shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

getVariantTracks() returns each track more times for DASH stream #170

Closed kareljuricka closed 3 years ago

kareljuricka commented 3 years ago

Calling method

getVariantTracks()

returns each of lang track more than once.

[ es, es, es, es, es,
  de, de, de, de, de,
  en, en, en, en, en,
  fr, fr, fr, fr, fr,
  it, it, it, it, it
]

instead of expected:

[ es, de, en, fr, it ]

Manifest: https://storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd

Same behaviour on HLS stream with useNativeHlsOnSafari = false configuration.

TheModMaker commented 3 years ago

This is expected behavior. This returns Variants (i.e. audio+video pairs). So since there are multiple resolutions, there will be multiple tracks for the same language. If you want to select the language and keep ABR auto-selecting the resolution, you should use audioLanguagesAndRoles and use selectAudioLanguage/selectAudioLanguage:withRole to change the selected language.

kareljuricka commented 3 years ago

Awesome! That's what I missed. Thanks!