diff options
author | Sam Potts <sam@potts.es> | 2018-05-06 00:49:12 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-05-06 00:49:12 +1000 |
commit | 9ebc2719d31e39b822eda42c2eb3272330e9fc5d (patch) | |
tree | 4f9c6d2eaea36caa689e9d852ce8e1490c631183 /src/js/media.js | |
parent | 5ca769807e773d6d6a884771ca8864e4db8c1376 (diff) | |
download | plyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.tar.lz plyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.tar.xz plyr-9ebc2719d31e39b822eda42c2eb3272330e9fc5d.zip |
v3.3.0
Diffstat (limited to 'src/js/media.js')
-rw-r--r-- | src/js/media.js | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/src/js/media.js b/src/js/media.js index bba2c62b..99fc5e85 100644 --- a/src/js/media.js +++ b/src/js/media.js @@ -2,15 +2,10 @@ // Plyr Media // ========================================================================== -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 -const browser = utils.getBrowser(); +import vimeo from './plugins/vimeo'; +import youtube from './plugins/youtube'; +import utils from './utils'; const media = { // Setup media @@ -33,23 +28,6 @@ const media = { utils.toggleClass(this.elements.container, this.config.classNames.type.replace('{0}', 'video'), true); } - if (this.supported.ui) { - // Check for picture-in-picture support - utils.toggleClass(this.elements.container, this.config.classNames.pip.supported, support.pip && this.isHTML5 && this.isVideo); - - // Check for airplay support - utils.toggleClass(this.elements.container, this.config.classNames.airplay.supported, support.airplay && this.isHTML5); - - // If there's no autoplay attribute, assume the video is stopped and add state class - utils.toggleClass(this.elements.container, this.config.classNames.stopped, this.config.autoplay); - - // Add iOS class - utils.toggleClass(this.elements.container, this.config.classNames.isIos, browser.isIos); - - // Add touch class - utils.toggleClass(this.elements.container, this.config.classNames.isTouch, this.touch); - } - // Inject the player wrapper if (this.isVideo) { // Create the wrapper div @@ -59,6 +37,13 @@ const media = { // Wrap the video in a container utils.wrap(this.media, this.elements.wrapper); + + // Faux poster container + this.elements.poster = utils.createElement('span', { + class: this.config.classNames.poster, + }); + + this.elements.wrapper.appendChild(this.elements.poster); } if (this.isEmbed) { @@ -75,8 +60,6 @@ const media = { break; } } else if (this.isHTML5) { - ui.setTitle.call(this); - html5.extend.call(this); } }, |