diff options
author | Sam Potts <sam@potts.es> | 2018-04-02 22:40:03 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-04-02 22:40:03 +1000 |
commit | 3395e8df903cdd63e227a377b4b3be77da682aa8 (patch) | |
tree | 41821293f126cccdd5089aa7cf64a12b14ecb37a /src/js/media.js | |
parent | cce143a7da5f47e8cffa9a255239288387efe193 (diff) | |
download | plyr-3395e8df903cdd63e227a377b4b3be77da682aa8.tar.lz plyr-3395e8df903cdd63e227a377b4b3be77da682aa8.tar.xz plyr-3395e8df903cdd63e227a377b4b3be77da682aa8.zip |
HTML5 quality selection
Diffstat (limited to 'src/js/media.js')
-rw-r--r-- | src/js/media.js | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/src/js/media.js b/src/js/media.js index 3a97a9d9..bba2c62b 100644 --- a/src/js/media.js +++ b/src/js/media.js @@ -6,6 +6,7 @@ import support from './support'; import utils from './utils'; import youtube from './plugins/youtube'; import vimeo from './plugins/vimeo'; +import html5 from './html5'; import ui from './ui'; // Sniff out the browser @@ -75,31 +76,9 @@ const media = { } } else if (this.isHTML5) { ui.setTitle.call(this); - } - }, - // Cancel current network requests - // See https://github.com/sampotts/plyr/issues/174 - cancelRequests() { - if (!this.isHTML5) { - return; + html5.extend.call(this); } - - // Remove child sources - utils.removeElement(this.media.querySelectorAll('source')); - - // Set blank video src attribute - // This is to prevent a MEDIA_ERR_SRC_NOT_SUPPORTED error - // Info: http://stackoverflow.com/questions/32231579/how-to-properly-dispose-of-an-html5-video-and-close-socket-or-connection - this.media.setAttribute('src', this.config.blankVideo); - - // Load the new empty source - // This will cancel existing requests - // See https://github.com/sampotts/plyr/issues/174 - this.media.load(); - - // Debugging - this.debug.log('Cancelled network requests'); }, }; |