diff options
author | Sam Potts <me@sampotts.me> | 2017-11-05 11:45:02 +1100 |
---|---|---|
committer | Sam Potts <me@sampotts.me> | 2017-11-05 11:45:02 +1100 |
commit | 1c693df00b44961674a35243f5172716a3735b71 (patch) | |
tree | 2df8dd8d252d1f80688cd3a3549de7374dca676c /src/js/plugins | |
parent | 8aaa9320505baec3575bc1e92f37225729ee88f6 (diff) | |
download | plyr-1c693df00b44961674a35243f5172716a3735b71.tar.lz plyr-1c693df00b44961674a35243f5172716a3735b71.tar.xz plyr-1c693df00b44961674a35243f5172716a3735b71.zip |
src getter fix, local storage fix
Diffstat (limited to 'src/js/plugins')
-rw-r--r-- | src/js/plugins/vimeo.js | 13 | ||||
-rw-r--r-- | src/js/plugins/youtube.js | 7 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/js/plugins/vimeo.js b/src/js/plugins/vimeo.js index f75b16aa..b9cc92c2 100644 --- a/src/js/plugins/vimeo.js +++ b/src/js/plugins/vimeo.js @@ -126,6 +126,19 @@ const vimeo = { }, }); + // 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); diff --git a/src/js/plugins/youtube.js b/src/js/plugins/youtube.js index 2b4c2cdc..12e9d3e6 100644 --- a/src/js/plugins/youtube.js +++ b/src/js/plugins/youtube.js @@ -155,6 +155,13 @@ const youtube = { }, }); + // Source + Object.defineProperty(player.media, 'currentSrc', { + get() { + return instance.getVideoUrl(); + }, + }); + // Get available speeds if (player.config.controls.includes('settings') && player.config.settings.includes('speed')) { controls.setSpeedMenu.call(player, instance.getAvailablePlaybackRates()); |