Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subtitle buffered check #4863

Merged
merged 1 commit into from
Aug 27, 2022
Merged

Conversation

robwalch
Copy link
Collaborator

@robwalch robwalch commented Aug 26, 2022

This PR will...

Fix an issue where BufferHelper.bufferInfo throws when it is passed an array of TimeRange objects from the subtitle-stream-controller.

Why is this Pull Request needed?

BufferHelper.bufferInfo and getBuffered expect an HTMLMediaElement or SourceBuffer (or something implementing the Bufferable interface) and not an array of TimeRanges, which subtitle-stream-controller was setting on mediaBuffer.

The stronger typing on media, mediaBuffer, and videoBuffer informed all of the changes in this PR, which will prevent exceptions when checking if subtitles are buffered while seeking or when the player is detached in certain event loops.

While the exception in BufferHelper.bufferInfo is caught, it can be reproduced by enabling "Pause on caught exceptions" and seeking outside the buffered range on any HLS stream with an active subtitle track and playlist. A result is that without an accurate reading on the buffered range for sub, active requests would not be aborted when seeking to prioritize newer requests like they are for audio and video.

Checklist

  • changes have been done against master branch, and PR does not conflict

@robwalch robwalch added this to the 1.2.2 milestone Aug 26, 2022
@robwalch robwalch merged commit 9859211 into master Aug 27, 2022
@robwalch robwalch deleted the bugfix/subtitle-buffered-check branch August 27, 2022 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant