In Firefox, the updateend event is triggered for both removing from the buffer and adding to the buffer. To prevent our update end handler from executing on removals, we wait for segmentInfo to have a filled in buffered value before we continue processing.
* Added a media2.m3u8 file since that was the only variant that was missing and it just so happens that fixing selection meant media2 became very commonly selected in tests
* Rendition selection test for non-exact player dimensions
When we switch playlists in a live video, we have to find the right place in the new playlist to continue buffering. This is complicated because we can't guarantee the two variants are segmented at the same time positions or that the windows of time they represent are exactly in sync. Most of the time, they're pretty close to one another and we can use that fact to make better guesses at which segment to download when switching.
This PR adds back tracking of expired content in the playlist loader, which can then be used to estimate the seekable window for live playlists even before we've buffered any segments from them. This also allows seekable to be accurate even when the player has paused for a long time and all the segment timing information we gathered has gone out of date. To make rejoining or seeking in a live stream even more robust, we detect when a seek "misses" the live window and seek again to a safe position.
Make the default bandwidth estimate a bit less conservative. On bad connections, this may lead to slower startups but it can be overridden through options or by setting the bandwidth property early.
* Moved blacklisting to above the rendition selection line so that we don't try to select the rendition that was just blacklisted
* Playlist Loader now emits the playlist it was trying to load so that it can be blacklisted when initial load was unsuccessful
Media Source Extensions is very picky about the type of media data fed to it. If you stop passing video because you've switched to an audio-only rendition, for instance, MSE will stall until video data is provided. Since we don't have a good way of reconfiguring a Media Source once we've started adding SourceBuffers to it yet, filter out variant playlists that we know are incompatible with the current SourceBuffer configuration.
Separate out the source handler object from the HLS namespace. Now, videojs.Hls is an object that is used to organize exports from this library. The actual source handler prototype is now HlsHandler. Intended to be defensive about the backwards-compatibility concerns in https://github.com/videojs/video.js/pull/2814.
Fixes#430. If drainBuffer is called after updating is reset on the sourceBuffer but before updateend fires, a segment could be appended twice. Check to make sure a segment hasn't already been appended before proceeding with draining the buffer.
Buffered will not be present in segment info when a segment processing is aborted due to seeking. Make sure bufferedAdditions_ does not error or add incorrect timeline information to the segment in that case.
Media sources implicitly track expired time by retaining the mapping between presentation timestamp values and the media timeline in the buffer. That allows us to simplify a good deal of code by not tracking it ourselves. Finish updating tests to work against the new timeline start and end annotations on segments instead of the old PTS values. Remove metadata cue translation because that is now handled by contrib-media-sources. Update key fetching in HLSe to occur concurrently with the segment download. All tests are now passing.
If the old and new buffered ranges have a shared start or end point, that edge should not be interpreted as a new buffered boundary. Fix up a number of the tests. Some tests are still failing.
For #400. Flash doesn't currently fire "loadstart" in data generation mode. Triggering that event should probably happen in video.js itself but fire it once the source handler is selected to make things behave somewhat sanely for now.
When a browser could support HTML or Flash based playback modes, allow video.js's techOrder to have precedence. It's very handy to be able to override the mode selection for debugging purposes, for instance.
player.tech was renamed to player.tech_
the videojs.xhr must be replaced with sinon differently now since videojs.xhr holds onto a reference to window.XMLHttpRequest
If a codecs attribute is present on a variant stream, use it when adding a source buffer. Wait to create the source buffer until the variant playlist is downloaded and the media source is open.
All of the tests currently pass, except for those that relied on timestamp-based information. That logic should be migrated into videojs-contrib-media-sources and then the remaining skipped tests can be removed.
HLS has been converted to a source handler but if people are still using the old tech-based mechanism, don't break their player completely. Log a deprecation warning for now and we can remove it completely later.
We shouldn't abort() on the source buffer for every seek. The buffered region is no longer guaranteed to be contiguous, so take that into account when determining if the segment to be loaded needs to be updated. Allow media sources to handle duration updates internally, don't set the duration on every segment download. Doing so was actually causing the range removal algorithm to run when the final segment came in slightly below the duration advertised in the m3u8.
Remove lots of transmuxing-related test harness code and get more of the tests working. Discontinuities, seeking, and PTS-based duration are still unresolved and so those tests are still failing.
Start using a real video.js build now that mergeOptions() is working correctly in master. Begin fixing tests-- there are still a number of tests that are broken.
As preparation for building a tool to transform mp2t files into mp4s, create a javascript tool that parses an mp4 file. Remove the local qunit so that karma and direct qunit testing happens with the same version of the library. Force the tech to run during tests so that Safari doesn't use native HLS.
Bump up to a vjs 5 release candidate. Make the necessary changes to work with the updated APIs. Convert the project from a subclass of the Flash tech to a source handler.