diff options
author | Sam Potts <sam@potts.es> | 2019-04-25 12:01:15 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2019-04-25 12:01:15 +1000 |
commit | c3fd822857d1b573ce938c470af85603117b07af (patch) | |
tree | eda98ad2c0b646bad27b02394a864aafaf20a7d5 | |
parent | e147f3a754765a8d21899751e8e8cf283929abfd (diff) | |
download | plyr-c3fd822857d1b573ce938c470af85603117b07af.tar.lz plyr-c3fd822857d1b573ce938c470af85603117b07af.tar.xz plyr-c3fd822857d1b573ce938c470af85603117b07af.zip |
Notes on autoplay support
-rw-r--r-- | readme.md | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -275,7 +275,7 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke | `iconUrl` | String | `null` | Specify a URL or path to the SVG sprite. See the [SVG section](#svg) for more info. | | `iconPrefix` | String | `plyr` | Specify the id prefix for the icons used in the default controls (e.g. "plyr-play" would be "plyr"). This is to prevent clashes if you're using your own SVG sprite but with the default controls. Most people can ignore this option. | | `blankVideo` | String | `https://cdn.plyr.io/static/blank.mp4` | Specify a URL or path to a blank video file used to properly cancel network requests. | -| `autoplay` | Boolean | `false` | Autoplay the media on load. This is generally advised against on UX grounds. It is also disabled by default in some browsers. If the `autoplay` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true. | +| `autoplay`² | Boolean | `false` | Autoplay the media on load. If the `autoplay` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true. | | `autopause`¹ | Boolean | `true` | Only allow one player playing at once. | | `seekTime` | Number | `10` | The time, in seconds, to seek when a user hits fast forward or rewind. | | `volume` | Number | `1` | A number, between 0 and 1, representing the initial volume of the player. | @@ -305,6 +305,11 @@ Note the single quotes encapsulating the JSON and double quotes on the object ke | `previewThumbnails` | Object | `{ enabled: false, src: '' }` | `enabled`: Whether to enable the preview thumbnails (they must be generated by you). `src` must be either a string or an array of strings representing URLs for the VTT files containing the image URL(s). Learn more about [preview thumbnails](#preview-thumbnails) below. | 1. Vimeo only +2. Autoplay is generally not recommended as it is seen as a negative user experience. It is also disabled in many browsers. Before raising issues, do your homework. More info can be found here: + +- https://webkit.org/blog/6784/new-video-policies-for-ios/ +- https://developers.google.com/web/updates/2017/09/autoplay-policy-changes +- https://hacks.mozilla.org/2019/02/firefox-66-to-block-automatically-playing-audible-video-and-audio/ # API @@ -406,6 +411,7 @@ player.fullscreen.active; // false; | `fullscreen.enabled` | ✓ | - | Returns a boolean indicating if the current player has fullscreen enabled. | | `pip`¹ | ✓ | ✓ | Gets or sets the picture-in-picture state of the player. The setter accepts a boolean. This currently only supported on Safari 10+ (on MacOS Sierra+ and iOS 10+) and Chrome 70+. | | `ratio` | ✓ | ✓ | Gets or sets the video aspect ratio. The setter accepts a string in the same format as the `ratio` option. | +| `download` | ✓ | ✓ | Gets or sets the URL for the download button. The setter accepts a string containing a valid absolute URL. | 1. HTML5 only |