Fix subtitle switching is broken when using SSTextTrackDescription #114
Open
Fix subtitle switching is broken when using SSTextTrackDescription #114
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
There is a couple issues where when using
SSTextTrackDescriptionandautomaticTimestampSyncEnabledbeing false, subtitle switching ends up being stuck on the first loaded subtitleThe issue mainly is in the SubtitleTransformer using the same URL for both subtitles so we run into cache issues when switching.
The reason why it does not reproduce with TextTrackDescription is because:
The cast above fails for TextTrackDescription and no transformer is used (we go into the if block). However, for
SSTextTrackDescriptionthe variableautosyncends up being false (the default value) and notnil, and therefore goes into the transformation block, and the transformer cache problem above starts showing.The fix for the latter issue is to test against
true(autosync != true) which handles the case when it isnildue to a failed cast but also guards against it being false in the case ofSSTextTrackDescriptionThe fix for the main issue is to set the subtitle url as a query parameter in the transformer url so we don’t run into sharing the same cache between different subtitle urls.