!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t(e,document):"function"==typeof define&&define.amd?define([],function(){return t(e,document)}):e.plyr=t(e,document)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(){var e,n,a,s=navigator.userAgent,l=navigator.appName,i=""+parseFloat(navigator.appVersion),r=parseInt(navigator.appVersion,10),o=!1,u=!1,c=!1,d=!1;return navigator.appVersion.indexOf("Windows NT")!==-1&&navigator.appVersion.indexOf("rv:11")!==-1?(o=!0,l="IE",i="11"):(n=s.indexOf("MSIE"))!==-1?(o=!0,l="IE",i=s.substring(n+5)):(n=s.indexOf("Chrome"))!==-1?(c=!0,l="Chrome",i=s.substring(n+7)):(n=s.indexOf("Safari"))!==-1?(d=!0,l="Safari",i=s.substring(n+7),(n=s.indexOf("Version"))!==-1&&(i=s.substring(n+8))):(n=s.indexOf("Firefox"))!==-1?(u=!0,l="Firefox",i=s.substring(n+8)):(e=s.lastIndexOf(" ")+1)<(n=s.lastIndexOf("/"))&&(l=s.substring(e,n),i=s.substring(n+1),l.toLowerCase()===l.toUpperCase()&&(l=navigator.appName)),(a=i.indexOf(";"))!==-1&&(i=i.substring(0,a)),(a=i.indexOf(" "))!==-1&&(i=i.substring(0,a)),r=parseInt(""+i,10),isNaN(r)&&(i=""+parseFloat(navigator.appVersion),r=parseInt(navigator.appVersion,10)),{name:l,version:r,isIE:o,isFirefox:u,isChrome:c,isSafari:d,isIos:/(iPad|iPhone|iPod)/g.test(navigator.platform),isTouch:"ontouchstart"in t.documentElement}}function a(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(){try{return e.self!==e.top}catch(e){return!0}}function l(e,t){return Array.prototype.indexOf&&e.indexOf(t)!==-1}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,s=e[n],l=s.parentNode,i=s.nextSibling;return a.appendChild(s),i?l.insertBefore(a,i):l.appendChild(a),a}}function r(e){e&&e.parentNode.removeChild(e)}function o(e,t){e.insertBefore(t,e.firstChild)}function u(e,t){for(var n in t)e.setAttribute(n,t[n])}function c(e,t){if(!O.string(e)||O.empty(e))return{};var n={};return e.split(",").forEach(function(e){e=e.trim();var a=e.charAt(0);switch(a){case".":var s=e.replace(".","");O.object(t)&&O.string(t.class)&&(t.class+=" "+s),n.class=s;break;case"#":n.id=e.replace("#","");break;case"[":e=e.replace(/[\[\]]/g,"");var l=e.split("="),i=l[0],r=l.length>1?l[1].replace(/[\"\']/g,""):"";n[i]=r}}),n}function d(e,n,a){var s=t.createElement(e);return O.object(n)&&u(s,n),O.string(a)&&(s.textContent=a),s}function p(e,t,n,a){var s=d(e,n,a);o(t,s)}function m(e){for(var t=e.childNodes.length;t--;)e.removeChild(e.lastChild)}function f(e){return e.replace(".","")}function y(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 b(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className))}function v(e,n){var a=Element.prototype,s=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.msMatchesSelector||function(e){return[].indexOf.call(t.querySelectorAll(e),this)!==-1};return s.call(e,n)}function g(e,t,n,a,s){k(e,t,function(t){n&&n.apply(e,[t]),a.apply(e,[t])},s)}function h(e,t,n,a,s){var l=t.split(" ");if(O.boolean(s)||(s=!1),e instanceof NodeList)for(var i=0;i'),st.captions.textTracks=!1,st.elements.media.textTracks&&(st.captions.textTracks=!0);var e=[],t="";if(st.elements.media.childNodes.forEach(function(t){"track"===t.nodeName.toLowerCase()&&("captions"!==t.kind&&"subtitles"!==t.kind||e.push(t.getAttribute("src")))}),st.captions.exist=!0,0===e.length?(st.captions.exist=!1,rt("No caption track found")):Number(_.captions.selectedIndex)+1>e.length?(st.captions.exist=!1,rt("Caption index out of bound")):(t=e[_.captions.selectedIndex],rt("Caption track found; URI: "+t)),st.captions.exist){var n=st.elements.media.textTracks;if([].forEach.call(n,function(e){w(e,"cuechange",ee),e.mode="hidden"}),le(st),(st.browser.isIE&&st.browser.version>=10||st.browser.isFirefox&&st.browser.version>=31)&&(rt("Detected browser with known TextTrack issues - using manual fallback"),st.captions.textTracks=!1),st.captions.textTracks){rt("TextTracks supported");var a=n[_.captions.selectedIndex];"captions"!==a.kind&&"subtitles"!==a.kind||(k(a,"cuechange",ee),a.activeCues&&a.activeCues.length>0&&ee(a))}else if(rt("TextTracks not supported so rendering captions manually"),st.captions.current="",st.captions.captions=[],""!==t){var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status){var e=s.responseText,t="\r\n";e.indexOf(t+t)===-1&&(t=e.indexOf("\r\r")!==-1?"\r":"\n");var n=e.split(t+t);st.captions.captions=n.map(function(e){var n=e.split(t),a=0;return n[a].indexOf(":")!==-1&&(a=1),[n[a],n[a+1]]}),st.captions.captions.shift(),rt("Successfully loaded the caption file via AJAX")}else ot(_.logPrefix+"There was a problem loading the caption file via AJAX")},s.open("get",t,!0),s.send()}}else y(st.elements.container,_.classes.captions.enabled)}}function ne(e){_.captions.selectedIndex=e||_.captions.selectedIndex,ae(),te()}function ae(e){var t=D(_.selectors.captions);if(O.htmlElement(t)){var n=d("span");m(t),O.undefined(e)&&(e=""),O.string(e)?n.innerHTML=e.trim():n.appendChild(e),t.appendChild(n)}}function se(e){function t(e,t){var n=[];n=e.split(" --> ");for(var a=0;ast.captions.captions.length-1){st.captions.count=st.captions.captions.length-1;break}st.elements.media.currentTime.toFixed(1)>=n(st.captions[st.subcount][0])&&st.elements.media.currentTime.toFixed(1)<=a(st.captions[st.subcount][0])?(st.captions.current=st.captions.captions[st.captions.count][1],ae(st.captions.current)):ae()}}function le(){if(st.elements.buttons.captions){y(st.elements.container,_.classes.captions.enabled,!0);var e=st.storage.captions;O.boolean(e)||(e=_.captions.defaultActive),e&&(y(st.elements.container,_.classes.captions.active,!0),x(st.elements.buttons.captions,!0))}}function ie(e){st.supported.full&&st.elements.buttons.captions&&(O.boolean(e)||(e=st.elements.container.className.indexOf(_.classes.captions.active)===-1),st.captions.enabled=e,x(st.elements.buttons.captions,st.captions.enabled),y(st.elements.container,_.classes.captions.active,st.captions.enabled),R(st.elements.container,st.captions.enabled?"captionsenabled":"captionsdisabled",!0),pe({captions:st.captions.enabled}))}function re(){if(_.loadSprite){var e=B();e.absolute?(rt("AJAX loading absolute SVG sprite"+(st.browser.isIE?" (due to IE)":"")),I(e.url,"sprite-plyr")):rt("Sprite will be used as external resource directly")}l(_.controls,"play-large")&&(st.elements.buttons.playLarge=J("play-large"),st.elements.container.appendChild(st.elements.buttons.playLarge)),st.id=Math.floor(1e4*Math.random());var n,a=$({id:st.id,seektime:_.seekTime,speed:Te(),quality:"HD",captions:"English",loop:"None"});if(O.string(_.selectors.controls.container)&&(n=t.querySelector(_.selectors.controls.container)),O.htmlElement(n)||(n=st.elements.container),n.appendChild(a),_.tooltips.controls)for(var s=V([_.selectors.controls.wrapper," ",_.selectors.labels," .",_.classes.hidden].join("")),i=s.length-1;i>=0;i--){var r=s[i];y(r,_.classes.hidden,!1),y(r,_.classes.tooltip,!0)}}function oe(){y(st.elements.container,_.selectors.container.replace(".",""),st.supported.full)}function ue(e){e&&l(_.types.html5,st.type)?st.elements.media.setAttribute("controls",""):st.elements.media.removeAttribute("controls")}function ce(e){var t=_.i18n.play;O.string(_.title)&&_.title.length&&(t+=", "+_.title,st.elements.container.setAttribute("aria-label",_.title)),st.supported.full&&(O.htmlElement(st.elements.buttons.play)&&st.elements.buttons.play.setAttribute("aria-label",t),O.htmlElement(st.elements.buttons.playLarge)&&st.elements.buttons.playLarge.setAttribute("aria-label",t)),O.htmlElement(e)&&e.setAttribute("title",_.i18n.frameTitle.replace("{title}",_.title))}function de(){var t=null;st.storage={},M.storage&&_.storage.enabled&&(e.localStorage.removeItem("plyr-volume"),t=e.localStorage.getItem(_.storage.key),t&&(/^\d+(\.\d+)?$/.test(t)?pe({volume:parseFloat(t)}):st.storage=JSON.parse(t)))}function pe(t){M.storage&&_.storage.enabled&&(S(st.storage,t),e.localStorage.setItem(_.storage.key,JSON.stringify(st.storage)))}function me(){if(!st.elements.media)return void ot("No media element found!");if(st.supported.full&&(y(st.elements.container,_.classes.type.replace("{0}",st.type),!0),l(_.types.embed,st.type)&&y(st.elements.container,_.classes.type.replace("{0}","video"),!0),y(st.elements.container,_.classes.pip.enabled,M.pip),y(st.elements.container,_.classes.stopped,_.autoplay),y(st.elements.container,_.classes.isIos,st.browser.isIos),y(st.elements.container,_.classes.isTouch,st.browser.isTouch),"video"===st.type)){var e=d("div");e.setAttribute("class",_.classes.videoWrapper),i(st.elements.media,e),st.elements.wrapper=e}l(_.types.embed,st.type)&&fe()}function fe(){var t,n=d("div"),s=st.type+"-"+Math.floor(1e4*Math.random());switch(st.type){case"youtube":t=E(st.embedId);break;case"vimeo":t=A(st.embedId);break;default:t=st.embedId}for(var l=V('[id^="'+st.type+'-"]'),i=l.length-1;i>=0;i--)r(l[i]);if(y(st.elements.media,_.classes.videoWrapper,!0),y(st.elements.media,_.classes.embedWrapper,!0),"youtube"===st.type)st.elements.media.appendChild(n),n.setAttribute("id",s),O.object(e.YT)?be(t,n):(a(_.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){be(t,n)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===st.type)if(st.supported.full?st.elements.media.appendChild(n):n=st.elements.media,n.setAttribute("id",s),O.object(e.Vimeo))ve(t,n);else{a(_.urls.vimeo.api);var o=e.setInterval(function(){O.object(e.Vimeo)&&(e.clearInterval(o),ve(t,n))},50)}else if("soundcloud"===st.type){var c=d("iframe");c.loaded=!1,k(c,"load",function(){c.loaded=!0}),u(c,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+t,id:s}),n.appendChild(c),st.elements.media.appendChild(n),e.SC||a(_.urls.soundcloud.api);var p=e.setInterval(function(){e.SC&&c.loaded&&(e.clearInterval(p),ge.call(c))},50)}}function ye(){st.supported.full&&(tt(),nt()),ce(D("iframe"))}function be(t,n){st.embed=new e.YT.Player(n.id,{videoId:t,playerVars:{autoplay:_.autoplay?1:0,controls:st.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:{onError:function(e){R(st.elements.container,"error",!0,{code:e.data,embed:e.target})},onPlaybackQualityChange:function(e){var t=e.target,n=t.getPlaybackQuality();console.warn(n)},onReady:function(t){var n=t.target;st.elements.media.play=function(){n.playVideo(),st.elements.media.paused=!1},st.elements.media.pause=function(){n.pauseVideo(),st.elements.media.paused=!0},st.elements.media.stop=function(){n.stopVideo(),st.elements.media.paused=!0},st.elements.media.duration=n.getDuration(),st.elements.media.paused=!0,st.elements.media.currentTime=0,st.elements.media.muted=n.isMuted();var a=n.getPlaybackRate(),s=n.getAvailablePlaybackRates();console.warn(a,s),_.title=n.getVideoData().title,st.supported.full&&st.elements.media.querySelector("iframe").setAttribute("tabindex","-1"),ye(),R(st.elements.media,"timeupdate"),R(st.elements.media,"durationchange"),e.clearInterval(lt.buffering),lt.buffering=e.setInterval(function(){st.elements.media.buffered=n.getVideoLoadedFraction(),(null===st.elements.media.lastBuffered||st.elements.media.lastBuffered=n)return;_.loop.end=n,_.loop.indicator.end=st.elements.display.played.value;break;case"all":_.loop.start=0,_.loop.end=st.elements.media.duration-2,_.loop.indicator.start=0,_.loop.indicator.end=100;break;case"toggle":_.loop.active?(_.loop.start=0,_.loop.end=null):(_.loop.start=0,_.loop.end=st.elements.media.duration-2);break;default:_.loop.start=0,_.loop.end=null}_.loop.active=O.number(_.loop.start)&&O.number(_.loop.end);var a=(We(_.loop.start,D('[data-plyr-loop="start"]')),null);O.number(_.loop.end)&&(a=We(_.loop.end,t.querySelector('[data-loop__value="loopout"]'))),_.loop.active}function xe(e){if(O.undefined(e)&&(e=st.storage.speed||_.defaultSpeed),!O.array(_.speeds))return void ot("Invalid speeds format");if(!O.number(e)){var t=_.speeds.indexOf(_.currentSpeed);if(t!==-1){var n=t+1;n>=_.speeds.length&&(n=0),e=_.speeds[n]}else e=_.defaultSpeed}_.currentSpeed=e,st.elements.media.playbackRate=e,pe({speed:e})}function Te(){return _.currentSpeed.toFixed(1).toString().replace(".0","")+"×"}function Se(e){O.number(e)||(e=_.seekTime),Ae(st.elements.media.currentTime-e)}function Ee(e){O.number(e)||(e=_.seekTime),Ae(st.elements.media.currentTime+e)}function Ae(e){var t=0,n=st.elements.media.paused,a=_e();O.number(e)?t=e:O.event(e)&&l(["input","change"],e.type)&&(t=e.target.value/e.target.max*a),t<0?t=0:t>a&&(t=a),Ye(t);try{st.elements.media.currentTime=t.toFixed(4)}catch(e){}if(l(_.types.embed,st.type)){switch(st.type){case"youtube":st.embed.seekTo(t);break;case"vimeo":st.embed.setCurrentTime(t.toFixed(0));break;case"soundcloud":st.embed.seekTo(1e3*t)}n&&ke(),R(st.elements.media,"timeupdate"),st.elements.media.seeking=!0,R(st.elements.media,"seeking")}rt("Seeking to "+st.elements.media.currentTime+" seconds"),se(t)}function _e(){var e=parseInt(_.duration),t=0;return null===st.elements.media.duration||isNaN(st.elements.media.duration)||(t=st.elements.media.duration),isNaN(e)?t:e}function Ie(){y(st.elements.container,_.classes.playing,!st.elements.media.paused),y(st.elements.container,_.classes.stopped,st.elements.media.paused),Ue(st.elements.media.paused)}function Pe(){q={x:e.pageXOffset||0,y:e.pageYOffset||0}}function Ne(){e.scrollTo(q.x,q.y)}function Fe(e){var n=M.fullscreen;if(n){if(!e||e.type!==j.eventType)return j.isFullScreen(st.elements.container)?j.cancelFullScreen():(Pe(),j.requestFullScreen(st.elements.container)),void(st.fullscreen.active=j.isFullScreen(st.elements.container));st.fullscreen.active=j.isFullScreen(st.elements.container)}else st.fullscreen.active=!st.fullscreen.active,t.body.style.overflow=st.fullscreen.active?"hidden":"";y(st.elements.container,_.classes.fullscreen.active,st.fullscreen.active),W(st.fullscreen.active),st.elements.buttons&&st.elements.buttons.fullscreen&&x(st.elements.buttons.fullscreen,st.fullscreen.active),R(st.elements.container,st.fullscreen.active?"enterfullscreen":"exitfullscreen",!0),!st.fullscreen.active&&n&&Ne()}function qe(e){if(O.boolean(e)||(e=!st.elements.media.muted),x(st.elements.buttons.mute,e),st.elements.media.muted=e,0===st.elements.media.volume&&Le(_.volume),l(_.types.embed,st.type)){switch(st.type){case"youtube":st.embed[st.elements.media.muted?"mute":"unMute"]();break;case"vimeo":case"soundcloud":st.embed.setVolume(st.elements.media.muted?0:parseFloat(_.volume/10))}R(st.elements.media,"volumechange")}}function Le(e){var t=10,n=0;if(O.event(e)&&(e=e.target.value),O.undefined(e)&&(e=st.storage.volume),(null===e||isNaN(e))&&(e=_.volume),e>t&&(e=t),e0&&qe()}function Oe(e){var t=st.elements.media.muted?0:10*st.elements.media.volume;O.number(e)||(e=1),Le(t+e)}function je(e){var t=st.elements.media.muted?0:10*st.elements.media.volume;O.number(e)||(e=1),Le(t-e)}function Me(){var e=st.elements.media.muted?0:10*st.elements.media.volume;st.supported.full&&(st.elements.inputs.volume&&(st.elements.inputs.volume.value=e),st.elements.display.volume&&(st.elements.display.volume.value=e)),pe({volume:e}),y(st.elements.container,_.classes.muted,0===e),st.supported.full&&st.elements.buttons.mute&&x(st.elements.buttons.mute,0===e)}function Re(e){var t="waiting"===e.type;clearTimeout(lt.loading),lt.loading=setTimeout(function(){y(st.elements.container,_.classes.loading,t),Ue(t)},t?250:0)}function Ve(e){if(st.supported.full){var t=st.elements.display.played,n=0,a=_e();if(e)switch(e.type){case"timeupdate":case"seeking":if(st.elements.controls.pressed)return;n=T(st.elements.media.currentTime,a),"timeupdate"===e.type&&st.elements.inputs.seek&&(st.elements.inputs.seek.value=n);break;case"playing":case"progress":t=st.elements.display.buffer,n=function(){var e=st.elements.media.buffered;return e&&e.length?T(e.end(0),a):O.number(e)?100*e:0}()}O.number(_.loop.start)&&O.number(_.loop.end)&&st.elements.media.currentTime>=_.loop.end&&Ae(_.loop.start),De(t,n)}}function De(e,t){if(st.supported.full){if(O.undefined(t)&&(t=0),O.undefined(e)){if(!O.htmlElement(st.elements.display.buffer))return;e=st.elements.display.buffer}if(O.htmlElement(e)){e.value=t;var n=e.getElementsByTagName("span")[0];O.htmlElement(n)&&(n.childNodes[0].nodeValue=t)}}}function We(e,t){if(t){isNaN(e)&&(e=0);var n=parseInt(e%60),a=parseInt(e/60%60),s=parseInt(e/60/60%60),l=parseInt(_e()/60/60%60)>0;n=("0"+n).slice(-2),a=("0"+a).slice(-2);var i=(l?s+":":"")+a+":"+n;return t.textContent=i,i}}function He(){if(st.supported.full){var e=_e()||0;!st.elements.display.duration&&_.displayDuration&&st.elements.media.paused&&We(e,st.elements.display.currentTime),st.elements.display.duration&&We(e,st.elements.display.duration),Xe()}}function Be(e){We(st.elements.media.currentTime,st.elements.display.currentTime),e&&"timeupdate"===e.type&&st.elements.media.seeking||Ve(e)}function Ye(e){O.number(e)||(e=0);var t=_e(),n=T(e,t);st.elements.progress&&st.elements.display.played&&(st.elements.display.played.value=n),st.elements.buttons&&st.elements.inputs.seek&&(st.elements.inputs.seek.value=n)}function Xe(e){var t=_e();if(_.tooltips.seek&&O.htmlElement(st.elements.inputs.seek)&&O.htmlElement(st.elements.display.seekTooltip)&&0!==t){var n=st.elements.inputs.seek.getBoundingClientRect(),a=0,s=_.classes.tooltip+"--visible";if(O.event(e))a=100/n.width*(e.pageX-n.left);else{if(!b(st.elements.display.seekTooltip,s))return;a=st.elements.display.seekTooltip.style.left.replace("%","")}a<0?a=0:a>100&&(a=100),We(t/100*a,st.elements.display.seekTooltip),st.elements.display.seekTooltip.style.left=a+"%",O.event(e)&&l(["mouseenter","mouseleave"],e.type)&&y(st.elements.display.seekTooltip,s,"mouseenter"===e.type)}}function Ue(t){if(_.hideControls&&"audio"!==st.type){var n=0,a=!1,s=t,i=b(st.elements.container,_.classes.loading); if(O.boolean(t)||(t&&t.type?(a="enterfullscreen"===t.type,s=l(["mousemove","touchstart","mouseenter","focus"],t.type),l(["mousemove","touchmove"],t.type)&&(n=2e3),"focus"===t.type&&(n=3e3)):s=b(st.elements.container,_.classes.hideControls)),e.clearTimeout(lt.hover),s||st.elements.media.paused||i){if(y(st.elements.container,_.classes.hideControls,!1),st.elements.media.paused||i)return;st.browser.isTouch&&(n=3e3)}s&&st.elements.media.paused||(lt.hover=e.setTimeout(function(){(!st.elements.controls.pressed&&!st.elements.controls.hover||a)&&y(st.elements.container,_.classes.hideControls,!0)},n))}}function Je(e){if(!O.undefined(e))return void Ke(e);var t;switch(st.type){case"youtube":t=st.embed.getVideoUrl();break;case"vimeo":st.embed.getVideoUrl.then(function(e){t=e});break;case"soundcloud":st.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=st.elements.media.currentSrc}return t||""}function Ke(e){function t(){if(st.embed=null,r(st.elements.media),"video"===st.type&&st.elements.wrapper&&r(st.elements.wrapper),st.elements.container&&st.elements.container.removeAttribute("class"),"type"in e&&(st.type=e.type,"video"===st.type)){var t=e.sources[0];"type"in t&&l(_.types.embed,t.type)&&(st.type=t.type)}switch(st.supported=P(st.type),st.type){case"video":st.elements.media=d("video");break;case"audio":st.elements.media=d("audio");break;case"youtube":case"vimeo":case"soundcloud":st.elements.media=d("div"),st.embedId=e.sources[0].src}o(st.elements.container,st.elements.media),O.boolean(e.autoplay)&&(_.autoplay=e.autoplay),l(_.types.html5,st.type)&&(_.crossorigin&&st.elements.media.setAttribute("crossorigin",""),_.autoplay&&st.elements.media.setAttribute("autoplay",""),"poster"in e&&st.elements.media.setAttribute("poster",e.poster),_.loop.active&&st.elements.media.setAttribute("loop","")),y(st.elements.container,_.classes.fullscreen.active,st.fullscreen.active),y(st.elements.container,_.classes.captions.active,st.captions.enabled),oe(),l(_.types.html5,st.type)&&H("source",e.sources),me(),l(_.types.html5,st.type)&&("tracks"in e&&H("track",e.tracks),st.elements.media.load()),(l(_.types.html5,st.type)||l(_.types.embed,st.type)&&!st.supported.full)&&(tt(),nt()),_.title=e.title,ce()}return O.object(e)&&"sources"in e&&e.sources.length?(y(st.elements.container,_.classes.ready,!1),ke(),Ye(),De(),Ge(),void Ze(t,!1)):void ot("Invalid source format")}function Qe(e){"video"===st.type&&st.elements.media.setAttribute("poster",e)}function ze(){function n(){var e=we(),t=st.elements.buttons[e?"play":"pause"],n=st.elements.buttons[e?"pause":"play"];if(n=n&&n.length>1?n[n.length-1]:n[0]){var a=b(t,_.classes.tabFocus);setTimeout(function(){n.focus(),a&&(y(t,_.classes.tabFocus,!1),y(n,_.classes.tabFocus,!0))},100)}}function a(){var e=t.activeElement;return e=e&&e!==t.body?t.querySelector(":focus"):null}function s(e){return e.keyCode?e.keyCode:e.which}function i(e){for(var t in st.elements.buttons){var n=st.elements.buttons[t];if(O.nodeList(n))for(var a=0;a0)&&(t?(je(n),a=-1):(Oe(n),a=1)),(e.deltaY>0||e.deltaX<0)&&(t?(Oe(n),a=1):(je(n),a=-1)),(1===a&&st.elements.media.volume<1||a===-1&&st.elements.media.volume>0)&&e.preventDefault()}),M.fullscreen&&k(t,j.eventType,Fe)}function $e(){if(k(st.elements.media,"timeupdate seeking",Be),k(st.elements.media,"timeupdate",se),k(st.elements.media,"durationchange loadedmetadata",He),k(st.elements.media,"ended",function(){"video"===st.type&&_.showPosterOnEnd&&("video"===st.type&&ae(),Ae(),st.elements.media.load())}),k(st.elements.media,"progress playing",Ve),k(st.elements.media,"volumechange",Me),k(st.elements.media,"play pause ended",Ie),k(st.elements.media,"waiting canplay seeked",Re),_.clickToPlay&&"audio"!==st.type){var e=D("."+_.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",k(e,"click",function(){_.hideControls&&st.browser.isTouch&&!st.elements.media.paused||(st.elements.media.paused?he():st.elements.media.ended?(Ae(),he()):ke())})}_.disableContextMenu&&k(st.elements.media,"contextmenu",function(e){e.preventDefault()}),k(st.elements.media,_.events.concat(["keyup","keydown"]).join(" "),function(e){R(st.elements.container,e.type,!0)})}function Ge(){if(l(_.types.html5,st.type)){for(var e=st.elements.media.querySelectorAll("source"),t=0;t