1
0
mirror of https://github.com/videojs/video.js.git synced 2025-12-01 23:13:02 +02:00

feat: add 'autoSetup' option (#5123)

this must be set globally with videojs.options.autoSetup = false in the same tick as videojs source is loaded to take effect

fixes #5094
This commit is contained in:
axten
2018-05-11 19:53:46 +02:00
committed by Gary Katsevman
parent c6617b24f7
commit d44682849e
2 changed files with 12 additions and 2 deletions

View File

@@ -19,6 +19,7 @@
* [width](#width)
* [Video.js-specific Options](#videojs-specific-options)
* [aspectRatio](#aspectratio)
* [autoSetup](#autosetup)
* [children](#children)
* [fluid](#fluid)
* [inactivityTimeout](#inactivitytimeout)
@@ -130,6 +131,15 @@ Each option is `undefined` by default unless otherwise specified.
Puts the player in [fluid](#fluid) mode and the value is used when calculating the dynamic size of the player. The value should represent a ratio - two numbers separated by a colon (e.g. `"16:9"` or `"4:3"`).
### `autoSetup`
> Type: `boolean`
Prevents the player from running the autoSetup for media elements with `data-setup` attribute.
> **Note**: this must be set globally with `videojs.options.autoSetup = false` in the same tick as videojs source is loaded to take effect.
### `children`
> Type: `Array|Object`

View File

@@ -17,8 +17,8 @@ let videojs;
*/
const autoSetup = function() {
// Protect against breakage in non-browser environments.
if (!Dom.isReal()) {
// Protect against breakage in non-browser environments and check global autoSetup option.
if (!Dom.isReal() || videojs.options.autoSetup === false) {
return;
}