Speed settings logic improvements
This commit is contained in:
@ -42,23 +42,28 @@ function assurePlaybackState(play) {
|
||||
|
||||
const vimeo = {
|
||||
setup() {
|
||||
const player = this;
|
||||
|
||||
// Add embed class for responsive
|
||||
toggleClass(this.elements.wrapper, this.config.classNames.embed, true);
|
||||
toggleClass(player.elements.wrapper, player.config.classNames.embed, true);
|
||||
|
||||
// Set speed options from config
|
||||
player.options.speed = player.config.speed.options;
|
||||
|
||||
// Set intial ratio
|
||||
setAspectRatio.call(this);
|
||||
setAspectRatio.call(player);
|
||||
|
||||
// Load the SDK if not already
|
||||
if (!is.object(window.Vimeo)) {
|
||||
loadScript(this.config.urls.vimeo.sdk)
|
||||
loadScript(player.config.urls.vimeo.sdk)
|
||||
.then(() => {
|
||||
vimeo.ready.call(this);
|
||||
vimeo.ready.call(player);
|
||||
})
|
||||
.catch(error => {
|
||||
this.debug.warn('Vimeo SDK (player.js) failed to load', error);
|
||||
player.debug.warn('Vimeo SDK (player.js) failed to load', error);
|
||||
});
|
||||
} else {
|
||||
vimeo.ready.call(this);
|
||||
vimeo.ready.call(player);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -297,7 +297,9 @@ const youtube = {
|
||||
});
|
||||
|
||||
// Get available speeds
|
||||
player.options.speed = instance.getAvailablePlaybackRates();
|
||||
const speeds = instance.getAvailablePlaybackRates();
|
||||
// Filter based on config
|
||||
player.options.speed = speeds.filter(s => player.config.speed.options.includes(s));
|
||||
|
||||
// Set the tabindex to avoid focus entering iframe
|
||||
if (player.supported.ui) {
|
||||
|
Reference in New Issue
Block a user