Tracks and languages ******************** Audio and text track/language selection for PRESTOplay for Web Apps. Code samples: * Audio and subtitle tracks (https://raw.githubusercontent.com/castlabs/prestoplay-web-code-samples/refs/heads/main/examples/tracks/tracks.js): initial languages with fallbacks, then listing and switching audio, subtitle, and video tracks. Initial language selection ========================== Set the initial audio and text tracks by language. Setting "preferredTextLanguage" also enables subtitles for the session: player.open({ source: 'https://example.com/manifest.mpd', preferredAudioLanguage: 'en', preferredTextLanguage: 'fr', }); Pass an array to define fallback languages. The player selects the first language in the list that is available: player.open({ source: 'https://example.com/manifest.mpd', preferredAudioLanguage: ['fr', 'en'], preferredTextLanguage: ['fr', 'en'], }); Switching tracks during playback ================================ To list or switch audio, text, and video tracks after playback starts, use "Player.getTrackManager" (https://players.castlabs.com/web/latest/docs/api/clpp.Player.md#getTrackManager) to access the "TrackManager" (https://players.castlabs.com/web/latest/docs/api/clpp.TrackManager.md).