Learn how to detect, switch, and render subtitle tracks in the FastPix iOS Player.
The FastPix iOS Player SDK supports WebVTT-based subtitle tracks. It automatically parses the HLS manifest, fetches subtitle segments, and delivers cues in sync with playback. Your app is responsible for rendering the subtitle text in the UI.
Set a preferred subtitle track by language name. The SDK automatically selects it when the video loads.
The preferred track is automatically applied on every playlist item change.
The SDK delivers subtitle text in real time through the onSubtitleCueChange callback. Create a label to display the text:
Position the label above the seek bar inside playerViewController.view:
Conform to FastPixSubtitleTrackDelegate to receive subtitle updates:
Important:
- Subtitle rendering is the host app’s responsibility. The SDK delivers cue text only.
- Call
disableSubtitles()when switching playlist items to prevent stale cues from appearing on videos without subtitles.- Add the subtitle label to
playerViewController.view, notself.view, to ensure correct positioning across orientations and full-screen transitions.