'),Ce.captionsContainer=H(N.selectors.captions).querySelector("span"),Ce.usingTextTracks=!1,Ce.media.textTracks&&(Ce.usingTextTracks=!0);for(var e,t="",n=Ce.media.childNodes,a=0;a=10||"Firefox"===Ce.browser.name&&Ce.browser.version>=31||"Chrome"===Ce.browser.name&&Ce.browser.version>=43||"Safari"===Ce.browser.name&&Ce.browser.version>=7)&&(r("Detected unsupported browser for HTML5 captions - using fallback"),Ce.usingTextTracks=!1),Ce.usingTextTracks){r("TextTracks supported");for(var o=0;o=7){r("Safari 7+ detected; removing track from DOM"),s=Ce.media.getElementsByTagName("track");for(var c=0;ct?t=0:t>Ce.media.duration&&(t=Ce.media.duration);try{Ce.media.currentTime=t.toFixed(1)}catch(a){}if(o(N.types.embed,Ce.type)){switch(Ce.type){case"youtube":Ce.embed.seekTo(t);break;case"vimeo":Ce.embed.api("seekTo",t.toFixed(0))}n&&te(),T(Ce.media,"timeupdate"),Ce.media.seeking=!0}r("Seeking to "+Ce.media.currentTime+" seconds"),S(t)}function ie(){b(Ce.container,N.classes.playing,!Ce.media.paused),b(Ce.container,N.classes.stopped,Ce.media.paused)}function oe(n){function r(){b(Ce.container,N.classes.hover,!0),e.clearTimeout(i),o||(i=e.setTimeout(function(){b(Ce.container,N.classes.hover,!1)},2e3))}function a(e){o="mouseenter"===e.type}var s=A.supportsFullScreen;n&&n.type===A.fullScreenEventName?Ce.isFullscreen=A.isFullScreen(Ce.container):s?(A.isFullScreen(Ce.container)?A.cancelFullScreen():A.requestFullScreen(Ce.container),Ce.isFullscreen=A.isFullScreen(Ce.container)):(Ce.isFullscreen=!Ce.isFullscreen,Ce.isFullscreen?(g(t,"keyup",le),t.body.style.overflow="hidden"):(h(t,"keyup",le),t.body.style.overflow="")),b(Ce.container,N.classes.fullscreen.active,Ce.isFullscreen),Ce.isFullscreen?Ce.container.setAttribute("tabindex","-1"):Ce.container.removeAttribute("tabindex"),j(Ce.isFullscreen),x(Ce.buttons.fullscreen,Ce.isFullscreen);var i,o=!1;N.fullscreen.hideControls&&(b(Ce.controls,N.classes.hover,!1),w(Ce.controls,"mouseenter mouseleave",a,Ce.isFullscreen),w(Ce.container,"mousemove",r,Ce.isFullscreen)),T(Ce.container,Ce.isFullscreen?"enterfullscreen":"exitfullscreen")}function le(e){27===(e.which||e.charCode||e.keyCode)&&Ce.isFullscreen&&oe()}function ue(e){if("boolean"!=typeof e&&(e=!Ce.media.muted),x(Ce.buttons.mute,e),Ce.media.muted=e,o(N.types.embed,Ce.type)){switch(Ce.type){case"youtube":Ce.embed[Ce.media.muted?"mute":"unMute"]();break;case"vimeo":Ce.embed.api("setVolume",Ce.media.muted?0:parseFloat(N.volume/10))}T(Ce.media,"volumechange")}}function ce(t){if("undefined"==typeof t&&(t=N.storage.enabled&&E().supported?e.localStorage[N.storage.key]||N.volume:N.volume),t>10&&(t=10),0>t&&(t=0),Ce.media.volume=parseFloat(t/10),N.volume=t,o(N.types.embed,Ce.type)){switch(Ce.type){case"youtube":Ce.embed.setVolume(100*Ce.media.volume);break;case"vimeo":Ce.embed.api("setVolume",Ce.media.volume)}T(Ce.media,"volumechange")}Ce.media.muted&&t>0&&ue()}function pe(){var t=Ce.media.muted?0:10*Ce.media.volume;Ce.supported.full&&Ce.volume&&(Ce.volume.value=t),N.storage.enabled&&E().supported&&e.localStorage.setItem(N.storage.key,t),b(Ce.container,N.classes.muted,0===t),Ce.supported.full&&Ce.buttons.mute&&x(Ce.buttons.mute,0===t)}function de(e){Ce.supported.full&&Ce.buttons.captions&&("boolean"!=typeof e&&(e=-1===Ce.container.className.indexOf(N.classes.captions.active)),Ce.captionsEnabled=e,x(Ce.buttons.captions,Ce.captionsEnabled),b(Ce.container,N.classes.captions.active,Ce.captionsEnabled),T(Ce.container,Ce.captionsEnabled?"captionsenabled":"captionsdisabled"))}function fe(e){var t="waiting"===e.type;clearTimeout(Ce.loadingTimer),Ce.loadingTimer=setTimeout(function(){b(Ce.container,N.classes.loading,t)},t?250:0)}function me(e){var t=Ce.progress.played.bar,n=Ce.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=_(Ce.media.currentTime,Ce.media.duration),"timeupdate"==e.type&&Ce.buttons.seek&&(Ce.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=Ce.progress.buffer.bar,n=Ce.progress.buffer.text,r=function(){var e=Ce.media.buffered;return e&&e.length?_(e.end(0),Ce.media.duration):"number"==typeof e?100*e:0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function ye(e,t){if(t){isNaN(e)&&(e=0),Ce.secs=parseInt(e%60),Ce.mins=parseInt(e/60%60),Ce.hours=parseInt(e/60/60%60);var n=parseInt(Ce.media.duration/60/60%60)>0;Ce.secs=("0"+Ce.secs).slice(-2),Ce.mins=("0"+Ce.mins).slice(-2),t.innerHTML=(n?Ce.hours+":":"")+Ce.mins+":"+Ce.secs}}function be(){if(Ce.supported.full){var e=Ce.media.duration||0;!Ce.duration&&N.displayDuration&&Ce.media.paused&&ye(e,Ce.currentTime),Ce.duration&&ye(e,Ce.duration)}}function ve(e){ye(Ce.media.currentTime,Ce.currentTime),e&&"timeupdate"==e.type&&Ce.media.seeking||me(e)}function ge(e){if("undefined"!=typeof e)return void he(e);var t;switch(Ce.type){case"youtube":t=Ce.embed.getVideoUrl();break;case"vimeo":Ce.embed.api("getVideoUrl",function(e){t=e});break;default:t=Ce.media.currentSrc}return t||""}function he(n){if(!("undefined"!=typeof n&&"sources"in n&&n.sources.length))return void r("Invalid source format",!0);if(te(),"youtube"===Ce.type?(Ce.embed.destroy(),e.clearInterval(Ce.timer.buffering),e.clearInterval(Ce.timer.playing)):"video"===Ce.type&&Ce.videoContainer&&p(Ce.videoContainer),p(Ce.media),"type"in n&&(Ce.type=n.type,"video"===Ce.type)){var a=n.sources[0];"type"in a&&o(N.types.embed,a.type)&&(Ce.type=a.type)}switch(Ce.supported=I.supported(Ce.type),Ce.type){case"video":Ce.media=t.createElement("video");break;case"audio":Ce.media=t.createElement("audio");break;case"youtube":case"vimeo":Ce.media=t.createElement("div"),Ce.embedId=n.sources[0].src}d(Ce.container,Ce.media),o(N.types.html5,Ce.type)&&(N.crossorigin&&Ce.media.setAttribute("crossorigin",""),N.autoplay&&Ce.media.setAttribute("autoplay",""),"poster"in n&&Ce.media.setAttribute("poster",n.poster),N.loop&&Ce.media.setAttribute("loop","")),Ce.container.className=Ce.originalClassName,b(Ce.container,N.classes.fullscreen.active,Ce.isFullscreen),b(Ce.container,N.classes.captions.active,Ce.captionsEnabled),W(),N.autoplay=n.autoplay||N.autoplay,o(N.types.html5,Ce.type)&&D("source",n.sources),K(),o(N.types.html5,Ce.type)&&("tracks"in n&&D("track",n.tracks),Ce.media.load(),be(),Fe()),N.autoplay&&ee(),"title"in n&&(N.title=n.title,z())}function ke(e){"video"===Ce.type&&Ce.media.setAttribute("poster",e)}function we(){function n(){var e=Ce.media.paused;e?ee():te();var t=Ce.buttons[e?"play":"pause"],n=Ce.buttons[e?"pause":"play"];if(n){var r=v(t,N.classes.tabFocus);setTimeout(function(){n.focus(),r&&(b(t,N.classes.tabFocus,!1),b(n,N.classes.tabFocus,!0))},100)}}function r(){var e=t.activeElement;e&&e!=t.body?t.querySelector&&(e=t.querySelector(":focus")):e=null;for(var n in Ce.buttons){var r=Ce.buttons[n];b(r,N.classes.tabFocus,r===e)}}var a="IE"==Ce.browser.name?"change":"input";g(e,"keyup",function(e){var t=e.keyCode?e.keyCode:e.which;9==t&&r()}),g(t.body,"click",function(){b(H("."+N.classes.tabFocus),N.classes.tabFocus,!1)});for(var s in Ce.buttons){var i=Ce.buttons[s];g(i,"blur",function(){b(i,"tab-focus",!1)})}k(Ce.buttons.play,"click",N.listeners.play,n),k(Ce.buttons.pause,"click",N.listeners.pause,n),k(Ce.buttons.restart,"click",N.listeners.restart,se),k(Ce.buttons.rewind,"click",N.listeners.rewind,re),k(Ce.buttons.forward,"click",N.listeners.forward,ae),k(Ce.buttons.seek,a,N.listeners.seek,se),k(Ce.volume,a,N.listeners.volume,function(){ce(Ce.volume.value)}),k(Ce.buttons.mute,"click",N.listeners.mute,ue),k(Ce.buttons.fullscreen,"click",N.listeners.fullscreen,oe),A.supportsFullScreen&&g(t,A.fullScreenEventName,oe),g(Ce.buttons.captions,"click",de)}function Te(){g(Ce.media,"timeupdate seeking",ve),g(Ce.media,"timeupdate",S),g(Ce.media,"durationchange loadedmetadata",be),g(Ce.media,"ended",function(){"video"===Ce.type&&(Ce.captionsContainer.innerHTML=""),ie()}),g(Ce.media,"progress playing",me),g(Ce.media,"volumechange",pe),g(Ce.media,"play pause",ie),g(Ce.media,"waiting canplay seeked",fe),"video"===Ce.type&&N.click&&g(Ce.videoContainer,"click",function(){Ce.media.paused?ee():Ce.media.ended?(se(),ee()):te()}),g(Ce.media,N.events.join(" "),function(e){T(Ce.container,e.type)})}function xe(){if(!Ce.init)return null;if(Ce.container.setAttribute("class",y(N.selectors.container)),Ce.init=!1,p(H(N.selectors.controls.wrapper)),"youtube"===Ce.type)return void Ce.embed.destroy();"video"===Ce.type&&(p(H(N.selectors.captions)),c(Ce.videoContainer)),$(!0);var e=Ce.media.cloneNode(!0);Ce.media.parentNode.replaceChild(e,Ce.media)}function _e(){if(Ce.init)return null;A=C(),Ce.browser=a(),Ce.media=Ce.container.querySelectorAll("audio, video, div")[0],Ce.originalClassName=Ce.container.className;var e=Ce.media.tagName.toLowerCase();if("div"===e?(Ce.type=Ce.media.getAttribute("data-type"),Ce.embedId=Ce.media.getAttribute("data-video-id"),Ce.media.removeAttribute("data-type"),Ce.media.removeAttribute("data-video-id")):(Ce.type=e,N.crossorigin=null!==Ce.media.getAttribute("crossorigin"),N.autoplay=N.autoplay||null!==Ce.media.getAttribute("autoplay"),N.loop=N.loop||null!==Ce.media.getAttribute("loop")),Ce.supported=I.supported(Ce.type),W(),!Ce.supported.basic)return!1;if(r(Ce.browser.name+" "+Ce.browser.version),K(),o(N.types.html5,Ce.type)){if(!Ce.supported.full)return void(Ce.init=!0);Fe(),z()}Ce.init=!0}function Fe(){if(!Ce.supported.full)return r("No full support for this media type ("+Ce.type+")",!0),p(H(N.selectors.controls.wrapper)),void $(!0);var e=!q(N.selectors.controls.wrapper).length;e&&B(),Y()&&(e&&we(),Te(),$(),Z(),Q(),ce(),pe(),ve(),ie())}var Ce=this;return Ce.container=F,_e(),Ce.init?{media:Ce.media,play:ee,pause:te,restart:se,rewind:re,forward:ae,seek:se,source:ge,poster:ke,setVolume:ce,togglePlay:ne,toggleMute:ue,toggleCaptions:de,toggleFullscreen:oe,isFullscreen:function(){return Ce.isFullscreen||!1},support:function(e){return s(Ce,e)},destroy:xe,restore:_e}:{}}var A,N,I={},P={enabled:!0,debug:!1,autoplay:!1,loop:!1,seekTime:10,volume:5,click:!0,tooltips:!1,displayDuration:!0,iconPrefix:"icon",selectors:{container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr] .sr-only, label .sr-only",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",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",hideControls:"plyr--fullscreen--hide-controls"},tabFocus:"tab-focus"},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,hideControls:!0,allowAudio:!1},storage:{enabled:!0,key:"plyr_volume"},controls:["restart","rewind","play","fast-forward","current-time","duration","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"],html5:["video","audio"]},urls:{vimeo:{api:"https://cdn.plyr.io/froogaloop/1.0.0/plyr.froogaloop.js"},youtube:{api:"https://www.youtube.com/iframe_api"}},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 I.supported=function(e){var n,r,s=a(),i="IE"===s.name&&s.version<=9,o=/iPhone|iPod/i.test(navigator.userAgent),l=!!t.createElement("audio").canPlayType,u=!!t.createElement("video").canPlayType;switch(e){case"video":n=u,r=n&&!i&&!o;break;case"audio":n=l,r=n&&!i;break;case"vimeo":case"youtube":n=!0,r=!i&&!o;break;default:n=l&&u,r=n&&!i}return{basic:n,full:r}},I.setup=function(e,n){var r=[];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(P.selectors.container)),N=F(P,n),!N.enabled||!I.supported().basic||!e.length)return!1;for(var a=e.length-1;a>=0;a--){var s=e[a];if("undefined"==typeof s.plyr){var i=new S(s);s.plyr=Object.keys(i).length?i:!1,T(s,"setup",{plyr:s.plyr})}r.push(s.plyr)}return r;
},I}),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}e.prototype=window.Event.prototype,"CustomEvent"in window||(window.CustomEvent=e)}();
\ No newline at end of file
diff --git a/package.json b/package.json
index f0e8df546..d78d58d85 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "plyr",
- "version": "1.5.3",
+ "version": "1.5.4",
"description": "A simple HTML5 media player using custom controls",
"homepage": "http://plyr.io",
"main": "gulpfile.js",
diff --git a/readme.md b/readme.md
index c1d9cfc1a..ba111604d 100644
--- a/readme.md
+++ b/readme.md
@@ -40,7 +40,7 @@ If you have any cool ideas or features, please let me know by [creating an issue
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.3/plyr.js` to `https://cdn.plyr.io/1.5.3/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.5.4/plyr.js` to `https://cdn.plyr.io/1.5.4/plyr.js`
### Bower
If bower is your thang, you can grab Plyr using:
@@ -60,11 +60,11 @@ 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
-
-
+
+
```
-You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.3/sprite.svg`.
+You can also access the `sprite.svg` file at `https://cdn.plyr.io/1.5.4/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.
@@ -162,7 +162,7 @@ More info on CORS here:
Here's an example of a default setup:
```html
-
+
```