fix: switching between 'subtitles' and 'captions' text tracks is broken #6008
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes a regression introduced in v7.4.3. The addition of this code made it so that, when turning on captions, other text tracks are only disabled if they are of the same
kind
as the one being selected. This resulted in broken behavior when switching between asubtitles
track and acaptions
track or vice-versa.Specific Changes proposed
"Subtitle" tracks should be disabled if another "caption" track is enabled, and vice-versa (in other words, they should be considered the same when enabling/disabling tracks). There is existing infrastructure that stores the appropriate text track
kinds_
orkind_
for a given instance ofTextTrackButton
, each of which creates a list ofTextTrackMenuItem
instances. We can pass that information on to each instance ofTextTrackMenuItem
where it can be stored as a property and used to aid in text track enabling/disabling decisions.Requirements Checklist