aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bower.json2
-rw-r--r--bundles.json4
-rw-r--r--changelog.md17
-rw-r--r--controls.md102
-rw-r--r--dist/plyr.css2
-rw-r--r--dist/plyr.js4
-rw-r--r--dist/sprite.svg2
-rw-r--r--docs/dist/docs.css2
-rw-r--r--docs/dist/docs.js2
-rw-r--r--docs/index.html5
-rw-r--r--docs/src/less/components/base.less5
-rw-r--r--docs/src/less/components/buttons.less3
-rw-r--r--docs/src/less/components/examples.less49
-rw-r--r--docs/src/less/components/type.less5
-rw-r--r--docs/src/less/lib/fontface.less4
-rw-r--r--docs/src/less/variables.less21
-rw-r--r--gulpfile.js26
-rw-r--r--package.json20
-rw-r--r--readme.md56
-rw-r--r--src/js/plyr.js353
-rw-r--r--src/less/mixins.less29
-rw-r--r--src/less/plyr.less287
-rw-r--r--src/less/variables.less66
-rw-r--r--src/sass/plyr.scss719
-rw-r--r--src/scss/mixins.scss29
-rw-r--r--src/scss/plyr.scss684
-rw-r--r--src/scss/variables.scss67
27 files changed, 1383 insertions, 1182 deletions
diff --git a/bower.json b/bower.json
index 537b614b..eaaf3a85 100644
--- a/bower.json
+++ b/bower.json
@@ -17,7 +17,7 @@
"dist/plyr.js",
"dist/sprite.svg",
"src/less/plyr.less",
- "src/sass/plyr.scss",
+ "src/scss/plyr.scss",
"src/js/plyr.js"
],
"ignore": [
diff --git a/bundles.json b/bundles.json
index c123e5b0..a2d35eae 100644
--- a/bundles.json
+++ b/bundles.json
@@ -3,8 +3,8 @@
"less": {
"plyr.css": ["src/less/plyr.less"]
},
- "sass": {
- "plyr.css": ["src/sass/plyr.sass"]
+ "scss": {
+ "plyr.css": ["src/scss/plyr.scss"]
},
"js": {
"plyr.js": ["src/js/plyr.js"]
diff --git a/changelog.md b/changelog.md
index c3c6c931..b8344604 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,22 @@
# Changelog
+## v1.6.1
+- Tooltip changes for accessibility
+
+## v1.6.0
+- New, cleaner, UI:
+ - Controls are now overlaid, maintaining the video's ratio and making sizing easier
+ - A large play button can now be overlaid over videos
+ - Default number of control buttons reduced
+ - New play, pause, rewind and fast forward icons
+ - Flexbox all the things!
+- Tidied up the LESS (and SCSS) as part of the above, variables and mixins in seprate files amking customization and upgrades easier
+- Toggle mute bug fix; if a player was muted previously and the user refreshed, unmuting would have meant volume was still zero (effectively muted), now the config default value is used. Not ideal but good for now
+- New `iconUrl` option allowing specifying a same origin SVG sprite location. Loading this way means you don't need the AJAX sprite loading JavaScript
+- `click` option renamed to `clickToPlay` to make it a bit more self explanatory. Unfortunately cross origin SVG sprites is not supported in any browser yet :-(
+- `hideControls` is now a global option, rather than being exclusive to fullscreen. Controls are now hidden after 2 seconds of no mouse movement. Controls are always shown when media is paused or stopped. This is defaulted to true.
+- `sass` folder in `src` renamed from to `scss`
+
## v1.5.21
- Bug fix for embeds: `play` not being defined (fixes #185 and #186)
diff --git a/controls.md b/controls.md
index 9bde7a17..a74bdcf8 100644
--- a/controls.md
+++ b/controls.md
@@ -15,7 +15,6 @@ i18n: {
play: "Play",
pause: "Pause",
forward: "Forward {seektime} secs",
- played: "played",
buffered: "buffered",
currentTime: "Current time",
duration: "Duration",
@@ -47,67 +46,64 @@ This is an example `html` option with all controls.
```javascript
var controls = ["<div class='plyr__controls'>",
- "<div class='plyr__progress'>",
+ "<button type='button' data-plyr='restart'>",
+ "<svg><use xlink:href='#icon-restart'></use></svg>",
+ "<span class='plyr__sr-only'>Restart</span>",
+ "</button>",
+ "<button type='button' data-plyr='rewind'>",
+ "<svg><use xlink:href='#icon-rewind'></use></svg>",
+ "<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
+ "</button>",
+ "<button type='button' data-plyr='play'>",
+ "<svg><use xlink:href='#icon-play'></use></svg>",
+ "<span class='plyr__sr-only'>Play</span>",
+ "</button>",
+ "<button type='button' data-plyr='pause'>",
+ "<svg><use xlink:href='#icon-pause'></use></svg>",
+ "<span class='plyr__sr-only'>Pause</span>",
+ "</button>",
+ "<button type='button' data-plyr='fast-forward'>",
+ "<svg><use xlink:href='#icon-fast-forward'></use></svg>",
+ "<span class='plyr__sr-only'>Forward {seektime} secs</span>",
+ "</button>",
+ "<span class='plyr__progress'>",
"<label for='seek{id}' class='plyr__sr-only'>Seek</label>",
"<input id='seek{id}' class='plyr__progress--seek' type='range' min='0' max='100' step='0.1' value='0' data-plyr='seek'>",
- "<progress class='plyr__progress--played' max='100' value='0'>",
- "<span>0</span>% played",
- "</progress>",
+ "<progress class='plyr__progress--played' max='100' value='0' role='presentation'></progress>",
"<progress class='plyr__progress--buffer' max='100' value='0'>",
"<span>0</span>% buffered",
"</progress>",
"<span class='plyr__tooltip'>00:00</span>",
- "</div>",
- "<span class='plyr__controls--left'>",
- "<button type='button' data-plyr='restart'>",
- "<svg><use xlink:href='#icon-restart'></use></svg>",
- "<span class='plyr__sr-only'>Restart</span>",
- "</button>",
- "<button type='button' data-plyr='rewind'>",
- "<svg><use xlink:href='#icon-rewind'></use></svg>",
- "<span class='plyr__sr-only'>Rewind {seektime} secs</span>",
- "</button>",
- "<button type='button' data-plyr='play'>",
- "<svg><use xlink:href='#icon-play'></use></svg>",
- "<span class='plyr__sr-only'>Play</span>",
- "</button>",
- "<button type='button' data-plyr='pause'>",
- "<svg><use xlink:href='#icon-pause'></use></svg>",
- "<span class='plyr__sr-only'>Pause</span>",
- "</button>",
- "<button type='button' data-plyr='fast-forward'>",
- "<svg><use xlink:href='#icon-fast-forward'></use></svg>",
- "<span class='plyr__sr-only'>Forward {seektime} secs</span>",
- "</button>",
- "<span class='plyr__time'>",
- "<span class='plyr__sr-only'>Current time</span>",
- "<span class='plyr__time--current'>00:00</span>",
- "</span>",
- "<span class='plyr__time'>",
- "<span class='plyr__sr-only'>Duration</span>",
- "<span class='plyr__time--duration'>00:00</span>",
- "</span>",
"</span>",
- "<span class='plyr__controls--right'>",
- "<button type='button' data-plyr='mute'>",
- "<svg class='icon--muted'><use xlink:href='#icon-muted'></use></svg>",
- "<svg><use xlink:href='#icon-volume'></use></svg>",
- "<span class='plyr__sr-only'>Toggle Mute</span>",
- "</button>",
+ "<span class='plyr__time'>",
+ "<span class='plyr__sr-only'>Current time</span>",
+ "<span class='plyr__time--current'>00:00</span>",
+ "</span>",
+ "<span class='plyr__time'>",
+ "<span class='plyr__sr-only'>Duration</span>",
+ "<span class='plyr__time--duration'>00:00</span>",
+ "</span>",
+ "<button type='button' data-plyr='mute'>",
+ "<svg class='icon--muted'><use xlink:href='#icon-muted'></use></svg>",
+ "<svg><use xlink:href='#icon-volume'></use></svg>",
+ "<span class='plyr__sr-only'>Toggle Mute</span>",
+ "</button>",
+ "<span class='plyr__volume'>",
"<label for='volume{id}' class='plyr__sr-only'>Volume</label>",
- "<input id='volume{id}' class='plyr__volume' type='range' min='0' max='10' value='5' data-plyr='volume'>",
- "<button type='button' data-plyr='captions'>",
- "<svg class='icon--captions-on'><use xlink:href='#icon-captions-on'></use></svg>",
- "<svg><use xlink:href='#icon-captions-off'></use></svg>",
- "<span class='plyr__sr-only'>Toggle Captions</span>",
- "</button>",
- "<button type='button' data-plyr='fullscreen'>",
- "<svg class='icon--exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>",
- "<svg><use xlink:href='#icon-enter-fullscreen'></use></svg>",
- "<span class='plyr__sr-only'>Toggle Fullscreen</span>",
- "</button>",
+ "<input id='volume{id}' class='plyr__volume--input' type='range' min='0' max='10' value='5' data-plyr='volume'>",
+ "<progress class='plyr__volume--display' max='10' value='0' role='presentation'></progress>",
"</span>",
-"</div>"].join("\n");
+ "<button type='button' data-plyr='captions'>",
+ "<svg class='icon--captions-on'><use xlink:href='#icon-captions-on'></use></svg>",
+ "<svg><use xlink:href='#icon-captions-off'></use></svg>",
+ "<span class='plyr__sr-only'>Toggle Captions</span>",
+ "</button>",
+ "<button type='button' data-plyr='fullscreen'>",
+ "<svg class='icon--exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>",
+ "<svg><use xlink:href='#icon-enter-fullscreen'></use></svg>",
+ "<span class='plyr__sr-only'>Toggle Fullscreen</span>",
+ "</button>",
+"</div>"].join("");
// Setup the player
plyr.setup('.js-player', {
diff --git a/dist/plyr.css b/dist/plyr.css
index 846b82c2..54d2ddeb 100644
--- a/dist/plyr.css
+++ b/dist/plyr.css
@@ -1 +1 @@
-.plyr .plyr__video-embed iframe,.plyr__tooltip{pointer-events:none}.plyr--hide-controls .plyr__controls,.plyr--playing .plyr__play-large,.plyr__tooltip{visibility:hidden;opacity:0}@-webkit-keyframes plyr-progress{to{background-position:25px 0}}@keyframes plyr-progress{to{background-position:25px 0}}.plyr{position:relative;max-width:100%;min-width:290px;font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle;border-radius:inherit}.plyr input[type=range]{display:block;height:16px;width:100%;margin:0;padding:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0}.plyr input[type=range]::-webkit-slider-runnable-track{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-webkit-user-select:none;user-select:none}.plyr input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-moz-range-track{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-moz-user-select:none;user-select:none}.plyr input[type=range]::-moz-range-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-ms-track{height:8px;background:0 0;border:0;color:transparent}.plyr input[type=range]::-ms-fill-lower,.plyr input[type=range]::-ms-fill-upper{height:8px;background:rgba(255,255,255,.25);border:0;border-radius:4px;-ms-user-select:none;user-select:none}.plyr input[type=range]::-ms-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15);box-sizing:border-box;margin-top:0}.plyr input[type=range]::-ms-tooltip{display:none}.plyr input[type=range]:focus{outline:0}.plyr input[type=range]::-moz-focus-outer{border:0}.plyr input[type=range].tab-focus:focus{outline:rgba(255,255,255,.5) dotted 1px;outline-offset:3px}.plyr input[type=range]:active::-webkit-slider-thumb{background:#63B4E1;border-color:#fff;-webkit-transform:scale(1.25);transform:scale(1.25)}.plyr input[type=range]:active::-moz-range-thumb{background:#63B4E1;border-color:#fff;transform:scale(1.25)}.plyr input[type=range]:active::-ms-thumb{background:#63B4E1;border-color:#fff;transform:scale(1.25)}.plyr__sr-only{position:absolute!important;clip:rect(1px,1px,1px,1px);padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden}.plyr__video-wrapper{position:relative;background:#000;border-radius:inherit}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;border-radius:inherit}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr video::-webkit-media-text-track-container{display:none}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 80px;color:#fff;font-size:20px;text-align:center;font-weight:400}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.85)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__controls,.plyr__play-large{transition:visibility .3s ease,opacity .3s ease}.plyr__controls{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;line-height:1;text-align:center}.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:10px}.plyr__controls .plyr__progress:first-child,.plyr__controls .plyr__time:first-child,.plyr__controls>button:first-child{margin-left:0}.plyr__controls .plyr__volume[type=range]{margin-left:5px}.plyr__controls [data-plyr=pause]{margin-left:0}.plyr__controls button{position:relative;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;vertical-align:middle;padding:5px 10px;border:0;background:0 0;border-radius:3px;cursor:pointer;transition:background .3s ease,color .3s ease,opacity .3s ease;color:inherit}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}.plyr--video .plyr__controls{position:absolute;left:0;right:0;bottom:0;padding:50px 15px 10px;background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.5));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:#fff}.plyr--video .plyr__controls button.tab-focus:focus,.plyr--video .plyr__controls button:hover{background:#63B4E1;color:#fff}.plyr--audio .plyr__controls{padding:10px;border-radius:inherit;background:0 0;color:#565D64}.plyr--audio .plyr__controls button.tab-focus:focus,.plyr--audio .plyr__controls button:hover,.plyr__play-large{background:#63B4E1;color:#fff}.plyr__play-large{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);padding:10px;border:4px solid #fff;border-radius:100%}.plyr__play-large svg{position:relative;left:2px;width:20px;height:20px;display:block;fill:currentColor}.plyr__play-large:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr--audio .plyr__play-large,.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr__time{display:inline-block}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:5px 7.5px;background:#000;box-shadow:0 0 5px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.1);border-radius:3px;color:#fff;font-size:14px;line-height:1.3;-webkit-transform:translate(-50%,10px) scale(.8);transform:translate(-50%,10px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,visibility .3s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:-4px;border-right:4px solid transparent;border-top:4px solid #000;border-left:4px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip,.plyr__tooltip--visible{visibility:visible;opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr__progress{position:relative;-webkit-flex:1;-ms-flex:1;flex:1}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress input[type=range]::-webkit-slider-runnable-track{background:0 0}.plyr__progress input[type=range]::-moz-range-track{background:0 0}.plyr__progress input[type=range]::-ms-fill-lower,.plyr__progress input[type=range]::-ms-fill-upper{background:0 0}.plyr__progress .plyr__tooltip{left:0}.plyr__progress--buffer[value],.plyr__progress--played[value]{position:absolute;left:0;top:50%;width:100%;height:8px;margin:-4px 0 0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:100px}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar{background:0 0}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-ms-fill,.plyr__progress--played[value]::-ms-fill{border-radius:100px}.plyr__progress--played[value]{z-index:1;color:#63B4E1;background:0 0}.plyr__progress--played[value]::-webkit-progress-value{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-moz-progress-bar{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-ms-fill{min-width:8px;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--buffer[value]{color:rgba(255,255,255,.25);background:rgba(255,255,255,.25)}.plyr__progress--buffer[value]::-webkit-progress-value{transition:width .2s ease}.plyr__progress--buffer[value]::-moz-progress-bar{transition:width .2s ease}.plyr__progress--buffer[value]::-ms-fill{transition:width .2s ease}.plyr--loading .plyr__progress--buffer{-webkit-animation:plyr-progress 1s linear infinite;animation:plyr-progress 1s linear infinite;background-size:25px 25px;background-repeat:repeat-x;background-color:rgba(255,255,255,.25);background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr__time{vertical-align:middle;font-size:14px;line-height:.95}.plyr__time+.plyr__time{display:none}@media (min-width:560px){.plyr__time+.plyr__time{display:inline-block}}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr__volume[type=range]{max-width:100px}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute],.plyr--is-ios.plyr--audio .plyr__controls--right{display:none}.plyr--is-ios.plyr--audio .plyr__controls--left{float:none}.plyr--fullscreen,.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000}.plyr--fullscreen video,.plyr--fullscreen-active video{height:100%}.plyr--fullscreen .plyr__video-wrapper,.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen .plyr__controls,.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0} \ No newline at end of file
+.plyr .plyr__video-embed iframe,.plyr__tooltip{pointer-events:none}@-webkit-keyframes plyr-progress{to{background-position:25px 0}}@keyframes plyr-progress{to{background-position:25px 0}}.plyr{position:relative;max-width:100%;min-width:200px;font-family:Avenir,"Avenir Next","Helvetica Neue","Segoe UI",Helvetica,Arial,sans-serif}.plyr,.plyr *,.plyr ::after,.plyr ::before{box-sizing:border-box}.plyr a,.plyr button,.plyr input,.plyr label{-ms-touch-action:manipulation;touch-action:manipulation}.plyr audio,.plyr video{width:100%;height:auto;vertical-align:middle;border-radius:inherit}.plyr input[type=range]{display:block;height:20px;width:100%;margin:0;padding:0;vertical-align:middle;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;border:none;background:0 0}.plyr input[type=range]::-webkit-slider-runnable-track{height:8px;background:0 0;border:0;border-radius:4px;-webkit-user-select:none;user-select:none}.plyr input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;margin-top:-4px;position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-moz-range-track{height:8px;background:0 0;border:0;border-radius:4px;-moz-user-select:none;user-select:none}.plyr input[type=range]::-moz-range-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box}.plyr input[type=range]::-ms-track{height:8px;background:0 0;border:0;color:transparent}.plyr input[type=range]::-ms-fill-upper{height:8px;background:0 0;border:0;border-radius:4px;-ms-user-select:none;user-select:none}.plyr input[type=range]::-ms-fill-lower{height:8px;border:0;border-radius:4px;-ms-user-select:none;user-select:none;background:#3498db}.plyr input[type=range]::-ms-thumb{position:relative;height:16px;width:16px;background:#fff;border:2px solid transparent;border-radius:100%;transition:background .2s ease,border .2s ease,-webkit-transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease;transition:background .2s ease,border .2s ease,transform .2s ease,-webkit-transform .2s ease;box-shadow:0 1px 1px rgba(0,0,0,.15),0 0 0 1px rgba(0,0,0,.15);box-sizing:border-box;margin-top:0}.plyr input[type=range]::-ms-tooltip{display:none}.plyr input[type=range]:focus{outline:0}.plyr input[type=range]::-moz-focus-outer{border:0}.plyr input[type=range].tab-focus:focus{outline-offset:3px}.plyr input[type=range]:active::-webkit-slider-thumb{background:#3498db;border-color:#fff;-webkit-transform:scale(1.25);transform:scale(1.25)}.plyr input[type=range]:active::-moz-range-thumb{background:#3498db;border-color:#fff;transform:scale(1.25)}.plyr input[type=range]:active::-ms-thumb{background:#3498db;border-color:#fff;transform:scale(1.25)}.plyr--video input[type=range].tab-focus:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr--audio input[type=range].tab-focus:focus{outline:rgba(86,93,100,.5) dotted 1px}.plyr__sr-only{position:absolute!important;clip:rect(1px,1px,1px,1px);padding:0!important;border:0!important;height:1px!important;width:1px!important;overflow:hidden}.plyr__video-wrapper{position:relative;background:#000;border-radius:inherit;-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.plyr__video-embed{padding-bottom:56.25%;height:0;overflow:hidden;border-radius:inherit}.plyr__video-embed iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.plyr__video-embed>div{position:relative;padding-bottom:200%;-webkit-transform:translateY(-35.95%);transform:translateY(-35.95%)}.plyr video::-webkit-media-text-track-container{display:none}.plyr__captions{display:none;position:absolute;bottom:0;left:0;width:100%;padding:20px 20px 80px;color:#fff;font-size:20px;text-align:center;font-weight:400;-webkit-font-smoothing:subpixel-antialiased}.plyr__captions span{border-radius:2px;padding:3px 10px;background:rgba(0,0,0,.85)}.plyr__captions span:empty{display:none}@media (min-width:768px){.plyr__captions{font-size:24px}}.plyr--captions-active .plyr__captions{display:block}.plyr--fullscreen-active .plyr__captions{font-size:32px}.plyr__time,.plyr__tooltip{font-size:14px;-webkit-font-smoothing:subpixel-antialiased}.plyr__controls{display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-ms-flex-align:center;align-items:center;line-height:1;text-align:center;transition:opacity .3s ease}.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:5px}.plyr__controls .plyr__progress:first-child,.plyr__controls .plyr__time:first-child,.plyr__controls>button:first-child{margin-left:0}.plyr__controls .plyr__volume{margin-left:5px}.plyr__controls [data-plyr=pause]{margin-left:0}.plyr__controls button{position:relative;display:inline-block;-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;vertical-align:middle;padding:5px;border:0;background:0 0;border-radius:3px;cursor:pointer;transition:background .3s ease,color .3s ease,opacity .3s ease;color:inherit}.plyr__controls button svg{width:18px;height:18px;display:block;fill:currentColor}.plyr__controls button:focus{outline:0}.plyr__controls .icon--captions-on,.plyr__controls .icon--exit-fullscreen,.plyr__controls .icon--muted{display:none}@media (min-width:480px){.plyr__controls .plyr__progress,.plyr__controls .plyr__time,.plyr__controls>button{margin-left:10px}.plyr__controls button{padding:5px 10px}}.plyr--hide-controls .plyr__controls{opacity:0}.plyr--video .plyr__controls{position:absolute;left:0;right:0;bottom:0;padding:50px 10px 10px;background:linear-gradient(rgba(0,0,0,0),rgba(0,0,0,.5));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;color:#fff}.plyr--video .plyr__controls button.tab-focus:focus,.plyr--video .plyr__controls button:hover{background:#3498db;color:#fff}@media (min-width:480px){.plyr--video .plyr__controls{padding-left:15px;padding-right:15px}}.plyr--audio .plyr__controls{padding:10px;border-radius:inherit;background:#fff;border:1px solid #dbe3e8;box-shadow:0 1px 1px rgba(0,0,0,.05);color:#565D64}.plyr--audio .plyr__controls button.tab-focus:focus,.plyr--audio .plyr__controls button:hover,.plyr__play-large{background:#3498db;color:#fff}.plyr__play-large{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);padding:10px;border:4px solid currentColor;border-radius:100%;box-shadow:0 1px 1px rgba(0,0,0,.15);transition:opacity .3s ease,visibility .3s ease}.plyr__play-large svg{position:relative;left:2px;width:20px;height:20px;display:block;fill:currentColor}.plyr--audio .plyr__play-large,.plyr--playing .plyr__controls [data-plyr=play],.plyr__controls [data-plyr=pause]{display:none}.plyr__play-large:focus{outline:rgba(255,255,255,.5) dotted 1px}.plyr--playing .plyr__play-large{opacity:0;visibility:hidden}.plyr--playing .plyr__controls [data-plyr=pause]{display:inline-block}.plyr--captions-active .plyr__controls .icon--captions-on,.plyr--fullscreen-active .icon--exit-fullscreen,.plyr--muted .plyr__controls .icon--muted{display:block}.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr--captions-active .plyr__controls .icon--captions-on+svg,.plyr--fullscreen-active .icon--exit-fullscreen+svg,.plyr--muted .plyr__controls .icon--muted+svg{display:none}.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen]{display:inline-block}.plyr__tooltip{position:absolute;z-index:2;bottom:100%;margin-bottom:10px;padding:5px 7.5px;opacity:0;background:#000;box-shadow:0 0 5px rgba(0,0,0,.1),0 0 0 1px rgba(0,0,0,.1);border-radius:3px;color:#fff;line-height:1.3;-webkit-transform:translate(-50%,10px) scale(.8);transform:translate(-50%,10px) scale(.8);-webkit-transform-origin:50% 100%;transform-origin:50% 100%;transition:opacity .2s .1s ease,-webkit-transform .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease;transition:transform .2s .1s ease,opacity .2s .1s ease,-webkit-transform .2s .1s ease}.plyr__tooltip::before{content:'';position:absolute;width:0;height:0;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:-4px;border-right:4px solid transparent;border-top:4px solid #000;border-left:4px solid transparent;z-index:2}.plyr button.tab-focus:focus .plyr__tooltip,.plyr button:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;-webkit-transform:translate(-50%,0) scale(1);transform:translate(-50%,0) scale(1)}.plyr button:hover .plyr__tooltip{z-index:3}.plyr__progress{position:relative;-webkit-flex:1;-ms-flex:1;flex:1}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress input[type=range]::-webkit-slider-runnable-track{background:0 0}.plyr__progress input[type=range]::-moz-range-track{background:0 0}.plyr__progress input[type=range]::-ms-fill-upper{background:0 0}.plyr__progress .plyr__tooltip{left:0}.plyr__progress--buffer[value],.plyr__progress--played[value],.plyr__volume--display[value]{position:absolute;left:0;top:50%;width:100%;height:8px;margin:-4px 0 0;padding:0;vertical-align:top;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:100px}.plyr__progress--buffer[value]::-webkit-progress-bar,.plyr__progress--played[value]::-webkit-progress-bar,.plyr__volume--display[value]::-webkit-progress-bar{background:0 0}.plyr__progress--buffer[value]::-webkit-progress-value,.plyr__progress--played[value]::-webkit-progress-value,.plyr__volume--display[value]::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-moz-progress-bar,.plyr__progress--played[value]::-moz-progress-bar,.plyr__volume--display[value]::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:8px}.plyr__progress--buffer[value]::-ms-fill,.plyr__progress--played[value]::-ms-fill,.plyr__volume--display[value]::-ms-fill{border-radius:100px}.plyr__progress--played[value],.plyr__volume--display[value]{z-index:1;color:#3498db;background:0 0;transition:none}.plyr__progress--played[value]::-webkit-progress-value,.plyr__volume--display[value]::-webkit-progress-value{min-width:8px;max-width:99%;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-moz-progress-bar,.plyr__volume--display[value]::-moz-progress-bar{min-width:8px;max-width:99%;border-top-right-radius:0;border-bottom-right-radius:0}.plyr__progress--played[value]::-ms-fill,.plyr__volume--display[value]::-ms-fill{display:none}.plyr__progress--buffer[value]::-webkit-progress-value{transition:width .2s ease}.plyr__progress--buffer[value]::-moz-progress-bar{transition:width .2s ease}.plyr__progress--buffer[value]::-ms-fill{transition:width .2s ease}.plyr--video .plyr__progress--buffer[value],.plyr--video .plyr__volume--display[value]{background:rgba(255,255,255,.25)}.plyr--video .plyr__progress--buffer[value]{color:rgba(255,255,255,.25)}.plyr--audio .plyr__progress--buffer[value],.plyr--audio .plyr__volume--display[value]{background:rgba(198,214,219,.66)}.plyr--audio .plyr__progress--buffer[value]{color:rgba(198,214,219,.66)}.plyr--loading .plyr__progress--buffer{-webkit-animation:plyr-progress 1s linear infinite;animation:plyr-progress 1s linear infinite;background-size:25px 25px;background-repeat:repeat-x;background-image:linear-gradient(-45deg,rgba(0,0,0,.15) 25%,transparent 25%,transparent 50%,rgba(0,0,0,.15) 50%,rgba(0,0,0,.15) 75%,transparent 75%,transparent);color:transparent}.plyr--video.plyr--loading .plyr__progress--buffer{background-color:rgba(255,255,255,.25)}.plyr--audio.plyr--loading .plyr__progress--buffer{background-color:rgba(198,214,219,.66)}.plyr__time{display:inline-block;vertical-align:middle;line-height:.95}.plyr__time+.plyr__time{display:none}@media (min-width:768px){.plyr__time+.plyr__time{display:inline-block}}.plyr__time+.plyr__time::before{content:'\2044';margin-right:10px}.plyr .plyr__volume{display:none;position:relative}.plyr .plyr__volume input[type=range]{position:relative;z-index:2}@media (min-width:480px){.plyr .plyr__volume{display:block;max-width:60px}}@media (min-width:768px){.plyr .plyr__volume{max-width:100px}}.plyr--is-ios .plyr__volume,.plyr--is-ios [data-plyr=mute]{display:none!important}.plyr--fullscreen,.plyr--fullscreen-active{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000;border-radius:0}.plyr--fullscreen video,.plyr--fullscreen-active video{height:100%}.plyr--fullscreen .plyr__video-wrapper,.plyr--fullscreen-active .plyr__video-wrapper{height:100%;width:100%}.plyr--fullscreen .plyr__controls,.plyr--fullscreen-active .plyr__controls{position:absolute;bottom:0;left:0;right:0} \ No newline at end of file
diff --git a/dist/plyr.js b/dist/plyr.js
index 05d5bc15..9e575543 100644
--- a/dist/plyr.js
+++ b/dist/plyr.js
@@ -1,2 +1,2 @@
-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define(null,function(){t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,a,r=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",o="11;"):-1!==(n=r.indexOf("MSIE"))?(s="IE",o=r.substring(n+5)):-1!==(n=r.indexOf("Chrome"))?(s="Chrome",o=r.substring(n+7)):-1!==(n=r.indexOf("Safari"))?(s="Safari",o=r.substring(n+7),-1!==(n=r.indexOf("Version"))&&(o=r.substring(n+8))):-1!==(n=r.indexOf("Firefox"))?(s="Firefox",o=r.substring(n+8)):(e=r.lastIndexOf(" ")+1)<(n=r.lastIndexOf("/"))&&(s=r.substring(e,n),o=r.substring(n+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(a=o.indexOf(";"))&&(o=o.substring(0,a)),-1!==(a=o.indexOf(" "))&&(o=o.substring(0,a)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform),touch:"ontouchstart"in t.documentElement}}function a(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function r(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var a=t.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a)}}function s(e,t){return Array.prototype.indexOf&&-1!=e.indexOf(t)}function o(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function i(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var a=n>0?t.cloneNode(!0):t,r=e[n],s=r.parentNode,o=r.nextSibling;a.appendChild(r),o?s.insertBefore(a,o):s.appendChild(a)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function u(e){e&&e.parentNode.removeChild(e)}function c(e,t){e.insertBefore(t,e.firstChild)}function p(e,t){for(var n in t)e.setAttribute(n,"boolean"==typeof t[n]&&t[n]?"":t[n])}function d(e,n,a){var r=t.createElement(e);p(r,a),c(n,r)}function m(e){return e.replace(".","")}function f(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=a+(n?" "+t:"")}}function y(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className):!1}function b(e,t,n){e&&h(e,t,n,!0)}function v(e,t,n){e&&h(e,t,n,!1)}function g(e,t,n,a){b(e,t,function(t){n&&n.apply(e,[t]),a.apply(e,[t])})}function h(e,t,n,a){var r=t.split(" ");if(e instanceof NodeList)for(var s=0;s<e.length;s++)e[s]instanceof Node&&h(e[s],arguments[1],arguments[2],arguments[3]);else for(var o=0;o<r.length;o++)e[a?"addEventListener":"removeEventListener"](r[o],n,!1)}function k(e,t,n){if(e&&t){var a=new CustomEvent(t,n);e.dispatchEvent(a)}}function w(e,t){return e?(t="boolean"==typeof t?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t):void 0}function T(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function x(){var e=arguments;if(e.length){if(1==e.lenth)return e[0];for(var t=Array.prototype.shift.call(e),n=e.length,a=0;n>a;a++){var r=e[a];for(var s in r)r[s]&&r[s].constructor&&r[s].constructor===Object?(t[s]=t[s]||{},x(t[s],r[s])):t[s]=r[s]}return t}}function _(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof t.cancelFullScreen)e.supportsFullScreen=!0;else for(var a=0,r=n.length;r>a;a++){if(e.prefix=n[a],"undefined"!=typeof t[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof t.msExitFullscreen&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=t.body),this.prefix){case"":return t.fullscreenElement==e;case"moz":return t.mozFullScreenElement==e;default:return t[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=t.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?t.cancelFullScreen():t[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?t.fullscreenElement:t[this.prefix+"FullscreenElement"]}),e}function C(){var t={supported:function(){if(!("localStorage"in e))return!1;try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(n){return!1}return!1}()};return t}function F(h,x){function F(t,n){x.debug&&e.console&&console[n?"warn":"log"](t)}function A(){var e=[];return s(x.controls,"play-large")&&e.push('<button type="button" data-plyr="play" class="plyr__play-large">','<svg><use xlink:href="#'+x.iconPrefix+'-play" /></svg>','<span class="plyr__sr-only">'+x.i18n.play+"</span>","</button>"),e.push('<div class="plyr__controls">'),s(x.controls,"restart")&&e.push('<button type="button" data-plyr="restart">','<svg><use xlink:href="#'+x.iconPrefix+'-restart" /></svg>','<span class="plyr__sr-only">'+x.i18n.restart+"</span>","</button>"),s(x.controls,"rewind")&&e.push('<button type="button" data-plyr="rewind">','<svg><use xlink:href="#'+x.iconPrefix+'-rewind" /></svg>','<span class="plyr__sr-only">'+x.i18n.rewind+"</span>","</button>"),s(x.controls,"play")&&e.push('<button type="button" data-plyr="play">','<svg><use xlink:href="#'+x.iconPrefix+'-play" /></svg>','<span class="plyr__sr-only">'+x.i18n.play+"</span>","</button>",'<button type="button" data-plyr="pause">','<svg><use xlink:href="#'+x.iconPrefix+'-pause" /></svg>','<span class="plyr__sr-only">'+x.i18n.pause+"</span>","</button>"),s(x.controls,"fast-forward")&&e.push('<button type="button" data-plyr="fast-forward">','<svg><use xlink:href="#'+x.iconPrefix+'-fast-forward" /></svg>','<span class="plyr__sr-only">'+x.i18n.forward+"</span>","</button>"),s(x.controls,"progress")&&(e.push('<span class="plyr__progress">','<label for="seek{id}" class="plyr__sr-only">Seek</label>','<input id="seek{id}" class="plyr__progress--seek" type="range" min="0" max="100" step="0.1" value="0" data-plyr="seek">','<progress class="plyr__progress--played" max="100" value="0">',"<span>0</span>% "+x.i18n.played,"</progress>",'<progress class="plyr__progress--buffer" max="100" value="0">',"<span>0</span>% "+x.i18n.buffered,"</progress>"),x.tooltips.seek&&e.push('<span class="plyr__tooltip">00:00</span>'),e.push("</span>")),s(x.controls,"current-time")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+x.i18n.currentTime+"</span>",'<span class="plyr__time--current">00:00</span>',"</span>"),s(x.controls,"duration")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+x.i18n.duration+"</span>",'<span class="plyr__time--duration">00:00</span>',"</span>"),s(x.controls,"mute")&&e.push('<button type="button" data-plyr="mute">','<svg class="icon--muted"><use xlink:href="#'+x.iconPrefix+'-muted" /></svg>','<svg><use xlink:href="#'+x.iconPrefix+'-volume" /></svg>','<span class="plyr__sr-only">'+x.i18n.toggleMute+"</span>","</button>"),s(x.controls,"volume")&&e.push('<label for="volume{id}" class="plyr__sr-only">'+x.i18n.volume+"</label>",'<input id="volume{id}" class="plyr__volume" type="range" min="0" max="10" value="5" data-plyr="volume">'),s(x.controls,"captions")&&e.push('<button type="button" data-plyr="captions">','<svg class="icon--captions-on"><use xlink:href="#'+x.iconPrefix+'-captions-on" /></svg>','<svg><use xlink:href="#'+x.iconPrefix+'-captions-off" /></svg>','<span class="plyr__sr-only">'+x.i18n.toggleCaptions+"</span>","</button>"),s(x.controls,"fullscreen")&&e.push('<button type="button" data-plyr="fullscreen">','<svg class="icon--exit-fullscreen"><use xlink:href="#'+x.iconPrefix+'-exit-fullscreen" /></svg>','<svg><use xlink:href="#'+x.iconPrefix+'-enter-fullscreen" /></svg>','<span class="plyr__sr-only">'+x.i18n.toggleFullscreen+"</span>","</button>"),e.push("</div>"),e.join("")}function N(){if(Ee.supported.full&&("audio"!=Ee.type||x.fullscreen.allowAudio)&&x.fullscreen.enabled){var e=E.supportsFullScreen;e||x.fullscreen.fallback&&!R()?(F((e?"Native":"Fallback")+" fullscreen enabled"),f(Ee.container,x.classes.fullscreen.enabled,!0)):F("Fullscreen not supported and fallback disabled"),w(Ee.buttons.fullscreen,!1),q()}}function P(){if("video"===Ee.type){V(x.selectors.captions)||Ee.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+m(x.selectors.captions)+'"></div>'),Ee.usingTextTracks=!1,Ee.media.textTracks&&(Ee.usingTextTracks=!0);for(var e,t="",n=Ee.media.childNodes,a=0;a<n.length;a++)"track"===n[a].nodeName.toLowerCase()&&(e=n[a].kind,"captions"!==e&&"subtitles"!==e||(t=n[a].getAttribute("src")));if(Ee.captionExists=!0,""===t?(Ee.captionExists=!1,F("No caption track found")):F("Caption track found; URI: "+t),Ee.captionExists){for(var r=Ee.media.textTracks,s=0;s<r.length;s++)r[s].mode="hidden";if(M(Ee),("IE"===Ee.browser.name&&Ee.browser.version>=10||"Firefox"===Ee.browser.name&&Ee.browser.version>=31)&&(F("Detected browser with known TextTrack issues - using manual fallback"),Ee.usingTextTracks=!1),Ee.usingTextTracks){F("TextTracks supported");for(var o=0;o<r.length;o++){var i=r[o];"captions"!==i.kind&&"subtitles"!==i.kind||b(i,"cuechange",function(){this.activeCues[0]&&"text"in this.activeCues[0]?I(this.activeCues[0].getCueAsHTML()):I()})}}else if(F("TextTracks not supported so rendering captions manually"),Ee.currentCaption="",Ee.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],n=l.responseText;t=n.split("\n\n");for(var a=0;a<t.length;a++){e=t[a],Ee.captions[a]=[];var r=e.split("\n"),s=0;-1===r[s].indexOf(":")&&(s=1),Ee.captions[a]=[r[s],r[s+1]]}Ee.captions.shift(),F("Successfully loaded the caption file via AJAX")}else F("There was a problem loading the caption file via AJAX",!0)},l.open("get",t,!0),l.send()}}else f(Ee.container,x.classes.captions.enabled)}}function I(e){var n=V(x.selectors.captions),a=t.createElement("span");n.innerHTML="","undefined"==typeof e&&(e=""),"string"==typeof e?a.innerHTML=e.trim():a.appendChild(e),n.appendChild(a);n.offsetHeight}function L(e){function t(e,t){var n=[];n=e.split(" --> ");for(var a=0;a<n.length;a++)n[a]=n[a].replace(/(\d+:\d+:\d+\.\d+).*/,"$1");return r(n[t])}function n(e){return t(e,0)}function a(e){return t(e,1)}function r(e){if(null===e||void 0===e)return 0;var t,n=[],a=[];return n=e.split(","),a=n[0].split(":"),t=Math.floor(60*a[0]*60)+Math.floor(60*a[1])+Math.floor(a[2])}if(!Ee.usingTextTracks&&"video"===Ee.type&&Ee.supported.full&&(Ee.subcount=0,e="number"==typeof e?e:Ee.media.currentTime,Ee.captions[Ee.subcount])){for(;a(Ee.captions[Ee.subcount][0])<e.toFixed(1);)if(Ee.subcount++,Ee.subcount>Ee.captions.length-1){Ee.subcount=Ee.captions.length-1;break}Ee.media.currentTime.toFixed(1)>=n(Ee.captions[Ee.subcount][0])&&Ee.media.currentTime.toFixed(1)<=a(Ee.captions[Ee.subcount][0])?(Ee.currentCaption=Ee.captions[Ee.subcount][1],I(Ee.currentCaption)):I()}}function M(){Ee.buttons.captions&&(f(Ee.container,x.classes.captions.enabled,!0),x.captions.defaultActive&&(f(Ee.container,x.classes.captions.active,!0),w(Ee.buttons.captions,!0)))}function O(e){return Ee.container.querySelectorAll(e)}function V(e){return O(e)[0]}function R(){try{return e.self!==e.top}catch(t){return!0}}function q(){function e(e){9===e.which&&Ee.isFullscreen&&(e.target!==a||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),a.focus()):(e.preventDefault(),n.focus()))}var t=O("input:not([disabled]), button:not([disabled])"),n=t[0],a=t[t.length-1];b(Ee.container,"keydown",e)}function j(e,t){if("string"==typeof t)d(e,Ee.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ee.media,t[n])}function H(){var e=x.html;F("Injecting custom controls"),e||(e=A()),e=o(e,"{seektime}",x.seekTime),e=o(e,"{id}",Math.floor(1e4*Math.random()));var n;if(null!==x.selectors.controls.container&&(n=x.selectors.controls.container,"string"==typeof selector&&(n=t.querySelector(n))),n instanceof HTMLElement||(n=Ee.container),n.insertAdjacentHTML("beforeend",e),x.tooltips.controls)for(var a=O([x.selectors.controls.wrapper," ",x.selectors.labels," .",x.classes.hidden].join("")),r=a.length-1;r>=0;r--){var s=a[r];f(s,x.classes.hidden,!1),f(s,x.classes.tooltip,!0)}}function W(){try{return Ee.controls=V(x.selectors.controls.wrapper),Ee.buttons={},Ee.buttons.seek=V(x.selectors.buttons.seek),Ee.buttons.play=O(x.selectors.buttons.play),Ee.buttons.pause=V(x.selectors.buttons.pause),Ee.buttons.restart=V(x.selectors.buttons.restart),Ee.buttons.rewind=V(x.selectors.buttons.rewind),Ee.buttons.forward=V(x.selectors.buttons.forward),Ee.buttons.fullscreen=V(x.selectors.buttons.fullscreen),Ee.buttons.volume=V(x.selectors.buttons.volume),Ee.buttons.mute=V(x.selectors.buttons.mute),Ee.buttons.captions=V(x.selectors.buttons.captions),Ee.checkboxes=O('[type="checkbox"]'),Ee.progress={},Ee.progress.container=V(x.selectors.progress.container),Ee.progress.buffer={},Ee.progress.buffer.bar=V(x.selectors.progress.buffer),Ee.progress.buffer.text=Ee.progress.buffer.bar&&Ee.progress.buffer.bar.getElementsByTagName("span")[0],Ee.progress.played={},Ee.progress.played.bar=V(x.selectors.progress.played),Ee.progress.played.text=Ee.progress.played.bar&&Ee.progress.played.bar.getElementsByTagName("span")[0],Ee.progress.tooltip=Ee.progress.container&&Ee.progress.container.querySelector("."+x.classes.tooltip),Ee.volume=V(x.selectors.buttons.volume),Ee.duration=V(x.selectors.duration),Ee.currentTime=V(x.selectors.currentTime),Ee.seekTime=O(x.selectors.seekTime),!0}catch(e){return F("It looks like there is a problem with your controls html",!0),Y(!0),!1}}function D(){f(Ee.container,x.selectors.container.replace(".",""),Ee.supported.full)}function Y(e){e?Ee.media.setAttribute("controls",""):Ee.media.removeAttribute("controls")}function B(e){var t=x.i18n.play;if("undefined"!=typeof x.title&&x.title.length&&(t+=", "+x.title),Ee.supported.full&&Ee.buttons.play)for(var n=Ee.buttons.play.length-1;n>=0;n--)Ee.buttons.play[n].setAttribute("aria-label",t);e instanceof HTMLElement&&e.setAttribute("title",x.i18n.frameTitle.replace("{title}",x.title))}function $(){if(!Ee.media)return F("No audio or video element found",!0),!1;if(Ee.supported.full&&(f(Ee.container,x.classes.type.replace("{0}",Ee.type),!0),s(x.types.embed,Ee.type)&&f(Ee.container,x.classes.type.replace("{0}","video"),!0),f(Ee.container,x.classes.stopped,x.autoplay),f(Ee.container,x.classes.isIos,Ee.browser.ios),f(Ee.container,x.classes.isTouch,Ee.browser.touch),"video"===Ee.type)){var e=t.createElement("div");e.setAttribute("class",x.classes.videoWrapper),i(Ee.media,e),Ee.videoContainer=e}s(x.types.embed,Ee.type)&&(U(),Ee.embedId=null)}function U(){for(var n=t.createElement("div"),a=Ee.embedId,s=Ee.type+"-"+Math.floor(1e4*Math.random()),o=O('[id^="'+Ee.type+'-"]'),i=o.length-1;i>=0;i--)u(o[i]);if(f(Ee.media,x.classes.videoWrapper,!0),f(Ee.media,x.classes.embedWrapper,!0),"youtube"===Ee.type)Ee.media.appendChild(n),n.setAttribute("id",s),"object"==typeof YT?K(a,n):(r(x.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){K(a,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://player.vimeo.com/video/"+a+"?player_id="+s+"&api=1&badge=0&byline=0&portrait=0&title=0",id:s,webkitallowfullscreen:"",mozallowfullscreen:"",allowfullscreen:"",frameborder:0}),Ee.supported.full?(n.appendChild(l),Ee.media.appendChild(n)):Ee.media.appendChild(l),"$f"in e||r(x.urls.vimeo.api);var c=e.setInterval(function(){"$f"in e&&l.loaded&&(e.clearInterval(c),X.call(l))},50)}else if("soundcloud"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+a,id:s}),n.appendChild(l),Ee.media.appendChild(n),e.SC||r(x.urls.soundcloud.api);var c=e.setInterval(function(){e.SC&&l.loaded&&(e.clearInterval(c),J.call(l))},50)}}function z(){Ee.container.plyr.embed=Ee.embed,Fe(),B(V("iframe"))}function K(t,n){"timer"in Ee||(Ee.timer={}),Ee.embed=new YT.Player(n.id,{videoId:t,playerVars:{autoplay:x.autoplay?1:0,controls:Ee.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:x.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onReady:function(t){var n=t.target;Ee.media.play=function(){n.playVideo(),Ee.media.paused=!1},Ee.media.pause=function(){n.pauseVideo(),Ee.media.paused=!0},Ee.media.stop=function(){n.stopVideo(),Ee.media.paused=!0},Ee.media.duration=n.getDuration(),Ee.media.paused=!0,Ee.media.currentTime=n.getCurrentTime(),Ee.media.muted=n.isMuted(),x.title=n.getVideoData().title,k(Ee.media,"timeupdate"),e.clearInterval(Ee.timer.buffering),Ee.timer.buffering=e.setInterval(function(){Ee.media.buffered=n.getVideoLoadedFraction(),k(Ee.media,"progress"),1===Ee.media.buffered&&(e.clearInterval(Ee.timer.buffering),k(Ee.media,"canplaythrough"))},200),z(),fe()},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Ee.timer.playing),t.data){case 0:Ee.media.paused=!0,k(Ee.media,"ended");break;case 1:Ee.media.paused=!1,Ee.media.seeking=!1,k(Ee.media,"play"),k(Ee.media,"playing"),Ee.timer.playing=e.setInterval(function(){Ee.media.currentTime=n.getCurrentTime(),k(Ee.media,"timeupdate")},100);break;case 2:Ee.media.paused=!0,k(Ee.media,"pause")}}}})}function X(){Ee.embed=$f(this),Ee.embed.addEvent("ready",function(){Ee.media.play=function(){Ee.embed.api("play"),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.api("pause"),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.api("stop"),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.api("getCurrentTime",function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.api("getDuration",function(e){Ee.media.duration=e,fe()}),Ee.embed.addEvent("play",function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.addEvent("pause",function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.addEvent("playProgress",function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.seconds,k(Ee.media,"timeupdate")}),Ee.embed.addEvent("loadProgress",function(e){Ee.media.buffered=e.percent,k(Ee.media,"progress"),1===parseInt(e.percent)&&k(Ee.media,"canplaythrough")}),Ee.embed.addEvent("finish",function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.api("play")})}function J(){Ee.embed=SC.Widget(this),Ee.embed.bind(SC.Widget.Events.READY,function(){Ee.media.play=function(){Ee.embed.play(),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.pause(),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.seekTo(0),Ee.embed.pause(),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.getPosition(function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.getDuration(function(e){Ee.media.duration=e/1e3,fe()}),Ee.embed.bind(SC.Widget.Events.PLAY,function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.bind(SC.Widget.Events.PAUSE,function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.bind(SC.Widget.Events.PLAY_PROGRESS,function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.currentPosition/1e3,k(Ee.media,"timeupdate")}),Ee.embed.bind(SC.Widget.Events.LOAD_PROGRESS,function(e){Ee.media.buffered=e.loadProgress,k(Ee.media,"progress"),1===parseInt(e.loadProgress)&&k(Ee.media,"canplaythrough")}),Ee.embed.bind(SC.Widget.Events.FINISH,function(){Ee.media.paused=!0,k(Ee.media,"ended")}),x.autoplay&&Ee.embed.play()})}function G(){"play"in Ee.media&&Ee.media.play()}function Q(){"pause"in Ee.media&&Ee.media.pause()}function Z(e){e===!0?G():e===!1?Q():Ee.media[Ee.media.paused?"play":"pause"]()}function ee(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime-e)}function te(e){"number"!=typeof e&&(e=x.seekTime),ne(Ee.media.currentTime+e)}function ne(e){var t=0,n=Ee.media.paused,a=ae();"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*a),0>t?t=0:t>a&&(t=a);try{Ee.media.currentTime=t.toFixed(1)}catch(r){}if(s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.seekTo(t);break;case"vimeo":Ee.embed.api("seekTo",t.toFixed(0));break;case"soundcloud":Ee.embed.seekTo(1e3*t)}n&&Q(),k(Ee.media,"timeupdate"),Ee.media.seeking=!0}F("Seeking to "+Ee.media.currentTime+" seconds"),L(t)}function ae(){var e=parseInt(x.duration);return isNaN(e)?Ee.media.duration:e}function re(){f(Ee.container,x.classes.playing,!Ee.media.paused),f(Ee.container,x.classes.stopped,Ee.media.paused),ve(Ee.media.paused)}function se(e){var n=E.supportsFullScreen;e&&e.type===E.fullScreenEventName?Ee.isFullscreen=E.isFullScreen(Ee.container):n?(E.isFullScreen(Ee.container)?E.cancelFullScreen():E.requestFullScreen(Ee.container),Ee.isFullscreen=E.isFullScreen(Ee.container)):(Ee.isFullscreen=!Ee.isFullscreen,Ee.isFullscreen?(b(t,"keyup",oe),t.body.style.overflow="hidden"):(v(t,"keyup",oe),t.body.style.overflow="")),f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),Ee.isFullscreen?Ee.container.setAttribute("tabindex","-1"):Ee.container.removeAttribute("tabindex"),q(Ee.isFullscreen),w(Ee.buttons.fullscreen,Ee.isFullscreen),k(Ee.container,Ee.isFullscreen?"enterfullscreen":"exitfullscreen")}function oe(e){27===(e.which||e.charCode||e.keyCode)&&Ee.isFullscreen&&se()}function ie(e){if("boolean"!=typeof e&&(e=!Ee.media.muted),w(Ee.buttons.mute,e),Ee.media.muted=e,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed[Ee.media.muted?"mute":"unMute"]();break;case"vimeo":Ee.embed.api("setVolume",Ee.media.muted?0:parseFloat(x.volume/10));break;case"soundcloud":Ee.embed.setVolume(Ee.media.muted?0:parseFloat(x.volume/10))}k(Ee.media,"volumechange")}}function le(t){if("undefined"==typeof t&&(t=x.volume,x.storage.enabled&&C().supported&&(t=e.localStorage.getItem(x.storage.key),e.localStorage.removeItem("plyr-volume"))),(null===t||isNaN(t))&&(t=x.volume),t>10&&(t=10),0>t&&(t=0),Ee.media.volume=parseFloat(t/10),x.volume=t,s(x.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.setVolume(100*Ee.media.volume);break;case"vimeo":Ee.embed.api("setVolume",Ee.media.volume);break;case"soundcloud":Ee.embed.setVolume(Ee.media.volume)}k(Ee.media,"volumechange")}Ee.media.muted&&t>0&&ie()}function ue(){var t=Ee.media.muted?0:10*Ee.media.volume;Ee.supported.full&&Ee.volume&&(Ee.volume.value=t),x.storage.enabled&&C().supported&&!isNaN(t)&&e.localStorage.setItem(x.storage.key,t),f(Ee.container,x.classes.muted,0===t),Ee.supported.full&&Ee.buttons.mute&&w(Ee.buttons.mute,0===t)}function ce(e){Ee.supported.full&&Ee.buttons.captions&&("boolean"!=typeof e&&(e=-1===Ee.container.className.indexOf(x.classes.captions.active)),Ee.captionsEnabled=e,w(Ee.buttons.captions,Ee.captionsEnabled),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),k(Ee.container,Ee.captionsEnabled?"captionsenabled":"captionsdisabled"))}function pe(e){var t="waiting"===e.type;clearTimeout(Ee.timers.loading),Ee.timers.loading=setTimeout(function(){f(Ee.container,x.classes.loading,t)},t?250:0)}function de(e){var t=Ee.progress.played.bar,n=Ee.progress.played.text,a=0,r=ae();if(e)switch(e.type){case"timeupdate":case"seeking":a=T(Ee.media.currentTime,r),"timeupdate"==e.type&&Ee.buttons.seek&&(Ee.buttons.seek.value=a);break;case"change":case"input":a=e.target.value;break;case"playing":case"progress":t=Ee.progress.buffer.bar,n=Ee.progress.buffer.text,a=function(){var e=Ee.media.buffered;return e&&e.length?T(e.end(0),r):"number"==typeof e?100*e:0}()}t&&(t.value=a),n&&(n.innerHTML=a)}function me(e,t){if(t){isNaN(e)&&(e=0),Ee.secs=parseInt(e%60),Ee.mins=parseInt(e/60%60),Ee.hours=parseInt(e/60/60%60);var n=parseInt(ae()/60/60%60)>0;Ee.secs=("0"+Ee.secs).slice(-2),Ee.mins=("0"+Ee.mins).slice(-2),t.innerHTML=(n?Ee.hours+":":"")+Ee.mins+":"+Ee.secs}}function fe(){if(Ee.supported.full){var e=ae()||0;!Ee.duration&&x.displayDuration&&Ee.media.paused&&me(e,Ee.currentTime),Ee.duration&&me(e,Ee.duration),be()}}function ye(e){me(Ee.media.currentTime,Ee.currentTime),e&&"timeupdate"==e.type&&Ee.media.seeking||de(e)}function be(e){if(x.tooltips.seek&&!Ee.browser.touch){var t=Ee.progress.container.getBoundingClientRect(),n=0,a=x.classes.tooltip+"--visible";if(e)n=100/t.width*(e.pageX-t.left);else{if(!y(Ee.progress.tooltip,a))return;n=Ee.progress.tooltip.style.left.replace("%","")}0>n?n=0:n>100&&(n=100),me(ae()/100*n,Ee.progress.tooltip),Ee.progress.tooltip.style.left=n+"%",e&&s(["mouseenter","mouseleave"],e.type)&&f(Ee.progress.tooltip,a,"mouseenter"===e.type)}}function ve(t){if(x.hideControls&&"audio"!==Ee.type){var n=!1,a=!1,r=t;"boolean"!=typeof t&&(t&&t.type?(n="mousemove"===t.type,a="enterfullscreen"===t.type,r=s(["mousemove","mouseenter"],t.type)):r=!1),e.clearTimeout(Ee.timers.hover),(r||Ee.media.paused)&&(f(Ee.container,x.classes.hideControls,!1),Ee.media.paused)||r&&Ee.media.paused||(Ee.timers.hover=e.setTimeout(function(){Ee.controls.active&&!a||f(Ee.container,x.classes.hideControls,!0)},n?2e3:0))}}function ge(e){if("undefined"!=typeof e)return void he(e);var t;switch(Ee.type){case"youtube":t=Ee.embed.getVideoUrl();break;case"vimeo":Ee.embed.api("getVideoUrl",function(e){t=e});break;case"soundcloud":Ee.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ee.media.currentSrc}return t||""}function he(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void F("Invalid source format",!0);if(Q(),Ee.buttons.seek&&(Ee.buttons.seek.value=0),"youtube"===Ee.type?(Ee.embed.destroy(),e.clearInterval(Ee.timer.buffering),e.clearInterval(Ee.timer.playing)):"video"===Ee.type&&Ee.videoContainer&&u(Ee.videoContainer),Ee.embed=null,xe(),u(Ee.media),"type"in n&&(Ee.type=n.type,"video"===Ee.type)){var a=n.sources[0];"type"in a&&s(x.types.embed,a.type)&&(Ee.type=a.type)}switch(Ee.supported=S.supported(Ee.type),Ee.type){case"video":Ee.media=t.createElement("video");break;case"audio":Ee.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ee.media=t.createElement("div"),Ee.embedId=n.sources[0].src}c(Ee.container,Ee.media),"undefined"!=typeof n.autoplay&&(x.autoplay=n.autoplay),s(x.types.html5,Ee.type)&&(x.crossorigin&&Ee.media.setAttribute("crossorigin",""),x.autoplay&&Ee.media.setAttribute("autoplay",""),"poster"in n&&Ee.media.setAttribute("poster",n.poster),x.loop&&Ee.media.setAttribute("loop","")),Ee.container.className=Ee.originalClassName,f(Ee.container,x.classes.fullscreen.active,Ee.isFullscreen),f(Ee.container,x.classes.captions.active,Ee.captionsEnabled),D(),s(x.types.html5,Ee.type)&&j("source",n.sources),$(),s(x.types.html5,Ee.type)&&("tracks"in n&&j("track",n.tracks),Ee.media.load(),Fe(),fe()),x.title=n.title,B(),Ee.container.plyr.media=Ee.media}function ke(e){"video"===Ee.type&&Ee.media.setAttribute("poster",e)}function we(){function n(){var e=Ee.media.paused;e?G():Q();var t=Ee.buttons[e?"play":"pause"],n=Ee.buttons[e?"pause":"play"];if(n){var a=y(t,x.classes.tabFocus);setTimeout(function(){n.focus(),a&&(f(t,x.classes.tabFocus,!1),f(n,x.classes.tabFocus,!0))},100)}}function a(){var e=t.activeElement;e&&e!=t.body?t.querySelector&&(e=t.querySelector(":focus")):e=null;for(var n in Ee.buttons){var a=Ee.buttons[n];f(a,x.classes.tabFocus,a===e)}}var r="IE"==Ee.browser.name?"change":"input";b(e,"keyup",function(e){var t=e.keyCode?e.keyCode:e.which;9==t&&a()}),b(t.body,"click",function(){f(V("."+x.classes.tabFocus),x.classes.tabFocus,!1)});for(var s in Ee.buttons){var o=Ee.buttons[s];b(o,"blur",function(){f(o,"tab-focus",!1)})}g(Ee.buttons.play,"click",x.listeners.play,n),g(Ee.buttons.pause,"click",x.listeners.pause,n),g(Ee.buttons.restart,"click",x.listeners.restart,ne),g(Ee.buttons.rewind,"click",x.listeners.rewind,ee),g(Ee.buttons.forward,"click",x.listeners.forward,te),g(Ee.buttons.seek,r,x.listeners.seek,ne),g(Ee.volume,r,x.listeners.volume,function(){le(Ee.volume.value)}),g(Ee.buttons.mute,"click",x.listeners.mute,ie),g(Ee.buttons.fullscreen,"click",x.listeners.fullscreen,se),E.supportsFullScreen&&b(t,E.fullScreenEventName,se),b(Ee.buttons.captions,"click",ce),b(Ee.progress.container,"mouseenter mouseleave mousemove",be),x.hideControls&&(b(Ee.container,"mouseenter mouseleave mousemove",ve),b(Ee.container,"enterfullscreen",ve),b(Ee.controls,"mouseenter mouseleave",function(e){Ee.controls.active="mouseenter"===e.type}))}function Te(){b(Ee.media,"timeupdate seeking",ye),b(Ee.media,"timeupdate",L),b(Ee.media,"durationchange loadedmetadata",fe),b(Ee.media,"ended",function(){"video"===Ee.type&&I(),re()}),b(Ee.media,"progress playing",de),b(Ee.media,"volumechange",ue),b(Ee.media,"play pause",re),b(Ee.media,"waiting canplay seeked",pe),x.clickToPlay&&(Ee.videoContainer.style.cursor="pointer",b(Ee.media,"click",function(){Ee.media.paused?G():Ee.media.ended?(ne(),G()):Q()})),b(Ee.media,x.events.join(" "),function(e){k(Ee.container,e.type)})}function xe(){if(s(x.types.html5,Ee.type)){Ee.media.setAttribute("src","");for(var e=Ee.media.querySelectorAll("source"),t=0;t<e.length;t++)u(e[t]);Ee.media.load(),F("Cancelled network requests for old media")}}function _e(){if(!Ee.init)return null;if(Ee.container.setAttribute("class",m(x.selectors.container)),Ee.init=!1,u(V(x.selectors.controls.wrapper)),"youtube"===Ee.type)return void Ee.embed.destroy();"video"===Ee.type&&(u(V(x.selectors.captions)),l(Ee.videoContainer)),Y(!0);var e=Ee.media.cloneNode(!0);Ee.media.parentNode.replaceChild(e,Ee.media)}function Ce(){if(Ee.init)return null;E=_(),Ee.browser=n(),Ee.media=Ee.container.querySelectorAll("audio, video, div")[0],Ee.originalClassName=Ee.container.className;var e=Ee.media.tagName.toLowerCase();if("div"===e?(Ee.type=Ee.media.getAttribute("data-type"),Ee.embedId=Ee.media.getAttribute("data-video-id"),Ee.media.removeAttribute("data-type"),Ee.media.removeAttribute("data-video-id")):(Ee.type=e,x.crossorigin=null!==Ee.media.getAttribute("crossorigin"),x.autoplay=x.autoplay||null!==Ee.media.getAttribute("autoplay"),x.loop=x.loop||null!==Ee.media.getAttribute("loop")),Ee.supported=S.supported(Ee.type),D(),!Ee.supported.basic)return!1;if(F(Ee.browser.name+" "+Ee.browser.version),$(),s(x.types.html5,Ee.type)){if(!Ee.supported.full)return void(Ee.init=!0);Fe(),B(),x.autoplay&&G()}Ee.init=!0}function Fe(){if(!Ee.supported.full)return F("No full support for this media type ("+Ee.type+")",!0),u(V(x.selectors.controls.wrapper)),void Y(!0);var e=!O(x.selectors.controls.wrapper).length;e&&H(),W()&&(e&&we(),Te(),Y(),N(),P(),le(),ue(),ye(),re(),fe(),k(Ee.container,"ready"))}var Ee=this;return Ee.container=h,Ee.timers={},F(x),Ce(),Ee.init?{media:Ee.media,play:G,pause:Q,restart:ne,
-rewind:ee,forward:te,seek:ne,source:ge,poster:ke,setVolume:le,togglePlay:Z,toggleMute:ie,toggleCaptions:ce,toggleFullscreen:se,isFullscreen:function(){return Ee.isFullscreen||!1},support:function(e){return a(Ee,e)},destroy:_e,restore:Ce}:{}}var E,S={},A={enabled:!0,debug:!1,autoplay:!1,loop:!1,seekTime:10,volume:5,duration:null,displayDuration:!0,iconPrefix:"icon",clickToPlay:!0,hideControls:!0,tooltips:{controls:!1,seek:!0},selectors:{container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{seek:'[data-plyr="seek"]',play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',forward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',volume:'[data-plyr="volume"]',captions:'[data-plyr="captions"]',fullscreen:'[data-plyr="fullscreen"]'},progress:{container:".plyr__progress",buffer:".plyr__progress--buffer",played:".plyr__progress--played"},captions:".plyr__captions",currentTime:".plyr__time--current",duration:".plyr__time--duration"},classes:{videoWrapper:"plyr__video-wrapper",embedWrapper:"plyr__video-embed",type:"plyr--{0}",stopped:"plyr--stopped",playing:"plyr--playing",muted:"plyr--muted",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",active:"plyr--fullscreen-active"},tabFocus:"tab-focus"},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,allowAudio:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","fullscreen"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",played:"played",buffered:"buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",toggleMute:"Toggle Mute",toggleCaptions:"Toggle Captions",toggleFullscreen:"Toggle Fullscreen",frameTitle:"Player for {title}"},types:{embed:["youtube","vimeo","soundcloud"],html5:["video","audio"]},urls:{vimeo:{api:"https://cdn.plyr.io/froogaloop/1.0.1/plyr.froogaloop.js"},youtube:{api:"https://www.youtube.com/iframe_api"},soundcloud:{api:"https://w.soundcloud.com/player/api.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,forward:null,mute:null,volume:null,captions:null,fullscreen:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","emptied"]};return S.supported=function(e){var a,r,s=n(),o="IE"===s.name&&s.version<=9,i=/iPhone|iPod/i.test(navigator.userAgent),l=!!t.createElement("audio").canPlayType,u=!!t.createElement("video").canPlayType;switch(e){case"video":a=u,r=a&&!o&&!i;break;case"audio":a=l,r=a&&!o;break;case"vimeo":case"youtube":case"soundcloud":a=!0,r=!o&&!i;break;default:a=l&&u,r=a&&!o}return{basic:a,full:r}},S.setup=function(e,n){var a=[];if("string"==typeof e?e=t.querySelectorAll(e):e instanceof HTMLElement?e=[e]:e instanceof NodeList||"string"==typeof e||("undefined"==typeof n&&"object"==typeof e&&(n=e),e=t.querySelectorAll(A.selectors.container)),!S.supported().basic||!e.length)return!1;for(var r=0;r<e.length;r++){var s=e[r];if("undefined"==typeof s.plyr){var o=x(A,n,JSON.parse(s.getAttribute("data-plyr")));if(!o.enabled)return;var i=new F(s,o);s.plyr=Object.keys(i).length?i:!1,k(s,"setup",{plyr:s.plyr})}a.push(s.plyr)}return a},S}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}return"function"==typeof window.CustomEvent?!1:(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(); \ No newline at end of file
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define(null,function(){t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,a,r=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",o="11;"):-1!==(n=r.indexOf("MSIE"))?(s="IE",o=r.substring(n+5)):-1!==(n=r.indexOf("Chrome"))?(s="Chrome",o=r.substring(n+7)):-1!==(n=r.indexOf("Safari"))?(s="Safari",o=r.substring(n+7),-1!==(n=r.indexOf("Version"))&&(o=r.substring(n+8))):-1!==(n=r.indexOf("Firefox"))?(s="Firefox",o=r.substring(n+8)):(e=r.lastIndexOf(" ")+1)<(n=r.lastIndexOf("/"))&&(s=r.substring(e,n),o=r.substring(n+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(a=o.indexOf(";"))&&(o=o.substring(0,a)),-1!==(a=o.indexOf(" "))&&(o=o.substring(0,a)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform),touch:"ontouchstart"in t.documentElement}}function a(e,t){var n=e.media;if("video"==e.type)switch(t){case"video/webm":return!(!n.canPlayType||!n.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,""));case"video/mp4":return!(!n.canPlayType||!n.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,""));case"video/ogg":return!(!n.canPlayType||!n.canPlayType('video/ogg; codecs="theora"').replace(/no/,""))}else if("audio"==e.type)switch(t){case"audio/mpeg":return!(!n.canPlayType||!n.canPlayType("audio/mpeg;").replace(/no/,""));case"audio/ogg":return!(!n.canPlayType||!n.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,""));case"audio/wav":return!(!n.canPlayType||!n.canPlayType('audio/wav; codecs="1"').replace(/no/,""))}return!1}function r(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var a=t.getElementsByTagName("script")[0];a.parentNode.insertBefore(n,a)}}function s(e,t){return Array.prototype.indexOf&&-1!=e.indexOf(t)}function o(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?\^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function i(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var a=n>0?t.cloneNode(!0):t,r=e[n],s=r.parentNode,o=r.nextSibling;a.appendChild(r),o?s.insertBefore(a,o):s.appendChild(a)}}function l(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}function u(e){e&&e.parentNode.removeChild(e)}function c(e,t){e.insertBefore(t,e.firstChild)}function p(e,t){for(var n in t)e.setAttribute(n,"boolean"==typeof t[n]&&t[n]?"":t[n])}function d(e,n,a){var r=t.createElement(e);p(r,a),c(n,r)}function m(e){return e.replace(".","")}function f(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var a=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=a+(n?" "+t:"")}}function y(e,t){return e?e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className):!1}function b(e,t,n,a){e&&h(e,t,n,!0,a)}function v(e,t,n,a){e&&h(e,t,n,!1,a)}function g(e,t,n,a,r){b(e,t,function(t){n&&n.apply(e,[t]),a.apply(e,[t])},r)}function h(e,t,n,a,r){var s=t.split(" ");if("boolean"!=typeof r&&(r=!1),e instanceof NodeList)for(var o=0;o<e.length;o++)e[o]instanceof Node&&h(e[o],arguments[1],arguments[2],arguments[3]);else for(var i=0;i<s.length;i++)e[a?"addEventListener":"removeEventListener"](s[i],n,r)}function k(e,t,n){if(e&&t){var a=new CustomEvent(t,n);e.dispatchEvent(a)}}function w(e,t){return e?(t="boolean"==typeof t?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t):void 0}function T(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function _(){var e=arguments;if(e.length){if(1==e.lenth)return e[0];for(var t=Array.prototype.shift.call(e),n=e.length,a=0;n>a;a++){var r=e[a];for(var s in r)r[s]&&r[s].constructor&&r[s].constructor===Object?(t[s]=t[s]||{},_(t[s],r[s])):t[s]=r[s]}return t}}function x(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit moz o ms khtml".split(" ");if("undefined"!=typeof t.cancelFullScreen)e.supportsFullScreen=!0;else for(var a=0,r=n.length;r>a;a++){if(e.prefix=n[a],"undefined"!=typeof t[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof t.msExitFullscreen&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch("undefined"==typeof e&&(e=t.body),this.prefix){case"":return t.fullscreenElement==e;case"moz":return t.mozFullScreenElement==e;default:return t[this.prefix+"FullscreenElement"]==e}},e.requestFullScreen=function(e){return"undefined"==typeof e&&(e=t.body),""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]()},e.cancelFullScreen=function(){return""===this.prefix?t.cancelFullScreen():t[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?t.fullscreenElement:t[this.prefix+"FullscreenElement"]}),e}function C(){var t={supported:function(){if(!("localStorage"in e))return!1;try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(n){return!1}return!1}()};return t}function F(h,_){function F(t,n){_.debug&&e.console&&console[n?"warn":"log"](t)}function A(){var e=[],t=_.iconUrl+"#"+_.iconPrefix;return s(_.controls,"play-large")&&e.push('<button type="button" data-plyr="play" class="plyr__play-large">','<svg><use xlink:href="'+t+'-play" /></svg>','<span class="plyr__sr-only">'+_.i18n.play+"</span>","</button>"),e.push('<div class="plyr__controls">'),s(_.controls,"restart")&&e.push('<button type="button" data-plyr="restart">','<svg><use xlink:href="'+t+'-restart" /></svg>','<span class="plyr__sr-only">'+_.i18n.restart+"</span>","</button>"),s(_.controls,"rewind")&&e.push('<button type="button" data-plyr="rewind">','<svg><use xlink:href="'+t+'-rewind" /></svg>','<span class="plyr__sr-only">'+_.i18n.rewind+"</span>","</button>"),s(_.controls,"play")&&e.push('<button type="button" data-plyr="play">','<svg><use xlink:href="'+t+'-play" /></svg>','<span class="plyr__sr-only">'+_.i18n.play+"</span>","</button>",'<button type="button" data-plyr="pause">','<svg><use xlink:href="'+t+'-pause" /></svg>','<span class="plyr__sr-only">'+_.i18n.pause+"</span>","</button>"),s(_.controls,"fast-forward")&&e.push('<button type="button" data-plyr="fast-forward">','<svg><use xlink:href="'+t+'-fast-forward" /></svg>','<span class="plyr__sr-only">'+_.i18n.forward+"</span>","</button>"),s(_.controls,"progress")&&(e.push('<span class="plyr__progress">','<label for="seek{id}" class="plyr__sr-only">Seek</label>','<input id="seek{id}" class="plyr__progress--seek" type="range" min="0" max="100" step="0.1" value="0" data-plyr="seek">','<progress class="plyr__progress--played" max="100" value="0" role="presentation"></progress>','<progress class="plyr__progress--buffer" max="100" value="0">',"<span>0</span>% "+_.i18n.buffered,"</progress>"),_.tooltips.seek&&e.push('<span class="plyr__tooltip">00:00</span>'),e.push("</span>")),s(_.controls,"current-time")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+_.i18n.currentTime+"</span>",'<span class="plyr__time--current">00:00</span>',"</span>"),s(_.controls,"duration")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+_.i18n.duration+"</span>",'<span class="plyr__time--duration">00:00</span>',"</span>"),s(_.controls,"mute")&&e.push('<button type="button" data-plyr="mute">','<svg class="icon--muted"><use xlink:href="'+t+'-muted" /></svg>','<svg><use xlink:href="'+t+'-volume" /></svg>','<span class="plyr__sr-only">'+_.i18n.toggleMute+"</span>","</button>"),s(_.controls,"volume")&&e.push('<span class="plyr__volume">','<label for="volume{id}" class="plyr__sr-only">'+_.i18n.volume+"</label>",'<input id="volume{id}" class="plyr__volume--input" type="range" min="0" max="10" value="5" data-plyr="volume">','<progress class="plyr__volume--display" max="10" value="0" role="presentation"></progress>',"</span>"),s(_.controls,"captions")&&e.push('<button type="button" data-plyr="captions">','<svg class="icon--captions-on"><use xlink:href="'+t+'-captions-on" /></svg>','<svg><use xlink:href="'+t+'-captions-off" /></svg>','<span class="plyr__sr-only">'+_.i18n.toggleCaptions+"</span>","</button>"),s(_.controls,"fullscreen")&&e.push('<button type="button" data-plyr="fullscreen">','<svg class="icon--exit-fullscreen"><use xlink:href="'+t+'-exit-fullscreen" /></svg>','<svg><use xlink:href="'+t+'-enter-fullscreen" /></svg>','<span class="plyr__sr-only">'+_.i18n.toggleFullscreen+"</span>","</button>"),e.push("</div>"),e.join("")}function N(){if(Ee.supported.full&&("audio"!=Ee.type||_.fullscreen.allowAudio)&&_.fullscreen.enabled){var e=E.supportsFullScreen;e||_.fullscreen.fallback&&!R()?(F((e?"Native":"Fallback")+" fullscreen enabled"),f(Ee.container,_.classes.fullscreen.enabled,!0)):F("Fullscreen not supported and fallback disabled"),w(Ee.buttons.fullscreen,!1),q()}}function I(){if("video"===Ee.type){V(_.selectors.captions)||Ee.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+m(_.selectors.captions)+'"></div>'),Ee.usingTextTracks=!1,Ee.media.textTracks&&(Ee.usingTextTracks=!0);for(var e,t="",n=Ee.media.childNodes,a=0;a<n.length;a++)"track"===n[a].nodeName.toLowerCase()&&(e=n[a].kind,"captions"!==e&&"subtitles"!==e||(t=n[a].getAttribute("src")));if(Ee.captionExists=!0,""===t?(Ee.captionExists=!1,F("No caption track found")):F("Caption track found; URI: "+t),Ee.captionExists){for(var r=Ee.media.textTracks,s=0;s<r.length;s++)r[s].mode="hidden";if(M(Ee),("IE"===Ee.browser.name&&Ee.browser.version>=10||"Firefox"===Ee.browser.name&&Ee.browser.version>=31)&&(F("Detected browser with known TextTrack issues - using manual fallback"),Ee.usingTextTracks=!1),Ee.usingTextTracks){F("TextTracks supported");for(var o=0;o<r.length;o++){var i=r[o];"captions"!==i.kind&&"subtitles"!==i.kind||b(i,"cuechange",function(){this.activeCues[0]&&"text"in this.activeCues[0]?P(this.activeCues[0].getCueAsHTML()):P()})}}else if(F("TextTracks not supported so rendering captions manually"),Ee.currentCaption="",Ee.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],n=l.responseText;t=n.split("\n\n");for(var a=0;a<t.length;a++){e=t[a],Ee.captions[a]=[];var r=e.split("\n"),s=0;-1===r[s].indexOf(":")&&(s=1),Ee.captions[a]=[r[s],r[s+1]]}Ee.captions.shift(),F("Successfully loaded the caption file via AJAX")}else F("There was a problem loading the caption file via AJAX",!0)},l.open("get",t,!0),l.send()}}else f(Ee.container,_.classes.captions.enabled)}}function P(e){var n=V(_.selectors.captions),a=t.createElement("span");n.innerHTML="","undefined"==typeof e&&(e=""),"string"==typeof e?a.innerHTML=e.trim():a.appendChild(e),n.appendChild(a);n.offsetHeight}function L(e){function t(e,t){var n=[];n=e.split(" --> ");for(var a=0;a<n.length;a++)n[a]=n[a].replace(/(\d+:\d+:\d+\.\d+).*/,"$1");return r(n[t])}function n(e){return t(e,0)}function a(e){return t(e,1)}function r(e){if(null===e||void 0===e)return 0;var t,n=[],a=[];return n=e.split(","),a=n[0].split(":"),t=Math.floor(60*a[0]*60)+Math.floor(60*a[1])+Math.floor(a[2])}if(!Ee.usingTextTracks&&"video"===Ee.type&&Ee.supported.full&&(Ee.subcount=0,e="number"==typeof e?e:Ee.media.currentTime,Ee.captions[Ee.subcount])){for(;a(Ee.captions[Ee.subcount][0])<e.toFixed(1);)if(Ee.subcount++,Ee.subcount>Ee.captions.length-1){Ee.subcount=Ee.captions.length-1;break}Ee.media.currentTime.toFixed(1)>=n(Ee.captions[Ee.subcount][0])&&Ee.media.currentTime.toFixed(1)<=a(Ee.captions[Ee.subcount][0])?(Ee.currentCaption=Ee.captions[Ee.subcount][1],P(Ee.currentCaption)):P()}}function M(){Ee.buttons.captions&&(f(Ee.container,_.classes.captions.enabled,!0),_.captions.defaultActive&&(f(Ee.container,_.classes.captions.active,!0),w(Ee.buttons.captions,!0)))}function O(e){return Ee.container.querySelectorAll(e)}function V(e){return O(e)[0]}function R(){try{return e.self!==e.top}catch(t){return!0}}function q(){function e(e){9===e.which&&Ee.isFullscreen&&(e.target!==a||e.shiftKey?e.target===n&&e.shiftKey&&(e.preventDefault(),a.focus()):(e.preventDefault(),n.focus()))}var t=O("input:not([disabled]), button:not([disabled])"),n=t[0],a=t[t.length-1];b(Ee.container,"keydown",e)}function j(e,t){if("string"==typeof t)d(e,Ee.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ee.media,t[n])}function W(){var e=_.html;F("Injecting custom controls"),e||(e=A()),e=o(e,"{seektime}",_.seekTime),e=o(e,"{id}",Math.floor(1e4*Math.random()));var n;if(null!==_.selectors.controls.container&&(n=_.selectors.controls.container,"string"==typeof selector&&(n=t.querySelector(n))),n instanceof HTMLElement||(n=Ee.container),n.insertAdjacentHTML("beforeend",e),_.tooltips.controls)for(var a=O([_.selectors.controls.wrapper," ",_.selectors.labels," .",_.classes.hidden].join("")),r=a.length-1;r>=0;r--){var s=a[r];f(s,_.classes.hidden,!1),f(s,_.classes.tooltip,!0)}}function H(){try{return Ee.controls=V(_.selectors.controls.wrapper),Ee.buttons={},Ee.buttons.seek=V(_.selectors.buttons.seek),Ee.buttons.play=O(_.selectors.buttons.play),Ee.buttons.pause=V(_.selectors.buttons.pause),Ee.buttons.restart=V(_.selectors.buttons.restart),Ee.buttons.rewind=V(_.selectors.buttons.rewind),Ee.buttons.forward=V(_.selectors.buttons.forward),Ee.buttons.fullscreen=V(_.selectors.buttons.fullscreen),Ee.buttons.mute=V(_.selectors.buttons.mute),Ee.buttons.captions=V(_.selectors.buttons.captions),Ee.progress={},Ee.progress.container=V(_.selectors.progress.container),Ee.progress.buffer={},Ee.progress.buffer.bar=V(_.selectors.progress.buffer),Ee.progress.buffer.text=Ee.progress.buffer.bar&&Ee.progress.buffer.bar.getElementsByTagName("span")[0],Ee.progress.played=V(_.selectors.progress.played),Ee.progress.tooltip=Ee.progress.container&&Ee.progress.container.querySelector("."+_.classes.tooltip),Ee.volume={},Ee.volume.input=V(_.selectors.volume.input),Ee.volume.display=V(_.selectors.volume.display),Ee.duration=V(_.selectors.duration),Ee.currentTime=V(_.selectors.currentTime),Ee.seekTime=O(_.selectors.seekTime),!0}catch(e){return F("It looks like there is a problem with your controls html",!0),Y(!0),!1}}function D(){f(Ee.container,_.selectors.container.replace(".",""),Ee.supported.full)}function Y(e){e?Ee.media.setAttribute("controls",""):Ee.media.removeAttribute("controls")}function B(e){var t=_.i18n.play;if("undefined"!=typeof _.title&&_.title.length&&(t+=", "+_.title),Ee.supported.full&&Ee.buttons.play)for(var n=Ee.buttons.play.length-1;n>=0;n--)Ee.buttons.play[n].setAttribute("aria-label",t);e instanceof HTMLElement&&e.setAttribute("title",_.i18n.frameTitle.replace("{title}",_.title))}function U(){if(!Ee.media)return F("No audio or video element found",!0),!1;if(Ee.supported.full&&(f(Ee.container,_.classes.type.replace("{0}",Ee.type),!0),s(_.types.embed,Ee.type)&&f(Ee.container,_.classes.type.replace("{0}","video"),!0),f(Ee.container,_.classes.stopped,_.autoplay),f(Ee.container,_.classes.isIos,Ee.browser.ios),f(Ee.container,_.classes.isTouch,Ee.browser.touch),"video"===Ee.type)){var e=t.createElement("div");e.setAttribute("class",_.classes.videoWrapper),i(Ee.media,e),Ee.videoContainer=e}s(_.types.embed,Ee.type)&&($(),Ee.embedId=null)}function $(){for(var n=t.createElement("div"),a=Ee.embedId,s=Ee.type+"-"+Math.floor(1e4*Math.random()),o=O('[id^="'+Ee.type+'-"]'),i=o.length-1;i>=0;i--)u(o[i]);if(f(Ee.media,_.classes.videoWrapper,!0),f(Ee.media,_.classes.embedWrapper,!0),"youtube"===Ee.type)Ee.media.appendChild(n),n.setAttribute("id",s),"object"==typeof YT?K(a,n):(r(_.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){K(a,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://player.vimeo.com/video/"+a+"?player_id="+s+"&api=1&badge=0&byline=0&portrait=0&title=0",id:s,webkitallowfullscreen:"",mozallowfullscreen:"",allowfullscreen:"",frameborder:0}),Ee.supported.full?(n.appendChild(l),Ee.media.appendChild(n)):Ee.media.appendChild(l),"$f"in e||r(_.urls.vimeo.api);var c=e.setInterval(function(){"$f"in e&&l.loaded&&(e.clearInterval(c),X.call(l))},50)}else if("soundcloud"===Ee.type){var l=t.createElement("iframe");l.loaded=!1,b(l,"load",function(){l.loaded=!0}),p(l,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+a,id:s}),n.appendChild(l),Ee.media.appendChild(n),e.SC||r(_.urls.soundcloud.api);var c=e.setInterval(function(){e.SC&&l.loaded&&(e.clearInterval(c),J.call(l))},50)}}function z(){Ee.container.plyr.embed=Ee.embed,Fe(),B(V("iframe"))}function K(t,n){"timer"in Ee||(Ee.timer={}),Ee.embed=new YT.Player(n.id,{videoId:t,playerVars:{autoplay:_.autoplay?1:0,controls:Ee.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:_.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onReady:function(t){var n=t.target;Ee.media.play=function(){n.playVideo(),Ee.media.paused=!1},Ee.media.pause=function(){n.pauseVideo(),Ee.media.paused=!0},Ee.media.stop=function(){n.stopVideo(),Ee.media.paused=!0},Ee.media.duration=n.getDuration(),Ee.media.paused=!0,Ee.media.currentTime=n.getCurrentTime(),Ee.media.muted=n.isMuted(),_.title=n.getVideoData().title,k(Ee.media,"timeupdate"),e.clearInterval(Ee.timer.buffering),Ee.timer.buffering=e.setInterval(function(){Ee.media.buffered=n.getVideoLoadedFraction(),k(Ee.media,"progress"),1===Ee.media.buffered&&(e.clearInterval(Ee.timer.buffering),k(Ee.media,"canplaythrough"))},200),z(),fe()},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Ee.timer.playing),t.data){case 0:Ee.media.paused=!0,k(Ee.media,"ended");break;case 1:Ee.media.paused=!1,Ee.media.seeking=!1,k(Ee.media,"play"),k(Ee.media,"playing"),Ee.timer.playing=e.setInterval(function(){Ee.media.currentTime=n.getCurrentTime(),k(Ee.media,"timeupdate")},100);break;case 2:Ee.media.paused=!0,k(Ee.media,"pause")}}}})}function X(){Ee.embed=$f(this),Ee.embed.addEvent("ready",function(){Ee.media.play=function(){Ee.embed.api("play"),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.api("pause"),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.api("stop"),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.api("getCurrentTime",function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.api("getDuration",function(e){Ee.media.duration=e,fe()}),Ee.embed.addEvent("play",function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.addEvent("pause",function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.addEvent("playProgress",function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.seconds,k(Ee.media,"timeupdate")}),Ee.embed.addEvent("loadProgress",function(e){Ee.media.buffered=e.percent,k(Ee.media,"progress"),1===parseInt(e.percent)&&k(Ee.media,"canplaythrough")}),Ee.embed.addEvent("finish",function(){Ee.media.paused=!0,k(Ee.media,"ended")}),_.autoplay&&Ee.embed.api("play")})}function J(){Ee.embed=SC.Widget(this),Ee.embed.bind(SC.Widget.Events.READY,function(){Ee.media.play=function(){Ee.embed.play(),Ee.media.paused=!1},Ee.media.pause=function(){Ee.embed.pause(),Ee.media.paused=!0},Ee.media.stop=function(){Ee.embed.seekTo(0),Ee.embed.pause(),Ee.media.paused=!0},Ee.media.paused=!0,Ee.media.currentTime=0,z(),Ee.embed.getPosition(function(e){Ee.media.currentTime=e,k(Ee.media,"timeupdate")}),Ee.embed.getDuration(function(e){Ee.media.duration=e/1e3,fe()}),Ee.embed.bind(SC.Widget.Events.PLAY,function(){Ee.media.paused=!1,k(Ee.media,"play"),k(Ee.media,"playing")}),Ee.embed.bind(SC.Widget.Events.PAUSE,function(){Ee.media.paused=!0,k(Ee.media,"pause")}),Ee.embed.bind(SC.Widget.Events.PLAY_PROGRESS,function(e){Ee.media.seeking=!1,Ee.media.currentTime=e.currentPosition/1e3,k(Ee.media,"timeupdate")}),Ee.embed.bind(SC.Widget.Events.LOAD_PROGRESS,function(e){Ee.media.buffered=e.loadProgress,k(Ee.media,"progress"),1===parseInt(e.loadProgress)&&k(Ee.media,"canplaythrough")}),Ee.embed.bind(SC.Widget.Events.FINISH,function(){Ee.media.paused=!0,k(Ee.media,"ended")}),_.autoplay&&Ee.embed.play()})}function G(){"play"in Ee.media&&Ee.media.play()}function Q(){"pause"in Ee.media&&Ee.media.pause()}function Z(e){e===!0?G():e===!1?Q():Ee.media[Ee.media.paused?"play":"pause"]()}function ee(e){"number"!=typeof e&&(e=_.seekTime),ne(Ee.media.currentTime-e)}function te(e){"number"!=typeof e&&(e=_.seekTime),ne(Ee.media.currentTime+e)}function ne(e){var t=0,n=Ee.media.paused,a=ae();"number"==typeof e?t=e:"object"!=typeof e||"input"!==e.type&&"change"!==e.type||(t=e.target.value/e.target.max*a),0>t?t=0:t>a&&(t=a),Ee.progress&&Ee.progress.played&&(Ee.progress.played.value=100/a*t);try{Ee.media.currentTime=t.toFixed(1)}catch(r){}if(s(_.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.seekTo(t);break;case"vimeo":Ee.embed.api("seekTo",t.toFixed(0));break;case"soundcloud":Ee.embed.seekTo(1e3*t)}n&&Q(),k(Ee.media,"timeupdate"),Ee.media.seeking=!0}F("Seeking to "+Ee.media.currentTime+" seconds"),L(t)}function ae(){var e=parseInt(_.duration);return isNaN(e)?Ee.media.duration:e}function re(){f(Ee.container,_.classes.playing,!Ee.media.paused),f(Ee.container,_.classes.stopped,Ee.media.paused),ve(Ee.media.paused)}function se(e){var n=E.supportsFullScreen;e&&e.type===E.fullScreenEventName?Ee.isFullscreen=E.isFullScreen(Ee.container):n?(E.isFullScreen(Ee.container)?E.cancelFullScreen():E.requestFullScreen(Ee.container),Ee.isFullscreen=E.isFullScreen(Ee.container)):(Ee.isFullscreen=!Ee.isFullscreen,Ee.isFullscreen?(b(t,"keyup",oe),t.body.style.overflow="hidden"):(v(t,"keyup",oe),t.body.style.overflow="")),f(Ee.container,_.classes.fullscreen.active,Ee.isFullscreen),Ee.isFullscreen?Ee.container.setAttribute("tabindex","-1"):Ee.container.removeAttribute("tabindex"),q(Ee.isFullscreen),w(Ee.buttons.fullscreen,Ee.isFullscreen),k(Ee.container,Ee.isFullscreen?"enterfullscreen":"exitfullscreen")}function oe(e){27===(e.which||e.charCode||e.keyCode)&&Ee.isFullscreen&&se()}function ie(e){if("boolean"!=typeof e&&(e=!Ee.media.muted),w(Ee.buttons.mute,e),Ee.media.muted=e,0===Ee.media.volume&&le(_.volume),s(_.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed[Ee.media.muted?"mute":"unMute"]();break;case"vimeo":Ee.embed.api("setVolume",Ee.media.muted?0:parseFloat(_.volume/10));break;case"soundcloud":Ee.embed.setVolume(Ee.media.muted?0:parseFloat(_.volume/10))}k(Ee.media,"volumechange")}}function le(t){if("undefined"==typeof t&&(t=_.volume,_.storage.enabled&&C().supported&&(t=e.localStorage.getItem(_.storage.key),e.localStorage.removeItem("plyr-volume"))),(null===t||isNaN(t))&&(t=_.volume),t>10&&(t=10),0>t&&(t=0),Ee.media.volume=parseFloat(t/10),Ee.volume.display&&(Ee.volume.display.value=t),s(_.types.embed,Ee.type)){switch(Ee.type){case"youtube":Ee.embed.setVolume(100*Ee.media.volume);break;case"vimeo":Ee.embed.api("setVolume",Ee.media.volume);break;case"soundcloud":Ee.embed.setVolume(Ee.media.volume)}k(Ee.media,"volumechange")}Ee.media.muted&&t>0&&ie()}function ue(){var t=Ee.media.muted?0:10*Ee.media.volume;Ee.supported.full&&(Ee.volume.input&&(Ee.volume.input.value=t),Ee.volume.display&&(Ee.volume.display.value=t)),_.storage.enabled&&C().supported&&!isNaN(t)&&e.localStorage.setItem(_.storage.key,t),f(Ee.container,_.classes.muted,0===t),Ee.supported.full&&Ee.buttons.mute&&w(Ee.buttons.mute,0===t)}function ce(e){Ee.supported.full&&Ee.buttons.captions&&("boolean"!=typeof e&&(e=-1===Ee.container.className.indexOf(_.classes.captions.active)),Ee.captionsEnabled=e,w(Ee.buttons.captions,Ee.captionsEnabled),f(Ee.container,_.classes.captions.active,Ee.captionsEnabled),k(Ee.container,Ee.captionsEnabled?"captionsenabled":"captionsdisabled"))}function pe(e){var t="waiting"===e.type;clearTimeout(Ee.timers.loading),Ee.timers.loading=setTimeout(function(){f(Ee.container,_.classes.loading,t)},t?250:0)}function de(e){var t=Ee.progress.played,n=!1,a=0,r=ae();if(e)switch(e.type){case"timeupdate":case"seeking":a=T(Ee.media.currentTime,r),"timeupdate"==e.type&&Ee.buttons.seek&&(Ee.buttons.seek.value=a);break;case"playing":case"progress":t=Ee.progress.buffer.bar,n=Ee.progress.buffer.text,a=function(){var e=Ee.media.buffered;return e&&e.length?T(e.end(0),r):"number"==typeof e?100*e:0}()}t&&(t.value=a),n&&(n.innerHTML=a)}function me(e,t){if(t){isNaN(e)&&(e=0),Ee.secs=parseInt(e%60),Ee.mins=parseInt(e/60%60),Ee.hours=parseInt(e/60/60%60);var n=parseInt(ae()/60/60%60)>0;Ee.secs=("0"+Ee.secs).slice(-2),Ee.mins=("0"+Ee.mins).slice(-2),t.innerHTML=(n?Ee.hours+":":"")+Ee.mins+":"+Ee.secs}}function fe(){if(Ee.supported.full){var e=ae()||0;!Ee.duration&&_.displayDuration&&Ee.media.paused&&me(e,Ee.currentTime),Ee.duration&&me(e,Ee.duration),be()}}function ye(e){me(Ee.media.currentTime,Ee.currentTime),e&&"timeupdate"==e.type&&Ee.media.seeking||de(e)}function be(e){if(_.tooltips.seek&&!Ee.browser.touch&&Ee.progress.container){var t=Ee.progress.container.getBoundingClientRect(),n=0,a=_.classes.tooltip+"--visible";if(e)n=100/t.width*(e.pageX-t.left);else{if(!y(Ee.progress.tooltip,a))return;n=Ee.progress.tooltip.style.left.replace("%","")}0>n?n=0:n>100&&(n=100),me(ae()/100*n,Ee.progress.tooltip),Ee.progress.tooltip.style.left=n+"%",e&&s(["mouseenter","mouseleave"],e.type)&&f(Ee.progress.tooltip,a,"mouseenter"===e.type)}}function ve(t){if(_.hideControls&&"audio"!==Ee.type){var n=0,a=!1,r=t;"boolean"!=typeof t&&(t&&t.type?(a="enterfullscreen"===t.type,r=s(["mousemove","mouseenter","focus"],t.type),"mousemove"===t.type&&(n=2e3),"focus"===t.type&&(n=3e3)):r=!1),e.clearTimeout(Ee.timers.hover),(r||Ee.media.paused)&&(f(Ee.container,_.classes.hideControls,!1),Ee.media.paused)||r&&Ee.media.paused||(Ee.timers.hover=e.setTimeout(function(){Ee.controls.active&&!a||f(Ee.container,_.classes.hideControls,!0)},n))}}function ge(e){if("undefined"!=typeof e)return void he(e);var t;switch(Ee.type){case"youtube":t=Ee.embed.getVideoUrl();break;case"vimeo":Ee.embed.api("getVideoUrl",function(e){t=e});break;case"soundcloud":Ee.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ee.media.currentSrc}return t||""}function he(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void F("Invalid source format",!0);if(Q(),Ee.buttons&&Ee.buttons.seek&&(Ee.buttons.seek.value=0),Ee.progress&&Ee.progress.played&&(Ee.progress.played.value=0),"youtube"===Ee.type?(Ee.embed.destroy(),e.clearInterval(Ee.timer.buffering),e.clearInterval(Ee.timer.playing)):"video"===Ee.type&&Ee.videoContainer&&u(Ee.videoContainer),Ee.embed=null,_e(),u(Ee.media),"type"in n&&(Ee.type=n.type,"video"===Ee.type)){var a=n.sources[0];"type"in a&&s(_.types.embed,a.type)&&(Ee.type=a.type)}switch(Ee.supported=S.supported(Ee.type),Ee.type){case"video":Ee.media=t.createElement("video");break;case"audio":Ee.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ee.media=t.createElement("div"),Ee.embedId=n.sources[0].src}c(Ee.container,Ee.media),"undefined"!=typeof n.autoplay&&(_.autoplay=n.autoplay),s(_.types.html5,Ee.type)&&(_.crossorigin&&Ee.media.setAttribute("crossorigin",""),_.autoplay&&Ee.media.setAttribute("autoplay",""),"poster"in n&&Ee.media.setAttribute("poster",n.poster),_.loop&&Ee.media.setAttribute("loop","")),Ee.container.className=Ee.originalClassName,f(Ee.container,_.classes.fullscreen.active,Ee.isFullscreen),f(Ee.container,_.classes.captions.active,Ee.captionsEnabled),D(),s(_.types.html5,Ee.type)&&j("source",n.sources),U(),s(_.types.html5,Ee.type)&&("tracks"in n&&j("track",n.tracks),Ee.media.load(),Fe(),fe()),_.title=n.title,B(),Ee.container.plyr.media=Ee.media}function ke(e){"video"===Ee.type&&Ee.media.setAttribute("poster",e)}function we(){function n(){var e=Ee.media.paused;e?G():Q();var t=Ee.buttons[e?"play":"pause"],n=Ee.buttons[e?"pause":"play"];if(n=n&&n.length>1?n[n.length-1]:n[0]){var a=y(t,_.classes.tabFocus);setTimeout(function(){n.focus(),a&&(f(t,_.classes.tabFocus,!1),f(n,_.classes.tabFocus,!0))},100)}}function a(){var e=t.activeElement;e&&e!=t.body?t.querySelector&&(e=t.querySelector(":focus")):e=null;for(var n in Ee.buttons){var a=Ee.buttons[n];if(a instanceof NodeList)for(var r=0;r<a.length;r++)f(a[r],_.classes.tabFocus,a[r]===e);else f(a,_.classes.tabFocus,a===e)}}var r="IE"==Ee.browser.name?"change":"input";b(e,"keyup",function(e){var t=e.keyCode?e.keyCode:e.which;9==t&&a()}),b(t.body,"click",function(){f(V("."+_.classes.tabFocus),_.classes.tabFocus,!1)});for(var s in Ee.buttons){var o=Ee.buttons[s];b(o,"blur",function(){f(o,"tab-focus",!1)})}g(Ee.buttons.play,"click",_.listeners.play,n),g(Ee.buttons.pause,"click",_.listeners.pause,n),g(Ee.buttons.restart,"click",_.listeners.restart,ne),g(Ee.buttons.rewind,"click",_.listeners.rewind,ee),g(Ee.buttons.forward,"click",_.listeners.forward,te),g(Ee.buttons.seek,r,_.listeners.seek,ne),g(Ee.volume.input,r,_.listeners.volume,function(){le(Ee.volume.input.value)}),g(Ee.buttons.mute,"click",_.listeners.mute,ie),g(Ee.buttons.fullscreen,"click",_.listeners.fullscreen,se),E.supportsFullScreen&&b(t,E.fullScreenEventName,se),b(Ee.buttons.captions,"click",ce),b(Ee.progress.container,"mouseenter mouseleave mousemove",be),_.hideControls&&(b(Ee.container,"mouseenter mouseleave mousemove enterfullscreen",ve),b(Ee.controls,"mouseenter mouseleave",function(e){Ee.controls.active="mouseenter"===e.type}),b(Ee.controls,"focus blur",ve,!0))}function Te(){if(b(Ee.media,"timeupdate seeking",ye),b(Ee.media,"timeupdate",L),b(Ee.media,"durationchange loadedmetadata",fe),b(Ee.media,"ended",function(){"video"===Ee.type&&P(),re()}),b(Ee.media,"progress playing",de),b(Ee.media,"volumechange",ue),b(Ee.media,"play pause",re),b(Ee.media,"waiting canplay seeked",pe),_.clickToPlay&&"audio"!==Ee.type){var e=V("."+_.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",b(e,"click",function(){Ee.media.paused?G():Ee.media.ended?(ne(),G()):Q()})}b(Ee.media,_.events.join(" "),function(e){k(Ee.container,e.type)})}function _e(){if(s(_.types.html5,Ee.type)){Ee.media.setAttribute("src","");for(var e=Ee.media.querySelectorAll("source"),t=0;t<e.length;t++)u(e[t]);Ee.media.load(),F("Cancelled network requests for old media")}}function xe(){if(!Ee.init)return null;if(Ee.container.setAttribute("class",m(_.selectors.container)),Ee.init=!1,u(V(_.selectors.controls.wrapper)),"youtube"===Ee.type)return void Ee.embed.destroy();"video"===Ee.type&&(u(V(_.selectors.captions)),l(Ee.videoContainer)),Y(!0);var e=Ee.media.cloneNode(!0);Ee.media.parentNode.replaceChild(e,Ee.media)}function Ce(){if(Ee.init)return null;if(E=x(),Ee.browser=n(),Ee.media=Ee.container.querySelectorAll("audio, video")[0],Ee.media||(Ee.media=Ee.container.querySelectorAll("div")[0]),Ee.media){Ee.originalClassName=Ee.container.className;var e=Ee.media.tagName.toLowerCase();if("div"===e?(Ee.type=Ee.media.getAttribute("data-type"),Ee.embedId=Ee.media.getAttribute("data-video-id"),Ee.media.removeAttribute("data-type"),Ee.media.removeAttribute("data-video-id")):(Ee.type=e,_.crossorigin=null!==Ee.media.getAttribute("crossorigin"),_.autoplay=_.autoplay||null!==Ee.media.getAttribute("autoplay"),_.loop=_.loop||null!==Ee.media.getAttribute("loop")),Ee.supported=S.supported(Ee.type),D(),!Ee.supported.basic)return!1;if(F(Ee.browser.name+" "+Ee.browser.version),U(),s(_.types.html5,Ee.type)){if(!Ee.supported.full)return void(Ee.init=!0);
+Fe(),B(),_.autoplay&&G()}Ee.init=!0}}function Fe(){if(!Ee.supported.full)return F("No full support for this media type ("+Ee.type+")",!0),u(V(_.selectors.controls.wrapper)),u(V(_.selectors.buttons.play)),void Y(!0);var e=!O(_.selectors.controls.wrapper).length;e&&W(),H()&&(e&&we(),Te(),Y(),N(),I(),le(),ue(),ye(),re(),fe(),k(Ee.container,"ready"))}var Ee=this;return Ee.container=h,Ee.timers={},F(_),Ce(),Ee.init?{media:Ee.media,play:G,pause:Q,restart:ne,rewind:ee,forward:te,seek:ne,source:ge,poster:ke,setVolume:le,togglePlay:Z,toggleMute:ie,toggleCaptions:ce,toggleFullscreen:se,isFullscreen:function(){return Ee.isFullscreen||!1},support:function(e){return a(Ee,e)},destroy:xe,restore:Ce}:{}}var E,S={},A={enabled:!0,debug:!1,autoplay:!1,loop:!1,seekTime:10,volume:5,duration:null,displayDuration:!0,iconPrefix:"icon",iconUrl:"",clickToPlay:!0,hideControls:!0,tooltips:{controls:!1,seek:!0},selectors:{container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{seek:'[data-plyr="seek"]',play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',forward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',fullscreen:'[data-plyr="fullscreen"]'},volume:{input:'[data-plyr="volume"]',display:".plyr__volume--display"},progress:{container:".plyr__progress",buffer:".plyr__progress--buffer",played:".plyr__progress--played"},captions:".plyr__captions",currentTime:".plyr__time--current",duration:".plyr__time--duration"},classes:{videoWrapper:"plyr__video-wrapper",embedWrapper:"plyr__video-embed",type:"plyr--{0}",stopped:"plyr--stopped",playing:"plyr--playing",muted:"plyr--muted",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",active:"plyr--fullscreen-active"},tabFocus:"tab-focus"},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,allowAudio:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","fullscreen"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",played:"played",buffered:"buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",toggleMute:"Toggle Mute",toggleCaptions:"Toggle Captions",toggleFullscreen:"Toggle Fullscreen",frameTitle:"Player for {title}"},types:{embed:["youtube","vimeo","soundcloud"],html5:["video","audio"]},urls:{vimeo:{api:"https://cdn.plyr.io/froogaloop/1.0.1/plyr.froogaloop.js"},youtube:{api:"https://www.youtube.com/iframe_api"},soundcloud:{api:"https://w.soundcloud.com/player/api.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,forward:null,mute:null,volume:null,captions:null,fullscreen:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","emptied"]};return S.supported=function(e){var a,r,s=n(),o="IE"===s.name&&s.version<=9,i=/iPhone|iPod/i.test(navigator.userAgent),l=!!t.createElement("audio").canPlayType,u=!!t.createElement("video").canPlayType;switch(e){case"video":a=u,r=a&&!o&&!i;break;case"audio":a=l,r=a&&!o;break;case"vimeo":case"youtube":case"soundcloud":a=!0,r=!o&&!i;break;default:a=l&&u,r=a&&!o}return{basic:a,full:r}},S.setup=function(e,n){var a=[];if("string"==typeof e?e=t.querySelectorAll(e):e instanceof HTMLElement?e=[e]:e instanceof NodeList||"string"==typeof e||("undefined"==typeof n&&"object"==typeof e&&(n=e),e=t.querySelectorAll(A.selectors.container)),!S.supported().basic||!e.length)return!1;for(var r=0;r<e.length;r++){var s=e[r];if("undefined"==typeof s.plyr){var o=_(A,n,JSON.parse(s.getAttribute("data-plyr")));if(!o.enabled)return;var i=new F(s,o);s.plyr=Object.keys(i).length?i:!1,k(s,"setup",{plyr:s.plyr})}a.push(s.plyr)}return a},S}),function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}return"function"==typeof window.CustomEvent?!1:(e.prototype=window.Event.prototype,void(window.CustomEvent=e))}(); \ No newline at end of file
diff --git a/dist/sprite.svg b/dist/sprite.svg
index 2b4cfc5a..56364d4b 100644
--- a/dist/sprite.svg
+++ b/dist/sprite.svg
@@ -1 +1 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-captions-off" viewBox="0 0 18 18"><path d="M1 2c-.552 0-1 .448-1 1v12c0 .552.448 1 1 1h16c.552 0 1-.448 1-1V3c0-.552-.448-1-1-1H1zm1 12V4h14v10H2z"/></symbol><symbol id="icon-captions-on" viewBox="0 0 18 18"><path d="M1 2c-.552 0-1 .448-1 1v12c0 .552.448 1 1 1h16c.552 0 1-.448 1-1V3c0-.552-.448-1-1-1H1zm1 12V4h14v10H2z"/><path d="M3 11h3v2H3zM12 11h3v2h-3zM7 11h4v2H7z"/></symbol><symbol id="icon-enter-fullscreen" viewBox="0 0 18 18"><path d="M10.3 9.7c.7.677 1.4 0 1.4 0L16 5.4V10h2V3c0-.6-.4-1-1-1h-7v2h4.6l-4.3 4.3s-.7.723 0 1.4z"/><path d="M7 2v2H2v10h14v-1h2v2c0 .6-.4 1-1 1H1c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1h6z"/></symbol><symbol id="icon-exit-fullscreen" viewBox="0 0 18 18"><path d="M7.7 8.3c-.7-.677-1.4 0-1.4 0L2 12.6V8H0v7c0 .6.4 1 1 1h7v-2H3.4l4.3-4.3s.7-.723 0-1.4z"/><path d="M11 16v-2h5V4H2v1H0V3c0-.6.4-1 1-1h16c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6z"/></symbol><symbol id="icon-fast-forward" viewBox="0 0 16 16"><path d="M7 6.4L0 1v14l7-5.4V15l9-7-9-7"/></symbol><symbol id="icon-muted" viewBox="0 0 18 18"><path d="M9.214 2c-.11 0-.225.032-.334.1L4.832 4.91C4.75 4.97 4.65 5 4.55 5H.995C.446 5 0 5.448 0 6v6c0 .552.446 1 .996 1H4.55c.1 0 .2.03.282.09L8.88 15.9c.11.068.223.1.334.1.392 0 .747-.4.747-.95V2.95c0-.55-.354-.95-.746-.95zM7.97 12.834L5.58 11.177c-.166-.115-.364-.178-.566-.178H2.49c-.274 0-.497-.225-.497-.5v-3c0-.277.223-.5.498-.5h2.526c.202 0 .4-.063.566-.18L7.97 5.165v7.67zM14.934 8.8c-.086-1.75-1.514-2.992-2.507-3.65-.47-.312-1.094-.122-1.325.408l-.038.086c-.188.43-.045.94.336 1.194.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27-.397.288-.528.84-.284 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.25 2.586-2.606 2.516-4.037z"/><path d="M13.957 9.2c.086 1.747 1.514 2.99 2.507 3.648.47.312 1.094.122 1.325-.408l.037-.086c.188-.43.045-.94-.336-1.194-.705-.473-1.585-1.247-1.623-2.065-.032-.676.553-1.468 1.663-2.27.398-.288.53-.84.285-1.275l-.042-.075c-.266-.475-.866-.624-1.3-.312-1.74 1.25-2.586 2.606-2.516 4.037z"/></symbol><symbol id="icon-pause" viewBox="0 0 16 16"><path d="M5 1H2c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM14 1h-3c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1z"/></symbol><symbol id="icon-play" viewBox="0 0 16 16"><path d="M13.6 7.2l-10-7C2.9-.3 2 .2 2 1v14c0 .8.9 1.3 1.6.8l10-7c.5-.4.5-1.2 0-1.6z"/></symbol><symbol id="icon-restart" viewBox="0 0 16 16"><path d="M7.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C4 2.6 2.9 3.2 2 4.1-.7 6.8-.7 11.2 2 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L14 1.9l-6.3-.7z"/></symbol><symbol id="icon-rewind" viewBox="0 0 16 16"><path d="M9 1L0 8l9 7V9.6l7 5.4V1L9 6.4"/></symbol><symbol id="icon-volume" viewBox="0 0 18 18"><path d="M10.214 2c-.11 0-.225.032-.334.1L5.832 4.91C5.75 4.97 5.65 5 5.55 5H1.995C1.446 5 1 5.448 1 6v6c0 .552.446 1 .996 1H5.55c.1 0 .2.03.282.09L9.88 15.9c.11.068.223.1.334.1.392 0 .747-.4.747-.95V2.95c0-.55-.354-.95-.746-.95zM8.97 12.834L6.58 11.177c-.166-.115-.364-.178-.566-.178H3.49c-.274 0-.497-.225-.497-.5v-3c0-.277.223-.5.498-.5h2.526c.202 0 .4-.063.566-.18L8.97 5.165v7.67zM16.934 8.8c-.086-1.75-1.514-2.992-2.507-3.65-.47-.312-1.094-.122-1.325.408l-.038.086c-.188.43-.045.94.336 1.194.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27-.397.288-.528.84-.284 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.25 2.586-2.606 2.516-4.037z"/></symbol></svg> \ No newline at end of file
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg"><symbol id="icon-captions-off" viewBox="0 0 18 18"><path d="M1 2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H1zm1 12V4h14v10H2z"/></symbol><symbol id="icon-captions-on" viewBox="0 0 18 18"><path d="M1 2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H1zm1 12V4h14v10H2z"/><path d="M3 11h3v2H3zM12 11h3v2h-3zM7 11h4v2H7z"/></symbol><symbol id="icon-enter-fullscreen" viewBox="0 0 18 18"><path d="M10.3 9.7c.7.677 1.4 0 1.4 0L16 5.4V10h2V3c0-.6-.4-1-1-1h-7v2h4.6l-4.3 4.3s-.7.723 0 1.4z"/><path d="M7 2v2H2v10h14v-1h2v2c0 .6-.4 1-1 1H1c-.6 0-1-.4-1-1V3c0-.6.4-1 1-1h6z"/></symbol><symbol id="icon-exit-fullscreen" viewBox="0 0 18 18"><path d="M7.7 8.3c-.7-.677-1.4 0-1.4 0L2 12.6V8H0v7c0 .6.4 1 1 1h7v-2H3.4l4.3-4.3s.7-.723 0-1.4z"/><path d="M11 16v-2h5V4H2v1H0V3c0-.6.4-1 1-1h16c.6 0 1 .4 1 1v12c0 .6-.4 1-1 1h-6z"/></symbol><symbol id="icon-fast-forward" viewBox="0 0 16 16"><path d="M7 6.4L0 1v14l7-5.4V15l9-7-9-7z"/></symbol><symbol id="icon-muted" viewBox="0 0 18 18"><path d="M9.214 2a.62.62 0 0 0-.334.101l-4.048 2.81A.494.494 0 0 1 4.549 5H.996A.998.998 0 0 0 0 6v6c0 .552.446 1 .996 1h3.553c.102 0 .2.031.283.089l4.048 2.81a.62.62 0 0 0 .334.101c.392 0 .747-.4.747-.949V2.95c0-.55-.355-.949-.747-.949V2zM7.969 12.834l-2.387-1.657a.996.996 0 0 0-.566-.178H2.491a.5.5 0 0 1-.498-.5v-3a.5.5 0 0 1 .498-.5h2.525c.202 0 .4-.062.566-.178l2.387-1.657v7.67zM14.934 8.799c-.086-1.748-1.514-2.991-2.507-3.649-.47-.312-1.094-.122-1.325.408l-.038.086a.973.973 0 0 0 .336 1.194c.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27a.987.987 0 0 0-.285 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.251 2.586-2.606 2.516-4.037v.001z"/><path d="M13.957 9.2c.086 1.747 1.514 2.99 2.507 3.648.47.312 1.094.122 1.325-.408l.038-.086a.973.973 0 0 0-.336-1.194c-.706-.473-1.586-1.247-1.624-2.065-.032-.676.553-1.468 1.663-2.27a.987.987 0 0 0 .285-1.275l-.042-.075c-.266-.475-.866-.624-1.3-.312-1.74 1.251-2.586 2.606-2.516 4.037z"/></symbol><symbol id="icon-pause" viewBox="0 0 16 16"><path d="M5 1H2c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zM14 1h-3c-.6 0-1 .4-1 1v12c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1z"/></symbol><symbol id="icon-play" viewBox="0 0 16 16"><path d="M13.6 7.2l-10-7A1 1 0 0 0 2 1v14c0 .8.9 1.3 1.6.8l10-7c.5-.4.5-1.2 0-1.6z"/></symbol><symbol id="icon-restart" viewBox="0 0 16 16"><path d="M7.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C4 2.6 2.9 3.2 2 4.1-.7 6.8-.7 11.2 2 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L14 1.9l-6.3-.7z"/></symbol><symbol id="icon-rewind" viewBox="0 0 16 16"><path d="M9 1L0 8l9 7V9.6l7 5.4V1L9 6.4z"/></symbol><symbol id="icon-volume" viewBox="0 0 18 18"><path d="M10.214 2a.62.62 0 0 0-.334.101l-4.048 2.81A.494.494 0 0 1 5.549 5H1.996A.998.998 0 0 0 1 6v6c0 .552.446 1 .996 1h3.553c.102 0 .2.031.283.089l4.048 2.81a.62.62 0 0 0 .334.101c.392 0 .747-.4.747-.949V2.95c0-.55-.355-.949-.747-.949zM8.969 12.834l-2.387-1.657a.996.996 0 0 0-.566-.178H3.491a.5.5 0 0 1-.498-.5v-3a.5.5 0 0 1 .498-.5h2.525c.202 0 .4-.062.566-.178l2.387-1.657v7.669zM16.934 8.799c-.086-1.748-1.514-2.991-2.507-3.649-.47-.312-1.094-.122-1.325.408l-.038.086a.973.973 0 0 0 .336 1.194c.706.473 1.586 1.247 1.624 2.065.032.676-.553 1.468-1.663 2.27a.987.987 0 0 0-.285 1.275l.042.075c.266.475.866.624 1.3.312 1.74-1.251 2.586-2.606 2.516-4.037z"/></symbol></svg> \ No newline at end of file
diff --git a/docs/dist/docs.css b/docs/dist/docs.css
index 1de7278b..35c501c7 100644
--- a/docs/dist/docs.css
+++ b/docs/dist/docs.css
@@ -1 +1 @@
-/*! normalize.css v2.1.3 | MIT License | git.io/normalize */a.logo,img,legend{border:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}body,small{padding:0 10px}body,figure,li,ul{margin:0}[hidden],template{display:none}li,nav ul,ul{list-style:none;padding:0}legend,li,nav ul,ul{padding:0}.btn__bar,sub,sup{position:relative}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;color:#3498db;border-bottom:1px dotted currentColor;transition:background .3s ease,color .3s ease,border .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn__bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}.btn__bar::before,.btn__count::before{content:"";top:50%}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}html{font-size:100%;height:100%;background:linear-gradient(#fff,#f2f5f7) fixed}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b;font-weight:500}h1,h2{letter-spacing:-.025em;color:#2E3C44;margin:0 0 10px;line-height:1.2;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-weight:700}h1{font-size:64px;font-size:4rem;color:#3498DB}p,small{margin:0 0 20px}small{font-size:14px;font-size:.875rem}a:focus,a:hover{color:#343f4a;border-bottom-color:transparent}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.color--vimeo{color:#19b7ed}.color--youtube{color:#cc181e}*,::after,::before{box-sizing:border-box}.btn__bar ul,nav li{display:inline-block}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}.icon{fill:currentColor;width:18px;height:18px;vertical-align:-3px}a svg,button svg,label svg{pointer-events:none}.btn .icon,a .icon{margin-right:10px}.btn:not(.btn-large) .icon{width:16px;height:16px}nav ul{margin:0;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn__bar{margin:0 auto 20px;max-width:1200px}.btn__bar::before{position:absolute;left:0;right:0;height:1px;background:#dbe3e8}.btn__bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn__bar li{margin:0}.btn__bar li:first-child .btn{border-radius:4px 0 0 4px}.btn__bar li:last-child .btn{border-radius:0 4px 4px 0}.btn__bar li+li .btn{margin-left:-1px}.btn__bar li.active .btn{position:relative;z-index:1}.btn__bar li.active .btn .icon{color:inherit}.btn__bar li.active+li .btn:hover{z-index:0}.btn__bar .btn{position:relative;display:block;border-radius:0}.btn__bar .btn:focus,.btn__bar .btn:hover{z-index:1}@media (min-width:560px){.btn__bar{margin-bottom:40px}}.btn,.btn__count{display:inline-block;vertical-align:middle;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn{padding:10px 12px;background:linear-gradient(#f8fafb,#e9eef1);border:1px solid #cbd0d3;box-shadow:0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b;transition:background .1s ease,color .1s ease;font-size:14px;font-size:.875rem}.btn:focus,.btn:hover{border-color:#b5bcc0;color:#55646b;outline:0}.btn--large{padding:10px 20px;font-size:16px;font-size:1rem}.btn--primary,.btn__bar li.active .btn{background-image:linear-gradient(#3498db,#258cd1);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn--primary:focus,.btn--primary:hover{color:#fff;border-color:#196090}.btn--youtube .icon{color:#cc181e}.btn--vimeo .icon{color:#19b7ed}.btn--twitter .icon{color:#4BAAF4}.btn__count{position:relative;margin-left:10px;padding:10px 15px;background:#fff;border:1px solid #cbd0d3}.btn__count::before{position:absolute;display:block;width:8px;height:8px;left:1px;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%;vertical-align:middle}section{margin:0 auto 20px;max-width:1200px}.plyr__video-embed,video{max-width:100%;vertical-align:middle}.plyr__video-embed{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC)}.plyr{margin:0 auto;border-radius:4px}.plyr--fullscreen,.plyr--fullscreen-active{max-width:none}.plyr--fullscreen .plyr-controls,.plyr--fullscreen iframe,.plyr--fullscreen video,.plyr--fullscreen-active .plyr-controls,.plyr--fullscreen-active iframe,.plyr--fullscreen-active video{border-radius:0}.plyr--fullscreen iframe,.plyr--fullscreen-active iframe{-webkit-mask-image:none}.plyr--audio{max-width:520px}.plyr__cite{display:none;margin-top:20px}.plyr__cite .icon{margin-right:5px}.plyr--audio~ul .plyr__cite--audio,.plyr--video~ul .plyr__cite--video,.plyr--vimeo~ul .plyr__cite--vimeo,.plyr--youtube~ul .plyr__cite--youtube{display:block} \ No newline at end of file
+/*! normalize.css v2.1.3 | MIT License | git.io/normalize */a.logo,img,legend{border:0}a,h1,h2{color:#3498db}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,small,summary{display:block}body,figure,li,ul{margin:0}[hidden],template{display:none}li,nav ul,ul{list-style:none;padding:0}legend,li,nav ul,ul{padding:0}.btn__bar,sub,sup{position:relative}.plyr--video::after,a svg,button svg,label svg{pointer-events:none}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}a{background:0 0;text-decoration:none;border-bottom:1px dotted currentColor;transition:background .3s ease,color .3s ease,border .3s ease}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}.btn__bar,nav li{white-space:nowrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@-webkit-keyframes fade-in{0%{opacity:0}100%{opacity:1}}@keyframes fade-in{0%{opacity:0}100%{opacity:1}}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-medium.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-medium.woff) format("woff");font-style:normal;font-weight:500}@font-face{font-family:Avenir;src:url(//cdn.plyr.io/fonts/avenir-bold.woff2) format("woff2"),url(//cdn.plyr.io/fonts/avenir-bold.woff) format("woff");font-style:normal;font-weight:700}html{font-size:100%;height:100%;background:fixed #f2f5f7}body{font-family:Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.5;text-align:center;color:#55646b;font-weight:500;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding:10px}h1,h2{letter-spacing:-.025em;margin:0 0 10px;line-height:1.2;font-weight:700}h1{font-size:64px;font-size:4rem}p,small{margin:0 0 20px}small{padding:0 10px;font-size:14px;font-size:.875rem}a:focus,a:hover{color:#343f4a;border-bottom-color:transparent}a:focus{outline:#343f4a dotted thin;outline-offset:1px}.color--vimeo{color:#19b7ed}.color--youtube{color:#cc181e}*,::after,::before{box-sizing:border-box}.btn__bar ul,nav li{display:inline-block}header{padding:20px;margin-bottom:20px}header p{font-size:18px;font-size:1.125rem}section{padding-bottom:20px}@media (min-width:480px){header{padding-top:60px;padding-bottom:60px}section{padding-bottom:40px}}.icon{fill:currentColor;width:18px;height:18px;vertical-align:-3px}.btn,.btn__count,.error main,video{vertical-align:middle}.btn .icon,a .icon{margin-right:10px}.btn:not(.btn-large) .icon{width:16px;height:16px}nav ul{margin:0;font-size:0}nav li{margin-top:10px;font-size:16px;font-size:1rem}nav li+li{margin-left:20px}.btn__bar{margin:0 auto 20px;max-width:1200px}.btn__bar::before{content:"";position:absolute;top:50%;left:0;right:0;height:1px;background:#dbe3e8}.btn__bar ul{position:relative;z-index:1;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn__bar li{margin:0}.btn__bar li:first-child .btn{border-radius:4px 0 0 4px}.btn__bar li:last-child .btn{border-radius:0 4px 4px 0}.btn__bar li+li .btn{margin-left:-1px}.btn__bar li.active .btn{position:relative;z-index:1}.btn__bar li.active .btn .icon{color:inherit}.btn__bar li.active+li .btn:hover{z-index:0}.btn__bar .btn{position:relative;display:block;border-radius:0}.btn__bar .btn:focus,.btn__bar .btn:hover{z-index:1}@media (min-width:560px){.btn__bar{margin-bottom:40px}}.btn,.btn__count{display:inline-block;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-weight:700}.btn{padding:10px 12px;background:linear-gradient(#f8fafb,#e9eef1);border:1px solid #cbd0d3;box-shadow:0 1px 1px rgba(0,0,0,.05);text-shadow:0 1px 1px #fff;color:#55646b;transition:background .1s ease,color .1s ease;font-size:14px;font-size:.875rem}.btn:focus,.btn:hover{border-color:#b5bcc0;color:#55646b;outline:0}.btn--large{padding:10px 20px;font-size:16px;font-size:1rem}.btn--primary,.btn__bar li.active .btn{background-image:linear-gradient(#3498db,#258cd1);background-color:#3498db;border-color:#217dbb;box-shadow:0 1px 1px rgba(0,0,0,.15);text-shadow:0 1px 1px rgba(0,0,0,.1);color:#fff}.btn--primary:focus,.btn--primary:hover{color:#fff;border-color:#196090}.btn--youtube .icon{color:#cc181e}.btn--vimeo .icon{color:#19b7ed}.btn--twitter .icon{color:#4BAAF4}.btn__count{position:relative;margin-left:10px;padding:10px 15px;background:#fff;border:1px solid #cbd0d3}.btn__count::before,.plyr--video::after{content:"";position:absolute}.btn__count::before{display:block;width:8px;height:8px;left:1px;top:50%;margin-top:-4px;background:inherit;border:inherit;border-width:1px 0 0 1px;-webkit-transform:rotate(-45deg) translate(-50%,-50%);transform:rotate(-45deg) translate(-50%,-50%)}.error body,html.error{height:100%}.error body{width:100%;display:table;table-layout:fixed}.error main{display:table-cell;width:100%}section{margin:0 auto 20px;max-width:1200px}video{max-width:100%}.plyr{margin:0 auto;border-radius:6px}.plyr--audio{max-width:520px}.plyr--video::after{top:0;bottom:0;left:0;right:0;border:1px solid rgba(0,0,0,.15);border-radius:inherit}.plyr__cite{display:none;margin-top:20px}.plyr__cite .icon{margin-right:5px}.plyr--audio~ul .plyr__cite--audio,.plyr--video:not(.plyr--youtube):not(.plyr--vimeo)~ul .plyr__cite--video,.plyr--vimeo~ul .plyr__cite--vimeo,.plyr--youtube~ul .plyr__cite--youtube{display:block} \ No newline at end of file
diff --git a/docs/dist/docs.js b/docs/dist/docs.js
index 3cc174d5..040dbd45 100644
--- a/docs/dist/docs.js
+++ b/docs/dist/docs.js
@@ -1 +1 @@
-"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,n=arguments.length;for(i=0;n>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],s=Object,o=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=o.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],n=0,s=i.length;s>n;n++)this.push(i[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,n=t.length,s=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),s=!0);while(++i<n);s&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,n=0,s=i.length,o=!1;do for(e=i[n]+"",t=c(this,e);-1!==t;)this.splice(t,1),o=!0,t=c(this,e);while(++n<s);o&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),n=i?t!==!0&&"remove":t!==!1&&"add";return n&&this[n](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},s.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{s.defineProperty(n,t,p)}catch(h){-2146823252===h.number&&(p.enumerable=!1,s.defineProperty(n,t,p))}}else s[i].__defineGetter__&&n.__defineGetter__(t,d)}}(self)),plyr.setup(".js-media-player",{debug:!0,title:"Video demo",tooltips:{controls:!0},captions:{defaultActive:!0}}),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=n+(i?" "+t:"")}}function t(t,o){if(t in n&&(o||t!=s)&&(s.length||t!=n.video)){var r=document.querySelector(".js-media-player").plyr;switch(t){case n.video:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"},{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt","default":!0}]});break;case n.audio:r.source({type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",sources:[{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case n.youtube:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}s=t;for(var a=i.length-1;a>=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},s=window.location.hash.replace("#",""),o=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),o&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),o){var a=!s.length;a&&(s=n.video),s in n&&history.replaceState({type:s},"",a?"":"#"+s),s!==n.video&&t(s,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,n,s,o,r){e.GoogleAnalyticsObject=s,e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)},e[s].l=1*new Date,o=t.createElement(i),r=t.getElementsByTagName(i)[0],o.async=1,o.src=n,r.parentNode.insertBefore(o,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview")); \ No newline at end of file
+"document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var e=document.createElement("_");if(e.classList.add("c1","c2"),!e.classList.contains("c2")){var t=function(e){var t=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(e){var i,n=arguments.length;for(i=0;n>i;i++)e=arguments[i],t.call(this,e)}};t("add"),t("remove")}if(e.classList.toggle("c3",!1),e.classList.contains("c3")){var i=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(e,t){return 1 in arguments&&!this.contains(e)==!t?t:i.call(this,e)}}e=null}():!function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],o=Object,s=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===e)return t;return-1},a=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},c=function(e,t){if(""===t)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return r.call(e,t)},l=function(e){for(var t=s.call(e.getAttribute("class")||""),i=t?t.split(/\s+/):[],n=0,o=i.length;o>n;n++)this.push(i[n]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},u=l[i]=[],d=function(){return new l(this)};if(a[i]=Error[i],u.item=function(e){return this[e]||null},u.contains=function(e){return e+="",-1!==c(this,e)},u.add=function(){var e,t=arguments,i=0,n=t.length,o=!1;do e=t[i]+"",-1===c(this,e)&&(this.push(e),o=!0);while(++i<n);o&&this._updateClassName()},u.remove=function(){var e,t,i=arguments,n=0,o=i.length,s=!1;do for(e=i[n]+"",t=c(this,e);-1!==t;)this.splice(t,1),s=!0,t=c(this,e);while(++n<o);s&&this._updateClassName()},u.toggle=function(e,t){e+="";var i=this.contains(e),n=i?t!==!0&&"remove":t!==!1&&"add";return n&&this[n](e),t===!0||t===!1?t:!i},u.toString=function(){return this.join(" ")},o.defineProperty){var p={get:d,enumerable:!0,configurable:!0};try{o.defineProperty(n,t,p)}catch(h){-2146823252===h.number&&(p.enumerable=!1,o.defineProperty(n,t,p))}}else o[i].__defineGetter__&&n.__defineGetter__(t,d)}}(self)),plyr.setup(".js-media-player",{debug:!0,title:"Video demo",tooltips:{controls:!0},captions:{defaultActive:!0}}),function(){function e(e,t,i){if(e)if(e.classList)e.classList[i?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=n+(i?" "+t:"")}}function t(t,s){if(t in n&&(s||t!=o)&&(o.length||t!=n.video)){var r=document.querySelector(".js-media-player").plyr;switch(t){case n.video:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.mp4",type:"video/mp4"},{src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.webm",type:"video/webm"}],poster:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.jpg",tracks:[{kind:"captions",label:"English",srclang:"en",src:"https://cdn.selz.com/plyr/1.5/View_From_A_Blue_Moon_Trailer-HD.en.vtt","default":!0}]});break;case n.audio:r.source({type:"audio",title:"Kishi Bashi &ndash; &ldquo;It All Began With A Burst&rdquo;",sources:[{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.mp3",type:"audio/mp3"},{src:"https://cdn.selz.com/plyr/1.5/Kishi_Bashi_-_It_All_Began_With_a_Burst.ogg",type:"audio/ogg"}]});break;case n.youtube:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"bTqVqk7FSmY",type:"youtube"}]});break;case n.vimeo:r.source({type:"video",title:"View From A Blue Moon",sources:[{src:"143418951",type:"vimeo"}]})}o=t;for(var a=i.length-1;a>=0;a--)e(i[a].parentElement,"active",!1);e(document.querySelector('[data-source="'+t+'"]').parentElement,"active",!0)}}for(var i=document.querySelectorAll("[data-source]"),n={video:"video",audio:"audio",youtube:"youtube",vimeo:"vimeo"},o=window.location.hash.replace("#",""),s=window.history&&window.history.pushState,r=i.length-1;r>=0;r--)i[r].addEventListener("click",function(){var e=this.getAttribute("data-source");t(e),s&&history.pushState({type:e},"","#"+e)});if(window.addEventListener("popstate",function(e){e.state&&"type"in e.state&&t(e.state.type)}),s){var a=!o.length;a&&(o=n.video),o in n&&history.replaceState({type:o},"",a?"":"#"+o),o!==n.video&&t(o,!0)}}(),document.domain.indexOf("plyr.io")>-1&&(!function(e,t,i,n,o,s,r){e.GoogleAnalyticsObject=o,e[o]=e[o]||function(){(e[o].q=e[o].q||[]).push(arguments)},e[o].l=1*new Date,s=t.createElement(i),r=t.getElementsByTagName(i)[0],s.async=1,s.src=n,r.parentNode.insertBefore(s,r)}(window,document,"script","//www.google-analytics.com/analytics.js","ga"),ga("create","UA-40881672-11","auto"),ga("send","pageview")); \ No newline at end of file
diff --git a/docs/index.html b/docs/index.html
index 2e6dbde0..801a63fa 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -121,7 +121,10 @@
<!-- Docs script -->
<script src="dist/docs.js"></script>
- <!-- Shr core script -->
+ <!-- Rangetouch to fix <input type="range"> on touch devices (see https://rangetouch.com) -->
+ <script src="https://cdn.rangetouch.com/0.0.9/rangetouch.js"></script>
+
+ <!-- Sharing libary (https://shr.one) -->
<script src="https://cdn.shr.one/0.1.9/shr.js"></script>
<script>if(window.shr) { window.shr.setup({ count: { classname: 'btn__count' } }); }</script>
</body>
diff --git a/docs/src/less/components/base.less b/docs/src/less/components/base.less
index 05b5fb52..c584b57e 100644
--- a/docs/src/less/components/base.less
+++ b/docs/src/less/components/base.less
@@ -16,10 +16,11 @@
// Base
html {
height: 100%;
- background: linear-gradient(#fff, @body-background) fixed;
+ background: @body-background fixed;
}
body {
- padding: 0 (@padding-base / 2);
+ margin: 0;
+ padding: (@padding-base / 2);
}
// Header
diff --git a/docs/src/less/components/buttons.less b/docs/src/less/components/buttons.less
index 7970a861..c99a0836 100644
--- a/docs/src/less/components/buttons.less
+++ b/docs/src/less/components/buttons.less
@@ -93,12 +93,13 @@ nav {
vertical-align: middle;
border-radius: @border-radius-base;
user-select: none;
+ font-weight: @font-weight-bold;
}
// Buttons
.btn {
padding: (@padding-base / 2) ((@padding-base / 2) + 2);
- background: linear-gradient(lighten(@body-background, 2%), darken(@body-background, 3%));
+ background: linear-gradient(lighten(@off-white, 2%), darken(@off-white, 3%));
border: 1px solid @gray-light;
box-shadow: 0 1px 1px rgba(0,0,0, .05);
text-shadow: 0 1px 1px #fff;
diff --git a/docs/src/less/components/examples.less b/docs/src/less/components/examples.less
index b57763fd..24bf1e9c 100644
--- a/docs/src/less/components/examples.less
+++ b/docs/src/less/components/examples.less
@@ -7,49 +7,30 @@ section {
max-width: @example-width-video;
}
-video,
-.plyr__video-embed {
+// For non supported browsers
+video {
max-width: 100%;
vertical-align: middle;
}
-.plyr__video-embed {
- -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
-}
// Example players
.plyr {
margin: 0 auto;
- border-radius: @border-radius-base;
-
- &--fullscreen,
- &--fullscreen-active {
- max-width: none;
-
- .plyr-controls,
- video,
- iframe {
- border-radius: 0;
- }
- iframe {
- -webkit-mask-image: none;
- }
- }
+ border-radius: @border-radius-large;
}
.plyr--audio {
max-width: @example-width-audio;
-
- /*.plyr__controls {
- border-radius: @border-radius-base;
- }
- .plyr__progress {
- border-radius: @border-radius-base @border-radius-base 0 0;
-
- progress,
- [type='range'] {
- border-radius: @border-radius-base @border-radius-base 0 0;
- overflow: hidden;
- }
- }*/
+}
+.plyr--video::after {
+ content: "";
+ pointer-events: none;
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ border: 1px solid fade(#000, 15%);
+ border-radius: inherit;
}
// Style full supported player
@@ -62,7 +43,7 @@ video,
}
}
-.plyr--video ~ ul .plyr__cite--video,
+.plyr--video:not(.plyr--youtube):not(.plyr--vimeo) ~ ul .plyr__cite--video,
.plyr--audio ~ ul .plyr__cite--audio,
.plyr--youtube ~ ul .plyr__cite--youtube,
.plyr--vimeo ~ ul .plyr__cite--vimeo {
diff --git a/docs/src/less/components/type.less b/docs/src/less/components/type.less
index d16a8865..951be36d 100644
--- a/docs/src/less/components/type.less
+++ b/docs/src/less/components/type.less
@@ -12,21 +12,20 @@ body {
text-align: center;
color: @gray;
font-weight: @font-weight-base;
+ .font-smoothing();
}
// Headings
h1,
h2 {
letter-spacing: -.025em;
- color: #2E3C44;
+ color: @brand-primary;
margin: 0 0 (@padding-base / 2);
line-height: 1.2;
- .font-smoothing();
font-weight: @font-weight-bold;
}
h1 {
.font-size(@font-size-h1);
- color: #3498DB;
}
// Paragraph and small
diff --git a/docs/src/less/lib/fontface.less b/docs/src/less/lib/fontface.less
index 7372023c..a7da5ad9 100644
--- a/docs/src/less/lib/fontface.less
+++ b/docs/src/less/lib/fontface.less
@@ -2,7 +2,7 @@
// Fonts
// ==========================================================================
-/*@font-face {
+@font-face {
font-family: "Avenir";
src: url("//cdn.plyr.io/fonts/avenir-medium.woff2") format("woff2"),
url("//cdn.plyr.io/fonts/avenir-medium.woff") format("woff");
@@ -15,4 +15,4 @@
url("//cdn.plyr.io/fonts/avenir-bold.woff") format("woff");
font-style: normal;
font-weight: @font-weight-bold;
-}*/ \ No newline at end of file
+} \ No newline at end of file
diff --git a/docs/src/less/variables.less b/docs/src/less/variables.less
index 4629d98d..4768cdd6 100644
--- a/docs/src/less/variables.less
+++ b/docs/src/less/variables.less
@@ -3,43 +3,46 @@
// ==========================================================================
// Colors
-@blue: #3498db;
@gray-dark: #343f4a;
@gray: #55646b;
@gray-light: #cbd0d3;
@gray-lighter: #dbe3e8;
@off-white: #f2f5f7;
+@brand-primary: #3498db;
+@brand-secondary: #02BD9B;
+
// Brands
@color-twitter: #4BAAF4;
@color-youtube: #cc181e;
@color-vimeo: #19b7ed;
// Base
-@body-background: @off-white;
+@body-background: @off-white; //linear-gradient(to left top, @brand-secondary, @brand-primary);
// Type
@font-size-base: 16;
@font-size-small: 14;
@font-size-h1: 64;
-@font-weight-base: 500;
-@font-weight-bold: 700;
+@font-weight-base: 500;
+@font-weight-bold: 700;
// Elements
-@link-color: @blue;
+@link-color: @brand-primary;
@padding-base: 20px;
@arrow-size: 8px;
// Icons
-@icon-size: 18px;
+@icon-size: 18px;
// Breakpoints
@screen-sm: 480px;
@screen-md: 768px;
// Radii
-@border-radius-base: 4px;
+@border-radius-base: 4px;
+@border-radius-large: 6px;
// Examples
-@example-width-audio: 520px;
-@example-width-video: 1200px;
+@example-width-audio: 520px;
+@example-width-video: 1200px;
diff --git a/gulpfile.js b/gulpfile.js
index 5083a75b..238ab798 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -12,7 +12,7 @@ var fs = require("fs"),
uglify = require("gulp-uglify"),
less = require("gulp-less"),
sass = require("gulp-sass"),
- minify = require("gulp-minify-css"),
+ cleanCSS = require("gulp-clean-css"),
run = require("run-sequence"),
prefix = require("gulp-autoprefixer"),
svgstore = require("gulp-svgstore"),
@@ -30,7 +30,7 @@ paths = {
// Source paths
src: {
less: path.join(root, "src/less/**/*"),
- sass: path.join(root, "src/sass/**/*"),
+ scss: path.join(root, "src/scss/**/*"),
js: path.join(root, "src/js/**/*"),
sprite: path.join(root, "src/sprite/*.svg")
},
@@ -55,7 +55,7 @@ paths = {
// Task arrays
tasks = {
less: [],
- sass: [],
+ scss: [],
js: [],
sprite: []
},
@@ -104,26 +104,26 @@ var build = {
.on("error", gutil.log)
.pipe(concat(key))
.pipe(prefix(["last 2 versions"], { cascade: true }))
- .pipe(minify())
+ .pipe(cleanCSS())
.pipe(gulp.dest(paths[bundle].output));
});
})(key);
}
},
- sass: function(files, bundle) {
+ scss: function(files, bundle) {
for (var key in files) {
(function (key) {
- var name = "sass-" + key;
- tasks.sass.push(name);
+ var name = "scss-" + key;
+ tasks.scss.push(name);
gulp.task(name, function () {
return gulp
- .src(bundles[bundle].sass[key])
+ .src(bundles[bundle].scss[key])
.pipe(sass())
.on("error", gutil.log)
.pipe(concat(key))
.pipe(prefix(["last 2 versions"], { cascade: true }))
- .pipe(minify())
+ .pipe(cleanCSS())
.pipe(gulp.dest(paths[bundle].output));
});
})(key);
@@ -152,7 +152,7 @@ var build = {
// Plyr core files
build.js(bundles.plyr.js, "plyr");
build.less(bundles.plyr.less, "plyr");
-build.sass(bundles.plyr.sass, "plyr");
+build.scss(bundles.plyr.scss, "plyr");
build.sprite("plyr");
// Docs files
@@ -165,9 +165,9 @@ gulp.task("js", function(){
run(tasks.js);
});
-// Build SASS (for testing, default is LESS)
-gulp.task("sass", function(){
- run(tasks.sass);
+// Build SCSS (for testing, default is LESS)
+gulp.task("scss", function(){
+ run(tasks.scss);
});
// Watch for file changes
diff --git a/package.json b/package.json
index 3a2d0d95..19f3df74 100644
--- a/package.json
+++ b/package.json
@@ -1,26 +1,26 @@
{
"name": "plyr",
- "version": "1.5.21",
+ "version": "1.6.1",
"description": "A simple, accessible and customizable HTML5, YouTube and Vimeo media player",
"homepage": "http://plyr.io",
"main": "src/js/plyr.js",
"dependencies": {},
"devDependencies": {
- "gulp": "^3.9.0",
+ "gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-concat": "^2.3.3",
"gulp-gzip": "^1.0.0",
"gulp-less": "^3.0.5",
- "gulp-minify-css": "^1.2.1",
- "gulp-open": "^1.0.0",
+ "gulp-clean-css": "^2.0.6",
+ "gulp-open": "^2.0.0",
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.3",
"gulp-s3": "^0.3.0",
- "gulp-sass": "^2.1.0",
- "gulp-size": "^2.0.0",
- "gulp-svgmin": "^1.0.0",
- "gulp-svgstore": "^5.0.0",
- "gulp-uglify": "^1.5.1",
+ "gulp-sass": "^2.3.1",
+ "gulp-size": "^2.1.0",
+ "gulp-svgmin": "^1.2.2",
+ "gulp-svgstore": "^5.0.5",
+ "gulp-uglify": "^1.5.3",
"gulp-util": "^3.0.7",
"run-sequence": "^1.1.5"
},
@@ -43,5 +43,5 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
- "author": "Sam Potts <sam@selz.com> (selz.com)"
+ "author": "Sam Potts <sam@selz.com>"
}
diff --git a/readme.md b/readme.md
index 60191e30..142f047b 100644
--- a/readme.md
+++ b/readme.md
@@ -3,7 +3,7 @@ A simple, accessible and customizable HTML5, YouTube and Vimeo media player.
[Checkout the demo](https://plyr.io)
-[![Image of Plyr](https://cdn.plyr.io/static/plyr-v1.5.jpg)](https://plyr.io)
+[![Image of Plyr](https://cdn.plyr.io/static/plyr_v1.6.0.png)](https://plyr.io)
## Why?
We wanted a lightweight, accessible and customizable media player that supports [*modern*](#browser-support) browsers. Sure, there are many other players out there but we wanted to keep things simple, using the right elements for the job.
@@ -40,10 +40,9 @@ If you have any cool ideas or features, please let me know by [creating an issue
## Implementation
Check `docs/index.html` and `docs/dist/docs.js` for an example setup.
-**Heads up:** the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.5.21/plyr.js` to `https://cdn.plyr.io/1.5.21/plyr.js`
+**Heads up:** the example `index.html` file needs to be served from a webserver (such as Apache, Nginx, IIS or similar) unless you change the file sources to include http or https. e.g. change `//cdn.plyr.io/1.6.1/plyr.js` to `https://cdn.plyr.io/1.6.1/plyr.js`
### Node Package Manager (NPM)
-[![npm version](https://badge.fury.io/js/plyr.svg)](https://badge.fury.io/js/plyr)
Using NPM, you can grab Plyr:
```
@@ -52,7 +51,6 @@ npm install plyr
[https://www.npmjs.com/package/plyr](https://www.npmjs.com/package/plyr)
### Bower
-[![Bower version](https://badge.fury.io/bo/plyr.svg)](https://badge.fury.io/bo/plyr)
If bower is your thang, you can grab Plyr using:
```
@@ -73,14 +71,14 @@ More info is on [npm](https://www.npmjs.com/package/ember-cli-plyr) and [GitHub]
If you want to use our CDN, you can use the following:
```html
-<link rel="stylesheet" href="https://cdn.plyr.io/1.5.21/plyr.css">
-<script src="https://cdn.plyr.io/1.5.21/plyr.js"></script>
+<link rel="stylesheet" href="https://cdn.plyr.io/1.6.1/plyr.css">
+<script src="https://cdn.plyr.io/1.6.1/plyr.js"></script>
```
-You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.21/sprite.svg`.
+You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.6.1/sprite.svg`.
### CSS & Styling
-If you want to use the default css, add the `plyr.css` file from `/dist` into your head, or even better use `plyr.less` or `plyr.sass` file included in `/src` in your build to save a request.
+If you want to use the default css, add the `plyr.css` file from `/dist` into your head, or even better use `plyr.less` or `plyr.scss` file included in `/src` in your build to save a request.
```html
<link rel="stylesheet" href="dist/plyr.css">
@@ -89,7 +87,18 @@ If you want to use the default css, add the `plyr.css` file from `/dist` into yo
The default setup uses the BEM methodology with `plyr` as the block, e.g. `.plyr__controls`. You can change the class hooks in the options. Check out the source for more on this.
### SVG
-The SVG sprite for the controls icons is loaded in by AJAX to help with performance. This is best added before the closing `</body>`, before any other scripts.
+The SVG sprite for the controls icons can be loaded two ways:
+- By passing the *relative* path to the sprite as the `iconUrl` option; or
+- Using AJAX, injecting the sprite into a hidden div.
+
+#### Using the `iconUrl` option
+This method requires the SVG sprite to be hosted on the *same domain* as your page hosting the player. Currently no browser supports cross origin SVG sprites due to XSS issues. Fingers crossed this will come soon though. An example value for this option would be:
+```
+/path/to/sprite.svg
+```
+
+#### Using AJAX
+Using AJAX means you can load the sprite from a different origin. Avoiding the issues above. This is an example script to load an SVG sprite best added before the closing `</body>`, before any other scripts.
```html
<script>
@@ -104,7 +113,7 @@ The SVG sprite for the controls icons is loaded in by AJAX to help with performa
c.innerHTML = a.responseText;
b.insertBefore(c, b.childNodes[0]);
};
-})(document, 'path/to/sprite.svg');
+})(document, 'https://cdn.plyr.io/1.6.1/sprite.svg');
</script>
```
@@ -179,7 +188,7 @@ Be sure to [validate your caption files](https://quuz.org/webvtt/)
Here's an example of a default setup:
```html
-<script src="https://cdn.plyr.io/1.5.21/plyr.js"></script>
+<script src="https://cdn.plyr.io/1.6.1/plyr.js"></script>
<script>plyr.setup();</script>
```
@@ -207,6 +216,9 @@ Passing just the options object:
plyr.setup(options);
```
+#### RangeTouch
+Some touch browsers (particularly Mobile Safari on iOS) seem to have issues with `<input type="range">` elements whereby touching the track to set the value doesn't work and sliding the thumb can be tricky. To combat this, I've created [RangeTouch](https://rangetouch.com) which I'd recommend including in your solution. It's a tiny script with a nice benefit for users on touch devices.
+
#### Options
Options must be passed as an object to the `setup()` method as above or as JSON in `data-plyr` attribute on each of your target elements (e.g. data-plyr='{ title: "testing" }') - note the single quotes encapsulating the JSON.
@@ -252,6 +264,12 @@ Options must be passed as an object to the `setup()` method as above or as JSON
<td>Specify the id prefix for the icons used in the default controls (e.g. "icon-play" would be "icon"). This is to prevent clashes if you're using your own SVG defs file but with the default controls. Most people can ignore this option.</td>
</tr>
<tr>
+ <td><code>iconUrl</code></td>
+ <td>String</td>
+ <td><code>null</code></td>
+ <td>Specify a relative path to the SVG sprite, hosted on the *same domain* as the page the player is hosted on. Using this menthod means no requirement for the AJAX sprite loading script. See the <a href="#svg">SVG section</a> for more info.</td>
+ </tr>
+ <tr>
<td><code>debug</code></td>
<td>Boolean</td>
<td><code>false</code></td>
@@ -276,10 +294,16 @@ Options must be passed as an object to the `setup()` method as above or as JSON
<td>A number, between 1 and 10, representing the initial volume of the player.</td>
</tr>
<tr>
- <td><code>click</code></td>
+ <td><code>clickToPlay</code></td>
<td>Boolean</td>
<td><code>true</code></td>
- <td>Click (or tap) will toggle pause/play of a <code>&lt;video&gt;</code>.</td>
+ <td>Click (or tap) of the video container will toggle pause/play.</td>
+ </tr>
+ <tr>
+ <td><code>hideControls</code></td>
+ <td>Boolean</td>
+ <td><code>true</code></td>
+ <td>Hide video controls automatically after 2s of no mouse or focus movement, on control element blur (tab out), on playback start or entering fullscreen. As soon as the mouse is moved, a control element is focused or playback is paused, the controls reappear instantly.</td>
</tr>
<tr>
<td><code>tooltips</code></td>
@@ -367,12 +391,6 @@ Options must be passed as an object to the `setup()` method as above or as JSON
<td>Enable a full viewport view for older browsers.</td>
</tr>
<tr>
- <td><code>hideControls</code></td>
- <td>Boolean</td>
- <td><code>true</code></td>
- <td>Hide the controls when fullscreen is active and the video is playing, after 1s. The controls reappear on hover of the progress bar (mouse), focusing a child control or pausing the video (by tap/click of video if `click` is `true`).</td>
- </tr>
- <tr>
<td><code>allowAudio</code></td>
<td>Boolean</td>
<td><code>false</code></td>
diff --git a/src/js/plyr.js b/src/js/plyr.js
index c34a1070..d3fc3648 100644
--- a/src/js/plyr.js
+++ b/src/js/plyr.js
@@ -1,6 +1,6 @@
// ==========================================================================
// Plyr
-// plyr.js v1.5.21
+// plyr.js v1.6.1
// https://github.com/selz/plyr
// License: The MIT License (MIT)
// ==========================================================================
@@ -39,6 +39,7 @@
duration: null,
displayDuration: true,
iconPrefix: 'icon',
+ iconUrl: '',
clickToPlay: true,
hideControls: true,
tooltips: {
@@ -60,10 +61,13 @@
rewind: '[data-plyr="rewind"]',
forward: '[data-plyr="fast-forward"]',
mute: '[data-plyr="mute"]',
- volume: '[data-plyr="volume"]',
captions: '[data-plyr="captions"]',
fullscreen: '[data-plyr="fullscreen"]'
},
+ volume: {
+ input: '[data-plyr="volume"]',
+ display: '.plyr__volume--display'
+ },
progress: {
container: '.plyr__progress',
buffer: '.plyr__progress--buffer',
@@ -332,7 +336,7 @@
// Remove an element
function _remove(element) {
- if(!element) {
+ if (!element) {
return;
}
element.parentNode.removeChild(element);
@@ -393,58 +397,40 @@
return false;
}
- // Debounce
- // deBouncer by hnldesign.nl
- // based on code by Paul Irish and the original debouncing function from John Hann
- // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
- function _debounce(func, threshold, execAsap) {
- var timeout;
- return function debounced () {
- var obj = this, args = arguments;
- function delayed () {
- if (!execAsap) {
- func.apply(obj, args);
- }
- timeout = null;
- }
- if (timeout) {
- clearTimeout(timeout);
- }
- else if (execAsap) {
- func.apply(obj, args);
- }
- timeout = setTimeout(delayed, threshold || 100);
- };
- }
-
// Bind event
- function _on(element, events, callback) {
+ function _on(element, events, callback, useCapture) {
if (element) {
- _toggleListener(element, events, callback, true);
+ _toggleListener(element, events, callback, true, useCapture);
}
}
// Unbind event
- function _off(element, events, callback) {
+ function _off(element, events, callback, useCapture) {
if (element) {
- _toggleListener(element, events, callback, false);
+ _toggleListener(element, events, callback, false, useCapture);
}
}
// Bind along with custom handler
- function _proxyListener(element, eventName, userListener, defaultListener) {
+ function _proxyListener(element, eventName, userListener, defaultListener, useCapture) {
_on(element, eventName, function(event) {
- if(userListener) {
+ if (userListener) {
userListener.apply(element, [event]);
}
defaultListener.apply(element, [event]);
- });
+ }, useCapture);
}
// Toggle event listener
- function _toggleListener(element, events, callback, toggle) {
+ function _toggleListener(element, events, callback, toggle, useCapture) {
var eventList = events.split(' ');
+ // Whether the listener is a capturing listener or not
+ // Default to false
+ if (typeof useCapture !== 'boolean') {
+ useCapture = false;
+ }
+
// If a nodelist is passed, call itself on each node
if (element instanceof NodeList) {
for (var x = 0; x < element.length; x++) {
@@ -457,14 +443,14 @@
// If a single node is passed, bind the event listener
for (var i = 0; i < eventList.length; i++) {
- element[toggle ? 'addEventListener' : 'removeEventListener'](eventList[i], callback, false);
+ element[toggle ? 'addEventListener' : 'removeEventListener'](eventList[i], callback, useCapture);
}
}
// Trigger event
function _triggerEvent(element, eventName, properties) {
// Bail if no element
- if(!element || !eventName) {
+ if (!element || !eventName) {
return;
}
@@ -479,7 +465,7 @@
// http://www.ssbbartgroup.com/blog/how-not-to-misuse-aria-states-properties-and-roles
function _toggleState(target, state) {
// Bail if no target
- if(!target) {
+ if (!target) {
return;
}
@@ -505,15 +491,15 @@
// Removed call to arguments.callee (used explicit function name instead)
function _extend() {
// Get arguments
- var objects = arguments;
+ var objects = arguments;
// Bail if nothing to merge
- if(!objects.length) {
+ if (!objects.length) {
return;
}
// Return first if specified but nothing to merge
- if(objects.lenth == 1) {
+ if (objects.lenth == 1) {
return objects[0];
}
@@ -614,15 +600,15 @@
function _storage() {
var storage = {
supported: (function() {
- if(!('localStorage' in window)) {
- return false;
- }
+ if (!('localStorage' in window)) {
+ return false;
+ }
- // Try to use it (it might be disabled, e.g. user is in private/porn mode)
+ // Try to use it (it might be disabled, e.g. user is in private/porn mode)
// see: https://github.com/Selz/plyr/issues/131
- try {
+ try {
// Add test item
- window.localStorage.setItem('___test', 'OK');
+ window.localStorage.setItem('___test', 'OK');
// Get the test item
var result = window.localStorage.getItem('___test');
@@ -632,12 +618,12 @@
// Check if value matches
return (result === 'OK');
- }
- catch (e) {
- return false;
- }
+ }
+ catch (e) {
+ return false;
+ }
- return false;
+ return false;
})()
};
return storage;
@@ -662,13 +648,14 @@
// Build the default HTML
function _buildControls() {
// Create html array
- var html = [];
+ var html = [],
+ iconPath = config.iconUrl + '#' + config.iconPrefix;
// Larger overlaid play button
if (_inArray(config.controls, 'play-large')) {
html.push(
'<button type="button" data-plyr="play" class="plyr__play-large">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-play" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-play" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.play + '</span>',
'</button>'
);
@@ -680,7 +667,7 @@
if (_inArray(config.controls, 'restart')) {
html.push(
'<button type="button" data-plyr="restart">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-restart" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-restart" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.restart + '</span>',
'</button>'
);
@@ -690,7 +677,7 @@
if (_inArray(config.controls, 'rewind')) {
html.push(
'<button type="button" data-plyr="rewind">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-rewind" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-rewind" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.rewind + '</span>',
'</button>'
);
@@ -701,11 +688,11 @@
if (_inArray(config.controls, 'play')) {
html.push(
'<button type="button" data-plyr="play">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-play" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-play" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.play + '</span>',
'</button>',
'<button type="button" data-plyr="pause">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-pause" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-pause" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.pause + '</span>',
'</button>'
);
@@ -715,7 +702,7 @@
if (_inArray(config.controls, 'fast-forward')) {
html.push(
'<button type="button" data-plyr="fast-forward">',
- '<svg><use xlink:href="#' + config.iconPrefix + '-fast-forward" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-fast-forward" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.forward + '</span>',
'</button>'
);
@@ -727,9 +714,7 @@
html.push('<span class="plyr__progress">',
'<label for="seek{id}" class="plyr__sr-only">Seek</label>',
'<input id="seek{id}" class="plyr__progress--seek" type="range" min="0" max="100" step="0.1" value="0" data-plyr="seek">',
- '<progress class="plyr__progress--played" max="100" value="0">',
- '<span>0</span>% ' + config.i18n.played,
- '</progress>',
+ '<progress class="plyr__progress--played" max="100" value="0" role="presentation"></progress>',
'<progress class="plyr__progress--buffer" max="100" value="0">',
'<span>0</span>% ' + config.i18n.buffered,
'</progress>');
@@ -767,8 +752,8 @@
if (_inArray(config.controls, 'mute')) {
html.push(
'<button type="button" data-plyr="mute">',
- '<svg class="icon--muted"><use xlink:href="#' + config.iconPrefix + '-muted" /></svg>',
- '<svg><use xlink:href="#' + config.iconPrefix + '-volume" /></svg>',
+ '<svg class="icon--muted"><use xlink:href="' + iconPath + '-muted" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-volume" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.toggleMute + '</span>',
'</button>'
);
@@ -777,8 +762,11 @@
// Volume range control
if (_inArray(config.controls, 'volume')) {
html.push(
- '<label for="volume{id}" class="plyr__sr-only">' + config.i18n.volume + '</label>',
- '<input id="volume{id}" class="plyr__volume" type="range" min="0" max="10" value="5" data-plyr="volume">'
+ '<span class="plyr__volume">',
+ '<label for="volume{id}" class="plyr__sr-only">' + config.i18n.volume + '</label>',
+ '<input id="volume{id}" class="plyr__volume--input" type="range" min="0" max="10" value="5" data-plyr="volume">',
+ '<progress class="plyr__volume--display" max="10" value="0" role="presentation"></progress>',
+ '</span>'
);
}
@@ -786,8 +774,8 @@
if (_inArray(config.controls, 'captions')) {
html.push(
'<button type="button" data-plyr="captions">',
- '<svg class="icon--captions-on"><use xlink:href="#' + config.iconPrefix + '-captions-on" /></svg>',
- '<svg><use xlink:href="#' + config.iconPrefix + '-captions-off" /></svg>',
+ '<svg class="icon--captions-on"><use xlink:href="' + iconPath + '-captions-on" /></svg>',
+ '<svg><use xlink:href="' + iconPath+ '-captions-off" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.toggleCaptions + '</span>',
'</button>'
);
@@ -797,8 +785,8 @@
if (_inArray(config.controls, 'fullscreen')) {
html.push(
'<button type="button" data-plyr="fullscreen">',
- '<svg class="icon--exit-fullscreen"><use xlink:href="#' + config.iconPrefix + '-exit-fullscreen" /></svg>',
- '<svg><use xlink:href="#' + config.iconPrefix + '-enter-fullscreen" /></svg>',
+ '<svg class="icon--exit-fullscreen"><use xlink:href="' + iconPath + '-exit-fullscreen" /></svg>',
+ '<svg><use xlink:href="' + iconPath + '-enter-fullscreen" /></svg>',
'<span class="plyr__sr-only">' + config.i18n.toggleFullscreen + '</span>',
'</button>'
);
@@ -958,7 +946,7 @@
index = 0;
// Incase caption numbers are added
- if(parts[index].indexOf(":") === -1) {
+ if (parts[index].indexOf(":") === -1) {
index = 1;
}
@@ -993,12 +981,12 @@
container.innerHTML = '';
// Default to empty
- if(typeof caption === 'undefined') {
+ if (typeof caption === 'undefined') {
caption = '';
}
// Set the span content
- if(typeof caption === 'string') {
+ if (typeof caption === 'string') {
content.innerHTML = caption.trim();
}
else {
@@ -1185,7 +1173,7 @@
if (config.selectors.controls.container !== null) {
container = config.selectors.controls.container;
- if(typeof selector === 'string') {
+ if (typeof selector === 'string') {
container = document.querySelector(container);
}
}
@@ -1227,10 +1215,8 @@
plyr.buttons.fullscreen = _getElement(config.selectors.buttons.fullscreen);
// Inputs
- plyr.buttons.volume = _getElement(config.selectors.buttons.volume);
plyr.buttons.mute = _getElement(config.selectors.buttons.mute);
plyr.buttons.captions = _getElement(config.selectors.buttons.captions);
- plyr.checkboxes = _getElements('[type="checkbox"]');
// Progress
plyr.progress = {};
@@ -1242,15 +1228,15 @@
plyr.progress.buffer.text = plyr.progress.buffer.bar && plyr.progress.buffer.bar.getElementsByTagName('span')[0];
// Progress - Played
- plyr.progress.played = {};
- plyr.progress.played.bar = _getElement(config.selectors.progress.played);
- plyr.progress.played.text = plyr.progress.played.bar && plyr.progress.played.bar.getElementsByTagName('span')[0];
+ plyr.progress.played = _getElement(config.selectors.progress.played);
// Seek tooltip
- plyr.progress.tooltip = plyr.progress.container && plyr.progress.container.querySelector('.' + config.classes.tooltip);
+ plyr.progress.tooltip = plyr.progress.container && plyr.progress.container.querySelector('.' + config.classes.tooltip);
// Volume
- plyr.volume = _getElement(config.selectors.buttons.volume);
+ plyr.volume = {};
+ plyr.volume.input = _getElement(config.selectors.volume.input);
+ plyr.volume.display = _getElement(config.selectors.volume.display);
// Timing
plyr.duration = _getElement(config.selectors.duration);
@@ -1276,7 +1262,7 @@
// Toggle native controls
function _toggleNativeControls(toggle) {
- if(toggle) {
+ if (toggle) {
plyr.media.setAttribute('controls', '');
}
else {
@@ -1421,7 +1407,7 @@
});
// If full support, we can use custom controls (hiding Vimeos), if not, use Vimeo
- if(plyr.supported.full) {
+ if (plyr.supported.full) {
container.appendChild(iframe);
plyr.media.appendChild(container);
}
@@ -1674,7 +1660,7 @@
plyr.media.buffered = data.percent;
_triggerEvent(plyr.media, 'progress');
- if(parseInt(data.percent) === 1) {
+ if (parseInt(data.percent) === 1) {
// Trigger event
_triggerEvent(plyr.media, 'canplaythrough');
}
@@ -1755,7 +1741,7 @@
plyr.media.buffered = data.loadProgress;
_triggerEvent(plyr.media, 'progress');
- if(parseInt(data.loadProgress) === 1) {
+ if (parseInt(data.loadProgress) === 1) {
// Trigger event
_triggerEvent(plyr.media, 'canplaythrough');
}
@@ -1775,14 +1761,14 @@
// Play media
function _play() {
- if('play' in plyr.media) {
+ if ('play' in plyr.media) {
plyr.media.play();
}
}
// Pause media
function _pause() {
- if('pause' in plyr.media) {
+ if ('pause' in plyr.media) {
plyr.media.pause();
}
}
@@ -1847,6 +1833,11 @@
targetTime = duration;
}
+ // Update progress
+ if (plyr.progress && plyr.progress.played) {
+ plyr.progress.played.value = ((100 / duration) * targetTime);
+ }
+
// Set the current time
// Try/catch incase the media isn't set and we're calling seek() from source() and IE moans
try {
@@ -1855,7 +1846,7 @@
catch(e) {}
// Embeds
- if(_inArray(config.types.embed, plyr.type)) {
+ if (_inArray(config.types.embed, plyr.type)) {
// YouTube
switch(plyr.type) {
case 'youtube':
@@ -1868,7 +1859,7 @@
break;
case 'soundcloud':
- plyr.embed.seekTo(targetTime*1000);
+ plyr.embed.seekTo(targetTime * 1000);
break;
}
@@ -1949,7 +1940,7 @@
_toggleClass(plyr.container, config.classes.fullscreen.active, plyr.isFullscreen);
// Trap focus
- if(plyr.isFullscreen) {
+ if (plyr.isFullscreen) {
plyr.container.setAttribute('tabindex', '-1');
}
else {
@@ -1987,8 +1978,13 @@
// Set mute on the player
plyr.media.muted = muted;
+ // If volume is 0 after unmuting, set to default
+ if (plyr.media.volume === 0) {
+ _setVolume(config.volume);
+ }
+
// Embeds
- if(_inArray(config.types.embed, plyr.type)) {
+ if (_inArray(config.types.embed, plyr.type)) {
// YouTube
switch(plyr.type) {
case 'youtube':
@@ -2025,7 +2021,7 @@
}
// Use config if all else fails
- if(volume === null || isNaN(volume)) {
+ if (volume === null || isNaN(volume)) {
volume = config.volume;
}
@@ -2041,11 +2037,13 @@
// Set the player volume
plyr.media.volume = parseFloat(volume / 10);
- // Store in config
- config.volume = volume;
+ // Set the display
+ if (plyr.volume.display) {
+ plyr.volume.display.value = volume;
+ }
// Embeds
- if(_inArray(config.types.embed, plyr.type)) {
+ if (_inArray(config.types.embed, plyr.type)) {
// YouTube
switch(plyr.type) {
case 'youtube':
@@ -2077,8 +2075,13 @@
var volume = plyr.media.muted ? 0 : (plyr.media.volume * 10);
// Update the <input type="range"> if present
- if (plyr.supported.full && plyr.volume) {
- plyr.volume.value = volume;
+ if (plyr.supported.full) {
+ if (plyr.volume.input) {
+ plyr.volume.input.value = volume;
+ }
+ if (plyr.volume.display) {
+ plyr.volume.display.value = volume;
+ }
}
// Store the volume in storage
@@ -2135,8 +2138,8 @@
// Update <progress> elements
function _updateProgress(event) {
- var progress = plyr.progress.played.bar,
- text = plyr.progress.played.text,
+ var progress = plyr.progress.played,
+ text = false,
value = 0,
duration = _getDuration();
@@ -2154,32 +2157,27 @@
break;
- // Events from seek range
- case 'change':
- case 'input':
- value = event.target.value;
- break;
-
-
// Check buffer status
case 'playing':
case 'progress':
progress = plyr.progress.buffer.bar;
text = plyr.progress.buffer.text;
value = (function() {
- var buffered = plyr.media.buffered;
+ var buffered = plyr.media.buffered;
- // HTML5
- if (buffered && buffered.length) {
- return _getPercentage(buffered.end(0), duration);
- }
- // YouTube returns between 0 and 1
- else if (typeof buffered === 'number') {
- return (buffered * 100);
- }
+ // HTML5
+ if (buffered && buffered.length) {
+ return _getPercentage(buffered.end(0), duration);
+ }
+ // YouTube returns between 0 and 1
+ else if (typeof buffered === 'number') {
+ return (buffered * 100);
+ }
+
+ return 0;
+ })();
- return 0;
- })();
+ break;
}
}
@@ -2248,7 +2246,7 @@
_updateTimeDisplay(plyr.media.currentTime, plyr.currentTime);
// Ignore updates while seeking
- if(event && event.type == 'timeupdate' && plyr.media.seeking) {
+ if (event && event.type == 'timeupdate' && plyr.media.seeking) {
return;
}
@@ -2259,7 +2257,7 @@
// Update hover tooltip for seeking
function _updateSeekTooltip(event) {
// Bail if setting not true
- if (!config.tooltips.seek || plyr.browser.touch) {
+ if (!config.tooltips.seek || plyr.browser.touch || !plyr.progress.container) {
return;
}
@@ -2270,7 +2268,7 @@
// Determine percentage, if already visible
if (!event) {
- if(_hasClass(plyr.progress.tooltip, visible)) {
+ if (_hasClass(plyr.progress.tooltip, visible)) {
percent = plyr.progress.tooltip.style.left.replace('%', '');
}
else {
@@ -2297,7 +2295,7 @@
// Show/hide the tooltip
// If the event is a moues in/out and percentage is inside bounds
- if(event && _inArray(['mouseenter', 'mouseleave'], event.type)) {
+ if (event && _inArray(['mouseenter', 'mouseleave'], event.type)) {
_toggleClass(plyr.progress.tooltip, visible, (event.type === 'mouseenter'));
}
}
@@ -2307,16 +2305,28 @@
if (!config.hideControls || plyr.type === 'audio') {
return;
}
- var delay = false,
+ var delay = 0,
isEnterFullscreen = false,
show = toggle;
// Default to false if no boolean
- if(typeof toggle !== "boolean") {
- if(toggle && toggle.type) {
- delay = (toggle.type === 'mousemove');
+ if (typeof toggle !== "boolean") {
+ if (toggle && toggle.type) {
+ // Is the enter fullscreen event
isEnterFullscreen = (toggle.type === 'enterfullscreen');
- show = _inArray(['mousemove','mouseenter'], toggle.type);
+
+ // Whether to show controls
+ show = _inArray(['mousemove', 'mouseenter', 'focus'], toggle.type);
+
+ // Delay hiding on mousemove events
+ if (toggle.type === 'mousemove') {
+ delay = 2000;
+ }
+
+ // Delay a little more for keyboard users
+ if (toggle.type === 'focus') {
+ delay = 3000;
+ }
}
else {
show = false;
@@ -2327,33 +2337,33 @@
window.clearTimeout(plyr.timers.hover);
// If the mouse is not over the controls, set a timeout to hide them
- if(show || plyr.media.paused) {
+ if (show || plyr.media.paused) {
_toggleClass(plyr.container, config.classes.hideControls, false);
// Always show controls when paused
- if(plyr.media.paused) {
+ if (plyr.media.paused) {
return;
}
}
// If toggle is false or if we're playing (regardless of toggle), then
// set the timer to hide the controls
- if(!show || !plyr.media.paused) {
+ if (!show || !plyr.media.paused) {
plyr.timers.hover = window.setTimeout(function() {
- // If the mouse is over the controls, bail
- if(plyr.controls.active && !isEnterFullscreen) {
+ // If the mouse is over the controls (and not entering fullscreen), bail
+ if (plyr.controls.active && !isEnterFullscreen) {
return;
}
_toggleClass(plyr.container, config.classes.hideControls, true);
- }, delay ? 2000 : 0);
+ }, delay);
}
}
// Add common function to retrieve media source
function _source(source) {
// If not null or undefined, parse it
- if(typeof source !== 'undefined') {
+ if (typeof source !== 'undefined') {
_updateSource(source);
return;
}
@@ -2397,9 +2407,12 @@
_pause();
// Set seek input to 0
- if(plyr.buttons.seek) {
+ if (plyr.buttons && plyr.buttons.seek) {
plyr.buttons.seek.value = 0;
}
+ if (plyr.progress && plyr.progress.played) {
+ plyr.progress.played.value = 0;
+ }
// Clean up YouTube stuff
if (plyr.type === 'youtube') {
@@ -2429,10 +2442,10 @@
plyr.type = source.type;
// Get child type for video (it might be an embed)
- if(plyr.type === 'video') {
+ if (plyr.type === 'video') {
var firstSource = source.sources[0];
- if('type' in firstSource && _inArray(config.types.embed, firstSource.type)) {
+ if ('type' in firstSource && _inArray(config.types.embed, firstSource.type)) {
plyr.type = firstSource.type;
}
}
@@ -2552,14 +2565,22 @@
var trigger = plyr.buttons[play ? 'play' : 'pause'],
target = plyr.buttons[play ? 'pause' : 'play'];
+ // Get the last play button to account for the large play button
+ if (target && target.length > 1) {
+ target = target[target.length - 1];
+ }
+ else {
+ target = target[0];
+ }
+
// Setup focus and tab focus
- if(target) {
+ if (target) {
var hadTabFocus = _hasClass(trigger, config.classes.tabFocus);
setTimeout(function() {
target.focus();
- if(hadTabFocus) {
+ if (hadTabFocus) {
_toggleClass(trigger, config.classes.tabFocus, false);
_toggleClass(target, config.classes.tabFocus, true);
}
@@ -2570,6 +2591,7 @@
// Detect tab focus
function checkFocus() {
var focused = document.activeElement;
+
if (!focused || focused == document.body) {
focused = null;
}
@@ -2579,7 +2601,14 @@
for (var button in plyr.buttons) {
var element = plyr.buttons[button];
- _toggleClass(element, config.classes.tabFocus, (element === focused));
+ if (element instanceof NodeList) {
+ for (var i = 0; i < element.length; i++) {
+ _toggleClass(element[i], config.classes.tabFocus, (element[i] === focused));
+ }
+ }
+ else {
+ _toggleClass(element, config.classes.tabFocus, (element === focused));
+ }
}
}
_on(window, 'keyup', function(event) {
@@ -2619,8 +2648,8 @@
_proxyListener(plyr.buttons.seek, inputEvent, config.listeners.seek, _seek);
// Set volume
- _proxyListener(plyr.volume, inputEvent, config.listeners.volume, function() {
- _setVolume(plyr.volume.value);
+ _proxyListener(plyr.volume.input, inputEvent, config.listeners.volume, function() {
+ _setVolume(plyr.volume.input.value);
});
// Mute
@@ -2642,14 +2671,16 @@
// Toggle controls visibility based on mouse movement
if (config.hideControls) {
- _on(plyr.container, 'mouseenter mouseleave mousemove', _toggleControls);
- //_on(plyr.container, 'mousemove', _debounce(_toggleControls, 200, true));
- _on(plyr.container, 'enterfullscreen', _toggleControls);
+ // Toggle controls on mouse events and entering fullscreen
+ _on(plyr.container, 'mouseenter mouseleave mousemove enterfullscreen', _toggleControls);
// Watch for cursor over controls so they don't hide when trying to interact
_on(plyr.controls, 'mouseenter mouseleave', function(event) {
plyr.controls.active = (event.type === 'mouseenter');
});
+
+ // Focus in/out on controls
+ _on(plyr.controls, 'focus blur', _toggleControls, true);
}
}
@@ -2688,11 +2719,20 @@
_on(plyr.media, 'waiting canplay seeked', _checkLoading);
// Click video
- if (config.clickToPlay) {
+ if (config.clickToPlay && plyr.type !== 'audio') {
+ // Re-fetch the wrapper
+ var wrapper = _getElement('.' + config.classes.videoWrapper);
+
+ // Bail if there's no wrapper (this should never happen)
+ if (!wrapper) {
+ return;
+ }
+
// Set cursor
- plyr.videoContainer.style.cursor = "pointer";
+ wrapper.style.cursor = "pointer";
- _on(plyr.media, 'click', function() {
+ // On click play, pause ore restart
+ _on(wrapper, 'click', function() {
if (plyr.media.paused) {
_play();
}
@@ -2715,7 +2755,7 @@
// Cancel current network requests
// See https://github.com/Selz/plyr/issues/174
function _cancelRequests() {
- if(!_inArray(config.types.html5, plyr.type)) {
+ if (!_inArray(config.types.html5, plyr.type)) {
return;
}
@@ -2793,7 +2833,17 @@
plyr.browser = _browserSniff();
// Get the media element
- plyr.media = plyr.container.querySelectorAll('audio, video, div')[0];
+ plyr.media = plyr.container.querySelectorAll('audio, video')[0];
+
+ // Get the div placeholder for YouTube and Vimeo
+ if (!plyr.media) {
+ plyr.media = plyr.container.querySelectorAll('div')[0];
+ }
+
+ // Bail if nothing to setup
+ if (!plyr.media) {
+ return;
+ }
// Get original classname
plyr.originalClassName = plyr.container.className;
@@ -2868,6 +2918,9 @@
// Remove controls
_remove(_getElement(config.selectors.controls.wrapper));
+ // Remove large play
+ _remove(_getElement(config.selectors.buttons.play));
+
// Restore native controls
_toggleNativeControls(true);
@@ -3031,7 +3084,7 @@
var config = _extend(defaults, options, JSON.parse(element.getAttribute("data-plyr")));
// Bail if not enabled
- if(!config.enabled) {
+ if (!config.enabled) {
return;
}
diff --git a/src/less/mixins.less b/src/less/mixins.less
new file mode 100644
index 00000000..25f43761
--- /dev/null
+++ b/src/less/mixins.less
@@ -0,0 +1,29 @@
+// ==========================================================================
+// Plyr mixins
+// https://github.com/selz/plyr
+// ==========================================================================
+
+// <input type="range"> styling
+.plyr-range-track() {
+ height: @plyr-range-track-height;
+ background: transparent;
+ border: 0;
+ border-radius: (@plyr-range-track-height / 2);
+ user-select: none;
+}
+.plyr-range-thumb() {
+ position: relative;
+ height: @plyr-range-thumb-height;
+ width: @plyr-range-thumb-width;
+ background: @plyr-range-thumb-bg;
+ border: @plyr-range-thumb-border;
+ border-radius: 100%;
+ transition: background .2s ease, border .2s ease, transform .2s ease;
+ box-shadow: @plyr-range-thumb-shadow;
+ box-sizing: border-box;
+}
+.plyr-range-thumb-active() {
+ background: @plyr-range-thumb-active-bg;
+ border-color: @plyr-range-thumb-active-border-color;
+ transform: scale(@plyr-range-thumb-active-scale);
+} \ No newline at end of file
diff --git a/src/less/plyr.less b/src/less/plyr.less
index 99df1115..c2b5e55b 100644
--- a/src/less/plyr.less
+++ b/src/less/plyr.less
@@ -3,65 +3,8 @@
// https://github.com/selz/plyr
// ==========================================================================
-// Variables
-// -------------------------------
-
-// Colors
-@plyr-color-main: #63B4E1;
-
-// Font sizes
-@plyr-font-size-small: 14px;
-@plyr-font-size-base: 16px;
-
-// Captions
-@plyr-font-size-captions-base: ceil(@plyr-font-size-base * 1.25);
-@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
-@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
-
-// Controls
-// #C6D6DB
-@plyr-control-spacing: 10px;
-@plyr-video-controls-bg: #000;
-@plyr-video-control-color: #fff;
-@plyr-video-control-color-hover: #fff;
-@plyr-video-control-bg-hover: @plyr-color-main;
-@plyr-audio-controls-bg: transparent;
-@plyr-audio-control-color: #565D64;
-@plyr-audio-control-color-hover: #fff;
-@plyr-audio-control-bg-hover: @plyr-color-main;
-
-// Tooltips
-@plyr-tooltip-bg: @plyr-video-controls-bg;
-@plyr-tooltip-border-color: fade(darken(@plyr-video-controls-bg, 75%), 10%);
-@plyr-tooltip-arrow-border-color: fade(darken(@plyr-video-controls-bg, 75%), 20%);
-@plyr-tooltip-border-width: 1px;
-@plyr-tooltip-shadow: 0 0 5px @plyr-tooltip-border-color, 0 0 0 @plyr-tooltip-border-width @plyr-tooltip-border-color;
-@plyr-tooltip-color: @plyr-video-control-color;
-@plyr-tooltip-padding: (@plyr-control-spacing / 2);
-@plyr-tooltip-arrow-size: 4px;
-@plyr-tooltip-radius: 3px;
-
-// Progress
-@plyr-progress-bg: fade(@plyr-video-control-color, 25%);
-@plyr-progress-playing-bg: @plyr-color-main;
-@plyr-progress-buffered-bg: fade(@plyr-video-control-color, 25%);
-@plyr-progress-loading-size: 25px;
-@plyr-progress-loading-bg: fade(#000, 15%);
-
-// Range sliders
-@range-track-height: 8px;
-@range-track-bg: fade(#fff, 25%);
-@range-thumb-height: floor(@range-track-height * 2);
-@range-thumb-width: floor(@range-track-height * 2);
-@range-thumb-bg: #fff;
-@range-thumb-border: 2px solid transparent;
-@range-thumb-active-border-color: #fff;
-@range-thumb-active-bg: @plyr-video-control-bg-hover;
-@range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
-
-// Breakpoints
-@plyr-bp-control-split: 560px; // When controls split into left/right
-@plyr-bp-captions-large: 768px; // When captions jump to the larger font size
+@import "variables";
+@import "mixins";
// Animation
// ---------------------------------------
@@ -69,40 +12,13 @@
to { background-position: @plyr-progress-loading-size 0; }
}
-// Mixins
-// -------------------------------
-// <input type="range"> styling
-.range-track() {
- height: @range-track-height;
- background: @range-track-bg;
- border: 0;
- border-radius: (@range-track-height / 2);
- user-select: none;
-}
-.range-thumb() {
- position: relative;
- height: @range-thumb-height;
- width: @range-thumb-width;
- background: @range-thumb-bg;
- border: @range-thumb-border;
- border-radius: 100%;
- transition: background .2s ease, border .2s ease, transform .2s ease;
- box-shadow: @range-thumb-shadow;
- box-sizing: border-box;
-}
-.range-thumb-active() {
- background: @range-thumb-active-bg;
- border-color: @range-thumb-active-border-color;
- transform: scale(1.25);
-}
-
// Styles
// -------------------------------
// Base
.plyr {
position: relative;
max-width: 100%;
- min-width: 290px;
+ min-width: 200px;
font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
// border-box everything
@@ -132,7 +48,7 @@
// Specificity is for bootstrap compatibility
input[type='range'] {
display: block;
- height: @range-thumb-height;
+ height: (@plyr-range-thumb-height * @plyr-range-thumb-active-scale);
width: 100%;
margin: 0;
padding: 0;
@@ -143,22 +59,22 @@
border: none;
background: transparent;
- // Webkit
+ // WebKit
&::-webkit-slider-runnable-track {
- .range-track();
+ .plyr-range-track();
}
&::-webkit-slider-thumb {
-webkit-appearance: none;
- margin-top: -((@range-thumb-height - @range-track-height) / 2);
- .range-thumb();
+ margin-top: -((@plyr-range-thumb-height - @plyr-range-track-height) / 2);
+ .plyr-range-thumb();
}
// Mozilla
&::-moz-range-track {
- .range-track();
+ .plyr-range-track();
}
&::-moz-range-thumb {
- .range-thumb();
+ .plyr-range-thumb();
}
&::-moz-focus-outer {
border: 0;
@@ -166,22 +82,23 @@
// Microsoft
&::-ms-track {
- height: @range-track-height;
+ height: @plyr-range-track-height;
background: transparent;
border: 0;
color: transparent;
}
- &::-ms-fill-lower,
&::-ms-fill-upper {
- .range-track();
+ .plyr-range-track();
+ }
+ &::-ms-fill-lower {
+ .plyr-range-track();
+ background: @plyr-range-selected-bg;
}
&::-ms-thumb {
- .range-thumb();
-
+ .plyr-range-thumb();
// For some reason, Edge uses the -webkit margin above
margin-top: 0;
}
-
&::-ms-tooltip {
display: none;
}
@@ -194,25 +111,34 @@
border: 0;
}
&.tab-focus:focus {
- outline: 1px dotted fade(@plyr-video-control-color, 50%);
outline-offset: 3px;
}
// Pressed styles
&:active {
&::-webkit-slider-thumb {
- .range-thumb-active();
+ .plyr-range-thumb-active();
}
&::-moz-range-thumb {
- .range-thumb-active();
+ .plyr-range-thumb-active();
}
&::-ms-thumb {
- .range-thumb-active();
+ .plyr-range-thumb-active();
}
}
}
}
+// Video range inputs
+.plyr--video input[type='range'].tab-focus:focus {
+ outline: 1px dotted fade(@plyr-video-control-color, 50%);
+}
+
+// Audio range inputs
+.plyr--audio input[type='range'].tab-focus:focus {
+ outline: 1px dotted fade(@plyr-audio-control-color, 50%);
+}
+
// Screen reader only elements
.plyr__sr-only {
position: absolute !important;
@@ -229,6 +155,9 @@
position: relative;
background: #000;
border-radius: inherit;
+
+ // Cleaner radius, also forces iframe radius
+ -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
}
// Container for embeds
@@ -277,6 +206,7 @@
font-size: @plyr-font-size-captions-base;
text-align: center;
font-weight: 400;
+ -webkit-font-smoothing: subpixel-antialiased;
span {
border-radius: 2px;
@@ -287,7 +217,7 @@
display: none;
}
- @media (min-width: @plyr-bp-captions-large) {
+ @media (min-width: @plyr-bp-screen-md) {
font-size: @plyr-font-size-captions-medium;
}
}
@@ -300,12 +230,6 @@
// Controls
// --------------------------------------------------------------
-// Shared
-.plyr__controls,
-.plyr__play-large {
- transition: visibility .3s ease, opacity .3s ease;
-}
-
// Playback controls
.plyr__controls {
display: flex;
@@ -314,17 +238,19 @@
line-height: 1;
text-align: center;
+ transition: opacity .3s ease;
+
// Spacing
> button,
.plyr__progress,
.plyr__time {
- margin-left: @plyr-control-spacing;
+ margin-left: (@plyr-control-spacing / 2);
&:first-child {
margin-left: 0;
}
}
- .plyr__volume[type="range"] {
+ .plyr__volume {
margin-left: (@plyr-control-spacing / 2);
}
[data-plyr="pause"] {
@@ -337,7 +263,7 @@
display: inline-block;
flex-shrink: 0;
vertical-align: middle;
- padding: (@plyr-control-spacing / 2) @plyr-control-spacing;
+ padding: (@plyr-control-spacing / 2);
border: 0;
background: transparent;
border-radius: 3px;
@@ -364,6 +290,21 @@
.icon--captions-on {
display: none;
}
+
+ @media (min-width: @plyr-bp-screen-sm) {
+ > button,
+ .plyr__progress,
+ .plyr__time {
+ margin-left: @plyr-control-spacing;
+ }
+ button {
+ padding: (@plyr-control-spacing / 2) @plyr-control-spacing;
+ }
+ }
+}
+// Hide controls
+.plyr--hide-controls .plyr__controls {
+ opacity: 0;
}
// Video controls
@@ -372,7 +313,7 @@
left: 0;
right: 0;
bottom: 0;
- padding: (@plyr-control-spacing * 5) (@plyr-control-spacing * 1.5) @plyr-control-spacing;
+ padding: (@plyr-control-spacing * 5) @plyr-control-spacing @plyr-control-spacing;
background: linear-gradient(fade(@plyr-video-controls-bg, 0%), fade(@plyr-video-controls-bg, 50%));
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
@@ -386,11 +327,20 @@
color: @plyr-video-control-color-hover;
}
}
+
+ @media (min-width: @plyr-bp-screen-sm) {
+ padding-left: (@plyr-control-spacing * 1.5);
+ padding-right: (@plyr-control-spacing * 1.5);
+ }
}
+
+// Audio controls
.plyr--audio .plyr__controls {
padding: @plyr-control-spacing;
border-radius: inherit;
background: @plyr-audio-controls-bg;
+ border: @plyr-audio-controls-border;
+ box-shadow: @plyr-audio-controls-box-shadow;
color: @plyr-audio-control-color;
button {
@@ -403,7 +353,7 @@
}
}
-// Large play button
+// Large play button (video only)
.plyr__play-large {
position: absolute;
top: 50%;
@@ -411,9 +361,11 @@
transform: translate(-50%, -50%);
padding: @plyr-control-spacing;
background: @plyr-video-control-bg-hover;
- border: 4px solid @plyr-video-control-color;
+ border: 4px solid currentColor;
border-radius: 100%;
+ box-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%);
color: @plyr-video-control-color;
+ transition: opacity .3s ease, visibility .3s ease;
svg {
position: relative;
@@ -431,6 +383,10 @@
.plyr--audio .plyr__play-large {
display: none;
}
+.plyr--playing .plyr__play-large {
+ opacity: 0;
+ visibility: hidden;
+}
// States
.plyr__controls [data-plyr='pause'],
@@ -441,13 +397,6 @@
display: inline-block;
}
-// Hide controls
-.plyr--hide-controls .plyr__controls,
-.plyr--playing .plyr__play-large {
- visibility: hidden;
- opacity: 0;
-}
-
// Change icons on state change
.plyr--fullscreen-active .icon--exit-fullscreen,
.plyr--muted .plyr__controls .icon--muted,
@@ -472,7 +421,6 @@
// Tooltips
// --------------------------------------------------------------
.plyr__tooltip {
- visibility: hidden;
position: absolute;
z-index: 2;
bottom: 100%;
@@ -488,10 +436,11 @@
color: @plyr-tooltip-color;
font-size: @plyr-font-size-small;
line-height: 1.3;
+ -webkit-font-smoothing: subpixel-antialiased;
transform: translate(-50%, 10px) scale(.8);
transform-origin: 50% 100%;
- transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease;
+ transition: transform .2s .1s ease, opacity .2s .1s ease;
// Arrows
&::before {
@@ -514,7 +463,6 @@
.plyr button:hover .plyr__tooltip,
.plyr button.tab-focus:focus .plyr__tooltip,
.plyr__tooltip--visible {
- visibility: visible;
opacity: 1;
transform: translate(-50%, 0) scale(1);
}
@@ -539,7 +487,6 @@
&::-moz-range-track {
background: transparent;
}
- &::-ms-fill-lower,
&::-ms-fill-upper {
background: transparent;
}
@@ -552,13 +499,14 @@
}
.plyr__progress--buffer[value],
-.plyr__progress--played[value] {
+.plyr__progress--played[value],
+.plyr__volume--display[value] {
position: absolute;
left: 0;
top: 50%;
width: 100%;
- height: @range-track-height;
- margin: -(@range-track-height / 2) 0 0;
+ height: @plyr-range-track-height;
+ margin: -(@plyr-range-track-height / 2) 0 0;
padding: 0;
vertical-align: top;
appearance: none;
@@ -571,42 +519,41 @@
&::-webkit-progress-value {
background: currentColor;
border-radius: 100px;
- min-width: @range-track-height;
+ min-width: @plyr-range-track-height;
}
&::-moz-progress-bar {
background: currentColor;
border-radius: 100px;
- min-width: @range-track-height;
+ min-width: @plyr-range-track-height;
}
&::-ms-fill {
border-radius: 100px;
}
}
-.plyr__progress--played[value] {
+.plyr__progress--played[value],
+.plyr__volume--display[value] {
z-index: 1;
- color: @plyr-progress-playing-bg;
+ color: @plyr-range-selected-bg;
background: transparent;
+ transition: none;
&::-webkit-progress-value {
- min-width: @range-track-height;
+ min-width: @plyr-range-track-height;
+ max-width: 99%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&::-moz-progress-bar {
- min-width: @range-track-height;
+ min-width: @plyr-range-track-height;
+ max-width: 99%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&::-ms-fill {
- min-width: @range-track-height;
- border-top-right-radius: 0;
- border-bottom-right-radius: 0;
+ display: none;
}
}
.plyr__progress--buffer[value] {
- color: @plyr-progress-buffered-bg;
- background: @range-track-bg;
-
&::-webkit-progress-value {
transition: width .2s ease;
}
@@ -617,13 +564,26 @@
transition: width .2s ease;
}
}
+.plyr--video .plyr__progress--buffer[value],
+.plyr--video .plyr__volume--display[value] {
+ background: @plyr-video-range-track-bg;
+}
+.plyr--video .plyr__progress--buffer[value] {
+ color: @plyr-video-progress-buffered-bg;
+}
+.plyr--audio .plyr__progress--buffer[value],
+.plyr--audio .plyr__volume--display[value] {
+ background: @plyr-audio-range-track-bg;
+}
+.plyr--audio .plyr__progress--buffer[value] {
+ color: @plyr-audio-progress-buffered-bg;
+}
// Loading state
.plyr--loading .plyr__progress--buffer {
animation: plyr-progress 1s linear infinite;
background-size: @plyr-progress-loading-size @plyr-progress-loading-size;
background-repeat: repeat-x;
- background-color: @plyr-progress-buffered-bg;
background-image: linear-gradient(
-45deg,
@plyr-progress-loading-bg 25%,
@@ -635,6 +595,12 @@
transparent);
color: transparent;
}
+.plyr--video.plyr--loading .plyr__progress--buffer {
+ background-color: @plyr-video-progress-buffered-bg;
+}
+.plyr--audio.plyr--loading .plyr__progress--buffer {
+ background-color: @plyr-audio-progress-buffered-bg;
+}
// Time
// --------------------------------------------------------------
@@ -643,13 +609,13 @@
vertical-align: middle;
font-size: @plyr-font-size-small;
line-height: .95;
+ -webkit-font-smoothing: subpixel-antialiased;
}
-
// Media duration hidden on small screens
.plyr__time + .plyr__time {
display: none;
- @media (min-width: @plyr-bp-control-split) {
+ @media (min-width: @plyr-bp-screen-md) {
display: inline-block;
}
@@ -662,23 +628,29 @@
// Volume
// --------------------------------------------------------------
-// <input[type='range']> element
-// Specificity is for bootstrap compatibility
-.plyr__volume[type='range'] {
- max-width: 100px;
+.plyr .plyr__volume {
+ display: none;
+ position: relative;
+
+ input[type="range"] {
+ position: relative;
+ z-index: 2;
+ }
+ @media (min-width: @plyr-bp-screen-sm) {
+ display: block;
+ max-width: 60px;
+ }
+ @media (min-width: @plyr-bp-screen-md) {
+ max-width: 100px;
+ }
}
// Hide sound controls on iOS
// It's not supported to change volume using JavaScript:
// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
.plyr--is-ios .plyr__volume,
-.plyr--is-ios [data-plyr='mute'],
-.plyr--is-ios.plyr--audio .plyr__controls--right {
- display: none;
-}
-// Center buttons so it looks less odd
-.plyr--is-ios.plyr--audio .plyr__controls--left {
- float: none;
+.plyr--is-ios [data-plyr='mute'] {
+ display: none !important;
}
// Fullscreen
@@ -694,6 +666,7 @@
width: 100%;
z-index: 10000000;
background: #000;
+ border-radius: 0;
video {
height: 100%;
diff --git a/src/less/variables.less b/src/less/variables.less
new file mode 100644
index 00000000..ea5c6b8e
--- /dev/null
+++ b/src/less/variables.less
@@ -0,0 +1,66 @@
+// ==========================================================================
+// Plyr variables
+// https://github.com/selz/plyr
+// ==========================================================================
+
+// Colors
+@plyr-color-main: #3498db;
+
+// Font sizes
+@plyr-font-size-small: 14px;
+@plyr-font-size-base: 16px;
+
+// Captions
+@plyr-font-size-captions-base: ceil(@plyr-font-size-base * 1.25);
+@plyr-font-size-captions-medium: ceil(@plyr-font-size-base * 1.5);
+@plyr-font-size-captions-large: (@plyr-font-size-base * 2);
+
+// Controls
+@plyr-control-spacing: 10px;
+@plyr-video-controls-bg: #000;
+@plyr-video-control-color: #fff;
+@plyr-video-control-color-hover: #fff;
+@plyr-video-control-bg-hover: @plyr-color-main;
+@plyr-audio-controls-bg: #fff;
+@plyr-audio-controls-border: 1px solid #dbe3e8;
+@plyr-audio-controls-box-shadow: 0 1px 1px fade(#000, 5%);
+@plyr-audio-control-color: #565D64;
+@plyr-audio-control-color-hover: #fff;
+@plyr-audio-control-bg-hover: @plyr-color-main;
+
+// Tooltips
+@plyr-tooltip-bg: @plyr-video-controls-bg;
+@plyr-tooltip-border-color: fade(darken(@plyr-video-controls-bg, 75%), 10%);
+@plyr-tooltip-arrow-border-color: fade(darken(@plyr-video-controls-bg, 75%), 20%);
+@plyr-tooltip-border-width: 1px;
+@plyr-tooltip-shadow: 0 0 5px @plyr-tooltip-border-color, 0 0 0 @plyr-tooltip-border-width @plyr-tooltip-border-color;
+@plyr-tooltip-color: @plyr-video-control-color;
+@plyr-tooltip-padding: (@plyr-control-spacing / 2);
+@plyr-tooltip-arrow-size: 4px;
+@plyr-tooltip-radius: 3px;
+
+// Progress
+@plyr-progress-loading-size: 25px;
+@plyr-progress-loading-bg: fade(#000, 15%);
+@plyr-video-progress-bg: fade(#fff, 25%);
+@plyr-video-progress-buffered-bg: @plyr-video-progress-bg;
+@plyr-audio-progress-bg: fade(#C6D6DB, 66%);
+@plyr-audio-progress-buffered-bg: @plyr-audio-progress-bg;
+
+// Range sliders
+@plyr-range-track-height: 8px;
+@plyr-range-thumb-height: floor(@plyr-range-track-height * 2);
+@plyr-range-thumb-width: floor(@plyr-range-track-height * 2);
+@plyr-range-thumb-bg: #fff;
+@plyr-range-thumb-border: 2px solid transparent;
+@plyr-range-thumb-shadow: 0 1px 1px fade(@plyr-video-controls-bg, 15%), 0 0 0 1px fade(#000, 15%);
+@plyr-range-thumb-active-border-color: #fff;
+@plyr-range-thumb-active-bg: @plyr-video-control-bg-hover;
+@plyr-range-thumb-active-scale: 1.25;
+@plyr-video-range-track-bg: @plyr-video-progress-buffered-bg;
+@plyr-audio-range-track-bg: @plyr-audio-progress-buffered-bg;
+@plyr-range-selected-bg: @plyr-color-main;
+
+// Breakpoints
+@plyr-bp-screen-sm: 480px;
+@plyr-bp-screen-md: 768px; \ No newline at end of file
diff --git a/src/sass/plyr.scss b/src/sass/plyr.scss
deleted file mode 100644
index 8de9af6e..00000000
--- a/src/sass/plyr.scss
+++ /dev/null
@@ -1,719 +0,0 @@
-// ==========================================================================
-// Plyr styles
-// https://github.com/selz/plyr
-// ==========================================================================
-
-// Variables
-// -------------------------------
-
-// Colors
-$plyr-blue: #3498DB !default;
-$plyr-gray-dark: #343F4A !default;
-$plyr-gray: #565D64 !default;
-$plyr-gray-light: #6B7D86 !default;
-$plyr-gray-lighter: #CBD0D3 !default;
-$plyr-off-white: #D6DADD !default;
-
-// Font sizes
-$plyr-font-size-small: 14px !default;
-$plyr-font-size-base: 16px !default;
-
-// Captions
-$plyr-font-size-captions-base: ceil($plyr-font-size-base * 1.25) !default;
-$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
-$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
-
-// Controls
-$plyr-control-spacing: 10px !default;
-$plyr-controls-bg: #fff !default;
-$plyr-control-bg-hover: $plyr-blue !default;
-
-// Contrast
-@if lightness($plyr-controls-bg) >= 65% {
- $plyr-control-color: $plyr-gray-light !default;
-}
-@else {
- $plyr-control-color: $plyr-gray-lighter !default;
-}
-@if lightness($plyr-control-bg-hover) >= 65% {
- $plyr-control-color-hover: $plyr-gray !default;
-}
-@else {
- $plyr-control-color-hover: #fff !default;
-}
-
-// Tooltips
-$plyr-tooltip-bg: $plyr-controls-bg !default;
-$plyr-tooltip-border-color: transparentize(darken($plyr-controls-bg, 75%), .9) !default;
-$plyr-tooltip-arrow-border-color: transparentize(darken($plyr-controls-bg, 75%), .8) !default;
-
-$plyr-tooltip-border-width: 1px;
-$plyr-tooltip-shadow: 0 0 5px $plyr-tooltip-border-color, 0 0 0 $plyr-tooltip-border-width $plyr-tooltip-border-color;
-$plyr-tooltip-color: $plyr-control-color !default;
-$plyr-tooltip-padding: $plyr-control-spacing !default;
-$plyr-tooltip-arrow-size: 6px !default;
-$plyr-tooltip-radius: 3px !default;
-
-// Progress
-$plyr-progress-bg: transparentize($plyr-gray, .8) !default;
-$plyr-progress-playing-bg: $plyr-blue !default;
-$plyr-progress-buffered-bg: transparentize($plyr-gray, .75) !default;
-$plyr-progress-loading-size: 40px !default;
-$plyr-progress-loading-bg: transparentize(#000, .85) !default;
-
-// Volume
-$plyr-volume-track-height: 6px !default;
-$plyr-volume-track-bg: darken($plyr-controls-bg, 10%) !default;
-$plyr-volume-thumb-height: ($plyr-volume-track-height * 2) !default;
-$plyr-volume-thumb-width: ($plyr-volume-track-height * 2) !default;
-$plyr-volume-thumb-bg: $plyr-control-color !default;
-$plyr-volume-thumb-bg-focus: $plyr-control-bg-hover !default;
-
-// Breakpoints
-$plyr-bp-control-split: 560px !default; // When controls split into left/right
-$plyr-bp-captions-large: 768px !default; // When captions jump to the larger font size
-
-// Animation
-// ---------------------------------------
-@keyframes plyr-progress {
- to { background-position: $plyr-progress-loading-size 0; }
-}
-
-// Font smoothing
-@mixin font-smoothing($mode: on)
-{
- @if ($mode == 'on') {
- -moz-osx-font-smoothing: grayscale;
- -webkit-font-smoothing: antialiased;
- }
- @else if ($mode == 'off') {
- -moz-osx-font-smoothing: auto;
- -webkit-font-smoothing: subpixel-antialiased;
- }
-}
-
-// <input type="range"> styling
-@mixin volume-thumb() {
- height: $plyr-volume-thumb-height;
- width: $plyr-volume-thumb-width;
- background: $plyr-volume-thumb-bg;
- border: 0;
- border-radius: 100%;
- transition: background .3s ease;
- cursor: ew-resize;
-}
-@mixin volume-track() {
- height: $plyr-volume-track-height;
- background: $plyr-volume-track-bg;
- border: 0;
- border-radius: ($plyr-volume-track-height / 2);
-}
-@mixin seek-thumb() {
- background: transparent;
- border: 0;
- width: 1px;
- height: $plyr-control-spacing;
-}
-@mixin seek-thumb-touch() {
- width: ($plyr-control-spacing * 4);
- transform: translateX(-50%);
-}
-@mixin seek-track() {
- background: none;
- border: 0;
-}
-
-// Styles
-// -------------------------------
-// Base
-.plyr {
- position: relative;
- max-width: 100%;
- min-width: 290px;
- font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
-
- // border-box everything
- // http://paulirish.com/2012/box-sizing-border-box-ftw/
- &,
- *,
- *::after,
- *::before {
- box-sizing: border-box;
- }
-
- // Fix 300ms delay
- a, button, input, label {
- touch-action: manipulation;
- }
-
- // Screen reader only
- &__sr-only {
- position: absolute !important;
- clip: rect(1px, 1px, 1px, 1px);
- padding: 0 !important;
- border: 0 !important;
- height: 1px !important;
- width: 1px !important;
- overflow: hidden;
- }
-
- // For video
- &__video-wrapper {
- position: relative;
- }
- video,
- audio {
- width: 100%;
- height: auto;
- vertical-align: middle;
- }
-
- // Hide default captions
- video::-webkit-media-text-track-container {
- display: none;
- }
-
- // For embeds
- &__video-embed {
- padding-bottom: 56.25%; /* 16:9 */
- height: 0;
- overflow: hidden;
- background: #000;
-
- iframe {
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- border: 0;
- user-select: none;
- }
-
- // Vimeo hack
- > div {
- position: relative;
- padding-bottom: 200%;
- transform: translateY(-35.95%);
- }
-
- // To allow mouse events to be captured if full support
- &.plyr iframe {
- pointer-events: none;
- }
- }
-
- // Captions
- &__captions {
- display: none;
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- padding: ($plyr-control-spacing * 2) ($plyr-control-spacing * 2) ($plyr-control-spacing * 3);
- color: #fff;
- font-size: $plyr-font-size-captions-base;
- text-align: center;
- @include font-smoothing();
-
- span {
- border-radius: 2px;
- padding: 3px 10px;
- background: transparentize(#000, .1);
- }
- span:empty {
- display: none;
- }
-
- @media (min-width: $plyr-bp-captions-large) {
- font-size: $plyr-font-size-captions-medium;
- }
- }
- &--captions-active &__captions {
- display: block;
- }
- &--fullscreen-active &__captions {
- font-size: $plyr-font-size-captions-large;
- }
-
- // Playback controls
- &__controls {
- @include font-smoothing();
- position: relative;
- padding: $plyr-control-spacing;
- background: $plyr-controls-bg;
- line-height: 1;
- text-align: center;
- box-shadow: 0 1px 1px transparentize($plyr-gray-dark, .8);
-
- // Clear floats
- &::after {
- content: '';
- display: table;
- clear: both;
- }
-
- // Layout
- &--right {
- display: block;
- margin: $plyr-control-spacing auto 0;
- }
- @media (min-width: $plyr-bp-control-split) {
- &--left {
- float: left;
- }
- &--right {
- float: right;
- margin-top: 0;
- }
- }
-
- // Buttons
- button {
- display: inline-block;
- vertical-align: middle;
- margin: 0 2px;
- padding: ($plyr-control-spacing / 2) $plyr-control-spacing;
- overflow: hidden;
- border: 0;
- background: transparent;
- border-radius: 3px;
- cursor: pointer;
- color: $plyr-control-color;
- transition: background .3s ease, color .3s ease, opacity .3s ease;
-
- svg {
- width: 18px;
- height: 18px;
- display: block;
- fill: currentColor;
- transition: fill .3s ease;
- }
-
- // Hover and tab focus
- &.tab-focus:hover,
- &:hover {
- background: $plyr-control-bg-hover;
- color: $plyr-control-color-hover;
- }
- // Default focus
- &:focus {
- outline: 0;
- }
- }
-
- // Hide toggle icons by default
- .icon--exit-fullscreen,
- .icon--muted,
- .icon--captions-on {
- display: none;
- }
-
- // Time display
- .plyr__time {
- display: inline-block;
- vertical-align: middle;
- margin-left: $plyr-control-spacing;
- color: $plyr-control-color;
- font-weight: 600;
- font-size: $plyr-font-size-small;
- }
-
- // Media duration hidden on small screens
- .plyr__time + .plyr__time {
- display: none;
-
- @media (min-width: $plyr-bp-control-split) {
- display: inline-block;
- }
-
- // Add a slash in before
- &::before {
- content: '\2044';
- margin-right: $plyr-control-spacing;
- }
- }
- }
-
- // Tooltips
- &__tooltip {
- visibility: hidden;
- position: absolute;
- z-index: 2;
- bottom: 100%;
- margin-bottom: $plyr-tooltip-padding;
- padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5);
- pointer-events: none;
-
- opacity: 0;
- background: $plyr-tooltip-bg;
- box-shadow: $plyr-tooltip-shadow;
- border-radius: $plyr-tooltip-radius;
- color: $plyr-tooltip-color;
- font-size: $plyr-font-size-small;
- line-height: 1.5;
- font-weight: 600;
-
- transform: translate(-50%, 10px) scale(.8);
- transform-origin: 50% 100%;
- transition: transform .2s .1s ease, opacity .2s .1s ease, visibility .3s ease;
-
- // Arrows
- &::after,
- &::before {
- content: '';
- position: absolute;
- width: 0;
- height: 0;
- top: 100%;
- left: 50%;
- transform: translateX(-50%);
- }
- // The border triangle
- &::after {
- $plyr-border-arrow-size: ($plyr-tooltip-arrow-size + ($plyr-tooltip-border-width * 1));
- bottom: -($plyr-border-arrow-size + $plyr-tooltip-border-width);
- border-right: $plyr-border-arrow-size solid transparent;
- border-top: $plyr-border-arrow-size solid $plyr-tooltip-arrow-border-color;
- border-left: $plyr-border-arrow-size solid transparent;
- z-index: 1;
- }
- // The background triangle
- &::before {
- bottom: -$plyr-tooltip-arrow-size;
- border-right: $plyr-tooltip-arrow-size solid transparent;
- border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
- border-left: $plyr-tooltip-arrow-size solid transparent;
- z-index: 2;
- }
- }
- button:hover .plyr__tooltip,
- button.tab-focus:focus .plyr__tooltip,
- &__tooltip--visible {
- visibility: visible;
- opacity: 1;
- transform: translate(-50%, 0) scale(1);
- }
- button:hover .plyr__tooltip {
- z-index: 3;
- }
-
- // Common range styles
- input[type='range'].tab-focus:focus {
- outline: thin dotted transparentize($plyr-gray-dark, .8);
- outline-offset: 3px;
- }
-
- // Playback progress
- // <progress> element
- &__progress {
- position: absolute;
- bottom: 100%;
- left: 0;
- right: 0;
- width: 100%;
- height: $plyr-control-spacing;
- background: $plyr-progress-bg;
-
- &--buffer[value],
- &--played[value],
- &--seek[type='range'] {
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: $plyr-control-spacing;
- margin: 0;
- padding: 0;
- vertical-align: top;
-
- -webkit-appearance: none;
- -moz-appearance: none;
- border: none;
- background: transparent;
- }
- &--buffer[value],
- &--played[value] {
- &::-webkit-progress-bar {
- background: transparent;
- transition: width .2s ease;
- }
-
- // Inherit from currentColor;
- &::-webkit-progress-value {
- background: currentColor;
- transition: width .2s ease;
- }
- &::-moz-progress-bar {
- background: currentColor;
- transition: width .2s ease;
- }
- }
- &--played[value] {
- z-index: 2;
- color: $plyr-progress-playing-bg;
- }
- &--buffer[value] {
- color: $plyr-progress-buffered-bg;
- }
-
- // Seek control
- // <input[type='range']> element
- // Specificity is for bootstrap compatibility
- &--seek[type='range'] {
- z-index: 4;
- cursor: pointer;
- outline: 0;
-
- // Webkit
- &::-webkit-slider-runnable-track {
- @include seek-track();
- }
- &::-webkit-slider-thumb {
- -webkit-appearance: none;
- @include seek-thumb();
- }
-
- // Mozilla
- &::-moz-range-track {
- @include seek-track();
- }
- &::-moz-range-thumb {
- -moz-appearance: none;
- @include seek-thumb();
- }
-
- // Microsoft
- &::-ms-track {
- color: transparent;
- @include seek-track();
- }
- &::-ms-fill-lower,
- &::-ms-fill-upper {
- @include seek-track();
- }
- &::-ms-thumb {
- @include seek-thumb();
- }
-
- &:focus {
- outline: 0;
- }
- &::-moz-focus-outer {
- border: 0;
- }
- }
-
- // Seek tooltip to show time
- .plyr__tooltip {
- left: 0;
- }
- }
-
- // Touch seek wider handle
- &--is-touch &--seek[type='range'] {
- &::-webkit-slider-thumb {
- @include seek-thumb-touch();
- }
- // Mozilla
- &::-moz-range-thumb {
- @include seek-thumb-touch();
- }
- // Microsoft
- &::-ms-thumb {
- @include seek-thumb-touch();
- }
- }
-
- // Loading state
- &--loading .plyr__progress--buffer {
- animation: plyr-progress 1s linear infinite;
- background-size: $plyr-progress-loading-size $plyr-progress-loading-size;
- background-repeat: repeat-x;
- background-color: $plyr-progress-buffered-bg;
- background-image: linear-gradient(
- -45deg,
- $plyr-progress-loading-bg 25%,
- transparent 25%,
- transparent 50%,
- $plyr-progress-loading-bg 50%,
- $plyr-progress-loading-bg 75%,
- transparent 75%,
- transparent);
- color: transparent;
- }
-
- // States
- &__controls [data-plyr='pause'],
- &--playing .plyr__controls [data-plyr='play'] {
- display: none;
- }
- &--playing .plyr__controls [data-plyr='pause'] {
- display: inline-block;
- }
-
- // Volume control
- // <input[type='range']> element
- // Specificity is for bootstrap compatibility
- &__volume[type='range'] {
- display: inline-block;
- vertical-align: middle;
- -webkit-appearance: none;
- -moz-appearance: none;
- width: 100px;
- margin: 0 $plyr-control-spacing 0 0;
- padding: 0;
- cursor: pointer;
- background: transparent;
- border: none;
-
- // Webkit
- &::-webkit-slider-runnable-track {
- @include volume-track();
- }
- &::-webkit-slider-thumb {
- -webkit-appearance: none;
- margin-top: -(($plyr-volume-thumb-height - $plyr-volume-track-height) / 2);
- @include volume-thumb();
- }
-
- // Mozilla
- &::-moz-range-track {
- @include volume-track();
- }
- &::-moz-range-thumb {
- @include volume-thumb();
- }
-
- // Microsoft
- &::-ms-track {
- height: $plyr-volume-track-height;
- background: transparent;
- border-color: transparent;
- border-width: (($plyr-volume-thumb-height - $plyr-volume-track-height) / 2) 0;
- color: transparent;
- }
- &::-ms-fill-lower,
- &::-ms-fill-upper {
- @include volume-track();
- }
- &::-ms-thumb {
- @include volume-thumb();
- }
-
- &:focus {
- outline: 0;
-
- &::-webkit-slider-thumb {
- background: $plyr-volume-thumb-bg-focus;
- }
- &::-moz-range-thumb {
- background: $plyr-volume-thumb-bg-focus;
- }
- &::-ms-thumb {
- background: $plyr-volume-thumb-bg-focus;
- }
- }
- }
-
- // Hide sound controls on iOS
- // It's not supported to change volume using JavaScript:
- // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
- &--is-ios &__volume,
- &--is-ios [data-plyr='mute'],
- &--is-ios.plyr--audio &__controls--right {
- display: none;
- }
- // Center buttons so it looks less odd
- &--is-ios.plyr--audio &__controls--left {
- float: none;
- }
-
- // Audio specific styles
- // Position the progress within the container
- &--audio .plyr__controls {
- padding-top: ($plyr-control-spacing * 2);
- }
- &--audio .plyr__progress {
- bottom: auto;
- top: 0;
- background: $plyr-off-white;
- }
-
- // Full screen mode
- &--fullscreen,
- &--fullscreen-active {
- position: fixed;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- height: 100%;
- width: 100%;
- z-index: 10000000;
- background: #000;
-
- video {
- height: 100%;
- }
- .plyr__video-wrapper {
- height: 100%;
- width: 100%;
- }
- .plyr__controls {
- position: absolute;
- bottom: 0;
- left: 0;
- right: 0;
- }
- }
-
- // Hide controls when playing in full screen
- &--fullscreen-active.plyr--fullscreen--hide-controls.plyr--playing,
- &.plyr--fullscreen.plyr--fullscreen--hide-controls.plyr--playing {
- .plyr__controls {
- transform: translateY(100%) translateY($plyr-control-spacing / 2);
- transition: transform .3s .2s ease;
- }
- .plyr__captions {
- bottom: ($plyr-control-spacing / 2);
- transition: bottom .3s .2s ease;
- }
- &.plyr--hover .plyr__controls {
- transform: translateY(0);
- }
- }
-
- // Captions
- &.plyr--fullscreen .plyr__captions,
- &--fullscreen-active .plyr__captions,
- &--fullscreen--hide-controls.plyr--fullscreen-active.plyr--playing.plyr--hover .plyr__captions {
- top: auto;
- bottom: 90px;
-
- @media (min-width: $plyr-bp-control-split) {
- bottom: 60px;
- }
- }
-
- // Change icons on state change
- &--fullscreen-active .icon--exit-fullscreen,
- &--muted .plyr__controls .icon--muted,
- &--captions-active .plyr__controls .icon--captions-on {
- display: block;
-
- & + svg {
- display: none;
- }
- }
-
- // Some options are hidden by default
- [data-plyr='captions'],
- [data-plyr='fullscreen'] {
- display: none;
- }
- &--captions-enabled [data-plyr='captions'],
- &--fullscreen-enabled [data-plyr='fullscreen'] {
- display: inline-block;
- }
-}
diff --git a/src/scss/mixins.scss b/src/scss/mixins.scss
new file mode 100644
index 00000000..b4bfca6a
--- /dev/null
+++ b/src/scss/mixins.scss
@@ -0,0 +1,29 @@
+// ==========================================================================
+// Plyr mixins
+// https://github.com/selz/plyr
+// ==========================================================================
+
+// <input type="range"> styling
+@mixin plyr-range-track() {
+ height: $plyr-range-track-height;
+ background: transparent;
+ border: 0;
+ border-radius: ($plyr-range-track-height / 2);
+ user-select: none;
+}
+@mixin plyr-range-thumb() {
+ position: relative;
+ height: $plyr-range-thumb-height;
+ width: $plyr-range-thumb-width;
+ background: $plyr-range-thumb-bg;
+ border: $plyr-range-thumb-border;
+ border-radius: 100%;
+ transition: background .2s ease, border .2s ease, transform .2s ease;
+ box-shadow: $plyr-range-thumb-shadow;
+ box-sizing: border-box;
+}
+@mixin plyr-range-thumb-active() {
+ background: $plyr-range-thumb-active-bg;
+ border-color: $plyr-range-thumb-active-border-color;
+ transform: scale($plyr-range-thumb-active-scale);
+} \ No newline at end of file
diff --git a/src/scss/plyr.scss b/src/scss/plyr.scss
new file mode 100644
index 00000000..465df084
--- /dev/null
+++ b/src/scss/plyr.scss
@@ -0,0 +1,684 @@
+// ==========================================================================
+// Plyr styles
+// https://github.com/selz/plyr
+// ==========================================================================
+
+@import "variables";
+@import "mixins";
+
+// Animation
+// ---------------------------------------
+@keyframes plyr-progress {
+ to { background-position: $plyr-progress-loading-size 0; }
+}
+
+// Styles
+// -------------------------------
+// Base
+.plyr {
+ position: relative;
+ max-width: 100%;
+ min-width: 200px;
+ font-family: Avenir, "Avenir Next", "Helvetica Neue", "Segoe UI", Helvetica, Arial, sans-serif;
+
+ // border-box everything
+ // http://paulirish.com/2012/box-sizing-border-box-ftw/
+ &,
+ *,
+ *::after,
+ *::before {
+ box-sizing: border-box;
+ }
+
+ // Fix 300ms delay
+ a, button, input, label {
+ touch-action: manipulation;
+ }
+
+ // Media elements
+ video,
+ audio {
+ width: 100%;
+ height: auto;
+ vertical-align: middle;
+ border-radius: inherit;
+ }
+
+ // Range inputs
+ // Specificity is for bootstrap compatibility
+ input[type='range'] {
+ display: block;
+ height: ($plyr-range-thumb-height * $plyr-range-thumb-active-scale);
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ vertical-align: middle;
+
+ appearance: none;
+ cursor: pointer;
+ border: none;
+ background: transparent;
+
+ // WebKit
+ &::-webkit-slider-runnable-track {
+ @include plyr-range-track();
+ }
+ &::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ margin-top: -(($plyr-range-thumb-height - $plyr-range-track-height) / 2);
+ @include plyr-range-thumb();
+ }
+
+ // Mozilla
+ &::-moz-range-track {
+ @include plyr-range-track();
+ }
+ &::-moz-range-thumb {
+ @include plyr-range-thumb();
+ }
+ &::-moz-focus-outer {
+ border: 0;
+ }
+
+ // Microsoft
+ &::-ms-track {
+ height: $plyr-range-track-height;
+ background: transparent;
+ border: 0;
+ color: transparent;
+ }
+ &::-ms-fill-upper {
+ @include plyr-range-track();
+ }
+ &::-ms-fill-lower {
+ @include plyr-range-track();
+ background: $plyr-range-selected-bg;
+ }
+ &::-ms-thumb {
+ @include plyr-range-thumb();
+ // For some reason, Edge uses the -webkit margin above
+ margin-top: 0;
+ }
+ &::-ms-tooltip {
+ display: none;
+ }
+
+ // Focus styles
+ &:focus {
+ outline: 0;
+ }
+ &::-moz-focus-outer {
+ border: 0;
+ }
+ &.tab-focus:focus {
+ outline-offset: 3px;
+ }
+
+ // Pressed styles
+ &:active {
+ &::-webkit-slider-thumb {
+ @include plyr-range-thumb-active();
+ }
+ &::-moz-range-thumb {
+ @include plyr-range-thumb-active();
+ }
+ &::-ms-thumb {
+ @include plyr-range-thumb-active();
+ }
+ }
+ }
+}
+
+// Video range inputs
+.plyr--video input[type='range'].tab-focus:focus {
+ outline: 1px dotted transparentize($plyr-video-control-color, .5);
+}
+
+// Audio range inputs
+.plyr--audio input[type='range'].tab-focus:focus {
+ outline: 1px dotted transparentize($plyr-audio-control-color, .5);
+}
+
+// Screen reader only elements
+.plyr__sr-only {
+ position: absolute !important;
+ clip: rect(1px, 1px, 1px, 1px);
+ padding: 0 !important;
+ border: 0 !important;
+ height: 1px !important;
+ width: 1px !important;
+ overflow: hidden;
+}
+
+// Video
+.plyr__video-wrapper {
+ position: relative;
+ background: #000;
+ border-radius: inherit;
+
+ // Cleaner radius, also forces iframe radius
+ -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC);
+}
+
+// Container for embeds
+.plyr__video-embed {
+ padding-bottom: 56.25%; /* 16:9 */
+ height: 0;
+ overflow: hidden;
+ border-radius: inherit;
+
+ iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ border: 0;
+ user-select: none;
+ }
+
+ // Vimeo hack
+ > div {
+ position: relative;
+ padding-bottom: 200%;
+ transform: translateY(-35.95%);
+ }
+}
+// To allow mouse events to be captured if full support
+.plyr .plyr__video-embed iframe {
+ pointer-events: none;
+}
+
+// Captions
+// --------------------------------------------------------------
+// Hide default captions
+.plyr video::-webkit-media-text-track-container {
+ display: none;
+}
+.plyr__captions {
+ display: none;
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ width: 100%;
+ padding: ($plyr-control-spacing * 2) ($plyr-control-spacing * 2) ($plyr-control-spacing * 8);
+ color: #fff;
+ font-size: $plyr-font-size-captions-base;
+ text-align: center;
+ font-weight: 400;
+ -webkit-font-smoothing: subpixel-antialiased;
+
+ span {
+ border-radius: 2px;
+ padding: floor($plyr-control-spacing / 3) $plyr-control-spacing;
+ background: transparentize(#000, .15);
+ }
+ span:empty {
+ display: none;
+ }
+
+ @media (min-width: $plyr-bp-screen-md) {
+ font-size: $plyr-font-size-captions-medium;
+ }
+}
+.plyr--captions-active .plyr__captions {
+ display: block;
+}
+.plyr--fullscreen-active .plyr__captions {
+ font-size: $plyr-font-size-captions-large;
+}
+
+// Controls
+// --------------------------------------------------------------
+// Playback controls
+.plyr__controls {
+ display: flex;
+ align-items: center;
+
+ line-height: 1;
+ text-align: center;
+
+ transition: opacity .3s ease;
+
+ // Spacing
+ > button,
+ .plyr__progress,
+ .plyr__time {
+ margin-left: ($plyr-control-spacing / 2);
+
+ &:first-child {
+ margin-left: 0;
+ }
+ }
+ .plyr__volume {
+ margin-left: ($plyr-control-spacing / 2);
+ }
+ [data-plyr="pause"] {
+ margin-left: 0;
+ }
+
+ // Buttons
+ button {
+ position: relative;
+ display: inline-block;
+ flex-shrink: 0;
+ vertical-align: middle;
+ padding: ($plyr-control-spacing / 2);
+ border: 0;
+ background: transparent;
+ border-radius: 3px;
+ cursor: pointer;
+ transition: background .3s ease, color .3s ease, opacity .3s ease;
+ color: inherit;
+
+ svg {
+ width: 18px;
+ height: 18px;
+ display: block;
+ fill: currentColor;
+ }
+
+ // Default focus
+ &:focus {
+ outline: 0;
+ }
+ }
+
+ // Hide toggle icons by default
+ .icon--exit-fullscreen,
+ .icon--muted,
+ .icon--captions-on {
+ display: none;
+ }
+
+ @media (min-width: $plyr-bp-screen-sm) {
+ > button,
+ .plyr__progress,
+ .plyr__time {
+ margin-left: $plyr-control-spacing;
+ }
+ button {
+ padding: ($plyr-control-spacing / 2) $plyr-control-spacing;
+ }
+ }
+}
+// Hide controls
+.plyr--hide-controls .plyr__controls {
+ opacity: 0;
+}
+
+// Video controls
+.plyr--video .plyr__controls {
+ position: absolute;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ padding: ($plyr-control-spacing * 5) $plyr-control-spacing $plyr-control-spacing;
+ background: linear-gradient(transparentize($plyr-video-controls-bg, 1), transparentize($plyr-video-controls-bg, .5));
+ border-bottom-left-radius: inherit;
+ border-bottom-right-radius: inherit;
+ color: $plyr-video-control-color;
+
+ button {
+ // Hover and tab focus
+ &.tab-focus:focus,
+ &:hover {
+ background: $plyr-video-control-bg-hover;
+ color: $plyr-video-control-color-hover;
+ }
+ }
+
+ @media (min-width: $plyr-bp-screen-sm) {
+ padding-left: ($plyr-control-spacing * 1.5);
+ padding-right: ($plyr-control-spacing * 1.5);
+ }
+}
+
+// Audio controls
+.plyr--audio .plyr__controls {
+ padding: $plyr-control-spacing;
+ border-radius: inherit;
+ background: $plyr-audio-controls-bg;
+ border: $plyr-audio-controls-border;
+ box-shadow: $plyr-audio-controls-box-shadow;
+ color: $plyr-audio-control-color;
+
+ button {
+ // Hover and tab focus
+ &.tab-focus:focus,
+ &:hover {
+ background: $plyr-audio-control-bg-hover;
+ color: $plyr-audio-control-color-hover;
+ }
+ }
+}
+
+// Large play button (video only)
+.plyr__play-large {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ padding: $plyr-control-spacing;
+ background: $plyr-video-control-bg-hover;
+ border: 4px solid currentColor;
+ border-radius: 100%;
+ box-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85);
+ color: $plyr-video-control-color;
+ transition: opacity .3s ease, visibility .3s ease;
+
+ svg {
+ position: relative;
+ left: 2px;
+ width: 20px;
+ height: 20px;
+ display: block;
+ fill: currentColor;
+ }
+
+ &:focus {
+ outline: 1px dotted transparentize($plyr-video-control-color, .5);
+ }
+}
+.plyr--audio .plyr__play-large {
+ display: none;
+}
+.plyr--playing .plyr__play-large {
+ opacity: 0;
+ visibility: hidden;
+}
+
+// States
+.plyr__controls [data-plyr='pause'],
+.plyr--playing .plyr__controls [data-plyr='play'] {
+ display: none;
+}
+.plyr--playing .plyr__controls [data-plyr='pause'] {
+ display: inline-block;
+}
+
+// Change icons on state change
+.plyr--fullscreen-active .icon--exit-fullscreen,
+.plyr--muted .plyr__controls .icon--muted,
+.plyr--captions-active .plyr__controls .icon--captions-on {
+ display: block;
+
+ & + svg {
+ display: none;
+ }
+}
+
+// Some options are hidden by default
+.plyr [data-plyr='captions'],
+.plyr [data-plyr='fullscreen'] {
+ display: none;
+}
+.plyr--captions-enabled [data-plyr='captions'],
+.plyr--fullscreen-enabled [data-plyr='fullscreen'] {
+ display: inline-block;
+}
+
+// Tooltips
+// --------------------------------------------------------------
+.plyr__tooltip {
+ position: absolute;
+ z-index: 2;
+ bottom: 100%;
+ margin-bottom: ($plyr-tooltip-padding * 2);
+ padding: $plyr-tooltip-padding ($plyr-tooltip-padding * 1.5);
+ pointer-events: none;
+
+ opacity: 0;
+ background: $plyr-tooltip-bg;
+ box-shadow: $plyr-tooltip-shadow;
+ border-radius: $plyr-tooltip-radius;
+
+ color: $plyr-tooltip-color;
+ font-size: $plyr-font-size-small;
+ line-height: 1.3;
+ -webkit-font-smoothing: subpixel-antialiased;
+
+ transform: translate(-50%, 10px) scale(.8);
+ transform-origin: 50% 100%;
+ transition: transform .2s .1s ease, opacity .2s .1s ease;
+
+ // Arrows
+ &::before {
+ content: '';
+ position: absolute;
+ width: 0;
+ height: 0;
+ left: 50%;
+ transform: translateX(-50%);
+ }
+ // The background triangle
+ &::before {
+ bottom: -$plyr-tooltip-arrow-size;
+ border-right: $plyr-tooltip-arrow-size solid transparent;
+ border-top: $plyr-tooltip-arrow-size solid $plyr-tooltip-bg;
+ border-left: $plyr-tooltip-arrow-size solid transparent;
+ z-index: 2;
+ }
+}
+.plyr button:hover .plyr__tooltip,
+.plyr button.tab-focus:focus .plyr__tooltip,
+.plyr__tooltip--visible {
+ opacity: 1;
+ transform: translate(-50%, 0) scale(1);
+}
+.plyr button:hover .plyr__tooltip {
+ z-index: 3;
+}
+
+// Playback progress
+// --------------------------------------------------------------
+// <progress> element
+.plyr__progress {
+ position: relative;
+ flex: 1;
+
+ input[type="range"] {
+ position: relative;
+ z-index: 2;
+
+ &::-webkit-slider-runnable-track {
+ background: transparent;
+ }
+ &::-moz-range-track {
+ background: transparent;
+ }
+ &::-ms-fill-upper {
+ background: transparent;
+ }
+ }
+
+ // Seek tooltip to show time
+ .plyr__tooltip {
+ left: 0;
+ }
+}
+
+.plyr__progress--buffer[value],
+.plyr__progress--played[value],
+.plyr__volume--display[value] {
+ position: absolute;
+ left: 0;
+ top: 50%;
+ width: 100%;
+ height: $plyr-range-track-height;
+ margin: -($plyr-range-track-height / 2) 0 0;
+ padding: 0;
+ vertical-align: top;
+ appearance: none;
+ border: none;
+ border-radius: 100px;
+
+ &::-webkit-progress-bar {
+ background: transparent;
+ }
+ &::-webkit-progress-value {
+ background: currentColor;
+ border-radius: 100px;
+ min-width: $plyr-range-track-height;
+ }
+ &::-moz-progress-bar {
+ background: currentColor;
+ border-radius: 100px;
+ min-width: $plyr-range-track-height;
+ }
+ &::-ms-fill {
+ border-radius: 100px;
+ }
+}
+.plyr__progress--played[value],
+.plyr__volume--display[value] {
+ z-index: 1;
+ color: $plyr-range-selected-bg;
+ background: transparent;
+ transition: none;
+
+ &::-webkit-progress-value {
+ min-width: $plyr-range-track-height;
+ max-width: 99%;
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ &::-moz-progress-bar {
+ min-width: $plyr-range-track-height;
+ max-width: 99%;
+ border-top-right-radius: 0;
+ border-bottom-right-radius: 0;
+ }
+ &::-ms-fill {
+ display: none;
+ }
+}
+.plyr__progress--buffer[value] {
+ &::-webkit-progress-value {
+ transition: width .2s ease;
+ }
+ &::-moz-progress-bar {
+ transition: width .2s ease;
+ }
+ &::-ms-fill {
+ transition: width .2s ease;
+ }
+}
+.plyr--video .plyr__progress--buffer[value],
+.plyr--video .plyr__volume--display[value] {
+ background: $plyr-video-range-track-bg;
+}
+.plyr--video .plyr__progress--buffer[value] {
+ color: $plyr-video-progress-buffered-bg;
+}
+.plyr--audio .plyr__progress--buffer[value],
+.plyr--audio .plyr__volume--display[value] {
+ background: $plyr-audio-range-track-bg;
+}
+.plyr--audio .plyr__progress--buffer[value] {
+ color: $plyr-audio-progress-buffered-bg;
+}
+
+// Loading state
+.plyr--loading .plyr__progress--buffer {
+ animation: plyr-progress 1s linear infinite;
+ background-size: $plyr-progress-loading-size $plyr-progress-loading-size;
+ background-repeat: repeat-x;
+ background-image: linear-gradient(
+ -45deg,
+ $plyr-progress-loading-bg 25%,
+ transparent 25%,
+ transparent 50%,
+ $plyr-progress-loading-bg 50%,
+ $plyr-progress-loading-bg 75%,
+ transparent 75%,
+ transparent);
+ color: transparent;
+}
+.plyr--video.plyr--loading .plyr__progress--buffer {
+ background-color: $plyr-video-progress-buffered-bg;
+}
+.plyr--audio.plyr--loading .plyr__progress--buffer {
+ background-color: $plyr-audio-progress-buffered-bg;
+}
+
+// Time
+// --------------------------------------------------------------
+.plyr__time {
+ display: inline-block;
+ vertical-align: middle;
+ font-size: $plyr-font-size-small;
+ line-height: .95;
+ -webkit-font-smoothing: subpixel-antialiased;
+}
+// Media duration hidden on small screens
+.plyr__time + .plyr__time {
+ display: none;
+
+ @media (min-width: $plyr-bp-screen-md) {
+ display: inline-block;
+ }
+
+ // Add a slash in before
+ &::before {
+ content: '\2044';
+ margin-right: $plyr-control-spacing;
+ }
+}
+
+// Volume
+// --------------------------------------------------------------
+.plyr .plyr__volume {
+ display: none;
+ position: relative;
+
+ input[type="range"] {
+ position: relative;
+ z-index: 2;
+ }
+ @media (min-width: $plyr-bp-screen-sm) {
+ display: block;
+ max-width: 60px;
+ }
+ @media (min-width: $plyr-bp-screen-md) {
+ max-width: 100px;
+ }
+}
+
+// Hide sound controls on iOS
+// It's not supported to change volume using JavaScript:
+// https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html
+.plyr--is-ios .plyr__volume,
+.plyr--is-ios [data-plyr='mute'] {
+ display: none !important;
+}
+
+// Fullscreen
+// --------------------------------------------------------------
+.plyr--fullscreen,
+.plyr--fullscreen-active {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ height: 100%;
+ width: 100%;
+ z-index: 10000000;
+ background: #000;
+ border-radius: 0;
+
+ video {
+ height: 100%;
+ }
+ .plyr__video-wrapper {
+ height: 100%;
+ width: 100%;
+ }
+ .plyr__controls {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ }
+}
diff --git a/src/scss/variables.scss b/src/scss/variables.scss
new file mode 100644
index 00000000..baf47e25
--- /dev/null
+++ b/src/scss/variables.scss
@@ -0,0 +1,67 @@
+// ==========================================================================
+// Plyr variables
+// https://github.com/selz/plyr
+// https://robots.thoughtbot.com/sass-default
+// ==========================================================================
+
+// Colors
+$plyr-color-main: #3498db !default;
+
+// Font sizes
+$plyr-font-size-small: 14px !default;
+$plyr-font-size-base: 16px !default;
+
+// Captions
+$plyr-font-size-captions-base: ceil($plyr-font-size-base * 1.25) !default;
+$plyr-font-size-captions-medium: ceil($plyr-font-size-base * 1.5) !default;
+$plyr-font-size-captions-large: ($plyr-font-size-base * 2) !default;
+
+// Controls
+$plyr-control-spacing: 10px !default;
+$plyr-video-controls-bg: #000 !default;
+$plyr-video-control-color: #fff !default;
+$plyr-video-control-color-hover: #fff !default;
+$plyr-video-control-bg-hover: $plyr-color-main !default;
+$plyr-audio-controls-bg: #fff !default;
+$plyr-audio-controls-border: 1px solid #dbe3e8 !default;
+$plyr-audio-controls-box-shadow: 0 1px 1px transparentize(#000, .95) !default;
+$plyr-audio-control-color: #565D64 !default;
+$plyr-audio-control-color-hover: #fff !default;
+$plyr-audio-control-bg-hover: $plyr-color-main;
+
+// Tooltips
+$plyr-tooltip-bg: $plyr-video-controls-bg !default;
+$plyr-tooltip-border-color: transparentize(darken($plyr-video-controls-bg, 75%), .9) !default;
+$plyr-tooltip-arrow-border-color: transparentize(darken($plyr-video-controls-bg, 75%), .8) !default;
+$plyr-tooltip-border-width: 1px !default;
+$plyr-tooltip-shadow: 0 0 5px $plyr-tooltip-border-color, 0 0 0 $plyr-tooltip-border-width $plyr-tooltip-border-color !default;
+$plyr-tooltip-color: $plyr-video-control-color !default;
+$plyr-tooltip-padding: ($plyr-control-spacing / 2) !default;
+$plyr-tooltip-arrow-size: 4px !default;
+$plyr-tooltip-radius: 3px !default;
+
+// Progress
+$plyr-progress-loading-size: 25px !default;
+$plyr-progress-loading-bg: transparentize(#000, .85) !default;
+$plyr-video-progress-bg: transparentize(#fff, .75) !default;
+$plyr-video-progress-buffered-bg: $plyr-video-progress-bg !default;
+$plyr-audio-progress-bg: transparentize(#C6D6DB, .33) !default;
+$plyr-audio-progress-buffered-bg: $plyr-audio-progress-bg !default;
+
+// Range sliders
+$plyr-range-track-height: 8px !default;
+$plyr-range-thumb-height: floor($plyr-range-track-height * 2) !default;
+$plyr-range-thumb-width: floor($plyr-range-track-height * 2) !default;
+$plyr-range-thumb-bg: #fff !default;
+$plyr-range-thumb-border: 2px solid transparent !default;
+$plyr-range-thumb-shadow: 0 1px 1px transparentize($plyr-video-controls-bg, .85), 0 0 0 1px transparentize(#000, .85) !default;
+$plyr-range-thumb-active-border-color: #fff !default;
+$plyr-range-thumb-active-bg: $plyr-video-control-bg-hover !default;
+$plyr-range-thumb-active-scale: 1.25 !default;
+$plyr-video-range-track-bg: $plyr-video-progress-buffered-bg !default;
+$plyr-audio-range-track-bg: $plyr-audio-progress-buffered-bg !default;
+$plyr-range-selected-bg: $plyr-color-main !default;
+
+// Breakpoints
+$plyr-bp-screen-sm: 480px !default;
+$plyr-bp-screen-md: 768px !default; \ No newline at end of file