Safari 10 automatically dedupes duplicate class names in an element. So,
our test was failing because we had an extra "foo" in the check. This is
an unlikely scenario that has browser variations, so, better to just
remove it.
Calling into the SWF too often is expensive. Current time and buffered don't actually change that often but it's very common to call them a couple times in the handling of a single event. Cache their return values for 100ms so the performance penalty of going through ExternalInterface is limited.
The current implementation causes the `mergeOptions` function to be
de-optimized. This change improves readability by switching to ES6
syntax AND it results in a roughly 75% improvement in the performance
of this function by transpiling to a `for` loop instead of
`slice.call`.
This is because IE returns 0 for both getComputedStyle and currentStyle.
However, offsetHeight and offsetWidth do contain the correct values we
want. So, if before returning in currentDimension the return value is
still zero, check the offset values.
This is used internally in the seek bar and mouse time display.
In firefox, in an iframe that is hidden with "display: none",
getComputedStyle() returns "null" which can break things.
See https://bugzilla.mozilla.org/show_bug.cgi?id=548397 for more
details.
Adds `currentSource` and `currentSources` methods to the player that return the current source object, containing `currentSrc()` and `currentType()`, and all source objects that were given to the player.
Fixes#2443
enable() and disable() on clickable components is only cosmetic. "Disabled" implies the control should not be functional.
* Remove event listeners on disable() and add back on enable().
* Move adding listeners from constructor to enable
* Remove tabindex from disabled components and add disabled attribute to disabled buttons to prevent keyboard access.
HTML5 tech will return NaN instead of Infinity if playback has not started. Fires a durationupdate event once the reported duration can be believed if the duration is still Infinity, so controls can update.
Fixes#3079.
If a player is fluid and does not have a width set, and preload is set to none, the height of the player is zero. This includes where preload is forced to none by mobile Chrome as in #3606.
* If the player has the .vjs-fluid class when initialised, fluid is set to true, so adding the class behaves the same as {fluid: true} in the setup options.
* The fluid(bool) setter calls player.updateStyleEl_(). Otherwise it won't be triggered in createEl() if an aspect ratio is not also set.
* Corrects the test for a set videoWidth() in updateStyleEl_() - videoWidth() returns 0 if the width is unknown. This allows the default 16:9 to kick in rather than using 0:0.
Flash blocks until the javascript side of ExternalInterface callbacks complete and swallows any exceptions generated during that process. To avoid performance issues and missed exceptions, trigger events from Flash asynchronously.
5.12.6's changelog accidentally included all the 5.12.x changes and the
link to the comparison was from 5.10.7 to 5.12.6.
The comparison link in 5.12.3 was also updated to properly refer to
5.12.2 as the previous change.
This involves updating to latest version of uglify and setting
"screwIE8" to false since that is a default in 2.7. However, this makes
"preserveComments" "some" work as it is supposed to work.
Fixes#3707. This also comes from the stable branch after the 5.11.9
release.
If you try and require videojs in an environment that doesn't implement `document.createElement` properly -- like in Node.js -- you could potentially get an error. This checks that `window.document && window.document.createElement` is available before calling `createElement`.
We specifically check `window.document` so that `global` module won't cause issues with it's shimming of `document.createElement` in `global/document.
Fixes#3665
`Tech.withSourceHandlers(Html5);` expects the prototype getter/setters to exist. Moving these functions after the getters/setters allows them to function properly.
A possessive belonging to an "it" doesn't need an apostrophe. Don't believe me? Ask [the Oatmeal](http://theoatmeal.com/comics/apostrophe) (look for the velociraptor)!
In browsers like IE9, `console` isn't always available. This, we need to apply `console` to our console functions but bail out early if `window.console` isn't defined.
There was a potential breakage that was caused by #3349. This restores the timeupdate and loadedmetadata listeners in the duration display that were removed. As part of 6.0, they could be removed as durationchange should be the correct and only listener we need.
iOS still doesn't have native fullscreen API access. The video element uses the old webkit fullscreen events `webkitbeginfullscreen` and `webkitendfullscreen`. This makes it so both of those trigger `fullscreenchange` on the player always as opposed to only when `requestFullscreen` was called on the player.
Some of the code in the html5 tech is a bit redundant and can be written another way to reduce the file size. Also, we made sure that all functions can still be documented properly.
* Disable HLS hack on Firefox for Android
* Fix canPlayType patching tests
* Add test to ensure that canPlayType is not patched in Firefox for Android
* Fix assertion message in Firefox for Android test
The control text element was being counted as the first buffered region but it didn't have the correct styling to be shown.
Instead, we keep the buffered region elements in a separate element rather than relying on el.children to be correct.