aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/vimeo.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-05 01:02:10 +1100
committerSam Potts <me@sampotts.me>2017-11-05 01:02:10 +1100
commit3930ebb339e750f6da8d6936f78d55215414b0f9 (patch)
tree10c4f154ee0238e7bae8ae646774c8185a4ce17c /src/js/plugins/vimeo.js
parent13d3037a53d846d100b10d421f266f268c592e40 (diff)
downloadplyr-3930ebb339e750f6da8d6936f78d55215414b0f9.tar.lz
plyr-3930ebb339e750f6da8d6936f78d55215414b0f9.tar.xz
plyr-3930ebb339e750f6da8d6936f78d55215414b0f9.zip
Menu design tweaks, moved logic into plugins
Diffstat (limited to 'src/js/plugins/vimeo.js')
-rw-r--r--src/js/plugins/vimeo.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js
index 7bcb2d01..8c7f2b04 100644
--- a/src/js/plugins/vimeo.js
+++ b/src/js/plugins/vimeo.js
@@ -77,9 +77,9 @@ const vimeo = {
player.media.paused = true;
player.media.currentTime = 0;
- let { currentTime } = player.media;
// Seeking
+ let { currentTime } = player.media;
Object.defineProperty(player.media, 'currentTime', {
get() {
return currentTime;
@@ -114,14 +114,34 @@ const vimeo = {
set() {},
});
+ // Volume
+ let { volume } = player.media;
+ Object.defineProperty(player.media, 'volume', {
+ get() {
+ return volume;
+ },
+ set(input) {
+ volume = input;
+ player.embed.setVolume(input);
+ utils.dispatchEvent.call(player, player.media, 'volumechange');
+ },
+ });
+
// Rebuild UI
window.setTimeout(() => ui.build.call(player), 0);
+ // Get title
+ player.embed.getVideoTitle().then(title => {
+ player.config.title = title;
+ });
+
+ // Get current time
player.embed.getCurrentTime().then(value => {
currentTime = value;
utils.dispatchEvent.call(this, this.media, 'timeupdate');
});
+ // Get duration
player.embed.getDuration().then(value => {
player.media.duration = value;
utils.dispatchEvent.call(player, player.media, 'durationchange');