diff options
author | Sam Potts <sam@potts.es> | 2017-11-07 23:23:17 +1100 |
---|---|---|
committer | Sam Potts <sam@potts.es> | 2017-11-07 23:23:17 +1100 |
commit | 1a5f4b1b9e1b2b8b316997c4be33d9af240e1383 (patch) | |
tree | 4bc660a5f04ea0908c01d32ee4730fe19fc10c83 /src/js/plyr.js | |
parent | 3f41a0cf5417a3047aafa27894b57fb740d7d7da (diff) | |
parent | 966ca1acc30d87e1b821d78cfddc35ca75557eff (diff) | |
download | plyr-1a5f4b1b9e1b2b8b316997c4be33d9af240e1383.tar.lz plyr-1a5f4b1b9e1b2b8b316997c4be33d9af240e1383.tar.xz plyr-1a5f4b1b9e1b2b8b316997c4be33d9af240e1383.zip |
Merge branch 'develop' of github.com:Selz/plyr into develop
# Conflicts:
# dist/plyr.js
# dist/plyr.js.map
# src/js/defaults.js
Diffstat (limited to 'src/js/plyr.js')
-rw-r--r-- | src/js/plyr.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/js/plyr.js b/src/js/plyr.js index 355fe5cb..09b2aa8a 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -170,21 +170,22 @@ class Plyr { case 'audio': this.type = type; - if (this.media.getAttribute('crossorigin') !== null) { + if (this.media.hasAttribute('crossorigin')) { this.config.crossorigin = true; } - if (this.media.getAttribute('autoplay') !== null) { + if (this.media.hasAttribute('autoplay')) { this.config.autoplay = true; } - if (this.media.getAttribute('playsinline') !== null) { + if (this.media.hasAttribute('playsinline')) { this.config.inline = true; } - if (this.media.getAttribute('muted') !== null) { + if (this.media.hasAttribute('muted')) { this.config.muted = true; } - if (this.media.getAttribute('loop') !== null) { + if (this.media.hasAttribute('loop')) { this.config.loop.active = true; } + break; default: @@ -889,12 +890,14 @@ class Plyr { // If it's a soft destroy, make minimal changes if (soft) { utils.removeElement(this.elements.captions); + Array.from(this.elements.buttons.play).forEach(button => utils.removeElement(button)); utils.removeElement(this.elements.controls); utils.removeElement(this.elements.wrapper); // Clear for GC this.elements.captions = null; this.elements.controls = null; + this.elements.buttons.play = null; this.elements.wrapper = null; // Callback |