Table of contents
In order to show subtitles you have three options:
- Use an HLS stream with embedded subtitles
- Use an HLS stream as
FPExternalMediaand configure the URL to subtitles
- Upload the VTT files to Flowplayer Platform and use
First you need to configure the player controls to use the
let config = FPPlayerControlConfigBuilder() .setMuteControl(true) .enablePlugins(["subtitles"]) .build() flowplayerViewController.setControlConfig(config)
Then you need to configure the player to use subtitles.
If you HLS stream contains subtitles all you need to do is to enable the subtitles plugin for the controls.
You can upload subtitles as VTT files for a video in the Flowplayer Platform UI from the "Files" view. The labels and languages configured will show up in the player.
If you are using
FPExternalMedia, you can configure the subtitles by hand:
let track = FPTrack( lang: "en", src: "https://mycdn.example.com/subs.vtt", label: "English subs", kind: "" ) let externalMedia = FPExternalMedia( mediaUrl: "https://mycdn.example.com/video.m3u8", adSchedule: nil, metadata: nil, subtitles: [track] )
Please note that subtitles only work with HLS streams, also when using