diff options
Diffstat (limited to 'dist/plyr.js')
-rw-r--r-- | dist/plyr.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dist/plyr.js b/dist/plyr.js index c01ce978..0f444b16 100644 --- a/dist/plyr.js +++ b/dist/plyr.js @@ -1 +1,3 @@ -!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,r,a=navigator.userAgent,s=navigator.appName,o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10),l=!1,u=!1,c=!1,d=!1;return-1!==navigator.appVersion.indexOf("Windows NT")&&-1!==navigator.appVersion.indexOf("rv:11")?(l=!0,s="IE",o="11"):-1!==(n=a.indexOf("MSIE"))?(l=!0,s="IE",o=a.substring(n+5)):-1!==(n=a.indexOf("Chrome"))?(c=!0,s="Chrome",o=a.substring(n+7)):-1!==(n=a.indexOf("Safari"))?(d=!0,s="Safari",o=a.substring(n+7),-1!==(n=a.indexOf("Version"))&&(o=a.substring(n+8))):-1!==(n=a.indexOf("Firefox"))?(u=!0,s="Firefox",o=a.substring(n+8)):(e=a.lastIndexOf(" ")+1)<(n=a.lastIndexOf("/"))&&(s=a.substring(e,n),o=a.substring(n+1),s.toLowerCase()===s.toUpperCase()&&(s=navigator.appName)),-1!==(r=o.indexOf(";"))&&(o=o.substring(0,r)),-1!==(r=o.indexOf(" "))&&(o=o.substring(0,r)),i=parseInt(""+o,10),isNaN(i)&&(o=""+parseFloat(navigator.appVersion),i=parseInt(navigator.appVersion,10)),{name:s,version:i,isIE:l,isFirefox:u,isChrome:c,isSafari:d,isIos:/(iPad|iPhone|iPod)/g.test(navigator.platform),isIphone:/(iPhone|iPod)/g.test(navigator.userAgent),isTouch:"ontouchstart"in t.documentElement}}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 a(e){if(!t.querySelectorAll('script[src="'+e+'"]').length){var n=t.createElement("script");n.src=e;var r=t.getElementsByTagName("script")[0];r.parentNode.insertBefore(n,r)}}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 r=n>0?t.cloneNode(!0):t,a=e[n],s=a.parentNode,o=a.nextSibling;return r.appendChild(a),o?s.insertBefore(r,o):s.appendChild(r),r}}function l(e){e&&e.parentNode.removeChild(e)}function u(e,t){e.insertBefore(t,e.firstChild)}function c(e,t){for(var n in t)e.setAttribute(n,O.boolean(t[n])&&t[n]?"":t[n])}function d(e,n,r){var a=t.createElement(e);c(a,r),u(n,a)}function p(e){return e.replace(".","")}function m(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 f(e,t){return!!e&&(e.classList?e.classList.contains(t):new RegExp("(\\s|^)"+t+"(\\s|$)").test(e.className))}function y(e,n){var r=Element.prototype;return(r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(e){return-1!==[].indexOf.call(t.querySelectorAll(e),this)}).call(e,n)}function b(e,t,n,r,a){n&&g(e,t,function(t){n.apply(e,[t])},a),g(e,t,function(t){r.apply(e,[t])},a)}function v(e,t,n,r,a){var s=t.split(" ");if(O.boolean(a)||(a=!1),e instanceof NodeList)for(var o=0;o<e.length;o++)e[o]instanceof Node&&v(e[o],arguments[1],arguments[2],arguments[3]);else for(var i=0;i<s.length;i++)e[r?"addEventListener":"removeEventListener"](s[i],n,a)}function g(e,t,n,r){e&&v(e,t,n,!0,r)}function h(e,t,n,r){e&&v(e,t,n,!1,r)}function k(e,t,n,r){if(e&&t){O.boolean(n)||(n=!1);var a=new CustomEvent(t,{bubbles:n,detail:r});e.dispatchEvent(a)}}function w(e,t){if(e)return t=O.boolean(t)?t:!e.getAttribute("aria-pressed"),e.setAttribute("aria-pressed",t),t}function x(e,t){return 0===e||0===t||isNaN(e)||isNaN(t)?0:(e/t*100).toFixed(2)}function T(){var e=arguments;if(e.length){if(1===e.length)return e[0];for(var t=Array.prototype.shift.call(e),n=e.length,r=0;r<n;r++){var a=e[r];for(var s in a)a[s]&&a[s].constructor&&a[s].constructor===Object?(t[s]=t[s]||{},T(t[s],a[s])):t[s]=a[s]}return t}}function S(e){return e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/)?RegExp.$2:e}function E(e){return e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}function _(){var e={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"",element:null,prefix:""},n="webkit o moz ms khtml".split(" ");if(O.undefined(t.cancelFullScreen))for(var r=0,a=n.length;r<a;r++){if(e.prefix=n[r],!O.undefined(t[e.prefix+"CancelFullScreen"])){e.supportsFullScreen=!0;break}if(!O.undefined(t.msExitFullscreen)&&t.msFullscreenEnabled){e.prefix="ms",e.supportsFullScreen=!0;break}}else e.supportsFullScreen=!0;return e.supportsFullScreen&&(e.fullScreenEventName="ms"===e.prefix?"MSFullscreenChange":e.prefix+"fullscreenchange",e.isFullScreen=function(e){switch(O.undefined(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 O.undefined(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(v,C){function j(e,t,n,r){k(e,t,n,T({},r,{plyr:We}))}function R(t,n){C.debug&&e.console&&(n=Array.prototype.slice.call(n),O.string(C.logPrefix)&&C.logPrefix.length&&n.unshift(C.logPrefix),console[t].apply(console,n))}function V(){return{url:C.iconUrl,absolute:0===C.iconUrl.indexOf("http")||Ye.browser.isIE&&!e.svg4everybody}}function q(){var e=[],t=V(),n=(t.absolute?"":t.url)+"#"+C.iconPrefix;return s(C.controls,"play-large")&&e.push('<button type="button" data-plyr="play" class="plyr__play-large">','<svg><use xlink:href="'+n+'-play" /></svg>','<span class="plyr__sr-only">'+C.i18n.play+"</span>","</button>"),e.push('<div class="plyr__controls">'),s(C.controls,"restart")&&e.push('<button type="button" data-plyr="restart">','<svg><use xlink:href="'+n+'-restart" /></svg>','<span class="plyr__sr-only">'+C.i18n.restart+"</span>","</button>"),s(C.controls,"rewind")&&e.push('<button type="button" data-plyr="rewind">','<svg><use xlink:href="'+n+'-rewind" /></svg>','<span class="plyr__sr-only">'+C.i18n.rewind+"</span>","</button>"),s(C.controls,"play")&&e.push('<button type="button" data-plyr="play">','<svg><use xlink:href="'+n+'-play" /></svg>','<span class="plyr__sr-only">'+C.i18n.play+"</span>","</button>",'<button type="button" data-plyr="pause">','<svg><use xlink:href="'+n+'-pause" /></svg>','<span class="plyr__sr-only">'+C.i18n.pause+"</span>","</button>"),s(C.controls,"fast-forward")&&e.push('<button type="button" data-plyr="fast-forward">','<svg><use xlink:href="'+n+'-fast-forward" /></svg>','<span class="plyr__sr-only">'+C.i18n.forward+"</span>","</button>"),s(C.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>% "+C.i18n.buffered,"</progress>"),C.tooltips.seek&&e.push('<span class="plyr__tooltip">00:00</span>'),e.push("</span>")),s(C.controls,"current-time")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+C.i18n.currentTime+"</span>",'<span class="plyr__time--current">00:00</span>',"</span>"),s(C.controls,"duration")&&e.push('<span class="plyr__time">','<span class="plyr__sr-only">'+C.i18n.duration+"</span>",'<span class="plyr__time--duration">00:00</span>',"</span>"),s(C.controls,"mute")&&e.push('<button type="button" data-plyr="mute">','<svg class="icon--muted"><use xlink:href="'+n+'-muted" /></svg>','<svg><use xlink:href="'+n+'-volume" /></svg>','<span class="plyr__sr-only">'+C.i18n.toggleMute+"</span>","</button>"),s(C.controls,"volume")&&e.push('<span class="plyr__volume">','<label for="volume{id}" class="plyr__sr-only">'+C.i18n.volume+"</label>",'<input id="volume{id}" class="plyr__volume--input" type="range" min="'+C.volumeMin+'" max="'+C.volumeMax+'" value="'+C.volume+'" data-plyr="volume">','<progress class="plyr__volume--display" max="'+C.volumeMax+'" value="'+C.volumeMin+'" role="presentation"></progress>',"</span>"),s(C.controls,"captions")&&e.push('<button type="button" data-plyr="captions">','<svg class="icon--captions-on"><use xlink:href="'+n+'-captions-on" /></svg>','<svg><use xlink:href="'+n+'-captions-off" /></svg>','<span class="plyr__sr-only">'+C.i18n.toggleCaptions+"</span>","</button>"),s(C.controls,"fullscreen")&&e.push('<button type="button" data-plyr="fullscreen">','<svg class="icon--exit-fullscreen"><use xlink:href="'+n+'-exit-fullscreen" /></svg>','<svg><use xlink:href="'+n+'-enter-fullscreen" /></svg>','<span class="plyr__sr-only">'+C.i18n.toggleFullscreen+"</span>","</button>"),e.push("</div>"),e.join("")}function D(){if(Ye.supported.full&&("audio"!==Ye.type||C.fullscreen.allowAudio)&&C.fullscreen.enabled){var e=N.supportsFullScreen;e||C.fullscreen.fallback&&!$()?($e((e?"Native":"Fallback")+" fullscreen enabled"),e||m(Ye.container,C.classes.fullscreen.fallback,!0),m(Ye.container,C.classes.fullscreen.enabled,!0)):$e("Fullscreen not supported and fallback disabled"),Ye.buttons&&Ye.buttons.fullscreen&&w(Ye.buttons.fullscreen,!1),J()}}function H(){if("video"===Ye.type){X(C.selectors.captions)||Ye.videoContainer.insertAdjacentHTML("afterbegin",'<div class="'+p(C.selectors.captions)+'"></div>'),Ye.usingTextTracks=!1,Ye.media.textTracks&&(Ye.usingTextTracks=!0);for(var e,t="",n=Ye.media.childNodes,r=0;r<n.length;r++)"track"===n[r].nodeName.toLowerCase()&&("captions"!==(e=n[r].kind)&&"subtitles"!==e||(t=n[r].getAttribute("src")));if(Ye.captionExists=!0,""===t?(Ye.captionExists=!1,$e("No caption track found")):$e("Caption track found; URI: "+t),Ye.captionExists){for(var a=Ye.media.textTracks,s=0;s<a.length;s++)a[s].mode="hidden";if(Y(),(Ye.browser.isIE&&Ye.browser.version>=10||Ye.browser.isFirefox&&Ye.browser.version>=31)&&($e("Detected browser with known TextTrack issues - using manual fallback"),Ye.usingTextTracks=!1),Ye.usingTextTracks){$e("TextTracks supported");for(var o=0;o<a.length;o++){var i=a[o];"captions"!==i.kind&&"subtitles"!==i.kind||g(i,"cuechange",function(){this.activeCues[0]&&"text"in this.activeCues[0]?U(this.activeCues[0].getCueAsHTML()):U()})}}else if($e("TextTracks not supported so rendering captions manually"),Ye.currentCaption="",Ye.captions=[],""!==t){var l=new XMLHttpRequest;l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status){var e,t=[],n=l.responseText,r="\r\n";-1===n.indexOf(r+r)&&(r=-1!==n.indexOf("\r\r")?"\r":"\n"),t=n.split(r+r);for(var a=0;a<t.length;a++){e=t[a],Ye.captions[a]=[];var s=e.split(r),o=0;-1===s[o].indexOf(":")&&(o=1),Ye.captions[a]=[s[o],s[o+1]]}Ye.captions.shift(),$e("Successfully loaded the caption file via AJAX")}else Je(C.logPrefix+"There was a problem loading the caption file via AJAX")},l.open("get",t,!0),l.send()}}else m(Ye.container,C.classes.captions.enabled)}}function U(e){var n=X(C.selectors.captions),r=t.createElement("span");n.innerHTML="",O.undefined(e)&&(e=""),O.string(e)?r.innerHTML=e.trim():r.appendChild(e),n.appendChild(r);n.offsetHeight}function W(e){function t(e,t){var n=[];n=e.split(" --\x3e ");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,1)}function r(e){if(null===e||void 0===e)return 0;var t=[],n=[];return t=e.split(","),n=t[0].split(":"),Math.floor(60*n[0]*60)+Math.floor(60*n[1])+Math.floor(n[2])}if(!Ye.usingTextTracks&&"video"===Ye.type&&Ye.supported.full&&(Ye.subcount=0,e=O.number(e)?e:Ye.media.currentTime,Ye.captions[Ye.subcount])){for(;n(Ye.captions[Ye.subcount][0])<e.toFixed(1);)if(Ye.subcount++,Ye.subcount>Ye.captions.length-1){Ye.subcount=Ye.captions.length-1;break}Ye.media.currentTime.toFixed(1)>=function(e){return t(e,0)}(Ye.captions[Ye.subcount][0])&&Ye.media.currentTime.toFixed(1)<=n(Ye.captions[Ye.subcount][0])?(Ye.currentCaption=Ye.captions[Ye.subcount][1],U(Ye.currentCaption)):U()}}function Y(){if(Ye.buttons.captions){m(Ye.container,C.classes.captions.enabled,!0);var e=Ye.storage.captionsEnabled;O.boolean(e)||(e=C.captions.defaultActive),e&&(m(Ye.container,C.classes.captions.active,!0),w(Ye.buttons.captions,!0))}}function B(e){return Ye.container.querySelectorAll(e)}function X(e){return B(e)[0]}function $(){try{return e.self!==e.top}catch(e){return!0}}function J(){var e=B("input:not([disabled]), button:not([disabled])"),t=e[0],n=e[e.length-1];g(Ye.container,"keydown",function(e){9===e.which&&Ye.isFullscreen&&(e.target!==n||e.shiftKey?e.target===t&&e.shiftKey&&(e.preventDefault(),n.focus()):(e.preventDefault(),t.focus()))})}function z(e,t){if(O.string(t))d(e,Ye.media,{src:t});else if(t.constructor===Array)for(var n=t.length-1;n>=0;n--)d(e,Ye.media,t[n])}function G(){if(C.loadSprite){var e=V();e.absolute?($e("AJAX loading absolute SVG sprite"+(Ye.browser.isIE?" (due to IE)":"")),F(e.url,"sprite-plyr")):$e("Sprite will be used as external resource directly")}var n=C.html;$e("Injecting custom controls"),n||(n=q()),n=o(n=o(n,"{seektime}",C.seekTime),"{id}",Math.floor(1e4*Math.random())),C.title&&(n=o(n,"{title}",C.title));var r;if(O.string(C.selectors.controls.container)&&(r=t.querySelector(C.selectors.controls.container)),O.htmlElement(r)||(r=Ye.container),r.insertAdjacentHTML("beforeend",n),C.tooltips.controls)for(var a=B([C.selectors.controls.wrapper," ",C.selectors.labels," .",C.classes.hidden].join("")),s=a.length-1;s>=0;s--){var i=a[s];m(i,C.classes.hidden,!1),m(i,C.classes.tooltip,!0)}}function K(){try{return Ye.controls=X(C.selectors.controls.wrapper),Ye.buttons={},Ye.buttons.seek=X(C.selectors.buttons.seek),Ye.buttons.play=B(C.selectors.buttons.play),Ye.buttons.pause=X(C.selectors.buttons.pause),Ye.buttons.restart=X(C.selectors.buttons.restart),Ye.buttons.rewind=X(C.selectors.buttons.rewind),Ye.buttons.forward=X(C.selectors.buttons.forward),Ye.buttons.fullscreen=X(C.selectors.buttons.fullscreen),Ye.buttons.mute=X(C.selectors.buttons.mute),Ye.buttons.captions=X(C.selectors.buttons.captions),Ye.progress={},Ye.progress.container=X(C.selectors.progress.container),Ye.progress.buffer={},Ye.progress.buffer.bar=X(C.selectors.progress.buffer),Ye.progress.buffer.text=Ye.progress.buffer.bar&&Ye.progress.buffer.bar.getElementsByTagName("span")[0],Ye.progress.played=X(C.selectors.progress.played),Ye.progress.tooltip=Ye.progress.container&&Ye.progress.container.querySelector("."+C.classes.tooltip),Ye.volume={},Ye.volume.input=X(C.selectors.volume.input),Ye.volume.display=X(C.selectors.volume.display),Ye.duration=X(C.selectors.duration),Ye.currentTime=X(C.selectors.currentTime),Ye.seekTime=B(C.selectors.seekTime),!0}catch(e){return Je("It looks like there is a problem with your controls HTML"),Z(!0),!1}}function Q(){m(Ye.container,C.selectors.container.replace(".",""),Ye.supported.full)}function Z(e){e&&s(C.types.html5,Ye.type)?Ye.media.setAttribute("controls",""):Ye.media.removeAttribute("controls")}function ee(e){var t=C.i18n.play;if(O.string(C.title)&&C.title.length&&(t+=", "+C.title,Ye.container.setAttribute("aria-label",C.title)),Ye.supported.full&&Ye.buttons.play)for(var n=Ye.buttons.play.length-1;n>=0;n--)Ye.buttons.play[n].setAttribute("aria-label",t);O.htmlElement(e)&&e.setAttribute("title",C.i18n.frameTitle.replace("{title}",C.title))}function te(){var t=null;Ye.storage={},L.supported&&C.storage.enabled&&(e.localStorage.removeItem("plyr-volume"),(t=e.localStorage.getItem(C.storage.key))&&(/^\d+(\.\d+)?$/.test(t)?ne({volume:parseFloat(t)}):Ye.storage=JSON.parse(t)))}function ne(t){L.supported&&C.storage.enabled&&(T(Ye.storage,t),e.localStorage.setItem(C.storage.key,JSON.stringify(Ye.storage)))}function re(){if(Ye.media){if(Ye.supported.full&&(m(Ye.container,C.classes.type.replace("{0}",Ye.type),!0),s(C.types.embed,Ye.type)&&m(Ye.container,C.classes.type.replace("{0}","video"),!0),m(Ye.container,C.classes.stopped,C.autoplay),m(Ye.container,C.classes.isIos,Ye.browser.isIos),m(Ye.container,C.classes.isTouch,Ye.browser.isTouch),"video"===Ye.type)){var e=t.createElement("div");e.setAttribute("class",C.classes.videoWrapper),i(Ye.media,e),Ye.videoContainer=e}s(C.types.embed,Ye.type)&&ae()}else Je("No media element found!")}function ae(){var n,r=t.createElement("div"),s=Ye.type+"-"+Math.floor(1e4*Math.random());switch(Ye.type){case"youtube":n=S(Ye.embedId);break;case"vimeo":n=E(Ye.embedId);break;default:n=Ye.embedId}for(var o=B('[id^="'+Ye.type+'-"]'),i=o.length-1;i>=0;i--)l(o[i]);if(m(Ye.media,C.classes.videoWrapper,!0),m(Ye.media,C.classes.embedWrapper,!0),"youtube"===Ye.type)Ye.media.appendChild(r),r.setAttribute("id",s),O.object(e.YT)?oe(n,r):(a(C.urls.youtube.api),e.onYouTubeReadyCallbacks=e.onYouTubeReadyCallbacks||[],e.onYouTubeReadyCallbacks.push(function(){oe(n,r)}),e.onYouTubeIframeAPIReady=function(){e.onYouTubeReadyCallbacks.forEach(function(e){e()})});else if("vimeo"===Ye.type)if(Ye.supported.full?Ye.media.appendChild(r):r=Ye.media,r.setAttribute("id",s),O.object(e.Vimeo))ie(n,r);else{a(C.urls.vimeo.api);var u=e.setInterval(function(){O.object(e.Vimeo)&&(e.clearInterval(u),ie(n,r))},50)}else if("soundcloud"===Ye.type){var d=t.createElement("iframe");d.loaded=!1,g(d,"load",function(){d.loaded=!0}),c(d,{src:"https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/"+n,id:s}),r.appendChild(d),Ye.media.appendChild(r),e.SC||a(C.urls.soundcloud.api);var p=e.setInterval(function(){e.SC&&d.loaded&&(e.clearInterval(p),le.call(d))},50)}}function se(){Ye.supported.full&&(He(),Ue()),ee(X("iframe"))}function oe(t,n){Ye.embed=new e.YT.Player(n.id,{videoId:t,playerVars:{autoplay:C.autoplay?1:0,controls:Ye.supported.full?0:1,rel:0,showinfo:0,iv_load_policy:3,cc_load_policy:C.captions.defaultActive?1:0,cc_lang_pref:"en",wmode:"transparent",modestbranding:1,disablekb:1,origin:"*"},events:{onError:function(e){j(Ye.container,"error",!0,{code:e.data,embed:e.target})},onReady:function(t){var n=t.target;Ye.media.play=function(){n.playVideo(),Ye.media.paused=!1},Ye.media.pause=function(){n.pauseVideo(),Ye.media.paused=!0},Ye.media.stop=function(){n.stopVideo(),Ye.media.paused=!0},Ye.media.duration=n.getDuration(),Ye.media.paused=!0,Ye.media.currentTime=0,Ye.media.muted=n.isMuted(),"function"==typeof n.getVideoData&&(C.title=n.getVideoData().title),Ye.supported.full&&Ye.media.querySelector("iframe").setAttribute("tabindex","-1"),se(),j(Ye.media,"timeupdate"),j(Ye.media,"durationchange"),e.clearInterval(Be.buffering),Be.buffering=e.setInterval(function(){Ye.media.buffered=n.getVideoLoadedFraction(),(null===Ye.media.lastBuffered||Ye.media.lastBuffered<Ye.media.buffered)&&j(Ye.media,"progress"),Ye.media.lastBuffered=Ye.media.buffered,1===Ye.media.buffered&&(e.clearInterval(Be.buffering),j(Ye.media,"canplaythrough"))},200)},onStateChange:function(t){var n=t.target;switch(e.clearInterval(Be.playing),t.data){case 0:Ye.media.paused=!0,j(Ye.media,"ended");break;case 1:Ye.media.paused=!1,Ye.media.seeking&&j(Ye.media,"seeked"),Ye.media.seeking=!1,j(Ye.media,"play"),j(Ye.media,"playing"),Be.playing=e.setInterval(function(){Ye.media.currentTime=n.getCurrentTime(),j(Ye.media,"timeupdate")},100),Ye.media.duration!==n.getDuration()&&(Ye.media.duration=n.getDuration(),j(Ye.media,"durationchange"));break;case 2:Ye.media.paused=!0,j(Ye.media,"pause")}j(Ye.container,"statechange",!1,{code:t.data})}}})}function ie(n,r){var a=function(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}({loop:C.loop,autoplay:C.autoplay,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0}),s=t.createElement("iframe"),o="https://player.vimeo.com/video/"+n+"?"+a;s.setAttribute("src",o),s.setAttribute("allowfullscreen",""),r.appendChild(s),Ye.embed=new e.Vimeo.Player(s),Ye.media.play=function(){Ye.embed.play(),Ye.media.paused=!1},Ye.media.pause=function(){Ye.embed.pause(),Ye.media.paused=!0},Ye.media.stop=function(){Ye.embed.stop(),Ye.media.paused=!0},Ye.media.paused=!0,Ye.media.currentTime=0,se(),Ye.embed.getCurrentTime().then(function(e){Ye.media.currentTime=e,j(Ye.media,"timeupdate")}),Ye.embed.getDuration().then(function(e){Ye.media.duration=e,j(Ye.media,"durationchange")}),Ye.embed.on("loaded",function(){O.htmlElement(Ye.embed.element)&&Ye.supported.full&&Ye.embed.element.setAttribute("tabindex","-1")}),Ye.embed.on("play",function(){Ye.media.paused=!1,j(Ye.media,"play"),j(Ye.media,"playing")}),Ye.embed.on("pause",function(){Ye.media.paused=!0,j(Ye.media,"pause")}),Ye.embed.on("timeupdate",function(e){Ye.media.seeking=!1,Ye.media.currentTime=e.seconds,j(Ye.media,"timeupdate")}),Ye.embed.on("progress",function(e){Ye.media.buffered=e.percent,j(Ye.media,"progress"),1===parseInt(e.percent)&&j(Ye.media,"canplaythrough")}),Ye.embed.on("seeked",function(){Ye.media.seeking=!1,j(Ye.media,"seeked"),j(Ye.media,"play")}),Ye.embed.on("ended",function(){Ye.media.paused=!0,j(Ye.media,"ended")})}function le(){Ye.embed=e.SC.Widget(this),Ye.embed.bind(e.SC.Widget.Events.READY,function(){Ye.media.play=function(){Ye.embed.play(),Ye.media.paused=!1},Ye.media.pause=function(){Ye.embed.pause(),Ye.media.paused=!0},Ye.media.stop=function(){Ye.embed.seekTo(0),Ye.embed.pause(),Ye.media.paused=!0},Ye.media.paused=!0,Ye.media.currentTime=0,Ye.embed.getDuration(function(e){Ye.media.duration=e/1e3,se()}),Ye.embed.getPosition(function(e){Ye.media.currentTime=e,j(Ye.media,"timeupdate")}),Ye.embed.bind(e.SC.Widget.Events.PLAY,function(){Ye.media.paused=!1,j(Ye.media,"play"),j(Ye.media,"playing")}),Ye.embed.bind(e.SC.Widget.Events.PAUSE,function(){Ye.media.paused=!0,j(Ye.media,"pause")}),Ye.embed.bind(e.SC.Widget.Events.PLAY_PROGRESS,function(e){Ye.media.seeking=!1,Ye.media.currentTime=e.currentPosition/1e3,j(Ye.media,"timeupdate")}),Ye.embed.bind(e.SC.Widget.Events.LOAD_PROGRESS,function(e){Ye.media.buffered=e.loadProgress,j(Ye.media,"progress"),1===parseInt(e.loadProgress)&&j(Ye.media,"canplaythrough")}),Ye.embed.bind(e.SC.Widget.Events.FINISH,function(){Ye.media.paused=!0,j(Ye.media,"ended")})})}function ue(){"play"in Ye.media&&Ye.media.play()}function ce(){"pause"in Ye.media&&Ye.media.pause()}function de(e){return O.boolean(e)||(e=Ye.media.paused),e?ue():ce(),e}function pe(e){O.number(e)||(e=C.seekTime),fe(Ye.media.currentTime-e)}function me(e){O.number(e)||(e=C.seekTime),fe(Ye.media.currentTime+e)}function fe(e){var t=0,n=Ye.media.paused,r=ye();O.number(e)?t=e:O.object(e)&&s(["input","change"],e.type)&&(t=e.target.value/e.target.max*r),t<0?t=0:t>r&&(t=r),Pe(t);try{Ye.media.currentTime=t.toFixed(4)}catch(e){}if(s(C.types.embed,Ye.type)){switch(Ye.type){case"youtube":Ye.embed.seekTo(t);break;case"vimeo":Ye.embed.setCurrentTime(t.toFixed(0));break;case"soundcloud":Ye.embed.seekTo(1e3*t)}n&&ce(),j(Ye.media,"timeupdate"),Ye.media.seeking=!0,j(Ye.media,"seeking")}$e("Seeking to "+Ye.media.currentTime+" seconds"),W(t)}function ye(){var e=parseInt(C.duration),t=0;return null===Ye.media.duration||isNaN(Ye.media.duration)||(t=Ye.media.duration),isNaN(e)?t:e}function be(){m(Ye.container,C.classes.playing,!Ye.media.paused),m(Ye.container,C.classes.stopped,Ye.media.paused),Oe(Ye.media.paused)}function ve(){P={x:e.pageXOffset||0,y:e.pageYOffset||0}}function ge(){e.scrollTo(P.x,P.y)}function he(e){var n=N.supportsFullScreen;if(n){if(!e||e.type!==N.fullScreenEventName)return N.isFullScreen(Ye.container)?N.cancelFullScreen():(ve(),N.requestFullScreen(Ye.container)),void(Ye.isFullscreen=N.isFullScreen(Ye.container));Ye.isFullscreen=N.isFullScreen(Ye.container)}else Ye.isFullscreen=!Ye.isFullscreen,t.body.style.overflow=Ye.isFullscreen?"hidden":"";m(Ye.container,C.classes.fullscreen.active,Ye.isFullscreen),J(Ye.isFullscreen),Ye.buttons&&Ye.buttons.fullscreen&&w(Ye.buttons.fullscreen,Ye.isFullscreen),j(Ye.container,Ye.isFullscreen?"enterfullscreen":"exitfullscreen",!0),!Ye.isFullscreen&&n&&ge()}function ke(e){if(O.boolean(e)||(e=!Ye.media.muted),w(Ye.buttons.mute,e),Ye.media.muted=e,0===Ye.media.volume&&we(C.volume),s(C.types.embed,Ye.type)){switch(Ye.type){case"youtube":Ye.embed[Ye.media.muted?"mute":"unMute"]();break;case"vimeo":case"soundcloud":Ye.embed.setVolume(Ye.media.muted?0:parseFloat(C.volume/C.volumeMax))}j(Ye.media,"volumechange")}}function we(e){var t=C.volumeMax,n=C.volumeMin;if(O.undefined(e)&&(e=Ye.storage.volume),(null===e||isNaN(e))&&(e=C.volume),e>t&&(e=t),e<n&&(e=n),Ye.media.volume=parseFloat(e/t),Ye.volume.display&&(Ye.volume.display.value=e),s(C.types.embed,Ye.type)){switch(Ye.type){case"youtube":Ye.embed.setVolume(100*Ye.media.volume);break;case"vimeo":case"soundcloud":Ye.embed.setVolume(Ye.media.volume)}j(Ye.media,"volumechange")}0===e?Ye.media.muted=!0:Ye.media.muted&&e>0&&ke()}function xe(e){var t=Ye.media.muted?0:Ye.media.volume*C.volumeMax;O.number(e)||(e=C.volumeStep),we(t+e)}function Te(e){var t=Ye.media.muted?0:Ye.media.volume*C.volumeMax;O.number(e)||(e=C.volumeStep),we(t-e)}function Se(){var e=Ye.media.muted?0:Ye.media.volume*C.volumeMax;Ye.supported.full&&(Ye.volume.input&&(Ye.volume.input.value=e),Ye.volume.display&&(Ye.volume.display.value=e)),ne({volume:e}),m(Ye.container,C.classes.muted,0===e),Ye.supported.full&&Ye.buttons.mute&&w(Ye.buttons.mute,0===e)}function Ee(e){Ye.supported.full&&Ye.buttons.captions&&(O.boolean(e)||(e=-1===Ye.container.className.indexOf(C.classes.captions.active)),Ye.captionsEnabled=e,w(Ye.buttons.captions,Ye.captionsEnabled),m(Ye.container,C.classes.captions.active,Ye.captionsEnabled),j(Ye.container,Ye.captionsEnabled?"captionsenabled":"captionsdisabled",!0),ne({captionsEnabled:Ye.captionsEnabled}))}function _e(e){var t="waiting"===e.type;clearTimeout(Be.loading),Be.loading=setTimeout(function(){m(Ye.container,C.classes.loading,t),Oe(t)},t?250:0)}function Ce(e){if(Ye.supported.full){var t=Ye.progress.played,n=0,r=ye();if(e)switch(e.type){case"timeupdate":case"seeking":if(Ye.controls.pressed)return;n=x(Ye.media.currentTime,r),"timeupdate"===e.type&&Ye.buttons.seek&&(Ye.buttons.seek.value=n);break;case"playing":case"progress":t=Ye.progress.buffer,n=function(){var e=Ye.media.buffered;return e&&e.length?x(e.end(0),r):O.number(e)?100*e:0}()}Fe(t,n)}}function Fe(e,t){if(Ye.supported.full){if(O.undefined(t)&&(t=0),O.undefined(e)){if(!Ye.progress||!Ye.progress.buffer)return;e=Ye.progress.buffer}O.htmlElement(e)?e.value=t:e&&(e.bar&&(e.bar.value=t),e.text&&(e.text.innerHTML=t))}}function Ae(e,t){if(t){isNaN(e)&&(e=0),Ye.secs=parseInt(e%60),Ye.mins=parseInt(e/60%60),Ye.hours=parseInt(e/60/60%60);var n=parseInt(ye()/60/60%60)>0;Ye.secs=("0"+Ye.secs).slice(-2),Ye.mins=("0"+Ye.mins).slice(-2),t.innerHTML=(n?Ye.hours+":":"")+Ye.mins+":"+Ye.secs}}function Ie(){if(Ye.supported.full){var e=ye()||0;!Ye.duration&&C.displayDuration&&Ye.media.paused&&Ae(e,Ye.currentTime),Ye.duration&&Ae(e,Ye.duration),Me()}}function Ne(e){Ae(Ye.media.currentTime,Ye.currentTime),e&&"timeupdate"===e.type&&Ye.media.seeking||Ce(e)}function Pe(e){O.number(e)||(e=0);var t=x(e,ye());Ye.progress&&Ye.progress.played&&(Ye.progress.played.value=t),Ye.buttons&&Ye.buttons.seek&&(Ye.buttons.seek.value=t)}function Me(e){var t=ye();if(C.tooltips.seek&&Ye.progress.container&&0!==t){var n=Ye.progress.container.getBoundingClientRect(),r=0,a=C.classes.tooltip+"--visible";if(e)r=100/n.width*(e.pageX-n.left);else{if(!f(Ye.progress.tooltip,a))return;r=Ye.progress.tooltip.style.left.replace("%","")}r<0?r=0:r>100&&(r=100),Ae(t/100*r,Ye.progress.tooltip),Ye.progress.tooltip.style.left=r+"%",e&&s(["mouseenter","mouseleave"],e.type)&&m(Ye.progress.tooltip,a,"mouseenter"===e.type)}}function Oe(t){if(C.hideControls&&"audio"!==Ye.type){var n=0,r=!1,a=t,o=f(Ye.container,C.classes.loading);if(O.boolean(t)||(t&&t.type?(r="enterfullscreen"===t.type,a=s(["mousemove","touchstart","mouseenter","focus"],t.type),s(["mousemove","touchmove"],t.type)&&(n=2e3),"focus"===t.type&&(n=3e3)):a=f(Ye.container,C.classes.hideControls)),e.clearTimeout(Be.hover),a||Ye.media.paused||o){if(m(Ye.container,C.classes.hideControls,!1),Ye.media.paused||o)return;Ye.browser.isTouch&&(n=3e3)}a&&Ye.media.paused||(Be.hover=e.setTimeout(function(){(!Ye.controls.pressed&&!Ye.controls.hover||r)&&m(Ye.container,C.classes.hideControls,!0)},n))}}function Le(e){O.object(e)&&"sources"in e&&e.sources.length?(m(Ye.container,C.classes.ready,!1),ce(),Pe(),Fe(),qe(),De(function(){if(Ye.embed=null,l(Ye.media),"video"===Ye.type&&Ye.videoContainer&&l(Ye.videoContainer),Ye.container&&Ye.container.removeAttribute("class"),"type"in e&&(Ye.type=e.type,"video"===Ye.type)){var n=e.sources[0];"type"in n&&s(C.types.embed,n.type)&&(Ye.type=n.type)}switch(Ye.supported=A(Ye.type),Ye.type){case"video":Ye.media=t.createElement("video");break;case"audio":Ye.media=t.createElement("audio");break;case"youtube":case"vimeo":case"soundcloud":Ye.media=t.createElement("div"),Ye.embedId=e.sources[0].src}u(Ye.container,Ye.media),O.boolean(e.autoplay)&&(C.autoplay=e.autoplay),s(C.types.html5,Ye.type)&&(C.crossorigin&&Ye.media.setAttribute("crossorigin",""),C.autoplay&&Ye.media.setAttribute("autoplay",""),"poster"in e&&Ye.media.setAttribute("poster",e.poster),C.loop&&Ye.media.setAttribute("loop","")),m(Ye.container,C.classes.fullscreen.active,Ye.isFullscreen),m(Ye.container,C.classes.captions.active,Ye.captionsEnabled),Q(),s(C.types.html5,Ye.type)&&z("source",e.sources),re(),s(C.types.html5,Ye.type)&&("tracks"in e&&z("track",e.tracks),Ye.media.load()),(s(C.types.html5,Ye.type)||s(C.types.embed,Ye.type)&&!Ye.supported.full)&&(He(),Ue()),C.title=e.title,ee()},!1)):Je("Invalid source format")}function je(){m(X("."+C.classes.tabFocus),C.classes.tabFocus,!1)}function Re(){function n(){var e=de(),t=Ye.buttons[e?"play":"pause"],n=Ye.buttons[e?"pause":"play"];if(n&&(n=n.length>1?n[n.length-1]:n[0]),n){var r=f(t,C.classes.tabFocus);setTimeout(function(){n.focus(),r&&(m(t,C.classes.tabFocus,!1),m(n,C.classes.tabFocus,!0))},100)}}function r(){var e=t.activeElement;return e=e&&e!==t.body?t.querySelector(":focus"):null}function a(e){return e.keyCode?e.keyCode:e.which}function o(e){for(var t in Ye.buttons){var n=Ye.buttons[t];if(O.nodeList(n))for(var r=0;r<n.length;r++)m(n[r],C.classes.tabFocus,n[r]===e);else m(n,C.classes.tabFocus,n===e)}}function i(e){var t=a(e),n="keydown"===e.type,r=n&&t===u;if(O.number(t))if(n){switch(s([48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67],t)&&(e.preventDefault(),e.stopPropagation()),t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:r||function(){var e=Ye.media.duration;O.number(e)&&fe(e/10*(t-48))}();break;case 32:case 75:r||de();break;case 38:xe();break;case 40:Te();break;case 77:r||ke();break;case 39:me();break;case 37:pe();break;case 70:he();break;case 67:r||Ee()}!N.supportsFullScreen&&Ye.isFullscreen&&27===t&&he(),u=t}else u=null}var l=Ye.browser.isIE?"change":"input";if(C.keyboardShorcuts.focused){var u=null;C.keyboardShorcuts.global&&g(e,"keydown keyup",function(e){var t=a(e),n=r();1!==I().length||!s([48,49,50,51,52,53,54,56,57,75,77,70,67],t)||O.htmlElement(n)&&y(n,C.selectors.editable)||i(e)}),g(Ye.container,"keydown keyup",i)}g(e,"keyup",function(e){var t=a(e),n=r();9===t&&o(n)}),g(t.body,"click",je);for(var c in Ye.buttons){var d=Ye.buttons[c];g(d,"blur",function(){m(d,"tab-focus",!1)})}b(Ye.buttons.play,"click",C.listeners.play,n),b(Ye.buttons.pause,"click",C.listeners.pause,n),b(Ye.buttons.restart,"click",C.listeners.restart,fe),b(Ye.buttons.rewind,"click",C.listeners.rewind,pe),b(Ye.buttons.forward,"click",C.listeners.forward,me),b(Ye.buttons.seek,l,C.listeners.seek,fe),b(Ye.volume.input,l,C.listeners.volume,function(){we(Ye.volume.input.value)}),b(Ye.buttons.mute,"click",C.listeners.mute,ke),b(Ye.buttons.fullscreen,"click",C.listeners.fullscreen,he),N.supportsFullScreen&&g(t,N.fullScreenEventName,he),b(Ye.buttons.captions,"click",C.listeners.captions,Ee),g(Ye.progress.container,"mouseenter mouseleave mousemove",Me),C.hideControls&&(g(Ye.container,"mouseenter mouseleave mousemove touchstart touchend touchcancel touchmove enterfullscreen",Oe),g(Ye.controls,"mouseenter mouseleave",function(e){Ye.controls.hover="mouseenter"===e.type}),g(Ye.controls,"mousedown mouseup touchstart touchend touchcancel",function(e){Ye.controls.pressed=s(["mousedown","touchstart"],e.type)}),g(Ye.controls,"focus blur",Oe,!0)),g(Ye.volume.input,"wheel",function(e){e.preventDefault();var t=e.webkitDirectionInvertedFromDevice,n=C.volumeStep/5;(e.deltaY<0||e.deltaX>0)&&(t?Te(n):xe(n)),(e.deltaY>0||e.deltaX<0)&&(t?xe(n):Te(n))})}function Ve(){if(g(Ye.media,"timeupdate seeking",Ne),g(Ye.media,"timeupdate",W),g(Ye.media,"durationchange loadedmetadata",Ie),g(Ye.media,"ended",function(){"video"===Ye.type&&C.showPosterOnEnd&&("video"===Ye.type&&U(),fe(),Ye.media.load())}),g(Ye.media,"progress playing",Ce),g(Ye.media,"volumechange",Se),g(Ye.media,"play pause ended",be),g(Ye.media,"waiting canplay seeked",_e),C.clickToPlay&&"audio"!==Ye.type){var e=X("."+C.classes.videoWrapper);if(!e)return;e.style.cursor="pointer",g(e,"click",function(){C.hideControls&&Ye.browser.isTouch&&!Ye.media.paused||(Ye.media.paused?ue():Ye.media.ended?(fe(),ue()):ce())})}C.disableContextMenu&&g(Ye.media,"contextmenu",function(e){e.preventDefault()}),g(Ye.media,C.events.concat(["keyup","keydown"]).join(" "),function(e){j(Ye.container,e.type,!0)})}function qe(){if(s(C.types.html5,Ye.type)){for(var e=Ye.media.querySelectorAll("source"),t=0;t<e.length;t++)l(e[t]);Ye.media.setAttribute("src",C.blankUrl),Ye.media.load(),$e("Cancelled network requests")}}function De(n,r){function a(){clearTimeout(Be.cleanUp),O.boolean(r)||(r=!0),O.function(n)&&n.call(Xe),r&&(Ye.init=!1,Ye.container.parentNode.replaceChild(Xe,Ye.container),Ye.container=null,t.body.style.overflow="",h(t.body,"click",je),j(Xe,"destroyed",!0))}if(!Ye.init)return null;switch(Ye.type){case"youtube":e.clearInterval(Be.buffering),e.clearInterval(Be.playing),Ye.embed.destroy(),a();break;case"vimeo":Ye.embed.unload().then(a),Be.cleanUp=e.setTimeout(a,200);break;case"video":case"audio":Z(!0),a()}}function He(){if(!Ye.supported.full)return Je("Basic support only",Ye.type),l(X(C.selectors.controls.wrapper)),l(X(C.selectors.buttons.play)),void Z(!0);var e=!B(C.selectors.controls.wrapper).length;e&&G(),K()&&(e&&Re(),Ve(),Z(),D(),H(),we(),Se(),Ne(),be(),Ie())}function Ue(){e.setTimeout(function(){j(Ye.media,"ready")},0),m(Ye.media,M.classes.setup,!0),m(Ye.container,C.classes.ready,!0),Ye.media.plyr=We,C.autoplay&&ue()}var We,Ye=this,Be={};Ye.media=v;var Xe=v.cloneNode(!0),$e=function(){R("log",arguments)},Je=function(){R("warn",arguments)};return $e("Config",C),We={getOriginal:function(){return Xe},getContainer:function(){return Ye.container},getEmbed:function(){return Ye.embed},getMedia:function(){return Ye.media},getType:function(){return Ye.type},getDuration:ye,getCurrentTime:function(){return Ye.media.currentTime},getVolume:function(){return Ye.media.volume},isMuted:function(){return Ye.media.muted},isReady:function(){return f(Ye.container,C.classes.ready)},isLoading:function(){return f(Ye.container,C.classes.loading)},isPaused:function(){return Ye.media.paused},on:function(e,t){return g(Ye.container,e,t),this},play:ue,pause:ce,stop:function(){ce(),fe()},restart:fe,rewind:pe,forward:me,seek:fe,source:function(e){if(O.undefined(e)){var t;switch(Ye.type){case"youtube":t=Ye.embed.getVideoUrl();break;case"vimeo":Ye.embed.getVideoUrl.then(function(e){t=e});break;case"soundcloud":Ye.embed.getCurrentSound(function(e){t=e.permalink_url});break;default:t=Ye.media.currentSrc}return t||""}Le(e)},poster:function(e){"video"===Ye.type&&Ye.media.setAttribute("poster",e)},setVolume:we,togglePlay:de,toggleMute:ke,toggleCaptions:Ee,toggleFullscreen:he,toggleControls:Oe,isFullscreen:function(){return Ye.isFullscreen||!1},support:function(e){return r(Ye,e)},destroy:De},function(){if(Ye.init)return null;if(N=_(),Ye.browser=n(),O.htmlElement(Ye.media)){te();var e=v.tagName.toLowerCase();"div"===e?(Ye.type=v.getAttribute("data-type"),Ye.embedId=v.getAttribute("data-video-id"),v.removeAttribute("data-type"),v.removeAttribute("data-video-id")):(Ye.type=e,C.crossorigin=null!==v.getAttribute("crossorigin"),C.autoplay=C.autoplay||null!==v.getAttribute("autoplay"),C.loop=C.loop||null!==v.getAttribute("loop")),Ye.supported=A(Ye.type),Ye.supported.basic&&(Ye.container=i(v,t.createElement("div")),Ye.container.setAttribute("tabindex",0),Q(),$e(Ye.browser.name+" "+Ye.browser.version),re(),(s(C.types.html5,Ye.type)||s(C.types.embed,Ye.type)&&!Ye.supported.full)&&(He(),Ue(),ee()),Ye.init=!0)}}(),Ye.init?We:null}function F(e,n){var r=new XMLHttpRequest;if(!O.string(n)||!O.htmlElement(t.querySelector("#"+n))){var a=t.createElement("div");a.setAttribute("hidden",""),O.string(n)&&a.setAttribute("id",n),t.body.insertBefore(a,t.body.childNodes[0]),"withCredentials"in r&&(r.open("GET",e,!0),r.onload=function(){a.innerHTML=r.responseText},r.send())}}function A(e){var r=n(),a=r.isIE&&r.version<=9,s=r.isIos,o=r.isIphone,i=!!t.createElement("audio").canPlayType,l=!!t.createElement("video").canPlayType,u=!1,c=!1;switch(e){case"video":c=(u=l)&&!a&&!o;break;case"audio":c=(u=i)&&!a;break;case"vimeo":u=!0,c=!a&&!s;break;case"youtube":u=!0,c=!a&&!s,s&&!o&&r.version>=10&&(c=!0);break;case"soundcloud":u=!0,c=!a&&!o;break;default:c=(u=i&&l)&&!a}return{basic:u,full:c}}function I(e){if(O.string(e)?e=t.querySelector(e):O.undefined(e)&&(e=t.body),O.htmlElement(e)){var n=e.querySelectorAll("."+M.classes.setup),r=[];return Array.prototype.slice.call(n).forEach(function(e){O.object(e.plyr)&&r.push(e.plyr)}),r}return[]}var N,P={x:0,y:0},M={enabled:!0,debug:!1,autoplay:!1,loop:!1,seekTime:10,volume:10,volumeMin:0,volumeMax:10,volumeStep:1,duration:null,displayDuration:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/2.0.17/plyr.svg",blankUrl:"https://cdn.plyr.io/static/blank.mp4",clickToPlay:!0,hideControls:!0,showPosterOnEnd:!1,disableContextMenu:!0,keyboardShorcuts:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},selectors:{html5:"video, audio",embed:"[data-type]",editable:"input, textarea, select, [contenteditable]",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:{setup:"plyr--setup",ready:"plyr--ready",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",fallback:"plyr--fullscreen-fallback",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://player.vimeo.com/api/player.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:["ready","ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied"],logPrefix:"[Plyr]"},O={object:function(e){return null!==e&&"object"==typeof e},array:function(e){return null!==e&&"object"==typeof e&&e.constructor===Array},number:function(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)},string:function(e){return null!==e&&("string"==typeof e||"object"==typeof e&&e.constructor===String)},boolean:function(e){return null!==e&&"boolean"==typeof e},nodeList:function(e){return null!==e&&e instanceof NodeList},htmlElement:function(e){return null!==e&&e instanceof HTMLElement},function:function(e){return null!==e&&"function"==typeof e},undefined:function(e){return null!==e&&void 0===e}},L={supported:function(){try{e.localStorage.setItem("___test","OK");var t=e.localStorage.getItem("___test");return e.localStorage.removeItem("___test"),"OK"===t}catch(e){return!1}return!1}()};return{setup:function(e,n){function r(e,t){f(t,M.classes.hook)||a.push({target:e,media:t})}var a=[],s=[],o=[M.selectors.html5,M.selectors.embed].join(",");if(O.string(e)?e=t.querySelectorAll(e):O.htmlElement(e)?e=[e]:O.nodeList(e)||O.array(e)||O.string(e)||(O.undefined(n)&&O.object(e)&&(n=e),e=t.querySelectorAll(o)),O.nodeList(e)&&(e=Array.prototype.slice.call(e)),!A().basic||!e.length)return!1;for(var i=0;i<e.length;i++){var l=e[i],u=l.querySelectorAll(o);if(u.length)for(var c=0;c<u.length;c++)r(l,u[c]);else y(l,o)&&r(l,l)}return a.forEach(function(e){var t=e.target,r=e.media,a={};try{a=JSON.parse(t.getAttribute("data-plyr"))}catch(e){}var o=T({},M,n,a);if(!o.enabled)return null;var i=new C(r,o);if(O.object(i)){if(o.debug){var l=o.events.concat(["setup","statechange","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled"]);g(i.getContainer(),l.join(" "),function(e){console.log([o.logPrefix,"event:",e.type].join(" "),e.detail.plyr)})}k(i.getContainer(),"setup",!0,{plyr:i}),s.push(i)}}),s},supported:A,loadSprite:F,get: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}"function"!=typeof window.CustomEvent&&(e.prototype=window.Event.prototype,window.CustomEvent=e)}();
\ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Plyr",t):e.Plyr=t()}(this,function(){"use strict";var e={html5:"html5",youtube:"youtube",vimeo:"vimeo"},t={audio:"audio",video:"video"},i={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:"16:9",clickToPlay:!0,hideControls:!0,showPosterOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/2.0.10/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:"default",options:["hd2160","hd1440","hd1080","hd720","large","medium","small","tiny","default"]},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:window.navigator.language.split("-")[0]},fullscreen:{enabled:!0,fallback:!0},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime} secs",play:"Play",pause:"Pause",forward:"Forward {seektime} secs",seek:"Seek",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",speed:"Speed",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",none:"None",disabled:"Disabled"},urls:{vimeo:{api:"https://player.vimeo.com/api/player.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,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","qualityrequested"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{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"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress--buffer",played:".plyr__progress--played",loop:".plyr__progress--loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",menu:{quality:".js-plyr__menu__list--quality"}},classNames:{video:"plyr__video-wrapper",embed:"plyr__video-embed",control:"plyr__control",type:"plyr--{0}",provider:"plyr--{0}",stopped:"plyr--stopped",playing:"plyr--playing",loading:"plyr--loading",error:"plyr--has-error",hover:"plyr--hover",tooltip:"plyr__tooltip",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus"},keys:{google:null}},n=(function(){function e(e){this.value=e}function t(t){function i(s,a){try{var o=t[s](a),l=o.value;l instanceof e?Promise.resolve(l.value).then(function(e){i("next",e)},function(e){i("throw",e)}):n(o.done?"return":"normal",o.value)}catch(e){n("throw",e)}}function n(e,t){switch(e){case"return":s.resolve({value:t,done:!0});break;case"throw":s.reject(t);break;default:s.resolve({value:t,done:!1})}(s=s.next)?i(s.key,s.arg):a=null}var s,a;this._invoke=function(e,t){return new Promise(function(n,o){var l={key:e,arg:t,resolve:n,reject:o,next:null};a?a=a.next=l:(s=a=l,i(e,t))})},"function"!=typeof t.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(t.prototype[Symbol.asyncIterator]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),s=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},o={is:{plyr:function(e){return this.instanceof(e,Plyr)},object:function(e){return this.getConstructor(e)===Object},number:function(e){return this.getConstructor(e)===Number&&!Number.isNaN(e)},string:function(e){return this.getConstructor(e)===String},boolean:function(e){return this.getConstructor(e)===Boolean},function:function(e){return this.getConstructor(e)===Function},array:function(e){return!this.nullOrUndefined(e)&&Array.isArray(e)},weakMap:function(e){return this.instanceof(e,window.WeakMap)},nodeList:function(e){return this.instanceof(e,window.NodeList)},element:function(e){return this.instanceof(e,window.Element)},textNode:function(e){return this.getConstructor(e)===Text},event:function(e){return this.instanceof(e,window.Event)},cue:function(e){return this.instanceof(e,window.TextTrackCue)||this.instanceof(e,window.VTTCue)},track:function(e){return this.instanceof(e,TextTrack)||!this.nullOrUndefined(e)&&this.string(e.kind)},nullOrUndefined:function(e){return null===e||void 0===e},empty:function(e){return this.nullOrUndefined(e)||(this.string(e)||this.array(e)||this.nodeList(e))&&!e.length||this.object(e)&&!Object.keys(e).length},instanceof:function(e,t){return Boolean(e&&t&&e instanceof t)},getConstructor:function(e){return this.nullOrUndefined(e)?null:e.constructor}},getBrowser:function(){return{isIE:!!document.documentMode,isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:/(iPad|iPhone|iPod)/gi.test(navigator.platform)}},loadScript:function(e,t){var i=document.querySelector('script[src="'+e+'"]');if(null!==i)return i.callbacks=i.callbacks||[],void i.callbacks.push(t);var n=document.createElement("script");n.callbacks=n.callbacks||[],n.callbacks.push(t),o.is.function(t)&&n.addEventListener("load",function(e){n.callbacks.forEach(function(t){return t.call(null,e)}),n.callbacks=null},!1),n.src=e;var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(n,s)},loadSprite:function(e,t){function i(e){this.innerHTML=e,document.body.insertBefore(this,document.body.childNodes[0])}if(o.is.string(e)){var n=o.is.string(t);if(!n||!document.querySelectorAll("#"+t).length){var s=document.createElement("div");if(o.toggleHidden(s,!0),n&&s.setAttribute("id",t),l.storage){var a=window.localStorage.getItem("cache-"+t);if(null!==a){var r=JSON.parse(a);return void i.call(s,r.content)}}fetch(e).then(function(e){return e.ok?e.text():null}).then(function(e){null!==e&&(l.storage&&window.localStorage.setItem("cache-"+t,JSON.stringify({content:e})),i.call(s,e))}).catch(function(){})}}},generateId:function(e){return e+"-"+Math.floor(1e4*Math.random())},inFrame:function(){try{return window.self!==window.top}catch(e){return!0}},wrap:function(e,t){var i=e.length?e:[e];Array.from(i).reverse().forEach(function(e,i){var n=i>0?t.cloneNode(!0):t,s=e.parentNode,a=e.nextSibling;n.appendChild(e),a?s.insertBefore(n,a):s.appendChild(n)})},createElement:function(e,t,i){var n=document.createElement(e);return o.is.object(t)&&o.setAttributes(n,t),o.is.string(i)&&(n.textContent=i),n},insertAfter:function(e,t){t.parentNode.insertBefore(e,t.nextSibling)},insertElement:function(e,t,i,n){t.appendChild(o.createElement(e,i,n))},removeElement:function(e){return o.is.element(e)&&o.is.element(e.parentNode)?(e.parentNode.removeChild(e),e):null},emptyElement:function(e){for(var t=e.childNodes.length;t>0;)e.removeChild(e.lastChild),t-=1},setAttributes:function(e,t){o.is.element(e)&&!o.is.empty(t)&&Object.keys(t).forEach(function(i){e.setAttribute(i,t[i])})},getAttributesFromSelector:function(e,t){if(!o.is.string(e)||o.is.empty(e))return{};var i={},n=t;return e.split(",").forEach(function(e){var t=e.trim(),s=t.replace(".",""),a=t.replace(/[[\]]/g,"").split("="),l=a[0],r=a.length>1?a[1].replace(/["']/g,""):"";switch(t.charAt(0)){case".":o.is.object(n)&&o.is.string(n.class)&&(n.class+=" "+s),i.class=s;break;case"#":i.id=t.replace("#","");break;case"[":i[l]=r}}),i},toggleClass:function(e,t,i){if(o.is.element(e)){var n=e.classList.contains(t);return e.classList[i?"add":"remove"](t),i&&!n||!i&&n}return null},hasClass:function(e,t){return o.is.element(e)&&e.classList.contains(t)},toggleHidden:function(e,t){o.is.element(e)&&(t?e.setAttribute("hidden",""):e.removeAttribute("hidden"))},matches:function(e,t){var i={Element:Element},n=i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(t)).includes(this)};return n.call(e,t)},getElements:function(e){return this.elements.container.querySelectorAll(e)},getElement:function(e){return this.elements.container.querySelector(e)},findElements:function(){try{return this.elements.controls=o.getElement.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:o.getElements.call(this,this.config.selectors.buttons.play),pause:o.getElement.call(this,this.config.selectors.buttons.pause),restart:o.getElement.call(this,this.config.selectors.buttons.restart),rewind:o.getElement.call(this,this.config.selectors.buttons.rewind),forward:o.getElement.call(this,this.config.selectors.buttons.forward),mute:o.getElement.call(this,this.config.selectors.buttons.mute),pip:o.getElement.call(this,this.config.selectors.buttons.pip),airplay:o.getElement.call(this,this.config.selectors.buttons.airplay),settings:o.getElement.call(this,this.config.selectors.buttons.settings),captions:o.getElement.call(this,this.config.selectors.buttons.captions),fullscreen:o.getElement.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=o.getElement.call(this,this.config.selectors.progress),this.elements.inputs={seek:o.getElement.call(this,this.config.selectors.inputs.seek),volume:o.getElement.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:o.getElement.call(this,this.config.selectors.display.buffer),duration:o.getElement.call(this,this.config.selectors.display.duration),currentTime:o.getElement.call(this,this.config.selectors.display.currentTime)},o.is.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector("."+this.config.classNames.tooltip)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},getFocusElement:function(){var e=document.activeElement;return e=e&&e!==document.body?document.querySelector(":focus"):null},trapFocus:function(){var e=this,t=o.getElements.call(this,"button:not(:disabled), input:not(:disabled), [tabindex]"),i=t[0],n=t[t.length-1];o.on(this.elements.container,"keydown",function(t){if("Tab"===t.key&&9===t.keyCode&&e.fullscreen.active){var s=o.getFocusElement();s!==n||t.shiftKey?s===i&&t.shiftKey&&(n.focus(),t.preventDefault()):(i.focus(),t.preventDefault())}},!1)},toggleListener:function(e,t,i,n,s,a){if(!o.is.nullOrUndefined(e))if(o.is.nodeList(e))Array.from(e).forEach(function(e){e instanceof Node&&o.toggleListener.call(null,e,t,i,n,s,a)});else{var r=t.split(" "),c=!!o.is.boolean(a)&&a;l.passiveListeners&&(c={passive:!o.is.boolean(s)||s,capture:!!o.is.boolean(a)&&a}),r.forEach(function(t){e[n?"addEventListener":"removeEventListener"](t,i,c)})}},on:function(e,t,i,n,s){o.toggleListener(e,t,i,!0,n,s)},off:function(e,t,i,n,s){o.toggleListener(e,t,i,!1,n,s)},dispatchEvent:function(e,t,i,n){if(e&&t){var s=new CustomEvent(t,{bubbles:!!o.is.boolean(i)&&i,detail:Object.assign({},n,{plyr:this instanceof Plyr?this:null})});e.dispatchEvent(s)}},toggleState:function(e,t){if(o.is.element(e)){var i="true"===e.getAttribute("aria-pressed"),n=o.is.boolean(t)?t:!i;e.setAttribute("aria-pressed",n)}},getPercentage:function(e,t){return 0===e||0===t||Number.isNaN(e)||Number.isNaN(t)?0:(e/t*100).toFixed(2)},extend:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(!i.length)return e;var s=i.shift();return o.is.object(s)?(Object.keys(s).forEach(function(t){o.is.object(s[t])?(Object.keys(e).includes(t)||Object.assign(e,a({},t,{})),o.extend(e[t],s[t])):Object.assign(e,a({},t,s[t]))}),o.extend.apply(o,[e].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t<e.length;t++)i[t]=e[t];return i}return Array.from(e)}(i)))):e},parseYouTubeId:function(e){return e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e},parseVimeoId:function(e){if(o.is.number(Number(e)))return e;return e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e},buildUrlParameters:function(e){return o.is.object(e)?Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&"):""},stripHTML:function(e){var t=document.createDocumentFragment(),i=document.createElement("div");return t.appendChild(i),i.innerHTML=e,t.firstChild.innerText},getAspectRatio:function(e,t){var i=function e(t,i){return 0===i?t:e(i,t%i)}(e,t);return e/i+":"+t/i},transitionEnd:function(){var e=document.createElement("span"),t=Object.keys({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"}).find(function(t){return void 0!==e.style[t]});return"string"==typeof t&&t}(),repaint:function(e){window.setTimeout(function(){e.setAttribute("hidden",""),e.offsetHeight,e.removeAttribute("hidden")},0)}},l={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check:function(e,t,i){var n=!1,s=!1,a=o.getBrowser(),r=a.isIPhone&&i&&l.inline;switch(t+":"+e){case"html5:video":s=(n=l.video)&&l.rangeInput&&(!a.isIPhone||r);break;case"html5:audio":s=(n=l.audio)&&l.rangeInput;break;case"youtube:video":n=!0,s=l.rangeInput&&(!a.isIPhone||r);break;case"vimeo:video":n=!0,s=l.rangeInput&&!a.isIPhone;break;default:s=(n=l.audio&&l.video)&&l.rangeInput}return{api:n,ui:s}},pip:!o.getBrowser().isIPhone&&o.is.function(o.createElement("video").webkitSetPresentationMode),airplay:o.is.function(window.WebKitPlaybackTargetAvailabilityEvent),inline:"playsInline"in document.createElement("video"),mime:function(e){var t=this.media;try{if(!this.isHTML5||!o.is.function(t.canPlayType))return!1;if(this.isVideo)switch(e){case"video/webm":return t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/no/,"");case"video/mp4":return t.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/,"");case"video/ogg":return t.canPlayType('video/ogg; codecs="theora"').replace(/no/,"");default:return!1}else if(this.isAudio)switch(e){case"audio/mpeg":return t.canPlayType("audio/mpeg;").replace(/no/,"");case"audio/ogg":return t.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/,"");case"audio/wav":return t.canPlayType('audio/wav; codecs="1"').replace(/no/,"");default:return!1}}catch(e){return!1}return!1},textTracks:"textTracks"in document.createElement("video"),passiveListeners:function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0,null}});window.addEventListener("test",null,t)}catch(e){}return e}(),rangeInput:function(){var e=document.createElement("input");return e.type="range","range"===e.type}(),touch:"ontouchstart"in document.documentElement,transitions:!1!==o.transitionEnd,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},r=function(){},c=function(){function e(t){n(this,e),this.enabled=window.console&&t.config.debug,this.enabled&&this.log("Debugging enabled")}return s(e,[{key:"log",get:function(){return this.enabled?Function.prototype.bind.call(console.log,console):r}},{key:"warn",get:function(){return this.enabled?Function.prototype.bind.call(console.warn,console):r}},{key:"error",get:function(){return this.enabled?Function.prototype.bind.call(console.error,console):r}}]),e}(),u=function(){function e(t){n(this,e),this.enabled=t.config.storage.enabled,this.key=t.config.storage.key}return s(e,[{key:"get",value:function(t){var i=window.localStorage.getItem(this.key);if(!e.supported||o.is.empty(i))return null;var n=JSON.parse(i);return o.is.string(t)&&t.length?n[t]:n}},{key:"set",value:function(t){if(e.supported&&this.enabled&&o.is.object(t)){var i=this.get();o.extend(i,t),window.localStorage.setItem(this.key,JSON.stringify(i))}}}],[{key:"supported",get:function(){if(!("localStorage"in window))return!1;try{return window.localStorage.setItem("___test","___test"),window.localStorage.removeItem("___test"),!0}catch(e){return!1}}}]),e}(),d=function(){var e=!1;return o.is.function(document.cancelFullScreen)?e="":["webkit","o","moz","ms","khtml"].some(function(t){return o.is.function(document[t+"CancelFullScreen"])?(e=t,!0):!(!o.is.function(document.msExitFullscreen)||!document.msFullscreenEnabled)&&(e="ms",!0)}),e}(),p={prefix:d,enabled:document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled,eventType:"ms"===d?"MSFullscreenChange":d+"fullscreenchange",isFullScreen:function(e){if(!p.enabled)return!1;var t=o.is.nullOrUndefined(e)?document.body:e;switch(d){case"":return document.fullscreenElement===t;case"moz":return document.mozFullScreenElement===t;default:return document[d+"FullscreenElement"]===t}},requestFullScreen:function(e){if(!p.enabled)return!1;var t=o.is.nullOrUndefined(e)?document.body:e;return d.length?t[d+("ms"===d?"RequestFullscreen":"RequestFullScreen")]():t.requestFullScreen()},cancelFullScreen:function(){return!!p.enabled&&(d.length?document[d+("ms"===d?"ExitFullscreen":"CancelFullScreen")]():document.cancelFullScreen())},element:function(){return p.enabled?d.length?document[d+"FullscreenElement"]:document.fullscreenElement:null},setup:function(){if(this.supported.ui&&!this.isAudio&&this.config.fullscreen.enabled){var e=p.enabled;e||this.config.fullscreen.fallback&&!o.inFrame()?(this.debug.log((e?"Native":"Fallback")+" fullscreen enabled"),o.toggleClass(this.elements.container,this.config.classNames.fullscreen.enabled,!0)):this.debug.log("Fullscreen not supported and fallback disabled"),this.elements.buttons&&this.elements.buttons.fullscreen&&o.toggleState(this.elements.buttons.fullscreen,!1),o.trapFocus.call(this)}}},h=o.getBrowser(),m={global:function(){var e=this,t=null,i=function(i){var n=function(e){return e.keyCode?e.keyCode:e.which}(i),s="keydown"===i.type,a=s&&n===t;if(!(i.altKey||i.ctrlKey||i.metaKey||i.shiftKey)&&o.is.number(n)){if(s){var l=[48,49,50,51,52,53,54,56,57,32,75,38,40,77,39,37,70,67,73,76,79],r=o.getFocusElement();if(o.is.element(r)&&o.matches(r,e.config.selectors.editable))return;switch(l.includes(n)&&(i.preventDefault(),i.stopPropagation()),n){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:a||(e.currentTime=e.duration/10*(n-48));break;case 32:case 75:a||e.togglePlay();break;case 38:e.increaseVolume(.1);break;case 40:e.decreaseVolume(.1);break;case 77:a||(e.muted=!e.muted);break;case 39:e.forward();break;case 37:e.rewind();break;case 70:e.toggleFullscreen();break;case 67:a||e.toggleCaptions();break;case 76:e.loop=!e.loop}!p.enabled&&e.fullscreen.active&&27===n&&e.toggleFullscreen(),t=n}else t=null}};this.config.keyboard.global?o.on(window,"keydown keyup",i,!1):this.config.keyboard.focused&&o.on(this.elements.container,"keydown keyup",i,!1),o.on(this.elements.container,"focusout",function(t){o.toggleClass(t.target,e.config.classNames.tabFocus,!1)}),o.on(this.elements.container,"keydown",function(t){9===t.keyCode&&window.setTimeout(function(){o.toggleClass(o.getFocusElement(),e.config.classNames.tabFocus,!0)},0)}),this.config.hideControls&&o.on(this.elements.container,"mouseenter mouseleave mousemove touchstart touchend touchmove enterfullscreen exitfullscreen",function(t){e.toggleControls(t)}),p.enabled&&(o.on(document,p.eventType,function(t){e.toggleFullscreen(t)}),o.on(this.elements.container,"dblclick",function(t){e.toggleFullscreen(t)}))},media:function(){var e=this;if(o.on(this.media,"timeupdate seeking",function(t){return g.timeUpdate.call(e,t)}),o.on(this.media,"durationchange loadedmetadata",function(t){return g.durationUpdate.call(e,t)}),o.on(this.media,"loadeddata",function(){o.toggleHidden(e.elements.volume,!e.hasAudio),o.toggleHidden(e.elements.buttons.mute,!e.hasAudio)}),o.on(this.media,"ended",function(){e.isHTML5&&e.isVideo&&e.config.showPosterOnEnd&&(e.restart(),e.media.load())}),o.on(this.media,"progress playing",function(t){return g.updateProgress.call(e,t)}),o.on(this.media,"volumechange",function(t){return g.updateVolume.call(e,t)}),o.on(this.media,"playing play pause ended",function(t){return g.checkPlaying.call(e,t)}),o.on(this.media,"stalled waiting canplay seeked playing",function(t){return g.checkLoading.call(e,t)}),this.supported.ui&&this.config.clickToPlay&&!this.isAudio){var t=o.getElement.call(this,"."+this.config.classNames.video);if(!o.is.element(t))return;o.on(t,"click",function(){e.config.hideControls&&l.touch&&!e.paused||(e.paused?e.play():e.ended?(e.restart(),e.play()):e.pause())})}this.supported.ui&&this.config.disableContextMenu&&o.on(this.media,"contextmenu",function(e){e.preventDefault()},!1),o.on(this.media,"volumechange",function(){e.storage.set({volume:e.volume,muted:e.muted})}),o.on(this.media,"ratechange",function(){y.updateSetting.call(e,"speed"),e.storage.set({speed:e.speed})}),o.on(this.media,"qualitychange",function(){y.updateSetting.call(e,"quality"),e.storage.set({quality:e.quality})}),o.on(this.media,"languagechange",function(){y.updateSetting.call(e,"captions"),e.storage.set({language:e.language})}),o.on(this.media,"captionsenabled captionsdisabled",function(){y.updateSetting.call(e,"captions"),e.storage.set({captions:e.captions.active})}),o.on(this.media,this.config.events.concat(["keyup","keydown"]).join(" "),function(t){var i={};"error"===t.type&&(i=e.media.error),o.dispatchEvent.call(e,e.elements.container,t.type,!0,i)})},controls:function(){var e=this,t=h.isIE?"change":"input",i=function(t,i,n){var s=e.config.listeners[i];o.is.function(s)&&s.call(e,t),!t.defaultPrevented&&o.is.function(n)&&n.call(e,t)};o.on(this.elements.buttons.play,"click",function(t){return i(t,"play",function(){e.togglePlay()})}),o.on(this.elements.buttons.restart,"click",function(t){return i(t,"restart",function(){e.restart()})}),o.on(this.elements.buttons.rewind,"click",function(t){return i(t,"rewind",function(){e.rewind()})}),o.on(this.elements.buttons.forward,"click",function(t){return i(t,"forward",function(){e.forward()})}),o.on(this.elements.buttons.mute,"click",function(t){return i(t,"mute",function(){e.muted=!e.muted})}),o.on(this.elements.buttons.captions,"click",function(t){return i(t,"captions",function(){e.toggleCaptions()})}),o.on(this.elements.buttons.fullscreen,"click",function(t){return i(t,"fullscreen",function(){e.toggleFullscreen()})}),o.on(this.elements.buttons.pip,"click",function(t){return i(t,"pip",function(){e.pip="toggle"})}),o.on(this.elements.buttons.airplay,"click",function(t){return i(t,"airplay",function(){e.airplay()})}),o.on(this.elements.buttons.settings,"click",function(t){y.toggleMenu.call(e,t)}),o.on(document.documentElement,"click",function(t){y.toggleMenu.call(e,t)}),o.on(this.elements.settings.form,"click",function(t){t.stopPropagation(),o.matches(t.target,e.config.selectors.inputs.language)?i(t,"language",function(){e.language=t.target.value}):o.matches(t.target,e.config.selectors.inputs.quality)?i(t,"quality",function(){e.quality=t.target.value}):o.matches(t.target,e.config.selectors.inputs.speed)?i(t,"speed",function(){e.speed=parseFloat(t.target.value)}):y.showTab.call(e,t)}),o.on(this.elements.inputs.seek,t,function(t){return i(t,"seek",function(){e.currentTime=t.target.value/t.target.max*e.duration})}),this.config.toggleInvert&&!o.is.element(this.elements.display.duration)&&o.on(this.elements.display.currentTime,"click",function(){0!==e.currentTime&&(e.config.invertTime=!e.config.invertTime,g.timeUpdate.call(e))}),o.on(this.elements.inputs.volume,t,function(t){return i(t,"volume",function(){e.volume=t.target.value})}),h.isWebkit&&o.on(o.getElements.call(this,'input[type="range"]'),"input",function(t){y.updateRangeFill.call(e,t.target)}),o.on(this.elements.progress,"mouseenter mouseleave mousemove",function(t){return y.updateSeekTooltip.call(e,t)}),this.config.hideControls&&(o.on(this.elements.controls,"mouseenter mouseleave",function(t){e.elements.controls.hover="mouseenter"===t.type}),o.on(this.elements.controls,"mousedown mouseup touchstart touchend touchcancel",function(t){e.elements.controls.pressed=["mousedown","touchstart"].includes(t.type)}),o.on(this.elements.controls,"focusin focusout",function(t){e.toggleControls(t)})),o.on(this.elements.inputs.volume,"wheel",function(t){return i(t,"volume",function(){var i=t.webkitDirectionInvertedFromDevice,n=0;(t.deltaY<0||t.deltaX>0)&&(i?(e.decreaseVolume(.02),n=-1):(e.increaseVolume(.02),n=1)),(t.deltaY>0||t.deltaX<0)&&(i?(e.increaseVolume(.02),n=1):(e.decreaseVolume(.02),n=-1)),(1===n&&e.media.volume<1||-1===n&&e.media.volume>0)&&t.preventDefault()})},!1)}},g={addStyleHook:function(){o.toggleClass(this.elements.container,this.config.selectors.container.replace(".",""),!0),o.toggleClass(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build:function(){if(m.media.call(this),!this.supported.ui)return this.debug.warn("Basic support only for "+this.provider+" "+this.type),o.removeElement.call(this,"controls"),o.removeElement.call(this,"buttons.play"),void g.toggleNativeControls.call(this,!0);o.is.element(this.elements.controls)||(y.inject.call(this),m.controls.call(this)),o.is.element(this.elements.controls)&&(g.toggleNativeControls.call(this),p.setup.call(this),b.setup.call(this),this.volume=null,this.muted=null,this.speed=null,this.loop=null,this.options.quality=[],g.timeUpdate.call(this),g.checkPlaying.call(this),this.ready=!0,o.dispatchEvent.call(this,this.media,"ready"),g.setTitle.call(this))},setTitle:function(){var e=this.config.i18n.play;if(o.is.string(this.config.title)&&!o.is.empty(this.config.title)&&(e+=", "+this.config.title,this.elements.container.setAttribute("aria-label",this.config.title)),o.is.nodeList(this.elements.buttons.play)&&Array.from(this.elements.buttons.play).forEach(function(t){t.setAttribute("aria-label",e)}),this.isEmbed){var t=o.getElement.call(this,"iframe");if(!o.is.element(t))return;var i=o.is.empty(this.config.title)?"video":this.config.title;t.setAttribute("title",this.config.i18n.frameTitle.replace("{title}",i))}},checkPlaying:function(){var e=this;o.toggleClass(this.elements.container,this.config.classNames.playing,this.playing),o.toggleClass(this.elements.container,this.config.classNames.stopped,this.paused),o.is.nodeList(this.elements.buttons.play)&&Array.from(this.elements.buttons.play).forEach(function(t){return o.toggleState(t,e.playing)}),this.toggleControls(!this.playing)},checkLoading:function(e){var t=this;this.loading=2===this.media.networkState||["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(function(){o.toggleClass(t.elements.container,t.config.classNames.loading,t.loading),t.toggleControls(t.loading)},this.loading?250:0)},checkFailed:function(){var e=this;this.failed=3===this.media.networkState,this.failed&&(o.toggleClass(this.elements.container,this.config.classNames.loading,!1),o.toggleClass(this.elements.container,this.config.classNames.error,!0)),clearTimeout(this.timers.failed),this.timers.loading=setTimeout(function(){o.toggleClass(e.elements.container,e.config.classNames.loading,e.loading),e.toggleControls(e.loading)},this.loading?250:0)},updateVolume:function(){this.supported.ui&&(o.is.element(this.elements.inputs.volume)&&g.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),o.is.element(this.elements.buttons.mute)&&o.toggleState(this.elements.buttons.mute,this.muted||0===this.volume))},setRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o.is.element(e)&&(e.value=t,y.updateRangeFill.call(this,e))},setProgress:function(e,t){var i=o.is.number(t)?t:0,n=o.is.element(e)?e:this.elements.display.buffer;if(o.is.element(n)){n.value=i;var s=n.getElementsByTagName("span")[0];o.is.element(s)&&(s.childNodes[0].nodeValue=i)}},updateProgress:function(e){var t=this;if(this.supported.ui&&o.is.event(e)){var i=0;if(e)switch(e.type){case"timeupdate":case"seeking":i=o.getPercentage(this.currentTime,this.duration),"timeupdate"===e.type&&g.setRange.call(this,this.elements.inputs.seek,i);break;case"playing":case"progress":i=function(){var e=t.media.buffered;return e&&e.length?o.getPercentage(e.end(0),t.duration):o.is.number(e)?100*e:0}(),g.setProgress.call(this,this.elements.display.buffer,i)}}},updateTimeDisplay:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(o.is.element(e)&&o.is.number(t)){var n=function(e){return("0"+e).slice(-2)},s=function(e){return parseInt(e/60/60%60,10)},a=s(t),l=function(e){return parseInt(e/60%60,10)}(t),r=function(e){return parseInt(e%60,10)}(t);s(this.duration)>0?a+=":":a="",e.textContent=(i?"-":"")+a+n(l)+":"+n(r)}},timeUpdate:function(e){var t=!o.is.element(this.elements.display.duration)&&this.config.invertTime;g.updateTimeDisplay.call(this,this.elements.display.currentTime,t?this.duration-this.currentTime:this.currentTime,t),e&&"timeupdate"===e.type&&this.media.seeking||g.updateProgress.call(this,e)},durationUpdate:function(){this.supported.ui&&(!o.is.element(this.elements.display.duration)&&this.config.displayDuration&&this.paused&&g.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),o.is.element(this.elements.display.duration)&&g.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),y.updateSeekTooltip.call(this))}},f=o.getBrowser(),y={updateRangeFill:function(e){if(f.isWebkit){var t=o.is.event(e)?e.target:e;if(o.is.element(t)&&"range"===t.getAttribute("type")){o.is.element(this.elements.styleSheet)||(this.elements.styleSheet=o.createElement("style"),this.elements.container.appendChild(this.elements.styleSheet));var i=this.elements.styleSheet.sheet,n=t.value/t.max*100,s="#"+t.id+"::-webkit-slider-runnable-track",a="{ background-image: linear-gradient(to right, currentColor "+n+"%, transparent "+n+"%) }",l=Array.from(i.rules).findIndex(function(e){return e.selectorText===s});-1!==l&&i.deleteRule(l),i.insertRule([s,a].join(" "))}}},getIconUrl:function(){return{url:this.config.iconUrl,absolute:0===this.config.iconUrl.indexOf("http")||f.isIE&&!window.svg4everybody}},createIcon:function(e,t){var i="http://www.w3.org/2000/svg",n=y.getIconUrl.call(this),s=(n.absolute?"":n.url)+"#"+this.config.iconPrefix,a=document.createElementNS(i,"svg");o.setAttributes(a,o.extend(t,{role:"presentation"}));var l=document.createElementNS(i,"use"),r=s+"-"+e;return"href"in l?l.setAttributeNS("http://www.w3.org/1999/xlink","href",r):l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r),a.appendChild(l),a},createLabel:function(e,t){var i=this.config.i18n[e],n=Object.assign({},t);switch(e){case"pip":i="PIP";break;case"airplay":i="AirPlay"}return"class"in n?n.class+=" "+this.config.classNames.hidden:n.class=this.config.classNames.hidden,o.createElement("span",n,i)},createBadge:function(e){if(o.is.empty(e))return null;var t=o.createElement("span",{class:this.config.classNames.menu.value});return t.appendChild(o.createElement("span",{class:this.config.classNames.menu.badge},e)),t},createButton:function(e,t){var i=o.createElement("button"),n=Object.assign({},t),s=e,a=!1,l=void 0,r=void 0,c=void 0,u=void 0;switch("type"in n||(n.type="button"),"class"in n?n.class.includes(this.config.classNames.control)&&(n.class+=" "+this.config.classNames.control):n.class=this.config.classNames.control,s){case"play":a=!0,l="play",c="pause",r="play",u="pause";break;case"mute":a=!0,l="mute",c="unmute",r="volume",u="muted";break;case"captions":a=!0,l="enableCaptions",c="disableCaptions",r="captions-off",u="captions-on";break;case"fullscreen":a=!0,l="enterFullscreen",c="exitFullscreen",r="enter-fullscreen",u="exit-fullscreen";break;case"play-large":n.class+=" "+this.config.classNames.control+"--overlaid",s="play",l="play",r="play";break;default:l=s,r=s}return a?(i.appendChild(y.createIcon.call(this,u,{class:"icon--pressed"})),i.appendChild(y.createIcon.call(this,r,{class:"icon--not-pressed"})),i.appendChild(y.createLabel.call(this,c,{class:"label--pressed"})),i.appendChild(y.createLabel.call(this,l,{class:"label--not-pressed"})),n["aria-pressed"]=!1,n["aria-label"]=this.config.i18n[l]):(i.appendChild(y.createIcon.call(this,r)),i.appendChild(y.createLabel.call(this,l))),o.extend(n,o.getAttributesFromSelector(this.config.selectors.buttons[s],n)),o.setAttributes(i,n),this.elements.buttons[s]=i,i},createRange:function(e,t){var i=o.createElement("label",{for:t.id,class:this.config.classNames.hidden},this.config.i18n[e]),n=o.createElement("input",o.extend(o.getAttributesFromSelector(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off"},t));return this.elements.inputs[e]=n,y.updateRangeFill.call(this,n),{label:i,input:n}},createProgress:function(e,t){var i=o.createElement("progress",o.extend(o.getAttributesFromSelector(this.config.selectors.display[e]),{min:0,max:100,value:0},t));if("volume"!==e){i.appendChild(o.createElement("span",null,"0"));var n="";switch(e){case"played":n=this.config.i18n.played;break;case"buffer":n=this.config.i18n.buffered}i.textContent="% "+n.toLowerCase()}return this.elements.display[e]=i,i},createTime:function(e){var t=o.createElement("div",{class:"plyr__time"});return t.appendChild(o.createElement("span",{class:this.config.classNames.hidden},this.config.i18n[e])),t.appendChild(o.createElement("span",o.getAttributesFromSelector(this.config.selectors.display[e]),"00:00")),this.elements.display[e]=t,t},createMenuItem:function(e,t,i,n){var s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=o.createElement("li"),r=o.createElement("label",{class:this.config.classNames.control}),c=o.createElement("input",o.extend(o.getAttributesFromSelector(this.config.selectors.inputs[i]),{type:"radio",name:"plyr-"+i,value:e,checked:a,class:"plyr__sr-only"})),u=o.createElement("span",{"aria-hidden":!0});r.appendChild(c),r.appendChild(u),r.insertAdjacentHTML("beforeend",n),o.is.element(s)&&r.appendChild(s),l.appendChild(r),t.appendChild(l)},updateSeekTooltip:function(e){if(this.config.tooltips.seek&&o.is.element(this.elements.inputs.seek)&&o.is.element(this.elements.display.seekTooltip)&&0!==this.duration){var t=0,i=this.elements.inputs.seek.getBoundingClientRect(),n=this.config.classNames.tooltip+"--visible";if(o.is.event(e))t=100/i.width*(e.pageX-i.left);else{if(!o.hasClass(this.elements.display.seekTooltip,n))return;t=parseFloat(this.elements.display.seekTooltip.style.left,10)}t<0?t=0:t>100&&(t=100),g.updateTimeDisplay.call(this,this.elements.display.seekTooltip,this.duration/100*t),this.elements.display.seekTooltip.style.left=t+"%",o.is.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&o.toggleClass(this.elements.display.seekTooltip,n,"mouseenter"===e.type)}},toggleTab:function(e,t){var i=this.elements.settings.tabs[e],n=this.elements.settings.panes[e];o.toggleHidden(i,!t),o.toggleHidden(n,!t)},setQualityMenu:function(e){var t=this,i=this.elements.settings.panes.quality.querySelector("ul");o.is.array(e)?this.options.quality=e.filter(function(e){return t.config.quality.options.includes(e)}):this.options.quality=this.config.quality.options;var n=!o.is.empty(this.options.quality)&&this.isYouTube;if(y.toggleTab.call(this,"quality",n),n){o.emptyElement(i);this.options.quality.forEach(function(e){return y.createMenuItem.call(t,e,i,"quality",y.getLabel.call(t,"quality",e),function(e){var i="";switch(e){case"hd2160":i="4K";break;case"hd1440":i="WQHD";break;case"hd1080":case"hd720":i="HD"}return i.length?y.createBadge.call(t,i):null}(e))}),y.updateSetting.call(this,"quality",i)}},getLabel:function(e,t){switch(e){case"speed":return 1===t?"Normal":t+"×";case"quality":switch(t){case"hd2160":return"2160P";case"hd1440":return"1440P";case"hd1080":return"1080P";case"hd720":return"720P";case"large":return"480P";case"medium":return"360P";case"small":return"240P";case"tiny":return"Tiny";case"default":return"Auto";default:return t}case"captions":return y.getLanguage.call(this);default:return null}},updateSetting:function(e,t){var i=this.elements.settings.panes[e],n=null,s=t;switch(e){case"captions":n=this.captions.active?this.captions.language:"";break;default:if(n=this[e],o.is.empty(n)&&(n=this.config[e].default),!this.options[e].includes(n))return void this.debug.warn("Unsupported value of '"+n+"' for "+e);if(!this.config[e].options.includes(n))return void this.debug.warn("Disabled value of '"+n+"' for "+e)}if(o.is.element(s)||(s=i&&i.querySelector("ul")),!o.is.empty(n)){this.elements.settings.tabs[e].querySelector("."+this.config.classNames.menu.value).innerHTML=y.getLabel.call(this,e,n)}var a=s&&s.querySelector('input[value="'+n+'"]');o.is.element(a)&&(a.checked=!0)},getLanguage:function(){if(!this.supported.ui)return null;if(!l.textTracks||!b.getTracks.call(this).length)return this.config.i18n.none;if(this.captions.active){var e=b.getCurrentTrack.call(this);if(o.is.track(e))return e.label}return this.config.i18n.disabled},setCaptionsMenu:function(){var e=this,t=this.elements.settings.panes.captions.querySelector("ul"),i=b.getTracks.call(this).length;if(y.toggleTab.call(this,"captions",i),o.emptyElement(t),i){var n=b.getTracks.call(this).map(function(e){return{language:e.language,label:o.is.empty(e.label)?e.language.toUpperCase():e.label}});n.unshift({language:"",label:this.config.i18n.none}),n.forEach(function(i){y.createMenuItem.call(e,i.language,t,"language",i.label||i.language,y.createBadge.call(e,i.language.toUpperCase()),i.language.toLowerCase()===e.captions.language.toLowerCase())}),y.updateSetting.call(this,"captions",t)}},setSpeedMenu:function(){var e=this;o.is.object(this.options.speed)&&Object.keys(this.options.speed).length||(this.options.speed=[.5,.75,1,1.25,1.5,1.75,2]),this.options.speed=this.options.speed.filter(function(t){return e.config.speed.options.includes(t)});var t=!o.is.empty(this.options.speed);if(y.toggleTab.call(this,"speed",t),t){var i=this.elements.settings.panes.speed.querySelector("ul");o.toggleHidden(this.elements.settings.tabs.speed,!1),o.toggleHidden(this.elements.settings.panes.speed,!1),o.emptyElement(i),this.options.speed.forEach(function(t){return y.createMenuItem.call(e,t,i,"speed",y.getLabel.call(e,"speed",t))}),y.updateSetting.call(this,"speed",i)}},toggleMenu:function(e){var t=this.elements.settings.form,i=this.elements.buttons.settings,n=o.is.boolean(e)?e:o.is.element(t)&&"true"===t.getAttribute("aria-hidden");if(o.is.event(e)){var s=o.is.element(t)&&t.contains(e.target),a=e.target===this.elements.buttons.settings;if(s||!s&&!a&&n)return;a&&e.stopPropagation()}o.is.element(i)&&i.setAttribute("aria-expanded",n),o.is.element(t)&&(t.setAttribute("aria-hidden",!n),o.toggleClass(this.elements.container,this.config.classNames.menu.open,n),n?t.removeAttribute("tabindex"):t.setAttribute("tabindex",-1))},getTabSize:function(e){var t=e.cloneNode(!0);t.style.position="absolute",t.style.opacity=0,t.setAttribute("aria-hidden",!1),Array.from(t.querySelectorAll("input[name]")).forEach(function(e){var t=e.getAttribute("name");e.setAttribute("name",t+"-clone")}),e.parentNode.appendChild(t);var i=t.scrollWidth,n=t.scrollHeight;return o.removeElement(t),{width:i,height:n}},showTab:function(e){var t=this.elements.settings.menu,i=e.target,n="false"===i.getAttribute("aria-expanded"),s=document.getElementById(i.getAttribute("aria-controls"));if(o.is.element(s)){if("tabpanel"===s.getAttribute("role")){var a=t.querySelector('[role="tabpanel"][aria-hidden="false"]'),r=a.parentNode;if(Array.from(t.querySelectorAll('[aria-controls="'+a.getAttribute("id")+'"]')).forEach(function(e){e.setAttribute("aria-expanded",!1)}),l.transitions&&!l.reducedMotion){r.style.width=a.scrollWidth+"px",r.style.height=a.scrollHeight+"px";var c=y.getTabSize.call(this,s),u=function e(t){t.target===r&&["width","height"].includes(t.propertyName)&&(r.style.width="",r.style.height="",o.off(r,o.transitionEnd,e))};o.on(r,o.transitionEnd,u),r.style.width=c.width+"px",r.style.height=c.height+"px"}a.setAttribute("aria-hidden",!0),a.setAttribute("tabindex",-1),s.setAttribute("aria-hidden",!n),i.setAttribute("aria-expanded",n),s.removeAttribute("tabindex"),s.querySelectorAll("button:not(:disabled), input:not(:disabled), [tabindex]")[0].focus()}}},create:function(e){var t=this;if(o.is.empty(this.config.controls))return null;var i=o.createElement("div",o.getAttributesFromSelector(this.config.selectors.controls.wrapper));if(this.config.controls.includes("restart")&&i.appendChild(y.createButton.call(this,"restart")),this.config.controls.includes("rewind")&&i.appendChild(y.createButton.call(this,"rewind")),this.config.controls.includes("play")&&i.appendChild(y.createButton.call(this,"play")),this.config.controls.includes("fast-forward")&&i.appendChild(y.createButton.call(this,"fast-forward")),this.config.controls.includes("progress")){var n=o.createElement("div",o.getAttributesFromSelector(this.config.selectors.progress)),s=y.createRange.call(this,"seek",{id:"plyr-seek-"+e.id});if(n.appendChild(s.label),n.appendChild(s.input),n.appendChild(y.createProgress.call(this,"buffer")),this.config.tooltips.seek){var a=o.createElement("span",{role:"tooltip",class:this.config.classNames.tooltip},"00:00");n.appendChild(a),this.elements.display.seekTooltip=a}this.elements.progress=n,i.appendChild(this.elements.progress)}if(this.config.controls.includes("current-time")&&i.appendChild(y.createTime.call(this,"currentTime")),this.config.controls.includes("duration")&&i.appendChild(y.createTime.call(this,"duration")),this.config.controls.includes("mute")&&i.appendChild(y.createButton.call(this,"mute")),this.config.controls.includes("volume")){var r=o.createElement("div",{class:"plyr__volume"}),c={max:1,step:.05,value:this.config.volume},u=y.createRange.call(this,"volume",o.extend(c,{id:"plyr-volume-"+e.id}));r.appendChild(u.label),r.appendChild(u.input),this.elements.volume=r,i.appendChild(r)}if(this.config.controls.includes("captions")&&i.appendChild(y.createButton.call(this,"captions")),this.config.controls.includes("settings")&&!o.is.empty(this.config.settings)){var d=o.createElement("div",{class:"plyr__menu"});d.appendChild(y.createButton.call(this,"settings",{id:"plyr-settings-toggle-"+e.id,"aria-haspopup":!0,"aria-controls":"plyr-settings-"+e.id,"aria-expanded":!1}));var p=o.createElement("form",{class:"plyr__menu__container",id:"plyr-settings-"+e.id,"aria-hidden":!0,"aria-labelled-by":"plyr-settings-toggle-"+e.id,role:"tablist",tabindex:-1}),h=o.createElement("div"),m=o.createElement("div",{id:"plyr-settings-"+e.id+"-home","aria-hidden":!1,"aria-labelled-by":"plyr-settings-toggle-"+e.id,role:"tabpanel"}),g=o.createElement("ul",{role:"tablist"});this.config.settings.forEach(function(i){var n=o.createElement("li",{role:"tab",hidden:""}),s=o.createElement("button",o.extend(o.getAttributesFromSelector(t.config.selectors.buttons.settings),{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--forward",id:"plyr-settings-"+e.id+"-"+i+"-tab","aria-haspopup":!0,"aria-controls":"plyr-settings-"+e.id+"-"+i,"aria-expanded":!1}),t.config.i18n[i]),a=o.createElement("span",{class:t.config.classNames.menu.value});a.innerHTML=e[i],s.appendChild(a),n.appendChild(s),g.appendChild(n),t.elements.settings.tabs[i]=n}),m.appendChild(g),h.appendChild(m),this.config.settings.forEach(function(i){var n=o.createElement("div",{id:"plyr-settings-"+e.id+"-"+i,"aria-hidden":!0,"aria-labelled-by":"plyr-settings-"+e.id+"-"+i+"-tab",role:"tabpanel",tabindex:-1,hidden:""}),s=o.createElement("button",{type:"button",class:t.config.classNames.control+" "+t.config.classNames.control+"--back","aria-haspopup":!0,"aria-controls":"plyr-settings-"+e.id+"-home","aria-expanded":!1},t.config.i18n[i]);n.appendChild(s);var a=o.createElement("ul");n.appendChild(a),h.appendChild(n),t.elements.settings.panes[i]=n}),p.appendChild(h),d.appendChild(p),i.appendChild(d),this.elements.settings.form=p,this.elements.settings.menu=d}return this.config.controls.includes("pip")&&l.pip&&i.appendChild(y.createButton.call(this,"pip")),this.config.controls.includes("airplay")&&l.airplay&&i.appendChild(y.createButton.call(this,"airplay")),this.config.controls.includes("fullscreen")&&i.appendChild(y.createButton.call(this,"fullscreen")),this.config.controls.includes("play-large")&&this.elements.container.appendChild(y.createButton.call(this,"play-large")),this.elements.controls=i,this.config.controls.includes("settings")&&this.config.settings.includes("speed")&&y.setSpeedMenu.call(this),i},inject:function(){var e=this;if(this.config.loadSprite){var t=y.getIconUrl.call(this);t.absolute&&o.loadSprite(t.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());var i=null;i=o.is.string(this.config.controls)?this.config.controls:o.is.function(this.config.controls)?this.config.controls({id:this.id,seektime:this.config.seekTime,title:this.config.title}):y.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:y.getLanguage.call(this)});var n=void 0;if(o.is.string(this.config.selectors.controls.container)&&(n=document.querySelector(this.config.selectors.controls.container)),o.is.element(n)||(n=this.elements.container),o.is.element(i)?n.appendChild(i):n.insertAdjacentHTML("beforeend",i),o.is.element(this.elements.controls)&&o.findElements.call(this),window.navigator.userAgent.includes("Edge")&&o.repaint(n),this.config.tooltips.controls){var s=o.getElements.call(this,[this.config.selectors.controls.wrapper," ",this.config.selectors.labels," .",this.config.classNames.hidden].join(""));Array.from(s).forEach(function(t){o.toggleClass(t,e.config.classNames.hidden,!1),o.toggleClass(t,e.config.classNames.tooltip,!0),t.setAttribute("role","tooltip")})}}},b={setup:function(){if(this.supported.ui){var e=this.storage.get("language");if(o.is.empty(e)||(this.captions.language=e),o.is.empty(this.captions.language)&&(this.captions.language=this.config.captions.language.toLowerCase()),!o.is.boolean(this.captions.active)){var t=this.storage.get("captions");o.is.boolean(t)?this.captions.active=t:this.captions.active=this.config.captions.active}!this.isVideo||this.isYouTube||this.isHTML5&&!l.textTracks?this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&y.setCaptionsMenu.call(this):(o.is.element(this.elements.captions)||(this.elements.captions=o.createElement("div",o.getAttributesFromSelector(this.config.selectors.captions)),o.insertAfter(this.elements.captions,this.elements.wrapper)),o.toggleClass(this.elements.container,this.config.classNames.captions.enabled,!o.is.empty(b.getTracks.call(this))),o.is.empty(b.getTracks.call(this))||(b.setLanguage.call(this),b.show.call(this),this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&y.setCaptionsMenu.call(this)))}},setLanguage:function(){var e=this;if(this.isHTML5&&this.isVideo){b.getTracks.call(this).forEach(function(t){o.on(t,"cuechange",function(t){return b.setCue.call(e,t)}),t.mode="hidden"});var t=b.getCurrentTrack.call(this);o.is.track(t)&&Array.from(t.activeCues||[]).length&&b.setCue.call(this,t)}else this.isVimeo&&this.captions.active&&this.embed.enableTextTrack(this.language)},getTracks:function(){return o.is.nullOrUndefined(this.media)?[]:Array.from(this.media.textTracks||[]).filter(function(e){return["captions","subtitles"].includes(e.kind)})},getCurrentTrack:function(){var e=this;return b.getTracks.call(this).find(function(t){return t.language.toLowerCase()===e.language})},setCue:function(e){var t=o.is.event(e)?e.target:e,i=t.activeCues[0];t===b.getCurrentTrack.call(this)&&(o.is.cue(i)?b.setText.call(this,i.getCueAsHTML()):b.setText.call(this,null),o.dispatchEvent.call(this,this.media,"cuechange"))},setText:function(e){if(this.supported.ui)if(o.is.element(this.elements.captions)){var t=o.createElement("span");o.emptyElement(this.elements.captions);var i=o.is.nullOrUndefined(e)?"":e;o.is.string(i)?t.textContent=i.trim():t.appendChild(i),this.elements.captions.appendChild(t)}else this.debug.warn("No captions element to render to")},show:function(){if(o.is.element(this.elements.buttons.captions)){var e=this.storage.get("captions");o.is.boolean(e)?this.captions.active=e:e=this.config.captions.active,e&&(o.toggleClass(this.elements.container,this.config.classNames.captions.active,!0),o.toggleState(this.elements.buttons.captions,!0))}}},v={setup:function(){var e=this,t=o.parseYouTubeId(this.embedId),i=o.getElements.call(this,'[id^="'+this.provider+'-"]');Array.from(i).forEach(o.removeElement),o.toggleClass(this.elements.wrapper,this.config.classNames.embed,!0),v.setAspectRatio.call(this),this.media.setAttribute("id",o.generateId(this.provider)),o.is.object(window.YT)?v.ready.call(this,t):(o.loadScript(this.config.urls.youtube.api),window.onYouTubeReadyCallbacks=window.onYouTubeReadyCallbacks||[],window.onYouTubeReadyCallbacks.push(function(){v.ready.call(e,t)}),window.onYouTubeIframeAPIReady=function(){window.onYouTubeReadyCallbacks.forEach(function(e){e()})})},getTitle:function(){var e=this;if(o.is.function(this.embed.getVideoData)){var t=this.embed.getVideoData().title;if(o.is.empty(t))return this.config.title=t,void g.setTitle.call(this)}var i=this.config.keys.google,n=o.parseYouTubeId(this.embedId);if(o.is.string(i)&&!o.is.empty(i)){var s="https://www.googleapis.com/youtube/v3/videos?id="+n+"&key="+i+"&fields=items(snippet(title))&part=snippet";fetch(s).then(function(e){return e.ok?e.json():null}).then(function(t){null!==t&&o.is.object(t)&&(e.config.title=t.items[0].snippet.title,g.setTitle.call(e))}).catch(function(){})}},setAspectRatio:function(){var e=this.config.ratio.split(":");this.elements.wrapper.style.paddingBottom=100/e[0]*e[1]+"%"},ready:function(e){var t=this;t.embed=new window.YT.Player(t.media.id,{videoId:e,playerVars:{autoplay:t.config.autoplay?1:0,controls:t.supported.ui?0:1,rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,disablekb:1,playsinline:1,origin:window&&window.location.hostname,widget_referrer:window&&window.location.href,cc_load_policy:this.captions.active?1:0,cc_lang_pref:this.config.captions.language},events:{onError:function(e){if(!o.is.object(t.media.error)){var i={code:e.data};switch(e.data){case 2:i.message="The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.";break;case 5:i.message="The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.";break;case 100:i.message="The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.";break;case 101:case 150:i.message="The owner of the requested video does not allow it to be played in embedded players.";break;default:i.message="An unknown error occured"}t.media.error=i,o.dispatchEvent.call(t,t.media,"error")}},onPlaybackQualityChange:function(e){var i=e.target;t.media.quality=i.getPlaybackQuality(),o.dispatchEvent.call(t,t.media,"qualitychange")},onPlaybackRateChange:function(e){var i=e.target;t.media.playbackRate=i.getPlaybackRate(),o.dispatchEvent.call(t,t.media,"ratechange")},onReady:function(e){var i=e.target;v.getTitle.call(t),t.media.play=function(){i.playVideo(),t.media.paused=!1},t.media.pause=function(){i.pauseVideo(),t.media.paused=!0},t.media.stop=function(){i.stopVideo(),t.media.paused=!0},t.media.duration=i.getDuration(),t.media.paused=!0,t.media.currentTime=0,Object.defineProperty(t.media,"currentTime",{get:function(){return Number(i.getCurrentTime())},set:function(e){t.media.seeking=!0,o.dispatchEvent.call(t,t.media,"seeking"),i.seekTo(e)}}),Object.defineProperty(t.media,"playbackRate",{get:function(){return i.getPlaybackRate()},set:function(e){i.setPlaybackRate(e)}}),Object.defineProperty(t.media,"quality",{get:function(){return i.getPlaybackQuality()},set:function(e){o.dispatchEvent.call(t,t.media,"qualityrequested",!1,{quality:e}),i.setPlaybackQuality(e)}});var n=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return n},set:function(e){n=e,i.setVolume(100*n),o.dispatchEvent.call(t,t.media,"volumechange")}});var s=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return s},set:function(e){var n=o.is.boolean(e)?e:s;s=n,i[n?"mute":"unMute"](),o.dispatchEvent.call(t,t.media,"volumechange")}}),Object.defineProperty(t.media,"currentSrc",{get:function(){return i.getVideoUrl()}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),t.options.speed=i.getAvailablePlaybackRates(),t.supported.ui&&t.media.setAttribute("tabindex",-1),o.dispatchEvent.call(t,t.media,"timeupdate"),o.dispatchEvent.call(t,t.media,"durationchange"),window.clearInterval(t.timers.buffering),t.timers.buffering=window.setInterval(function(){t.media.buffered=i.getVideoLoadedFraction(),(null===t.media.lastBuffered||t.media.lastBuffered<t.media.buffered)&&o.dispatchEvent.call(t,t.media,"progress"),t.media.lastBuffered=t.media.buffered,1===t.media.buffered&&(window.clearInterval(t.timers.buffering),o.dispatchEvent.call(t,t.media,"canplaythrough"))},200),window.setTimeout(function(){return g.build.call(t)},50)},onStateChange:function(e){var i=e.target;switch(window.clearInterval(t.timers.playing),e.data){case 0:t.media.paused=!0,t.media.loop?(i.stopVideo(),i.playVideo()):o.dispatchEvent.call(t,t.media,"ended");break;case 1:t.media.seeking&&o.dispatchEvent.call(t,t.media,"seeked"),t.media.seeking=!1,t.media.paused&&o.dispatchEvent.call(t,t.media,"play"),t.media.paused=!1,o.dispatchEvent.call(t,t.media,"playing"),t.timers.playing=window.setInterval(function(){o.dispatchEvent.call(t,t.media,"timeupdate")},50),t.media.duration!==i.getDuration()&&(t.media.duration=i.getDuration(),o.dispatchEvent.call(t,t.media,"durationchange")),y.setQualityMenu.call(t,i.getAvailableQualityLevels());break;case 2:t.media.paused=!0,o.dispatchEvent.call(t,t.media,"pause")}o.dispatchEvent.call(t,t.elements.container,"statechange",!1,{code:e.data})}}})}},k={setup:function(){var e=this,t=o.getElements.call(this,'[id^="'+this.provider+'-"]');Array.from(t).forEach(o.removeElement),o.toggleClass(this.elements.wrapper,this.config.classNames.embed,!0),k.setAspectRatio.call(this),this.media.setAttribute("id",o.generateId(this.provider)),o.is.object(window.Vimeo)?k.ready.call(this):o.loadScript(this.config.urls.vimeo.api,function(){k.ready.call(e)})},setAspectRatio:function(e){var t=o.is.string(e)?e.split(":"):this.config.ratio.split(":"),i=100/t[0]*t[1],n=(200-i)/4;this.elements.wrapper.style.paddingBottom=i+"%",this.media.style.transform="translateY(-"+n+"%)"},ready:function(){var e=this,t=this,i={loop:t.config.loop.active,autoplay:t.autoplay,byline:!1,portrait:!1,title:!1,speed:!0,transparent:0,gesture:"media"},n=o.buildUrlParameters(i),s=o.parseVimeoId(t.embedId),a=o.createElement("iframe"),l="https://player.vimeo.com/video/"+s+"?"+n;a.setAttribute("src",l),a.setAttribute("allowfullscreen",""),t.media.appendChild(a),t.embed=new window.Vimeo.Player(a),t.media.paused=!0,t.media.currentTime=0,t.media.play=function(){t.embed.play().then(function(){t.media.paused=!1})},t.media.pause=function(){t.embed.pause().then(function(){t.media.paused=!0})},t.media.stop=function(){t.embed.stop().then(function(){t.media.paused=!0,t.currentTime=0})};var r=t.media.currentTime;Object.defineProperty(t.media,"currentTime",{get:function(){return r},set:function(e){var i=t.media.paused;t.media.seeking=!0,o.dispatchEvent.call(t,t.media,"seeking"),t.embed.setCurrentTime(e),i&&t.pause()}});var c=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:function(){return c},set:function(e){t.embed.setPlaybackRate(e).then(function(){c=e,o.dispatchEvent.call(t,t.media,"ratechange")})}});var u=t.config.volume;Object.defineProperty(t.media,"volume",{get:function(){return u},set:function(e){t.embed.setVolume(e).then(function(){u=e,o.dispatchEvent.call(t,t.media,"volumechange")})}});var d=t.config.muted;Object.defineProperty(t.media,"muted",{get:function(){return d},set:function(e){var i=!!o.is.boolean(e)&&e;t.embed.setVolume(i?0:t.config.volume).then(function(){d=i,o.dispatchEvent.call(t,t.media,"volumechange")})}});var p=t.config.loop;Object.defineProperty(t.media,"loop",{get:function(){return p},set:function(e){var i=o.is.boolean(e)?e:t.config.loop.active;t.embed.setLoop(i).then(function(){p=i})}});var h=void 0;t.embed.getVideoUrl().then(function(e){h=e}),Object.defineProperty(t.media,"currentSrc",{get:function(){return h}}),Object.defineProperty(t.media,"ended",{get:function(){return t.currentTime===t.duration}}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(function(t){var i=o.getAspectRatio(t[0],t[1]);k.setAspectRatio.call(e,i)}),t.embed.setAutopause(t.config.autopause).then(function(e){t.config.autopause=e}),t.embed.getVideoTitle().then(function(i){t.config.title=i,g.setTitle.call(e)}),t.embed.getCurrentTime().then(function(e){r=e,o.dispatchEvent.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(function(e){t.media.duration=e,o.dispatchEvent.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(function(e){t.media.textTracks=e,b.setup.call(t)}),t.embed.on("cuechange",function(e){var i=null;e.cues.length&&(i=o.stripHTML(e.cues[0].text)),b.setText.call(t,i)}),t.embed.on("loaded",function(){if(o.is.element(t.embed.element)&&t.supported.ui){t.embed.element.setAttribute("tabindex",-1)}}),t.embed.on("play",function(){t.media.paused&&o.dispatchEvent.call(t,t.media,"play"),t.media.paused=!1,o.dispatchEvent.call(t,t.media,"playing")}),t.embed.on("pause",function(){t.media.paused=!0,o.dispatchEvent.call(t,t.media,"pause")}),t.embed.on("timeupdate",function(e){t.media.seeking=!1,r=e.seconds,o.dispatchEvent.call(t,t.media,"timeupdate")}),t.embed.on("progress",function(e){t.media.buffered=e.percent,o.dispatchEvent.call(t,t.media,"progress"),1===parseInt(e.percent,10)&&o.dispatchEvent.call(t,t.media,"canplaythrough")}),t.embed.on("seeked",function(){t.media.seeking=!1,o.dispatchEvent.call(t,t.media,"seeked"),o.dispatchEvent.call(t,t.media,"play")}),t.embed.on("ended",function(){t.media.paused=!0,o.dispatchEvent.call(t,t.media,"ended")}),t.embed.on("error",function(e){t.media.error=e,o.dispatchEvent.call(t,t.media,"error")}),window.setTimeout(function(){return g.build.call(t)},0)}},w=o.getBrowser(),E={setup:function(){if(this.media)if(o.toggleClass(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),o.toggleClass(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&o.toggleClass(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.supported.ui&&(o.toggleClass(this.elements.container,this.config.classNames.pip.supported,l.pip&&this.isHTML5&&this.isVideo),o.toggleClass(this.elements.container,this.config.classNames.airplay.supported,l.airplay&&this.isHTML5),o.toggleClass(this.elements.container,this.config.classNames.stopped,this.config.autoplay),o.toggleClass(this.elements.container,this.config.classNames.isIos,w.isIos),o.toggleClass(this.elements.container,this.config.classNames.isTouch,l.touch)),(this.isVideo||this.isYouTube||this.isVimeo)&&(this.elements.wrapper=o.createElement("div",{class:this.config.classNames.video}),o.wrap(this.media,this.elements.wrapper)),this.isEmbed)switch(this.provider){case"youtube":v.setup.call(this);break;case"vimeo":k.setup.call(this)}else this.isHTML5&&g.setTitle.call(this);else this.debug.warn("No media element found!")},cancelRequests:function(){this.isHTML5&&(Array.from(this.media.querySelectorAll("source")).forEach(o.removeElement),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}},T={insertElements:function(e,t){var i=this;o.is.string(t)?o.insertElement(e,this.media,{src:t}):o.is.array(t)&&t.forEach(function(t){o.insertElement(e,i.media,t)})},change:function(t){var i=this;o.is.object(t)&&"sources"in t&&t.sources.length?(E.cancelRequests.call(this),this.destroy.call(this,function(){switch(o.removeElement(i.media),i.media=null,o.is.element(i.elements.container)&&i.elements.container.removeAttribute("class"),i.type=t.type,i.provider=o.is.empty(t.sources[0].provider)?e.html5:t.sources[0].provider,i.supported=l.check(i.type,i.provider,i.config.inline),i.provider+":"+i.type){case"html5:video":i.media=o.createElement("video");break;case"html5:audio":i.media=o.createElement("audio");break;case"youtube:video":case"vimeo:video":i.media=o.createElement("div"),i.embedId=t.sources[0].src}i.elements.container.appendChild(i.media),o.is.boolean(t.autoplay)&&(i.config.autoplay=t.autoplay),i.isHTML5&&(i.config.crossorigin&&i.media.setAttribute("crossorigin",""),i.config.autoplay&&i.media.setAttribute("autoplay",""),"poster"in t&&i.media.setAttribute("poster",t.poster),i.config.loop.active&&i.media.setAttribute("loop",""),i.config.muted&&i.media.setAttribute("muted",""),i.config.inline&&i.media.setAttribute("playsinline","")),g.addStyleHook.call(i),i.isHTML5&&T.insertElements.call(i,"source",t.sources),i.config.title=t.title,E.setup.call(i),i.isHTML5&&("tracks"in t&&T.insertElements.call(i,"track",t.tracks),i.media.load()),(i.isHTML5||i.isEmbed&&!i.supported.ui)&&g.build.call(i)},!0)):this.debug.warn("Invalid source format")}},C={x:0,y:0};return function(){function a(s,r){var d=this;if(n(this,a),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.media=s,o.is.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||o.is.nodeList(this.media)||o.is.array(this.media))&&(this.media=this.media[0]),this.config=o.extend({},i,r,function(){try{return JSON.parse(d.media.getAttribute("data-plyr-config"))}catch(e){return{}}}()),this.elements={container:null,buttons:{},display:{},progress:{},inputs:{},settings:{menu:null,panes:{},tabs:{}},captions:null},this.captions={active:null,currentTrack:null},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new c(this),this.debug.log("Config",this.config),this.debug.log("Support",l),!o.is.nullOrUndefined(this.media)&&o.is.element(this.media))if(this.media.plyr)this.debug.warn("Target already setup");else if(this.config.enabled)if(l.check().api){this.elements.original=this.media.cloneNode(!0);var p=this.media.tagName.toLowerCase(),h="data-plyr-provider",f="data-plyr-embed-id";switch(p){case"div":if(this.type=t.video,this.provider=this.media.getAttribute(h),this.embedId=this.media.getAttribute(f),o.is.empty(this.provider)||!Object.keys(e).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");if(o.is.empty(this.embedId))return void this.debug.error("Setup failed: Embed ID or URL missing");this.media.removeAttribute(h),this.media.removeAttribute(f);break;case"video":case"audio":this.type=p,this.provider=e.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),this.media.hasAttribute("playsinline")&&(this.config.inline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.storage=new u(this),this.supported=l.check(this.type,this.provider,this.config.inline),this.supported.api?(this.media.plyr=this,this.elements.container=o.createElement("div"),o.wrap(this.media,this.elements.container),this.elements.container.setAttribute("tabindex",0),m.global.call(this),g.addStyleHook.call(this),E.setup.call(this),this.config.debug&&o.on(this.elements.container,this.config.events.join(" "),function(e){d.debug.log("event: "+e.type)}),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&g.build.call(this)):this.debug.error("Setup failed: no support")}else this.debug.error("Setup failed: no support");else this.debug.error("Setup failed: disabled by config");else this.debug.error("Setup failed: no suitable element passed")}return s(a,[{key:"play",value:function(){return this.media.play()}},{key:"pause",value:function(){this.playing&&this.media.pause()}},{key:"togglePlay",value:function(e){(o.is.boolean(e)?e:!this.playing)?this.play():this.pause()}},{key:"stop",value:function(){this.restart(),this.pause()}},{key:"restart",value:function(){this.currentTime=0}},{key:"rewind",value:function(e){this.currentTime=this.currentTime-(o.is.number(e)?e:this.config.seekTime)}},{key:"forward",value:function(e){this.currentTime=this.currentTime+(o.is.number(e)?e:this.config.seekTime)}},{key:"increaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t+(o.is.number(e)?e:1)}},{key:"decreaseVolume",value:function(e){var t=this.media.muted?0:this.volume;this.volume=t-(o.is.number(e)?e:1)}},{key:"toggleCaptions",value:function(e){if(this.supported.ui&&o.is.element(this.elements.buttons.captions)){var t=o.is.boolean(e)?e:-1===this.elements.container.className.indexOf(this.config.classNames.captions.active);this.captions.active!==t&&(this.captions.active=t,o.toggleState(this.elements.buttons.captions,this.captions.active),o.toggleClass(this.elements.container,this.config.classNames.captions.active,this.captions.active),o.dispatchEvent.call(this,this.media,this.captions.active?"captionsenabled":"captionsdisabled"))}}},{key:"toggleFullscreen",value:function(e){if(!this.isAudio){if(p.enabled){if(!o.is.event(e)||e.type!==p.eventType)return void(this.fullscreen.active?p.cancelFullScreen():p.requestFullScreen(this.elements.container));this.fullscreen.active=p.isFullScreen(this.elements.container)}else this.fullscreen.active=!this.fullscreen.active,o.toggleClass(this.elements.container,this.config.classNames.fullscreen.fallback,this.fullscreen.active),this.fullscreen.active?C={x:window.pageXOffset||0,y:window.pageYOffset||0}:window.scrollTo(C.x,C.y),document.body.style.overflow=this.fullscreen.active?"hidden":"";o.is.element(this.elements.buttons.fullscreen)&&o.toggleState(this.elements.buttons.fullscreen,this.fullscreen.active),o.dispatchEvent.call(this,this.media,this.fullscreen.active?"enterfullscreen":"exitfullscreen")}}},{key:"airplay",value:function(){l.airplay&&this.media.webkitShowPlaybackTargetPicker()}},{key:"toggleControls",value:function(e){var t=this;if(o.is.element(this.elements.controls)&&this.supported.ui&&!this.isAudio){var i=0,n=e,s=!1;if(o.is.boolean(e)||(o.is.event(e)?(s="enterfullscreen"===e.type,n=["mouseenter","mousemove","touchstart","touchmove","focusin"].includes(e.type),["mousemove","touchmove","touchend"].includes(e.type)&&(i=2e3),"focusin"===e.type&&(i=3e3,o.toggleClass(this.elements.controls,this.config.classNames.noTransition,!0))):n=o.hasClass(this.elements.container,this.config.classNames.hideControls)),window.clearTimeout(this.timers.controls),n||this.paused||this.loading){if(o.toggleClass(this.elements.container,this.config.classNames.hideControls,!1)&&o.dispatchEvent.call(this,this.media,"controlsshown"),this.paused||this.loading)return;l.touch&&(i=3e3)}n&&!this.playing||(this.timers.controls=window.setTimeout(function(){if(!t.elements.controls.pressed&&!t.elements.controls.hover||s){o.hasClass(t.elements.container,t.config.classNames.hideControls)||o.toggleClass(t.elements.controls,t.config.classNames.noTransition,!1);o.toggleClass(t.elements.container,t.config.classNames.hideControls,!0)&&(o.dispatchEvent.call(t,t.media,"controlshidden"),t.config.controls.includes("settings")&&!o.is.empty(t.config.settings)&&y.toggleMenu.call(t,!1))}},i))}}},{key:"on",value:function(e,t){o.on(this.elements.container,e,t)}},{key:"off",value:function(e,t){o.off(this.elements.container,e,t)}},{key:"destroy",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=function(){if(document.body.style.overflow="",t.embed=null,t.embedId=null,i)Object.keys(t.elements).length&&(t.elements.buttons&&t.elements.buttons.play&&Array.from(t.elements.buttons.play).forEach(function(e){return o.removeElement(e)}),o.removeElement(t.elements.captions),o.removeElement(t.elements.controls),o.removeElement(t.elements.wrapper),t.elements.buttons.play=null,t.elements.captions=null,t.elements.controls=null,t.elements.wrapper=null),o.is.function(e)&&e();else{var n=t.elements.container.parentNode;o.is.element(n)&&n.replaceChild(t.elements.original,t.elements.container),o.dispatchEvent.call(t,t.elements.original,"destroyed",!0),o.is.function(e)&&e.call(t.elements.original),t.elements=null}};switch(this.provider+":"+this.type){case"html5:video":case"html5:audio":g.toggleNativeControls.call(this,!0),n();break;case"youtube:video":window.clearInterval(this.timers.buffering),window.clearInterval(this.timers.playing),this.embed.destroy(),n();break;case"vimeo:video":this.embed.unload().then(n),window.setTimeout(n,200)}}},{key:"supports",value:function(e){return l.mime.call(this,e)}},{key:"isHTML5",get:function(){return this.provider===e.html5}},{key:"isEmbed",get:function(){return this.isYouTube||this.isVimeo}},{key:"isYouTube",get:function(){return this.provider===e.youtube}},{key:"isVimeo",get:function(){return this.provider===e.vimeo}},{key:"isVideo",get:function(){return this.type===t.video}},{key:"isAudio",get:function(){return this.type===t.audio}},{key:"paused",get:function(){return this.media.paused}},{key:"playing",get:function(){return!this.paused&&!this.ended&&(!this.isHTML5||this.media.readyState>2)}},{key:"ended",get:function(){return this.media.ended}},{key:"currentTime",set:function(e){var t=0;o.is.number(e)&&(t=e),t<0?t=0:t>this.duration&&(t=this.duration),this.media.currentTime=t.toFixed(4),this.debug.log("Seeking to "+this.currentTime+" seconds")},get:function(){return Number(this.media.currentTime)}},{key:"seeking",get:function(){return this.media.seeking}},{key:"duration",get:function(){var e=parseInt(this.config.duration,10),t=Number(this.media.duration);return Number.isNaN(e)?t:e}},{key:"volume",set:function(e){var t=e;o.is.string(t)&&(t=Number(t)),o.is.number(t)||(t=this.storage.get("volume")),o.is.number(t)||(t=this.config.volume),t>1&&(t=1),t<0&&(t=0),this.config.volume=t,this.media.volume=t,this.muted&&t>0&&(this.muted=!1)},get:function(){return this.media.volume}},{key:"muted",set:function(e){var t=e;o.is.boolean(t)||(t=this.storage.get("muted")),o.is.boolean(t)||(t=this.config.muted),this.config.muted=t,this.media.muted=t},get:function(){return this.media.muted}},{key:"hasAudio",get:function(){return!this.isHTML5||(this.media.mozHasAudio||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length))}},{key:"speed",set:function(e){var t=null;o.is.number(e)&&(t=e),o.is.number(t)||(t=this.storage.get("speed")),o.is.number(t)||(t=this.config.speed.selected),t<.1&&(t=.1),t>2&&(t=2),this.config.speed.options.includes(t)?(this.config.speed.selected=t,this.media.playbackRate=t):this.debug.warn("Unsupported speed ("+t+")")},get:function(){return this.media.playbackRate}},{key:"quality",set:function(e){var t=null;o.is.string(e)&&(t=e),o.is.string(t)||(t=this.storage.get("quality")),o.is.string(t)||(t=this.config.quality.selected),this.options.quality.includes(t)?(this.config.quality.selected=t,this.media.quality=t):this.debug.warn("Unsupported quality option ("+t+")")},get:function(){return this.media.quality}},{key:"loop",set:function(e){var t=o.is.boolean(e)?e:this.config.loop.active;this.config.loop.active=t,this.media.loop=t},get:function(){return this.media.loop}},{key:"source",set:function(e){T.change.call(this,e)},get:function(){return this.media.currentSrc}},{key:"poster",set:function(e){this.isHTML5&&this.isVideo?o.is.string(e)&&this.media.setAttribute("poster",e):this.debug.warn("Poster can only be set on HTML5 video")},get:function(){return this.isHTML5&&this.isVideo?this.media.getAttribute("poster"):null}},{key:"autoplay",set:function(e){var t=o.is.boolean(e)?e:this.config.autoplay;this.config.autoplay=t},get:function(){return this.config.autoplay}},{key:"language",set:function(e){if(o.is.string(e)&&(this.toggleCaptions(!o.is.empty(e)),!o.is.empty(e))){var t=e.toLowerCase();this.language!==t&&(this.captions.language=t,b.setText.call(this,null),b.setLanguage.call(this),o.dispatchEvent.call(this,this.media,"languagechange"))}},get:function(){return this.captions.language}},{key:"pip",set:function(e){var t="picture-in-picture",i="inline";if(l.pip){var n=o.is.boolean(e)?e:this.pip===i;this.media.webkitSetPresentationMode(n?t:i)}},get:function(){return l.pip?this.media.webkitPresentationMode:null}}],[{key:"supported",value:function(e,t,i){return l.check(e,t,i)}},{key:"loadSprite",value:function(e,t){return o.loadSprite(e,t)}}]),a}()}); + +//# sourceMappingURL=plyr.js.map |