Added ended and playing getters

This commit is contained in:
Sam Potts
2017-11-20 10:48:28 +11:00
parent dc391c98c6
commit feae00224e
7 changed files with 34 additions and 9 deletions

View File

@ -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]);