diff options
author | Sam Potts <me@sampotts.me> | 2017-11-06 19:53:27 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2017-11-06 19:53:27 +1100 |
commit | 62c1b368cf254fdaba2612a308b6ce0a51ec853c (patch) | |
tree | 890ec6ff53bed17689305338bcd8d9df4bb911ce /src | |
parent | f8ecea8fb700059ee6eee7e5dd05d8ed772c0d12 (diff) | |
download | plyr-62c1b368cf254fdaba2612a308b6ce0a51ec853c.tar.lz plyr-62c1b368cf254fdaba2612a308b6ce0a51ec853c.tar.xz plyr-62c1b368cf254fdaba2612a308b6ce0a51ec853c.zip |
Cleanup
Diffstat (limited to 'src')
-rw-r--r-- | src/js/plugins/vimeo.js | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index 76846cf9..dce3af03 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -47,8 +47,8 @@ const vimeo = { // Get Vimeo params for the iframe const options = { - loop: this.config.loop.active, - autoplay: this.config.autoplay, + loop: player.config.loop.active, + autoplay: player.config.autoplay, byline: false, portrait: false, title: false, @@ -56,7 +56,7 @@ const vimeo = { transparent: 0, }; const params = utils.buildUrlParameters(options); - const id = utils.parseVimeoId(this.embedId); + const id = utils.parseVimeoId(player.embedId); // Build an iframe const iframe = utils.createElement('iframe'); @@ -66,7 +66,7 @@ const vimeo = { player.media.appendChild(iframe); // Setup instance - // https://github.com/vimeo/this.js + // https://github.com/vimeo/player.js player.embed = new window.Vimeo.Player(iframe); // Create a faux HTML5 API using the Vimeo API @@ -108,7 +108,7 @@ const vimeo = { // Restore pause state if (paused) { - this.pause(); + player.pause(); } }, }); @@ -174,7 +174,7 @@ const vimeo = { // Get current time player.embed.getCurrentTime().then(value => { currentTime = value; - utils.dispatchEvent.call(this, this.media, 'timeupdate'); + utils.dispatchEvent.call(player, player.media, 'timeupdate'); }); // Get duration @@ -220,31 +220,31 @@ const vimeo = { utils.dispatchEvent.call(player, player.media, 'pause'); }); - this.embed.on('timeupdate', data => { - this.media.seeking = false; + player.embed.on('timeupdate', data => { + player.media.seeking = false; currentTime = data.seconds; - utils.dispatchEvent.call(this, this.media, 'timeupdate'); + utils.dispatchEvent.call(player, player.media, 'timeupdate'); }); - this.embed.on('progress', data => { - this.media.buffered = data.percent; - utils.dispatchEvent.call(this, this.media, 'progress'); + player.embed.on('progress', data => { + player.media.buffered = data.percent; + utils.dispatchEvent.call(player, player.media, 'progress'); if (parseInt(data.percent, 10) === 1) { // Trigger event - utils.dispatchEvent.call(this, this.media, 'canplaythrough'); + utils.dispatchEvent.call(player, player.media, 'canplaythrough'); } }); - this.embed.on('seeked', () => { - this.media.seeking = false; - utils.dispatchEvent.call(this, this.media, 'seeked'); - utils.dispatchEvent.call(this, this.media, 'play'); + player.embed.on('seeked', () => { + player.media.seeking = false; + utils.dispatchEvent.call(player, player.media, 'seeked'); + utils.dispatchEvent.call(player, player.media, 'play'); }); - this.embed.on('ended', () => { - this.media.paused = true; - utils.dispatchEvent.call(this, this.media, 'ended'); + player.embed.on('ended', () => { + player.media.paused = true; + utils.dispatchEvent.call(player, player.media, 'ended'); }); // Rebuild UI |