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.
This PR will...
Fix an issue where
BufferHelper.bufferInfo
throws when it is passed an array ofTimeRange
objects from the subtitle-stream-controller.Why is this Pull Request needed?
BufferHelper.bufferInfo
andgetBuffered
expect anHTMLMediaElement
orSourceBuffer
(or something implementing theBufferable
interface) and not an array of TimeRanges, which subtitle-stream-controller was setting onmediaBuffer
.The stronger typing on
media
,mediaBuffer
, andvideoBuffer
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