Tracks Selection Mode

This document describes how to use track selection modes in the player.

Note: Track selection modes are available for audio and text tracks only!

Available Modes and Behavior

There are three available track selection modes:

  • Off - Off, which is the default mode, means different things for text selection and audio selection: for audio selection, Off means the player will use the default value from the media. For text, the player will simply turn text selection off.
  • Auto - In this mode, the player selects the language by the device locale if available; if not, it takes the default selection from the stream instead (if there is one).
  • Selection - This mode uses a specific selection, where you’ll need to provide the specific selection you’d like to use.

Text Track Selection

swift

player.settings.trackSelection.textSelectionMode = // .off/.auto/.selection
// use text selection language when using '.selection' mode.
player.settings.trackSelection.textSelectionLanguage = // en/fr...

objc

player.settings.trackSelection.textSelectionMode = // TrackSelectionModeOff/TrackSelectionModeAuto/TrackSelectionModeSelection
// use text selection language when using 'TrackSelectionModeSelection' mode.
player.settings.trackSelection.textSelectionLanguage = // en/fr...

Audio Track Selection

swift

player.settings.trackSelection.audioSelectionMode = // .off/.auto/.selection
// use text selection language when using '.selection' mode.
player.settings.trackSelection.audioSelectionLanguage = // en/fr...

objc

player.settings.trackSelection.audioSelectionMode = // TrackSelectionModeOff/TrackSelectionModeAuto/TrackSelectionModeSelection
// use text selection language when using 'TrackSelectionModeSelection' mode.
player.settings.trackSelection.audioSelectionLanguage = // en/fr...

Code Samples

Go to PlayKit iOS Samples for code samples.

Have Questions or Need Help?

Check out the Kaltura Player SDK Forum page for different ways of getting in touch.