* fix: have reloadSourceOnError get src from player
Previously, we were getting the source from tech.currentSource_. This
only gets set when a source handler like VHS is used. However, because
VHS is in Video.js by default and the plugin is global, some people are
using this plugin for other sources as well.
There isn't a reason why we should be relying on tech.currentSource_
over player.currentSource() when we have access to the player in the
plugin.
Fixesvideojs/video.js#6744
Introduces a new config option BACK_BUFFER_LENGTH that defaults to 30,
the previous value.
When set, we trim the back buffer according to the provided value.
Deprecate lingering references to hls from the old videojs-contrib-hls
project, as well as dash. Ensure all references use `tech().vhs` instead.
Co-authored-by: Garrett Singer <gesinger@gmail.com>
Co-authored-by: Gary Katsevman <git@gkatsev.com>
Do a check for videojs.browser.IS_ANY_SAFARI and use that for overrideNative so that we use VHS playback on any non-safari browser.
Co-authored-by: ipadilla4 <ipadilla@brightcove.com>
Co-authored-by: Garrett Singer <gesinger@gmail.com>
This change adds two new events to `SegmentLoader`. The first `appendsdone` is fired whenever an append is complete on any main, audio, or subtitle loader. The second `playlistupdate` is fired whenever a playlist is changed on the segment loader.
Using these new events `PlaybackWatcher` watches for the `SegmentLoaders` `buffered_()` function to return a different buffered time range after each append. If it finds that we are not changing the buffered time range after three appends it will exclude the playlist or disable and remove the text track causing the issue.
Finally `PlaybackWatcher` will reset the buffered change counter whenever `playlistupdate` is fired on the `SegmentLoader` or when `seeking`/`seeked` fire on the `Tech`.
- fix: only save timeline mappings for main loader
Timeline mappings should only be saved for the main loader. This is for multiple
reasons:
1) Only one mapping is saved per timeline, meaning that if both the audio loader
and the main loader try to save the timeline mapping, whichever comes later
will overwrite the first. In theory this is OK, as the mappings should be the
same, however, it breaks for (2)
2) In the event of a live stream, the initial live point will make for a somewhat
arbitrary mapping. If audio and video streams are not perfectly in-sync, then
the mapping will be off for one of the streams, dependent on which one was
first saved (see (1)).
3) Primary timing goes by video in VHS, so the mapping should be video.
Since the audio loader will wait for the main loader to load the first segment,
the main loader will save the first timeline mapping, and ensure that there won't
be a case where audio loads two segments without saving a mapping (thus leading
to missing segment timing info).
- Add playback watcher check to correct cases where seek point ends up just before content.
If audio and video streams are not perfectly aligned, a seek can result in the buffer
starting just after the seek position. In that event, playback watcher should seek into
the buffered contents to resume playback.
This pull request updates dash-playlist-loader to use a partial request before we would use sidx. This partial requests downloads as much data as needed to get the container type and ends. If the sidx segment is not mp4 it will be blacklisted. If it is mp4 sidx bytes will be passed along if they were downloaded. Otherwise we will do another request for sidx bytes.
It's hard to find where loader stats methods are created because we do
it dynamically.
Add a comment with the full name of the loader stats methods so that
they can be searched directly.