diff options
author | Sam Potts <sam@potts.es> | 2018-05-08 22:22:43 +1000 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2018-05-08 22:22:43 +1000 |
commit | 34401de3d03e61eb7d1a04f6f0b7599e7ce9cd93 (patch) | |
tree | f8f46e1f38bdfb28d8ccc146a4d014ca1ca05a31 /src/js/media.js | |
parent | 403df36af6813acf762e2b85bae6b1584b781c59 (diff) | |
parent | f687b81b70a73835f0190fbfa17a0fbbfcd28b7a (diff) | |
download | plyr-34401de3d03e61eb7d1a04f6f0b7599e7ce9cd93.tar.lz plyr-34401de3d03e61eb7d1a04f6f0b7599e7ce9cd93.tar.xz plyr-34401de3d03e61eb7d1a04f6f0b7599e7ce9cd93.zip |
Merge branch 'master' into develop
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..f10bea1f 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('div', { + 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); } }, |