1
0
mirror of https://github.com/videojs/video.js.git synced 2025-12-18 00:17:28 +02:00

feat: Add normalizeAutoplay option to treat autoplay: true as autoplay: "play" (#7190)

This PR adds a new option to treat autoplay: true the same as autoplay: 'play'. In general we want video.js to handle as much of the autoplay logic itself as possible, since the browser's treatment of the video element's autoplay attribute is less predictable. For now the default option value is false, but it may be made the default behavior in a future major version.
This commit is contained in:
Alex Barstow
2021-06-08 11:03:51 -04:00
committed by GitHub
parent 35ad17a0ef
commit b4ad93a10e
4 changed files with 62 additions and 6 deletions

View File

@@ -31,6 +31,7 @@
* [liveTracker.trackingThreshold](#livetrackertrackingthreshold)
* [liveTracker.liveTolerance](#livetrackerlivetolerance)
* [nativeControlsForTouch](#nativecontrolsfortouch)
* [normalizeAutoplay](#normalizeautoplay)
* [notSupportedMessage](#notsupportedmessage)
* [noUITitleAttributes](#nouititleattributes)
* [fullscreen](#fullscreen)
@@ -294,6 +295,12 @@ An option for the liveTracker component of the player that controls how far from
Explicitly set a default value for [the associated tech option](#nativecontrolsfortouch).
### `normalizeAutoplay`
> Type: `boolean`
Specify whether setting `autoplay: true` and `<video autoplay>` should be treated the same as `autoplay: 'play'`, i.e. the `autoplay` attribute should be removed from (or not added to) the video element and `play()` be initiated manually by Video.js rather than the browser.
### `notSupportedMessage`
> Type: `string`