Added Vimeo playback speed
This commit is contained in:
parent
0068710740
commit
f8ecea8fb7
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
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
import utils from './../utils';
|
import utils from './../utils';
|
||||||
import captions from './../captions';
|
import captions from './../captions';
|
||||||
|
import controls from './../controls';
|
||||||
import ui from './../ui';
|
import ui from './../ui';
|
||||||
|
|
||||||
const vimeo = {
|
const vimeo = {
|
||||||
@ -51,6 +52,7 @@ const vimeo = {
|
|||||||
byline: false,
|
byline: false,
|
||||||
portrait: false,
|
portrait: false,
|
||||||
title: false,
|
title: false,
|
||||||
|
speed: true,
|
||||||
transparent: 0,
|
transparent: 0,
|
||||||
};
|
};
|
||||||
const params = utils.buildUrlParameters(options);
|
const params = utils.buildUrlParameters(options);
|
||||||
@ -112,12 +114,16 @@ const vimeo = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Playback speed
|
// Playback speed
|
||||||
// Not currently supported in Vimeo
|
let { playbackRate } = player.media;
|
||||||
Object.defineProperty(player.media, 'playbackRate', {
|
Object.defineProperty(player.media, 'playbackRate', {
|
||||||
get() {
|
get() {
|
||||||
return null;
|
return playbackRate;
|
||||||
|
},
|
||||||
|
set(input) {
|
||||||
|
playbackRate = input;
|
||||||
|
player.embed.setPlaybackRate(input);
|
||||||
|
utils.dispatchEvent.call(player, player.media, 'ratechange');
|
||||||
},
|
},
|
||||||
set() {},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Volume
|
// Volume
|
||||||
@ -155,6 +161,11 @@ const vimeo = {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Get available speeds
|
||||||
|
if (player.config.controls.includes('settings') && player.config.settings.includes('speed')) {
|
||||||
|
controls.setSpeedMenu.call(player);
|
||||||
|
}
|
||||||
|
|
||||||
// Get title
|
// Get title
|
||||||
player.embed.getVideoTitle().then(title => {
|
player.embed.getVideoTitle().then(title => {
|
||||||
player.config.title = title;
|
player.config.title = title;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user