diff options
-rw-r--r-- | changelog.md | 4 | ||||
-rw-r--r-- | dist/plyr.js | 2 | ||||
-rw-r--r-- | docs/error.html | 2 | ||||
-rw-r--r-- | docs/index.html | 10 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | readme.md | 8 | ||||
-rw-r--r-- | src/js/plyr.js | 34 |
7 files changed, 33 insertions, 29 deletions
diff --git a/changelog.md b/changelog.md index 7c8adca4..ae0b2ff3 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,9 @@ # Changelog +## v1.1.1 +- Fix for unsupported browser handling +- Fix for config.controls having no effect + ## v1.1.0 - Added config option to set which controls are shown (if using the default controls html) and better handling of missing controls diff --git a/dist/plyr.js b/dist/plyr.js index 82d19ec8..1815863c 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1 +1 @@ -!function(e){"use strict";function t(e,t){w.debug&&window.console&&console[t?"error":"log"](e)}function n(){var e,t,n,r=navigator.userAgent,s=navigator.appName,a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",a="11;"):-1!==(t=r.indexOf("MSIE"))?(s="IE",a=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(s="Chrome",a=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(s="Safari",a=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(a=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(s="Firefox",a=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(s=r.substring(e,t),a=r.substring(t+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(n=a.indexOf(";"))&&(a=a.substring(0,n)),-1!==(n=a.indexOf(" "))&&(a=a.substring(0,n)),o=parseInt(""+a,10),isNaN(o)&&(a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),{name:s,version:o,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform)}}function r(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 s(e,t){return-1!=e.indexOf(t)}function a(e,t,n){return e.replace(new RegExp(t.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1"),"g"),n)}function o(e,t){e.length||(e=[e]);for(var n=e.length-1;n>=0;n--){var r=n>0?t.cloneNode(!0):t,s=e[n],a=s.parentNode,o=s.nextSibling;r.appendChild(s),o?a.insertBefore(r,o):a.appendChild(r)}}function i(e){e.parentNode.removeChild(e)}function l(e,t){e.insertBefore(t,e.firstChild)}function c(e,t){for(var n in t)e.setAttribute(n,t[n])}function u(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function p(e,t,n,r){if(t=t.split(" "),e instanceof NodeList)for(var s=0;s<e.length;s++)e[s]instanceof Node&&p(e[s],arguments[1],arguments[2],arguments[3]);else for(var a=0;a<t.length;a++)e[r?"addEventListener":"removeEventListener"](t[a],n,!1)}function d(e,t,n){e&&p(e,t,n,!0)}function f(e,t,n){e&&p(e,t,n,!1)}function m(e,t){var n=document.createEvent("MouseEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function y(e){return e.keyCode&&13!=e.keyCode?!0:(e.target.checked=!e.target.checked,m(e.target,"change"),void 0)}function v(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function g(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},g(e[n],t[n])):e[n]=t[n];return e}function b(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},t="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)e.supportsFullScreen=!0;else for(var n=0,r=t.length;r>n;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function h(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function k(s){function p(e){if(!nt.usingTextTracks&&"video"===nt.type&&nt.supported.full){for(nt.subcount=0,e="number"==typeof e?e:nt.media.currentTime;k(nt.captions[nt.subcount][0])<e.toFixed(1);)if(nt.subcount++,nt.subcount>nt.captions.length-1){nt.subcount=nt.captions.length-1;break}nt.media.currentTime.toFixed(1)>=g(nt.captions[nt.subcount][0])&&nt.media.currentTime.toFixed(1)<=k(nt.captions[nt.subcount][0])?(nt.currentCaption=nt.captions[nt.subcount][1],nt.captionsContainer.innerHTML=nt.currentCaption):nt.captionsContainer.innerHTML=""}}function m(){nt.buttons.captions&&(u(nt.container,w.classes.captions.enabled,!0),w.captions.defaultActive&&(u(nt.container,w.classes.captions.active,!0),nt.buttons.captions.checked=!0))}function g(e){var t=[];return t=e.split(" --> "),T(t[0])}function k(e){var t=[];return t=e.split(" --> "),T(t[1])}function T(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function S(e){return nt.container.querySelectorAll(e)}function F(e){return S(e)[0]}function C(){try{return window.self!==window.top}catch(e){return!0}}function E(){if(t("Injecting custom controls."),w.html&&(w.html=a(w.html,"{seektime}",w.seekTime),w.html=a(w.html,"{id}",nt.random),nt.container.insertAdjacentHTML("beforeend",w.html),w.tooltips))for(var e=S(w.selectors.labels),n=e.length-1;n>=0;n--){var r=e[n];u(r,w.classes.hidden,!1),u(r,w.classes.tooltip,!0)}}function A(){try{return nt.controls=F(w.selectors.controls),nt.buttons={},nt.buttons.seek=F(w.selectors.buttons.seek),nt.buttons.play=F(w.selectors.buttons.play),nt.buttons.pause=F(w.selectors.buttons.pause),nt.buttons.restart=F(w.selectors.buttons.restart),nt.buttons.rewind=F(w.selectors.buttons.rewind),nt.buttons.forward=F(w.selectors.buttons.forward),nt.buttons.fullscreen=F(w.selectors.buttons.fullscreen),nt.buttons.mute=F(w.selectors.buttons.mute),nt.buttons.captions=F(w.selectors.buttons.captions),nt.checkboxes=S("[type='checkbox']"),nt.progress={},nt.progress.container=F(w.selectors.progress.container),nt.progress.buffer={},nt.progress.buffer.bar=F(w.selectors.progress.buffer),nt.progress.buffer.text=nt.progress.buffer.bar&&nt.progress.buffer.bar.getElementsByTagName("span")[0],nt.progress.played={},nt.progress.played.bar=F(w.selectors.progress.played),nt.progress.played.text=nt.progress.played.bar&&nt.progress.played.bar.getElementsByTagName("span")[0],nt.volume=F(w.selectors.buttons.volume),nt.duration=F(w.selectors.duration),nt.currentTime=F(w.selectors.currentTime),nt.seekTime=S(w.selectors.seekTime),!0}catch(e){return t("It looks like there's a problem with your controls html. Bailing.",!0),nt.media.setAttribute("controls",""),!1}}function N(){if(nt.buttons.play){var e=nt.buttons.play.innerText||"Play";"undefined"!=typeof w.title&&w.title.length&&(e+=", "+w.title),nt.buttons.play.setAttribute("aria-label",e)}}function P(){if(!nt.media)return t("No audio or video element found!",!0),!1;if(nt.supported.full&&(nt.media.removeAttribute("controls"),u(nt.container,w.classes[nt.type],!0),u(nt.container,w.classes.stopped,null===nt.media.getAttribute("autoplay")),nt.browser.ios&&u(nt.container,"ios",!0),"video"===nt.type)){var e=document.createElement("div");e.setAttribute("class",w.classes.videoWrapper),o(nt.media,e),nt.videoContainer=e}null!==nt.media.getAttribute("autoplay")&&L()}function I(){if("video"===nt.type){nt.videoContainer.insertAdjacentHTML("afterbegin","<div class='"+w.selectors.captions.replace(".","")+"'></div>"),nt.captionsContainer=F(w.selectors.captions),nt.usingTextTracks=!1,nt.media.textTracks&&(nt.usingTextTracks=!0);for(var e,n="",r=nt.media.childNodes,s=0;s<r.length;s++)"track"===r[s].nodeName.toLowerCase()&&(e=r[s].getAttribute("kind"),"captions"===e&&(n=r[s].getAttribute("src")));if(nt.captionExists=!0,""===n?(nt.captionExists=!1,t("No caption track found.")):t("Caption track found; URI: "+n),nt.captionExists){for(var a=nt.media.textTracks,o=0;o<a.length;o++)a[o].mode="hidden";if(m(nt),("IE"===nt.browser.name&&10===nt.browser.version||"IE"===nt.browser.name&&11===nt.browser.version||"Firefox"===nt.browser.name&&nt.browser.version>=31||"Safari"===nt.browser.name&&nt.browser.version>=7)&&(t("Detected IE 10/11 or Firefox 31+ or Safari 7+."),nt.usingTextTracks=!1),nt.usingTextTracks){t("TextTracks supported.");for(var i=0;i<a.length;i++){var l=a[i];"captions"===l.kind&&d(l,"cuechange",function(){nt.captionsContainer.innerHTML="",this.activeCues[0]&&this.activeCues[0].hasOwnProperty("text")&&nt.captionsContainer.appendChild(this.activeCues[0].getCueAsHTML())})}}else if(t("TextTracks not supported so rendering captions manually."),nt.currentCaption="",nt.captions=[],""!==n){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)if(200===c.status){var e,n=[],r=c.responseText;n=r.split("\n\n");for(var s=0;s<n.length;s++)e=n[s],nt.captions[s]=[],nt.captions[s]=e.split("\n");nt.captions.shift(),t("Successfully loaded the caption file via AJAX.")}else t("There was a problem loading the caption file via AJAX.",!0)},c.open("get",n,!0),c.send()}if("Safari"===nt.browser.name&&nt.browser.version>=7){t("Safari 7+ detected; removing track from DOM."),a=nt.media.getElementsByTagName("track");for(var p=0;p<a.length;p++)nt.media.removeChild(a[p])}}else u(nt.container,w.classes.captions.enabled)}}function M(){if("video"===nt.type&&w.fullscreen.enabled){var e=x.supportsFullScreen;e||w.fullscreen.fallback&&!C()?(t((e?"Native":"Fallback")+" fullscreen enabled."),u(nt.container,w.classes.fullscreen.enabled,!0)):t("Fullscreen not supported and fallback disabled."),w.fullscreen.hideControls&&u(nt.container,w.classes.fullscreen.hideControls,!0)}}function L(){nt.media.play()}function O(){nt.media.pause()}function q(e){"number"!=typeof e&&(e=w.seekTime),V(nt.media.currentTime-e)}function H(e){"number"!=typeof e&&(e=w.seekTime),V(nt.media.currentTime+e)}function V(e){var n=0;"number"==typeof e?n=e:"object"!=typeof e||"change"!==e.type&&"input"!==e.type||(n=e.target.value/e.target.max*nt.media.duration),0>n?n=0:n>nt.media.duration&&(n=nt.media.duration);try{nt.media.currentTime=n.toFixed(1)}catch(r){}t("Seeking to "+nt.media.currentTime+" seconds"),p(n)}function R(){u(nt.container,w.classes.playing,!nt.media.paused),u(nt.container,w.classes.stopped,nt.media.paused)}function j(e){var t=x.supportsFullScreen;e&&e.type===x.fullScreenEventName?w.fullscreen.active=x.isFullScreen():t?(x.isFullScreen()?x.cancelFullScreen():x.requestFullScreen(nt.container),w.fullscreen.active=x.isFullScreen()):(w.fullscreen.active=!w.fullscreen.active,w.fullscreen.active?(d(document,"keyup",B),document.body.style.overflow="hidden"):(f(document,"keyup",B),document.body.style.overflow="")),u(nt.container,w.classes.fullscreen.active,w.fullscreen.active)}function B(e){27===(e.which||e.charCode||e.keyCode)&&w.fullscreen.active&&j()}function D(e){nt.volume&&("undefined"==typeof e&&(e=w.storage.enabled&&h().supported?window.localStorage[w.storage.key]||w.volume:w.volume),e>10&&(e=10),nt.supported.full&&(nt.volume.value=e),nt.media.volume=parseFloat(e/10),U(),w.storage.enabled&&h().supported&&(window.localStorage.plyr_volume=e))}function W(e){"undefined"==typeof e&&(e=!nt.media.muted),nt.supported.full&&(nt.buttons.mute.checked=e),nt.media.muted=e,U()}function _(e){nt.supported.full&&nt.buttons.captions&&("undefined"==typeof e&&(e=-1===nt.container.className.indexOf(w.classes.captions.active),nt.buttons.captions.checked=e),u(nt.container,w.classes.captions.active,e))}function U(){u(nt.container,w.classes.muted,0===nt.media.volume||nt.media.muted)}function X(e){var t="waiting"===e.type;clearTimeout(nt.loadingTimer),nt.loadingTimer=setTimeout(function(){u(nt.container,w.classes.loading,t)},t?250:0)}function J(e){var t=nt.progress.played.bar,n=nt.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=v(nt.media.currentTime,nt.media.duration),"timeupdate"==e.type&&nt.buttons.seek&&(nt.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=nt.progress.buffer.bar,n=nt.progress.buffer.text,r=function(){var e=nt.media.buffered;return e.length?v(e.end(0),nt.media.duration):0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function $(e,t){if(t){nt.secs=parseInt(e%60),nt.mins=parseInt(e/60%60),nt.hours=parseInt(e/60/60%60);var n=parseInt(nt.media.duration/60/60%60)>0;nt.secs=("0"+nt.secs).slice(-2),nt.mins=("0"+nt.mins).slice(-2),t.innerHTML=(n?nt.hours+":":"")+nt.mins+":"+nt.secs}}function z(){var e=nt.media.duration||0;!nt.duration&&w.displayDuration&&nt.media.paused&&$(e,nt.currentTime),nt.duration&&$(e,nt.duration)}function K(e){$(nt.media.currentTime,nt.currentTime),J(e)}function Y(){for(var e=nt.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)i(e[t]);nt.media.removeAttribute("src")}function G(e){if(e.src){var t=document.createElement("source");c(t,e),l(nt.media,t)}}function Q(e){if(O(),V(),Y(),"string"==typeof e)nt.media.setAttribute("src",e);else if(e.constructor===Array)for(var t in e)G(e[t]);nt.supported.full&&(K(),R()),nt.media.load(),null!==nt.media.getAttribute("autoplay")&&L()}function Z(e){"video"===nt.type&&nt.media.setAttribute("poster",e)}function et(){d(nt.buttons.play,"click",function(){L(),setTimeout(function(){nt.buttons.pause.focus()},100)}),d(nt.buttons.pause,"click",function(){O(),setTimeout(function(){nt.buttons.play.focus()},100)}),d(nt.buttons.restart,"click",V),d(nt.buttons.rewind,"click",q),d(nt.buttons.forward,"click",H),d(nt.volume,"change input",function(){D(this.value)}),d(nt.buttons.mute,"change",function(){W(this.checked)}),d(nt.buttons.fullscreen,"click",j),x.supportsFullScreen&&d(document,x.fullScreenEventName,j),d(nt.media,"timeupdate seeking",K),d(nt.media,"timeupdate",p),d(nt.media,"loadedmetadata",z),d(nt.buttons.seek,"change input",V),d(nt.buttons.captions,"change",function(){_(this.checked)}),d(nt.media,"ended",function(){"video"===nt.type&&(nt.captionsContainer.innerHTML=""),R()}),d(nt.media,"progress",J),d(nt.media,"playing",J),d(nt.media,"volumechange",U),d(nt.media,"play pause",R),d(nt.media,"waiting canplay seeked",X),d(nt.checkboxes,"keyup",y),"video"===nt.type&&w.click&&d(nt.videoContainer,"click",function(){nt.media.paused?L():nt.media.ended?(V(),L()):O()}),w.fullscreen.hideControls&&d(nt.controls,"mouseenter mouseleave",function(e){u(nt.controls,w.classes.hover,"mouseenter"===e.type)})}function tt(){if(x=b(),nt.browser=n(),nt.media=nt.container.querySelectorAll("audio, video")[0],nt.type=nt.media.tagName.toLowerCase(),nt.supported=e.supported(nt.type),!nt.supported.basic)return!1;if(t(nt.browser.name+" "+nt.browser.version),P(),nt.random=Math.floor(1e4*Math.random()),nt.supported.full){if(E(),!A())return!1;w.displayDuration&&z(),N(),I(),D(),M(),et()}return!0}var nt=this;return nt.container=s,tt()?{media:nt.media,play:L,pause:O,restart:V,rewind:q,forward:H,seek:V,setVolume:D,toggleMute:W,toggleCaptions:_,source:Q,poster:Z,support:function(e){return r(nt,e)}}:{}}var x,w,T={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,tooltips:!1,displayDuration:!0,selectors:{container:".player",controls:".player-controls",labels:"[data-player] .sr-only, label .sr-only",buttons:{seek:"[data-player='seek']",play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",currentTime:".player-current-time",duration:".player-duration"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",loading:"loading",tooltip:"player-tooltip",hidden:"sr-only",hover:"hover",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active",hideControls:"fullscreen-hide-controls"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,hideControls:!0},storage:{enabled:!0,key:"plyr_volume"},controls:["restart","rewind","play","fast-forward","current-time","duration","mute","volume","captions","fullscreen"]};T.html=function(){var e=["<div class='player-controls'>","<div class='player-progress'>","<label for='seek{id}' class='sr-only'>Seek</label>","<input id='seek{id}' class='player-progress-seek' type='range' min='0' max='100' step='0.5' value='0' data-player='seek'>","<progress class='player-progress-played' max='100' value='0'>","<span>0</span>% played","</progress>","<progress class='player-progress-buffer' max='100' value='0'>","<span>0</span>% buffered","</progress>","</div>","<span class='player-controls-left'>"];return s(T.controls,"restart")&&e.push("<button type='button' data-player='restart'>","<svg><use xlink:href='#icon-restart'></use></svg>","<span class='sr-only'>Restart</span>","</button>"),s(T.controls,"rewind")&&e.push("<button type='button' data-player='rewind'>","<svg><use xlink:href='#icon-rewind'></use></svg>","<span class='sr-only'>Rewind {seektime} secs</span>","</button>"),s(T.controls,"play")&&e.push("<button type='button' data-player='play'>","<svg><use xlink:href='#icon-play'></use></svg>","<span class='sr-only'>Play</span>","</button>","<button type='button' data-player='pause'>","<svg><use xlink:href='#icon-pause'></use></svg>","<span class='sr-only'>Pause</span>","</button>"),s(T.controls,"fast-forward")&&e.push("<button type='button' data-player='fast-forward'>","<svg><use xlink:href='#icon-fast-forward'></use></svg>","<span class='sr-only'>Forward {seektime} secs</span>","</button>"),s(T.controls,"current-time")&&e.push("<span class='player-time'>","<span class='sr-only'>Current time</span>","<span class='player-current-time'>00:00</span>","</span>"),s(T.controls,"duration")&&e.push("<span class='player-time'>","<span class='sr-only'>Duration</span>","<span class='player-duration'>00:00</span>","</span>"),e.push("</span>","<span class='player-controls-right'>"),s(T.controls,"mute")&&e.push("<input class='inverted sr-only' id='mute{id}' type='checkbox' data-player='mute'>","<label id='mute{id}' for='mute{id}'>","<svg class='icon-muted'><use xlink:href='#icon-muted'></use></svg>","<svg><use xlink:href='#icon-volume'></use></svg>","<span class='sr-only'>Toggle Mute</span>","</label>"),s(T.controls,"volume")&&e.push("<label for='volume{id}' class='sr-only'>Volume</label>","<input id='volume{id}' class='player-volume' type='range' min='0' max='10' value='5' data-player='volume'>"),s(T.controls,"captions")&&e.push("<input class='sr-only' id='captions{id}' type='checkbox' data-player='captions'>","<label for='captions{id}'>","<svg class='icon-captions-on'><use xlink:href='#icon-captions-on'></use></svg>","<svg><use xlink:href='#icon-captions-off'></use></svg>","<span class='sr-only'>Toggle Captions</span>","</label>"),s(T.controls,"fullscreen")&&e.push("<button type='button' data-player='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='sr-only'>Toggle Fullscreen</span>","</button>"),e.push("</span>","</div>"),e.join("")}(),e.supported=function(e){var t,r,s=n(),a="IE"===s.name&&s.version<=9,o=/iPhone|iPod/i.test(navigator.userAgent),i=!!document.createElement("audio").canPlayType,l=!!document.createElement("video").canPlayType;switch(e){case"video":t=l,r=t&&!a&&!o;break;case"audio":t=i,r=t&&!a;break;default:t=i&&l,r=t&&!a}return{basic:t,full:r}},e.setup=function(t){if(w=g(T,t),!w.enabled||!e.supported().basic)return!1;for(var n=document.querySelectorAll(w.selectors.container),r=[],s=n.length-1;s>=0;s--){var a=n[s];if("undefined"==typeof a.plyr){var o=new k(a);a.plyr=Object.keys(o).length?o:!1}r.push(a.plyr)}return r}}(this.plyr=this.plyr||{});
\ No newline at end of file +!function(e){"use strict";function t(){var e=["<div class='player-controls'>","<div class='player-progress'>","<label for='seek{id}' class='sr-only'>Seek</label>","<input id='seek{id}' class='player-progress-seek' type='range' min='0' max='100' step='0.5' value='0' data-player='seek'>","<progress class='player-progress-played' max='100' value='0'>","<span>0</span>% played","</progress>","<progress class='player-progress-buffer' max='100' value='0'>","<span>0</span>% buffered","</progress>","</div>","<span class='player-controls-left'>"];return a(T.controls,"restart")&&e.push("<button type='button' data-player='restart'>","<svg><use xlink:href='#icon-restart'></use></svg>","<span class='sr-only'>Restart</span>","</button>"),a(T.controls,"rewind")&&e.push("<button type='button' data-player='rewind'>","<svg><use xlink:href='#icon-rewind'></use></svg>","<span class='sr-only'>Rewind {seektime} secs</span>","</button>"),a(T.controls,"play")&&e.push("<button type='button' data-player='play'>","<svg><use xlink:href='#icon-play'></use></svg>","<span class='sr-only'>Play</span>","</button>","<button type='button' data-player='pause'>","<svg><use xlink:href='#icon-pause'></use></svg>","<span class='sr-only'>Pause</span>","</button>"),a(T.controls,"fast-forward")&&e.push("<button type='button' data-player='fast-forward'>","<svg><use xlink:href='#icon-fast-forward'></use></svg>","<span class='sr-only'>Forward {seektime} secs</span>","</button>"),a(T.controls,"current-time")&&e.push("<span class='player-time'>","<span class='sr-only'>Current time</span>","<span class='player-current-time'>00:00</span>","</span>"),a(T.controls,"duration")&&e.push("<span class='player-time'>","<span class='sr-only'>Duration</span>","<span class='player-duration'>00:00</span>","</span>"),e.push("</span>","<span class='player-controls-right'>"),a(T.controls,"mute")&&e.push("<input class='inverted sr-only' id='mute{id}' type='checkbox' data-player='mute'>","<label id='mute{id}' for='mute{id}'>","<svg class='icon-muted'><use xlink:href='#icon-muted'></use></svg>","<svg><use xlink:href='#icon-volume'></use></svg>","<span class='sr-only'>Toggle Mute</span>","</label>"),a(T.controls,"volume")&&e.push("<label for='volume{id}' class='sr-only'>Volume</label>","<input id='volume{id}' class='player-volume' type='range' min='0' max='10' value='5' data-player='volume'>"),a(T.controls,"captions")&&e.push("<input class='sr-only' id='captions{id}' type='checkbox' data-player='captions'>","<label for='captions{id}'>","<svg class='icon-captions-on'><use xlink:href='#icon-captions-on'></use></svg>","<svg><use xlink:href='#icon-captions-off'></use></svg>","<span class='sr-only'>Toggle Captions</span>","</label>"),a(T.controls,"fullscreen")&&e.push("<button type='button' data-player='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='sr-only'>Toggle Fullscreen</span>","</button>"),e.push("</span>","</div>"),e.join("")}function n(e,t){T.debug&&window.console&&console[t?"error":"log"](e)}function r(){var e,t,n,r=navigator.userAgent,s=navigator.appName,a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10);return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(s="IE",a="11;"):-1!==(t=r.indexOf("MSIE"))?(s="IE",a=r.substring(t+5)):-1!==(t=r.indexOf("Chrome"))?(s="Chrome",a=r.substring(t+7)):-1!==(t=r.indexOf("Safari"))?(s="Safari",a=r.substring(t+7),-1!==(t=r.indexOf("Version"))&&(a=r.substring(t+8))):-1!==(t=r.indexOf("Firefox"))?(s="Firefox",a=r.substring(t+8)):(e=r.lastIndexOf(" ")+1)<(t=r.lastIndexOf("/"))&&(s=r.substring(e,t),a=r.substring(t+1),s.toLowerCase()==s.toUpperCase()&&(s=navigator.appName)),-1!==(n=a.indexOf(";"))&&(a=a.substring(0,n)),-1!==(n=a.indexOf(" "))&&(a=a.substring(0,n)),o=parseInt(""+a,10),isNaN(o)&&(a=""+parseFloat(navigator.appVersion),o=parseInt(navigator.appVersion,10)),{name:s,version:o,ios:/(iPad|iPhone|iPod)/g.test(navigator.platform)}}function s(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 a(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 r=n>0?t.cloneNode(!0):t,s=e[n],a=s.parentNode,o=s.nextSibling;r.appendChild(s),o?a.insertBefore(r,o):a.appendChild(r)}}function l(e){e.parentNode.removeChild(e)}function c(e,t){e.insertBefore(t,e.firstChild)}function u(e,t){for(var n in t)e.setAttribute(n,t[n])}function p(e,t,n){if(e)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(/\s+/g," ").replace(" "+t+" ","");e.className=r+(n?" "+t:"")}}function d(e,t,n,r){if(t=t.split(" "),e instanceof NodeList)for(var s=0;s<e.length;s++)e[s]instanceof Node&&d(e[s],arguments[1],arguments[2],arguments[3]);else for(var a=0;a<t.length;a++)e[r?"addEventListener":"removeEventListener"](t[a],n,!1)}function f(e,t,n){e&&d(e,t,n,!0)}function m(e,t,n){e&&d(e,t,n,!1)}function y(e,t){var n=document.createEvent("MouseEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function v(e){return e.keyCode&&13!=e.keyCode?!0:(e.target.checked=!e.target.checked,y(e.target,"change"),void 0)}function g(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function b(e,t){for(var n in t)t[n]&&t[n].constructor&&t[n].constructor===Object?(e[n]=e[n]||{},b(e[n],t[n])):e[n]=t[n];return e}function h(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},t="webkit moz o ms khtml".split(" ");if("undefined"!=typeof document.cancelFullScreen)e.supportsFullScreen=!0;else for(var n=0,r=t.length;r>n;n++){if(e.prefix=t[n],"undefined"!=typeof document[e.prefix+"CancelFullScreen"]){e.supportsFullScreen=!0;break}if("undefined"!=typeof document.msExitFullscreen&&document.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}return"webkit"===e.prefix&&navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)&&(e.supportsFullScreen=!1),e.supportsFullScreen&&(e.fullScreenEventName="ms"==e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(){switch(this.prefix){case"":return document.fullScreen;case"webkit":return document.webkitIsFullScreen;case"ms":return null!==document.msFullscreenElement;default:return document[this.prefix+"FullScreen"]}},e.requestFullScreen=function(e){return""===this.prefix?e.requestFullScreen():e[this.prefix+("ms"==this.prefix?"RequestFullscreen":"RequestFullScreen")]("webkit"===this.prefix?e.ALLOW_KEYBOARD_INPUT:null)},e.cancelFullScreen=function(){return""===this.prefix?document.cancelFullScreen():document[this.prefix+("ms"==this.prefix?"ExitFullscreen":"CancelFullScreen")]()},e.element=function(){return""===this.prefix?document.fullscreenElement:document[this.prefix+"FullscreenElement"]}),e}function k(){var e={supported:function(){try{return"localStorage"in window&&null!==window.localStorage}catch(e){return!1}}()};return e}function x(a){function d(e){if(!rt.usingTextTracks&&"video"===rt.type&&rt.supported.full){for(rt.subcount=0,e="number"==typeof e?e:rt.media.currentTime;x(rt.captions[rt.subcount][0])<e.toFixed(1);)if(rt.subcount++,rt.subcount>rt.captions.length-1){rt.subcount=rt.captions.length-1;break}rt.media.currentTime.toFixed(1)>=b(rt.captions[rt.subcount][0])&&rt.media.currentTime.toFixed(1)<=x(rt.captions[rt.subcount][0])?(rt.currentCaption=rt.captions[rt.subcount][1],rt.captionsContainer.innerHTML=rt.currentCaption):rt.captionsContainer.innerHTML=""}}function y(){rt.buttons.captions&&(p(rt.container,T.classes.captions.enabled,!0),T.captions.defaultActive&&(p(rt.container,T.classes.captions.active,!0),rt.buttons.captions.checked=!0))}function b(e){var t=[];return t=e.split(" --> "),S(t[0])}function x(e){var t=[];return t=e.split(" --> "),S(t[1])}function S(e){if(null===e||void 0===e)return 0;var t,n=[],r=[];return n=e.split(","),r=n[0].split(":"),t=Math.floor(60*r[0]*60)+Math.floor(60*r[1])+Math.floor(r[2])}function F(e){return rt.container.querySelectorAll(e)}function C(e){return F(e)[0]}function E(){try{return window.self!==window.top}catch(e){return!0}}function A(){if(n("Injecting custom controls."),T.html||(T.html=t()),T.html=o(T.html,"{seektime}",T.seekTime),T.html=o(T.html,"{id}",rt.random),rt.container.insertAdjacentHTML("beforeend",T.html),T.tooltips)for(var e=F(T.selectors.labels),r=e.length-1;r>=0;r--){var s=e[r];p(s,T.classes.hidden,!1),p(s,T.classes.tooltip,!0)}}function N(){try{return rt.controls=C(T.selectors.controls),rt.buttons={},rt.buttons.seek=C(T.selectors.buttons.seek),rt.buttons.play=C(T.selectors.buttons.play),rt.buttons.pause=C(T.selectors.buttons.pause),rt.buttons.restart=C(T.selectors.buttons.restart),rt.buttons.rewind=C(T.selectors.buttons.rewind),rt.buttons.forward=C(T.selectors.buttons.forward),rt.buttons.fullscreen=C(T.selectors.buttons.fullscreen),rt.buttons.mute=C(T.selectors.buttons.mute),rt.buttons.captions=C(T.selectors.buttons.captions),rt.checkboxes=F("[type='checkbox']"),rt.progress={},rt.progress.container=C(T.selectors.progress.container),rt.progress.buffer={},rt.progress.buffer.bar=C(T.selectors.progress.buffer),rt.progress.buffer.text=rt.progress.buffer.bar&&rt.progress.buffer.bar.getElementsByTagName("span")[0],rt.progress.played={},rt.progress.played.bar=C(T.selectors.progress.played),rt.progress.played.text=rt.progress.played.bar&&rt.progress.played.bar.getElementsByTagName("span")[0],rt.volume=C(T.selectors.buttons.volume),rt.duration=C(T.selectors.duration),rt.currentTime=C(T.selectors.currentTime),rt.seekTime=F(T.selectors.seekTime),!0}catch(e){return n("It looks like there's a problem with your controls html. Bailing.",!0),rt.media.setAttribute("controls",""),!1}}function P(){if(rt.buttons.play){var e=rt.buttons.play.innerText||"Play";"undefined"!=typeof T.title&&T.title.length&&(e+=", "+T.title),rt.buttons.play.setAttribute("aria-label",e)}}function I(){if(!rt.media)return n("No audio or video element found!",!0),!1;if(rt.supported.full&&(rt.media.removeAttribute("controls"),p(rt.container,T.classes[rt.type],!0),p(rt.container,T.classes.stopped,null===rt.media.getAttribute("autoplay")),rt.browser.ios&&p(rt.container,"ios",!0),"video"===rt.type)){var e=document.createElement("div");e.setAttribute("class",T.classes.videoWrapper),i(rt.media,e),rt.videoContainer=e}null!==rt.media.getAttribute("autoplay")&&O()}function M(){if("video"===rt.type){rt.videoContainer.insertAdjacentHTML("afterbegin","<div class='"+T.selectors.captions.replace(".","")+"'></div>"),rt.captionsContainer=C(T.selectors.captions),rt.usingTextTracks=!1,rt.media.textTracks&&(rt.usingTextTracks=!0);for(var e,t="",r=rt.media.childNodes,s=0;s<r.length;s++)"track"===r[s].nodeName.toLowerCase()&&(e=r[s].getAttribute("kind"),"captions"===e&&(t=r[s].getAttribute("src")));if(rt.captionExists=!0,""===t?(rt.captionExists=!1,n("No caption track found.")):n("Caption track found; URI: "+t),rt.captionExists){for(var a=rt.media.textTracks,o=0;o<a.length;o++)a[o].mode="hidden";if(y(rt),("IE"===rt.browser.name&&10===rt.browser.version||"IE"===rt.browser.name&&11===rt.browser.version||"Firefox"===rt.browser.name&&rt.browser.version>=31||"Safari"===rt.browser.name&&rt.browser.version>=7)&&(n("Detected IE 10/11 or Firefox 31+ or Safari 7+."),rt.usingTextTracks=!1),rt.usingTextTracks){n("TextTracks supported.");for(var i=0;i<a.length;i++){var l=a[i];"captions"===l.kind&&f(l,"cuechange",function(){rt.captionsContainer.innerHTML="",this.activeCues[0]&&this.activeCues[0].hasOwnProperty("text")&&rt.captionsContainer.appendChild(this.activeCues[0].getCueAsHTML())})}}else if(n("TextTracks not supported so rendering captions manually."),rt.currentCaption="",rt.captions=[],""!==t){var c=new XMLHttpRequest;c.onreadystatechange=function(){if(4===c.readyState)if(200===c.status){var e,t=[],r=c.responseText;t=r.split("\n\n");for(var s=0;s<t.length;s++)e=t[s],rt.captions[s]=[],rt.captions[s]=e.split("\n");rt.captions.shift(),n("Successfully loaded the caption file via AJAX.")}else n("There was a problem loading the caption file via AJAX.",!0)},c.open("get",t,!0),c.send()}if("Safari"===rt.browser.name&&rt.browser.version>=7){n("Safari 7+ detected; removing track from DOM."),a=rt.media.getElementsByTagName("track");for(var u=0;u<a.length;u++)rt.media.removeChild(a[u])}}else p(rt.container,T.classes.captions.enabled)}}function L(){if("video"===rt.type&&T.fullscreen.enabled){var e=w.supportsFullScreen;e||T.fullscreen.fallback&&!E()?(n((e?"Native":"Fallback")+" fullscreen enabled."),p(rt.container,T.classes.fullscreen.enabled,!0)):n("Fullscreen not supported and fallback disabled."),T.fullscreen.hideControls&&p(rt.container,T.classes.fullscreen.hideControls,!0)}}function O(){rt.media.play()}function q(){rt.media.pause()}function H(e){"number"!=typeof e&&(e=T.seekTime),R(rt.media.currentTime-e)}function V(e){"number"!=typeof e&&(e=T.seekTime),R(rt.media.currentTime+e)}function R(e){var t=0;"number"==typeof e?t=e:"object"!=typeof e||"change"!==e.type&&"input"!==e.type||(t=e.target.value/e.target.max*rt.media.duration),0>t?t=0:t>rt.media.duration&&(t=rt.media.duration);try{rt.media.currentTime=t.toFixed(1)}catch(r){}n("Seeking to "+rt.media.currentTime+" seconds"),d(t)}function j(){p(rt.container,T.classes.playing,!rt.media.paused),p(rt.container,T.classes.stopped,rt.media.paused)}function B(e){var t=w.supportsFullScreen;e&&e.type===w.fullScreenEventName?T.fullscreen.active=w.isFullScreen():t?(w.isFullScreen()?w.cancelFullScreen():w.requestFullScreen(rt.container),T.fullscreen.active=w.isFullScreen()):(T.fullscreen.active=!T.fullscreen.active,T.fullscreen.active?(f(document,"keyup",D),document.body.style.overflow="hidden"):(m(document,"keyup",D),document.body.style.overflow="")),p(rt.container,T.classes.fullscreen.active,T.fullscreen.active)}function D(e){27===(e.which||e.charCode||e.keyCode)&&T.fullscreen.active&&B()}function W(e){rt.volume&&("undefined"==typeof e&&(e=T.storage.enabled&&k().supported?window.localStorage[T.storage.key]||T.volume:T.volume),e>10&&(e=10),rt.supported.full&&(rt.volume.value=e),rt.media.volume=parseFloat(e/10),X(),T.storage.enabled&&k().supported&&(window.localStorage.plyr_volume=e))}function _(e){"undefined"==typeof e&&(e=!rt.media.muted),rt.supported.full&&(rt.buttons.mute.checked=e),rt.media.muted=e,X()}function U(e){rt.supported.full&&rt.buttons.captions&&("undefined"==typeof e&&(e=-1===rt.container.className.indexOf(T.classes.captions.active),rt.buttons.captions.checked=e),p(rt.container,T.classes.captions.active,e))}function X(){p(rt.container,T.classes.muted,0===rt.media.volume||rt.media.muted)}function J(e){var t="waiting"===e.type;clearTimeout(rt.loadingTimer),rt.loadingTimer=setTimeout(function(){p(rt.container,T.classes.loading,t)},t?250:0)}function $(e){var t=rt.progress.played.bar,n=rt.progress.played.text,r=0;if(e)switch(e.type){case"timeupdate":case"seeking":r=g(rt.media.currentTime,rt.media.duration),"timeupdate"==e.type&&rt.buttons.seek&&(rt.buttons.seek.value=r);break;case"change":case"input":r=e.target.value;break;case"playing":case"progress":t=rt.progress.buffer.bar,n=rt.progress.buffer.text,r=function(){var e=rt.media.buffered;return e.length?g(e.end(0),rt.media.duration):0}()}t&&(t.value=r),n&&(n.innerHTML=r)}function z(e,t){if(t){rt.secs=parseInt(e%60),rt.mins=parseInt(e/60%60),rt.hours=parseInt(e/60/60%60);var n=parseInt(rt.media.duration/60/60%60)>0;rt.secs=("0"+rt.secs).slice(-2),rt.mins=("0"+rt.mins).slice(-2),t.innerHTML=(n?rt.hours+":":"")+rt.mins+":"+rt.secs}}function K(){var e=rt.media.duration||0;!rt.duration&&T.displayDuration&&rt.media.paused&&z(e,rt.currentTime),rt.duration&&z(e,rt.duration)}function Y(e){z(rt.media.currentTime,rt.currentTime),$(e)}function G(){for(var e=rt.media.querySelectorAll("source"),t=e.length-1;t>=0;t--)l(e[t]);rt.media.removeAttribute("src")}function Q(e){if(e.src){var t=document.createElement("source");u(t,e),c(rt.media,t)}}function Z(e){if(q(),R(),G(),"string"==typeof e)rt.media.setAttribute("src",e);else if(e.constructor===Array)for(var t in e)Q(e[t]);rt.supported.full&&(Y(),j()),rt.media.load(),null!==rt.media.getAttribute("autoplay")&&O()}function et(e){"video"===rt.type&&rt.media.setAttribute("poster",e)}function tt(){f(rt.buttons.play,"click",function(){O(),setTimeout(function(){rt.buttons.pause.focus()},100)}),f(rt.buttons.pause,"click",function(){q(),setTimeout(function(){rt.buttons.play.focus()},100)}),f(rt.buttons.restart,"click",R),f(rt.buttons.rewind,"click",H),f(rt.buttons.forward,"click",V),f(rt.volume,"change input",function(){W(this.value)}),f(rt.buttons.mute,"change",function(){_(this.checked)}),f(rt.buttons.fullscreen,"click",B),w.supportsFullScreen&&f(document,w.fullScreenEventName,B),f(rt.media,"timeupdate seeking",Y),f(rt.media,"timeupdate",d),f(rt.media,"loadedmetadata",K),f(rt.buttons.seek,"change input",R),f(rt.buttons.captions,"change",function(){U(this.checked)}),f(rt.media,"ended",function(){"video"===rt.type&&(rt.captionsContainer.innerHTML=""),j()}),f(rt.media,"progress",$),f(rt.media,"playing",$),f(rt.media,"volumechange",X),f(rt.media,"play pause",j),f(rt.media,"waiting canplay seeked",J),f(rt.checkboxes,"keyup",v),"video"===rt.type&&T.click&&f(rt.videoContainer,"click",function(){rt.media.paused?O():rt.media.ended?(R(),O()):q()}),T.fullscreen.hideControls&&f(rt.controls,"mouseenter mouseleave",function(e){p(rt.controls,T.classes.hover,"mouseenter"===e.type)})}function nt(){if(w=h(),rt.browser=r(),rt.media=rt.container.querySelectorAll("audio, video")[0],rt.type=rt.media.tagName.toLowerCase(),rt.supported=e.supported(rt.type),!rt.supported.basic)return!1;if(n(rt.browser.name+" "+rt.browser.version),I(),rt.random=Math.floor(1e4*Math.random()),rt.supported.full){if(A(),!N())return!1;T.displayDuration&&K(),P(),M(),W(),L(),tt()}return!0}var rt=this;return rt.container=a,nt()?{media:rt.media,play:O,pause:q,restart:R,rewind:H,forward:V,seek:R,setVolume:W,toggleMute:_,toggleCaptions:U,source:Z,poster:et,support:function(e){return s(rt,e)}}:{}}var w,T,S={enabled:!0,debug:!1,seekTime:10,volume:5,click:!0,tooltips:!1,displayDuration:!0,selectors:{container:".player",controls:".player-controls",labels:"[data-player] .sr-only, label .sr-only",buttons:{seek:"[data-player='seek']",play:"[data-player='play']",pause:"[data-player='pause']",restart:"[data-player='restart']",rewind:"[data-player='rewind']",forward:"[data-player='fast-forward']",mute:"[data-player='mute']",volume:"[data-player='volume']",captions:"[data-player='captions']",fullscreen:"[data-player='fullscreen']"},progress:{container:".player-progress",buffer:".player-progress-buffer",played:".player-progress-played"},captions:".player-captions",currentTime:".player-current-time",duration:".player-duration"},classes:{video:"player-video",videoWrapper:"player-video-wrapper",audio:"player-audio",stopped:"stopped",playing:"playing",muted:"muted",loading:"loading",tooltip:"player-tooltip",hidden:"sr-only",hover:"hover",captions:{enabled:"captions-enabled",active:"captions-active"},fullscreen:{enabled:"fullscreen-enabled",active:"fullscreen-active",hideControls:"fullscreen-hide-controls"}},captions:{defaultActive:!1},fullscreen:{enabled:!0,fallback:!0,hideControls:!0},storage:{enabled:!0,key:"plyr_volume"},controls:["restart","rewind","play","fast-forward","current-time","duration","mute","volume","captions","fullscreen"]};e.supported=function(e){var t,n,s=r(),a="IE"===s.name&&s.version<=9,o=/iPhone|iPod/i.test(navigator.userAgent),i=!!document.createElement("audio").canPlayType,l=!!document.createElement("video").canPlayType;switch(e){case"video":t=l,n=t&&!a&&!o;break;case"audio":t=i,n=t&&!a;break;default:t=i&&l,n=t&&!a}return{basic:t,full:n}},e.setup=function(t){if(T=b(S,t),!T.enabled||!e.supported().basic)return!1;for(var n=document.querySelectorAll(T.selectors.container),r=[],s=n.length-1;s>=0;s--){var a=n[s];if("undefined"==typeof a.plyr){var o=new x(a);a.plyr=Object.keys(o).length?o:!1}r.push(a.plyr)}return r}}(this.plyr=this.plyr||{});
\ No newline at end of file diff --git a/docs/error.html b/docs/error.html index 93d02829..acac1c9c 100644 --- a/docs/error.html +++ b/docs/error.html @@ -6,7 +6,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Docs styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.1.0/docs.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.1.1/docs.css"> </head> <body> <main> diff --git a/docs/index.html b/docs/index.html index 1ec375c8..88a31fb0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -8,10 +8,10 @@ <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.1.0/plyr.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.1.1/plyr.css"> <!-- Docs styles --> - <link rel="stylesheet" href="//cdn.plyr.io/1.1.0/docs.css"> + <link rel="stylesheet" href="//cdn.plyr.io/1.1.1/docs.css"> </head> <body> <header> @@ -83,13 +83,13 @@ b.insertBefore(c, b.childNodes[0]); } } - })(document, "https://cdn.plyr.io/1.1.0/sprite.svg"); + })(document, "https://cdn.plyr.io/1.1.1/sprite.svg"); </script> <!-- Plyr core script --> - <script src="//cdn.plyr.io/1.1.0/plyr.js"></script> + <script src="//cdn.plyr.io/1.1.1/plyr.js"></script> <!-- Docs script --> - <script src="//cdn.plyr.io/1.1.0/docs.js"></script> + <script src="//cdn.plyr.io/1.1.1/docs.js"></script> </body> </html>
\ No newline at end of file diff --git a/package.json b/package.json index 56fc10e0..3deb776a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plyr", - "version": "1.1.0", + "version": "1.1.1", "description": "A simple HTML5 media player using custom controls", "homepage": "http://plyr.io", "main": "gulpfile.js", @@ -38,7 +38,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.1.0/plyr.js` to `https://cdn.plyr.io/1.1.0/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.1.1/plyr.js` to `https://cdn.plyr.io/1.1.1/plyr.js` ### Bower If bower is your thang, you can grab Plyr using: @@ -51,11 +51,11 @@ More info on setting up dependencies can be found in the [Bower Docs](http://bow If you want to use our CDN, you can use the following. HTTPS (SSL) is supported. ```html -<link rel="stylesheet" href="//cdn.plyr.io/1.1.0/plyr.css"> -<script src="//cdn.plyr.io/1.1.0/plyr.js"></script> +<link rel="stylesheet" href="//cdn.plyr.io/1.1.1/plyr.css"> +<script src="//cdn.plyr.io/1.1.1/plyr.js"></script> ``` -You can also access the `sprite.svg` file at `//cdn.plyr.io/1.1.0/sprite.svg`. +You can also access the `sprite.svg` file at `//cdn.plyr.io/1.1.1/sprite.svg`. ### CSS 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. diff --git a/src/js/plyr.js b/src/js/plyr.js index 8b995303..b8b2f17d 100644 --- a/src/js/plyr.js +++ b/src/js/plyr.js @@ -1,6 +1,6 @@ // ========================================================================== // Plyr -// plyr.js v1.1.0 +// plyr.js v1.1.1 // https://github.com/selz/plyr // License: The MIT License (MIT) // ========================================================================== @@ -84,7 +84,7 @@ }; // Build the default HTML - defaults.html = (function() { + function _buildControls() { // Open and add the progress and seek elements var html = [ "<div class='player-controls'>", @@ -101,7 +101,7 @@ "<span class='player-controls-left'>"]; // Restart button - if(_inArray(defaults.controls, "restart")) { + if(_inArray(config.controls, "restart")) { html.push( "<button type='button' data-player='restart'>", "<svg><use xlink:href='#icon-restart'></use></svg>", @@ -111,7 +111,7 @@ } // Rewind button - if(_inArray(defaults.controls, "rewind")) { + if(_inArray(config.controls, "rewind")) { html.push( "<button type='button' data-player='rewind'>", "<svg><use xlink:href='#icon-rewind'></use></svg>", @@ -121,7 +121,7 @@ } // Play/pause button - if(_inArray(defaults.controls, "play")) { + if(_inArray(config.controls, "play")) { html.push( "<button type='button' data-player='play'>", "<svg><use xlink:href='#icon-play'></use></svg>", @@ -135,7 +135,7 @@ } // Fast forward button - if(_inArray(defaults.controls, "fast-forward")) { + if(_inArray(config.controls, "fast-forward")) { html.push( "<button type='button' data-player='fast-forward'>", "<svg><use xlink:href='#icon-fast-forward'></use></svg>", @@ -145,7 +145,7 @@ } // Media current time display - if(_inArray(defaults.controls, "current-time")) { + if(_inArray(config.controls, "current-time")) { html.push( "<span class='player-time'>", "<span class='sr-only'>Current time</span>", @@ -155,7 +155,7 @@ } // Media duration display - if(_inArray(defaults.controls, "duration")) { + if(_inArray(config.controls, "duration")) { html.push( "<span class='player-time'>", "<span class='sr-only'>Duration</span>", @@ -171,7 +171,7 @@ ); // Toggle mute button - if(_inArray(defaults.controls, "mute")) { + if(_inArray(config.controls, "mute")) { html.push( "<input class='inverted sr-only' id='mute{id}' type='checkbox' data-player='mute'>", "<label id='mute{id}' for='mute{id}'>", @@ -183,7 +183,7 @@ } // Volume range control - if(_inArray(defaults.controls, "volume")) { + if(_inArray(config.controls, "volume")) { html.push( "<label for='volume{id}' class='sr-only'>Volume</label>", "<input id='volume{id}' class='player-volume' type='range' min='0' max='10' value='5' data-player='volume'>" @@ -191,7 +191,7 @@ } // Toggle captions button - if(_inArray(defaults.controls, "captions")) { + if(_inArray(config.controls, "captions")) { html.push( "<input class='sr-only' id='captions{id}' type='checkbox' data-player='captions'>", "<label for='captions{id}'>", @@ -203,7 +203,7 @@ } // Toggle fullscreen button - if(_inArray(defaults.controls, "fullscreen")) { + if(_inArray(config.controls, "fullscreen")) { html.push( "<button type='button' data-player='fullscreen'>", "<svg class='icon-exit-fullscreen'><use xlink:href='#icon-exit-fullscreen'></use></svg>", @@ -220,7 +220,7 @@ ); return html.join(""); - })(); + } // Debugging function _log(text, error) { @@ -330,7 +330,7 @@ // Element exists in an array function _inArray(haystack, needle) { - return (haystack.indexOf(needle) != -1); + return Array.prototype.indexOf && (haystack.indexOf(needle) != -1); } // Replace all @@ -684,9 +684,9 @@ // Insert custom video controls _log("Injecting custom controls."); - // If no controls are specified, bail + // If no controls are specified, create default if(!config.html) { - return; + config.html = _buildControls(); } // Replace seek time instances @@ -1624,7 +1624,7 @@ // Extend the default options with user specified config = _extend(defaults, options); - // If enabled carry on + // Bail if disabled or no basic support // You may want to disable certain UAs etc if(!config.enabled || !api.supported().basic) { return false; |