On native playback engines, like Safari, for some streams, seekable and
currentTime won't have correct values until video data has started
loading. Previously, we only tried to turn toggle tracking on
durationchange, now we also do it on canplay.
This is a followup to #7034 which helped prevent the live tracker from
showing up in some cases.
Adds a debug build to video.js that does the following:
- Exposes DomData on video.js. DomData our internal event tracking object and should be empty on player dispose.
- Set log level to debug by default.
The progress control is updated inside of requestAnimationFrames (rAFs). Normally, this is fine. However, when a tab is hidden, rAFs are generally not triggered. So, what happens is that we get a cached rAF from the last time the tab was active. When we come back to be active, we update again, but because we already have a named rAF, we don't clear it out and instead that one gets triggered. This isn't an issue if the video is still playing, because in a second, another rAF will be triggered which will update things. However, if the video has ended, we won't get any more updated and the progress bar will still be in the old position.
Instead, when the document becomes hidden, we should clear out both the SeekBar#update and the Slider#update rAFs. Doing just one, unfortunately, isn't enough. In addition, we also only re-enable the interval if we aren't ended or paused and ignore the update method if the tab is hidden.
Fixes#7086
Since we switched to using adding up offsets to calculate the pointer position relative to the current element, we've had some issues, particularly on iOS, where a translated parent would cause us to miscalculate the position. This is currently a quickfix for the issue, and I'd like to spend some time to figure out a better solution that hopefully won't require us to iterate through the DOM and add up the transform matrix.
On iPads, if the player is inside a floating div, when fullscreen, we'll have an incorrect offset value. Instead, we should stop counting our offsets once we get to our fullscreen element (i.e. the player) because in fullscreen it's outside the regular flow, and we don't actually want to add offset the float gives us inline.
Follow up from #6982. We previously threw an error, but we've seen it
happen unexpectedly. Instead, we should log an error.
We will still throw an error if the event is undefined or null.
Here, if we have a `log` object on the current object, we should use it,
otherwise, we use a default `log` object.
Using Video.js's .bind still makes us attach prototype methods as
handlers. Then when one is removed, all handlers are removed.
Instead, use arrow methods to make these methods unique.
Fixes#7013.
Fixes an issue in native Safari and Android HLS playback where liveCurrentTime returns Infinity (as we don't have a seekableEnd or seekableEnd is actually Infinity). Which causes the new live ui to show up when we don't really have a live window.
Instead of returning Infinity when liveCurrentTime is Infinity, return 0. So that everything knows that we do not have a seekable window of live playback.
People keep finding the v4 legacy docs at docs.videojs.com/docs and Google keeps positioning them highly in search results. This attempts to lessen that.
The video dimensions aren't necessarily known at loadedmetadata particularly with native playback on iOS. In fluid mode, the player defaults to 16:9 and does not update once the dimensions are known.
- Updates player styles on resize events.
- Fixes arguments passed to addEventedCallback so the callbacks are executed.
Fixes#6939
This fixes an issue with requirejs where global/window and
global/document were being marked as dependencies. Instead, this makes
sure that the module gets inlines properly and not worked as a dep for
requirejs.
Fixes#6443, #6272, #6212, #5680.
This needs to be cast before exporting so users
can confidently pass it into their videojs config
and not worry about videojs internals doing strict
equality checks against true/false.
Co-authored-by: Kevin Kipp <kkipp@cloudflare.com>
Allows the editing of a track's label after its creation. Menu buttons will listen for the labelchange event and update their content accordingly.
This is technically divergent from the spec, which says it's readonly, but it can be useful for Video.js users.
Co-authored-by: Claudia Hinkle <chinkle@chinkle-mn1.linkedin.biz>
Skipping the tabIndex property on created elements due to #6145
optimizations blocks them from receiving keyboard events, due to not
being focusable; for example this breaks closing ModalDialog elements by
pressing Escape.
Fix this by always setting tabIndex, as the element may return the same
value even though the property has not been explicitly set.
Fixes#6870