Skip to main content
Skip table of contents

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.

JAVA
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);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.