Provide a preferred language for audio/subtitle tracks
To override the default behaviour for audio/subtitle track selection, a preferred language can be provided via an IETF BCP 47 tag through the OTVPlayerConfiguration.setPreferredAudioLanguage()
and OTVPlayerConfiguration.setPreferredTextLanguage()
APIs.
private final OTVPlayerConfiguration trackSelectionConfiguration =
new OTVPlayerConfiguration.Builder()
.setPreferredTextLanguage(PREFERRED_LANGUAGE)
.setPreferredAudioLanguage(PREFERRED_LANGUAGE)
.build(); //Build the player configuration and pass it to OTVVideoView
// Here videoView is the instance of OTVVideoView.
videoView.setPlayerConfiguration(trackSelectionConfiguration);