question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A default text track in language X is preferred over a forced text track in language Y when audio language Y is selected

See original GitHub issue

When filing a question:

  1. What is the default behavior for forced-subtitle text tracks in exo-player, if no text track is selected then is it expected that the forced-subtitle track, appropriate for that particular audio track will be selected?
  2. At present with the demo application, I am able to see repeated text tracks (As mentioned in Issue #9432), and selecting None doesn’t select the appropriate forced-subtitle track but it disables the renderer altogether?

I have shared a sample .mpd file in the mail.

cc @vinodkputta @LuGO0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
icbakercommented, Dec 21, 2021

I added a comment to #9432 about whether the UI should expose that a forced track is selected at all.

While looking into this issue I also spotted what I think is a bug in DefaultTrackSelector when the content has both default and forced tracks in a variety of languages. Something like:

audio:
  english
  german
text:
  english, default
  english, forced
  german, forced

Current behaviour:

  • When the english audio track is selected the default english text track is selected.
    • It’s unclear to me whether this is expected vs selecting the forced text track.
  • When the german audio track is selected the default english text track is still selected.
    • This seems unexpected, because the user has expressed a preference for german audio and no overriding preference for subtitle language, so we should select the ‘accompanying’ forced german text track.

I have a pending change which changes this behaviour to:

  • When the english audio track is selected the forced english text track is selected.
    • As above, it’s unclear if this is expected vs selecting the default text track.
  • When the german audio track is selected the forced german text track is selected.
    • This seems more expected to me.

I’m going to re-open this issue and use it to track making this change.

1reaction
icbakercommented, Dec 20, 2021

I just played around some more, and I think my second bullet was incorrect - I’ve removed it now. The best way to get ‘automatic’ behaviour is just to start playback from scratch. The two track selectors in the demo app interact in quite a confusing way.

I observe:

  • Selecting a specific track or ‘None’ (i.e. not ‘Auto’) in the top (demo-app only) selector will cause the same track to be selected in the bottom (StyledPlayerView) selector (providing the StyledPlayerView selector is not already set to ‘None’).
    • However in this state it’s impossible to select a different specific track from the StyledPlayerView selector (tapping them has no effect, the ‘old’ track remains selected).
    • Selecting ‘None’ in the StyledPlayerView selector does work (subtitles disappear) - however the ‘top’ selector still shows the ‘old’ selection.
      • In this state (e.g. top=French, StyledPlayerView=None) then selecting any specific track in the StyledPlayerView will re-enable the top-selected track (i.e. French).
  • Selecting ‘Auto’ in the top selector will re-select whatever track was selected by StyledPlayerView before. i.e. the following steps will have the following result:
    • Start playback of the bipbop 16x9 stream. English subtitles are shown. Tops selector says ‘Auto’, StyledPlayerView says ‘English’)
    • Select ‘French’ in StyledPlayerView. French subtitles are shown. Top selector still says ‘Auto’.
    • Select ‘Spanish’ in top selector. Spanish subtitles are shown. StyledPlayerView selector now says ‘Spanish’.
    • Select ‘Auto’ in top selector. French subtitles are shown. StyledPlayerView selector says ‘French’.

I think these are all UI problems resulting from having two different text track selectors in the demo app - with one intended to be a ‘real’ track selector that you might show to end users, while the other is a deliberately ‘advanced’ one that shows all available tracks, even if an end-user should never specifically select them. I don’t think any of this indicates a problem with the underlying track selection logic (which of course is mostly unrelated to the UI components: https://exoplayer.dev/track-selection.html).

Read more comments on GitHub >

github_iconTop Results From Across the Web

The Embed Text Track element - HTML - MDN Web Docs
It lets you specify timed text tracks (or time-based data), for example to automatically handle subtitles. The tracks are formatted in WebVTT ...
Read more >
4.8.8 The video element - HTML Standard - WhatWG
The track element allows authors to specify explicit external timed text tracks for media elements. It does not represent anything on its own....
Read more >
Nikse - Subtitle Edit - Help/FAQ
Translating Subtitle Edit to another language ... List view is the default. ... You can edit text and time codes here, delete and...
Read more >
mkvmerge -- Merge multimedia streams into a Matroska file
Sets the default language code that will be used for tracks for which no ... mkvmerge(1) requires a video or an audio track...
Read more >
TextView - Android Developers
A user interface element that displays text to the user. ... layout direction of this view is from deduced from the default language...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found