aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins/vimeo.js
diff options
context:
space:
mode:
authorSam Potts <me@sampotts.me>2017-11-20 10:48:28 +1100
committerSam Potts <me@sampotts.me>2017-11-20 10:48:28 +1100
commitfeae00224e90c42228fb76e5b3d3075ab0532b3b (patch)
tree157763d5eebfa84e2cc89fb1cc01fde042ff940f /src/js/plugins/vimeo.js
parentdc391c98c6c77479b994dbe7ee00093e1684eea4 (diff)
downloadplyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.tar.lz
plyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.tar.xz
plyr-feae00224e90c42228fb76e5b3d3075ab0532b3b.zip
Added ended and playing getters
Diffstat (limited to 'src/js/plugins/vimeo.js')
-rw-r--r--src/js/plugins/vimeo.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js
index f033a969..50c49748 100644
--- a/src/js/plugins/vimeo.js
+++ b/src/js/plugins/vimeo.js
@@ -190,6 +190,13 @@ const vimeo = {
},
});
+ // Ended
+ Object.defineProperty(player.media, 'ended', {
+ get() {
+ return player.currentTime === player.duration;
+ },
+ });
+
// Set aspect ratio based on video size
Promise.all([player.embed.getVideoWidth(), player.embed.getVideoHeight()]).then(dimensions => {
const ratio = utils.getAspectRatio(dimensions[0], dimensions[1]);