This repository has been archived by the owner on Jan 29, 2019. It is now read-only.
Append video data at end of buffer in HTML mode for IE11 for safe quality switch #164
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.
Description
Some browsers (cough IE11 and Edge cough) have a more simple, though still spec compliant, implementation of MediaSourceExtensions compared to other browsers. The main issue with this simpler implementation is that MSE will drop data until the next key frame that comes after the time already sent to the decoder. What this means is you cannot append content that overlaps with the playhead (something videojs-contrib-hls relies on for faster mid-segment quality switching) without the risk of visual corruption since the frames needed to decode the new content at the playhead are dropped before being sent to the decoder.
REQUIRES THE FOLLOWING FOR FULL SUPPORT
videojs/mux.js#162
videojs/videojs-contrib-hls#1259
Specific Changes proposed
VirtualSourceBuffer
will now keep track of the timing information of the GOPs within the segments it appends to the media source buffer. It will inform the transmuxer before transmuxing each segment of a list of time values considered "safe" to append. This will prevent appended video data that overlaps with the playhead while also making sure data is aligned on GOP boundaries to make sure the decoder always has enough information to decode whats appended