Subtitles
To show subtitles you have two options:
- Use an HLS stream with embedded subtitles.
-
Use an HLS stream as
FPExternalMedia
and configure the URL to subtitles.
Using FPExternalMedia with VTT files
If you're 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]
)
info
Please note that subtitles only work with HLS streams. This also applies when using FPExternalMedia
.