Closed alex-barstow closed 4 days ago
Attention: Patch coverage is 94.44444%
with 3 lines
in your changes missing coverage. Please review.
Please upload report for BASE (
main@9f1c4ad
). Learn more about missing BASE report. Report is 1 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
src/playlist-controller.js | 93.02% | 3 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
Description
This PR fixes 2 issues:
Issue 1:
If you wait to start playback of a sliding window livestream, playback will not start from the live edge. This is because the seekable range does not update correctly on playlist refreshes before playback starts. For a sliding window livestream, here's an example of how the seekable range should update on playlist refreshes:
But before playback starts, what we get now is this:
So when playback starts, we seek to 1000 thinking it is the seekable end, but that puts us behind the true seekable end of 1010.
This happens because before we fetch the first segment, what we do now is calculate the seekable end as the duration of the segments in the playlist without updating the base start time when segments expire off the start of the playlist.
Solution:
Calculate the seekable start and end using
MediaSequenceSync
start
andend
times, which are already accurately updated whenever a new playlist is loaded. By using these values that are already available we can bypass all the complexity of the current calculations.Issue 2:
Occasionally, when switching renditions, playback will not continue from the same place in the stream but will jump way back. This is caused by a race condition-- it is possible to switch to a new media playlist that has a Media Sequence value less than the current Media Sequence value, which presumably can result from delays on the media server updating playlists across renditions.
Solution:
If we switch to a media playlist with an older/lower mediaSequence value, we now calculate the base time by extrapolating backwards from a known segment start time rather than falling back to the currentTime.
Requirements Checklist