fix(subtitles): Previously active subtitles won't show #7418
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.



Cause
In Chromium browsers the text track of the native player resets after each video/audio stream switch. Generally, the function prevents applying the same subtitles multiple times to the same track, but it fails to account for the scenario, where the active text tracks were reset. In this single case we should allow the reapplication of the same text track.
Changes
I've implemented a check to only return the function if the targeted track is truly active and the native text track wasn't reset.
Note
In Firefox based browsers this problem didn't occur, but my fix does not change the intended behavior there, rather implements a fail-safe.
Issues
Fixed #7417