aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/vimeo.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/plugins/vimeo.js')
-rw-r--r--src/js/plugins/vimeo.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js
index 81f96c9b..0b815fa5 100644
--- a/src/js/plugins/vimeo.js
+++ b/src/js/plugins/vimeo.js
@@ -126,22 +126,28 @@ const vimeo = {
},
});
+ // Muted
+ Object.defineProperty(player.media, 'muted', {
+ get() {
+ return volume === 0;
+ },
+ set(input) {
+ const toggle = utils.is.boolean(input) ? input : false;
+ player.volume = toggle ? 0 : player.config.volume;
+ },
+ });
+
// Source
let currentSrc;
-
player.embed.getVideoUrl().then(value => {
currentSrc = value;
});
-
Object.defineProperty(player.media, 'currentSrc', {
get() {
return currentSrc;
},
});
- // Rebuild UI
- window.setTimeout(() => ui.build.call(player), 0);
-
// Get title
player.embed.getVideoTitle().then(title => {
player.config.title = title;
@@ -222,6 +228,9 @@ const vimeo = {
this.media.paused = true;
utils.dispatchEvent.call(this, this.media, 'ended');
});
+
+ // Rebuild UI
+ window.setTimeout(() => ui.build.call(player), 0);
},
};