Vimeo autopause option
This commit is contained in:
parent
edfc6cd475
commit
f518ec108b
2
dist/plyr.js
vendored
2
dist/plyr.js
vendored
File diff suppressed because one or more lines are too long
2
dist/plyr.js.map
vendored
2
dist/plyr.js.map
vendored
File diff suppressed because one or more lines are too long
@ -230,6 +230,7 @@ Option | Type | Default | Description
|
|||||||
`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.
|
`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.
|
||||||
`blankUrl` | String | `https://cdn.plyr.io/static/blank.mp4` | Specify a URL or path to a blank video file used to properly cancel network requests.
|
`blankUrl` | 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. 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.
|
||||||
|
`autopause`¹ | Boolean | `false` | Only allow one player playing at once.
|
||||||
`seekTime` | Number | `10` | The time, in seconds, to seek when a user hits fast forward or rewind.
|
`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.
|
`volume` | Number | `1` | A number, between 0 and 1, representing the initial volume of the player.
|
||||||
`muted` | Boolean | `false` | Whether to start playback muted. If the `muted` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true.
|
`muted` | Boolean | `false` | Whether to start playback muted. If the `muted` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true.
|
||||||
@ -252,6 +253,8 @@ Option | Type | Default | Description
|
|||||||
`quality` | Object | `{ default: 'default', options: ['hd2160', 'hd1440', 'hd1080', 'hd720', 'large', 'medium', 'small', 'tiny', 'default'] }` | Currently only supported by YouTube. `default` is the default quality level, determined by YouTube. `options` are the options to display.
|
`quality` | Object | `{ default: 'default', options: ['hd2160', 'hd1440', 'hd1080', 'hd720', 'large', 'medium', 'small', 'tiny', 'default'] }` | Currently only supported by YouTube. `default` is the default quality level, determined by YouTube. `options` are the options to display.
|
||||||
`loop` | Object | `{ active: false }` | `active`: Whether to loop the current video. If the `loop` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true This is an object to support future functionality.
|
`loop` | Object | `{ active: false }` | `active`: Whether to loop the current video. If the `loop` attribute is present on a `<video>` or `<audio>` element, this will be automatically set to true This is an object to support future functionality.
|
||||||
|
|
||||||
|
1. Vimeo only
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
There are methods, setters and getters on a Plyr object.
|
There are methods, setters and getters on a Plyr object.
|
||||||
|
@ -12,6 +12,9 @@ const defaults = {
|
|||||||
// Auto play (if supported)
|
// Auto play (if supported)
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
|
|
||||||
|
// Only allow one media playing at once (vimeo only)
|
||||||
|
autopause: false,
|
||||||
|
|
||||||
// Default time to skip when rewind/fast forward
|
// Default time to skip when rewind/fast forward
|
||||||
seekTime: 10,
|
seekTime: 10,
|
||||||
|
|
||||||
|
@ -203,6 +203,11 @@ const vimeo = {
|
|||||||
vimeo.setAspectRatio.call(this, ratio);
|
vimeo.setAspectRatio.call(this, ratio);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Set autopause
|
||||||
|
player.embed.setAutopause(player.config.autopause).then(state => {
|
||||||
|
player.config.autopause = state;
|
||||||
|
});
|
||||||
|
|
||||||
// Get available speeds
|
// Get available speeds
|
||||||
if (player.config.controls.includes('settings') && player.config.settings.includes('speed')) {
|
if (player.config.controls.includes('settings') && player.config.settings.includes('speed')) {
|
||||||
controls.setSpeedMenu.call(player);
|
controls.setSpeedMenu.call(player);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user