12345678910111213 |
- /*2019-05-07 16:37:44 - static_tmp/v3/js/video.js*/!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.videojs=b()}(this,function(){function a(a,b){return b={exports:{}},a(b,b.exports),b.exports}function b(a){return a.replace(/\n\r?\s*/g,"")}function c(a,b){Nb(a).forEach(function(c){return b(a[c],c)})}function d(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Nb(a).reduce(function(c,d){return b(c,a[d],d)},c)}function e(a){for(var b=arguments.length,d=Array(b>1?b-1:0),e=1;b>e;e++)d[e-1]=arguments[e];return Object.assign?Object.assign.apply(Object,[a].concat(d)):(d.forEach(function(b){b&&c(b,function(b,c){a[c]=b})}),a)}function f(a){return!!a&&"object"===("undefined"==typeof a?"undefined":Hb(a))}function g(a){return f(a)&&"[object Object]"===Mb.call(a)&&a.constructor===Object}function h(a,b){if(!a||!b)return"";if("function"==typeof vb.getComputedStyle){var c=vb.getComputedStyle(a);return c?c[b]:""}return""}function i(a){return"string"==typeof a&&/\S/.test(a)}function j(a){if(/\s/.test(a))throw new Error("class has illegal whitespace characters")}function k(a){return new RegExp("(^|\\s)"+a+"($|\\s)")}function l(){return Ab===vb.document}function m(a){return f(a)&&1===a.nodeType}function n(){try{return vb.parent!==vb.self}catch(a){return!0}}function o(a){return function(b,c){if(!i(b))return Ab[a](null);i(c)&&(c=Ab.querySelector(c));var d=m(c)?c:Ab;return d[a]&&d[a](b)}}function p(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=arguments[3],e=Ab.createElement(a);return Object.getOwnPropertyNames(b).forEach(function(a){var c=b[a];-1!==a.indexOf("aria-")||"role"===a||"type"===a?(Fb.warn(Gb(Ob,a,c)),e.setAttribute(a,c)):"textContent"===a?q(e,c):e[a]=c}),Object.getOwnPropertyNames(c).forEach(function(a){e.setAttribute(a,c[a])}),d&&J(e,d),e}function q(a,b){return"undefined"==typeof a.textContent?a.innerText=b:a.textContent=b,a}function r(a,b){b.firstChild?b.insertBefore(a,b.firstChild):b.appendChild(a)}function s(a,b){return j(b),a.classList?a.classList.contains(b):k(b).test(a.className)}function t(a,b){return a.classList?a.classList.add(b):s(a,b)||(a.className=(a.className+" "+b).trim()),a}function u(a,b){return a.classList?a.classList.remove(b):(j(b),a.className=a.className.split(/\s+/).filter(function(a){return a!==b}).join(" ")),a}function v(a,b,c){var d=s(a,b);return"function"==typeof c&&(c=c(a,b)),"boolean"!=typeof c&&(c=!d),c!==d?(c?t(a,b):u(a,b),a):void 0}function w(a,b){Object.getOwnPropertyNames(b).forEach(function(c){var d=b[c];null===d||"undefined"==typeof d||d===!1?a.removeAttribute(c):a.setAttribute(c,d===!0?"":d)})}function x(a){var b={},c=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(a&&a.attributes&&a.attributes.length>0)for(var d=a.attributes,e=d.length-1;e>=0;e--){var f=d[e].name,g=d[e].value;("boolean"==typeof a[f]||-1!==c.indexOf(","+f+","))&&(g=null!==g?!0:!1),b[f]=g}return b}function y(a,b){return a.getAttribute(b)}function z(a,b,c){a.setAttribute(b,c)}function A(a,b){a.removeAttribute(b)}function B(){Ab.body.focus(),Ab.onselectstart=function(){return!1}}function C(){Ab.onselectstart=function(){return!0}}function D(a){if(a&&a.getBoundingClientRect&&a.parentNode){var b=a.getBoundingClientRect(),c={};return["bottom","height","left","right","top","width"].forEach(function(a){void 0!==b[a]&&(c[a]=b[a])}),c.height||(c.height=parseFloat(h(a,"height"))),c.width||(c.width=parseFloat(h(a,"width"))),c}}function E(a){var b=void 0;if(a.getBoundingClientRect&&a.parentNode&&(b=a.getBoundingClientRect()),!b)return{left:0,top:0};var c=Ab.documentElement,d=Ab.body,e=c.clientLeft||d.clientLeft||0,f=vb.pageXOffset||d.scrollLeft,g=b.left+f-e,h=c.clientTop||d.clientTop||0,i=vb.pageYOffset||d.scrollTop,j=b.top+i-h;return{left:Math.round(g),top:Math.round(j)}}function F(a,b){var c={},d=E(a),e=a.offsetWidth,f=a.offsetHeight,g=d.top,h=d.left,i=b.pageY,j=b.pageX;return b.changedTouches&&(j=b.changedTouches[0].pageX,i=b.changedTouches[0].pageY),c.y=Math.max(0,Math.min(1,(g-i+f)/f)),c.x=Math.max(0,Math.min(1,(j-h)/e)),c}function G(a){return f(a)&&3===a.nodeType}function H(a){for(;a.firstChild;)a.removeChild(a.firstChild);return a}function I(a){return"function"==typeof a&&(a=a()),(Array.isArray(a)?a:[a]).map(function(a){return"function"==typeof a&&(a=a()),m(a)||G(a)?a:"string"==typeof a&&/\S/.test(a)?Ab.createTextNode(a):void 0}).filter(function(a){return a})}function J(a,b){return I(b).forEach(function(b){return a.appendChild(b)}),a}function K(a,b){return J(H(a),b)}function L(a){return void 0===a.button&&void 0===a.buttons?!0:0===a.button&&void 0===a.buttons?!0:0!==a.button||1!==a.buttons?!1:!0}function M(){return Sb++}function N(a){var b=a[Ub];return b||(b=a[Ub]=M()),Tb[b]||(Tb[b]={}),Tb[b]}function O(a){var b=a[Ub];return b?!!Object.getOwnPropertyNames(Tb[b]).length:!1}function P(a){var b=a[Ub];if(b){delete Tb[b];try{delete a[Ub]}catch(c){a.removeAttribute?a.removeAttribute(Ub):a[Ub]=null}}}function Q(a,b){var c=N(a);0===c.handlers[b].length&&(delete c.handlers[b],a.removeEventListener?a.removeEventListener(b,c.dispatcher,!1):a.detachEvent&&a.detachEvent("on"+b,c.dispatcher)),Object.getOwnPropertyNames(c.handlers).length<=0&&(delete c.handlers,delete c.dispatcher,delete c.disabled),0===Object.getOwnPropertyNames(c).length&&P(a)}function R(a,b,c,d){c.forEach(function(c){a(b,c,d)})}function S(a){function b(){return!0}function c(){return!1}if(!a||!a.isPropagationStopped){var d=a||vb.event;a={};for(var e in d)"layerX"!==e&&"layerY"!==e&&"keyLocation"!==e&&"webkitMovementX"!==e&&"webkitMovementY"!==e&&("returnValue"===e&&d.preventDefault||(a[e]=d[e]));if(a.target||(a.target=a.srcElement||Ab),a.relatedTarget||(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement),a.preventDefault=function(){d.preventDefault&&d.preventDefault(),a.returnValue=!1,d.returnValue=!1,a.defaultPrevented=!0},a.defaultPrevented=!1,a.stopPropagation=function(){d.stopPropagation&&d.stopPropagation(),a.cancelBubble=!0,d.cancelBubble=!0,a.isPropagationStopped=b},a.isPropagationStopped=c,a.stopImmediatePropagation=function(){d.stopImmediatePropagation&&d.stopImmediatePropagation(),a.isImmediatePropagationStopped=b,a.stopPropagation()},a.isImmediatePropagationStopped=c,null!==a.clientX&&void 0!==a.clientX){var f=Ab.documentElement,g=Ab.body;a.pageX=a.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=a.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)}a.which=a.charCode||a.keyCode,null!==a.button&&void 0!==a.button&&(a.button=1&a.button?0:4&a.button?1:2&a.button?2:0)}return a}function T(a,b,c){if(Array.isArray(b))return R(T,a,b,c);var d=N(a);if(d.handlers||(d.handlers={}),d.handlers[b]||(d.handlers[b]=[]),c.guid||(c.guid=M()),d.handlers[b].push(c),d.dispatcher||(d.disabled=!1,d.dispatcher=function(b,c){if(!d.disabled){b=S(b);var e=d.handlers[b.type];if(e)for(var f=e.slice(0),g=0,h=f.length;h>g&&!b.isImmediatePropagationStopped();g++)try{f[g].call(a,b,c)}catch(i){Fb.error(i)}}}),1===d.handlers[b].length)if(a.addEventListener){var e=!1;Vb&&Wb.indexOf(b)>-1&&(e={passive:!0}),a.addEventListener(b,d.dispatcher,e)}else a.attachEvent&&a.attachEvent("on"+b,d.dispatcher)}function U(a,b,c){if(O(a)){var d=N(a);if(d.handlers){if(Array.isArray(b))return R(U,a,b,c);var e=function(a,b){d.handlers[b]=[],Q(a,b)};if(void 0!==b){var f=d.handlers[b];if(f){if(!c)return void e(a,b);if(c.guid)for(var g=0;g<f.length;g++)f[g].guid===c.guid&&f.splice(g--,1);Q(a,b)}}else for(var h in d.handlers)Object.prototype.hasOwnProperty.call(d.handlers||{},h)&&e(a,h)}}}function V(a,b,c){var d=O(a)?N(a):{},e=a.parentNode||a.ownerDocument;if("string"==typeof b?b={type:b,target:a}:b.target||(b.target=a),b=S(b),d.dispatcher&&d.dispatcher.call(a,b,c),e&&!b.isPropagationStopped()&&b.bubbles===!0)V.call(null,e,b,c);else if(!e&&!b.defaultPrevented){var f=N(b.target);b.target[b.type]&&(f.disabled=!0,"function"==typeof b.target[b.type]&&b.target[b.type](),f.disabled=!1)}return!b.defaultPrevented}function W(a,b,c){if(Array.isArray(b))return R(W,a,b,c);var d=function e(){U(a,b,e),c.apply(this,arguments)};d.guid=c.guid=c.guid||M(),T(a,b,d)}function X(a,b){b&&(Zb=b),vb.setTimeout($b,a)}function Y(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=b.eventBusKey;if(c){if(!a[c].nodeName)throw new Error('The eventBusKey "'+c+'" does not refer to an element.');a.eventBusEl_=a[c]}else a.eventBusEl_=p("span",{className:"vjs-event-bus"});return e(a,mc),a.on("dispose",function(){a.off(),vb.setTimeout(function(){a.eventBusEl_=null},0)}),a}function Z(a,b){return e(a,nc),a.state=e({},a.state,b),"function"==typeof a.handleStateChanged&&fc(a)&&a.on("statechanged",a.handleStateChanged),a}function $(a){return"string"!=typeof a?a:a.charAt(0).toUpperCase()+a.slice(1)}function _(a,b){return $(a)===$(b)}function aa(){for(var a={},b=arguments.length,d=Array(b),e=0;b>e;e++)d[e]=arguments[e];return d.forEach(function(b){b&&c(b,function(b,c){return g(b)?(g(a[c])||(a[c]={}),void(a[c]=aa(a[c],b))):void(a[c]=b)})}),a}function ba(a,b,c){if("number"!=typeof b||0>b||b>c)throw new Error("Failed to execute '"+a+"' on 'TimeRanges': The index provided ("+b+") is non-numeric or out of bounds (0-"+c+").")}function ca(a,b,c,d){return ba(a,d,c.length-1),c[d][b]}function da(a){return void 0===a||0===a.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:a.length,start:ca.bind(null,"start",0,a),end:ca.bind(null,"end",1,a)}}function ea(a,b){return Array.isArray(a)?da(a):void 0===a||void 0===b?da():da([[a,b]])}function fa(a,b){var c=0,d=void 0,e=void 0;if(!b)return 0;a&&a.length||(a=ea(0,0));for(var f=0;f<a.length;f++)d=a.start(f),e=a.end(f),e>b&&(e=b),c+=e-d;return c/b}function ga(a){return a instanceof ga?a:("number"==typeof a?this.code=a:"string"==typeof a?this.message=a:f(a)&&("number"==typeof a.code&&(this.code=a.code),e(this,a)),void(this.message||(this.message=ga.defaultMessages[this.code]||"")))}function ha(a,b){var c,d=null;try{c=JSON.parse(a,b)}catch(e){d=e}return[d,c]}function ia(a){return void 0!==a&&null!==a&&"function"==typeof a.then}function ja(a){ia(a)&&a.then(null,function(a){})}function ka(a){var b=qd.call(a);return"[object Function]"===b||"function"==typeof a&&"[object RegExp]"!==b||"undefined"!=typeof window&&(a===window.setTimeout||a===window.alert||a===window.confirm||a===window.prompt)}function la(a,b,c){if(!wd(b))throw new TypeError("iterator must be a function");arguments.length<3&&(c=this),"[object Array]"===yd.call(a)?ma(a,b,c):"string"==typeof a?na(a,b,c):oa(a,b,c)}function ma(a,b,c){for(var d=0,e=a.length;e>d;d++)zd.call(a,d)&&b.call(c,a[d],d,a)}function na(a,b,c){for(var d=0,e=a.length;e>d;d++)b.call(c,a.charAt(d),d,a)}function oa(a,b,c){for(var d in a)zd.call(a,d)&&b.call(c,a[d],d,a)}function pa(){for(var a={},b=0;b<arguments.length;b++){var c=arguments[b];for(var d in c)Hd.call(c,d)&&(a[d]=c[d])}return a}function qa(a,b){for(var c=0;c<a.length;c++)b(a[c])}function ra(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function sa(a,b,c){var d=a;return wd(b)?(c=b,"string"==typeof a&&(d={uri:a})):d=Kd(b,{uri:a}),d.callback=c,d}function ta(a,b,c){return b=sa(a,b,c),ua(b)}function ua(a){function b(){4===h.readyState&&setTimeout(e,0)}function c(){var a=void 0;if(a=h.response?h.response:h.responseText||va(h),q)try{a=JSON.parse(a)}catch(b){}return a}function d(a){return clearTimeout(k),a instanceof Error||(a=new Error(""+(a||"Unknown XMLHttpRequest Error"))),a.statusCode=0,g(a,r)}function e(){if(!j){var b;clearTimeout(k),b=a.useXDR&&void 0===h.status?200:1223===h.status?204:h.status;var d=r,e=null;return 0!==b?(d={body:c(),statusCode:b,method:m,headers:{},url:l,rawRequest:h},h.getAllResponseHeaders&&(d.headers=Jd(h.getAllResponseHeaders()))):e=new Error("Internal XMLHttpRequest Error"),g(e,d,d.body)}}if("undefined"==typeof a.callback)throw new Error("callback argument missing");var f=!1,g=function(b,c,d){f||(f=!0,a.callback(b,c,d))},h=a.xhr||null;h||(h=a.cors||a.useXDR?new ta.XDomainRequest:new ta.XMLHttpRequest);var i,j,k,l=h.url=a.uri||a.url,m=h.method=a.method||"GET",n=a.body||a.data,o=h.headers=a.headers||{},p=!!a.sync,q=!1,r={body:void 0,headers:{},statusCode:0,method:m,url:l,rawRequest:h};if("json"in a&&a.json!==!1&&(q=!0,o.accept||o.Accept||(o.Accept="application/json"),"GET"!==m&&"HEAD"!==m&&(o["content-type"]||o["Content-Type"]||(o["Content-Type"]="application/json"),n=JSON.stringify(a.json===!0?n:a.json))),h.onreadystatechange=b,h.onload=e,h.onerror=d,h.onprogress=function(){},h.onabort=function(){j=!0},h.ontimeout=d,h.open(m,l,!p,a.username,a.password),p||(h.withCredentials=!!a.withCredentials),!p&&a.timeout>0&&(k=setTimeout(function(){if(!j){j=!0,h.abort("timeout");var a=new Error("XMLHttpRequest timeout");a.code="ETIMEDOUT",d(a)}},a.timeout)),h.setRequestHeader)for(i in o)o.hasOwnProperty(i)&&h.setRequestHeader(i,o[i]);else if(a.headers&&!ra(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(h.responseType=a.responseType),"beforeSend"in a&&"function"==typeof a.beforeSend&&a.beforeSend(h),h.send(n||null),h}function va(a){if("document"===a.responseType)return a.responseXML;var b=a.responseXML&&"parsererror"===a.responseXML.documentElement.nodeName;return""!==a.responseType||b?null:a.responseXML}function wa(){}function xa(a,b){this.name="ParsingError",this.code=a.code,this.message=b||a.message}function ya(a){function b(a,b,c,d){return 3600*(0|a)+60*(0|b)+(0|c)+(0|d)/1e3}var c=a.match(/^(\d+):(\d{2})(:\d{2})?\.(\d{3})/);return c?c[3]?b(c[1],c[2],c[3].replace(":",""),c[4]):c[1]>59?b(c[1],c[2],0,c[4]):b(0,c[1],c[2],c[4]):null}function za(){this.values=Zd(null)}function Aa(a,b,c,d){var e=d?a.split(d):[a];for(var f in e)if("string"==typeof e[f]){var g=e[f].split(c);if(2===g.length){var h=g[0],i=g[1];b(h,i)}}}function Ba(a,b,c){function d(){var b=ya(a);if(null===b)throw new xa(xa.Errors.BadTimeStamp,"Malformed timestamp: "+g);return a=a.replace(/^[^\sa-zA-Z-]+/,""),b}function e(a,b){var d=new za;Aa(a,function(a,b){switch(a){case"region":for(var e=c.length-1;e>=0;e--)if(c[e].id===b){d.set(a,c[e].region);break}break;case"vertical":d.alt(a,b,["rl","lr"]);break;case"line":var f=b.split(","),g=f[0];d.integer(a,g),d.percent(a,g)?d.set("snapToLines",!1):null,d.alt(a,g,["auto"]),2===f.length&&d.alt("lineAlign",f[1],["start","middle","end"]);break;case"position":f=b.split(","),d.percent(a,f[0]),2===f.length&&d.alt("positionAlign",f[1],["start","middle","end"]);break;case"size":d.percent(a,b);break;case"align":d.alt(a,b,["start","middle","end","left","right"])}},/:/,/\s/),b.region=d.get("region",null),b.vertical=d.get("vertical",""),b.line=d.get("line","auto"),b.lineAlign=d.get("lineAlign","start"),b.snapToLines=d.get("snapToLines",!0),b.size=d.get("size",100),b.align=d.get("align","middle"),b.position=d.get("position",{start:0,left:0,middle:50,end:100,right:100},b.align),b.positionAlign=d.get("positionAlign",{start:"start",left:"start",middle:"middle",end:"end",right:"end"},b.align)}function f(){a=a.replace(/^\s+/,"")}var g=a;if(f(),b.startTime=d(),f(),"-->"!==a.substr(0,3))throw new xa(xa.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+g);a=a.substr(3),f(),b.endTime=d(),f(),e(a,b)}function Ca(a,b){function c(){function a(a){return b=b.substr(a.length),a}if(!b)return null;var c=b.match(/^([^<]*)(<[^>]*>?)?/);return a(c[1]?c[1]:c[2])}function d(a){return $d[a]}function e(a){for(;n=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(n[0],d);return a}function f(a,b){return!be[b.localName]||be[b.localName]===a.localName}function g(b,c){var d=_d[b];if(!d)return null;var e=a.document.createElement(d);e.localName=d;var f=ae[b];return f&&c&&(e[f]=c.trim()),e}for(var h,i=a.document.createElement("div"),j=i,k=[];null!==(h=c());)if("<"!==h[0])j.appendChild(a.document.createTextNode(e(h)));else{if("/"===h[1]){k.length&&k[k.length-1]===h.substr(2).replace(">","")&&(k.pop(),j=j.parentNode);continue}var l,m=ya(h.substr(1,h.length-2));if(m){l=a.document.createProcessingInstruction("timestamp",m),j.appendChild(l);continue}var n=h.match(/^<([^.\s\/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!n)continue;if(l=g(n[1],n[3]),!l)continue;if(!f(j,l))continue;n[2]&&(l.className=n[2].substr(1).replace("."," ")),k.push(n[1]),j.appendChild(l),j=l}return i}function Da(a){for(var b=0;b<ce.length;b++){var c=ce[b];if(a>=c[0]&&a<=c[1])return!0}return!1}function Ea(a){function b(a,b){for(var c=b.childNodes.length-1;c>=0;c--)a.push(b.childNodes[c])}function c(a){if(!a||!a.length)return null;var d=a.pop(),e=d.textContent||d.innerText;if(e){var f=e.match(/^.*(\n|\r)/);return f?(a.length=0,f[0]):e}return"ruby"===d.tagName?c(a):d.childNodes?(b(a,d),c(a)):void 0}var d,e=[],f="";if(!a||!a.childNodes)return"ltr";for(b(e,a);f=c(e);)for(var g=0;g<f.length;g++)if(d=f.charCodeAt(g),Da(d))return"rtl";return"ltr"}function Fa(a){if("number"==typeof a.line&&(a.snapToLines||a.line>=0&&a.line<=100))return a.line;if(!a.track||!a.track.textTrackList||!a.track.textTrackList.mediaElement)return-1;for(var b=a.track,c=b.textTrackList,d=0,e=0;e<c.length&&c[e]!==b;e++)"showing"===c[e].mode&&d++;return-1*++d}function Ga(){}function Ha(a,b,c){Ga.call(this),this.cue=b,this.cueDiv=Ca(a,b.text);var d={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===b.vertical?"horizontal-tb":"lr"===b.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(d,this.cueDiv),this.div=a.document.createElement("div"),d={direction:Ea(this.cueDiv),writingMode:""===b.vertical?"horizontal-tb":"lr"===b.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===b.align?"center":b.align,font:c.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(d),this.div.appendChild(this.cueDiv);var e=0;switch(b.positionAlign){case"start":e=b.position;break;case"middle":e=b.position-b.size/2;break;case"end":e=b.position-b.size}""===b.vertical?this.applyStyles({left:this.formatStyle(e,"%"),width:this.formatStyle(b.size,"%")}):this.applyStyles({top:this.formatStyle(e,"%"),height:this.formatStyle(b.size,"%")}),this.move=function(a){this.applyStyles({top:this.formatStyle(a.top,"px"),bottom:this.formatStyle(a.bottom,"px"),left:this.formatStyle(a.left,"px"),right:this.formatStyle(a.right,"px"),height:this.formatStyle(a.height,"px"),width:this.formatStyle(a.width,"px")})}}function Ia(a){var b,c,d,e;if(a.div){c=a.div.offsetHeight,d=a.div.offsetWidth,e=a.div.offsetTop;var f=(f=a.div.childNodes)&&(f=f[0])&&f.getClientRects&&f.getClientRects();a=a.div.getBoundingClientRect(),b=f?Math.max(f[0]&&f[0].height||0,a.height/f.length):0}this.left=a.left,this.right=a.right,this.top=a.top||e,this.height=a.height||c,this.bottom=a.bottom||e+(a.height||c),this.width=a.width||d,this.lineHeight=void 0!==b?b:a.lineHeight}function Ja(a,b,c,d){function e(a,b){for(var e,f=new Ia(a),g=1,h=0;h<b.length;h++){for(;a.overlapsOppositeAxis(c,b[h])||a.within(c)&&a.overlapsAny(d);)a.move(b[h]);if(a.within(c))return a;var i=a.intersectPercentage(c);g>i&&(e=new Ia(a),g=i),a=new Ia(f)}return e||f}var f=new Ia(b),g=b.cue,h=Fa(g),i=[];if(g.snapToLines){var j;switch(g.vertical){case"":i=["+y","-y"],j="height";break;case"rl":i=["+x","-x"],j="width";break;case"lr":i=["-x","+x"],j="width"}var k=f.lineHeight,l=k*Math.round(h),m=c[j]+k,n=i[0];Math.abs(l)>m&&(l=0>l?-1:1,l*=Math.ceil(m/k)*k),0>h&&(l+=""===g.vertical?c.height:c.width,i=i.reverse()),f.move(n,l)}else{var o=f.lineHeight/c.height*100;switch(g.lineAlign){case"middle":h-=o/2;break;case"end":h-=o}switch(g.vertical){case"":b.applyStyles({top:b.formatStyle(h,"%")});break;case"rl":b.applyStyles({left:b.formatStyle(h,"%")});break;case"lr":b.applyStyles({right:b.formatStyle(h,"%")})}i=["+y","-x","+x","-y"],f=new Ia(b)}var p=e(f,i);b.move(p.toCSSCompatValues(c))}function Ka(){}function La(a){if("string"!=typeof a)return!1;var b=je[a.toLowerCase()];return b?a.toLowerCase():!1}function Ma(a){if("string"!=typeof a)return!1;var b=ke[a.toLowerCase()];return b?a.toLowerCase():!1}function Na(a,b,c){this.hasBeenReset=!1;var d="",e=!1,f=a,g=b,h=c,i=null,j="",k=!0,l="auto",m="start",n=50,o="middle",p=50,q="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return d},set:function(a){d=""+a}},pauseOnExit:{enumerable:!0,get:function(){return e},set:function(a){e=!!a}},startTime:{enumerable:!0,get:function(){return f},set:function(a){if("number"!=typeof a)throw new TypeError("Start time must be set to a number.");f=a,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return g},set:function(a){if("number"!=typeof a)throw new TypeError("End time must be set to a number.");g=a,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return h},set:function(a){h=""+a,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return i},set:function(a){i=a,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return j},set:function(a){var b=La(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");j=b,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return k},set:function(a){k=!!a,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return l},set:function(a){if("number"!=typeof a&&a!==ie)throw new SyntaxError("An invalid number or illegal string was specified.");l=a,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return m},set:function(a){var b=Ma(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");m=b,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return n},set:function(a){if(0>a||a>100)throw new Error("Position must be between 0 and 100.");n=a,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return o},set:function(a){var b=Ma(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");o=b,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return p},set:function(a){if(0>a||a>100)throw new Error("Size must be between 0 and 100.");p=a,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return q},set:function(a){var b=Ma(a);if(!b)throw new SyntaxError("An invalid or illegal string was specified.");q=b,this.hasBeenReset=!0}}}),this.displayState=void 0}function Oa(a){if("string"!=typeof a)return!1;var b=ne[a.toLowerCase()];return b?a.toLowerCase():!1}function Pa(a){return"number"==typeof a&&a>=0&&100>=a}function Qa(){var a=100,b=3,c=0,d=100,e=0,f=100,g="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return a},set:function(b){if(!Pa(b))throw new Error("Width must be between 0 and 100.");a=b}},lines:{enumerable:!0,get:function(){return b},set:function(a){if("number"!=typeof a)throw new TypeError("Lines must be set to a number.");b=a}},regionAnchorY:{enumerable:!0,get:function(){return d},set:function(a){if(!Pa(a))throw new Error("RegionAnchorX must be between 0 and 100.");d=a}},regionAnchorX:{enumerable:!0,get:function(){return c},set:function(a){if(!Pa(a))throw new Error("RegionAnchorY must be between 0 and 100.");c=a}},viewportAnchorY:{enumerable:!0,get:function(){return f},set:function(a){if(!Pa(a))throw new Error("ViewportAnchorY must be between 0 and 100.");f=a}},viewportAnchorX:{enumerable:!0,get:function(){return e},set:function(a){if(!Pa(a))throw new Error("ViewportAnchorX must be between 0 and 100.");e=a}},scroll:{enumerable:!0,get:function(){return g},set:function(a){var b=Oa(a);if(b===!1)throw new SyntaxError("An invalid or illegal string was specified.");g=b}}})}function Ra(a,b,c,d){var e=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},f=a.textTracks();e.kind=b,c&&(e.label=c),d&&(e.language=d),e.tech=a;var g=new Yd.text.TrackClass(e);return f.addTrack(g),g}function Sa(a,b){ve[a]=ve[a]||[],ve[a].push(b)}function Ta(a,b,c){a.setTimeout(function(){return ab(b,ve[b.type],c,a)},1)}function Ua(a,b){a.forEach(function(a){return a.setTech&&a.setTech(b)})}function Va(a,b,c){return a.reduceRight(Ya(c),b[c]())}function Wa(a,b,c,d){return b[c](a.reduce(Ya(c),d))}function Xa(a,b,c){var d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,e="call"+$(c),f=a.reduce(Ya(e),d),g=f===xe,h=g?null:b[c](f);return Za(a,c,h,g),h}function Ya(a){return function(b,c){return b===xe?xe:c[a]?c[a](b):b}}function Za(a,b,c,d){for(var e=a.length-1;e>=0;e--){var f=a[e];f[b]&&f[b](d,c)}}function $a(a){we[a.id()]=null}function _a(a,b){var c=we[a.id()],d=null;if(void 0===c||null===c)return d=b(a),we[a.id()]=[[b,d]],d;for(var e=0;e<c.length;e++){var f=c[e],g=f[0],h=f[1];g===b&&(d=h)}return null===d&&(d=b(a),c.push([b,d])),d}function ab(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],c=arguments[2],d=arguments[3],f=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],g=arguments.length>5&&void 0!==arguments[5]?arguments[5]:!1,h=b[0],i=b.slice(1);if("string"==typeof h)ab(a,ve[h],c,d,f,g);else if(h){var j=_a(d,h);j.setSource(e({},a),function(b,e){return b?ab(a,i,c,d,f,g):(f.push(j),void ab(e,a.type===e.type?i:ve[e.type],c,d,f,g))})}else i.length?ab(a,i,c,d,f,g):g?c(a,f):ab(a,ve["*"],c,d,f,!0)}function bb(a){var b=Ce(a.src);return!a.type&&b&&(a.type=b),a}function cb(a,b){return"rgba("+parseInt(a[1]+a[1],16)+","+parseInt(a[2]+a[2],16)+","+parseInt(a[3]+a[3],16)+","+b+")"}function db(a,b,c){try{a.style[b]=c}catch(d){return}}function eb(a){Se=a}function fb(){Se=Re}function gb(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;return Se(a,b)}function hb(a,b){return b&&(a=b(a)),a&&"none"!==a?a:void 0}function ib(a,b){var c=a.options[a.options.selectedIndex].value;return hb(c,b)}function jb(a,b,c){if(b)for(var d=0;d<a.options.length;d++)if(hb(a.options[d].value,c)===b){a.selectedIndex=d;break}}function kb(a,b,c){var d=kb.getPlayer(a);if(d)return b&&Fb.warn('Player "'+a+'" is already initialised. Options will not be applied.'),c&&d.ready(c),d;var e="string"==typeof a?Pb("#"+Cg(a)):a;if(!m(e))throw new TypeError("The element or ID supplied is not valid. (videojs)");Ab.body.contains(e)||Fb.warn("The element supplied is not included in the DOM"),b=b||{},kb.hooks("beforesetup").forEach(function(a){var c=a(e,aa(b));return!f(c)||Array.isArray(c)?void Fb.error("please return an object in beforesetup hooks"):void(b=aa(b,c))});var g=oc.getComponent("Player");return d=new g(e,b,c),kb.hooks("setup").forEach(function(a){return a(d)}),d}function lb(a){for(var b=vb.atob(a),c=new Uint8Array(b.length),d=0;d<b.length;d++)c[d]=b.charCodeAt(d);return c}function mb(a){return a.subarray(0,a.byteLength-a[a.byteLength-1])}function nb(a,b){return function(c){var d=this;if(!b)return new Hk(a);if(Hk&&!c){var e=b.toString().replace(/^function.+?{/,"").slice(0,-1),f=ob(e);return this[Dk]=new Hk(f),pb(this[Dk],f),this[Dk]}var g={postMessage:function(a){d.onmessage&&setTimeout(function(){d.onmessage({data:a,target:g})})}};b.call(g),this.postMessage=function(a){setTimeout(function(){g.onmessage({data:a,target:d})})},this.isThisThread=!0}}function ob(a){try{return Gk.createObjectURL(new Blob([a],{type:Ek}))}catch(b){var c=new Fk;return c.append(a),Gk.createObjectURL(c.getBlob(type))}}function pb(a,b){if(a&&b){var c=a.terminate;a.objURL=b,a.terminate=function(){a.objURL&&Gk.revokeObjectURL(a.objURL),c.call(a)}}}function qb(){}var rb,sb="7.0.2",tb="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};rb="undefined"!=typeof window?window:"undefined"!=typeof tb?tb:"undefined"!=typeof self?self:{};var ub,vb=rb,wb={},xb=Object.freeze({"default":wb}),yb=xb&&wb||xb,zb="undefined"!=typeof tb?tb:"undefined"!=typeof window?window:{};"undefined"!=typeof document?ub=document:(ub=zb["__GLOBAL_DOCUMENT_CACHE@4"],ub||(ub=zb["__GLOBAL_DOCUMENT_CACHE@4"]=yb));var Ab=ub,Bb=void 0,Cb="info",Db=[],Eb=function(a,b){var c=Bb.levels[Cb],d=new RegExp("^("+c+")$");if("log"!==a&&b.unshift(a.toUpperCase()+":"),Db&&Db.push([].concat(b)),b.unshift("VIDEOJS:"),vb.console){var e=vb.console[a];e||"debug"!==a||(e=vb.console.info||vb.console.log),e&&c&&d.test(a)&&e[Array.isArray(b)?"apply":"call"](vb.console,b)}};Bb=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];Eb("log",b)},Bb.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:Cb},Bb.level=function(a){if("string"==typeof a){if(!Bb.levels.hasOwnProperty(a))throw new Error('"'+a+'" in not a valid log level');Cb=a}return Cb},Bb.history=function(){return Db?[].concat(Db):[]},Bb.history.clear=function(){Db&&(Db.length=0)},Bb.history.disable=function(){null!==Db&&(Db.length=0,Db=null)},Bb.history.enable=function(){null===Db&&(Db=[])},Bb.error=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return Eb("error",b)},Bb.warn=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return Eb("warn",b)},Bb.debug=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return Eb("debug",b)};var Fb=Bb,Gb=function(a){for(var c="",d=0;d<arguments.length;d++)c+=b(a[d])+(arguments[d+1]||"");return c},Hb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Ib=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},Jb=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+typeof b);a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)},Kb=function(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!=typeof b&&"function"!=typeof b?a:b},Lb=function(a,b){return a.raw=b,a},Mb=Object.prototype.toString,Nb=function(a){return f(a)?Object.keys(a):[]},Ob=Lb(["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."],["Setting attributes in the second argument of createEl()\n has been deprecated. Use the third argument instead.\n createEl(type, properties, attributes). Attempting to set "," to ","."]),Pb=o("querySelector"),Qb=o("querySelectorAll"),Rb=Object.freeze({isReal:l,isEl:m,isInFrame:n,createEl:p,textContent:q,prependTo:r,hasClass:s,addClass:t,removeClass:u,toggleClass:v,setAttributes:w,getAttributes:x,getAttribute:y,setAttribute:z,removeAttribute:A,blockTextSelection:B,unblockTextSelection:C,getBoundingClientRect:D,findPosition:E,getPointerPosition:F,isTextNode:G,emptyEl:H,normalizeContent:I,appendContent:J,insertContent:K,isSingleLeftClick:L,$:Pb,$$:Qb}),Sb=1,Tb={},Ub="vdata"+(new Date).getTime(),Vb=!1;!function(){try{var a=Object.defineProperty({},"passive",{get:function(){Vb=!0}});vb.addEventListener("test",null,a),vb.removeEventListener("test",null,a)}catch(b){}}();var Wb=["touchstart","touchmove"],Xb=Object.freeze({fixEvent:S,on:T,off:U,trigger:V,one:W}),Yb=!1,Zb=void 0,$b=function(){if(l()&&Zb.options.autoSetup!==!1){var a=Array.prototype.slice.call(Ab.getElementsByTagName("video")),b=Array.prototype.slice.call(Ab.getElementsByTagName("audio")),c=Array.prototype.slice.call(Ab.getElementsByTagName("video-js")),d=a.concat(b,c);if(d&&d.length>0)for(var e=0,f=d.length;f>e;e++){var g=d[e];if(!g||!g.getAttribute){X(1);break}if(void 0===g.player){var h=g.getAttribute("data-setup");null!==h&&Zb(g)}}else Yb||X(1)}};l()&&"complete"===Ab.readyState?Yb=!0:W(vb,"load",function(){
- Yb=!0});var _b=function(a){var b=Ab.createElement("style");return b.className=a,b},ac=function(a,b){a.styleSheet?a.styleSheet.cssText=b:a.textContent=b},bc=function(a,b,c){b.guid||(b.guid=M());var d=function(){return b.apply(a,arguments)};return d.guid=c?c+"_"+b.guid:b.guid,d},cc=function(a,b){var c=Date.now(),d=function(){var d=Date.now();d-c>=b&&(a.apply(void 0,arguments),c=d)};return d},dc=function(a,b,c){var d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:vb,e=void 0;return function(){var f=this,g=arguments,h=function(){e=null,h=null,c||a.apply(f,g)};!e&&c&&a.apply(f,g),d.clearTimeout(e),e=d.setTimeout(h,b)}},ec=function(){};ec.prototype.allowedEvents_={},ec.prototype.on=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},T(this,a,b),this.addEventListener=c},ec.prototype.addEventListener=ec.prototype.on,ec.prototype.off=function(a,b){U(this,a,b)},ec.prototype.removeEventListener=ec.prototype.off,ec.prototype.one=function(a,b){var c=this.addEventListener;this.addEventListener=function(){},W(this,a,b),this.addEventListener=c},ec.prototype.trigger=function(a){var b=a.type||a;"string"==typeof a&&(a={type:b}),a=S(a),this.allowedEvents_[b]&&this["on"+b]&&this["on"+b](a),V(this,a)},ec.prototype.dispatchEvent=ec.prototype.trigger;var fc=function(a){return a instanceof ec||!!a.eventBusEl_&&["on","one","off","trigger"].every(function(b){return"function"==typeof a[b]})},gc=function(a){return"string"==typeof a&&/\S/.test(a)||Array.isArray(a)&&!!a.length},hc=function(a){if(!a.nodeName&&!fc(a))throw new Error("Invalid target; must be a DOM node or evented object.")},ic=function(a){if(!gc(a))throw new Error("Invalid event type; must be a non-empty string or array.")},jc=function(a){if("function"!=typeof a)throw new Error("Invalid listener; must be a function.")},kc=function(a,b){var c=b.length<3||b[0]===a||b[0]===a.eventBusEl_,d=void 0,e=void 0,f=void 0;return c?(d=a.eventBusEl_,b.length>=3&&b.shift(),e=b[0],f=b[1]):(d=b[0],e=b[1],f=b[2]),hc(d),ic(e),jc(f),f=bc(a,f),{isTargetingSelf:c,target:d,type:e,listener:f}},lc=function(a,b,c,d){hc(a),a.nodeName?Xb[b](a,c,d):a[b](c,d)},mc={on:function(){for(var a=this,b=arguments.length,c=Array(b),d=0;b>d;d++)c[d]=arguments[d];var e=kc(this,c),f=e.isTargetingSelf,g=e.target,h=e.type,i=e.listener;if(lc(g,"on",h,i),!f){var j=function(){return a.off(g,h,i)};j.guid=i.guid;var k=function(){return a.off("dispose",j)};k.guid=i.guid,lc(this,"on","dispose",j),lc(g,"on","dispose",k)}},one:function(){for(var a=this,b=arguments.length,c=Array(b),d=0;b>d;d++)c[d]=arguments[d];var e=kc(this,c),f=e.isTargetingSelf,g=e.target,h=e.type,i=e.listener;if(f)lc(g,"one",h,i);else{var j=function k(){for(var b=arguments.length,c=Array(b),d=0;b>d;d++)c[d]=arguments[d];a.off(g,h,k),i.apply(null,c)};j.guid=i.guid,lc(g,"one",h,j)}},off:function(a,b,c){if(!a||gc(a))U(this.eventBusEl_,a,b);else{var d=a,e=b;hc(d),ic(e),jc(c),c=bc(this,c),this.off("dispose",c),d.nodeName?(U(d,e,c),U(d,"dispose",c)):fc(d)&&(d.off(e,c),d.off("dispose",c))}},trigger:function(a,b){return V(this.eventBusEl_,a,b)}},nc={state:{},setState:function(a){var b=this;"function"==typeof a&&(a=a());var d=void 0;return c(a,function(a,c){b.state[c]!==a&&(d=d||{},d[c]={from:b.state[c],to:a}),b.state[c]=a}),d&&fc(this)&&this.trigger({changes:d,type:"statechanged"}),d}},oc=function(){function a(b,c,d){if(Ib(this,a),!b&&this.play?this.player_=b=this:this.player_=b,this.options_=aa({},this.options_),c=this.options_=aa(this.options_,c),this.id_=c.id||c.el&&c.el.id,!this.id_){var e=b&&b.id&&b.id()||"no_player";this.id_=e+"_component_"+M()}this.name_=c.name||null,c.el?this.el_=c.el:c.createEl!==!1&&(this.el_=this.createEl()),c.evented!==!1&&Y(this,{eventBusKey:this.el_?"el_":null}),Z(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},c.initChildren!==!1&&this.initChildren(),this.ready(d),c.reportTouchActivity!==!1&&this.enableTouchActivity()}return a.prototype.dispose=function(){if(this.trigger({type:"dispose",bubbles:!1}),this.children_)for(var a=this.children_.length-1;a>=0;a--)this.children_[a].dispose&&this.children_[a].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.el_&&(this.el_.parentNode&&this.el_.parentNode.removeChild(this.el_),P(this.el_),this.el_=null),this.player_=null},a.prototype.player=function(){return this.player_},a.prototype.options=function(a){return Fb.warn("this.options() has been deprecated and will be moved to the constructor in 6.0"),a?(this.options_=aa(this.options_,a),this.options_):this.options_},a.prototype.el=function(){return this.el_},a.prototype.createEl=function(a,b,c){return p(a,b,c)},a.prototype.localize=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a,d=this.player_.language&&this.player_.language(),e=this.player_.languages&&this.player_.languages(),f=e&&e[d],g=d&&d.split("-")[0],h=e&&e[g],i=c;return f&&f[a]?i=f[a]:h&&h[a]&&(i=h[a]),b&&(i=i.replace(/\{(\d+)\}/g,function(a,c){var d=b[c-1],e=d;return"undefined"==typeof d&&(e=a),e})),i},a.prototype.contentEl=function(){return this.contentEl_||this.el_},a.prototype.id=function(){return this.id_},a.prototype.name=function(){return this.name_},a.prototype.children=function(){return this.children_},a.prototype.getChildById=function(a){return this.childIndex_[a]},a.prototype.getChild=function(a){return a?(a=$(a),this.childNameIndex_[a]):void 0},a.prototype.addChild=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.children_.length,e=void 0,f=void 0;if("string"==typeof b){f=$(b);var g=c.componentClass||f;c.name=f;var h=a.getComponent(g);if(!h)throw new Error("Component "+g+" does not exist");if("function"!=typeof h)return null;e=new h(this.player_||this,c)}else e=b;if(this.children_.splice(d,0,e),"function"==typeof e.id&&(this.childIndex_[e.id()]=e),f=f||e.name&&$(e.name()),f&&(this.childNameIndex_[f]=e),"function"==typeof e.el&&e.el()){var i=this.contentEl().children,j=i[d]||null;this.contentEl().insertBefore(e.el(),j)}return e},a.prototype.removeChild=function(a){if("string"==typeof a&&(a=this.getChild(a)),a&&this.children_){for(var b=!1,c=this.children_.length-1;c>=0;c--)if(this.children_[c]===a){b=!0,this.children_.splice(c,1);break}if(b){this.childIndex_[a.id()]=null,this.childNameIndex_[a.name()]=null;var d=a.el();d&&d.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el())}}},a.prototype.initChildren=function(){var b=this,c=this.options_.children;if(c){var d=this.options_,e=function(a){var c=a.name,e=a.opts;if(void 0!==d[c]&&(e=d[c]),e!==!1){e===!0&&(e={}),e.playerOptions=b.options_.playerOptions;var f=b.addChild(c,e);f&&(b[c]=f)}},f=void 0,g=a.getComponent("Tech");f=Array.isArray(c)?c:Object.keys(c),f.concat(Object.keys(this.options_).filter(function(a){return!f.some(function(b){return"string"==typeof b?a===b:a===b.name})})).map(function(a){var d=void 0,e=void 0;return"string"==typeof a?(d=a,e=c[d]||b.options_[d]||{}):(d=a.name,e=a),{name:d,opts:e}}).filter(function(b){var c=a.getComponent(b.opts.componentClass||$(b.name));return c&&!g.isTech(c)}).forEach(e)}},a.prototype.buildCSSClass=function(){return""},a.prototype.ready=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!1;if(a)return this.isReady_?void(b?a.call(this):this.setTimeout(a,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(a))},a.prototype.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var a=this.readyQueue_;this.readyQueue_=[],a&&a.length>0&&a.forEach(function(a){a.call(this)},this),this.trigger("ready")},1)},a.prototype.$=function(a,b){return Pb(a,b||this.contentEl())},a.prototype.$$=function(a,b){return Qb(a,b||this.contentEl())},a.prototype.hasClass=function(a){return s(this.el_,a)},a.prototype.addClass=function(a){t(this.el_,a)},a.prototype.removeClass=function(a){u(this.el_,a)},a.prototype.toggleClass=function(a,b){v(this.el_,a,b)},a.prototype.show=function(){this.removeClass("vjs-hidden")},a.prototype.hide=function(){this.addClass("vjs-hidden")},a.prototype.lockShowing=function(){this.addClass("vjs-lock-showing")},a.prototype.unlockShowing=function(){this.removeClass("vjs-lock-showing")},a.prototype.getAttribute=function(a){return y(this.el_,a)},a.prototype.setAttribute=function(a,b){z(this.el_,a,b)},a.prototype.removeAttribute=function(a){A(this.el_,a)},a.prototype.width=function(a,b){return this.dimension("width",a,b)},a.prototype.height=function(a,b){return this.dimension("height",a,b)},a.prototype.dimensions=function(a,b){this.width(a,!0),this.height(b)},a.prototype.dimension=function(a,b,c){if(void 0!==b)return(null===b||b!==b)&&(b=0),-1!==(""+b).indexOf("%")||-1!==(""+b).indexOf("px")?this.el_.style[a]=b:"auto"===b?this.el_.style[a]="":this.el_.style[a]=b+"px",void(c||this.trigger("componentresize"));if(!this.el_)return 0;var d=this.el_.style[a],e=d.indexOf("px");return-1!==e?parseInt(d.slice(0,e),10):parseInt(this.el_["offset"+$(a)],10)},a.prototype.currentDimension=function(a){var b=0;if("width"!==a&&"height"!==a)throw new Error("currentDimension only accepts width or height value");if("function"==typeof vb.getComputedStyle){var c=vb.getComputedStyle(this.el_);b=c.getPropertyValue(a)||c[a]}if(b=parseFloat(b),0===b){var d="offset"+$(a);b=this.el_[d]}return b},a.prototype.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},a.prototype.currentWidth=function(){return this.currentDimension("width")},a.prototype.currentHeight=function(){return this.currentDimension("height")},a.prototype.focus=function(){this.el_.focus()},a.prototype.blur=function(){this.el_.blur()},a.prototype.emitTapEvents=function(){var a=0,b=null,c=10,d=200,e=void 0;this.on("touchstart",function(c){1===c.touches.length&&(b={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY},a=(new Date).getTime(),e=!0)}),this.on("touchmove",function(a){if(a.touches.length>1)e=!1;else if(b){var d=a.touches[0].pageX-b.pageX,f=a.touches[0].pageY-b.pageY,g=Math.sqrt(d*d+f*f);g>c&&(e=!1)}});var f=function(){e=!1};this.on("touchleave",f),this.on("touchcancel",f),this.on("touchend",function(c){if(b=null,e===!0){var f=(new Date).getTime()-a;d>f&&(c.preventDefault(),this.trigger("tap"))}})},a.prototype.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var a=bc(this.player(),this.player().reportUserActivity),b=void 0;this.on("touchstart",function(){a(),this.clearInterval(b),b=this.setInterval(a,250)});var c=function(c){a(),this.clearInterval(b)};this.on("touchmove",a),this.on("touchend",c),this.on("touchcancel",c)}},a.prototype.setTimeout=function(a,b){var c=this;a=bc(this,a);var d=vb.setTimeout(a,b),e=function(){return c.clearTimeout(d)};return e.guid="vjs-timeout-"+d,this.on("dispose",e),d},a.prototype.clearTimeout=function(a){vb.clearTimeout(a);var b=function(){};return b.guid="vjs-timeout-"+a,this.off("dispose",b),a},a.prototype.setInterval=function(a,b){var c=this;a=bc(this,a);var d=vb.setInterval(a,b),e=function(){return c.clearInterval(d)};return e.guid="vjs-interval-"+d,this.on("dispose",e),d},a.prototype.clearInterval=function(a){vb.clearInterval(a);var b=function(){};return b.guid="vjs-interval-"+a,this.off("dispose",b),a},a.prototype.requestAnimationFrame=function(a){var b=this;if(this.supportsRaf_){a=bc(this,a);var c=vb.requestAnimationFrame(a),d=function(){return b.cancelAnimationFrame(c)};return d.guid="vjs-raf-"+c,this.on("dispose",d),c}return this.setTimeout(a,1e3/60)},a.prototype.cancelAnimationFrame=function(a){if(this.supportsRaf_){vb.cancelAnimationFrame(a);var b=function(){};return b.guid="vjs-raf-"+a,this.off("dispose",b),a}return this.clearTimeout(a)},a.registerComponent=function(b,c){if("string"!=typeof b||!b)throw new Error('Illegal component name, "'+b+'"; must be a non-empty string.');var d=a.getComponent("Tech"),e=d&&d.isTech(c),f=a===c||a.prototype.isPrototypeOf(c.prototype);if(e||!f){var g=void 0;throw g=e?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error('Illegal component, "'+b+'"; '+g+".")}b=$(b),a.components_||(a.components_={});var h=a.getComponent("Player");if("Player"===b&&h&&h.players){var i=h.players,j=Object.keys(i);if(i&&j.length>0&&j.map(function(a){return i[a]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return a.components_[b]=c,c},a.getComponent=function(b){return b?(b=$(b),a.components_&&a.components_[b]?a.components_[b]:void 0):void 0},a}();oc.prototype.supportsRaf_="function"==typeof vb.requestAnimationFrame&&"function"==typeof vb.cancelAnimationFrame,oc.registerComponent("Component",oc);for(var pc=vb.navigator&&vb.navigator.userAgent||"",qc=/AppleWebKit\/([\d.]+)/i.exec(pc),rc=qc?parseFloat(qc.pop()):null,sc=/iPad/i.test(pc),tc=/iPhone/i.test(pc)&&!sc,uc=/iPod/i.test(pc),vc=tc||sc||uc,wc=function(){var a=pc.match(/OS (\d+)_/i);return a&&a[1]?a[1]:null}(),xc=/Android/i.test(pc),yc=function(){var a=pc.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!a)return null;var b=a[1]&&parseFloat(a[1]),c=a[2]&&parseFloat(a[2]);return b&&c?parseFloat(a[1]+"."+a[2]):b?b:null}(),zc=xc&&5>yc&&537>rc,Ac=/Firefox/i.test(pc),Bc=/Edge/i.test(pc),Cc=!Bc&&/Chrome/i.test(pc),Dc=function(){var a=pc.match(/Chrome\/(\d+)/);return a&&a[1]?parseFloat(a[1]):null}(),Ec=function(){var a=/MSIE\s(\d+)\.\d/.exec(pc),b=a&&parseFloat(a[1]);return!b&&/Trident\/7.0/i.test(pc)&&/rv:11.0/.test(pc)&&(b=11),b}(),Fc=/Safari/i.test(pc)&&!Cc&&!xc&&!Bc,Gc=Fc||vc,Hc=(l()&&("ontouchstart"in vb||vb.DocumentTouch&&vb.document instanceof vb.DocumentTouch)),Ic=Object.freeze({IS_IPAD:sc,IS_IPHONE:tc,IS_IPOD:uc,IS_IOS:vc,IOS_VERSION:wc,IS_ANDROID:xc,ANDROID_VERSION:yc,IS_NATIVE_ANDROID:zc,IS_FIREFOX:Ac,IS_EDGE:Bc,IS_CHROME:Cc,CHROME_VERSION:Dc,IE_VERSION:Ec,IS_SAFARI:Fc,IS_ANY_SAFARI:Gc,TOUCH_ENABLED:Hc}),Jc={},Kc=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],Lc=Kc[0],Mc=void 0,Nc=0;Nc<Kc.length;Nc++)if(Kc[Nc][1]in Ab){Mc=Kc[Nc];break}if(Mc)for(var Oc=0;Oc<Mc.length;Oc++)Jc[Lc[Oc]]=Mc[Oc];ga.prototype.code=0,ga.prototype.message="",ga.prototype.status=null,ga.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],ga.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Pc=0;Pc<ga.errorTypes.length;Pc++)ga[ga.errorTypes[Pc]]=Pc,ga.prototype[ga.errorTypes[Pc]]=Pc;var Qc=ha,Rc=function(a){var b=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(function(b,c,d){return a[c]&&(b[c]=a[c]),b},{cues:a.cues&&Array.prototype.map.call(a.cues,function(a){return{startTime:a.startTime,endTime:a.endTime,text:a.text,id:a.id}})});return b},Sc=function(a){var b=a.$$("track"),c=Array.prototype.map.call(b,function(a){return a.track}),d=Array.prototype.map.call(b,function(a){var b=Rc(a.track);return a.src&&(b.src=a.src),b});return d.concat(Array.prototype.filter.call(a.textTracks(),function(a){return-1===c.indexOf(a)}).map(Rc))},Tc=function(a,b){return a.forEach(function(a){var c=b.addRemoteTextTrack(a).track;!a.src&&a.cues&&a.cues.forEach(function(a){return c.addCue(a)})}),b.textTracks()},Uc={textTracksToJson:Sc,jsonToTextTracks:Tc,trackToJson_:Rc},Vc="vjs-modal-dialog",Wc=27,Xc=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.opened_=e.hasBeenOpened_=e.hasBeenFilled_=!1,e.closeable(!e.options_.uncloseable),e.content(e.options_.content),e.contentEl_=p("div",{className:Vc+"-content"},{role:"document"}),e.descEl_=p("p",{className:Vc+"-description vjs-control-text",id:e.el().getAttribute("aria-describedby")}),q(e.descEl_,e.description()),e.el_.appendChild(e.descEl_),e.el_.appendChild(e.contentEl_),e}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":this.id()+"_description","aria-hidden":"true","aria-label":this.label(),role:"dialog"})},b.prototype.dispose=function(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,a.prototype.dispose.call(this)},b.prototype.buildCSSClass=function(){return Vc+" vjs-hidden "+a.prototype.buildCSSClass.call(this)},b.prototype.handleKeyPress=function(a){a.which===Wc&&this.closeable()&&this.close()},b.prototype.label=function(){return this.localize(this.options_.label||"Modal Window")},b.prototype.description=function(){var a=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),a},b.prototype.open=function(){if(!this.opened_){var a=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!a.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&a.pause(),this.closeable()&&this.on(this.el_.ownerDocument,"keydown",bc(this,this.handleKeyPress)),this.hadControls_=a.controls(),a.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}},b.prototype.opened=function(a){return"boolean"==typeof a&&this[a?"open":"close"](),this.opened_},b.prototype.close=function(){if(this.opened_){var a=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&a.play(),this.closeable()&&this.off(this.el_.ownerDocument,"keydown",bc(this,this.handleKeyPress)),this.hadControls_&&a.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}},b.prototype.closeable=function c(a){if("boolean"==typeof a){var c=this.closeable_=!!a,b=this.getChild("closeButton");if(c&&!b){var d=this.contentEl_;this.contentEl_=this.el_,b=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=d,this.on(b,"close",this.close)}!c&&b&&(this.off(b,"close",this.close),this.removeChild(b),b.dispose())}return this.closeable_},b.prototype.fill=function(){this.fillWith(this.content())},b.prototype.fillWith=function(a){var b=this.contentEl(),c=b.parentNode,d=b.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,c.removeChild(b),this.empty(),K(b,a),this.trigger("modalfill"),d?c.insertBefore(b,d):c.appendChild(b);var e=this.getChild("closeButton");e&&c.appendChild(e.el_)},b.prototype.empty=function(){this.trigger("beforemodalempty"),H(this.contentEl()),this.trigger("modalempty")},b.prototype.content=function(a){return"undefined"!=typeof a&&(this.content_=a),this.content_},b.prototype.conditionalFocus_=function(){var a=Ab.activeElement,b=this.player_.el_;this.previouslyActiveEl_=null,(b.contains(a)||b===a)&&(this.previouslyActiveEl_=a,this.focus(),this.on(Ab,"keydown",this.handleKeyDown))},b.prototype.conditionalBlur_=function(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null),this.off(Ab,"keydown",this.handleKeyDown)},b.prototype.handleKeyDown=function(a){if(9===a.which){for(var b=this.focusableEls_(),c=this.el_.querySelector(":focus"),d=void 0,e=0;e<b.length;e++)if(c===b[e]){d=e;break}Ab.activeElement===this.el_&&(d=0),a.shiftKey&&0===d?(b[b.length-1].focus(),a.preventDefault()):a.shiftKey||d!==b.length-1||(b[0].focus(),a.preventDefault())}},b.prototype.focusableEls_=function(){var a=this.el_.querySelectorAll("*");return Array.prototype.filter.call(a,function(a){return(a instanceof vb.HTMLAnchorElement||a instanceof vb.HTMLAreaElement)&&a.hasAttribute("href")||(a instanceof vb.HTMLInputElement||a instanceof vb.HTMLSelectElement||a instanceof vb.HTMLTextAreaElement||a instanceof vb.HTMLButtonElement)&&!a.hasAttribute("disabled")||a instanceof vb.HTMLIFrameElement||a instanceof vb.HTMLObjectElement||a instanceof vb.HTMLEmbedElement||a.hasAttribute("tabindex")&&-1!==a.getAttribute("tabindex")||a.hasAttribute("contenteditable")})},b}(oc);Xc.prototype.options_={pauseOnOpen:!0,temporary:!0},oc.registerComponent("ModalDialog",Xc);var Yc=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ib(this,b);var d=Kb(this,a.call(this));d.tracks_=[],Object.defineProperty(d,"length",{get:function(){return this.tracks_.length}});for(var e=0;e<c.length;e++)d.addTrack(c[e]);return d}return Jb(b,a),b.prototype.addTrack=function(a){var b=this.tracks_.length;""+b in this||Object.defineProperty(this,b,{get:function(){return this.tracks_[b]}}),-1===this.tracks_.indexOf(a)&&(this.tracks_.push(a),this.trigger({track:a,type:"addtrack"}))},b.prototype.removeTrack=function(a){for(var b=void 0,c=0,d=this.length;d>c;c++)if(this[c]===a){b=this[c],b.off&&b.off(),this.tracks_.splice(c,1);break}b&&this.trigger({track:b,type:"removetrack"})},b.prototype.getTrackById=function(a){for(var b=null,c=0,d=this.length;d>c;c++){var e=this[c];if(e.id===a){b=e;break}}return b},b}(ec);Yc.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack"};for(var Zc in Yc.prototype.allowedEvents_)Yc.prototype["on"+Zc]=null;var $c=function(a,b){for(var c=0;c<a.length;c++)Object.keys(a[c]).length&&b.id!==a[c].id&&(a[c].enabled=!1)},_c=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ib(this,b);for(var d=c.length-1;d>=0;d--)if(c[d].enabled){$c(c,c[d]);break}var e=Kb(this,a.call(this,c));return e.changing_=!1,e}return Jb(b,a),b.prototype.addTrack=function(b){var c=this;b.enabled&&$c(this,b),a.prototype.addTrack.call(this,b),b.addEventListener&&b.addEventListener("enabledchange",function(){c.changing_||(c.changing_=!0,$c(c,b),c.changing_=!1,c.trigger("change"))})},b}(Yc),ad=function(a,b){for(var c=0;c<a.length;c++)Object.keys(a[c]).length&&b.id!==a[c].id&&(a[c].selected=!1)},bd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ib(this,b);for(var d=c.length-1;d>=0;d--)if(c[d].selected){ad(c,c[d]);break}var e=Kb(this,a.call(this,c));return e.changing_=!1,Object.defineProperty(e,"selectedIndex",{get:function(){for(var a=0;a<this.length;a++)if(this[a].selected)return a;return-1},set:function(){}}),e}return Jb(b,a),b.prototype.addTrack=function(b){var c=this;b.selected&&ad(this,b),a.prototype.addTrack.call(this,b),b.addEventListener&&b.addEventListener("selectedchange",function(){c.changing_||(c.changing_=!0,ad(c,b),c.changing_=!1,c.trigger("change"))})},b}(Yc),cd=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.addTrack=function(b){a.prototype.addTrack.call(this,b),b.addEventListener("modechange",bc(this,function(){this.trigger("change")}));var c=["metadata","chapters"];-1===c.indexOf(b.kind)&&b.addEventListener("modechange",bc(this,function(){this.trigger("selectedlanguagechange")}))},b}(Yc),dd=function(){function a(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ib(this,a),this.trackElements_=[],Object.defineProperty(this,"length",{get:function(){return this.trackElements_.length}});for(var c=0,d=b.length;d>c;c++)this.addTrackElement_(b[c])}return a.prototype.addTrackElement_=function(a){var b=this.trackElements_.length;""+b in this||Object.defineProperty(this,b,{get:function(){return this.trackElements_[b]}}),-1===this.trackElements_.indexOf(a)&&this.trackElements_.push(a)},a.prototype.getTrackElementByTrack_=function(a){for(var b=void 0,c=0,d=this.trackElements_.length;d>c;c++)if(a===this.trackElements_[c].track){b=this.trackElements_[c];break}return b},a.prototype.removeTrackElement_=function(a){for(var b=0,c=this.trackElements_.length;c>b;b++)if(a===this.trackElements_[b]){this.trackElements_.splice(b,1);break}},a}(),ed=function(){function a(b){Ib(this,a),a.prototype.setCues_.call(this,b),Object.defineProperty(this,"length",{get:function(){return this.length_}})}return a.prototype.setCues_=function(a){var b=this.length||0,c=0,d=a.length;this.cues_=a,this.length_=a.length;var e=function(a){""+a in this||Object.defineProperty(this,""+a,{get:function(){return this.cues_[a]}})};if(d>b)for(c=b;d>c;c++)e.call(this,c)},a.prototype.getCueById=function(a){for(var b=null,c=0,d=this.length;d>c;c++){var e=this[c];if(e.id===a){b=e;break}}return b},a}(),fd={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},gd={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},hd={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},id={disabled:"disabled",hidden:"hidden",showing:"showing"},jd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ib(this,b);var d=Kb(this,a.call(this)),e={id:c.id||"vjs_track_"+M(),kind:c.kind||"",label:c.label||"",language:c.language||""},f=function(a){Object.defineProperty(d,a,{get:function(){return e[a]},set:function(){}})};for(var g in e)f(g);return d}return Jb(b,a),b}(ec),kd=function(a){var b=["protocol","hostname","port","pathname","search","hash","host"],c=Ab.createElement("a");c.href=a;var d=""===c.host&&"file:"!==c.protocol,e=void 0;d&&(e=Ab.createElement("div"),e.innerHTML='<a href="'+a+'"></a>',c=e.firstChild,e.setAttribute("style","display:none; position:absolute;"),Ab.body.appendChild(e));for(var f={},g=0;g<b.length;g++)f[b[g]]=c[b[g]];return"http:"===f.protocol&&(f.host=f.host.replace(/:80$/,"")),"https:"===f.protocol&&(f.host=f.host.replace(/:443$/,"")),f.protocol||(f.protocol=vb.location.protocol),d&&Ab.body.removeChild(e),f},ld=function(a){if(!a.match(/^https?:\/\//)){var b=Ab.createElement("div");b.innerHTML='<a href="'+a+'">x</a>',a=b.firstChild.href}return a},md=function(a){if("string"==typeof a){var b=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i,c=b.exec(a);if(c)return c.pop().toLowerCase()}return""},nd=function(a){var b=vb.location,c=kd(a),d=":"===c.protocol?b.protocol:c.protocol,e=d+c.host!==b.protocol+b.host;return e},od=Object.freeze({parseUrl:kd,getAbsoluteURL:ld,getFileExtension:md,isCrossOrigin:nd}),pd=ka,qd=Object.prototype.toString,rd=Object.freeze({"default":pd,__moduleExports:pd}),sd=a(function(a,b){function c(a){return a.replace(/^\s*|\s*$/g,"")}b=a.exports=c,b.left=function(a){return a.replace(/^\s*/,"")},b.right=function(a){return a.replace(/\s*$/,"")}}),td=sd.left,ud=sd.right,vd=Object.freeze({"default":sd,__moduleExports:sd,left:td,right:ud}),wd=rd&&pd||rd,xd=la,yd=Object.prototype.toString,zd=Object.prototype.hasOwnProperty,Ad=Object.freeze({"default":xd,__moduleExports:xd}),Bd=vd&&sd||vd,Cd=Ad&&xd||Ad,Dd=function(a){return"[object Array]"===Object.prototype.toString.call(a)},Ed=function(a){if(!a)return{};var b={};return Cd(Bd(a).split("\n"),function(a){var c=a.indexOf(":"),d=Bd(a.slice(0,c)).toLowerCase(),e=Bd(a.slice(c+1));"undefined"==typeof b[d]?b[d]=e:Dd(b[d])?b[d].push(e):b[d]=[b[d],e]}),b},Fd=Object.freeze({"default":Ed,__moduleExports:Ed}),Gd=pa,Hd=Object.prototype.hasOwnProperty,Id=Object.freeze({"default":Gd,__moduleExports:Gd}),Jd=Fd&&Ed||Fd,Kd=Id&&Gd||Id,Ld=ta;ta.XMLHttpRequest=vb.XMLHttpRequest||wa,ta.XDomainRequest="withCredentials"in new ta.XMLHttpRequest?ta.XMLHttpRequest:vb.XDomainRequest,qa(["get","put","post","patch","head","delete"],function(a){ta["delete"===a?"del":a]=function(b,c,d){return c=sa(b,c,d),c.method=a.toUpperCase(),ua(c)}});var Md=function(a,b){var c=new vb.WebVTT.Parser(vb,vb.vttjs,vb.WebVTT.StringDecoder()),d=[];c.oncue=function(a){b.addCue(a)},c.onparsingerror=function(a){d.push(a)},c.onflush=function(){b.trigger({type:"loadeddata",target:b})},c.parse(a),d.length>0&&(vb.console&&vb.console.groupCollapsed&&vb.console.groupCollapsed("Text Track parsing errors for "+b.src),d.forEach(function(a){return Fb.error(a)}),vb.console&&vb.console.groupEnd&&vb.console.groupEnd()),c.flush()},Nd=function(a,b){var c={uri:a},d=nd(a);d&&(c.cors=d),Ld(c,bc(this,function(a,c,d){if(a)return Fb.error(a,c);if(b.loaded_=!0,"function"!=typeof vb.WebVTT){if(b.tech_){var e=function(){return Md(d,b)};b.tech_.on("vttjsloaded",e),b.tech_.on("vttjserror",function(){Fb.error("vttjs failed to load, stopping trying to process "+b.src),b.tech_.off("vttjsloaded",e)})}}else Md(d,b)}))},Od=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Ib(this,b),!c.tech)throw new Error("A tech was not provided.");var d=aa(c,{kind:hd[c.kind]||"subtitles",language:c.language||c.srclang||""}),e=id[d.mode]||"disabled",f=d["default"];("metadata"===d.kind||"chapters"===d.kind)&&(e="hidden");var g=Kb(this,a.call(this,d));g.tech_=d.tech,g.cues_=[],g.activeCues_=[];var h=new ed(g.cues_),i=new ed(g.activeCues_),j=!1,k=bc(g,function(){this.activeCues,j&&(this.trigger("cuechange"),j=!1)});return"disabled"!==e&&g.tech_.ready(function(){g.tech_.on("timeupdate",k)},!0),Object.defineProperties(g,{"default":{get:function(){return f},set:function(){}},mode:{get:function(){return e},set:function(a){var b=this;id[a]&&(e=a,"showing"===e&&this.tech_.ready(function(){b.tech_.on("timeupdate",k)},!0),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?h:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return i;for(var a=this.tech_.currentTime(),b=[],c=0,d=this.cues.length;d>c;c++){var e=this.cues[c];e.startTime<=a&&e.endTime>=a?b.push(e):e.startTime===e.endTime&&e.startTime<=a&&e.startTime+.5>=a&&b.push(e)}if(j=!1,b.length!==this.activeCues_.length)j=!0;else for(var f=0;f<b.length;f++)-1===this.activeCues_.indexOf(b[f])&&(j=!0);return this.activeCues_=b,i.setCues_(this.activeCues_),i},set:function(){}}}),d.src?(g.src=d.src,Nd(d.src,g)):g.loaded_=!0,g}return Jb(b,a),b.prototype.addCue=function(a){var b=a;if(vb.vttjs&&!(a instanceof vb.vttjs.VTTCue)){b=new vb.vttjs.VTTCue(a.startTime,a.endTime,a.text);for(var c in a)c in b||(b[c]=a[c]);b.id=a.id,b.originalCue_=a}for(var d=this.tech_.textTracks(),e=0;e<d.length;e++)d[e]!==this&&d[e].removeCue(b);this.cues_.push(b),this.cues.setCues_(this.cues_)},b.prototype.removeCue=function(a){for(var b=this.cues_.length;b--;){var c=this.cues_[b];if(c===a||c.originalCue_&&c.originalCue_===a){this.cues_.splice(b,1),this.cues.setCues_(this.cues_);break}}},b}(jd);Od.prototype.allowedEvents_={cuechange:"cuechange"};var Pd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ib(this,b);var d=aa(c,{kind:gd[c.kind]||""}),e=Kb(this,a.call(this,d)),f=!1;return Object.defineProperty(e,"enabled",{get:function(){return f},set:function(a){"boolean"==typeof a&&a!==f&&(f=a,this.trigger("enabledchange"))}}),d.enabled&&(e.enabled=d.enabled),e.loaded_=!0,e}return Jb(b,a),b}(jd),Qd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ib(this,b);var d=aa(c,{kind:fd[c.kind]||""}),e=Kb(this,a.call(this,d)),f=!1;return Object.defineProperty(e,"selected",{
- get:function(){return f},set:function(a){"boolean"==typeof a&&a!==f&&(f=a,this.trigger("selectedchange"))}}),d.selected&&(e.selected=d.selected),e}return Jb(b,a),b}(jd),Rd=0,Sd=1,Td=2,Ud=3,Vd=function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Ib(this,b);var d=Kb(this,a.call(this)),e=void 0,f=new Od(c);return d.kind=f.kind,d.src=f.src,d.srclang=f.language,d.label=f.label,d["default"]=f["default"],Object.defineProperties(d,{readyState:{get:function(){return e}},track:{get:function(){return f}}}),e=Rd,f.addEventListener("loadeddata",function(){e=Td,d.trigger({type:"load",target:d})}),d}return Jb(b,a),b}(ec);Vd.prototype.allowedEvents_={load:"load"},Vd.NONE=Rd,Vd.LOADING=Sd,Vd.LOADED=Td,Vd.ERROR=Ud;var Wd={audio:{ListClass:_c,TrackClass:Pd,capitalName:"Audio"},video:{ListClass:bd,TrackClass:Qd,capitalName:"Video"},text:{ListClass:cd,TrackClass:Od,capitalName:"Text"}};Object.keys(Wd).forEach(function(a){Wd[a].getterName=a+"Tracks",Wd[a].privateName=a+"Tracks_"});var Xd={remoteText:{ListClass:cd,TrackClass:Od,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:dd,TrackClass:Vd,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Yd=aa(Wd,Xd);Xd.names=Object.keys(Xd),Wd.names=Object.keys(Wd),Yd.names=[].concat(Xd.names).concat(Wd.names);var Zd=Object.create||function(){function a(){}return function(b){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return a.prototype=b,new a}}();xa.prototype=Zd(Error.prototype),xa.prototype.constructor=xa,xa.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},za.prototype={set:function(a,b){this.get(a)||""===b||(this.values[a]=b)},get:function(a,b,c){return c?this.has(a)?this.values[a]:b[c]:this.has(a)?this.values[a]:b},has:function(a){return a in this.values},alt:function(a,b,c){for(var d=0;d<c.length;++d)if(b===c[d]){this.set(a,b);break}},integer:function(a,b){/^-?\d+$/.test(b)&&this.set(a,parseInt(b,10))},percent:function(a,b){var c;return(c=b.match(/^([\d]{1,3})(\.[\d]*)?%$/))&&(b=parseFloat(b),b>=0&&100>=b)?(this.set(a,b),!0):!1}};var $d={"&":"&","<":"<",">":">","‎":"","‏":""," ":" "},_d={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},ae={v:"title",lang:"lang"},be={rt:"ruby"},ce=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];Ga.prototype.applyStyles=function(a,b){b=b||this.div;for(var c in a)a.hasOwnProperty(c)&&(b.style[c]=a[c])},Ga.prototype.formatStyle=function(a,b){return 0===a?0:a+b},Ha.prototype=Zd(Ga.prototype),Ha.prototype.constructor=Ha,Ia.prototype.move=function(a,b){switch(b=void 0!==b?b:this.lineHeight,a){case"+x":this.left+=b,this.right+=b;break;case"-x":this.left-=b,this.right-=b;break;case"+y":this.top+=b,this.bottom+=b;break;case"-y":this.top-=b,this.bottom-=b}},Ia.prototype.overlaps=function(a){return this.left<a.right&&this.right>a.left&&this.top<a.bottom&&this.bottom>a.top},Ia.prototype.overlapsAny=function(a){for(var b=0;b<a.length;b++)if(this.overlaps(a[b]))return!0;return!1},Ia.prototype.within=function(a){return this.top>=a.top&&this.bottom<=a.bottom&&this.left>=a.left&&this.right<=a.right},Ia.prototype.overlapsOppositeAxis=function(a,b){switch(b){case"+x":return this.left<a.left;case"-x":return this.right>a.right;case"+y":return this.top<a.top;case"-y":return this.bottom>a.bottom}},Ia.prototype.intersectPercentage=function(a){var b=Math.max(0,Math.min(this.right,a.right)-Math.max(this.left,a.left)),c=Math.max(0,Math.min(this.bottom,a.bottom)-Math.max(this.top,a.top)),d=b*c;return d/(this.height*this.width)},Ia.prototype.toCSSCompatValues=function(a){return{top:this.top-a.top,bottom:a.bottom-this.bottom,left:this.left-a.left,right:a.right-this.right,height:this.height,width:this.width}},Ia.getSimpleBoxPosition=function(a){var b=a.div?a.div.offsetHeight:a.tagName?a.offsetHeight:0,c=a.div?a.div.offsetWidth:a.tagName?a.offsetWidth:0,d=a.div?a.div.offsetTop:a.tagName?a.offsetTop:0;a=a.div?a.div.getBoundingClientRect():a.tagName?a.getBoundingClientRect():a;var e={left:a.left,right:a.right,top:a.top||d,height:a.height||b,bottom:a.bottom||d+(a.height||b),width:a.width||c};return e},Ka.StringDecoder=function(){return{decode:function(a){if(!a)return"";if("string"!=typeof a)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(a))}}},Ka.convertCueToDOMTree=function(a,b){return a&&b?Ca(a,b):null};var de=.05,ee="sans-serif",fe="1.5%";Ka.processCues=function(a,b,c){function d(a){for(var b=0;b<a.length;b++)if(a[b].hasBeenReset||!a[b].displayState)return!0;return!1}if(!a||!b||!c)return null;for(;c.firstChild;)c.removeChild(c.firstChild);var e=a.document.createElement("div");if(e.style.position="absolute",e.style.left="0",e.style.right="0",e.style.top="0",e.style.bottom="0",e.style.margin=fe,c.appendChild(e),d(b)){var f=[],g=Ia.getSimpleBoxPosition(e),h=Math.round(g.height*de*100)/100,i={font:h+"px "+ee};!function(){for(var c,d,h=0;h<b.length;h++)d=b[h],c=new Ha(a,d,i),e.appendChild(c.div),Ja(a,c,g,f),d.displayState=c.div,f.push(Ia.getSimpleBoxPosition(c))}()}else for(var j=0;j<b.length;j++)e.appendChild(b[j].displayState)},Ka.Parser=function(a,b,c){c||(c=b,b={}),b||(b={}),this.window=a,this.vttjs=b,this.state="INITIAL",this.buffer="",this.decoder=c||new TextDecoder("utf8"),this.regionList=[]},Ka.Parser.prototype={reportOrThrowError:function(a){if(!(a instanceof xa))throw a;this.onparsingerror&&this.onparsingerror(a)},parse:function(a){function b(){for(var a=f.buffer,b=0;b<a.length&&"\r"!==a[b]&&"\n"!==a[b];)++b;var c=a.substr(0,b);return"\r"===a[b]&&++b,"\n"===a[b]&&++b,f.buffer=a.substr(b),c}function c(a){var b=new za;if(Aa(a,function(a,c){switch(a){case"id":b.set(a,c);break;case"width":b.percent(a,c);break;case"lines":b.integer(a,c);break;case"regionanchor":case"viewportanchor":var d=c.split(",");if(2!==d.length)break;var e=new za;if(e.percent("x",d[0]),e.percent("y",d[1]),!e.has("x")||!e.has("y"))break;b.set(a+"X",e.get("x")),b.set(a+"Y",e.get("y"));break;case"scroll":b.alt(a,c,["up"])}},/=/,/\s/),b.has("id")){var c=new(f.vttjs.VTTRegion||f.window.VTTRegion);c.width=b.get("width",100),c.lines=b.get("lines",3),c.regionAnchorX=b.get("regionanchorX",0),c.regionAnchorY=b.get("regionanchorY",100),c.viewportAnchorX=b.get("viewportanchorX",0),c.viewportAnchorY=b.get("viewportanchorY",100),c.scroll=b.get("scroll",""),f.onregion&&f.onregion(c),f.regionList.push({id:b.get("id"),region:c})}}function d(a){var b=new za;Aa(a,function(a,c){switch(a){case"MPEGT":b.integer(a+"S",c);break;case"LOCA":b.set(a+"L",ya(c))}},/[^\d]:/,/,/),f.ontimestampmap&&f.ontimestampmap({MPEGTS:b.get("MPEGTS"),LOCAL:b.get("LOCAL")})}function e(a){a.match(/X-TIMESTAMP-MAP/)?Aa(a,function(a,b){switch(a){case"X-TIMESTAMP-MAP":d(b)}},/=/):Aa(a,function(a,b){switch(a){case"Region":c(b)}},/:/)}var f=this;a&&(f.buffer+=f.decoder.decode(a,{stream:!0}));try{var g;if("INITIAL"===f.state){if(!/\r\n|\n/.test(f.buffer))return this;g=b();var h=g.match(/^WEBVTT([ \t].*)?$/);if(!h||!h[0])throw new xa(xa.Errors.BadSignature);f.state="HEADER"}for(var i=!1;f.buffer;){if(!/\r\n|\n/.test(f.buffer))return this;switch(i?i=!1:g=b(),f.state){case"HEADER":/:/.test(g)?e(g):g||(f.state="ID");continue;case"NOTE":g||(f.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(g)){f.state="NOTE";break}if(!g)continue;if(f.cue=new(f.vttjs.VTTCue||f.window.VTTCue)(0,0,""),f.state="CUE",-1===g.indexOf("-->")){f.cue.id=g;continue}case"CUE":try{Ba(g,f.cue,f.regionList)}catch(j){f.reportOrThrowError(j),f.cue=null,f.state="BADCUE";continue}f.state="CUETEXT";continue;case"CUETEXT":var k=-1!==g.indexOf("-->");if(!g||k&&(i=!0)){f.oncue&&f.oncue(f.cue),f.cue=null,f.state="ID";continue}f.cue.text&&(f.cue.text+="\n"),f.cue.text+=g;continue;case"BADCUE":g||(f.state="ID");continue}}}catch(j){f.reportOrThrowError(j),"CUETEXT"===f.state&&f.cue&&f.oncue&&f.oncue(f.cue),f.cue=null,f.state="INITIAL"===f.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var a=this;try{if(a.buffer+=a.decoder.decode(),(a.cue||"HEADER"===a.state)&&(a.buffer+="\n\n",a.parse()),"INITIAL"===a.state)throw new xa(xa.Errors.BadSignature)}catch(b){a.reportOrThrowError(b)}return a.onflush&&a.onflush(),this}};var ge=Ka,he=Object.freeze({"default":ge,__moduleExports:ge}),ie="auto",je={"":1,lr:1,rl:1},ke={start:1,middle:1,end:1,left:1,right:1};Na.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var le=Na,me=Object.freeze({"default":le,__moduleExports:le}),ne={"":!0,up:!0},oe=Qa,pe=Object.freeze({"default":oe,__moduleExports:oe}),qe=he&&ge||he,re=me&&le||me,se=pe&&oe||pe,te=a(function(a){var b=a.exports={WebVTT:qe,VTTCue:re,VTTRegion:se};vb.vttjs=b,vb.WebVTT=b.WebVTT;var c=b.VTTCue,d=b.VTTRegion,e=vb.VTTCue,f=vb.VTTRegion;b.shim=function(){vb.VTTCue=c,vb.VTTRegion=d},b.restore=function(){vb.VTTCue=e,vb.VTTRegion=f},vb.VTTCue||b.shim()}),ue=(te.WebVTT,te.VTTCue,te.VTTRegion,function(a){function b(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){};Ib(this,b),c.reportTouchActivity=!1;var e=Kb(this,a.call(this,null,c,d));return e.hasStarted_=!1,e.on("playing",function(){this.hasStarted_=!0}),e.on("loadstart",function(){this.hasStarted_=!1}),Yd.names.forEach(function(a){var b=Yd[a];c&&c[b.getterName]&&(e[b.privateName]=c[b.getterName])}),e.featuresProgressEvents||e.manualProgressOn(),e.featuresTimeupdateEvents||e.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(a){c["native"+a+"Tracks"]===!1&&(e["featuresNative"+a+"Tracks"]=!1)}),c.nativeCaptions===!1||c.nativeTextTracks===!1?e.featuresNativeTextTracks=!1:(c.nativeCaptions===!0||c.nativeTextTracks===!0)&&(e.featuresNativeTextTracks=!0),e.featuresNativeTextTracks||e.emulateTextTracks(),e.autoRemoteTextTracks_=new Yd.text.ListClass,e.initTrackListeners(),c.nativeControlsForTouch||e.emitTapEvents(),e.constructor&&(e.name_=e.constructor.name||"Unknown Tech"),e}return Jb(b,a),b.prototype.triggerSourceset=function(a){var b=this;this.isReady_||this.one("ready",function(){return b.setTimeout(function(){return b.triggerSourceset(a)},1)}),this.trigger({src:a,type:"sourceset"})},b.prototype.manualProgressOn=function(){this.on("durationchange",this.onDurationChange),this.manualProgress=!0,this.one("ready",this.trackProgress)},b.prototype.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange)},b.prototype.trackProgress=function(a){this.stopTrackingProgress(),this.progressInterval=this.setInterval(bc(this,function(){var a=this.bufferedPercent();this.bufferedPercent_!==a&&this.trigger("progress"),this.bufferedPercent_=a,1===a&&this.stopTrackingProgress()}),500)},b.prototype.onDurationChange=function(a){this.duration_=this.duration()},b.prototype.buffered=function(){return ea(0,0)},b.prototype.bufferedPercent=function(){return fa(this.buffered(),this.duration_)},b.prototype.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},b.prototype.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime),this.on("pause",this.stopTrackingCurrentTime)},b.prototype.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime),this.off("pause",this.stopTrackingCurrentTime)},b.prototype.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},b.prototype.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.dispose=function(){this.clearTracks(Wd.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),a.prototype.dispose.call(this)},b.prototype.clearTracks=function(a){var b=this;a=[].concat(a),a.forEach(function(a){for(var c=b[a+"Tracks"]()||[],d=c.length;d--;){var e=c[d];"text"===a&&b.removeRemoteTextTrack(e),c.removeTrack(e)}})},b.prototype.cleanupAutoTextTracks=function(){for(var a=this.autoRemoteTextTracks_||[],b=a.length;b--;){var c=a[b];this.removeRemoteTextTrack(c)}},b.prototype.reset=function(){},b.prototype.error=function(a){return void 0!==a&&(this.error_=new ga(a),this.trigger("error")),this.error_},b.prototype.played=function(){return this.hasStarted_?ea(0,0):ea()},b.prototype.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},b.prototype.initTrackListeners=function(){var a=this;Wd.names.forEach(function(b){var c=Wd[b],d=function(){a.trigger(b+"trackchange")},e=a[c.getterName]();e.addEventListener("removetrack",d),e.addEventListener("addtrack",d),a.on("dispose",function(){e.removeEventListener("removetrack",d),e.removeEventListener("addtrack",d)})})},b.prototype.addWebVttScript_=function(){var a=this;if(!vb.WebVTT)if(Ab.body.contains(this.el())){if(!this.options_["vtt.js"]&&g(te)&&Object.keys(te).length>0)return void this.trigger("vttjsloaded");var b=Ab.createElement("script");b.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",b.onload=function(){a.trigger("vttjsloaded")},b.onerror=function(){a.trigger("vttjserror")},this.on("dispose",function(){b.onload=null,b.onerror=null}),vb.WebVTT=!0,this.el().parentNode.appendChild(b)}else this.ready(this.addWebVttScript_)},b.prototype.emulateTextTracks=function(){var a=this,b=this.textTracks(),c=this.remoteTextTracks(),d=function(a){return b.addTrack(a.track)},e=function(a){return b.removeTrack(a.track)};c.on("addtrack",d),c.on("removetrack",e),this.addWebVttScript_();var f=function(){return a.trigger("texttrackchange")},g=function(){f();for(var a=0;a<b.length;a++){var c=b[a];c.removeEventListener("cuechange",f),"showing"===c.mode&&c.addEventListener("cuechange",f)}};g(),b.addEventListener("change",g),b.addEventListener("addtrack",g),b.addEventListener("removetrack",g),this.on("dispose",function(){c.off("addtrack",d),c.off("removetrack",e),b.removeEventListener("change",g),b.removeEventListener("addtrack",g),b.removeEventListener("removetrack",g);for(var a=0;a<b.length;a++){var h=b[a];h.removeEventListener("cuechange",f)}})},b.prototype.addTextTrack=function(a,b,c){if(!a)throw new Error("TextTrack kind is required but was not provided");return Ra(this,a,b,c)},b.prototype.createRemoteTextTrack=function(a){var b=aa(a,{tech:this});return new Xd.remoteTextEl.TrackClass(b)},b.prototype.addRemoteTextTrack=function(){var a=this,b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},c=arguments[1],d=this.createRemoteTextTrack(b);return c!==!0&&c!==!1&&(Fb.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),c=!0),this.remoteTextTrackEls().addTrackElement_(d),this.remoteTextTracks().addTrack(d.track),c!==!0&&this.ready(function(){return a.autoRemoteTextTracks_.addTrack(d.track)}),d},b.prototype.removeRemoteTextTrack=function(a){var b=this.remoteTextTrackEls().getTrackElementByTrack_(a);this.remoteTextTrackEls().removeTrackElement_(b),this.remoteTextTracks().removeTrack(a),this.autoRemoteTextTracks_.removeTrack(a)},b.prototype.getVideoPlaybackQuality=function(){return{}},b.prototype.setPoster=function(){},b.prototype.playsinline=function(){},b.prototype.setPlaysinline=function(){},b.prototype.overrideNativeAudioTracks=function(){},b.prototype.overrideNativeVideoTracks=function(){},b.prototype.canPlayType=function(){return""},b.canPlayType=function(){return""},b.canPlaySource=function(a,c){return b.canPlayType(a.type)},b.isTech=function(a){return a.prototype instanceof b||a instanceof b||a===b},b.registerTech=function(a,c){if(b.techs_||(b.techs_={}),!b.isTech(c))throw new Error("Tech "+a+" must be a Tech");if(!b.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!b.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return a=$(a),b.techs_[a]=c,"Tech"!==a&&b.defaultTechOrder_.push(a),c},b.getTech=function(a){return a?(a=$(a),b.techs_&&b.techs_[a]?b.techs_[a]:vb&&vb.videojs&&vb.videojs[a]?(Fb.warn("The "+a+" tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),vb.videojs[a]):void 0):void 0},b}(oc));Yd.names.forEach(function(a){var b=Yd[a];ue.prototype[b.getterName]=function(){return this[b.privateName]=this[b.privateName]||new b.ListClass,this[b.privateName]}}),ue.prototype.featuresVolumeControl=!0,ue.prototype.featuresFullscreenResize=!1,ue.prototype.featuresPlaybackRate=!1,ue.prototype.featuresProgressEvents=!1,ue.prototype.featuresSourceset=!1,ue.prototype.featuresTimeupdateEvents=!1,ue.prototype.featuresNativeTextTracks=!1,ue.withSourceHandlers=function(a){a.registerSourceHandler=function(b,c){var d=a.sourceHandlers;d||(d=a.sourceHandlers=[]),void 0===c&&(c=d.length),d.splice(c,0,b)},a.canPlayType=function(b){for(var c=a.sourceHandlers||[],d=void 0,e=0;e<c.length;e++)if(d=c[e].canPlayType(b))return d;return""},a.selectSourceHandler=function(b,c){for(var d=a.sourceHandlers||[],e=void 0,f=0;f<d.length;f++)if(e=d[f].canHandleSource(b,c))return d[f];return null},a.canPlaySource=function(b,c){var d=a.selectSourceHandler(b,c);return d?d.canHandleSource(b,c):""};var b=["seekable","seeking","duration"];b.forEach(function(a){var b=this[a];"function"==typeof b&&(this[a]=function(){return this.sourceHandler_&&this.sourceHandler_[a]?this.sourceHandler_[a].apply(this.sourceHandler_,arguments):b.apply(this,arguments)})},a.prototype),a.prototype.setSource=function(b){var c=a.selectSourceHandler(b,this.options_);c||(a.nativeSourceHandler?c=a.nativeSourceHandler:Fb.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler),c!==a.nativeSourceHandler&&(this.currentSource_=b),this.sourceHandler_=c.handleSource(b,this,this.options_),this.on("dispose",this.disposeSourceHandler)},a.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},oc.registerComponent("Tech",ue),ue.registerTech("Tech",ue),ue.defaultTechOrder_=[];var ve={},we={},xe={},ye={buffered:1,currentTime:1,duration:1,seekable:1,played:1,paused:1},ze={setCurrentTime:1},Ae={play:1,pause:1},Be={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",mp3:"audio/mpeg",aac:"audio/aac",oga:"audio/ogg",m3u8:"application/x-mpegURL"},Ce=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=md(a),c=Be[b.toLowerCase()];return c||""},De=function(a,b){if(!b)return"";if(a.cache_.source.src===b&&a.cache_.source.type)return a.cache_.source.type;var c=a.cache_.sources.filter(function(a){return a.src===b});if(c.length)return c[0].type;for(var d=a.$$("source"),e=0;e<d.length;e++){var f=d[e];if(f.type&&f.src&&f.src===b)return f.type}return Ce(b)},Ee=function Mm(a){if(Array.isArray(a)){var b=[];a.forEach(function(a){a=Mm(a),Array.isArray(a)?b=b.concat(a):f(a)&&b.push(a)}),a=b}else a="string"==typeof a&&a.trim()?[bb({src:a})]:f(a)&&"string"==typeof a.src&&a.src&&a.src.trim()?[bb(a)]:[];return a},Fe=function(a){function b(c,d,e){Ib(this,b);var f=aa({createEl:!1},d),g=Kb(this,a.call(this,c,f,e));if(d.playerOptions.sources&&0!==d.playerOptions.sources.length)c.src(d.playerOptions.sources);else for(var h=0,i=d.playerOptions.techOrder;h<i.length;h++){var j=$(i[h]),k=ue.getTech(j);if(j||(k=oc.getComponent(j)),k&&k.isSupported()){c.loadTech_(j);break}}return g}return Jb(b,a),b}(oc);oc.registerComponent("MediaLoader",Fe);var Ge=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.emitTapEvents(),e.enable(),e}return Jb(b,a),b.prototype.createEl=function(){var b=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};c=e({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass(),tabIndex:0},c),"button"===b&&Fb.error("Creating a ClickableComponent with an HTML element of "+b+" is not supported; use a Button instead."),d=e({role:"button"},d),this.tabIndex_=c.tabIndex;var f=a.prototype.createEl.call(this,b,c,d);return this.createControlTextEl(f),f},b.prototype.dispose=function(){this.controlTextEl_=null,a.prototype.dispose.call(this)},b.prototype.createControlTextEl=function(a){return this.controlTextEl_=p("span",{className:"vjs-control-text"},{"aria-live":"polite"}),a&&a.appendChild(this.controlTextEl_),this.controlText(this.controlText_,a),this.controlTextEl_},b.prototype.controlText=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.el();if(void 0===a)return this.controlText_||"Need Text";var c=this.localize(a);this.controlText_=a,q(this.controlTextEl_,c),this.nonIconControl||b.setAttribute("title",c)},b.prototype.buildCSSClass=function(){return"vjs-control vjs-button "+a.prototype.buildCSSClass.call(this)},b.prototype.enable=function(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),"undefined"!=typeof this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur))},b.prototype.disable=function(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),"undefined"!=typeof this.tabIndex_&&this.el_.removeAttribute("tabIndex"),this.off(["tap","click"],this.handleClick),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur)},b.prototype.handleClick=function(a){},b.prototype.handleFocus=function(a){T(Ab,"keydown",bc(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.trigger("click")):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b.prototype.handleBlur=function(a){U(Ab,"keydown",bc(this,this.handleKeyPress))},b}(oc);oc.registerComponent("ClickableComponent",Ge);var He=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.update(),c.on("posterchange",bc(e,e.update)),e}return Jb(b,a),b.prototype.dispose=function(){this.player().off("posterchange",this.update),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var a=p("div",{className:"vjs-poster",tabIndex:-1});return a},b.prototype.update=function(a){var b=this.player().poster();this.setSrc(b),b?this.show():this.hide()},b.prototype.setSrc=function(a){var b="";a&&(b='url("'+a+'")'),this.el_.style.backgroundImage=b},b.prototype.handleClick=function(a){this.player_.controls()&&(this.player_.paused()?this.player_.play():this.player_.pause())},b}(Ge);oc.registerComponent("PosterImage",He);var Ie="#222",Je="#ccc",Ke={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'},Le=function(a){function b(c,d,e){Ib(this,b);var f=Kb(this,a.call(this,c,d,e));return c.on("loadstart",bc(f,f.toggleDisplay)),c.on("texttrackchange",bc(f,f.updateDisplay)),c.on("loadstart",bc(f,f.preselectTrack)),c.ready(bc(f,function(){if(c.tech_&&c.tech_.featuresNativeTextTracks)return void this.hide();c.on("fullscreenchange",bc(this,this.updateDisplay));for(var a=this.options_.playerOptions.tracks||[],b=0;b<a.length;b++)this.player_.addRemoteTextTrack(a[b],!0);this.preselectTrack()})),f}return Jb(b,a),b.prototype.preselectTrack=function(){for(var a={captions:1,subtitles:1},b=this.player_.textTracks(),c=this.player_.cache_.selectedLanguage,d=void 0,e=void 0,f=void 0,g=0;g<b.length;g++){var h=b[g];c&&c.enabled&&c.language===h.language?h.kind===c.kind?f=h:f||(f=h):c&&!c.enabled?(f=null,d=null,e=null):h["default"]&&("descriptions"!==h.kind||d?h.kind in a&&!e&&(e=h):d=h)}f?f.mode="showing":e?e.mode="showing":d&&(d.mode="showing")},b.prototype.toggleDisplay=function(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-text-track-display"},{"aria-live":"off","aria-atomic":"true"})},b.prototype.clearDisplay=function(){"function"==typeof vb.WebVTT&&vb.WebVTT.processCues(vb,[],this.el_)},b.prototype.updateDisplay=function(){var a=this.player_.textTracks();this.clearDisplay();for(var b=null,c=null,d=a.length;d--;){var e=a[d];"showing"===e.mode&&("descriptions"===e.kind?b=e:c=e)}c?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(c)):b&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(b))},b.prototype.updateForTrack=function(a){if("function"==typeof vb.WebVTT&&a.activeCues){for(var b=[],c=0;c<a.activeCues.length;c++)b.push(a.activeCues[c]);if(vb.WebVTT.processCues(vb,b,this.el_),this.player_.textTrackSettings)for(var d=this.player_.textTrackSettings.getValues(),e=b.length;e--;){var f=b[e];if(f){var g=f.displayState;if(d.color&&(g.firstChild.style.color=d.color),d.textOpacity&&db(g.firstChild,"color",cb(d.color||"#fff",d.textOpacity)),d.backgroundColor&&(g.firstChild.style.backgroundColor=d.backgroundColor),d.backgroundOpacity&&db(g.firstChild,"backgroundColor",cb(d.backgroundColor||"#000",d.backgroundOpacity)),d.windowColor&&(d.windowOpacity?db(g,"backgroundColor",cb(d.windowColor,d.windowOpacity)):g.style.backgroundColor=d.windowColor),d.edgeStyle&&("dropshadow"===d.edgeStyle?g.firstChild.style.textShadow="2px 2px 3px "+Ie+", 2px 2px 4px "+Ie+", 2px 2px 5px "+Ie:"raised"===d.edgeStyle?g.firstChild.style.textShadow="1px 1px "+Ie+", 2px 2px "+Ie+", 3px 3px "+Ie:"depressed"===d.edgeStyle?g.firstChild.style.textShadow="1px 1px "+Je+", 0 1px "+Je+", -1px -1px "+Ie+", 0 -1px "+Ie:"uniform"===d.edgeStyle&&(g.firstChild.style.textShadow="0 0 4px "+Ie+", 0 0 4px "+Ie+", 0 0 4px "+Ie+", 0 0 4px "+Ie)),d.fontPercent&&1!==d.fontPercent){var h=vb.parseFloat(g.style.fontSize);g.style.fontSize=h*d.fontPercent+"px",g.style.height="auto",g.style.top="auto",g.style.bottom="2px"}d.fontFamily&&"default"!==d.fontFamily&&("small-caps"===d.fontFamily?g.firstChild.style.fontVariant="small-caps":g.firstChild.style.fontFamily=Ke[d.fontFamily])}}}},b}(oc);oc.registerComponent("TextTrackDisplay",Le);var Me=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){var b=this.player_.isAudio(),c=this.localize(b?"Audio Player":"Video Player"),d=p("span",{className:"vjs-control-text",innerHTML:this.localize("{1} is loading.",[c])}),e=a.prototype.createEl.call(this,"div",{className:"vjs-loading-spinner",dir:"ltr"});return e.appendChild(d),e},b}(oc);oc.registerComponent("LoadingSpinner",Me);var Ne=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};a="button",b=e({innerHTML:'<span aria-hidden="true" class="vjs-icon-placeholder"></span>',className:this.buildCSSClass()},b),c=e({type:"button"},c);var d=oc.prototype.createEl.call(this,a,b,c);return this.createControlTextEl(d),d},b.prototype.addChild=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=this.constructor.name;return Fb.warn("Adding an actionable (user controllable) child to a Button ("+c+") is not supported; use a ClickableComponent instead."),oc.prototype.addChild.call(this,a,b)},b.prototype.enable=function(){a.prototype.enable.call(this),this.el_.removeAttribute("disabled")},b.prototype.disable=function(){a.prototype.disable.call(this),this.el_.setAttribute("disabled","disabled")},b.prototype.handleKeyPress=function(b){32!==b.which&&13!==b.which&&a.prototype.handleKeyPress.call(this,b)},b}(Ge);oc.registerComponent("Button",Ne);var Oe=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.mouseused_=!1,e.on("mousedown",e.handleMouseDown),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-big-play-button"},b.prototype.handleClick=function(a){var b=this.player_.play();if(!(this.mouseused_&&a.clientX&&a.clientY)){var c=this.player_.getChild("controlBar"),d=c&&c.getChild("playToggle");if(!d)return void this.player_.focus();var e=function(){return d.focus()};ia(b)?b.then(e,function(){}):this.setTimeout(e,1)}},b.prototype.handleKeyPress=function(b){this.mouseused_=!1,a.prototype.handleKeyPress.call(this,b)},b.prototype.handleMouseDown=function(a){this.mouseused_=!0},b}(Ne);Oe.prototype.controlText_="Play Video",oc.registerComponent("BigPlayButton",Oe);var Pe=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.controlText(d&&d.controlText||e.localize("Close")),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-close-button "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.trigger({type:"close",bubbles:!1})},b}(Ne);oc.registerComponent("CloseButton",Pe);var Qe=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"play",e.handlePlay),e.on(c,"pause",e.handlePause),e.on(c,"ended",e.handleEnded),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-play-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handleSeeked=function(a){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(a):this.handlePlay(a)},b.prototype.handlePlay=function(a){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("")},b.prototype.handlePause=function(a){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("");
- },b.prototype.handleEnded=function(a){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",this.handleSeeked)},b}(Ne);Qe.prototype.controlText_="Play",oc.registerComponent("PlayToggle",Qe);var Re=function(a,b){a=0>a?0:a;var c=Math.floor(a%60),d=Math.floor(a/60%60),e=Math.floor(a/3600),f=Math.floor(b/60%60),g=Math.floor(b/3600);return(isNaN(a)||a===1/0)&&(e=d=c="-"),e=e>0||g>0?e+":":"",d=((e||f>=10)&&10>d?"0"+d:d)+":",c=10>c?"0"+c:c,e+d+c},Se=Re,Te=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.throttledUpdateContent=cc(bc(e,e.updateContent),25),e.on(c,"timeupdate",e.throttledUpdateContent),e}return Jb(b,a),b.prototype.createEl=function(b){var c=this.buildCSSClass(),d=a.prototype.createEl.call(this,"div",{className:c+" vjs-time-control vjs-control",innerHTML:'<span class="vjs-control-text">'+this.localize(this.labelText_)+" </span>"});return this.contentEl_=p("span",{className:c+"-display"},{"aria-live":"off"}),this.updateTextNode_(),d.appendChild(this.contentEl_),d},b.prototype.dispose=function(){this.contentEl_=null,this.textNode_=null,a.prototype.dispose.call(this)},b.prototype.updateTextNode_=function(){if(this.contentEl_){for(;this.contentEl_.firstChild;)this.contentEl_.removeChild(this.contentEl_.firstChild);this.textNode_=Ab.createTextNode(this.formattedTime_||this.formatTime_(0)),this.contentEl_.appendChild(this.textNode_)}},b.prototype.formatTime_=function(a){return gb(a)},b.prototype.updateFormattedTime_=function(a){var b=this.formatTime_(a);b!==this.formattedTime_&&(this.formattedTime_=b,this.requestAnimationFrame(this.updateTextNode_))},b.prototype.updateContent=function(a){},b}(oc);Te.prototype.labelText_="Time",Te.prototype.controlText_="Time",oc.registerComponent("TimeDisplay",Te);var Ue=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"ended",e.handleEnded),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-current-time"},b.prototype.updateContent=function(a){var b=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateFormattedTime_(b)},b.prototype.handleEnded=function(a){this.player_.duration()&&this.updateFormattedTime_(this.player_.duration())},b}(Te);Ue.prototype.labelText_="Current Time",Ue.prototype.controlText_="Current Time",oc.registerComponent("CurrentTimeDisplay",Ue);var Ve=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"durationchange",e.updateContent),e.on(c,"loadedmetadata",e.throttledUpdateContent),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-duration"},b.prototype.updateContent=function(a){var b=this.player_.duration();b&&this.duration_!==b&&(this.duration_=b,this.updateFormattedTime_(b))},b}(Te);Ve.prototype.labelText_="Duration",Ve.prototype.controlText_="Duration",oc.registerComponent("DurationDisplay",Ve);var We=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider",innerHTML:"<div><span>/</span></div>"})},b}(oc);oc.registerComponent("TimeDivider",We);var Xe=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"durationchange",e.throttledUpdateContent),e.on(c,"ended",e.handleEnded),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-remaining-time"},b.prototype.formatTime_=function(b){return"-"+a.prototype.formatTime_.call(this,b)},b.prototype.updateContent=function(a){this.player_.duration()&&(this.player_.remainingTimeDisplay?this.updateFormattedTime_(this.player_.remainingTimeDisplay()):this.updateFormattedTime_(this.player_.remainingTime()))},b.prototype.handleEnded=function(a){this.player_.duration()&&this.updateFormattedTime_(0)},b}(Te);Xe.prototype.labelText_="Remaining Time",Xe.prototype.controlText_="Remaining Time",oc.registerComponent("RemainingTimeDisplay",Xe);var Ye=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.updateShowing(),e.on(e.player(),"durationchange",e.updateShowing),e}return Jb(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=p("div",{className:"vjs-live-display",innerHTML:'<span class="vjs-control-text">'+this.localize("Stream Type")+" </span>"+this.localize("LIVE")},{"aria-live":"off"}),b.appendChild(this.contentEl_),b},b.prototype.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},b.prototype.updateShowing=function(a){this.player().duration()===1/0?this.show():this.hide()},b}(oc);oc.registerComponent("LiveDisplay",Ye);var Ze=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.bar=e.getChild(e.options_.barName),e.vertical(!!e.options_.vertical),e.enable(),e}return Jb(b,a),b.prototype.enabled=function(){return this.enabled_},b.prototype.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown),this.on("touchstart",this.handleMouseDown),this.on("focus",this.handleFocus),this.on("blur",this.handleBlur),this.on("click",this.handleClick),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},b.prototype.disable=function(){if(this.enabled()){var a=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown),this.off("touchstart",this.handleMouseDown),this.off("focus",this.handleFocus),this.off("blur",this.handleBlur),this.off("click",this.handleClick),this.off(this.player_,"controlsvisible",this.update),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}},b.prototype.createEl=function(b){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return c.className=c.className+" vjs-slider",c=e({tabIndex:0},c),d=e({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},d),a.prototype.createEl.call(this,b,c,d)},b.prototype.handleMouseDown=function(a){var b=this.bar.el_.ownerDocument;a.preventDefault(),B(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(b,"mousemove",this.handleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchmove",this.handleMouseMove),this.on(b,"touchend",this.handleMouseUp),this.handleMouseMove(a)},b.prototype.handleMouseMove=function(a){},b.prototype.handleMouseUp=function(){var a=this.bar.el_.ownerDocument;C(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(a,"mousemove",this.handleMouseMove),this.off(a,"mouseup",this.handleMouseUp),this.off(a,"touchmove",this.handleMouseMove),this.off(a,"touchend",this.handleMouseUp),this.update()},b.prototype.update=function(){if(this.el_){var a=this.getPercent(),b=this.bar;if(b){("number"!=typeof a||a!==a||0>a||a===1/0)&&(a=0);var c=(100*a).toFixed(2)+"%",d=b.el().style;return this.vertical()?d.height=c:d.width=c,a}}},b.prototype.calculateDistance=function(a){var b=F(this.el_,a);return this.vertical()?b.y:b.x},b.prototype.handleFocus=function(){this.on(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepBack()):(38===a.which||39===a.which)&&(a.preventDefault(),this.stepForward())},b.prototype.handleBlur=function(){this.off(this.bar.el_.ownerDocument,"keydown",this.handleKeyPress)},b.prototype.handleClick=function(a){a.stopImmediatePropagation(),a.preventDefault()},b.prototype.vertical=function(a){return void 0===a?this.vertical_||!1:(this.vertical_=!!a,void(this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")))},b}(oc);oc.registerComponent("Slider",Ze);var $e=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.partEls_=[],e.on(c,"progress",e.update),e}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-load-progress",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Loaded")+"</span>: 0%</span>"})},b.prototype.dispose=function(){this.partEls_=null,a.prototype.dispose.call(this)},b.prototype.update=function(a){var b=this.player_.buffered(),c=this.player_.duration(),d=this.player_.bufferedEnd(),e=this.partEls_,f=function(a,b){var c=a/b||0;return 100*(c>=1?1:c)+"%"};this.el_.style.width=f(d,c);for(var g=0;g<b.length;g++){var h=b.start(g),i=b.end(g),j=e[g];j||(j=this.el_.appendChild(p()),e[g]=j),j.style.left=f(h,d),j.style.width=f(i-h,d)}for(var k=e.length;k>b.length;k--)this.el_.removeChild(e[k-1]);e.length=b.length},b}(oc);oc.registerComponent("LoadProgressBar",$e);var _e=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"})},b.prototype.update=function(a,b,c){var d=D(this.el_),e=D(this.player_.el()),f=a.width*b;if(e&&d){var g=a.left-e.left+f,h=a.width-f+(e.right-a.right),i=d.width/2;i>g?i+=i-g:i>h&&(i=h),0>i?i=0:i>d.width&&(i=d.width),this.el_.style.right="-"+i+"px",q(this.el_,c)}},b}(oc);oc.registerComponent("TimeTooltip",_e);var af=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar",innerHTML:'<span class="vjs-control-text"><span>'+this.localize("Progress")+"</span>: 0%</span>"})},b.prototype.update=function(a,b){var c=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var d=c.player_.scrubbing()?c.player_.getCache().currentTime:c.player_.currentTime(),e=gb(d,c.player_.duration()),f=c.getChild("timeTooltip");f&&f.update(a,b,e)})},b}(oc);af.prototype.options_={children:[]},vc||xc||af.prototype.options_.children.push("timeTooltip"),oc.registerComponent("PlayProgressBar",af);var bf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.update=cc(bc(e,e.update),25),e}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},b.prototype.update=function(a,b){var c=this;this.rafId_&&this.cancelAnimationFrame(this.rafId_),this.rafId_=this.requestAnimationFrame(function(){var d=c.player_.duration(),e=gb(b*d,d);c.el_.style.left=a.width*b+"px",c.getChild("timeTooltip").update(a,b,e)})},b}(oc);bf.prototype.options_={children:["timeTooltip"]},oc.registerComponent("MouseTimeDisplay",bf);var cf=5,df=30,ef=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.setEventHandlers_(),e}return Jb(b,a),b.prototype.setEventHandlers_=function(){var a=this;this.update=cc(bc(this,this.update),df),this.on(this.player_,"timeupdate",this.update),this.on(this.player_,"ended",this.handleEnded),this.updateInterval=null,this.on(this.player_,["playing"],function(){a.clearInterval(a.updateInterval),a.updateInterval=a.setInterval(function(){a.requestAnimationFrame(function(){a.update()})},df)}),this.on(this.player_,["ended","pause","waiting"],function(){a.clearInterval(a.updateInterval)}),this.on(this.player_,["timeupdate","ended"],this.update)},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},b.prototype.update_=function(a,b){var c=this.player_.duration();this.el_.setAttribute("aria-valuenow",(100*b).toFixed(2)),this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[gb(a,c),gb(c,c)],"{1} of {2}")),this.bar.update(D(this.el_),b)},b.prototype.update=function(b){var c=a.prototype.update.call(this);return this.update_(this.getCurrentTime_(),c),c},b.prototype.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},b.prototype.handleEnded=function(a){this.update_(this.player_.duration(),1)},b.prototype.getPercent=function(){var a=this.getCurrentTime_()/this.player_.duration();return a>=1?1:a||0},b.prototype.handleMouseDown=function(b){L(b)&&(b.stopPropagation(),this.player_.scrubbing(!0),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),a.prototype.handleMouseDown.call(this,b))},b.prototype.handleMouseMove=function(a){if(L(a)){var b=this.calculateDistance(a)*this.player_.duration();b===this.player_.duration()&&(b-=.1),this.player_.currentTime(b)}},b.prototype.enable=function(){a.prototype.enable.call(this);var b=this.getChild("mouseTimeDisplay");b&&b.show()},b.prototype.disable=function(){a.prototype.disable.call(this);var b=this.getChild("mouseTimeDisplay");b&&b.hide()},b.prototype.handleMouseUp=function(b){a.prototype.handleMouseUp.call(this,b),b&&b.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying&&ja(this.player_.play())},b.prototype.stepForward=function(){this.player_.currentTime(this.player_.currentTime()+cf)},b.prototype.stepBack=function(){this.player_.currentTime(this.player_.currentTime()-cf)},b.prototype.handleAction=function(a){this.player_.paused()?this.player_.play():this.player_.pause()},b.prototype.handleKeyPress=function(b){32===b.which||13===b.which?(b.preventDefault(),this.handleAction(b)):a.prototype.handleKeyPress&&a.prototype.handleKeyPress.call(this,b)},b}(Ze);ef.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},vc||xc||ef.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),ef.prototype.playerEvent="timeupdate",oc.registerComponent("SeekBar",ef);var ff=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.handleMouseMove=cc(bc(e,e.handleMouseMove),25),e.throttledHandleMouseSeek=cc(bc(e,e.handleMouseSeek),25),e.enable(),e}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},b.prototype.handleMouseMove=function(a){var b=this.getChild("seekBar");if(b){var c=b.getChild("mouseTimeDisplay"),d=b.el(),e=D(d),f=F(d,a).x;f>1?f=1:0>f&&(f=0),c&&c.update(e,f)}},b.prototype.handleMouseSeek=function(a){var b=this.getChild("seekBar");b&&b.handleMouseMove(a)},b.prototype.enabled=function(){return this.enabled_},b.prototype.disable=function(){this.children().forEach(function(a){return a.disable&&a.disable()}),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDown),this.off(this.el_,"mousemove",this.handleMouseMove),this.handleMouseUp(),this.addClass("disabled"),this.enabled_=!1)},b.prototype.enable=function(){this.children().forEach(function(a){return a.enable&&a.enable()}),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDown),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)},b.prototype.handleMouseDown=function(a){var b=this.el_.ownerDocument,c=this.getChild("seekBar");c&&c.handleMouseDown(a),this.on(b,"mousemove",this.throttledHandleMouseSeek),this.on(b,"touchmove",this.throttledHandleMouseSeek),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseUp=function(a){var b=this.el_.ownerDocument,c=this.getChild("seekBar");c&&c.handleMouseUp(a),this.off(b,"mousemove",this.throttledHandleMouseSeek),this.off(b,"touchmove",this.throttledHandleMouseSeek),this.off(b,"mouseup",this.handleMouseUp),this.off(b,"touchend",this.handleMouseUp)},b}(oc);ff.prototype.options_={children:["seekBar"]},oc.registerComponent("ProgressControl",ff);var gf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"fullscreenchange",e.handleFullscreenChange),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-fullscreen-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleFullscreenChange=function(a){this.player_.isFullscreen()?this.controlText(""):this.controlText("")},b.prototype.handleClick=function(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},b}(Ne);gf.prototype.controlText_="",oc.registerComponent("FullscreenToggle",gf);var hf=function(a,b){b.tech_&&!b.tech_.featuresVolumeControl&&a.addClass("vjs-hidden"),a.on(b,"loadstart",function(){b.tech_.featuresVolumeControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")})},jf=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-level",innerHTML:'<span class="vjs-control-text"></span>'})},b}(oc);oc.registerComponent("VolumeLevel",jf);var kf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on("slideractive",e.updateLastVolume_),e.on(c,"volumechange",e.updateARIAAttributes),c.ready(function(){return e.updateARIAAttributes()}),e}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},b.prototype.handleMouseDown=function(b){L(b)&&a.prototype.handleMouseDown.call(this,b)},b.prototype.handleMouseMove=function(a){L(a)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(a)))},b.prototype.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},b.prototype.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},b.prototype.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},b.prototype.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},b.prototype.updateARIAAttributes=function(a){var b=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",b),this.el_.setAttribute("aria-valuetext",b+"%")},b.prototype.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},b.prototype.updateLastVolume_=function(){var a=this,b=this.player_.volume();this.one("sliderinactive",function(){0===a.player_.volume()&&a.player_.lastVolume_(b)})},b}(Ze);kf.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},kf.prototype.playerEvent="volumechange",oc.registerComponent("VolumeBar",kf);var lf=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ib(this,b),d.vertical=d.vertical||!1,("undefined"==typeof d.volumeBar||g(d.volumeBar))&&(d.volumeBar=d.volumeBar||{},d.volumeBar.vertical=d.vertical);var e=Kb(this,a.call(this,c,d));return hf(e,c),e.throttledHandleMouseMove=cc(bc(e,e.handleMouseMove),25),e.on("mousedown",e.handleMouseDown),e.on("touchstart",e.handleMouseDown),e.on(e.volumeBar,["focus","slideractive"],function(){e.volumeBar.addClass("vjs-slider-active"),e.addClass("vjs-slider-active"),e.trigger("slideractive")}),e.on(e.volumeBar,["blur","sliderinactive"],function(){e.volumeBar.removeClass("vjs-slider-active"),e.removeClass("vjs-slider-active"),e.trigger("sliderinactive")}),e}return Jb(b,a),b.prototype.createEl=function(){var b="vjs-volume-horizontal";return this.options_.vertical&&(b="vjs-volume-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+b})},b.prototype.handleMouseDown=function(a){var b=this.el_.ownerDocument;this.on(b,"mousemove",this.throttledHandleMouseMove),this.on(b,"touchmove",this.throttledHandleMouseMove),this.on(b,"mouseup",this.handleMouseUp),this.on(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseUp=function(a){var b=this.el_.ownerDocument;this.off(b,"mousemove",this.throttledHandleMouseMove),this.off(b,"touchmove",this.throttledHandleMouseMove),this.off(b,"mouseup",this.handleMouseUp),this.off(b,"touchend",this.handleMouseUp)},b.prototype.handleMouseMove=function(a){this.volumeBar.handleMouseMove(a)},b}(oc);lf.prototype.options_={children:["volumeBar"]},oc.registerComponent("VolumeControl",lf);var mf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return hf(e,c),e.on(c,["loadstart","volumechange"],e.update),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-mute-control "+a.prototype.buildCSSClass.call(this)},b.prototype.handleClick=function(a){var b=this.player_.volume(),c=this.player_.lastVolume_();if(0===b){var d=.1>c?.1:c;this.player_.volume(d),this.player_.muted(!1)}else this.player_.muted(this.player_.muted()?!1:!0)},b.prototype.update=function(a){this.updateIcon_(),this.updateControlText_()},b.prototype.updateIcon_=function(){var a=this.player_.volume(),b=3;0===a||this.player_.muted()?b=0:.33>a?b=1:.67>a&&(b=2);for(var c=0;4>c;c++)u(this.el_,"vjs-vol-"+c);t(this.el_,"vjs-vol-"+b)},b.prototype.updateControlText_=function(){var a=(this.player_.muted()||0===this.player_.volume(),"");this.controlText()!==a&&this.controlText(a)},b}(Ne);mf.prototype.controlText_="Mute",oc.registerComponent("MuteToggle",mf);var nf=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ib(this,b),"undefined"!=typeof d.inline?d.inline=d.inline:d.inline=!0,("undefined"==typeof d.volumeControl||g(d.volumeControl))&&(d.volumeControl=d.volumeControl||{},d.volumeControl.vertical=!d.inline);var e=Kb(this,a.call(this,c,d));return hf(e,c),e.on(e.volumeControl,["slideractive"],e.sliderActive_),e.on(e.volumeControl,["sliderinactive"],e.sliderInactive_),e}return Jb(b,a),b.prototype.sliderActive_=function(){this.addClass("vjs-slider-active")},b.prototype.sliderInactive_=function(){this.removeClass("vjs-slider-active")},b.prototype.createEl=function(){var b="vjs-volume-panel-horizontal";return this.options_.inline||(b="vjs-volume-panel-vertical"),a.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+b})},b}(oc);nf.prototype.options_={children:["muteToggle","volumeControl"]},oc.registerComponent("VolumePanel",nf);var of=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return d&&(e.menuButton_=d.menuButton),e.focusedChild_=-1,e.on("keydown",e.handleKeyPress),e}return Jb(b,a),b.prototype.addItem=function(a){this.addChild(a),a.on("click",bc(this,function(b){this.menuButton_&&(this.menuButton_.unpressButton(),"CaptionSettingsMenuItem"!==a.name()&&this.menuButton_.focus())}))},b.prototype.createEl=function(){var b=this.options_.contentElType||"ul";this.contentEl_=p(b,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var c=a.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return c.appendChild(this.contentEl_),T(c,"click",function(a){a.preventDefault(),a.stopImmediatePropagation()}),c},b.prototype.dispose=function(){this.contentEl_=null,a.prototype.dispose.call(this)},b.prototype.handleKeyPress=function(a){37===a.which||40===a.which?(a.preventDefault(),this.stepForward()):(38===a.which||39===a.which)&&(a.preventDefault(),this.stepBack())},b.prototype.stepForward=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1),this.focus(a)},b.prototype.stepBack=function(){var a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1),this.focus(a)},b.prototype.focus=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,b=this.children().slice(),c=b.length&&b[0].className&&/vjs-menu-title/.test(b[0].className);c&&b.shift(),b.length>0&&(0>a?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())},b}(oc);oc.registerComponent("Menu",of);var pf=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ib(this,b);var e=Kb(this,a.call(this,c,d));e.menuButton_=new Ne(c,d),e.menuButton_.controlText(e.controlText_),e.menuButton_.el_.setAttribute("aria-haspopup","true");var f=Ne.prototype.buildCSSClass();return e.menuButton_.el_.className=e.buildCSSClass()+" "+f,e.menuButton_.removeClass("vjs-control"),e.addChild(e.menuButton_),e.update(),e.enabled_=!0,e.on(e.menuButton_,"tap",e.handleClick),e.on(e.menuButton_,"click",e.handleClick),e.on(e.menuButton_,"focus",e.handleFocus),e.on(e.menuButton_,"blur",e.handleBlur),e.on("keydown",e.handleSubmenuKeyPress),e}return Jb(b,a),b.prototype.update=function(){var a=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=a,this.addChild(a),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?this.hide():this.show()},b.prototype.createMenu=function(){var a=new of(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var b=p("li",{className:"vjs-menu-title",innerHTML:$(this.options_.title),tabIndex:-1});this.hideThreshold_+=1,a.children_.unshift(b),r(b,a.contentEl())}if(this.items=this.createItems(),this.items)for(var c=0;c<this.items.length;c++)a.addItem(this.items[c]);return a},b.prototype.createItems=function(){},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildWrapperCSSClass()},{})},b.prototype.buildWrapperCSSClass=function(){var b="vjs-menu-button";b+=this.options_.inline===!0?"-inline":"-popup";var c=Ne.prototype.buildCSSClass();return"vjs-menu-button "+b+" "+c+" "+a.prototype.buildCSSClass.call(this)},b.prototype.buildCSSClass=function(){var b="vjs-menu-button";return b+=this.options_.inline===!0?"-inline":"-popup","vjs-menu-button "+b+" "+a.prototype.buildCSSClass.call(this)},b.prototype.controlText=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.menuButton_.el();return this.menuButton_.controlText(a,b)},b.prototype.handleClick=function(a){this.one(this.menu.contentEl(),"mouseleave",bc(this,function(a){this.unpressButton(),this.el_.blur()})),this.buttonPressed_?this.unpressButton():this.pressButton()},b.prototype.focus=function(){this.menuButton_.focus()},b.prototype.blur=function(){this.menuButton_.blur()},b.prototype.handleFocus=function(){T(Ab,"keydown",bc(this,this.handleKeyPress))},b.prototype.handleBlur=function(){U(Ab,"keydown",bc(this,this.handleKeyPress))},b.prototype.handleKeyPress=function(a){27===a.which||9===a.which?(this.buttonPressed_&&this.unpressButton(),9!==a.which&&(a.preventDefault(),this.menuButton_.el_.focus())):(38===a.which||40===a.which)&&(this.buttonPressed_||(this.pressButton(),a.preventDefault()))},b.prototype.handleSubmenuKeyPress=function(a){(27===a.which||9===a.which)&&(this.buttonPressed_&&this.unpressButton(),9!==a.which&&(a.preventDefault(),this.menuButton_.el_.focus()))},b.prototype.pressButton=function(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),vc&&n())return;this.menu.focus()}},b.prototype.unpressButton=function(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","false"))},b.prototype.disable=function(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()},b.prototype.enable=function(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()},b}(oc);oc.registerComponent("MenuButton",pf);var qf=function(a){function b(c,d){Ib(this,b);var e=d.tracks,f=Kb(this,a.call(this,c,d));if(f.items.length<=1&&f.hide(),!e)return Kb(f);var g=bc(f,f.update);return e.addEventListener("removetrack",g),e.addEventListener("addtrack",g),f.player_.on("ready",g),f.player_.on("dispose",function(){e.removeEventListener("removetrack",g),e.removeEventListener("addtrack",g)}),f}return Jb(b,a),b}(pf);oc.registerComponent("TrackButton",qf);var rf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.selectable=d.selectable,e.isSelected_=d.selected||!1,e.selected(e.isSelected_),e.selectable?e.el_.setAttribute("role","menuitemcheckbox"):e.el_.setAttribute("role","menuitem"),e}return Jb(b,a),b.prototype.createEl=function(b,c,d){return this.nonIconControl=!0,a.prototype.createEl.call(this,"li",e({className:"vjs-menu-item",innerHTML:'<span class="vjs-menu-item-text">'+this.localize(this.options_.label)+"</span>",tabIndex:-1},c),d)},b.prototype.handleClick=function(a){this.selected(!0)},b.prototype.selected=function(a){this.selectable&&(a?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))},b}(Ge);oc.registerComponent("MenuItem",rf);var sf=function(a){function b(c,d){Ib(this,b);var e=d.track,f=c.textTracks();d.label=e.label||e.language||"Unknown",d.selected="showing"===e.mode;var g=Kb(this,a.call(this,c,d));g.track=e;var h=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];g.handleTracksChange.apply(g,b)},i=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];g.handleSelectedLanguageChange.apply(g,b)};if(c.on(["loadstart","texttrackchange"],h),f.addEventListener("change",h),f.addEventListener("selectedlanguagechange",i),g.on("dispose",function(){c.off(["loadstart","texttrackchange"],h),f.removeEventListener("change",h),f.removeEventListener("selectedlanguagechange",i)}),void 0===f.onchange){var j=void 0;g.on(["tap","click"],function(){if("object"!==Hb(vb.Event))try{j=new vb.Event("change")}catch(a){}j||(j=Ab.createEvent("Event"),j.initEvent("change",!0,!0)),f.dispatchEvent(j)})}return g.handleTracksChange(),g}return Jb(b,a),b.prototype.handleClick=function(b){var c=this.track.kind,d=this.track.kinds,e=this.player_.textTracks();if(d||(d=[c]),a.prototype.handleClick.call(this,b),e)for(var f=0;f<e.length;f++){var g=e[f];g===this.track&&d.indexOf(g.kind)>-1?"showing"!==g.mode&&(g.mode="showing"):"disabled"!==g.mode&&(g.mode="disabled")}},b.prototype.handleTracksChange=function(a){var b="showing"===this.track.mode;b!==this.isSelected_&&this.selected(b)},b.prototype.handleSelectedLanguageChange=function(a){if("showing"===this.track.mode){var b=this.player_.cache_.selectedLanguage;if(b&&b.enabled&&b.language===this.track.language&&b.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}},b.prototype.dispose=function(){this.track=null,a.prototype.dispose.call(this)},b}(rf);oc.registerComponent("TextTrackMenuItem",sf);var tf=function(a){function b(c,d){return Ib(this,b),d.track={player:c,kind:d.kind,kinds:d.kinds,"default":!1,mode:"disabled"},d.kinds||(d.kinds=[d.kind]),d.label?d.track.label=d.label:d.track.label=d.kinds.join(" and ")+" off",d.selectable=!0,Kb(this,a.call(this,c,d))}return Jb(b,a),b.prototype.handleTracksChange=function(a){for(var b=this.player().textTracks(),c=!0,d=0,e=b.length;e>d;d++){var f=b[d];if(this.options_.kinds.indexOf(f.kind)>-1&&"showing"===f.mode){c=!1;break}}c!==this.isSelected_&&this.selected(c)},b.prototype.handleSelectedLanguageChange=function(a){for(var b=this.player().textTracks(),c=!0,d=0,e=b.length;e>d;d++){var f=b[d];if(["captions","descriptions","subtitles"].indexOf(f.kind)>-1&&"showing"===f.mode){c=!1;break}}c&&(this.player_.cache_.selectedLanguage={enabled:!1})},b}(sf);oc.registerComponent("OffTextTrackMenuItem",tf);var uf=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ib(this,b),d.tracks=c.textTracks(),Kb(this,a.call(this,c,d))}return Jb(b,a),b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:sf,c=void 0;this.label_&&(c=this.label_+" off"),a.push(new tf(this.player_,{kinds:this.kinds_,kind:this.kind_,
- label:c})),this.hideThreshold_+=1;var d=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var e=0;e<d.length;e++){var f=d[e];if(this.kinds_.indexOf(f.kind)>-1){var g=new b(this.player_,{track:f,selectable:!0});g.addClass("vjs-"+f.kind+"-menu-item"),a.push(g)}}return a},b}(qf);oc.registerComponent("TextTrackButton",uf);var vf=function(a){function b(c,d){Ib(this,b);var e=d.track,f=d.cue,g=c.currentTime();d.selectable=!0,d.label=f.text,d.selected=f.startTime<=g&&g<f.endTime;var h=Kb(this,a.call(this,c,d));return h.track=e,h.cue=f,e.addEventListener("cuechange",bc(h,h.update)),h}return Jb(b,a),b.prototype.handleClick=function(b){a.prototype.handleClick.call(this),this.player_.currentTime(this.cue.startTime),this.update(this.cue.startTime)},b.prototype.update=function(a){var b=this.cue,c=this.player_.currentTime();this.selected(b.startTime<=c&&c<b.endTime)},b}(rf);oc.registerComponent("ChaptersTrackMenuItem",vf);var wf=function(a){function b(c,d,e){return Ib(this,b),Kb(this,a.call(this,c,d,e))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-chapters-button "+a.prototype.buildWrapperCSSClass.call(this)},b.prototype.update=function(b){(!this.track_||b&&("addtrack"===b.type||"removetrack"===b.type))&&this.setTrack(this.findChaptersTrack()),a.prototype.update.call(this)},b.prototype.setTrack=function(a){if(this.track_!==a){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){var b=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);b&&b.removeEventListener("load",this.updateHandler_),this.track_=null}if(this.track_=a,this.track_){this.track_.mode="hidden";var c=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);c&&c.addEventListener("load",this.updateHandler_)}}},b.prototype.findChaptersTrack=function(){for(var a=this.player_.textTracks()||[],b=a.length-1;b>=0;b--){var c=a[b];if(c.kind===this.kind_)return c}},b.prototype.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize($(this.kind_))},b.prototype.createMenu=function(){return this.options_.title=this.getMenuCaption(),a.prototype.createMenu.call(this)},b.prototype.createItems=function(){var a=[];if(!this.track_)return a;var b=this.track_.cues;if(!b)return a;for(var c=0,d=b.length;d>c;c++){var e=b[c],f=new vf(this.player_,{track:this.track_,cue:e});a.push(f)}return a},b}(uf);wf.prototype.kind_="chapters",wf.prototype.controlText_="Chapters",oc.registerComponent("ChaptersButton",wf);var xf=function(a){function b(c,d,e){Ib(this,b);var f=Kb(this,a.call(this,c,d,e)),g=c.textTracks(),h=bc(f,f.handleTracksChange);return g.addEventListener("change",h),f.on("dispose",function(){g.removeEventListener("change",h)}),f}return Jb(b,a),b.prototype.handleTracksChange=function(a){for(var b=this.player().textTracks(),c=!1,d=0,e=b.length;e>d;d++){var f=b[d];if(f.kind!==this.kind_&&"showing"===f.mode){c=!0;break}}c?this.disable():this.enable()},b.prototype.buildCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-descriptions-button "+a.prototype.buildWrapperCSSClass.call(this)},b}(uf);xf.prototype.kind_="descriptions",xf.prototype.controlText_="Descriptions",oc.registerComponent("DescriptionsButton",xf);var yf=function(a){function b(c,d,e){return Ib(this,b),Kb(this,a.call(this,c,d,e))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-subtitles-button "+a.prototype.buildWrapperCSSClass.call(this)},b}(uf);yf.prototype.kind_="subtitles",yf.prototype.controlText_="Subtitles",oc.registerComponent("SubtitlesButton",yf);var zf=function(a){function b(c,d){Ib(this,b),d.track={player:c,kind:d.kind,label:d.kind+" settings",selectable:!1,"default":!1,mode:"disabled"},d.selectable=!1,d.name="CaptionSettingsMenuItem";var e=Kb(this,a.call(this,c,d));return e.addClass("vjs-texttrack-settings"),e.controlText(", opens "+d.kind+" settings dialog"),e}return Jb(b,a),b.prototype.handleClick=function(a){this.player().getChild("textTrackSettings").open()},b}(sf);oc.registerComponent("CaptionSettingsMenuItem",zf);var Af=function(a){function b(c,d,e){return Ib(this,b),Kb(this,a.call(this,c,d,e))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-captions-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-captions-button "+a.prototype.buildWrapperCSSClass.call(this)},b.prototype.createItems=function(){var b=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(b.push(new zf(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),a.prototype.createItems.call(this,b)},b}(uf);Af.prototype.kind_="captions",Af.prototype.controlText_="Captions",oc.registerComponent("CaptionsButton",Af);var Bf=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(b,c,d){var f='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);"captions"===this.options_.track.kind&&(f+='\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> '+this.localize("Captions")+"</span>\n "),f+="</span>";var g=a.prototype.createEl.call(this,b,e({innerHTML:f},c),d);return g},b}(sf);oc.registerComponent("SubsCapsMenuItem",Bf);var Cf=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.label_="subtitles",["en","en-us","en-ca","fr-ca"].indexOf(e.player_.language_)>-1&&(e.label_="captions"),e.menuButton_.controlText($(e.label_)),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+a.prototype.buildWrapperCSSClass.call(this)},b.prototype.createItems=function(){var b=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(b.push(new zf(this.player_,{kind:this.label_})),this.hideThreshold_+=1),b=a.prototype.createItems.call(this,b,Bf)},b}(uf);Cf.prototype.kinds_=["captions","subtitles"],Cf.prototype.controlText_="Subtitles",oc.registerComponent("SubsCapsButton",Cf);var Df=function(a){function b(c,d){Ib(this,b);var e=d.track,f=c.audioTracks();d.label=e.label||e.language||"Unknown",d.selected=e.enabled;var g=Kb(this,a.call(this,c,d));g.track=e;var h=function(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];g.handleTracksChange.apply(g,b)};return f.addEventListener("change",h),g.on("dispose",function(){f.removeEventListener("change",h)}),g}return Jb(b,a),b.prototype.handleClick=function(b){var c=this.player_.audioTracks();a.prototype.handleClick.call(this,b);for(var d=0;d<c.length;d++){var e=c[d];e.enabled=e===this.track}},b.prototype.handleTracksChange=function(a){this.selected(this.track.enabled)},b}(rf);oc.registerComponent("AudioTrackMenuItem",Df);var Ef=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ib(this,b),d.tracks=c.audioTracks(),Kb(this,a.call(this,c,d))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-audio-button "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-audio-button "+a.prototype.buildWrapperCSSClass.call(this)},b.prototype.createItems=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.hideThreshold_=1;for(var b=this.player_.audioTracks(),c=0;c<b.length;c++){var d=b[c];a.push(new Df(this.player_,{track:d,selectable:!0}))}return a},b}(qf);Ef.prototype.controlText_="Audio Track",oc.registerComponent("AudioTrackButton",Ef);var Ff=function(a){function b(c,d){Ib(this,b);var e=d.rate,f=parseFloat(e,10);d.label=e,d.selected=1===f,d.selectable=!0;var g=Kb(this,a.call(this,c,d));return g.label=e,g.rate=f,g.on(c,"ratechange",g.update),g}return Jb(b,a),b.prototype.handleClick=function(b){a.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},b.prototype.update=function(a){this.selected(this.player().playbackRate()===this.rate)},b}(rf);Ff.prototype.contentElType="button",oc.registerComponent("PlaybackRateMenuItem",Ff);var Gf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.updateVisibility(),e.updateLabel(),e.on(c,"loadstart",e.updateVisibility),e.on(c,"ratechange",e.updateLabel),e}return Jb(b,a),b.prototype.createEl=function(){var b=a.prototype.createEl.call(this);return this.labelEl_=p("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),b.appendChild(this.labelEl_),b},b.prototype.dispose=function(){this.labelEl_=null,a.prototype.dispose.call(this)},b.prototype.buildCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildCSSClass.call(this)},b.prototype.buildWrapperCSSClass=function(){return"vjs-playback-rate "+a.prototype.buildWrapperCSSClass.call(this)},b.prototype.createMenu=function(){var a=new of(this.player()),b=this.playbackRates();if(b)for(var c=b.length-1;c>=0;c--)a.addChild(new Ff(this.player(),{rate:b[c]+"x"}));return a},b.prototype.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},b.prototype.handleClick=function(a){for(var b=this.player().playbackRate(),c=this.playbackRates(),d=c[0],e=0;e<c.length;e++)if(c[e]>b){d=c[e];break}this.player().playbackRate(d)},b.prototype.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},b.prototype.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},b.prototype.updateVisibility=function(a){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},b.prototype.updateLabel=function(a){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},b}(pf);Gf.prototype.controlText_="Playback Rate",oc.registerComponent("PlaybackRateMenuButton",Gf);var Hf=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},b}(oc);oc.registerComponent("Spacer",Hf);var If=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-custom-control-spacer "+a.prototype.buildCSSClass.call(this)},b.prototype.createEl=function(){var b=a.prototype.createEl.call(this,{className:this.buildCSSClass()});return b.innerHTML=" ",b},b}(Hf);oc.registerComponent("CustomControlSpacer",If);var Jf=function(a){function b(){return Ib(this,b),Kb(this,a.apply(this,arguments))}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},b}(oc);Jf.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},oc.registerComponent("ControlBar",Jf);var Kf=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.on(c,"error",e.open),e}return Jb(b,a),b.prototype.buildCSSClass=function(){return"vjs-error-display "+a.prototype.buildCSSClass.call(this)},b.prototype.content=function(){var a=this.player().error();return a?this.localize(a.message):""},b}(Xc);Kf.prototype.options_=aa(Xc.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),oc.registerComponent("ErrorDisplay",Kf);var Lf="vjs-text-track-settings",Mf=["#000","Black"],Nf=["#00F","Blue"],Of=["#0FF","Cyan"],Pf=["#0F0","Green"],Qf=["#F0F","Magenta"],Rf=["#F00","Red"],Sf=["#FFF","White"],Tf=["#FF0","Yellow"],Uf=["1","Opaque"],Vf=["0.5","Semi-Transparent"],Wf=["0","Transparent"],Xf={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Mf,Sf,Rf,Pf,Nf,Tf,Qf,Of]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Uf,Vf,Wf]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Sf,Mf,Rf,Pf,Nf,Tf,Qf,Of]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],"default":2,parser:function(a){return"1.00"===a?null:Number(a)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Uf,Vf]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Wf,Vf,Uf]}};Xf.windowColor.options=Xf.backgroundColor.options;var Yf=function(a){function b(d,e){Ib(this,b),e.temporary=!1;var f=Kb(this,a.call(this,d,e));return f.updateDisplay=bc(f,f.updateDisplay),f.fill(),f.hasBeenOpened_=f.hasBeenFilled_=!0,f.endDialog=p("p",{className:"vjs-control-text",textContent:f.localize("End of dialog window.")}),f.el().appendChild(f.endDialog),f.setDefaults(),void 0===e.persistTextTrackSettings&&(f.options_.persistTextTrackSettings=f.options_.playerOptions.persistTextTrackSettings),f.on(f.$(".vjs-done-button"),"click",function(){f.saveSettings(),f.close()}),f.on(f.$(".vjs-default-button"),"click",function(){f.setDefaults(),f.updateDisplay()}),c(Xf,function(a){f.on(f.$(a.selector),"change",f.updateDisplay)}),f.options_.persistTextTrackSettings&&f.restoreSettings(),f}return Jb(b,a),b.prototype.dispose=function(){this.endDialog=null,a.prototype.dispose.call(this)},b.prototype.createElSelect_=function(a){var b=this,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"label",e=Xf[a],f=e.id.replace("%s",this.id_),g=[c,f].join(" ").trim();return["<"+d+' id="'+f+'" class="'+("label"===d?"vjs-label":"")+'">',this.localize(e.label),"</"+d+">",'<select aria-labelledby="'+g+'">'].concat(e.options.map(function(a){var c=f+"-"+a[1].replace(/\W+/g,"");return['<option id="'+c+'" value="'+a[0]+'" ','aria-labelledby="'+g+" "+c+'">',b.localize(a[1]),"</option>"].join("")})).concat("</select>").join("")},b.prototype.createElFgColor_=function(){var a="captions-text-legend-"+this.id_;return['<fieldset class="vjs-fg-color vjs-track-setting">','<legend id="'+a+'">',this.localize("Text"),"</legend>",this.createElSelect_("color",a),'<span class="vjs-text-opacity vjs-opacity">',this.createElSelect_("textOpacity",a),"</span>","</fieldset>"].join("")},b.prototype.createElBgColor_=function(){var a="captions-background-"+this.id_;return['<fieldset class="vjs-bg-color vjs-track-setting">','<legend id="'+a+'">',this.localize("Background"),"</legend>",this.createElSelect_("backgroundColor",a),'<span class="vjs-bg-opacity vjs-opacity">',this.createElSelect_("backgroundOpacity",a),"</span>","</fieldset>"].join("")},b.prototype.createElWinColor_=function(){var a="captions-window-"+this.id_;return['<fieldset class="vjs-window-color vjs-track-setting">','<legend id="'+a+'">',this.localize("Window"),"</legend>",this.createElSelect_("windowColor",a),'<span class="vjs-window-opacity vjs-opacity">',this.createElSelect_("windowOpacity",a),"</span>","</fieldset>"].join("")},b.prototype.createElColors_=function(){return p("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},b.prototype.createElFont_=function(){return p("div",{className:"vjs-track-settings-font",innerHTML:['<fieldset class="vjs-font-percent vjs-track-setting">',this.createElSelect_("fontPercent","","legend"),"</fieldset>",'<fieldset class="vjs-edge-style vjs-track-setting">',this.createElSelect_("edgeStyle","","legend"),"</fieldset>",'<fieldset class="vjs-font-family vjs-track-setting">',this.createElSelect_("fontFamily","","legend"),"</fieldset>"].join("")})},b.prototype.createElControls_=function(){var a=this.localize("restore all settings to the default values");return p("div",{className:"vjs-track-settings-controls",innerHTML:['<button class="vjs-default-button" title="'+a+'">',this.localize("Reset"),'<span class="vjs-control-text"> '+a+"</span>","</button>",'<button class="vjs-done-button">'+this.localize("Done")+"</button>"].join("")})},b.prototype.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},b.prototype.label=function(){return this.localize("Caption Settings Dialog")},b.prototype.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},b.prototype.buildCSSClass=function(){return a.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},b.prototype.getValues=function(){var a=this;return d(Xf,function(b,c,d){var e=ib(a.$(c.selector),c.parser);return void 0!==e&&(b[d]=e),b},{})},b.prototype.setValues=function(a){var b=this;c(Xf,function(c,d){jb(b.$(c.selector),a[d],c.parser)})},b.prototype.setDefaults=function(){var a=this;c(Xf,function(b){var c=b.hasOwnProperty("default")?b["default"]:0;a.$(b.selector).selectedIndex=c})},b.prototype.restoreSettings=function(){var a=void 0;try{a=JSON.parse(vb.localStorage.getItem(Lf))}catch(b){Fb.warn(b)}a&&this.setValues(a)},b.prototype.saveSettings=function(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.keys(a).length?vb.localStorage.setItem(Lf,JSON.stringify(a)):vb.localStorage.removeItem(Lf)}catch(b){Fb.warn(b)}}},b.prototype.updateDisplay=function(){var a=this.player_.getChild("textTrackDisplay");a&&a.updateDisplay()},b.prototype.conditionalBlur_=function(){this.previouslyActiveEl_=null,this.off(Ab,"keydown",this.handleKeyDown);var a=this.player_.controlBar,b=a&&a.subsCapsButton,c=a&&a.captionsButton;b?b.focus():c&&c.focus()},b}(Xc);oc.registerComponent("TextTrackSettings",Yf);var Zf=function(a){function b(c,d){Ib(this,b);var e=d.ResizeObserver||vb.ResizeObserver;null===d.ResizeObserver&&(e=!1);var f=aa({createEl:!e},d),g=Kb(this,a.call(this,c,f));return g.ResizeObserver=d.ResizeObserver||vb.ResizeObserver,g.loadListener_=null,g.resizeObserver_=null,g.debouncedHandler_=dc(function(){g.resizeHandler()},100,!1,c),e?(g.resizeObserver_=new g.ResizeObserver(g.debouncedHandler_),g.resizeObserver_.observe(c.el())):(g.loadListener_=function(){g.el_.contentWindow&&T(g.el_.contentWindow,"resize",g.debouncedHandler_),g.off("load",g.loadListener_)},g.on("load",g.loadListener_)),g}return Jb(b,a),b.prototype.createEl=function(){return a.prototype.createEl.call(this,"iframe",{className:"vjs-resize-manager"})},b.prototype.resizeHandler=function(){this.player_.trigger("playerresize")},b.prototype.dispose=function(){this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.el_&&this.el_.contentWindow&&U(this.el_.contentWindow,"resize",this.debouncedHandler_),this.loadListener_&&this.off("load",this.loadListener_),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null},b}(oc);oc.registerComponent("ResizeManager",Zf);var $f=function(a){var b=a.el();if(b.hasAttribute("src"))return a.triggerSourceset(b.src),!0;var c=a.$$("source"),d=[],e="";if(!c.length)return!1;for(var f=0;f<c.length;f++){var g=c[f].src;g&&-1===d.indexOf(g)&&d.push(g)}return d.length?(1===d.length&&(e=d[0]),a.triggerSourceset(e),!0):!1},_f=Object.defineProperty({},"innerHTML",{get:function(){return this.cloneNode(!0).innerHTML},set:function(a){var b=Ab.createElement(this.nodeName.toLowerCase());b.innerHTML=a;for(var c=Ab.createDocumentFragment();b.childNodes.length;)c.appendChild(b.childNodes[0]);return this.innerText="",vb.Element.prototype.appendChild.call(this,c),this.innerHTML}}),ag=function(a,b){for(var c={},d=0;d<a.length&&(c=Object.getOwnPropertyDescriptor(a[d],b),!(c&&c.set&&c.get));d++);return c.enumerable=!0,c.configurable=!0,c},bg=function(a){return ag([a.el(),vb.HTMLMediaElement.prototype,vb.Element.prototype,_f],"innerHTML")},cg=function(a){var b=a.el();if(!b.resetSourceWatch_){var c={},d=bg(a),e=function(c){return function(){for(var d=arguments.length,e=Array(d),f=0;d>f;f++)e[f]=arguments[f];var g=c.apply(b,e);return $f(a),g}};["append","appendChild","insertAdjacentHTML"].forEach(function(a){b[a]&&(c[a]=b[a],b[a]=e(c[a]))}),Object.defineProperty(b,"innerHTML",aa(d,{set:e(d.set)})),b.resetSourceWatch_=function(){b.resetSourceWatch_=null,Object.keys(c).forEach(function(a){b[a]=c[a]}),Object.defineProperty(b,"innerHTML",d)},a.one("sourceset",b.resetSourceWatch_)}},dg=Object.defineProperty({},"src",{get:function(){return this.hasAttribute("src")?ld(vb.Element.prototype.getAttribute.call(this,"src")):""},set:function(a){return vb.Element.prototype.setAttribute.call(this,"src",a),a}}),eg=function(a){return ag([a.el(),vb.HTMLMediaElement.prototype,dg],"src")},fg=function(a){if(a.featuresSourceset){var b=a.el();if(!b.resetSourceset_){var c=eg(a),d=b.setAttribute,e=b.load;Object.defineProperty(b,"src",aa(c,{set:function(d){var e=c.set.call(b,d);return a.triggerSourceset(b.src),e}})),b.setAttribute=function(c,e){var f=d.call(b,c,e);return/src/i.test(c)&&a.triggerSourceset(b.src),f},b.load=function(){var c=e.call(b);return $f(a)||(a.triggerSourceset(""),cg(a)),c},b.currentSrc?a.triggerSourceset(b.currentSrc):$f(a)||cg(a),b.resetSourceset_=function(){b.resetSourceset_=null,b.load=e,b.setAttribute=d,Object.defineProperty(b,"src",c),b.resetSourceWatch_&&b.resetSourceWatch_()}}}},gg=Lb(["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."],["Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\n This may prevent text tracks from loading."]),hg=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,c,d)),f=c.source,g=!1;if(f&&(e.el_.currentSrc!==f.src||c.tag&&3===c.tag.initNetworkState_)?e.setSource(f):e.handleLateInit_(e.el_),c.enableSourceset&&e.setupSourcesetHandling_(),e.el_.hasChildNodes()){for(var h=e.el_.childNodes,i=h.length,j=[];i--;){var k=h[i],l=k.nodeName.toLowerCase();"track"===l&&(e.featuresNativeTextTracks?(e.remoteTextTrackEls().addTrackElement_(k),e.remoteTextTracks().addTrack(k.track),e.textTracks().addTrack(k.track),g||e.el_.hasAttribute("crossorigin")||!nd(k.src)||(g=!0)):j.push(k))}for(var m=0;m<j.length;m++)e.el_.removeChild(j[m])}return e.proxyNativeTracks_(),e.featuresNativeTextTracks&&g&&Fb.warn(Gb(gg)),e.restoreMetadataTracksInIOSNativePlayer_(),(Hc||tc||zc)&&c.nativeControlsForTouch===!0&&e.setControls(!0),e.proxyWebkitFullscreen_(),e.triggerReady(),e}return Jb(b,a),b.prototype.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),b.disposeMediaElement(this.el_),this.options_=null,a.prototype.dispose.call(this)},b.prototype.setupSourcesetHandling_=function(){fg(this)},b.prototype.restoreMetadataTracksInIOSNativePlayer_=function(){var a=this.textTracks(),b=void 0,c=function(){b=[];for(var c=0;c<a.length;c++){var d=a[c];"metadata"===d.kind&&b.push({track:d,storedMode:d.mode})}};c(),a.addEventListener("change",c),this.on("dispose",function(){return a.removeEventListener("change",c)});var d=function e(){for(var c=0;c<b.length;c++){var d=b[c];"disabled"===d.track.mode&&d.track.mode!==d.storedMode&&(d.track.mode=d.storedMode)}a.removeEventListener("change",e)};this.on("webkitbeginfullscreen",function(){a.removeEventListener("change",c),a.removeEventListener("change",d),a.addEventListener("change",d)}),this.on("webkitendfullscreen",function(){a.removeEventListener("change",c),a.addEventListener("change",c),a.removeEventListener("change",d)})},b.prototype.overrideNative_=function(a,b){var c=this;if(b===this["featuresNative"+a+"Tracks"]){var d=a.toLowerCase();this[d+"TracksListeners_"]&&Object.keys(this[d+"TracksListeners_"]).forEach(function(a){var b=c.el()[d+"Tracks"];b.removeEventListener(a,c[d+"TracksListeners_"][a])}),this["featuresNative"+a+"Tracks"]=!b,this[d+"TracksListeners_"]=null,this.proxyNativeTracksForType_(d)}},b.prototype.overrideNativeAudioTracks=function(a){this.overrideNative_("Audio",a)},b.prototype.overrideNativeVideoTracks=function(a){this.overrideNative_("Video",a)},b.prototype.proxyNativeTracksForType_=function(a){var b=this,c=Wd[a],d=this.el()[c.getterName],e=this[c.getterName]();if(this["featuresNative"+c.capitalName+"Tracks"]&&d&&d.addEventListener){var f={change:function(a){e.trigger({type:"change",target:e,currentTarget:e,srcElement:e})},addtrack:function(a){e.addTrack(a.track)},removetrack:function(a){e.removeTrack(a.track)}},g=function(){for(var a=[],b=0;b<e.length;b++){for(var c=!1,f=0;f<d.length;f++)if(d[f]===e[b]){c=!0;break}c||a.push(e[b])}for(;a.length;)e.removeTrack(a.shift())};this[c.getterName+"Listeners_"]=f,Object.keys(f).forEach(function(a){var c=f[a];d.addEventListener(a,c),b.on("dispose",function(b){return d.removeEventListener(a,c)})}),this.on("loadstart",g),this.on("dispose",function(a){return b.off("loadstart",g)})}},b.prototype.proxyNativeTracks_=function(){var a=this;Wd.names.forEach(function(b){a.proxyNativeTracksForType_(b)})},b.prototype.createEl=function(){var a=this.options_.tag;if(!a||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(a){var c=a.cloneNode(!0);a.parentNode&&a.parentNode.insertBefore(c,a),b.disposeMediaElement(a),a=c}else{a=Ab.createElement("video");var d=this.options_.tag&&x(this.options_.tag),f=aa({},d);Hc&&this.options_.nativeControlsForTouch===!0||delete f.controls,w(a,e(f,{id:this.options_.techId,"class":"vjs-tech"}))}a.playerId=this.options_.playerId}"undefined"!=typeof this.options_.preload&&z(a,"preload",this.options_.preload);for(var g=["loop","muted","playsinline","autoplay"],h=0;h<g.length;h++){var i=g[h],j=this.options_[i];"undefined"!=typeof j&&(j?z(a,i,i):A(a,i),a[i]=j)}return a},b.prototype.handleLateInit_=function(a){if(0!==a.networkState&&3!==a.networkState){if(0===a.readyState){var b=!1,c=function(){b=!0};this.on("loadstart",c);var d=function(){b||this.trigger("loadstart")};return this.on("loadedmetadata",d),void this.ready(function(){this.off("loadstart",c),this.off("loadedmetadata",d),b||this.trigger("loadstart")})}var e=["loadstart"];e.push("loadedmetadata"),a.readyState>=2&&e.push("loadeddata"),a.readyState>=3&&e.push("canplay"),a.readyState>=4&&e.push("canplaythrough"),this.ready(function(){e.forEach(function(a){this.trigger(a)},this)})}},b.prototype.setCurrentTime=function(a){try{this.el_.currentTime=a}catch(b){Fb(b,"Video is not ready. (Video.js)")}},b.prototype.duration=function(){var a=this;if(this.el_.duration===1/0&&xc&&Cc&&0===this.el_.currentTime){var b=function c(){a.el_.currentTime>0&&(a.el_.duration===1/0&&a.trigger("durationchange"),a.off("timeupdate",c))};return this.on("timeupdate",b),NaN}return this.el_.duration||NaN},b.prototype.width=function(){return this.el_.offsetWidth},b.prototype.height=function(){return this.el_.offsetHeight},b.prototype.proxyWebkitFullscreen_=function(){var a=this;if("webkitDisplayingFullscreen"in this.el_){var b=function(){this.trigger("fullscreenchange",{isFullscreen:!1})},c=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",b),this.trigger("fullscreenchange",{isFullscreen:!0}))};this.on("webkitbeginfullscreen",c),this.on("dispose",function(){a.off("webkitbeginfullscreen",c),a.off("webkitendfullscreen",b)})}},b.prototype.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var a=vb.navigator&&vb.navigator.userAgent||"";if(/Android/.test(a)||!/Chrome|Mac OS X 10.5/.test(a))return!0}return!1},b.prototype.enterFullScreen=function(){var a=this.el_;a.paused&&a.networkState<=a.HAVE_METADATA?(this.el_.play(),this.setTimeout(function(){a.pause(),a.webkitEnterFullScreen()},0)):a.webkitEnterFullScreen()},b.prototype.exitFullScreen=function(){this.el_.webkitExitFullScreen()},b.prototype.src=function(a){return void 0===a?this.el_.src:void this.setSrc(a)},b.prototype.reset=function(){b.resetMediaElement(this.el_)},b.prototype.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},b.prototype.setControls=function(a){this.el_.controls=!!a},b.prototype.addTextTrack=function(b,c,d){return this.featuresNativeTextTracks?this.el_.addTextTrack(b,c,d):a.prototype.addTextTrack.call(this,b,c,d)},b.prototype.createRemoteTextTrack=function(b){if(!this.featuresNativeTextTracks)return a.prototype.createRemoteTextTrack.call(this,b);var c=Ab.createElement("track");return b.kind&&(c.kind=b.kind),b.label&&(c.label=b.label),(b.language||b.srclang)&&(c.srclang=b.language||b.srclang),b["default"]&&(c["default"]=b["default"]),b.id&&(c.id=b.id),b.src&&(c.src=b.src),c},b.prototype.addRemoteTextTrack=function(b,c){var d=a.prototype.addRemoteTextTrack.call(this,b,c);return this.featuresNativeTextTracks&&this.el().appendChild(d),d},b.prototype.removeRemoteTextTrack=function(b){if(a.prototype.removeRemoteTextTrack.call(this,b),this.featuresNativeTextTracks)for(var c=this.$$("track"),d=c.length;d--;)(b===c[d]||b===c[d].track)&&this.el().removeChild(c[d])},b.prototype.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var a={};return"undefined"!=typeof this.el().webkitDroppedFrameCount&&"undefined"!=typeof this.el().webkitDecodedFrameCount&&(a.droppedVideoFrames=this.el().webkitDroppedFrameCount,a.totalVideoFrames=this.el().webkitDecodedFrameCount),vb.performance&&"function"==typeof vb.performance.now?a.creationTime=vb.performance.now():vb.performance&&vb.performance.timing&&"number"==typeof vb.performance.timing.navigationStart&&(a.creationTime=vb.Date.now()-vb.performance.timing.navigationStart),a},b}(ue);if(l()){hg.TEST_VID=Ab.createElement("video");var ig=Ab.createElement("track");ig.kind="captions",ig.srclang="en",ig.label="English",hg.TEST_VID.appendChild(ig)}hg.isSupported=function(){try{hg.TEST_VID.volume=.5}catch(a){return!1}return!(!hg.TEST_VID||!hg.TEST_VID.canPlayType)},hg.canPlayType=function(a){return hg.TEST_VID.canPlayType(a)},hg.canPlaySource=function(a,b){return hg.canPlayType(a.type)},hg.canControlVolume=function(){try{var a=hg.TEST_VID.volume;return hg.TEST_VID.volume=a/2+.1,a!==hg.TEST_VID.volume}catch(b){return!1}},hg.canControlPlaybackRate=function(){if(xc&&Cc&&58>Dc)return!1;try{var a=hg.TEST_VID.playbackRate;return hg.TEST_VID.playbackRate=a/2+.1,a!==hg.TEST_VID.playbackRate}catch(b){return!1}},hg.canOverrideAttributes=function(){try{var a=function(){};Object.defineProperty(Ab.createElement("video"),"src",{
- get:a,set:a}),Object.defineProperty(Ab.createElement("audio"),"src",{get:a,set:a}),Object.defineProperty(Ab.createElement("video"),"innerHTML",{get:a,set:a}),Object.defineProperty(Ab.createElement("audio"),"innerHTML",{get:a,set:a})}catch(b){return!1}return!0},hg.supportsNativeTextTracks=function(){return Gc},hg.supportsNativeVideoTracks=function(){return!(!hg.TEST_VID||!hg.TEST_VID.videoTracks)},hg.supportsNativeAudioTracks=function(){return!(!hg.TEST_VID||!hg.TEST_VID.audioTracks)},hg.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],hg.prototype.featuresVolumeControl=hg.canControlVolume(),hg.prototype.featuresPlaybackRate=hg.canControlPlaybackRate(),hg.prototype.featuresSourceset=hg.canOverrideAttributes(),hg.prototype.movingMediaElementInDOM=!vc,hg.prototype.featuresFullscreenResize=!0,hg.prototype.featuresProgressEvents=!0,hg.prototype.featuresTimeupdateEvents=!0,hg.prototype.featuresNativeTextTracks=hg.supportsNativeTextTracks(),hg.prototype.featuresNativeVideoTracks=hg.supportsNativeVideoTracks(),hg.prototype.featuresNativeAudioTracks=hg.supportsNativeAudioTracks();var jg=hg.TEST_VID&&hg.TEST_VID.constructor.prototype.canPlayType,kg=/^application\/(?:x-|vnd\.apple\.)mpegurl/i;hg.patchCanPlayType=function(){yc>=4&&!Ac&&!Cc&&(hg.TEST_VID.constructor.prototype.canPlayType=function(a){return a&&kg.test(a)?"maybe":jg.call(this,a)})},hg.unpatchCanPlayType=function(){var a=hg.TEST_VID.constructor.prototype.canPlayType;return hg.TEST_VID.constructor.prototype.canPlayType=jg,a},hg.patchCanPlayType(),hg.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},hg.resetMediaElement=function(a){if(a){for(var b=a.querySelectorAll("source"),c=b.length;c--;)a.removeChild(b[c]);a.removeAttribute("src"),"function"==typeof a.load&&!function(){try{a.load()}catch(b){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(a){hg.prototype[a]=function(){return this.el_[a]||this.el_.hasAttribute(a)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){hg.prototype["set"+$(a)]=function(b){this.el_[a]=b,b?this.el_.setAttribute(a,a):this.el_.removeAttribute(a)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","played","networkState","readyState","videoWidth","videoHeight"].forEach(function(a){hg.prototype[a]=function(){return this.el_[a]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate"].forEach(function(a){hg.prototype["set"+$(a)]=function(b){this.el_[a]=b}}),["pause","load","play"].forEach(function(a){hg.prototype[a]=function(){return this.el_[a]()}}),ue.withSourceHandlers(hg),hg.nativeSourceHandler={},hg.nativeSourceHandler.canPlayType=function(a){try{return hg.TEST_VID.canPlayType(a)}catch(b){return""}},hg.nativeSourceHandler.canHandleSource=function(a,b){if(a.type)return hg.nativeSourceHandler.canPlayType(a.type);if(a.src){var c=md(a.src);return hg.nativeSourceHandler.canPlayType("video/"+c)}return""},hg.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)},hg.nativeSourceHandler.dispose=function(){},hg.registerSourceHandler(hg.nativeSourceHandler),ue.registerTech("Html5",hg);var lg=Lb(["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "],["\n Using the tech directly can be dangerous. I hope you know what you're doing.\n See https://github.com/videojs/video.js/issues/2617 for more info.\n "]),mg=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],ng={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},og=function(a){function b(c,d,f){if(Ib(this,b),c.id=c.id||d.id||"vjs_video_"+M(),d=e(b.getTagSettings(c),d),d.initChildren=!1,d.createEl=!1,d.evented=!1,d.reportTouchActivity=!1,!d.language)if("function"==typeof c.closest){var g=c.closest("[lang]");g&&g.getAttribute&&(d.language=g.getAttribute("lang"))}else for(var h=c;h&&1===h.nodeType;){if(x(h).hasOwnProperty("lang")){d.language=h.getAttribute("lang");break}h=h.parentNode}var i=Kb(this,a.call(this,null,d,f));if(i.isPosterFromTech_=!1,i.queuedCallbacks_=[],i.isReady_=!1,i.hasStarted_=!1,i.userActive_=!1,!i.options_||!i.options_.techOrder||!i.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(i.tag=c,i.tagAttributes=c&&x(c),i.language(i.options_.language),d.languages){var j={};Object.getOwnPropertyNames(d.languages).forEach(function(a){j[a.toLowerCase()]=d.languages[a]}),i.languages_=j}else i.languages_=b.prototype.options_.languages;i.cache_={},i.poster_=d.poster||"",i.controls_=!!d.controls,i.cache_.lastVolume=1,c.controls=!1,c.removeAttribute("controls"),i.scrubbing_=!1,i.el_=i.createEl(),i.cache_.lastPlaybackRate=i.defaultPlaybackRate(),Y(i,{eventBusKey:"el_"});var k=aa(i.options_);if(d.plugins){var l=d.plugins;Object.keys(l).forEach(function(a){if("function"!=typeof this[a])throw new Error('plugin "'+a+'" does not exist');this[a](l[a])},i)}i.options_.playerOptions=k,i.middleware_=[],i.initChildren(),i.isAudio("audio"===c.nodeName.toLowerCase()),i.controls()?i.addClass("vjs-controls-enabled"):i.addClass("vjs-controls-disabled"),i.el_.setAttribute("role","region"),i.isAudio()?i.el_.setAttribute("aria-label",i.localize("Audio Player")):i.el_.setAttribute("aria-label",i.localize("Video Player")),i.isAudio()&&i.addClass("vjs-audio"),i.flexNotSupported_()&&i.addClass("vjs-no-flex"),vc||i.addClass("vjs-workinghover"),b.players[i.id_]=i;var m=sb.split(".")[0];return i.addClass("vjs-v"+m),i.userActive(!0),i.reportUserActivity(),i.one("play",i.listenForUserActivity_),i.on("fullscreenchange",i.handleFullscreenChange_),i.on("stageclick",i.handleStageClick_),i.changingSrc_=!1,i.playWaitingForReady_=!1,i.playOnLoadstart_=null,i}return Jb(b,a),b.prototype.dispose=function(){this.trigger("dispose"),this.off("dispose"),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),b.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),$a(this),a.prototype.dispose.call(this)},b.prototype.createEl=function(){var b=this.tag,c=void 0,d=this.playerElIngest_=b.parentNode&&b.parentNode.hasAttribute&&b.parentNode.hasAttribute("data-vjs-player"),e="video-js"===this.tag.tagName.toLowerCase();d?c=this.el_=b.parentNode:e||(c=this.el_=a.prototype.createEl.call(this,"div"));var f=x(b);if(e){for(c=this.el_=b,b=this.tag=Ab.createElement("video");c.children.length;)b.appendChild(c.firstChild);s(c,"video-js")||t(c,"video-js"),c.appendChild(b),d=this.playerElIngest_=c,Object.keys(c).forEach(function(a){b[a]=c[a]})}if(b.setAttribute("tabindex","-1"),b.removeAttribute("width"),b.removeAttribute("height"),Object.getOwnPropertyNames(f).forEach(function(a){c.setAttribute(a,f[a]),e&&b.setAttribute(a,f[a])}),b.playerId=b.id,b.id+="_html5_api",b.className="vjs-tech",b.player=c.player=this,this.addClass("vjs-paused"),vb.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=_b("vjs-styles-dimensions");var g=Pb(".vjs-styles-defaults"),h=Pb("head");h.insertBefore(this.styleEl_,g?g.nextSibling:h.firstChild)}this.width(this.options_.width),this.height(this.options_.height),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio);for(var i=b.getElementsByTagName("a"),j=0;j<i.length;j++){var k=i.item(j);t(k,"vjs-hidden"),k.setAttribute("hidden","hidden")}return b.initNetworkState_=b.networkState,b.parentNode&&!d&&b.parentNode.insertBefore(c,b),r(b,c),this.children_.unshift(b),this.el_.setAttribute("lang",this.language_),this.el_=c,c},b.prototype.width=function(a){return this.dimension("width",a)},b.prototype.height=function(a){return this.dimension("height",a)},b.prototype.dimension=function(a,b){var c=a+"_";if(void 0===b)return this[c]||0;if(""===b)return this[c]=void 0,void this.updateStyleEl_();var d=parseFloat(b);return isNaN(d)?void Fb.error('Improper value "'+b+'" supplied for for '+a):(this[c]=d,void this.updateStyleEl_())},b.prototype.fluid=function(a){return void 0===a?!!this.fluid_:(this.fluid_=!!a,a?this.addClass("vjs-fluid"):this.removeClass("vjs-fluid"),void this.updateStyleEl_())},b.prototype.aspectRatio=function(a){if(void 0===a)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(a))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=a,this.fluid(!0),this.updateStyleEl_()},b.prototype.updateStyleEl_=function(){if(vb.VIDEOJS_NO_DYNAMIC_STYLE===!0){var a="number"==typeof this.width_?this.width_:this.options_.width,b="number"==typeof this.height_?this.height_:this.options_.height,c=this.tech_&&this.tech_.el();return void(c&&(a>=0&&(c.width=a),b>=0&&(c.height=b)))}var d=void 0,e=void 0,f=void 0,g=void 0;f=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";var h=f.split(":"),i=h[1]/h[0];d=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/i:this.videoWidth()||300,e=void 0!==this.height_?this.height_:d*i,g=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(g),ac(this.styleEl_,"\n ."+g+" {\n width: "+d+"px;\n height: "+e+"px;\n }\n\n ."+g+".vjs-fluid {\n padding-top: "+100*i+"%;\n }\n ")},b.prototype.loadTech_=function(a,b){var c=this;this.tech_&&this.unloadTech_();var d=$(a),f=a.charAt(0).toLowerCase()+a.slice(1);"Html5"!==d&&this.tag&&(ue.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=d,this.isReady_=!1;var g={source:b,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+d+"_api",autoplay:this.options_.autoplay,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Yd.names.forEach(function(a){var b=Yd[a];g[b.getterName]=c[b.privateName]}),e(g,this.options_[d]),e(g,this.options_[f]),e(g,this.options_[a.toLowerCase()]),this.tag&&(g.tag=this.tag),b&&b.src===this.cache_.src&&this.cache_.currentTime>0&&(g.startTime=this.cache_.currentTime);var h=ue.getTech(a);if(!h)throw new Error("No Tech named '"+d+"' exists! '"+d+"' should be registered using videojs.registerTech()'");this.tech_=new h(g),this.tech_.ready(bc(this,this.handleTechReady_),!0),Uc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),mg.forEach(function(a){c.on(c.tech_,a,c["handleTech"+$(a)+"_"])}),Object.keys(ng).forEach(function(a){c.on(c.tech_,a,function(b){return 0===c.tech_.playbackRate()&&c.tech_.seeking()?void c.queuedCallbacks_.push({callback:c["handleTech"+ng[a]+"_"].bind(c),event:b}):void c["handleTech"+ng[a]+"_"](b)})}),this.on(this.tech_,"loadstart",this.handleTechLoadStart_),this.on(this.tech_,"sourceset",this.handleTechSourceset_),this.on(this.tech_,"waiting",this.handleTechWaiting_),this.on(this.tech_,"ended",this.handleTechEnded_),this.on(this.tech_,"seeking",this.handleTechSeeking_),this.on(this.tech_,"play",this.handleTechPlay_),this.on(this.tech_,"firstplay",this.handleTechFirstPlay_),this.on(this.tech_,"pause",this.handleTechPause_),this.on(this.tech_,"durationchange",this.handleTechDurationChange_),this.on(this.tech_,"fullscreenchange",this.handleTechFullscreenChange_),this.on(this.tech_,"error",this.handleTechError_),this.on(this.tech_,"loadedmetadata",this.updateStyleEl_),this.on(this.tech_,"posterchange",this.handleTechPosterChange_),this.on(this.tech_,"textdata",this.handleTechTextData_),this.on(this.tech_,"ratechange",this.handleTechRateChange_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===d&&this.tag||r(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},b.prototype.unloadTech_=function(){var a=this;Yd.names.forEach(function(b){var c=Yd[b];a[c.privateName]=a[c.getterName]()}),this.textTracksJson_=Uc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},b.prototype.tech=function(a){return void 0===a&&Fb.warn(Gb(lg)),this.tech_},b.prototype.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mousedown",this.handleTechClick_),this.on(this.tech_,"touchstart",this.handleTechTouchStart_),this.on(this.tech_,"touchmove",this.handleTechTouchMove_),this.on(this.tech_,"touchend",this.handleTechTouchEnd_),this.on(this.tech_,"tap",this.handleTechTap_)},b.prototype.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.handleTechTap_),this.off(this.tech_,"touchstart",this.handleTechTouchStart_),this.off(this.tech_,"touchmove",this.handleTechTouchMove_),this.off(this.tech_,"touchend",this.handleTechTouchEnd_),this.off(this.tech_,"mousedown",this.handleTechClick_)},b.prototype.handleTechReady_=function(){if(this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_(),(this.src()||this.currentSrc())&&this.tag&&this.options_.autoplay&&this.paused())try{delete this.tag.poster}catch(a){Fb("deleting tag.poster throws in some browsers",a)}},b.prototype.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay"))},b.prototype.updateSourceCaches_=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b=a,c="";"string"!=typeof b&&(b=a.src,c=a.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],b&&!c&&(c=De(this,b)),this.cache_.source={src:b,type:c};for(var d=this.cache_.sources.filter(function(a){return a.src&&a.src===b}),e=[],f=this.$$("source"),g=[],h=0;h<f.length;h++){var i=x(f[h]);e.push(i),i.src&&i.src===b&&g.push(i.src)}g.length&&!d.length?this.cache_.sources=e:d.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=b},b.prototype.handleTechSourceset_=function(a){var b=this;if(!this.changingSrc_&&(this.updateSourceCaches_(a.src),!a.src)){var c=function d(a){"sourceset"!==a.type&&b.updateSourceCaches_(b.techGet_("currentSrc")),b.tech_.off(["sourceset","loadstart"],d)};this.tech_.one(["sourceset","loadstart"],c)}this.trigger({src:a.src,type:"sourceset"})},b.prototype.hasStarted=function(a){return void 0===a?this.hasStarted_:void(a!==this.hasStarted_&&(this.hasStarted_=a,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started")))},b.prototype.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},b.prototype.handleTechRateChange_=function(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(a){return a.callback(a.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},b.prototype.handleTechWaiting_=function(){var a=this;this.addClass("vjs-waiting"),this.trigger("waiting"),this.one("timeupdate",function(){return a.removeClass("vjs-waiting")})},b.prototype.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},b.prototype.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},b.prototype.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},b.prototype.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},b.prototype.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.trigger("seeked")},b.prototype.handleTechFirstPlay_=function(){this.options_.starttime&&(Fb.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},b.prototype.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},b.prototype.handleTechEnded_=function(){this.addClass("vjs-ended"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},b.prototype.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},b.prototype.handleTechClick_=function(a){L(a)&&this.controls_&&(this.paused()?this.play():this.pause())},b.prototype.handleTechTap_=function(){this.userActive(!this.userActive())},b.prototype.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},b.prototype.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},b.prototype.handleTechTouchEnd_=function(a){a.preventDefault()},b.prototype.handleFullscreenChange_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},b.prototype.handleStageClick_=function(){this.reportUserActivity()},b.prototype.handleTechFullscreenChange_=function(a,b){b&&this.isFullscreen(b.isFullscreen),this.trigger("fullscreenchange")},b.prototype.handleTechError_=function(){var a=this.tech_.error();this.error(a)},b.prototype.handleTechTextData_=function(){var a=null;arguments.length>1&&(a=arguments[1]),this.trigger("textdata",a)},b.prototype.getCache=function(){return this.cache_},b.prototype.techCall_=function(a,b){this.ready(function(){if(a in ze)return Wa(this.middleware_,this.tech_,a,b);if(a in Ae)return Xa(this.middleware_,this.tech_,a,b);try{this.tech_&&this.tech_[a](b)}catch(c){throw Fb(c),c}},!0)},b.prototype.techGet_=function(a){if(this.tech_&&this.tech_.isReady_){if(a in ye)return Va(this.middleware_,this.tech_,a);if(a in Ae)return Xa(this.middleware_,this.tech_,a);try{return this.tech_[a]()}catch(b){if(void 0===this.tech_[a])throw Fb("Video.js: "+a+" method not defined for "+this.techName_+" playback technology.",b),b;if("TypeError"===b.name)throw Fb("Video.js: "+a+" unavailable on "+this.techName_+" playback technology element.",b),this.tech_.isReady_=!1,b;throw Fb(b),b}}},b.prototype.play=function(){var a=this;if(this.playOnLoadstart_&&this.off("loadstart",this.playOnLoadstart_),this.isReady_){if(!this.changingSrc_&&(this.src()||this.currentSrc()))return this.techGet_("play");this.playOnLoadstart_=function(){a.playOnLoadstart_=null,ja(a.play())},this.one("loadstart",this.playOnLoadstart_)}else{if(this.playWaitingForReady_)return;this.playWaitingForReady_=!0,this.ready(function(){a.playWaitingForReady_=!1,ja(a.play())})}},b.prototype.pause=function(){this.techCall_("pause")},b.prototype.paused=function(){return this.techGet_("paused")===!1?!1:!0},b.prototype.played=function(){return this.techGet_("played")||ea(0,0)},b.prototype.scrubbing=function(a){return"undefined"==typeof a?this.scrubbing_:(this.scrubbing_=!!a,void(a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")))},b.prototype.currentTime=function(a){return"undefined"!=typeof a?(0>a&&(a=0),void this.techCall_("setCurrentTime",a)):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},b.prototype.duration=function(a){return void 0===a?void 0!==this.cache_.duration?this.cache_.duration:NaN:(a=parseFloat(a),0>a&&(a=1/0),void(a!==this.cache_.duration&&(this.cache_.duration=a,a===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),this.trigger("durationchange"))))},b.prototype.remainingTime=function(){return this.duration()-this.currentTime()},b.prototype.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},b.prototype.buffered=function c(){var c=this.techGet_("buffered");return c&&c.length||(c=ea(0,0)),c},b.prototype.bufferedPercent=function(){return fa(this.buffered(),this.duration())},b.prototype.bufferedEnd=function(){var a=this.buffered(),b=this.duration(),c=a.end(a.length-1);return c>b&&(c=b),c},b.prototype.volume=function(a){var b=void 0;return void 0!==a?(b=Math.max(0,Math.min(1,parseFloat(a))),this.cache_.volume=b,this.techCall_("setVolume",b),void(b>0&&this.lastVolume_(b))):(b=parseFloat(this.techGet_("volume")),isNaN(b)?1:b)},b.prototype.muted=function(a){return void 0!==a?void this.techCall_("setMuted",a):this.techGet_("muted")||!1},b.prototype.defaultMuted=function(a){return void 0!==a?this.techCall_("setDefaultMuted",a):this.techGet_("defaultMuted")||!1},b.prototype.lastVolume_=function(a){return void 0!==a&&0!==a?void(this.cache_.lastVolume=a):this.cache_.lastVolume},b.prototype.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},b.prototype.isFullscreen=function(a){return void 0!==a?void(this.isFullscreen_=!!a):!!this.isFullscreen_},b.prototype.requestFullscreen=function(){var a=Jc;this.isFullscreen(!0),a.requestFullscreen?(T(Ab,a.fullscreenchange,bc(this,function b(c){this.isFullscreen(Ab[a.fullscreenElement]),this.isFullscreen()===!1&&U(Ab,a.fullscreenchange,b),this.trigger("fullscreenchange")})),this.el_[a.requestFullscreen]()):this.tech_.supportsFullScreen()?this.techCall_("enterFullScreen"):(this.enterFullWindow(),this.trigger("fullscreenchange"))},b.prototype.exitFullscreen=function(){var a=Jc;this.isFullscreen(!1),a.requestFullscreen?Ab[a.exitFullscreen]():this.tech_.supportsFullScreen()?this.techCall_("exitFullScreen"):(this.exitFullWindow(),this.trigger("fullscreenchange"))},b.prototype.enterFullWindow=function(){this.isFullWindow=!0,this.docOrigOverflow=Ab.documentElement.style.overflow,T(Ab,"keydown",bc(this,this.fullWindowOnEscKey)),Ab.documentElement.style.overflow="hidden",t(Ab.body,"vjs-full-window"),this.trigger("enterFullWindow")},b.prototype.fullWindowOnEscKey=function(a){27===a.keyCode&&(this.isFullscreen()===!0?this.exitFullscreen():this.exitFullWindow())},b.prototype.exitFullWindow=function(){this.isFullWindow=!1,U(Ab,"keydown",this.fullWindowOnEscKey),Ab.documentElement.style.overflow=this.docOrigOverflow,u(Ab.body,"vjs-full-window"),this.trigger("exitFullWindow")},b.prototype.canPlayType=function(a){for(var b=void 0,c=0,d=this.options_.techOrder;c<d.length;c++){var e=d[c],f=ue.getTech(e);if(f||(f=oc.getComponent(e)),f){if(f.isSupported()&&(b=f.canPlayType(a)))return b}else Fb.error('The "'+e+'" tech is undefined. Skipped browser support check for that tech.')}return""},b.prototype.selectSource=function(a){var b=this,c=this.options_.techOrder.map(function(a){return[a,ue.getTech(a)]}).filter(function(a){var b=a[0],c=a[1];return c?c.isSupported():(Fb.error('The "'+b+'" tech is undefined. Skipped browser support check for that tech.'),!1)}),d=function(a,b,c){var d=void 0;return a.some(function(a){return b.some(function(b){return d=c(a,b),d?!0:void 0})}),d},e=void 0,f=function(a){return function(b,c){return a(c,b)}},g=function(a,c){var d=a[0],e=a[1];return e.canPlaySource(c,b.options_[d.toLowerCase()])?{source:c,tech:d}:void 0};return e=this.options_.sourceOrder?d(a,c,f(g)):d(c,a,g),e||!1},b.prototype.src=function(a){var b=this;if("undefined"==typeof a)return this.cache_.src||"";var c=Ee(a);return c.length?(this.changingSrc_=!0,this.cache_.sources=c,this.updateSourceCaches_(c[0]),void Ta(this,c[0],function(a,d){b.middleware_=d,b.cache_.sources=c,b.updateSourceCaches_(a);var e=b.src_(a);return e?c.length>1?b.src(c.slice(1)):(b.changingSrc_=!1,b.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0),void b.triggerReady()):void Ua(d,b.tech_)})):void this.setTimeout(function(){this.error({code:4,message:this.localize(this.options_.notSupportedMessage)})},0)},b.prototype.src_=function(a){var b=this,c=this.selectSource([a]);return c?_(c.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",a):this.techCall_("src",a.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(c.tech,c.source),this.tech_.ready(function(){b.changingSrc_=!1}),!1):!0},b.prototype.load=function(){this.techCall_("load")},b.prototype.reset=function(){this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset")},b.prototype.currentSources=function(){var a=this.currentSource(),b=[];return 0!==Object.keys(a).length&&b.push(a),this.cache_.sources||b},b.prototype.currentSource=function(){return this.cache_.source||{}},b.prototype.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},b.prototype.currentType=function(){return this.currentSource()&&this.currentSource().type||""},b.prototype.preload=function(a){return void 0!==a?(this.techCall_("setPreload",a),void(this.options_.preload=a)):this.techGet_("preload")},b.prototype.autoplay=function(a){return void 0!==a?(this.techCall_("setAutoplay",a),void(this.options_.autoplay=a)):this.techGet_("autoplay",a)},b.prototype.playsinline=function(a){return void 0!==a?(this.techCall_("setPlaysinline",a),this.options_.playsinline=a,this):this.techGet_("playsinline")},b.prototype.loop=function(a){return void 0!==a?(this.techCall_("setLoop",a),void(this.options_.loop=a)):this.techGet_("loop")},b.prototype.poster=function(a){return void 0===a?this.poster_:(a||(a=""),void(a!==this.poster_&&(this.poster_=a,this.techCall_("setPoster",a),this.isPosterFromTech_=!1,this.trigger("posterchange"))))},b.prototype.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var a=this.tech_.poster()||"";a!==this.poster_&&(this.poster_=a,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},b.prototype.controls=function(a){return void 0===a?!!this.controls_:(a=!!a,void(this.controls_!==a&&(this.controls_=a,this.usingNativeControls()&&this.techCall_("setControls",a),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))))},b.prototype.usingNativeControls=function(a){return void 0===a?!!this.usingNativeControls_:(a=!!a,void(this.usingNativeControls_!==a&&(this.usingNativeControls_=a,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))))},b.prototype.error=function(a){return void 0===a?this.error_||null:null===a?(this.error_=a,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close())):(this.error_=new ga(a),this.addClass("vjs-error"),Fb.error("(CODE:"+this.error_.code+" "+ga.errorTypes[this.error_.code]+")",this.error_.message,this.error_),void this.trigger("error"))},b.prototype.reportUserActivity=function(a){this.userActivity_=!0},b.prototype.userActive=function(a){if(void 0===a)return this.userActive_;if(a=!!a,a!==this.userActive_){if(this.userActive_=a,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(a){a.stopPropagation(),a.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},b.prototype.listenForUserActivity_=function(){var a=void 0,b=void 0,c=void 0,d=bc(this,this.reportUserActivity),e=function(a){(a.screenX!==b||a.screenY!==c)&&(b=a.screenX,c=a.screenY,d())},f=function(){d(),this.clearInterval(a),a=this.setInterval(d,250)},g=function(b){d(),this.clearInterval(a)};this.on("mousedown",f),this.on("mousemove",e),this.on("mouseup",g),this.on("keydown",d),this.on("keyup",d);var h=void 0;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(h);var a=this.options_.inactivityTimeout;0>=a||(h=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},a))}},250)},b.prototype.playbackRate=function(a){return void 0!==a?void this.techCall_("setPlaybackRate",a):this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1},b.prototype.defaultPlaybackRate=function(a){return void 0!==a?this.techCall_("setDefaultPlaybackRate",a):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},b.prototype.isAudio=function(a){return void 0!==a?void(this.isAudio_=!!a):!!this.isAudio_},b.prototype.addTextTrack=function(a,b,c){return this.tech_?this.tech_.addTextTrack(a,b,c):void 0},b.prototype.addRemoteTextTrack=function(a,b){return this.tech_?this.tech_.addRemoteTextTrack(a,b):void 0},b.prototype.removeRemoteTextTrack=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=a.track,c=void 0===b?arguments[0]:b;return this.tech_?this.tech_.removeRemoteTextTrack(c):void 0},b.prototype.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},b.prototype.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},b.prototype.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},b.prototype.language=function(a){return void 0===a?this.language_:void(this.language_=String(a).toLowerCase())},b.prototype.languages=function(){return aa(b.prototype.options_.languages,this.languages_)},b.prototype.toJSON=function(){var a=aa(this.options_),b=a.tracks;a.tracks=[];for(var c=0;c<b.length;c++){var d=b[c];d=aa(d),d.player=void 0,a.tracks[c]=d}return a},b.prototype.createModal=function(a,b){var c=this;b=b||{},b.content=a||"";var d=new Xc(this,b);return this.addChild(d),d.on("dispose",function(){c.removeChild(d)}),d.open(),d},b.getTagSettings=function(a){var b={sources:[],tracks:[]},c=x(a),d=c["data-setup"];if(s(a,"vjs-fluid")&&(c.fluid=!0),null!==d){var f=Qc(d||"{}"),g=f[0],h=f[1];g&&Fb.error(g),e(c,h)}if(e(b,c),a.hasChildNodes())for(var i=a.childNodes,j=0,k=i.length;k>j;j++){var l=i[j],m=l.nodeName.toLowerCase();"source"===m?b.sources.push(x(l)):"track"===m&&b.tracks.push(x(l))}return b},b.prototype.flexNotSupported_=function(){var a=Ab.createElement("i");return!("flexBasis"in a.style||"webkitFlexBasis"in a.style||"mozFlexBasis"in a.style||"msFlexBasis"in a.style||"msFlexOrder"in a.style)},b}(oc);Yd.names.forEach(function(a){var b=Yd[a];og.prototype[b.getterName]=function(){return this.tech_?this.tech_[b.getterName]():(this[b.privateName]=this[b.privateName]||new b.ListClass,this[b.privateName])}}),og.players={};var pg=vb.navigator;og.prototype.options_={techOrder:ue.defaultTechOrder_,html5:{},flash:{},inactivityTimeout:2e3,playbackRates:[],children:["mediaLoader","posterImage","textTrackDisplay","loadingSpinner","bigPlayButton","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:pg&&(pg.languages&&pg.languages[0]||pg.userLanguage||pg.language)||"en",
- languages:{},notSupportedMessage:"No compatible source was found for this media."},["ended","seeking","seekable","networkState","readyState"].forEach(function(a){og.prototype[a]=function(){return this.techGet_(a)}}),mg.forEach(function(a){og.prototype["handleTech"+$(a)+"_"]=function(){return this.trigger(a)}}),oc.registerComponent("Player",og);var qg="plugin",rg="activePlugins_",sg={},tg=function(a){return sg.hasOwnProperty(a)},ug=function(a){return tg(a)?sg[a]:void 0},vg=function(a,b){a[rg]=a[rg]||{},a[rg][b]=!0},wg=function(a,b,c){var d=(c?"before":"")+"pluginsetup";a.trigger(d,b),a.trigger(d+":"+b.name,b)},xg=function(a,b){var c=function(){wg(this,{name:a,plugin:b,instance:null},!0);var c=b.apply(this,arguments);return vg(this,a),wg(this,{name:a,plugin:b,instance:c}),c};return Object.keys(b).forEach(function(a){c[a]=b[a]}),c},yg=function(a,b){return b.prototype.name=a,function(){wg(this,{name:a,plugin:b,instance:null},!0);for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var f=new(Function.prototype.bind.apply(b,[null].concat([this].concat(d))));return this[a]=function(){return f},wg(this,f.getEventHash()),f}},zg=function(){function a(b){if(Ib(this,a),this.constructor===a)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=b,Y(this),delete this.trigger,Z(this,this.constructor.defaultState),vg(b,this.name),this.dispose=bc(this,this.dispose),b.on("dispose",this.dispose)}return a.prototype.version=function(){return this.constructor.VERSION},a.prototype.getEventHash=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a.name=this.name,a.plugin=this.constructor,a.instance=this,a},a.prototype.trigger=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return V(this.eventBusEl_,a,this.getEventHash(b))},a.prototype.handleStateChanged=function(a){},a.prototype.dispose=function(){var a=this.name,b=this.player;this.trigger("dispose"),this.off(),b.off("dispose",this.dispose),b[rg][a]=!1,this.player=this.state=null,b[a]=yg(a,sg[a])},a.isBasic=function(b){var c="string"==typeof b?ug(b):b;return"function"==typeof c&&!a.prototype.isPrototypeOf(c.prototype)},a.registerPlugin=function(b,c){if("string"!=typeof b)throw new Error('Illegal plugin name, "'+b+'", must be a string, was '+("undefined"==typeof b?"undefined":Hb(b))+".");if(tg(b))Fb.warn('A plugin named "'+b+'" already exists. You may want to avoid re-registering plugins!');else if(og.prototype.hasOwnProperty(b))throw new Error('Illegal plugin name, "'+b+'", cannot share a name with an existing player method!');if("function"!=typeof c)throw new Error('Illegal plugin for "'+b+'", must be a function, was '+("undefined"==typeof c?"undefined":Hb(c))+".");return sg[b]=c,b!==qg&&(a.isBasic(c)?og.prototype[b]=xg(b,c):og.prototype[b]=yg(b,c)),c},a.deregisterPlugin=function(a){if(a===qg)throw new Error("Cannot de-register base plugin.");tg(a)&&(delete sg[a],delete og.prototype[a])},a.getPlugins=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Object.keys(sg),b=void 0;return a.forEach(function(a){var c=ug(a);c&&(b=b||{},b[a]=c)}),b},a.getPluginVersion=function(a){var b=ug(a);return b&&b.VERSION||""},a}();zg.getPlugin=ug,zg.BASE_PLUGIN_NAME=qg,zg.registerPlugin(qg,zg),og.prototype.usingPlugin=function(a){return!!this[rg]&&this[rg][a]===!0},og.prototype.hasPlugin=function(a){return!!tg(a)};var Ag=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":Hb(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(a.super_=b)},Bg=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=function(){a.apply(this,arguments)},d={};"object"===("undefined"==typeof b?"undefined":Hb(b))?(b.constructor!==Object.prototype.constructor&&(c=b.constructor),d=b):"function"==typeof b&&(c=b),Ag(c,a);for(var e in d)d.hasOwnProperty(e)&&(c.prototype[e]=d[e]);return c},Cg=function(a){return 0===a.indexOf("#")?a.slice(1):a};if(kb.hooks_={},kb.hooks=function(a,b){return kb.hooks_[a]=kb.hooks_[a]||[],b&&(kb.hooks_[a]=kb.hooks_[a].concat(b)),kb.hooks_[a]},kb.hook=function(a,b){kb.hooks(a,b)},kb.hookOnce=function(a,b){kb.hooks(a,[].concat(b).map(function(b){var c=function d(){return kb.removeHook(a,d),b.apply(void 0,arguments)};return c}))},kb.removeHook=function(a,b){var c=kb.hooks(a).indexOf(b);return-1>=c?!1:(kb.hooks_[a]=kb.hooks_[a].slice(),kb.hooks_[a].splice(c,1),!0)},vb.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&l()){var Dg=Pb(".vjs-styles-defaults");if(!Dg){Dg=_b("vjs-styles-defaults");var Eg=Pb("head");Eg&&Eg.insertBefore(Dg,Eg.firstChild),ac(Dg,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")}}X(1,kb),kb.VERSION=sb,kb.options=og.prototype.options_,kb.getPlayers=function(){return og.players},kb.getPlayer=function(a){var b=og.players,c=void 0;if("string"==typeof a){var d=Cg(a),e=b[d];if(e)return e;c=Pb("#"+d)}else c=a;if(m(c)){var f=c,g=f.player,h=f.playerId;if(g||b[h])return g||b[h]}},kb.getAllPlayers=function(){return Object.keys(og.players).map(function(a){return og.players[a]}).filter(Boolean)},kb.players=og.players,kb.getComponent=oc.getComponent,kb.registerComponent=function(a,b){ue.isTech(b)&&Fb.warn("The "+a+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),oc.registerComponent.call(oc,a,b)},kb.getTech=ue.getTech,kb.registerTech=ue.registerTech,kb.use=Sa,Object.defineProperty(kb,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(kb.middleware,"TERMINATOR",{value:xe,writeable:!1,enumerable:!0}),kb.browser=Ic,kb.TOUCH_ENABLED=Hc,kb.extend=Bg,kb.mergeOptions=aa,kb.bind=bc,kb.registerPlugin=zg.registerPlugin,kb.plugin=function(a,b){return Fb.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),zg.registerPlugin(a,b)},kb.getPlugins=zg.getPlugins,kb.getPlugin=zg.getPlugin,kb.getPluginVersion=zg.getPluginVersion,kb.addLanguage=function(a,b){var c;return a=(""+a).toLowerCase(),kb.options.languages=aa(kb.options.languages,(c={},c[a]=b,c)),kb.options.languages[a]},kb.log=Fb,kb.createTimeRange=kb.createTimeRanges=ea,kb.formatTime=gb,kb.setFormatTime=eb,kb.resetFormatTime=fb,kb.parseUrl=kd,kb.isCrossOrigin=nd,kb.EventTarget=ec,kb.on=T,kb.one=W,kb.off=U,kb.trigger=V,kb.xhr=Ld,kb.TextTrack=Od,kb.AudioTrack=Pd,kb.VideoTrack=Qd,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(a){kb[a]=function(){return Fb.warn("videojs."+a+"() is deprecated; use videojs.dom."+a+"() instead"),Rb[a].apply(null,arguments)}}),kb.computedStyle=h,kb.dom=Rb,kb.url=od;var Fg,Gg,Hg,Ig,Jg=a(function(a,b){!function(b){var c=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,d=/^([^\/;?#]*)(.*)$/,e=/(?:\/|^)\.(?=\/)/g,f=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,g={buildAbsoluteURL:function(a,b,c){if(c=c||{},a=a.trim(),b=b.trim(),!b){if(!c.alwaysNormalize)return a;var e=g.parseURL(a);if(!e)throw new Error("Error trying to parse base URL.");return e.path=g.normalizePath(e.path),g.buildURLFromParts(e)}var f=g.parseURL(b);if(!f)throw new Error("Error trying to parse relative URL.");if(f.scheme)return c.alwaysNormalize?(f.path=g.normalizePath(f.path),g.buildURLFromParts(f)):b;var h=g.parseURL(a);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&"/"!==h.path[0]){var i=d.exec(h.path);h.netLoc=i[1],h.path=i[2]}h.netLoc&&!h.path&&(h.path="/");var j={scheme:h.scheme,netLoc:f.netLoc,path:null,params:f.params,query:f.query,fragment:f.fragment};if(!f.netLoc&&(j.netLoc=h.netLoc,"/"!==f.path[0]))if(f.path){var k=h.path,l=k.substring(0,k.lastIndexOf("/")+1)+f.path;j.path=g.normalizePath(l)}else j.path=h.path,f.params||(j.params=h.params,f.query||(j.query=h.query));return null===j.path&&(j.path=c.alwaysNormalize?g.normalizePath(f.path):f.path),g.buildURLFromParts(j)},parseURL:function(a){var b=c.exec(a);return b?{scheme:b[1]||"",netLoc:b[2]||"",path:b[3]||"",params:b[4]||"",query:b[5]||"",fragment:b[6]||""}:null},normalizePath:function(a){for(a=a.split("").reverse().join("").replace(e,"");a.length!==(a=a.replace(f,"")).length;);return a.split("").reverse().join("")},buildURLFromParts:function(a){return a.scheme+a.netLoc+a.path+a.params+a.query+a.fragment}};a.exports=g}(tb)}),Kg=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},Lg=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var c=arguments[b];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=c[d])}return a},Mg=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":Hb(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)},Ng=function(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==("undefined"==typeof b?"undefined":Hb(b))&&"function"!=typeof b?a:b},Og=function(){function a(){Kg(this,a),this.listeners={}}return a.prototype.on=function(a,b){this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push(b)},a.prototype.off=function(a,b){if(!this.listeners[a])return!1;var c=this.listeners[a].indexOf(b);return this.listeners[a].splice(c,1),c>-1},a.prototype.trigger=function(a){var b=this.listeners[a],c=void 0,d=void 0,e=void 0;if(b)if(2===arguments.length)for(d=b.length,c=0;d>c;++c)b[c].call(this,arguments[1]);else for(e=Array.prototype.slice.call(arguments,1),d=b.length,c=0;d>c;++c)b[c].apply(this,e)},a.prototype.dispose=function(){this.listeners={}},a.prototype.pipe=function(a){this.on("data",function(b){a.push(b)})},a}(),Pg=function(a){function b(){Kg(this,b);var c=Ng(this,a.call(this));return c.buffer="",c}return Mg(b,a),b.prototype.push=function(a){var b=void 0;for(this.buffer+=a,b=this.buffer.indexOf("\n");b>-1;b=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,b)),this.buffer=this.buffer.substring(b+1)},b}(Og),Qg=function(){var a="[^=]*",b='"[^"]*"|[^,]*',c="(?:"+a+")=(?:"+b+")";return new RegExp("(?:^|,)("+c+")")},Rg=function(a){for(var b=a.split(Qg()),c={},d=b.length,e=void 0;d--;)""!==b[d]&&(e=/([^=]*)=(.*)/.exec(b[d]).slice(1),e[0]=e[0].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^\s+|\s+$/g,""),e[1]=e[1].replace(/^['"](.*)['"]$/g,"$1"),c[e[0]]=e[1]);return c},Sg=function(a){function b(){Kg(this,b);var c=Ng(this,a.call(this));return c.customParsers=[],c}return Mg(b,a),b.prototype.push=function(a){var b=void 0,c=void 0;if(a=a.replace(/^[\u0000\s]+|[\u0000\s]+$/g,""),0!==a.length){if("#"!==a[0])return void this.trigger("data",{type:"uri",uri:a});for(var d=0;d<this.customParsers.length;d++)if(this.customParsers[d].call(this,a))return;if(0!==a.indexOf("#EXT"))return void this.trigger("data",{type:"comment",text:a.slice(1)});if(a=a.replace("\r",""),b=/^#EXTM3U/.exec(a))return void this.trigger("data",{type:"tag",tagType:"m3u"});if(b=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(a))return c={type:"tag",tagType:"inf"},b[1]&&(c.duration=parseFloat(b[1])),b[2]&&(c.title=b[2]),void this.trigger("data",c);if(b=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(a))return c={type:"tag",tagType:"targetduration"},b[1]&&(c.duration=parseInt(b[1],10)),void this.trigger("data",c);if(b=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(a))return c={type:"tag",tagType:"totalduration"},b[1]&&(c.duration=parseInt(b[1],10)),void this.trigger("data",c);if(b=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(a))return c={type:"tag",tagType:"version"},b[1]&&(c.version=parseInt(b[1],10)),void this.trigger("data",c);if(b=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))return c={type:"tag",tagType:"media-sequence"},b[1]&&(c.number=parseInt(b[1],10)),void this.trigger("data",c);if(b=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(a))return c={type:"tag",tagType:"discontinuity-sequence"},b[1]&&(c.number=parseInt(b[1],10)),void this.trigger("data",c);if(b=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(a))return c={type:"tag",tagType:"playlist-type"},b[1]&&(c.playlistType=b[1]),void this.trigger("data",c);if(b=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(a))return c={type:"tag",tagType:"byterange"},b[1]&&(c.length=parseInt(b[1],10)),b[2]&&(c.offset=parseInt(b[2],10)),void this.trigger("data",c);if(b=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(a))return c={type:"tag",tagType:"allow-cache"},b[1]&&(c.allowed=!/NO/.test(b[1])),void this.trigger("data",c);if(b=/^#EXT-X-MAP:?(.*)$/.exec(a)){if(c={type:"tag",tagType:"map"},b[1]){var e=Rg(b[1]);if(e.URI&&(c.uri=e.URI),e.BYTERANGE){var f=e.BYTERANGE.split("@"),g=f[0],h=f[1];c.byterange={},g&&(c.byterange.length=parseInt(g,10)),h&&(c.byterange.offset=parseInt(h,10))}}return void this.trigger("data",c)}if(b=/^#EXT-X-STREAM-INF:?(.*)$/.exec(a)){if(c={type:"tag",tagType:"stream-inf"},b[1]){if(c.attributes=Rg(b[1]),c.attributes.RESOLUTION){var i=c.attributes.RESOLUTION.split("x"),j={};i[0]&&(j.width=parseInt(i[0],10)),i[1]&&(j.height=parseInt(i[1],10)),c.attributes.RESOLUTION=j}c.attributes.BANDWIDTH&&(c.attributes.BANDWIDTH=parseInt(c.attributes.BANDWIDTH,10)),c.attributes["PROGRAM-ID"]&&(c.attributes["PROGRAM-ID"]=parseInt(c.attributes["PROGRAM-ID"],10))}return void this.trigger("data",c)}return(b=/^#EXT-X-MEDIA:?(.*)$/.exec(a))?(c={type:"tag",tagType:"media"},b[1]&&(c.attributes=Rg(b[1])),void this.trigger("data",c)):(b=/^#EXT-X-ENDLIST/.exec(a))?void this.trigger("data",{type:"tag",tagType:"endlist"}):(b=/^#EXT-X-DISCONTINUITY/.exec(a))?void this.trigger("data",{type:"tag",tagType:"discontinuity"}):(b=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(a))?(c={type:"tag",tagType:"program-date-time"},b[1]&&(c.dateTimeString=b[1],c.dateTimeObject=new Date(b[1])),void this.trigger("data",c)):(b=/^#EXT-X-KEY:?(.*)$/.exec(a))?(c={type:"tag",tagType:"key"},b[1]&&(c.attributes=Rg(b[1]),c.attributes.IV&&("0x"===c.attributes.IV.substring(0,2).toLowerCase()&&(c.attributes.IV=c.attributes.IV.substring(2)),c.attributes.IV=c.attributes.IV.match(/.{8}/g),c.attributes.IV[0]=parseInt(c.attributes.IV[0],16),c.attributes.IV[1]=parseInt(c.attributes.IV[1],16),c.attributes.IV[2]=parseInt(c.attributes.IV[2],16),c.attributes.IV[3]=parseInt(c.attributes.IV[3],16),c.attributes.IV=new Uint32Array(c.attributes.IV))),void this.trigger("data",c)):(b=/^#EXT-X-START:?(.*)$/.exec(a))?(c={type:"tag",tagType:"start"},b[1]&&(c.attributes=Rg(b[1]),c.attributes["TIME-OFFSET"]=parseFloat(c.attributes["TIME-OFFSET"]),c.attributes.PRECISE=/YES/.test(c.attributes.PRECISE)),void this.trigger("data",c)):(b=/^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(a))?(c={type:"tag",tagType:"cue-out-cont"},b[1]?c.data=b[1]:c.data="",void this.trigger("data",c)):(b=/^#EXT-X-CUE-OUT:?(.*)?$/.exec(a))?(c={type:"tag",tagType:"cue-out"},b[1]?c.data=b[1]:c.data="",void this.trigger("data",c)):(b=/^#EXT-X-CUE-IN:?(.*)?$/.exec(a))?(c={type:"tag",tagType:"cue-in"},b[1]?c.data=b[1]:c.data="",void this.trigger("data",c)):void this.trigger("data",{type:"tag",data:a.slice(4)})}},b.prototype.addParser=function(a){var b=this,c=a.expression,d=a.customType,e=a.dataParser,f=a.segment;"function"!=typeof e&&(e=function(a){return a}),this.customParsers.push(function(a){var g=c.exec(a);return g?(b.trigger("data",{type:"custom",data:e(a),customType:d,segment:f}),!0):void 0})},b}(Og),Tg=function(a){function b(){Kg(this,b);var c=Ng(this,a.call(this));c.lineStream=new Pg,c.parseStream=new Sg,c.lineStream.pipe(c.parseStream);var d=c,e=[],f={},g=void 0,h=void 0,i=function(){},j={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},k=0;return c.manifest={allowCache:!0,discontinuityStarts:[],segments:[]},c.parseStream.on("data",function(a){var b=void 0,c=void 0;({tag:function(){(({"allow-cache":function(){this.manifest.allowCache=a.allowed,"allowed"in a||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange:function l(){var l={};"length"in a&&(f.byterange=l,l.length=a.length,"offset"in a||(this.trigger("info",{message:"defaulting offset to zero"}),a.offset=0)),"offset"in a&&(f.byterange=l,l.offset=a.offset)},endlist:function(){this.manifest.endList=!0},inf:function(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),a.duration>0&&(f.duration=a.duration),0===a.duration&&(f.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=e},key:function(){return a.attributes?"NONE"===a.attributes.METHOD?void(h=null):a.attributes.URI?(a.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),h={method:a.attributes.METHOD||"AES-128",uri:a.attributes.URI},void("undefined"!=typeof a.attributes.IV&&(h.iv=a.attributes.IV))):void this.trigger("warn",{message:"ignoring key declaration without URI"}):void this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence":function(){return isFinite(a.number)?void(this.manifest.mediaSequence=a.number):void this.trigger("warn",{message:"ignoring invalid media sequence: "+a.number})},"discontinuity-sequence":function(){return isFinite(a.number)?(this.manifest.discontinuitySequence=a.number,void(k=a.number)):void this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+a.number})},"playlist-type":function(){return/VOD|EVENT/.test(a.playlistType)?void(this.manifest.playlistType=a.playlistType):void this.trigger("warn",{message:"ignoring unknown playlist type: "+a.playlist})},map:function(){g={},a.uri&&(g.uri=a.uri),a.byterange&&(g.byterange=a.byterange)},"stream-inf":function(){return this.manifest.playlists=e,this.manifest.mediaGroups=this.manifest.mediaGroups||j,a.attributes?(f.attributes||(f.attributes={}),void Lg(f.attributes,a.attributes)):void this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media:function(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||j,!(a.attributes&&a.attributes.TYPE&&a.attributes["GROUP-ID"]&&a.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});var d=this.manifest.mediaGroups[a.attributes.TYPE];d[a.attributes["GROUP-ID"]]=d[a.attributes["GROUP-ID"]]||{},b=d[a.attributes["GROUP-ID"]],c={"default":/yes/i.test(a.attributes.DEFAULT)},c["default"]?c.autoselect=!0:c.autoselect=/yes/i.test(a.attributes.AUTOSELECT),a.attributes.LANGUAGE&&(c.language=a.attributes.LANGUAGE),a.attributes.URI&&(c.uri=a.attributes.URI),a.attributes["INSTREAM-ID"]&&(c.instreamId=a.attributes["INSTREAM-ID"]),a.attributes.CHARACTERISTICS&&(c.characteristics=a.attributes.CHARACTERISTICS),a.attributes.FORCED&&(c.forced=/yes/i.test(a.attributes.FORCED)),b[a.attributes.NAME]=c},discontinuity:function(){k+=1,f.discontinuity=!0,this.manifest.discontinuityStarts.push(e.length)},"program-date-time":function(){"undefined"==typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=a.dateTimeString,this.manifest.dateTimeObject=a.dateTimeObject),f.dateTimeString=a.dateTimeString,f.dateTimeObject=a.dateTimeObject},targetduration:function(){return!isFinite(a.duration)||a.duration<0?void this.trigger("warn",{message:"ignoring invalid target duration: "+a.duration}):void(this.manifest.targetDuration=a.duration)},totalduration:function(){return!isFinite(a.duration)||a.duration<0?void this.trigger("warn",{message:"ignoring invalid total duration: "+a.duration}):void(this.manifest.totalDuration=a.duration)},start:function(){return!a.attributes||isNaN(a.attributes["TIME-OFFSET"])?void this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):void(this.manifest.start={timeOffset:a.attributes["TIME-OFFSET"],precise:a.attributes.PRECISE})},"cue-out":function(){f.cueOut=a.data},"cue-out-cont":function(){f.cueOutCont=a.data},"cue-in":function(){f.cueIn=a.data}})[a.tagType]||i).call(d)},uri:function(){f.uri=a.uri,e.push(f),!this.manifest.targetDuration||"duration"in f||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),f.duration=this.manifest.targetDuration),h&&(f.key=h),f.timeline=k,g&&(f.map=g),f={}},comment:function(){},custom:function(){a.segment?(f.custom=f.custom||{},f.custom[a.customType]=a.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[a.customType]=a.data)}})[a.type].call(d)}),c}return Mg(b,a),b.prototype.push=function(a){this.lineStream.push(a)},b.prototype.end=function(){this.lineStream.push("\n")},b.prototype.addParser=function(a){this.parseStream.addParser(a)},b}(Og),Ug=function(a){var b,c=a.attributes,d=a.segments,e={attributes:(b={NAME:c.id,BANDWIDTH:c.bandwidth,CODECS:c.codecs},b["PROGRAM-ID"]=1,b),uri:"",endList:"static"===(c.type||"static"),timeline:c.periodIndex,resolvedUri:"",targetDuration:c.duration,segments:d,mediaSequence:d.length?d[0].number:1};return c.contentProtection&&(e.contentProtection=c.contentProtection),e},Vg=function(a){var b,c=a.attributes,d=a.segments;return"undefined"==typeof d&&(d=[{uri:c.baseUrl,timeline:c.periodIndex,resolvedUri:c.baseUrl||"",duration:c.sourceDuration,number:0}],c.duration=c.sourceDuration),{attributes:(b={NAME:c.id,BANDWIDTH:c.bandwidth},b["PROGRAM-ID"]=1,b),uri:"",endList:"static"===(c.type||"static"),timeline:c.periodIndex,resolvedUri:c.baseUrl||"",targetDuration:c.duration,segments:d,mediaSequence:d.length?d[0].number:1}},Wg=function(a){return a.reduce(function(a,b){var c=b.attributes.role&&b.attributes.role.value||"main",d=b.attributes.lang||"",e="main";return d&&(e=b.attributes.lang+" ("+c+")"),a[e]&&a[e].playlists[0].attributes.BANDWIDTH>b.attributes.bandwidth?a:(a[e]={language:d,autoselect:!0,"default":"main"===c,playlists:[Ug(b)],uri:""},a)},{})},Xg=function(a){return a.reduce(function(a,b){var c=b.attributes.lang||"text";return a[c]?a:(a[c]={language:c,"default":!1,autoselect:!1,playlists:[Vg(b)],uri:""},a)},{})},Yg=function(a){var b,c=a.attributes,d=a.segments,e={attributes:(b={NAME:c.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:c.width,height:c.height},CODECS:c.codecs,BANDWIDTH:c.bandwidth},b["PROGRAM-ID"]=1,b),uri:"",endList:"static"===(c.type||"static"),timeline:c.periodIndex,resolvedUri:"",targetDuration:c.duration,segments:d,mediaSequence:d.length?d[0].number:1};return c.contentProtection&&(e.contentProtection=c.contentProtection),e},Zg=function(a){var b;if(!a.length)return{};var c=a[0].attributes,d=c.sourceDuration,e=c.minimumUpdatePeriod,f=void 0===e?0:e,g=function(a){var b=a.attributes;return"video/mp4"===b.mimeType||"video"===b.contentType},h=function(a){var b=a.attributes;return"audio/mp4"===b.mimeType||"audio"===b.contentType},i=function(a){var b=a.attributes;return"text/vtt"===b.mimeType||"text"===b.contentType},j=a.filter(g).map(Yg),k=a.filter(h),l=a.filter(i),m={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(b={AUDIO:{},VIDEO:{}},b["CLOSED-CAPTIONS"]={},b.SUBTITLES={},b),uri:"",duration:d,playlists:j,minimumUpdatePeriod:1e3*f};return k.length&&(m.mediaGroups.AUDIO.audio=Wg(k)),l.length&&(m.mediaGroups.SUBTITLES.subs=Xg(l)),m},$g=function(a){return!!a&&"object"===("undefined"==typeof a?"undefined":Hb(a))},_g=function Nm(){for(var a=arguments.length,b=Array(a),c=0;a>c;c++)b[c]=arguments[c];return b.reduce(function(a,b){return Object.keys(b).forEach(function(c){Array.isArray(a[c])&&Array.isArray(b[c])?a[c]=a[c].concat(b[c]):$g(a[c])&&$g(b[c])?a[c]=Nm(a[c],b[c]):a[c]=b[c]}),a},{})},ah=function(a,b){return/^[a-z]+:/i.test(b)?b:(/\/\//i.test(a)||(a=Jg.buildAbsoluteURL(vb.location.href,a)),Jg.buildAbsoluteURL(a,b))},bh=function(a){var b=a.baseUrl,c=void 0===b?"":b,d=a.source,e=void 0===d?"":d,f=a.range,g=void 0===f?"":f,h={uri:e,resolvedUri:ah(c||"",e)};if(g){var i=g.split("-"),j=parseInt(i[0],10),k=parseInt(i[1],10);h.byterange={length:k-j,offset:j}}return h},ch=function(a,b,c){var d=a.NOW,e=a.clientOffset,f=a.availabilityStartTime,g=a.timescale,h=void 0===g?1:g,i=a.start,j=void 0===i?0:i,k=a.minimumUpdatePeriod,l=void 0===k?0:k,m=(d+e)/1e3,n=f+j,o=m+l,p=o-n;return Math.ceil((p*h-b)/c)},dh=function(a,b){for(var c=a.type,d=void 0===c?"static":c,e=a.minimumUpdatePeriod,f=void 0===e?0:e,g=a.media,h=void 0===g?"":g,i=a.sourceDuration,j=a.timescale,k=void 0===j?1:j,l=a.startNumber,m=void 0===l?1:l,n=a.periodIndex,o=[],p=-1,q=0;q<b.length;q++){var r=b[q],s=r.d,t=r.r||0,u=r.t||0;0>p&&(p=u),u&&u>p&&(p=u);var v=void 0;if(0>t){var w=q+1;v=w===b.length?"dynamic"===d&&f>0&&h.indexOf("$Number$")>0?ch(a,p,s):(i*k-p)/s:(b[w].t-p)/s}else v=t+1;for(var x=m+o.length+v,y=m+o.length;x>y;)o.push({number:y,duration:s/k,time:p,timeline:n}),p+=s,y++}return o},eh=function(a,b){for(var c=[],d=a;b>d;d++)c.push(d);return c},fh=function(a){return a.reduce(function(a,b){return a.concat(b)},[])},gh=function(a){if(!a.length)return[];for(var b=[],c=0;c<a.length;c++)b.push(a[c]);return b},hh={"static":function(a){var b=a.duration,c=a.timescale,d=void 0===c?1:c,e=a.sourceDuration;return{start:0,end:Math.ceil(e/(b/d))}},dynamic:function(a){var b=a.NOW,c=a.clientOffset,d=a.availabilityStartTime,e=a.timescale,f=void 0===e?1:e,g=a.duration,h=a.start,i=void 0===h?0:h,j=a.minimumUpdatePeriod,k=void 0===j?0:j,l=a.timeShiftBufferDepth,m=void 0===l?1/0:l,n=(b+c)/1e3,o=d+i,p=n+k,q=p-o,r=Math.ceil(q*f/g),s=Math.floor((n-o-m)*f/g),t=Math.floor((n-o)*f/g);return{start:Math.max(0,s),end:Math.min(r,t)}}},ih=function(a){return function(b,c){var d=a.duration,e=a.timescale,f=void 0===e?1:e,g=a.periodIndex,h=a.startNumber,i=void 0===h?1:h;return{number:i+b,duration:d/f,timeline:g,time:c*d}}},jh=function(a){var b=a.type,c=void 0===b?"static":b,d=a.duration,e=a.timescale,f=void 0===e?1:e,g=a.sourceDuration,h=hh[c](a),i=h.start,j=h.end,k=eh(i,j).map(ih(a));if("static"===c){var l=k.length-1;k[l].duration=g-d/f*l}return k},kh=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,lh=function(a){return function(b,c,d,e){if("$$"===b)return"$";if("undefined"==typeof a[c])return b;var f=""+a[c];return"RepresentationID"===c?f:(e=d?parseInt(e,10):1,f.length>=e?f:""+new Array(e-f.length+1).join("0")+f)}},mh=function(a,b){return a.replace(kh,lh(b))},nh=function(a,b){return a.duration||b?a.duration?jh(a):dh(a,b):[{number:a.startNumber||1,duration:a.sourceDuration,time:0,timeline:a.periodIndex}]},oh=function(a,b){var c={RepresentationID:a.id,Bandwidth:a.bandwidth||0},d=a.initialization,e=void 0===d?{sourceURL:"",range:""}:d,f=bh({baseUrl:a.baseUrl,source:mh(e.sourceURL,c),range:e.range}),g=nh(a,b);return g.map(function(b){c.Number=b.number,c.Time=b.time;var d=mh(a.media||"",c);return{uri:d,timeline:b.timeline,duration:b.duration,resolvedUri:ah(a.baseUrl||"",d),map:f,number:b.number}})},ph={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"},qh=function(a,b){var c=a.baseUrl,d=a.initialization,e=void 0===d?{}:d,f=bh({baseUrl:c,source:e.sourceURL,range:e.range}),g=bh({baseUrl:c,source:b.media,range:b.mediaRange});return g.map=f,g},rh=function(a,b){var c=a.duration,d=a.segmentUrls,e=void 0===d?[]:d;if(!c&&!b||c&&b)throw new Error(ph.SEGMENT_TIME_UNSPECIFIED);var f=e.map(function(b){return qh(a,b)}),g=void 0;c&&(g=jh(a)),b&&(g=dh(a,b));var h=g.map(function(a,b){if(f[b]){var c=f[b];return c.timeline=a.timeline,c.duration=a.duration,c.number=a.number,c}}).filter(function(a){return a});return h},sh=function(a){var b=a.baseUrl,c=a.initialization,d=void 0===c?{}:c,e=a.sourceDuration,f=a.timescale,g=void 0===f?1:f,h=a.indexRange,i=void 0===h?"":h,j=a.duration;if(!b)throw new Error(ph.NO_BASE_URL);var k=bh({baseUrl:b,source:d.sourceURL,range:d.range}),l=bh({baseUrl:b,source:b,range:i});if(l.map=k,j){var m=jh(a);m.length&&(l.duration=m[0].duration,l.timeline=m[0].timeline)}else e&&(l.duration=e/g,l.timeline=0);return l.number=0,[l]},th=function(a){var b=a.attributes,c=a.segmentInfo,d=void 0,e=void 0;if(c.template?(e=oh,d=_g(b,c.template)):c.base?(e=sh,d=_g(b,c.base)):c.list&&(e=rh,d=_g(b,c.list)),!e)return{attributes:b};var f=e(d,c.timeline);if(d.duration){var g=d,h=g.duration,i=g.timescale,j=void 0===i?1:i;d.duration=h/j}else f.length?d.duration=f.reduce(function(a,b){return Math.max(a,Math.ceil(b.duration))},0):d.duration=0;return{attributes:d,segments:f}},uh=function(a){return a.map(th)},vh=function(a,b){return gh(a.childNodes).filter(function(a){var c=a.tagName;return c===b})},wh=function(a){return a.textContent.trim()},xh=function(a){var b=31536e3,c=2592e3,d=86400,e=3600,f=60,g=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/,h=g.exec(a);if(!h)return 0;var i=h.slice(1),j=i[0],k=i[1],l=i[2],m=i[3],n=i[4],o=i[5];return parseFloat(j||0)*b+parseFloat(k||0)*c+parseFloat(l||0)*d+parseFloat(m||0)*e+parseFloat(n||0)*f+parseFloat(o||0)},yh=function(a){var b=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;return b.test(a)&&(a+="Z"),Date.parse(a)},zh={mediaPresentationDuration:function(a){return xh(a)},availabilityStartTime:function(a){return yh(a)/1e3},minimumUpdatePeriod:function(a){return xh(a)},timeShiftBufferDepth:function(a){return xh(a)},start:function(a){return xh(a)},width:function(a){return parseInt(a,10)},height:function(a){return parseInt(a,10)},bandwidth:function(a){return parseInt(a,10)},startNumber:function(a){return parseInt(a,10)},timescale:function(a){return parseInt(a,10)},duration:function(a){var b=parseInt(a,10);return isNaN(b)?xh(a):b},d:function(a){return parseInt(a,10)},t:function(a){return parseInt(a,10)},r:function(a){return parseInt(a,10)},DEFAULT:function(a){return a}},Ah=function(a){return a&&a.attributes?gh(a.attributes).reduce(function(a,b){var c=zh[b.name]||zh.DEFAULT;return a[b.name]=c(b.value),a},{}):{}},Bh={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime"},Ch=function(a,b){return b.length?fh(a.map(function(a){return b.map(function(b){return ah(a,wh(b))})})):a},Dh=function(a){var b=vh(a,"SegmentTemplate")[0],c=vh(a,"SegmentList")[0],d=c&&vh(c,"SegmentURL").map(function(a){return _g({tag:"SegmentURL"},Ah(a))}),e=vh(a,"SegmentBase")[0],f=c||b,g=f&&vh(f,"SegmentTimeline")[0],h=c||e||b,i=h&&vh(h,"Initialization")[0],j=b&&Ah(b);j&&i?j.initialization=i&&Ah(i):j&&j.initialization&&(j.initialization={sourceURL:j.initialization});var k={template:j,timeline:g&&vh(g,"S").map(function(a){return Ah(a)}),list:c&&_g(Ah(c),{segmentUrls:d,initialization:Ah(i)}),base:e&&_g(Ah(e),{initialization:Ah(i)})};return Object.keys(k).forEach(function(a){k[a]||delete k[a]}),k},Eh=function(a,b,c){return function(d){var e=vh(d,"BaseURL"),f=Ch(b,e),g=_g(a,Ah(d)),h=Dh(d);return f.map(function(a){return{segmentInfo:_g(c,h),attributes:_g(g,{baseUrl:a})}})}},Fh=function(a){return a.reduce(function(a,b){var c=Ah(b),d=Bh[c.schemeIdUri];if(d){a[d]={attributes:c};var e=vh(b,"cenc:pssh")[0];if(e){var f=wh(e),g=f&&lb(f);a[d].pssh=g}}return a},{})},Gh=function(a,b,c){return function(d){var e=Ah(d),f=Ch(b,vh(d,"BaseURL")),g=vh(d,"Role")[0],h={role:Ah(g)},i=_g(a,e,h),j=Fh(vh(d,"ContentProtection"));Object.keys(j).length&&(i=_g(i,{contentProtection:j}));var k=Dh(d),l=vh(d,"Representation"),m=_g(c,k);return fh(l.map(Eh(i,f,m)))}},Hh=function(a,b){return function(c,d){var e=Ch(b,vh(c,"BaseURL")),f=Ah(c),g=_g(a,f,{periodIndex:d}),h=vh(c,"AdaptationSet"),i=Dh(c);
- return fh(h.map(Gh(g,e,i)))}},Ih=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=b.manifestUri,d=void 0===c?"":c,e=b.NOW,f=void 0===e?Date.now():e,g=b.clientOffset,h=void 0===g?0:g,i=vh(a,"Period");if(1!==i.length)throw new Error(ph.INVALID_NUMBER_OF_PERIOD);var j=Ah(a),k=Ch([d],vh(a,"BaseURL"));return j.sourceDuration=j.mediaPresentationDuration||0,j.NOW=f,j.clientOffset=h,fh(i.map(Hh(j,k)))},Jh=function(a){if(""===a)throw new Error(ph.DASH_EMPTY_MANIFEST);var b=new vb.DOMParser,c=b.parseFromString(a,"application/xml"),d=c&&"MPD"===c.documentElement.tagName?c.documentElement:null;if(!d||d&&d.getElementsByTagName("parsererror").length>0)throw new Error(ph.DASH_INVALID_XML);return d},Kh=function(a){var b=vh(a,"UTCTiming")[0];if(!b)return null;var c=Ah(b);switch(c.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":c.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":c.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":c.method="DIRECT",c.value=Date.parse(c.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(ph.UNSUPPORTED_UTC_TIMING_SCHEME)}return c},Lh=function(a,b){return Zg(uh(Ih(Jh(a),b)))},Mh=function(a){return Kh(Jh(a))},Nh=function(a){return a>>>0},Oh={toUnsigned:Nh},Ph=Oh.toUnsigned,Qh=Object.freeze({"default":Oh,__moduleExports:Oh,toUnsigned:Ph}),Rh=Qh&&Oh||Qh,Sh=Rh.toUnsigned;Fg=function(a,b){var c,d,e,f,g,h=[];if(!b.length)return null;for(c=0;c<a.byteLength;)d=Sh(a[c]<<24|a[c+1]<<16|a[c+2]<<8|a[c+3]),e=Gg(a.subarray(c+4,c+8)),f=d>1?c+d:a.byteLength,e===b[0]&&(1===b.length?h.push(a.subarray(c+8,f)):(g=Fg(a.subarray(c+8,f),b.slice(1)),g.length&&(h=h.concat(g)))),c=f;return h},Gg=function(a){var b="";return b+=String.fromCharCode(a[0]),b+=String.fromCharCode(a[1]),b+=String.fromCharCode(a[2]),b+=String.fromCharCode(a[3])},Hg=function(a){var b={},c=Fg(a,["moov","trak"]);return c.reduce(function(a,b){var c,d,e,f,g;return(c=Fg(b,["tkhd"])[0])?(d=c[0],e=0===d?12:20,f=Sh(c[e]<<24|c[e+1]<<16|c[e+2]<<8|c[e+3]),(g=Fg(b,["mdia","mdhd"])[0])?(d=g[0],e=0===d?12:20,a[f]=Sh(g[e]<<24|g[e+1]<<16|g[e+2]<<8|g[e+3]),a):null):null},b)},Ig=function(a,b){var c,d,e;return c=Fg(b,["moof","traf"]),d=[].concat.apply([],c.map(function(b){return Fg(b,["tfhd"]).map(function(c){var d,e,f;return d=Sh(c[4]<<24|c[5]<<16|c[6]<<8|c[7]),e=a[d]||9e4,f=Fg(b,["tfdt"]).map(function(a){var b,c;return b=a[0],c=Sh(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),1===b&&(c*=Math.pow(2,32),c+=Sh(a[8]<<24|a[9]<<16|a[10]<<8|a[11])),c})[0],f=f||1/0,f/e})})),e=Math.min.apply(null,d),isFinite(e)?e:0};var Th={parseType:Gg,timescale:Hg,startTime:Ig},Uh={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},Vh=Uh.H264_STREAM_TYPE,Wh=Uh.ADTS_STREAM_TYPE,Xh=Uh.METADATA_STREAM_TYPE,Yh=Object.freeze({"default":Uh,__moduleExports:Uh,H264_STREAM_TYPE:Vh,ADTS_STREAM_TYPE:Wh,METADATA_STREAM_TYPE:Xh}),Zh=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b]=a[b].concat(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b]=a[b].slice(),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])if(2===arguments.length)for(e=c.length,d=0;e>d;++d)c[d].call(this,arguments[1]);else{for(f=[],d=arguments.length,d=1;d<arguments.length;++d)f.push(arguments[d]);for(e=c.length,d=0;e>d;++d)c[d].apply(this,f)}},this.dispose=function(){a={}}}};Zh.prototype.pipe=function(a){return this.on("data",function(b){a.push(b)}),this.on("done",function(b){a.flush(b)}),a},Zh.prototype.push=function(a){this.trigger("data",a)},Zh.prototype.flush=function(a){this.trigger("done",a)};var $h=Zh,_h=Object.freeze({"default":$h,__moduleExports:$h}),ai=_h&&$h||_h,bi=8589934592,ci=4294967296,di=function(a,b){var c=1;for(a>b&&(c=-1);Math.abs(b-a)>ci;)a+=c*bi;return a},ei=function Om(a){var b,c;Om.prototype.init.call(this),this.type_=a,this.push=function(a){a.type===this.type_&&(void 0===c&&(c=a.dts),a.dts=di(a.dts,c),a.pts=di(a.pts,c),b=a.dts,this.trigger("data",a))},this.flush=function(){c=b,this.trigger("done")},this.discontinuity=function(){c=void 0,b=void 0}};ei.prototype=new ai;var fi={TimestampRolloverStream:ei,handleRollover:di},gi=fi.TimestampRolloverStream,hi=fi.handleRollover,ii=Object.freeze({"default":fi,__moduleExports:fi,TimestampRolloverStream:gi,handleRollover:hi}),ji=Yh&&Uh||Yh,ki=function(a){var b=31&a[1];return b<<=8,b|=a[2]},li=function(a){return!!(64&a[1])},mi=function(a){var b=0;return(48&a[3])>>>4>1&&(b+=a[4]+1),b},ni=function(a,b){var c=ki(a);return 0===c?"pat":c===b?"pmt":b?"pes":null},oi=function(a){var b=li(a),c=4+mi(a);return b&&(c+=a[c]+1),(31&a[c+10])<<8|a[c+11]},pi=function(a){var b={},c=li(a),d=4+mi(a);if(c&&(d+=a[d]+1),1&a[d+5]){var e,f,g;e=(15&a[d+1])<<8|a[d+2],f=3+e-4,g=(15&a[d+10])<<8|a[d+11];for(var h=12+g;f>h;){var i=d+h;b[(31&a[i+1])<<8|a[i+2]]=a[i],h+=((15&a[i+3])<<8|a[i+4])+5}return b}},qi=function(a,b){var c=ki(a),d=b[c];switch(d){case ji.H264_STREAM_TYPE:return"video";case ji.ADTS_STREAM_TYPE:return"audio";case ji.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},ri=function(a){var b=li(a);if(!b)return null;var c=4+mi(a);if(c>=a.byteLength)return null;var d,e=null;return d=a[c+7],192&d&&(e={},e.pts=(14&a[c+9])<<27|(255&a[c+10])<<20|(254&a[c+11])<<12|(255&a[c+12])<<5|(254&a[c+13])>>>3,e.pts*=4,e.pts+=(6&a[c+13])>>>1,e.dts=e.pts,64&d&&(e.dts=(14&a[c+14])<<27|(255&a[c+15])<<20|(254&a[c+16])<<12|(255&a[c+17])<<5|(254&a[c+18])>>>3,e.dts*=4,e.dts+=(6&a[c+18])>>>1)),e},si=function(a){switch(a){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},ti=function(a){for(var b,c=4+mi(a),d=a.subarray(c),e=0,f=0,g=!1;f<d.byteLength-3;f++)if(1===d[f+2]){e=f+5;break}for(;e<d.byteLength;)switch(d[e]){case 0:if(0!==d[e-1]){e+=2;break}if(0!==d[e-2]){e++;break}f+3!==e-2&&(b=si(31&d[f+3]),"slice_layer_without_partitioning_rbsp_idr"===b&&(g=!0));do e++;while(1!==d[e]&&e<d.length);f=e-2,e+=3;break;case 1:if(0!==d[e-1]||0!==d[e-2]){e+=3;break}b=si(31&d[f+3]),"slice_layer_without_partitioning_rbsp_idr"===b&&(g=!0),f=e-2,e+=3;break;default:e+=3}return d=d.subarray(f),e-=f,f=0,d&&d.byteLength>3&&(b=si(31&d[f+3]),"slice_layer_without_partitioning_rbsp_idr"===b&&(g=!0)),g},ui={parseType:ni,parsePat:oi,parsePmt:pi,parsePayloadUnitStartIndicator:li,parsePesType:qi,parsePesTime:ri,videoPacketContainsKeyFrame:ti},vi=ui.parseType,wi=ui.parsePat,xi=ui.parsePmt,yi=ui.parsePayloadUnitStartIndicator,zi=ui.parsePesType,Ai=ui.parsePesTime,Bi=ui.videoPacketContainsKeyFrame,Ci=Object.freeze({"default":ui,__moduleExports:ui,parseType:vi,parsePat:wi,parsePmt:xi,parsePayloadUnitStartIndicator:yi,parsePesType:zi,parsePesTime:Ai,videoPacketContainsKeyFrame:Bi}),Di=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Ei=function(a){return a[0]<<21|a[1]<<14|a[2]<<7|a[3]},Fi=function(a,b,c){var d,e="";for(d=b;c>d;d++)e+="%"+("00"+a[d].toString(16)).slice(-2);return e},Gi=function(a,b,c){return unescape(Fi(a,b,c))},Hi=function(a,b){var c=a[b+6]<<21|a[b+7]<<14|a[b+8]<<7|a[b+9],d=a[b+5],e=(16&d)>>4;return e?c+20:c+10},Ii=function(a,b){var c=(224&a[b+5])>>5,d=a[b+4]<<3,e=6144&a[b+3];return e|d|c},Ji=function(a,b){return a[b]==="I".charCodeAt(0)&&a[b+1]==="D".charCodeAt(0)&&a[b+2]==="3".charCodeAt(0)?"timed-metadata":a[b]&!0&&240===(240&a[b+1])?"audio":null},Ki=function(a){for(var b=0;b+5<a.length;){if(255===a[b]&&240===(246&a[b+1]))return Di[(60&a[b+2])>>>2];b++}return null},Li=function(a){var b,c,d,e;b=10,64&a[5]&&(b+=4,b+=Ei(a.subarray(10,14)));do{if(c=Ei(a.subarray(b+4,b+8)),1>c)return null;if(e=String.fromCharCode(a[b],a[b+1],a[b+2],a[b+3]),"PRIV"===e){d=a.subarray(b+10,b+c+10);for(var f=0;f<d.byteLength;f++)if(0===d[f]){var g=Gi(d,0,f);if("com.apple.streaming.transportStreamTimestamp"===g){var h=d.subarray(f+1),i=(1&h[3])<<30|h[4]<<22|h[5]<<14|h[6]<<6|h[7]>>>2;return i*=4,i+=3&h[7]}break}}b+=10,b+=c}while(b<a.byteLength);return null},Mi={parseId3TagSize:Hi,parseAdtsSize:Ii,parseType:Ji,parseSampleRate:Ki,parseAacTimestamp:Li},Ni=Mi.parseId3TagSize,Oi=Mi.parseAdtsSize,Pi=Mi.parseType,Qi=Mi.parseSampleRate,Ri=Mi.parseAacTimestamp,Si=Object.freeze({"default":Mi,__moduleExports:Mi,parseId3TagSize:Ni,parseAdtsSize:Oi,parseType:Pi,parseSampleRate:Qi,parseAacTimestamp:Ri}),Ti=ii&&fi||ii,Ui=Ci&&ui||Ci,Vi=Si&&Mi||Si,Wi=Ti.handleRollover,Xi={};Xi.ts=Ui,Xi.aac=Vi;var Yi=9e4,Zi=188,$i=71,_i=function(a){return a[0]==="I".charCodeAt(0)&&a[1]==="D".charCodeAt(0)&&a[2]==="3".charCodeAt(0)?!0:!1},aj=function(a,b){for(var c,d,e=0,f=Zi;f<a.byteLength;)if(a[e]!==$i||a[f]!==$i)e++,f++;else{switch(c=a.subarray(e,f),d=Xi.ts.parseType(c,b.pid)){case"pat":b.pid||(b.pid=Xi.ts.parsePat(c));break;case"pmt":b.table||(b.table=Xi.ts.parsePmt(c))}if(b.pid&&b.table)return;e+=Zi,f+=Zi}},bj=function(a,b,c){for(var d,e,f,g,h,i=0,j=Zi,k=!1;j<a.byteLength;)if(a[i]!==$i||a[j]!==$i)i++,j++;else{switch(d=a.subarray(i,j),e=Xi.ts.parseType(d,b.pid)){case"pes":f=Xi.ts.parsePesType(d,b.table),g=Xi.ts.parsePayloadUnitStartIndicator(d),"audio"===f&&g&&(h=Xi.ts.parsePesTime(d),h&&(h.type="audio",c.audio.push(h),k=!0))}if(k)break;i+=Zi,j+=Zi}for(j=a.byteLength,i=j-Zi,k=!1;i>=0;)if(a[i]!==$i||a[j]!==$i)i--,j--;else{switch(d=a.subarray(i,j),e=Xi.ts.parseType(d,b.pid)){case"pes":f=Xi.ts.parsePesType(d,b.table),g=Xi.ts.parsePayloadUnitStartIndicator(d),"audio"===f&&g&&(h=Xi.ts.parsePesTime(d),h&&(h.type="audio",c.audio.push(h),k=!0))}if(k)break;i-=Zi,j-=Zi}},cj=function(a,b,c){for(var d,e,f,g,h,i,j,k,l=0,m=Zi,n=!1,o={data:[],size:0};m<a.byteLength;)if(a[l]!==$i||a[m]!==$i)l++,m++;else{switch(d=a.subarray(l,m),e=Xi.ts.parseType(d,b.pid)){case"pes":if(f=Xi.ts.parsePesType(d,b.table),g=Xi.ts.parsePayloadUnitStartIndicator(d),"video"===f&&(g&&!n&&(h=Xi.ts.parsePesTime(d),h&&(h.type="video",c.video.push(h),n=!0)),!c.firstKeyFrame)){if(g&&0!==o.size){for(i=new Uint8Array(o.size),j=0;o.data.length;)k=o.data.shift(),i.set(k,j),j+=k.byteLength;Xi.ts.videoPacketContainsKeyFrame(i)&&(c.firstKeyFrame=Xi.ts.parsePesTime(i),c.firstKeyFrame.type="video"),o.size=0}o.data.push(d),o.size+=d.byteLength}}if(n&&c.firstKeyFrame)break;l+=Zi,m+=Zi}for(m=a.byteLength,l=m-Zi,n=!1;l>=0;)if(a[l]!==$i||a[m]!==$i)l--,m--;else{switch(d=a.subarray(l,m),e=Xi.ts.parseType(d,b.pid)){case"pes":f=Xi.ts.parsePesType(d,b.table),g=Xi.ts.parsePayloadUnitStartIndicator(d),"video"===f&&g&&(h=Xi.ts.parsePesTime(d),h&&(h.type="video",c.video.push(h),n=!0))}if(n)break;l-=Zi,m-=Zi}},dj=function(a,b){if(a.audio&&a.audio.length){var c=b;"undefined"==typeof c&&(c=a.audio[0].dts),a.audio.forEach(function(a){a.dts=Wi(a.dts,c),a.pts=Wi(a.pts,c),a.dtsTime=a.dts/Yi,a.ptsTime=a.pts/Yi})}if(a.video&&a.video.length){var d=b;if("undefined"==typeof d&&(d=a.video[0].dts),a.video.forEach(function(a){a.dts=Wi(a.dts,d),a.pts=Wi(a.pts,d),a.dtsTime=a.dts/Yi,a.ptsTime=a.pts/Yi}),a.firstKeyFrame){var e=a.firstKeyFrame;e.dts=Wi(e.dts,d),e.pts=Wi(e.pts,d),e.dtsTime=e.dts/Yi,e.ptsTime=e.dts/Yi}}},ej=function(a){for(var b,c=!1,d=0,e=null,f=null,g=0,h=0;a.length-h>=3;){var i=Xi.aac.parseType(a,h);switch(i){case"timed-metadata":if(a.length-h<10){c=!0;break}if(g=Xi.aac.parseId3TagSize(a,h),g>a.length){c=!0;break}null===f&&(b=a.subarray(h,h+g),f=Xi.aac.parseAacTimestamp(b)),h+=g;break;case"audio":if(a.length-h<7){c=!0;break}if(g=Xi.aac.parseAdtsSize(a,h),g>a.length){c=!0;break}null===e&&(b=a.subarray(h,h+g),e=Xi.aac.parseSampleRate(b)),d++,h+=g;break;default:h++}if(c)return null}if(null===e||null===f)return null;var j=Yi/e,k={audio:[{type:"audio",dts:f,pts:f},{type:"audio",dts:f+1024*d*j,pts:f+1024*d*j}]};return k},fj=function(a){var b={pid:null,table:null},c={};aj(a,b);for(var d in b.table)if(b.table.hasOwnProperty(d)){var e=b.table[d];switch(e){case ji.H264_STREAM_TYPE:c.video=[],cj(a,b,c),0===c.video.length&&delete c.video;break;case ji.ADTS_STREAM_TYPE:c.audio=[],bj(a,b,c),0===c.audio.length&&delete c.audio}}return c},gj=function(a,b){var c,d=_i(a);return c=d?ej(a):fj(a),c&&(c.audio||c.video)?(dj(c,b),c):null},hj={inspect:gj},ij=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},jj=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),kj=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":Hb(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)},lj=function(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==("undefined"==typeof b?"undefined":Hb(b))&&"function"!=typeof b?a:b},mj=function(){var a=[[[],[],[],[],[]],[[],[],[],[],[]]],b=a[0],c=a[1],d=b[4],e=c[4],f=void 0,g=void 0,h=void 0,i=[],j=[],k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0;for(f=0;256>f;f++)j[(i[f]=f<<1^283*(f>>7))^f]=f;for(g=h=0;!d[g];g^=k||1,h=j[h]||1)for(n=h^h<<1^h<<2^h<<3^h<<4,n=n>>8^255&n^99,d[g]=n,e[n]=g,m=i[l=i[k=i[g]]],p=16843009*m^65537*l^257*k^16843008*g,o=257*i[n]^16843008*n,f=0;4>f;f++)b[f][g]=o=o<<24^o>>>8,c[f][n]=p=p<<24^p>>>8;for(f=0;5>f;f++)b[f]=b[f].slice(0),c[f]=c[f].slice(0);return a},nj=null,oj=function(){function a(b){ij(this,a),nj||(nj=mj()),this._tables=[[nj[0][0].slice(),nj[0][1].slice(),nj[0][2].slice(),nj[0][3].slice(),nj[0][4].slice()],[nj[1][0].slice(),nj[1][1].slice(),nj[1][2].slice(),nj[1][3].slice(),nj[1][4].slice()]];var c=void 0,d=void 0,e=void 0,f=void 0,g=void 0,h=this._tables[0][4],i=this._tables[1],j=b.length,k=1;if(4!==j&&6!==j&&8!==j)throw new Error("Invalid aes key size");for(f=b.slice(0),g=[],this._key=[f,g],c=j;4*j+28>c;c++)e=f[c-1],(c%j===0||8===j&&c%j===4)&&(e=h[e>>>24]<<24^h[e>>16&255]<<16^h[e>>8&255]<<8^h[255&e],c%j===0&&(e=e<<8^e>>>24^k<<24,k=k<<1^283*(k>>7))),f[c]=f[c-j]^e;for(d=0;c;d++,c--)e=f[3&d?c:c-4],4>=c||4>d?g[d]=e:g[d]=i[0][h[e>>>24]]^i[1][h[e>>16&255]]^i[2][h[e>>8&255]]^i[3][h[255&e]]}return a.prototype.decrypt=function(a,b,c,d,e,f){var g=this._key[1],h=a^g[0],i=d^g[1],j=c^g[2],k=b^g[3],l=void 0,m=void 0,n=void 0,o=g.length/4-2,p=void 0,q=4,r=this._tables[1],s=r[0],t=r[1],u=r[2],v=r[3],w=r[4];for(p=0;o>p;p++)l=s[h>>>24]^t[i>>16&255]^u[j>>8&255]^v[255&k]^g[q],m=s[i>>>24]^t[j>>16&255]^u[k>>8&255]^v[255&h]^g[q+1],n=s[j>>>24]^t[k>>16&255]^u[h>>8&255]^v[255&i]^g[q+2],k=s[k>>>24]^t[h>>16&255]^u[i>>8&255]^v[255&j]^g[q+3],q+=4,h=l,i=m,j=n;for(p=0;4>p;p++)e[(3&-p)+f]=w[h>>>24]<<24^w[i>>16&255]<<16^w[j>>8&255]<<8^w[255&k]^g[q++],l=h,h=i,i=j,j=k,k=l},a}(),pj=function(){function a(){ij(this,a),this.listeners={}}return a.prototype.on=function(a,b){this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push(b)},a.prototype.off=function(a,b){if(!this.listeners[a])return!1;var c=this.listeners[a].indexOf(b);return this.listeners[a].splice(c,1),c>-1},a.prototype.trigger=function(a){var b=this.listeners[a];if(b)if(2===arguments.length)for(var c=b.length,d=0;c>d;++d)b[d].call(this,arguments[1]);else for(var e=Array.prototype.slice.call(arguments,1),f=b.length,g=0;f>g;++g)b[g].apply(this,e)},a.prototype.dispose=function(){this.listeners={}},a.prototype.pipe=function(a){this.on("data",function(b){a.push(b)})},a}(),qj=function(a){function b(){ij(this,b);var c=lj(this,a.call(this,pj));return c.jobs=[],c.delay=1,c.timeout_=null,c}return kj(b,a),b.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},b.prototype.push=function(a){this.jobs.push(a),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},b}(pj),rj=function(a){return a<<24|(65280&a)<<8|(16711680&a)>>8|a>>>24},sj=function(a,b,c){var d=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>2),e=new oj(Array.prototype.slice.call(b)),f=new Uint8Array(a.byteLength),g=new Int32Array(f.buffer),h=void 0,i=void 0,j=void 0,k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0;for(h=c[0],i=c[1],j=c[2],k=c[3],p=0;p<d.length;p+=4)l=rj(d[p]),m=rj(d[p+1]),n=rj(d[p+2]),o=rj(d[p+3]),e.decrypt(l,m,n,o,g,p),g[p]=rj(g[p]^h),g[p+1]=rj(g[p+1]^i),g[p+2]=rj(g[p+2]^j),g[p+3]=rj(g[p+3]^k),h=l,i=m,j=n,k=o;return f},tj=function(){function a(b,c,d,e){ij(this,a);var f=a.STEP,g=new Int32Array(b.buffer),h=new Uint8Array(b.byteLength),i=0;for(this.asyncStream_=new qj,this.asyncStream_.push(this.decryptChunk_(g.subarray(i,i+f),c,d,h)),i=f;i<g.length;i+=f)d=new Uint32Array([rj(g[i-4]),rj(g[i-3]),rj(g[i-2]),rj(g[i-1])]),this.asyncStream_.push(this.decryptChunk_(g.subarray(i,i+f),c,d,h));this.asyncStream_.push(function(){e(null,mb(h))})}return a.prototype.decryptChunk_=function(a,b,c,d){return function(){var e=sj(a,b,c);d.set(e,a.byteOffset)}},jj(a,null,[{key:"STEP",get:function(){return 32e3}}]),a}(),uj=function(a,b){return/^[a-z]+:/i.test(b)?b:(/\/\//i.test(a)||(a=Jg.buildAbsoluteURL(vb.location.href,a)),Jg.buildAbsoluteURL(a,b))},vj=kb.mergeOptions,wj=kb.EventTarget,xj=kb.log,yj=function(a,b){["AUDIO","SUBTITLES"].forEach(function(c){for(var d in a.mediaGroups[c])for(var e in a.mediaGroups[c][d]){var f=a.mediaGroups[c][d][e];b(f,c,d,e)}})},zj=function(a,b,c){var d=b.slice();c=c||0;for(var e=Math.min(a.length,b.length+c),f=c;e>f;f++)d[f-c]=vj(a[f],d[f-c]);return d},Aj=function(a,b){a.resolvedUri||(a.resolvedUri=uj(b,a.uri)),a.key&&!a.key.resolvedUri&&(a.key.resolvedUri=uj(b,a.key.uri)),a.map&&!a.map.resolvedUri&&(a.map.resolvedUri=uj(b,a.map.uri))},Bj=function(a,b){var c=vj(a,{}),d=c.playlists[b.uri];if(!d)return null;if(d.segments&&b.segments&&d.segments.length===b.segments.length&&d.mediaSequence===b.mediaSequence)return null;var e=vj(d,b);d.segments&&(e.segments=zj(d.segments,b.segments,b.mediaSequence-d.mediaSequence)),e.segments.forEach(function(a){Aj(a,e.resolvedUri)});for(var f=0;f<c.playlists.length;f++)c.playlists[f].uri===b.uri&&(c.playlists[f]=e);return c.playlists[b.uri]=e,c},Cj=function(a){for(var b=a.playlists.length;b--;){var c=a.playlists[b];a.playlists[c.uri]=c,c.resolvedUri=uj(a.uri,c.uri),c.id=b,c.attributes||(c.attributes={},xj.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}},Dj=function(a){yj(a,function(b){b.uri&&(b.resolvedUri=uj(a.uri,b.uri))})},Ej=function(a,b){var c=a.segments[a.segments.length-1],d=void 0;return d=b&&c&&c.duration?1e3*c.duration:500*(a.targetDuration||10)},Fj=function(a){function b(c,d,e){Ib(this,b);var f=Kb(this,a.call(this));if(f.srcUrl=c,f.hls_=d,f.withCredentials=e,!f.srcUrl)throw new Error("A non-empty playlist URL is required");return f.state="HAVE_NOTHING",f.on("mediaupdatetimeout",function(){"HAVE_METADATA"===f.state&&(f.state="HAVE_CURRENT_METADATA",f.request=f.hls_.xhr({uri:uj(f.master.uri,f.media().uri),withCredentials:f.withCredentials},function(a,b){return f.request?a?f.playlistRequestError(f.request,f.media().uri,"HAVE_METADATA"):void f.haveMetadata(f.request,f.media().uri):void 0}))}),f}return Jb(b,a),b.prototype.playlistRequestError=function(a,b,c){this.request=null,c&&(this.state=c),this.error={playlist:this.master.playlists[b],status:a.status,message:"HLS playlist request error at URL: "+b,responseText:a.responseText,code:a.status>=500?4:2},this.trigger("error")},b.prototype.haveMetadata=function(a,b){var c=this;this.request=null,this.state="HAVE_METADATA";var d=new Tg;d.push(a.responseText),d.end(),d.manifest.uri=b,d.manifest.attributes=d.manifest.attributes||{};var e=Bj(this.master,d.manifest);this.targetDuration=d.manifest.targetDuration,e?(this.master=e,this.media_=this.master.playlists[d.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(vb.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=vb.setTimeout(function(){c.trigger("mediaupdatetimeout")},Ej(this.media(),!!e))),this.trigger("loadedplaylist")},b.prototype.dispose=function(){this.stopRequest(),vb.clearTimeout(this.mediaUpdateTimeout)},b.prototype.stopRequest=function(){if(this.request){var a=this.request;this.request=null,a.onreadystatechange=null,a.abort()}},b.prototype.media=function(a){var b=this;if(!a)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var c=this.state;if("string"==typeof a){if(!this.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=this.master.playlists[a]}var d=!this.media_||a.uri!==this.media_.uri;if(this.master.playlists[a.uri].endList)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=a,void(d&&(this.trigger("mediachanging"),this.trigger("mediachange")));if(d){if(this.state="SWITCHING_MEDIA",this.request){if(uj(this.master.uri,a.uri)===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.request=this.hls_.xhr({uri:uj(this.master.uri,a.uri),withCredentials:this.withCredentials},function(d,e){if(b.request){if(d)return b.playlistRequestError(b.request,a.uri,c);b.haveMetadata(e,a.uri),"HAVE_MASTER"===c?b.trigger("loadedmetadata"):b.trigger("mediachange")}})}},b.prototype.pause=function(){this.stopRequest(),vb.clearTimeout(this.mediaUpdateTimeout),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},b.prototype.load=function(a){var b=this;vb.clearTimeout(this.mediaUpdateTimeout);var c=this.media();if(a){var d=c?c.targetDuration/2*1e3:5e3;return void(this.mediaUpdateTimeout=vb.setTimeout(function(){return b.load()},d))}return this.started?void(c&&!c.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")):void this.start()},b.prototype.start=function(){var a=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(b,c){if(a.request){if(a.request=null,b)return a.error={status:c.status,message:"HLS playlist request error at URL: "+a.srcUrl,responseText:c.responseText,code:2},"HAVE_NOTHING"===a.state&&(a.started=!1),a.trigger("error");var d=new Tg;return d.push(c.responseText),d.end(),a.state="HAVE_MASTER",d.manifest.uri=a.srcUrl,d.manifest.playlists?(a.master=d.manifest,Cj(a.master),Dj(a.master),a.trigger("loadedplaylist"),void(a.request||a.media(d.manifest.playlists[0]))):(a.master={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:vb.location.href,playlists:[{uri:a.srcUrl,id:0}]},a.master.playlists[a.srcUrl]=a.master.playlists[0],a.master.playlists[0].resolvedUri=a.srcUrl,a.master.playlists[0].attributes=a.master.playlists[0].attributes||{},a.haveMetadata(c,a.srcUrl),a.trigger("loadedmetadata"))}})},b}(wj),Gj=kb.createTimeRange,Hj=function(a,b){var c=0,d=b-a.mediaSequence,e=a.segments[d];if(e){if("undefined"!=typeof e.start)return{result:e.start,precise:!0};if("undefined"!=typeof e.end)return{result:e.end-e.duration,precise:!0}}for(;d--;){if(e=a.segments[d],"undefined"!=typeof e.end)return{result:c+e.end,precise:!0};if(c+=e.duration,"undefined"!=typeof e.start)return{result:c+e.start,precise:!0}}return{result:c,precise:!1}},Ij=function(a,b){for(var c=0,d=void 0,e=b-a.mediaSequence;e<a.segments.length;e++){if(d=a.segments[e],"undefined"!=typeof d.start)return{result:d.start-c,precise:!0};if(c+=d.duration,"undefined"!=typeof d.end)return{result:d.end-c,precise:!0}}return{result:-1,precise:!1}},Jj=function(a,b,c){var d=void 0,e=void 0;return"undefined"==typeof b&&(b=a.mediaSequence+a.segments.length),b<a.mediaSequence?0:(d=Hj(a,b),d.precise?d.result:(e=Ij(a,b),e.precise?e.result:d.result+c))},Kj=function(a,b,c){if(!a)return 0;if("number"!=typeof c&&(c=0),"undefined"==typeof b){if(a.totalDuration)return a.totalDuration;if(!a.endList)return vb.Infinity}return Jj(a,b,c)},Lj=function(a,b,c){var d=0;if(b>c){var e=[c,b];b=e[0],c=e[1]}if(0>b){for(var f=b;f<Math.min(0,c);f++)d+=a.targetDuration;b=0}for(var g=b;c>g;g++)d+=a.segments[g].duration;return d},Mj=function(a){if(!a.segments.length)return 0;for(var b=a.segments.length-1,c=a.segments[b].duration||a.targetDuration,d=c+2*a.targetDuration;b--&&(c+=a.segments[b].duration,!(c>=d)););return Math.max(0,b)},Nj=function(a,b,c){if(!a||!a.segments)return null;if(a.endList)return Kj(a);if(null===b)return null;b=b||0;var d=c?Mj(a):a.segments.length;return Jj(a,a.mediaSequence+d,b)},Oj=function(a,b){var c=!0,d=b||0,e=Nj(a,b,c);return null===e?Gj():Gj(d,e)},Pj=function(a){return a-Math.floor(a)===0},Qj=function(a,b){if(Pj(b))return b+.1*a;for(var c=b.toString().split(".")[1].length,d=1;c>=d;d++){var e=Math.pow(10,d),f=b*e;if(Pj(f)||d===c)return(f+a)/e}},Rj=Qj.bind(null,1),Sj=Qj.bind(null,-1),Tj=function(a,b,c,d){var e=void 0,f=void 0,g=a.segments.length,h=b-d;if(0>h){if(c>0)for(e=c-1;e>=0;e--)if(f=a.segments[e],h+=Sj(f.duration),h>0)return{mediaIndex:e,startTime:d-Lj(a,c,e)};return{mediaIndex:0,startTime:b}}if(0>c){for(e=c;0>e;e++)if(h-=a.targetDuration,0>h)return{mediaIndex:0,startTime:b};c=0}for(e=c;g>e;e++)if(f=a.segments[e],h-=Rj(f.duration),0>h)return{mediaIndex:e,startTime:d+Lj(a,c,e)};return{mediaIndex:g-1,startTime:b}},Uj=function(a){return a.excludeUntil&&a.excludeUntil>Date.now()},Vj=function(a){return a.excludeUntil&&a.excludeUntil===1/0},Wj=function(a){var b=Uj(a);return!a.disabled&&!b},Xj=function(a){return a.disabled},Yj=function(a){for(var b=0;b<a.segments.length;b++)if(a.segments[b].key)return!0;return!1},Zj=function(a){for(var b=0;b<a.segments.length;b++)if(a.segments[b].map)return!0;return!1},$j=function(a,b){return b.attributes&&b.attributes[a]},_j=function(a,b,c){var d=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;if(!$j("BANDWIDTH",c))return NaN;var e=a*c.attributes.BANDWIDTH;return(e-8*d)/b},ak=function(a,b){if(1===a.playlists.length)return!0;var c=b.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===a.playlists.filter(function(a){return Wj(a)?(a.attributes.BANDWIDTH||0)<c:!1}).length},bk={duration:Kj,seekable:Oj,safeLiveIndex:Mj,getMediaInfoForTime:Tj,isEnabled:Wj,isDisabled:Xj,isBlacklisted:Uj,isIncompatible:Vj,playlistEnd:Nj,isAes:Yj,isFmp4:Zj,hasAttribute:$j,estimateSegmentRequestTime:_j,isLowestEnabledRendition:ak},ck=kb.xhr,dk=kb.mergeOptions,ek=function(){var a=function b(a,c){a=dk({timeout:45e3},a);var d=b.beforeRequest||kb.Hls.xhr.beforeRequest;if(d&&"function"==typeof d){var e=d(a);e&&(a=e)}var f=ck(a,function(a,b){var d=f.response;!a&&d&&(f.responseTime=Date.now(),f.roundTripTime=f.responseTime-f.requestTime,f.bytesReceived=d.byteLength||d.length,f.bandwidth||(f.bandwidth=Math.floor(f.bytesReceived/f.roundTripTime*8*1e3))),b.headers&&(f.responseHeaders=b.headers),a&&"ETIMEDOUT"===a.code&&(f.timedout=!0),a||f.aborted||200===b.statusCode||206===b.statusCode||0===b.statusCode||(a=new Error("XHR Failed with a response of: "+(f&&(d||f.responseText)))),c(a,f)}),g=f.abort;return f.abort=function(){return f.aborted=!0,g.apply(f,arguments)},f.uri=a.uri,f.requestTime=Date.now(),f};return a},fk=function(a,b){return a.start(b)+"-"+a.end(b)},gk=function(a,b){var c=a.toString(16);return"00".substring(0,2-c.length)+c+(b%2?" ":"")},hk=function(a){return a>=32&&126>a?String.fromCharCode(a):"."},ik=function(a){var b={};return Object.keys(a).forEach(function(c){var d=a[c];ArrayBuffer.isView(d)?b[c]={bytes:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength}:b[c]=d}),b},jk=function(a){var b=a.byterange||{length:1/0,offset:0};return[b.length,b.offset,a.resolvedUri].join(",")},kk=function(a){for(var b=Array.prototype.slice.call(a),c=16,d="",e=void 0,f=void 0,g=0;g<b.length/c;g++)e=b.slice(g*c,g*c+c).map(gk).join(""),f=b.slice(g*c,g*c+c).map(hk).join(""),d+=e+" "+f+"\n";return d},lk=function(a){var b=a.bytes;return kk(b)},mk=function(a){var b="",c=void 0;for(c=0;c<a.length;c++)b+=fk(a,c)+" ";return b},nk=Object.freeze({createTransferableMessage:ik,initSegmentId:jk,hexDump:kk,tagDump:lk,textRanges:mk}),ok=1/30,pk=3*ok,qk=function(a,b){var c=[],d=void 0;if(a&&a.length)for(d=0;d<a.length;d++)b(a.start(d),a.end(d))&&c.push([a.start(d),a.end(d)]);return kb.createTimeRanges(c)},rk=function(a,b){return qk(a,function(a,c){return b>=a-ok&&c+ok>=b})},sk=function(a,b){return qk(a,function(a){return a-ok>=b})},tk=function(a){if(a.length<2)return kb.createTimeRanges();for(var b=[],c=1;c<a.length;c++){var d=a.end(c-1),e=a.start(c);b.push([d,e])}return kb.createTimeRanges(b)},uk=function(a){var b=[];if(!a||!a.length)return"";for(var c=0;c<a.length;c++)b.push(a.start(c)+" => "+a.end(c));return b.join(", ")},vk=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,d=a.length?a.end(a.length-1):0;return(d-b)/c},wk=function(a){for(var b=[],c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b},xk=function(a,b,c){var d=b.player_;if(c.captions&&c.captions.length){a.inbandTextTracks_||(a.inbandTextTracks_={});for(var e in c.captionStreams)if(!a.inbandTextTracks_[e]){d.tech_.trigger({type:"usage",name:"hls-608"});var f=d.textTracks().getTrackById(e);f?a.inbandTextTracks_[e]=f:a.inbandTextTracks_[e]=d.addRemoteTextTrack({kind:"captions",id:e,label:e},!1).track}}c.metadata&&c.metadata.length&&!a.metadataTrack_&&(a.metadataTrack_=d.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,a.metadataTrack_.inBandMetadataTrackDispatchType=c.metadata.dispatchType)},yk=function(a,b,c){var d=void 0,e=void 0;if(c&&c.cues)for(d=c.cues.length;d--;)e=c.cues[d],e.startTime<=b&&e.endTime>=a&&c.removeCue(e)},zk=function(a){Object.defineProperties(a.frame,{id:{get:function(){return kb.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),a.value.key}},value:{get:function(){return kb.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),a.value.data}},privateData:{get:function(){return kb.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),a.value.data}}})},Ak=function(a){var b=void 0;return b=isNaN(a)||Math.abs(a)===1/0?Number.MAX_VALUE:a},Bk=function(a,b,c){var d=vb.WebKitDataCue||vb.VTTCue;if(b&&b.forEach(function(a){var b=a.stream;this.inbandTextTracks_[b].addCue(new d(a.startTime+this.timestampOffset,a.endTime+this.timestampOffset,a.text))},a),c){var e=Ak(a.mediaSource_.duration);if(c.forEach(function(a){var b=a.cueTime+this.timestampOffset;a.frames.forEach(function(a){var c=new d(b,b,a.value||a.url||a.data||"");c.frame=a,c.value=a,zk(c),this.metadataTrack_.addCue(c)},this)},a),a.metadataTrack_&&a.metadataTrack_.cues&&a.metadataTrack_.cues.length){for(var f=a.metadataTrack_.cues,g=[],h=0;h<f.length;h++)f[h]&&g.push(f[h]);var i=g.reduce(function(a,b){var c=a[b.startTime]||[];return c.push(b),a[b.startTime]=c,a},{}),j=Object.keys(i).sort(function(a,b){return Number(a)-Number(b)});j.forEach(function(a,b){var c=i[a],d=Number(j[b+1])||e;c.forEach(function(a){a.endTime=d})})}}},Ck="undefined"!=typeof window?window:{},Dk="undefined"==typeof Symbol?"__target":Symbol(),Ek="application/javascript",Fk=Ck.BlobBuilder||Ck.WebKitBlobBuilder||Ck.MozBlobBuilder||Ck.MSBlobBuilder,Gk=Ck.URL||Ck.webkitURL||Gk&&Gk.msURL,Hk=Ck.Worker;if(Hk){var Ik,Jk=ob("self.onmessage = function () {}"),Kk=new Uint8Array(1);try{Ik=new Hk(Jk),Ik.postMessage(Kk,[Kk.buffer])}catch(Lk){Hk=null}finally{Gk.revokeObjectURL(Jk),Ik&&Ik.terminate()}}var Mk=new nb("./transmuxer-worker.worker.js",function(a,b){var c=this;(function(){var b,d="undefined"!=typeof a?a:"undefined"!=typeof global?global:"undefined"!=typeof c?c:{};b="undefined"!=typeof a?a:"undefined"!=typeof d?d:"undefined"!=typeof c?c:{};var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O=b,P=Math.pow(2,32)-1;
- !function(){var a;if(A={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},"undefined"!=typeof Uint8Array){for(a in A)A.hasOwnProperty(a)&&(A[a]=[a.charCodeAt(0),a.charCodeAt(1),a.charCodeAt(2),a.charCodeAt(3)]);B=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),D=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),C=new Uint8Array([0,0,0,1]),E=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),F=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),G={video:E,audio:F},J=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),I=new Uint8Array([0,0,0,0,0,0,0,0]),K=new Uint8Array([0,0,0,0,0,0,0,0]),L=K,M=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N=K,H=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),e=function(a){var b,c,d,e=[],f=0;for(b=1;b<arguments.length;b++)e.push(arguments[b]);for(b=e.length;b--;)f+=e[b].byteLength;for(c=new Uint8Array(f+8),d=new DataView(c.buffer,c.byteOffset,c.byteLength),d.setUint32(0,c.byteLength),c.set(a,4),b=0,f=8;b<e.length;b++)c.set(e[b],f),f+=e[b].byteLength;return c},f=function(){return e(A.dinf,e(A.dref,J))},g=function(a){return e(A.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,a.audioobjecttype<<3|a.samplingfrequencyindex>>>1,a.samplingfrequencyindex<<7|a.channelcount<<3,6,1,2]))},h=function(){return e(A.ftyp,B,C,B,D)},t=function(a){return e(A.hdlr,G[a])},i=function(a){return e(A.mdat,a)},s=function(a){var b=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,a.duration>>>24&255,a.duration>>>16&255,a.duration>>>8&255,255&a.duration,85,196,0,0]);return a.samplerate&&(b[12]=a.samplerate>>>24&255,b[13]=a.samplerate>>>16&255,b[14]=a.samplerate>>>8&255,b[15]=255&a.samplerate),e(A.mdhd,b)},r=function(a){return e(A.mdia,s(a),t(a.type),k(a))},j=function(a){return e(A.mfhd,new Uint8Array([0,0,0,0,(4278190080&a)>>24,(16711680&a)>>16,(65280&a)>>8,255&a]))},k=function(a){return e(A.minf,"video"===a.type?e(A.vmhd,H):e(A.smhd,I),f(),v(a))},l=function(a,b){for(var c=[],d=b.length;d--;)c[d]=x(b[d]);return e.apply(null,[A.moof,j(a)].concat(c))},m=function(a){for(var b=a.length,c=[];b--;)c[b]=p(a[b]);return e.apply(null,[A.moov,o(4294967295)].concat(c).concat(n(a)))},n=function(a){for(var b=a.length,c=[];b--;)c[b]=y(a[b]);return e.apply(null,[A.mvex].concat(c))},o=function(a){var b=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&a)>>24,(16711680&a)>>16,(65280&a)>>8,255&a,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e(A.mvhd,b)},u=function(a){var b,c,d=a.samples||[],f=new Uint8Array(4+d.length);for(c=0;c<d.length;c++)b=d[c].flags,f[c+4]=b.dependsOn<<4|b.isDependedOn<<2|b.hasRedundancy;return e(A.sdtp,f)},v=function(a){return e(A.stbl,w(a),e(A.stts,N),e(A.stsc,L),e(A.stsz,M),e(A.stco,K))},function(){var a,b;w=function(c){return e(A.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===c.type?a(c):b(c))},a=function(a){var b,c=a.sps||[],d=a.pps||[],f=[],g=[];for(b=0;b<c.length;b++)f.push((65280&c[b].byteLength)>>>8),f.push(255&c[b].byteLength),f=f.concat(Array.prototype.slice.call(c[b]));for(b=0;b<d.length;b++)g.push((65280&d[b].byteLength)>>>8),g.push(255&d[b].byteLength),g=g.concat(Array.prototype.slice.call(d[b]));return e(A.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&a.width)>>8,255&a.width,(65280&a.height)>>8,255&a.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),e(A.avcC,new Uint8Array([1,a.profileIdc,a.profileCompatibility,a.levelIdc,255].concat([c.length]).concat(f).concat([d.length]).concat(g))),e(A.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))},b=function(a){return e(A.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&a.channelcount)>>8,255&a.channelcount,(65280&a.samplesize)>>8,255&a.samplesize,0,0,0,0,(65280&a.samplerate)>>8,255&a.samplerate,0,0]),g(a))}}(),q=function(a){var b=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,0,(4278190080&a.duration)>>24,(16711680&a.duration)>>16,(65280&a.duration)>>8,255&a.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&a.width)>>8,255&a.width,0,0,(65280&a.height)>>8,255&a.height,0,0]);return e(A.tkhd,b)},x=function(a){var b,c,d,f,g,h,i;return b=e(A.tfhd,new Uint8Array([0,0,0,58,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),h=Math.floor(a.baseMediaDecodeTime/(P+1)),i=Math.floor(a.baseMediaDecodeTime%(P+1)),c=e(A.tfdt,new Uint8Array([1,0,0,0,h>>>24&255,h>>>16&255,h>>>8&255,255&h,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),g=92,"audio"===a.type?(d=z(a,g),e(A.traf,b,c,d)):(f=u(a),d=z(a,f.length+g),e(A.traf,b,c,d,f))},p=function(a){return a.duration=a.duration||4294967295,e(A.trak,q(a),r(a))},y=function(a){var b=new Uint8Array([0,0,0,0,(4278190080&a.id)>>24,(16711680&a.id)>>16,(65280&a.id)>>8,255&a.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==a.type&&(b[b.length-1]=0),e(A.trex,b)},function(){var a,b,c;c=function(a,b){var c=0,d=0,e=0,f=0;return a.length&&(void 0!==a[0].duration&&(c=1),void 0!==a[0].size&&(d=2),void 0!==a[0].flags&&(e=4),void 0!==a[0].compositionTimeOffset&&(f=8)),[0,0,c|d|e|f,1,(4278190080&a.length)>>>24,(16711680&a.length)>>>16,(65280&a.length)>>>8,255&a.length,(4278190080&b)>>>24,(16711680&b)>>>16,(65280&b)>>>8,255&b]},b=function(a,b){var d,f,g,h;for(f=a.samples||[],b+=20+16*f.length,d=c(f,b),h=0;h<f.length;h++)g=f[h],d=d.concat([(4278190080&g.duration)>>>24,(16711680&g.duration)>>>16,(65280&g.duration)>>>8,255&g.duration,(4278190080&g.size)>>>24,(16711680&g.size)>>>16,(65280&g.size)>>>8,255&g.size,g.flags.isLeading<<2|g.flags.dependsOn,g.flags.isDependedOn<<6|g.flags.hasRedundancy<<4|g.flags.paddingValue<<1|g.flags.isNonSyncSample,61440&g.flags.degradationPriority,15&g.flags.degradationPriority,(4278190080&g.compositionTimeOffset)>>>24,(16711680&g.compositionTimeOffset)>>>16,(65280&g.compositionTimeOffset)>>>8,255&g.compositionTimeOffset]);return e(A.trun,new Uint8Array(d))},a=function(a,b){var d,f,g,h;for(f=a.samples||[],b+=20+8*f.length,d=c(f,b),h=0;h<f.length;h++)g=f[h],d=d.concat([(4278190080&g.duration)>>>24,(16711680&g.duration)>>>16,(65280&g.duration)>>>8,255&g.duration,(4278190080&g.size)>>>24,(16711680&g.size)>>>16,(65280&g.size)>>>8,255&g.size]);return e(A.trun,new Uint8Array(d))},z=function(c,d){return"audio"===c.type?a(c,d):b(c,d)}}();var Q={ftyp:h,mdat:i,moof:l,moov:m,initSegment:function(a){var b,c=h(),d=m(a);return b=new Uint8Array(c.byteLength+d.byteLength),b.set(c),b.set(d,c.byteLength),b}},R=function(){this.init=function(){var a={};this.on=function(b,c){a[b]||(a[b]=[]),a[b]=a[b].concat(c)},this.off=function(b,c){var d;return a[b]?(d=a[b].indexOf(c),a[b]=a[b].slice(),a[b].splice(d,1),d>-1):!1},this.trigger=function(b){var c,d,e,f;if(c=a[b])if(2===arguments.length)for(e=c.length,d=0;e>d;++d)c[d].call(this,arguments[1]);else{for(f=[],d=arguments.length,d=1;d<arguments.length;++d)f.push(arguments[d]);for(e=c.length,d=0;e>d;++d)c[d].apply(this,f)}},this.dispose=function(){a={}}}};R.prototype.pipe=function(a){return this.on("data",function(b){a.push(b)}),this.on("done",function(b){a.flush(b)}),a},R.prototype.push=function(a){this.trigger("data",a)},R.prototype.flush=function(a){this.trigger("done",a)};var S=R,T=4,U=128,V=function(a){for(var b=0,c={payloadType:-1,payloadSize:0},d=0,e=0;b<a.byteLength&&a[b]!==U;){for(;255===a[b];)d+=255,b++;for(d+=a[b++];255===a[b];)e+=255,b++;if(e+=a[b++],!c.payload&&d===T){c.payloadType=d,c.payloadSize=e,c.payload=a.subarray(b,b+e);break}b+=e,d=0,e=0}return c},W=function(a){return 181!==a.payload[0]?null:49!==(a.payload[1]<<8|a.payload[2])?null:"GA94"!==String.fromCharCode(a.payload[3],a.payload[4],a.payload[5],a.payload[6])?null:3!==a.payload[7]?null:a.payload.subarray(8,a.payload.length-1)},X=function(a,b){var c,d,e,f,g=[];if(!(64&b[0]))return g;for(d=31&b[0],c=0;d>c;c++)e=3*c,f={type:3&b[e+2],pts:a},4&b[e+2]&&(f.ccData=b[e+3]<<8|b[e+4],g.push(f));return g},Y=function ub(){ub.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new ca(0,0),new ca(0,1),new ca(1,0),new ca(1,1)],this.reset(),this.ccStreams_.forEach(function(a){a.on("data",this.trigger.bind(this,"data")),a.on("done",this.trigger.bind(this,"done"))},this)};Y.prototype=new S,Y.prototype.push=function(a){var b,c;if("sei_rbsp"===a.nalUnitType&&(b=V(a.escapedRBSP),b.payloadType===T&&(c=W(b)))){if(a.dts<this.latestDts_)return void(this.ignoreNextEqualDts_=!0);if(a.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));this.captionPackets_=this.captionPackets_.concat(X(a.pts,c)),this.latestDts_!==a.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=a.dts}},Y.prototype.flush=function(){return this.captionPackets_.length?(this.captionPackets_.forEach(function(a,b){a.presortIndex=b}),this.captionPackets_.sort(function(a,b){return a.pts===b.pts?a.presortIndex-b.presortIndex:a.pts-b.pts}),this.captionPackets_.forEach(function(a){a.type<2&&this.dispatchCea608Packet(a)},this),this.captionPackets_.length=0,void this.ccStreams_.forEach(function(a){a.flush()},this)):void this.ccStreams_.forEach(function(a){a.flush()},this)},Y.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(a){a.reset()})},Y.prototype.dispatchCea608Packet=function(a){this.setsChannel1Active(a)?this.activeCea608Channel_[a.type]=0:this.setsChannel2Active(a)&&(this.activeCea608Channel_[a.type]=1),null!==this.activeCea608Channel_[a.type]&&this.ccStreams_[(a.type<<1)+this.activeCea608Channel_[a.type]].push(a)},Y.prototype.setsChannel1Active=function(a){return 4096===(30720&a.ccData)},Y.prototype.setsChannel2Active=function(a){return 6144===(30720&a.ccData)};var Z={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},$=function(a){return null===a?"":(a=Z[a]||a,String.fromCharCode(a))},_=14,aa=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ba=function(){for(var a=[],b=_+1;b--;)a.push("");return a},ca=function vb(a,b){vb.prototype.init.call(this),this.field_=a||0,this.dataChannel_=b||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(a){var b,c,d,e,f;if(b=32639&a.ccData,b===this.lastControlCode_)return void(this.lastControlCode_=null);if(4096===(61440&b)?this.lastControlCode_=b:b!==this.PADDING_&&(this.lastControlCode_=null),d=b>>>8,e=255&b,b!==this.PADDING_)if(b===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(b===this.END_OF_CAPTION_)this.clearFormatting(a.pts),this.flushDisplayed(a.pts),c=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=c,this.startPts_=a.pts;else if(b===this.ROLL_UP_2_ROWS_)this.topRow_=_-1,this.mode_="rollUp";else if(b===this.ROLL_UP_3_ROWS_)this.topRow_=_-2,this.mode_="rollUp";else if(b===this.ROLL_UP_4_ROWS_)this.topRow_=_-3,this.mode_="rollUp";else if(b===this.CARRIAGE_RETURN_)this.clearFormatting(a.pts),this.flushDisplayed(a.pts),this.shiftRowsUp_(),this.startPts_=a.pts;else if(b===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[_]=this.nonDisplayed_[_].slice(0,-1):this.displayed_[_]=this.displayed_[_].slice(0,-1);else if(b===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(a.pts),this.displayed_=ba();else if(b===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ba();else if(b===this.RESUME_DIRECT_CAPTIONING_)this.mode_="paintOn";else if(this.isSpecialCharacter(d,e))d=(3&d)<<8,f=$(d|e),this[this.mode_](a.pts,f),this.column_++;else if(this.isExtCharacter(d,e))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[_]=this.displayed_[_].slice(0,-1),d=(3&d)<<8,f=$(d|e),this[this.mode_](a.pts,f),this.column_++;else if(this.isMidRowCode(d,e))this.clearFormatting(a.pts),this[this.mode_](a.pts," "),this.column_++,14===(14&e)&&this.addFormatting(a.pts,["i"]),1===(1&e)&&this.addFormatting(a.pts,["u"]);else if(this.isOffsetControlCode(d,e))this.column_+=3&e;else if(this.isPAC(d,e)){var g=aa.indexOf(7968&b);g!==this.row_&&(this.clearFormatting(a.pts),this.row_=g),1&e&&-1===this.formatting_.indexOf("u")&&this.addFormatting(a.pts,["u"]),16===(16&b)&&(this.column_=4*((14&b)>>1)),this.isColorPAC(e)&&14===(14&e)&&this.addFormatting(a.pts,["i"])}else this.isNormalChar(d)&&(0===e&&(e=null),f=$(d),f+=$(e),this[this.mode_](a.pts,f),this.column_+=f.length)}};ca.prototype=new S,ca.prototype.flushDisplayed=function(a){var b=this.displayed_.map(function(a){return a.trim()}).join("\n").replace(/^\n+|\n+$/g,"");b.length&&this.trigger("data",{startPts:this.startPts_,endPts:a,text:b,stream:this.name_})},ca.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ba(),this.nonDisplayed_=ba(),this.lastControlCode_=null,this.column_=0,this.row_=_,this.formatting_=[]},ca.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},ca.prototype.isSpecialCharacter=function(a,b){return a===this.EXT_&&b>=48&&63>=b},ca.prototype.isExtCharacter=function(a,b){return(a===this.EXT_+1||a===this.EXT_+2)&&b>=32&&63>=b},ca.prototype.isMidRowCode=function(a,b){return a===this.EXT_&&b>=32&&47>=b},ca.prototype.isOffsetControlCode=function(a,b){return a===this.OFFSET_&&b>=33&&35>=b},ca.prototype.isPAC=function(a,b){return a>=this.BASE_&&a<this.BASE_+8&&b>=64&&127>=b},ca.prototype.isColorPAC=function(a){return a>=64&&79>=a||a>=96&&127>=a},ca.prototype.isNormalChar=function(a){return a>=32&&127>=a},ca.prototype.addFormatting=function(a,b){this.formatting_=this.formatting_.concat(b);var c=b.reduce(function(a,b){return a+"<"+b+">"},"");this[this.mode_](a,c)},ca.prototype.clearFormatting=function(a){if(this.formatting_.length){var b=this.formatting_.reverse().reduce(function(a,b){return a+"</"+b+">"},"");this.formatting_=[],this[this.mode_](a,b)}},ca.prototype.popOn=function(a,b){var c=this.nonDisplayed_[this.row_];c+=b,this.nonDisplayed_[this.row_]=c},ca.prototype.rollUp=function(a,b){var c=this.displayed_[_];c+=b,this.displayed_[_]=c},ca.prototype.shiftRowsUp_=function(){var a;for(a=0;a<this.topRow_;a++)this.displayed_[a]="";for(a=this.topRow_;_>a;a++)this.displayed_[a]=this.displayed_[a+1];this.displayed_[_]=""},ca.prototype.paintOn=function(){};var da={CaptionStream:Y,Cea608Stream:ca},ea={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},fa=8589934592,ga=4294967296,ha=function(a,b){var c=1;for(a>b&&(c=-1);Math.abs(b-a)>ga;)a+=c*fa;return a},ia=function wb(a){var b,c;wb.prototype.init.call(this),this.type_=a,this.push=function(a){a.type===this.type_&&(void 0===c&&(c=a.dts),a.dts=ha(a.dts,c),a.pts=ha(a.pts,c),b=a.dts,this.trigger("data",a))},this.flush=function(){c=b,this.trigger("done")},this.discontinuity=function(){c=void 0,b=void 0}};ia.prototype=new S;var ja,ka={TimestampRolloverStream:ia,handleRollover:ha},la=function(a,b,c){var d,e="";for(d=b;c>d;d++)e+="%"+("00"+a[d].toString(16)).slice(-2);return e},ma=function(a,b,c){return decodeURIComponent(la(a,b,c))},na=function(a,b,c){return unescape(la(a,b,c))},oa=function(a){return a[0]<<21|a[1]<<14|a[2]<<7|a[3]},pa={TXXX:function(a){var b;if(3===a.data[0]){for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=ma(a.data,1,b),a.value=ma(a.data,b+1,a.data.length).replace(/\0*$/,"");break}a.data=a.value}},WXXX:function(a){var b;if(3===a.data[0])for(b=1;b<a.data.length;b++)if(0===a.data[b]){a.description=ma(a.data,1,b),a.url=ma(a.data,b+1,a.data.length);break}},PRIV:function(a){var b;for(b=0;b<a.data.length;b++)if(0===a.data[b]){a.owner=na(a.data,0,b);break}a.privateData=a.data.subarray(b+1),a.data=a.privateData}};ja=function(a){var b,c={debug:!(!a||!a.debug),descriptor:a&&a.descriptor},d=0,e=[],f=0;if(ja.prototype.init.call(this),this.dispatchType=ea.METADATA_STREAM_TYPE.toString(16),c.descriptor)for(b=0;b<c.descriptor.length;b++)this.dispatchType+=("00"+c.descriptor[b].toString(16)).slice(-2);this.push=function(a){var b,g,h,i,j,k;if("timed-metadata"===a.type){if(a.dataAlignmentIndicator&&(f=0,e.length=0),0===e.length&&(a.data.length<10||a.data[0]!=="I".charCodeAt(0)||a.data[1]!=="D".charCodeAt(0)||a.data[2]!=="3".charCodeAt(0)))return void c.debug;if(e.push(a),f+=a.data.byteLength,1===e.length&&(d=oa(a.data.subarray(6,10)),d+=10),!(d>f)){for(b={data:new Uint8Array(d),frames:[],pts:e[0].pts,dts:e[0].dts},j=0;d>j;)b.data.set(e[0].data.subarray(0,d-j),j),j+=e[0].data.byteLength,f-=e[0].data.byteLength,e.shift();g=10,64&b.data[5]&&(g+=4,g+=oa(b.data.subarray(10,14)),d-=oa(b.data.subarray(16,20)));do{if(h=oa(b.data.subarray(g+4,g+8)),1>h)return void 0;if(k=String.fromCharCode(b.data[g],b.data[g+1],b.data[g+2],b.data[g+3]),i={id:k,data:b.data.subarray(g+10,g+h+10)},i.key=i.id,pa[i.id]&&(pa[i.id](i),"com.apple.streaming.transportStreamTimestamp"===i.owner)){var l=i.data,m=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;m*=4,m+=3&l[7],i.timeStamp=m,void 0===b.pts&&void 0===b.dts&&(b.pts=i.timeStamp,b.dts=i.timeStamp),this.trigger("timestamp",i)}b.frames.push(i),g+=10,g+=h}while(d>g);this.trigger("data",b)}}}},ja.prototype=new S;var qa,ra,sa,ta=ja,ua=ka.TimestampRolloverStream,va=188,wa=71;qa=function(){var a=new Uint8Array(va),b=0;qa.prototype.init.call(this),this.push=function(c){var d,e=0,f=va;for(b?(d=new Uint8Array(c.byteLength+b),d.set(a.subarray(0,b)),d.set(c,b),b=0):d=c;f<d.byteLength;)d[e]!==wa||d[f]!==wa?(e++,f++):(this.trigger("data",d.subarray(e,f)),e+=va,f+=va);e<d.byteLength&&(a.set(d.subarray(e),0),b=d.byteLength-e)},this.flush=function(){b===va&&a[0]===wa&&(this.trigger("data",a),b=0),this.trigger("done")}},qa.prototype=new S,ra=function(){var a,b,c,d;ra.prototype.init.call(this),d=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,a=function(a,d){var e=0;d.payloadUnitStartIndicator&&(e+=a[e]+1),"pat"===d.type?b(a.subarray(e),d):c(a.subarray(e),d)},b=function(a,b){b.section_number=a[7],b.last_section_number=a[8],d.pmtPid=(31&a[10])<<8|a[11],b.pmtPid=d.pmtPid},c=function(a,b){var c,e,f,g;if(1&a[5]){for(d.programMapTable={video:null,audio:null,"timed-metadata":{}},c=(15&a[1])<<8|a[2],e=3+c-4,f=(15&a[10])<<8|a[11],g=12+f;e>g;){var h=a[g],i=(31&a[g+1])<<8|a[g+2];h===ea.H264_STREAM_TYPE&&null===d.programMapTable.video?d.programMapTable.video=i:h===ea.ADTS_STREAM_TYPE&&null===d.programMapTable.audio?d.programMapTable.audio=i:h===ea.METADATA_STREAM_TYPE&&(d.programMapTable["timed-metadata"][i]=h),g+=((15&a[g+3])<<8|a[g+4])+5}b.programMapTable=d.programMapTable}},this.push=function(b){var c={},d=4;if(c.payloadUnitStartIndicator=!!(64&b[1]),c.pid=31&b[1],c.pid<<=8,c.pid|=b[2],(48&b[3])>>>4>1&&(d+=b[d]+1),0===c.pid)c.type="pat",a(b.subarray(d),c),this.trigger("data",c);else if(c.pid===this.pmtPid)for(c.type="pmt",a(b.subarray(d),c),this.trigger("data",c);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([b,d,c]):this.processPes_(b,d,c)},this.processPes_=function(a,b,c){c.pid===this.programMapTable.video?c.streamType=ea.H264_STREAM_TYPE:c.pid===this.programMapTable.audio?c.streamType=ea.ADTS_STREAM_TYPE:c.streamType=this.programMapTable["timed-metadata"][c.pid],c.type="pes",c.data=a.subarray(b),this.trigger("data",c)}},ra.prototype=new S,ra.STREAM_TYPES={h264:27,adts:15},sa=function(){var a=this,b={data:[],size:0},c={data:[],size:0},d={data:[],size:0},e=function(a,b){var c;b.packetLength=6+(a[4]<<8|a[5]),b.dataAlignmentIndicator=0!==(4&a[6]),c=a[7],192&c&&(b.pts=(14&a[9])<<27|(255&a[10])<<20|(254&a[11])<<12|(255&a[12])<<5|(254&a[13])>>>3,b.pts*=4,b.pts+=(6&a[13])>>>1,b.dts=b.pts,64&c&&(b.dts=(14&a[14])<<27|(255&a[15])<<20|(254&a[16])<<12|(255&a[17])<<5|(254&a[18])>>>3,b.dts*=4,b.dts+=(6&a[18])>>>1)),b.data=a.subarray(9+a[8])},f=function(b,c,d){var f,g=new Uint8Array(b.size),h={type:c},i=0,j=0,k=!1;if(b.data.length&&!(b.size<9)){for(h.trackId=b.data[0].pid,i=0;i<b.data.length;i++)f=b.data[i],g.set(f.data,j),j+=f.data.byteLength;e(g,h),k="video"===c||h.packetLength<=b.size,(d||k)&&(b.size=0,b.data.length=0),k&&a.trigger("data",h)}};sa.prototype.init.call(this),this.push=function(e){({pat:function(){},pes:function(){var a,g;switch(e.streamType){case ea.H264_STREAM_TYPE:case ea.H264_STREAM_TYPE:a=b,g="video";break;case ea.ADTS_STREAM_TYPE:a=c,g="audio";break;case ea.METADATA_STREAM_TYPE:a=d,g="timed-metadata";break;default:return}e.payloadUnitStartIndicator&&f(a,g,!0),a.data.push(e),a.size+=e.data.byteLength},pmt:function(){var b={type:"metadata",tracks:[]},c=e.programMapTable;null!==c.video&&b.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+c.video,codec:"avc",type:"video"}),null!==c.audio&&b.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+c.audio,codec:"adts",type:"audio"}),a.trigger("data",b)}})[e.type]()},this.flush=function(){f(b,"video"),f(c,"audio"),f(d,"timed-metadata"),this.trigger("done")}},sa.prototype=new S;var xa={PAT_PID:0,MP2T_PACKET_LENGTH:va,TransportPacketStream:qa,TransportParseStream:ra,ElementaryStream:sa,TimestampRolloverStream:ua,CaptionStream:da.CaptionStream,Cea608Stream:da.Cea608Stream,MetadataStream:ta};for(var ya in ea)ea.hasOwnProperty(ya)&&(xa[ya]=ea[ya]);var za,Aa=xa,Ba=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];za=function(){var a;za.prototype.init.call(this),this.push=function(b){var c,d,e,f,g,h,i=0,j=0;if("audio"===b.type)for(a?(f=a,a=new Uint8Array(f.byteLength+b.data.byteLength),a.set(f),a.set(b.data,f.byteLength)):a=b.data;i+5<a.length;)if(255===a[i]&&240===(246&a[i+1])){if(d=2*(1&~a[i+1]),c=(3&a[i+3])<<11|a[i+4]<<3|(224&a[i+5])>>5,g=1024*((3&a[i+6])+1),h=9e4*g/Ba[(60&a[i+2])>>>2],e=i+c,a.byteLength<e)return;if(this.trigger("data",{pts:b.pts+j*h,dts:b.dts+j*h,sampleCount:g,audioobjecttype:(a[i+2]>>>6&3)+1,channelcount:(1&a[i+2])<<2|(192&a[i+3])>>>6,samplerate:Ba[(60&a[i+2])>>>2],samplingfrequencyindex:(60&a[i+2])>>>2,samplesize:16,data:a.subarray(i+7+d,e)}),a.byteLength===e)return void(a=void 0);j++,a=a.subarray(e)}else i++},this.flush=function(){this.trigger("done")}},za.prototype=new S;var Ca,Da=za;Ca=function(a){var b=a.byteLength,c=0,d=0;this.length=function(){return 8*b},this.bitsAvailable=function(){return 8*b+d},this.loadWord=function(){var e=a.byteLength-b,f=new Uint8Array(4),g=Math.min(4,b);if(0===g)throw new Error("no bytes available");f.set(a.subarray(e,e+g)),c=new DataView(f.buffer).getUint32(0),d=8*g,b-=g},this.skipBits=function(a){var e;d>a?(c<<=a,d-=a):(a-=d,e=Math.floor(a/8),a-=8*e,b-=e,this.loadWord(),c<<=a,d-=a)},this.readBits=function(a){var e=Math.min(d,a),f=c>>>32-e;return d-=e,d>0?c<<=e:b>0&&this.loadWord(),e=a-e,e>0?f<<e|this.readBits(e):f},this.skipLeadingZeros=function(){var a;for(a=0;d>a;++a)if(0!==(c&2147483648>>>a))return c<<=a,d-=a,a;return this.loadWord(),a+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var a=this.skipLeadingZeros();return this.readBits(a+1)-1},this.readExpGolomb=function(){var a=this.readUnsignedExpGolomb();return 1&a?1+a>>>1:-1*(a>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ea,Fa,Ga,Ha=Ca;Fa=function(){var a,b,c=0;Fa.prototype.init.call(this),this.push=function(d){var e;for(b?(e=new Uint8Array(b.byteLength+d.data.byteLength),e.set(b),e.set(d.data,b.byteLength),b=e):b=d.data;c<b.byteLength-3;c++)if(1===b[c+2]){a=c+5;break}for(;a<b.byteLength;)switch(b[a]){case 0:if(0!==b[a-1]){a+=2;break}if(0!==b[a-2]){a++;break}c+3!==a-2&&this.trigger("data",b.subarray(c+3,a-2));do a++;while(1!==b[a]&&a<b.length);c=a-2,a+=3;break;case 1:if(0!==b[a-1]||0!==b[a-2]){a+=3;break}this.trigger("data",b.subarray(c+3,a-2)),c=a-2,a+=3;break;default:a+=3}b=b.subarray(c),a-=c,c=0},this.flush=function(){b&&b.byteLength>3&&this.trigger("data",b.subarray(c+3)),b=null,c=0,this.trigger("done")}},Fa.prototype=new S,Ga={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ea=function(){var a,b,c,d,e,f,g,h=new Fa;Ea.prototype.init.call(this),a=this,this.push=function(a){"video"===a.type&&(b=a.trackId,c=a.pts,d=a.dts,h.push(a))},h.on("data",function(g){var h={trackId:b,pts:c,dts:d,data:g};switch(31&g[0]){case 5:h.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:h.nalUnitType="sei_rbsp",h.escapedRBSP=e(g.subarray(1));break;case 7:h.nalUnitType="seq_parameter_set_rbsp",h.escapedRBSP=e(g.subarray(1)),h.config=f(h.escapedRBSP);break;case 8:h.nalUnitType="pic_parameter_set_rbsp";break;case 9:h.nalUnitType="access_unit_delimiter_rbsp"}a.trigger("data",h)}),h.on("done",function(){a.trigger("done")}),this.flush=function(){h.flush()},g=function(a,b){var c,d,e=8,f=8;for(c=0;a>c;c++)0!==f&&(d=b.readExpGolomb(),f=(e+d+256)%256),e=0===f?e:f},e=function(a){for(var b,c,d=a.byteLength,e=[],f=1;d-2>f;)0===a[f]&&0===a[f+1]&&3===a[f+2]?(e.push(f+2),f+=2):f++;if(0===e.length)return a;b=d-e.length,c=new Uint8Array(b);var g=0;for(f=0;b>f;g++,f++)g===e[0]&&(g++,e.shift()),c[f]=a[g];return c},f=function(a){var b,c,d,e,f,h,i,j,k,l,m,n,o,p,q=0,r=0,s=0,t=0,u=1;if(b=new Ha(a),c=b.readUnsignedByte(),e=b.readUnsignedByte(),d=b.readUnsignedByte(),b.skipUnsignedExpGolomb(),Ga[c]&&(f=b.readUnsignedExpGolomb(),3===f&&b.skipBits(1),b.skipUnsignedExpGolomb(),b.skipUnsignedExpGolomb(),b.skipBits(1),b.readBoolean()))for(m=3!==f?8:12,p=0;m>p;p++)b.readBoolean()&&(6>p?g(16,b):g(64,b));if(b.skipUnsignedExpGolomb(),h=b.readUnsignedExpGolomb(),0===h)b.readUnsignedExpGolomb();else if(1===h)for(b.skipBits(1),b.skipExpGolomb(),b.skipExpGolomb(),i=b.readUnsignedExpGolomb(),p=0;i>p;p++)b.skipExpGolomb();if(b.skipUnsignedExpGolomb(),b.skipBits(1),j=b.readUnsignedExpGolomb(),k=b.readUnsignedExpGolomb(),l=b.readBits(1),0===l&&b.skipBits(1),b.skipBits(1),b.readBoolean()&&(q=b.readUnsignedExpGolomb(),r=b.readUnsignedExpGolomb(),s=b.readUnsignedExpGolomb(),t=b.readUnsignedExpGolomb()),b.readBoolean()&&b.readBoolean()){switch(o=b.readUnsignedByte()){case 1:n=[1,1];break;case 2:n=[12,11];break;case 3:n=[10,11];break;case 4:n=[16,11];break;case 5:n=[40,33];break;case 6:n=[24,11];break;case 7:n=[20,11];break;case 8:n=[32,11];break;case 9:n=[80,33];break;case 10:n=[18,11];break;case 11:n=[15,11];break;case 12:n=[64,33];break;case 13:n=[160,99];break;case 14:n=[4,3];break;case 15:n=[3,2];break;case 16:n=[2,1];break;case 255:n=[b.readUnsignedByte()<<8|b.readUnsignedByte(),b.readUnsignedByte()<<8|b.readUnsignedByte()]}n&&(u=n[0]/n[1])}return{profileIdc:c,levelIdc:d,profileCompatibility:e,width:Math.ceil((16*(j+1)-2*q-2*r)*u),height:(2-l)*(k+1)*16-2*s-2*t}}},Ea.prototype=new S;var Ia,Ja={H264Stream:Ea,NalByteStream:Fa};Ia=function(){var a=new Uint8Array,b=0;Ia.prototype.init.call(this),this.setTimestamp=function(a){b=a},this.parseId3TagSize=function(a,b){var c=a[b+6]<<21|a[b+7]<<14|a[b+8]<<7|a[b+9],d=a[b+5],e=(16&d)>>4;return e?c+20:c+10},this.parseAdtsSize=function(a,b){var c=(224&a[b+5])>>5,d=a[b+4]<<3,e=6144&a[b+3];return e|d|c},this.push=function(c){var d,e,f,g,h=0,i=0;for(a.length?(g=a.length,a=new Uint8Array(c.byteLength+g),a.set(a.subarray(0,g)),a.set(c,g)):a=c;a.length-i>=3;)if(a[i]!=="I".charCodeAt(0)||a[i+1]!=="D".charCodeAt(0)||a[i+2]!=="3".charCodeAt(0))if(a[i]&!0&&240===(240&a[i+1])){if(a.length-i<7)break;if(h=this.parseAdtsSize(a,i),h>a.length)break;f={type:"audio",data:a.subarray(i,i+h),pts:b,dts:b},this.trigger("data",f),i+=h}else i++;else{if(a.length-i<10)break;if(h=this.parseId3TagSize(a,i),h>a.length)break;e={type:"timed-metadata",data:a.subarray(i,i+h)},this.trigger("data",e),i+=h}d=a.length-i,a=d>0?a.subarray(i):new Uint8Array}},Ia.prototype=new S;var Ka,La,Ma,Na,Oa,Pa,Qa=Ia,Ra=[33,16,5,32,164,27],Sa=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],Ta=function(a){for(var b=[];a--;)b.push(0);return b},Ua=function(a){return Object.keys(a).reduce(function(b,c){return b[c]=new Uint8Array(a[c].reduce(function(a,b){return a.concat(b)},[])),b},{})},Va={96e3:[Ra,[227,64],Ta(154),[56]],88200:[Ra,[231],Ta(170),[56]],64e3:[Ra,[248,192],Ta(240),[56]],48e3:[Ra,[255,192],Ta(268),[55,148,128],Ta(54),[112]],44100:[Ra,[255,192],Ta(268),[55,163,128],Ta(84),[112]],32e3:[Ra,[255,192],Ta(268),[55,234],Ta(226),[112]],24e3:[Ra,[255,192],Ta(268),[55,255,128],Ta(268),[111,112],Ta(126),[224]],16e3:[Ra,[255,192],Ta(268),[55,255,128],Ta(268),[111,255],Ta(269),[223,108],Ta(195),[1,192]],12e3:[Sa,Ta(268),[3,127,248],Ta(268),[6,255,240],Ta(268),[13,255,224],Ta(268),[27,253,128],Ta(259),[56]],11025:[Sa,Ta(268),[3,127,248],Ta(268),[6,255,240],Ta(268),[13,255,224],Ta(268),[27,255,192],Ta(268),[55,175,128],Ta(108),[112]],8e3:[Sa,Ta(268),[3,121,16],Ta(47),[7]]},Wa=Ua(Va),Xa=9e4;Ka=function(a){return a*Xa},La=function(a,b){return a*b},Ma=function(a){return a/Xa},Na=function(a,b){return a/b},Oa=function(a,b){return Ka(Na(a,b))},Pa=function(a,b){return La(Ma(a),b)};var Ya,Za,$a,_a,ab,bb,cb,db,eb,fb,gb,hb={secondsToVideoTs:Ka,secondsToAudioTs:La,videoTsToSeconds:Ma,audioTsToSeconds:Na,audioTsToVideoTs:Oa,videoTsToAudioTs:Pa},ib=Ja.H264Stream,jb=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],kb=["width","height","profileIdc","levelIdc","profileCompatibility"],lb=9e4;ab=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0}}},bb=function(a){return a[0]==="I".charCodeAt(0)&&a[1]==="D".charCodeAt(0)&&a[2]==="3".charCodeAt(0)?!0:!1},fb=function(a,b){var c;if(a.length!==b.length)return!1;for(c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0},gb=function(a){var b,c,d=0;for(b=0;b<a.length;b++)c=a[b],d+=c.data.byteLength;return d},Za=function(a,b){var c=[],d=0,e=0,f=0,g=1/0;b=b||{},Za.prototype.init.call(this),this.push=function(b){cb(a,b),a&&jb.forEach(function(c){a[c]=b[c]}),c.push(b)},this.setEarliestDts=function(b){e=b-a.timelineStartInfo.baseMediaDecodeTime},this.setVideoBaseMediaDecodeTime=function(a){g=a},this.setAudioAppendStart=function(a){f=a},this.flush=function(){var e,f,g,h;return 0===c.length?void this.trigger("done","AudioSegmentStream"):(e=this.trimAdtsFramesByEarliestDts_(c),
- a.baseMediaDecodeTime=eb(a,b.keepOriginalTimestamps),this.prefixWithSilence_(a,e),a.samples=this.generateSampleTable_(e),g=Q.mdat(this.concatenateFrameData_(e)),c=[],f=Q.moof(d,[a]),h=new Uint8Array(f.byteLength+g.byteLength),d++,h.set(f),h.set(g,f.byteLength),db(a),this.trigger("data",{track:a,boxes:h}),void this.trigger("done","AudioSegmentStream"))},this.prefixWithSilence_=function(a,b){var c,d,e,h=0,i=0,j=0,k=0;if(b.length&&(c=hb.audioTsToVideoTs(a.baseMediaDecodeTime,a.samplerate),h=Math.ceil(lb/(a.samplerate/1024)),f&&g&&(i=c-Math.max(f,g),j=Math.floor(i/h),k=j*h),!(1>j||k>lb/2))){for(d=Wa[a.samplerate],d||(d=b[0].data),e=0;j>e;e++)b.splice(e,0,{data:d});a.baseMediaDecodeTime-=Math.floor(hb.videoTsToAudioTs(k,a.samplerate))}},this.trimAdtsFramesByEarliestDts_=function(b){return a.minSegmentDts>=e?b:(a.minSegmentDts=1/0,b.filter(function(b){return b.dts>=e?(a.minSegmentDts=Math.min(a.minSegmentDts,b.dts),a.minSegmentPts=a.minSegmentDts,!0):!1}))},this.generateSampleTable_=function(a){var b,c,d=[];for(b=0;b<a.length;b++)c=a[b],d.push({size:c.data.byteLength,duration:1024});return d},this.concatenateFrameData_=function(a){var b,c,d=0,e=new Uint8Array(gb(a));for(b=0;b<a.length;b++)c=a[b],e.set(c.data,d),d+=c.data.byteLength;return e}},Za.prototype=new S,Ya=function(a,b){var c,d,e=0,f=[],g=[];b=b||{},Ya.prototype.init.call(this),delete a.minPTS,this.gopCache_=[],this.push=function(b){cb(a,b),"seq_parameter_set_rbsp"!==b.nalUnitType||c||(c=b.config,a.sps=[b.data],kb.forEach(function(b){a[b]=c[b]},this)),"pic_parameter_set_rbsp"!==b.nalUnitType||d||(d=b.data,a.pps=[b.data]),f.push(b)},this.flush=function(){for(var c,d,h,i,j,k;f.length&&"access_unit_delimiter_rbsp"!==f[0].nalUnitType;)f.shift();if(0===f.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(c=this.groupNalsIntoFrames_(f),h=this.groupFramesIntoGops_(c),h[0][0].keyFrame||(d=this.getGopForFusion_(f[0],a),d?(h.unshift(d),h.byteLength+=d.byteLength,h.nalCount+=d.nalCount,h.pts=d.pts,h.dts=d.dts,h.duration+=d.duration):h=this.extendFirstKeyFrame_(h)),g.length){var l;if(l=b.alignGopsAtEnd?this.alignGopsAtEnd_(h):this.alignGopsAtStart_(h),!l)return this.gopCache_.unshift({gop:h.pop(),pps:a.pps,sps:a.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),f=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");db(a),h=l}cb(a,h),a.samples=this.generateSampleTable_(h),j=Q.mdat(this.concatenateNalData_(h)),a.baseMediaDecodeTime=eb(a,b.keepOriginalTimestamps),this.trigger("processedGopsInfo",h.map(function(a){return{pts:a.pts,dts:a.dts,byteLength:a.byteLength}})),this.gopCache_.unshift({gop:h.pop(),pps:a.pps,sps:a.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),f=[],this.trigger("baseMediaDecodeTime",a.baseMediaDecodeTime),this.trigger("timelineStartInfo",a.timelineStartInfo),i=Q.moof(e,[a]),k=new Uint8Array(i.byteLength+j.byteLength),e++,k.set(i),k.set(j,i.byteLength),this.trigger("data",{track:a,boxes:k}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.resetStream_=function(){db(a),c=void 0,d=void 0},this.getGopForFusion_=function(b){var c,d,e,f,g,h=45e3,i=1e4,j=1/0;for(g=0;g<this.gopCache_.length;g++)f=this.gopCache_[g],e=f.gop,a.pps&&fb(a.pps[0],f.pps[0])&&a.sps&&fb(a.sps[0],f.sps[0])&&(e.dts<a.timelineStartInfo.dts||(c=b.dts-e.dts-e.duration,c>=-i&&h>=c&&(!d||j>c)&&(d=f,j=c)));return d?d.gop:null},this.extendFirstKeyFrame_=function(a){var b;return!a[0][0].keyFrame&&a.length>1&&(b=a.shift(),a.byteLength-=b.byteLength,a.nalCount-=b.nalCount,a[0][0].dts=b.dts,a[0][0].pts=b.pts,a[0][0].duration+=b.duration),a},this.groupNalsIntoFrames_=function(a){var b,c,d=[],e=[];for(d.byteLength=0,b=0;b<a.length;b++)c=a[b],"access_unit_delimiter_rbsp"===c.nalUnitType?(d.length&&(d.duration=c.dts-d.dts,e.push(d)),d=[c],d.byteLength=c.data.byteLength,d.pts=c.pts,d.dts=c.dts):("slice_layer_without_partitioning_rbsp_idr"===c.nalUnitType&&(d.keyFrame=!0),d.duration=c.dts-d.dts,d.byteLength+=c.data.byteLength,d.push(c));return e.length&&(!d.duration||d.duration<=0)&&(d.duration=e[e.length-1].duration),e.push(d),e},this.groupFramesIntoGops_=function(a){var b,c,d=[],e=[];for(d.byteLength=0,d.nalCount=0,d.duration=0,d.pts=a[0].pts,d.dts=a[0].dts,e.byteLength=0,e.nalCount=0,e.duration=0,e.pts=a[0].pts,e.dts=a[0].dts,b=0;b<a.length;b++)c=a[b],c.keyFrame?(d.length&&(e.push(d),e.byteLength+=d.byteLength,e.nalCount+=d.nalCount,e.duration+=d.duration),d=[c],d.nalCount=c.length,d.byteLength=c.byteLength,d.pts=c.pts,d.dts=c.dts,d.duration=c.duration):(d.duration+=c.duration,d.nalCount+=c.length,d.byteLength+=c.byteLength,d.push(c));return e.length&&d.duration<=0&&(d.duration=e[e.length-1].duration),e.byteLength+=d.byteLength,e.nalCount+=d.nalCount,e.duration+=d.duration,e.push(d),e},this.generateSampleTable_=function(a,b){var c,d,e,f,g,h=b||0,i=[];for(c=0;c<a.length;c++)for(f=a[c],d=0;d<f.length;d++)g=f[d],e=ab(),e.dataOffset=h,e.compositionTimeOffset=g.pts-g.dts,e.duration=g.duration,e.size=4*g.length,e.size+=g.byteLength,g.keyFrame&&(e.flags.dependsOn=2),h+=e.size,i.push(e);return i},this.concatenateNalData_=function(a){var b,c,d,e,f,g,h=0,i=a.byteLength,j=a.nalCount,k=i+4*j,l=new Uint8Array(k),m=new DataView(l.buffer);for(b=0;b<a.length;b++)for(e=a[b],c=0;c<e.length;c++)for(f=e[c],d=0;d<f.length;d++)g=f[d],m.setUint32(h,g.data.byteLength),h+=4,l.set(g.data,h),h+=g.data.byteLength;return l},this.alignGopsAtStart_=function(a){var b,c,d,e,f,h,i,j;for(f=a.byteLength,h=a.nalCount,i=a.duration,b=c=0;b<g.length&&c<a.length&&(d=g[b],e=a[c],d.pts!==e.pts);)e.pts>d.pts?b++:(c++,f-=e.byteLength,h-=e.nalCount,i-=e.duration);return 0===c?a:c===a.length?null:(j=a.slice(c),j.byteLength=f,j.duration=i,j.nalCount=h,j.pts=j[0].pts,j.dts=j[0].dts,j)},this.alignGopsAtEnd_=function(a){var b,c,d,e,f,h;for(b=g.length-1,c=a.length-1,f=null,h=!1;b>=0&&c>=0;){if(d=g[b],e=a[c],d.pts===e.pts){h=!0;break}d.pts>e.pts?b--:(b===g.length-1&&(f=c),c--)}if(!h&&null===f)return null;var i;if(i=h?c:f,0===i)return a;var j=a.slice(i),k=j.reduce(function(a,b){return a.byteLength+=b.byteLength,a.duration+=b.duration,a.nalCount+=b.nalCount,a},{byteLength:0,duration:0,nalCount:0});return j.byteLength=k.byteLength,j.duration=k.duration,j.nalCount=k.nalCount,j.pts=j[0].pts,j.dts=j[0].dts,j},this.alignGopsWith=function(a){g=a}},Ya.prototype=new S,cb=function(a,b){"number"==typeof b.pts&&(void 0===a.timelineStartInfo.pts&&(a.timelineStartInfo.pts=b.pts),void 0===a.minSegmentPts?a.minSegmentPts=b.pts:a.minSegmentPts=Math.min(a.minSegmentPts,b.pts),void 0===a.maxSegmentPts?a.maxSegmentPts=b.pts:a.maxSegmentPts=Math.max(a.maxSegmentPts,b.pts)),"number"==typeof b.dts&&(void 0===a.timelineStartInfo.dts&&(a.timelineStartInfo.dts=b.dts),void 0===a.minSegmentDts?a.minSegmentDts=b.dts:a.minSegmentDts=Math.min(a.minSegmentDts,b.dts),void 0===a.maxSegmentDts?a.maxSegmentDts=b.dts:a.maxSegmentDts=Math.max(a.maxSegmentDts,b.dts))},db=function(a){delete a.minSegmentDts,delete a.maxSegmentDts,delete a.minSegmentPts,delete a.maxSegmentPts},eb=function(a,b){var c,d,e=a.minSegmentDts;return b||(e-=a.timelineStartInfo.dts),c=a.timelineStartInfo.baseMediaDecodeTime,c+=e,c=Math.max(0,c),"audio"===a.type&&(d=a.samplerate/lb,c*=d,c=Math.floor(c)),c},_a=function(a,b){this.numberOfTracks=0,this.metadataStream=b,"undefined"!=typeof a.remux?this.remuxTracks=!!a.remux:this.remuxTracks=!0,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,_a.prototype.init.call(this),this.push=function(a){return a.text?this.pendingCaptions.push(a):a.frames?this.pendingMetadata.push(a):(this.pendingTracks.push(a.track),this.pendingBoxes.push(a.boxes),this.pendingBytes+=a.boxes.byteLength,"video"===a.track.type&&(this.videoTrack=a.track),void("audio"===a.track.type&&(this.audioTrack=a.track)))}},_a.prototype=new S,_a.prototype.flush=function(a){var b,c,d,e,f=0,g={captions:[],captionStreams:{},metadata:[],info:{}},h=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==a&&"AudioSegmentStream"!==a)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}for(this.videoTrack?(h=this.videoTrack.timelineStartInfo.pts,kb.forEach(function(a){g.info[a]=this.videoTrack[a]},this)):this.audioTrack&&(h=this.audioTrack.timelineStartInfo.pts,jb.forEach(function(a){g.info[a]=this.audioTrack[a]},this)),1===this.pendingTracks.length?g.type=this.pendingTracks[0].type:g.type="combined",this.emittedTracks+=this.pendingTracks.length,d=Q.initSegment(this.pendingTracks),g.initSegment=new Uint8Array(d.byteLength),g.initSegment.set(d),g.data=new Uint8Array(this.pendingBytes),e=0;e<this.pendingBoxes.length;e++)g.data.set(this.pendingBoxes[e],f),f+=this.pendingBoxes[e].byteLength;for(e=0;e<this.pendingCaptions.length;e++)b=this.pendingCaptions[e],b.startTime=b.startPts-h,b.startTime/=9e4,b.endTime=b.endPts-h,b.endTime/=9e4,g.captionStreams[b.stream]=!0,g.captions.push(b);for(e=0;e<this.pendingMetadata.length;e++)c=this.pendingMetadata[e],c.cueTime=c.pts-h,c.cueTime/=9e4,g.metadata.push(c);g.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",g),this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},$a=function(a){var b,c,d=this,e=!0;$a.prototype.init.call(this),a=a||{},this.baseMediaDecodeTime=a.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var b={};this.transmuxPipeline_=b,b.type="aac",b.metadataStream=new Aa.MetadataStream,b.aacStream=new Qa,b.audioTimestampRolloverStream=new Aa.TimestampRolloverStream("audio"),b.timedMetadataTimestampRolloverStream=new Aa.TimestampRolloverStream("timed-metadata"),b.adtsStream=new Da,b.coalesceStream=new _a(a,b.metadataStream),b.headOfPipeline=b.aacStream,b.aacStream.pipe(b.audioTimestampRolloverStream).pipe(b.adtsStream),b.aacStream.pipe(b.timedMetadataTimestampRolloverStream).pipe(b.metadataStream).pipe(b.coalesceStream),b.metadataStream.on("timestamp",function(a){b.aacStream.setTimestamp(a.timeStamp)}),b.aacStream.on("data",function(e){"timed-metadata"!==e.type||b.audioSegmentStream||(c=c||{timelineStartInfo:{baseMediaDecodeTime:d.baseMediaDecodeTime},codec:"adts",type:"audio"},b.coalesceStream.numberOfTracks++,b.audioSegmentStream=new Za(c,a),b.adtsStream.pipe(b.audioSegmentStream).pipe(b.coalesceStream))}),b.coalesceStream.on("data",this.trigger.bind(this,"data")),b.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setupTsPipeline=function(){var e={};this.transmuxPipeline_=e,e.type="ts",e.metadataStream=new Aa.MetadataStream,e.packetStream=new Aa.TransportPacketStream,e.parseStream=new Aa.TransportParseStream,e.elementaryStream=new Aa.ElementaryStream,e.videoTimestampRolloverStream=new Aa.TimestampRolloverStream("video"),e.audioTimestampRolloverStream=new Aa.TimestampRolloverStream("audio"),e.timedMetadataTimestampRolloverStream=new Aa.TimestampRolloverStream("timed-metadata"),e.adtsStream=new Da,e.h264Stream=new ib,e.captionStream=new Aa.CaptionStream,e.coalesceStream=new _a(a,e.metadataStream),e.headOfPipeline=e.packetStream,e.packetStream.pipe(e.parseStream).pipe(e.elementaryStream),e.elementaryStream.pipe(e.videoTimestampRolloverStream).pipe(e.h264Stream),e.elementaryStream.pipe(e.audioTimestampRolloverStream).pipe(e.adtsStream),e.elementaryStream.pipe(e.timedMetadataTimestampRolloverStream).pipe(e.metadataStream).pipe(e.coalesceStream),e.h264Stream.pipe(e.captionStream).pipe(e.coalesceStream),e.elementaryStream.on("data",function(f){var g;if("metadata"===f.type){for(g=f.tracks.length;g--;)b||"video"!==f.tracks[g].type?c||"audio"!==f.tracks[g].type||(c=f.tracks[g],c.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime):(b=f.tracks[g],b.timelineStartInfo.baseMediaDecodeTime=d.baseMediaDecodeTime);b&&!e.videoSegmentStream&&(e.coalesceStream.numberOfTracks++,e.videoSegmentStream=new Ya(b,a),e.videoSegmentStream.on("timelineStartInfo",function(a){c&&(c.timelineStartInfo=a,e.audioSegmentStream.setEarliestDts(a.dts))}),e.videoSegmentStream.on("processedGopsInfo",d.trigger.bind(d,"gopInfo")),e.videoSegmentStream.on("baseMediaDecodeTime",function(a){c&&e.audioSegmentStream.setVideoBaseMediaDecodeTime(a)}),e.h264Stream.pipe(e.videoSegmentStream).pipe(e.coalesceStream)),c&&!e.audioSegmentStream&&(e.coalesceStream.numberOfTracks++,e.audioSegmentStream=new Za(c,a),e.adtsStream.pipe(e.audioSegmentStream).pipe(e.coalesceStream))}}),e.coalesceStream.on("data",this.trigger.bind(this,"data")),e.coalesceStream.on("done",this.trigger.bind(this,"done"))},this.setBaseMediaDecodeTime=function(a){var d=this.transmuxPipeline_;this.baseMediaDecodeTime=a,c&&(c.timelineStartInfo.dts=void 0,c.timelineStartInfo.pts=void 0,db(c),c.timelineStartInfo.baseMediaDecodeTime=a,d.audioTimestampRolloverStream&&d.audioTimestampRolloverStream.discontinuity()),b&&(d.videoSegmentStream&&(d.videoSegmentStream.gopCache_=[],d.videoTimestampRolloverStream.discontinuity()),b.timelineStartInfo.dts=void 0,b.timelineStartInfo.pts=void 0,db(b),d.captionStream.reset(),b.timelineStartInfo.baseMediaDecodeTime=a),d.timedMetadataTimestampRolloverStream&&d.timedMetadataTimestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(a){c&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(a)},this.alignGopsWith=function(a){b&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(a)},this.push=function(a){if(e){var b=bb(a);b&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():b||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),e=!1}this.transmuxPipeline_.headOfPipeline.push(a)},this.flush=function(){e=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},$a.prototype=new S;var mb={Transmuxer:$a,VideoSegmentStream:Ya,AudioSegmentStream:Za,AUDIO_PROPERTIES:jb,VIDEO_PROPERTIES:kb},nb={generator:Q,Transmuxer:mb.Transmuxer,AudioSegmentStream:mb.AudioSegmentStream,VideoSegmentStream:mb.VideoSegmentStream},ob=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},pb=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),qb=function(a){a.on("data",function(a){var b=a.initSegment;a.initSegment={data:b.buffer,byteOffset:b.byteOffset,byteLength:b.byteLength};var c=a.data;a.data=c.buffer,O.postMessage({action:"data",segment:a,byteOffset:c.byteOffset,byteLength:c.byteLength},[a.data])}),a.captionStream&&a.captionStream.on("data",function(a){O.postMessage({action:"caption",data:a})}),a.on("done",function(a){O.postMessage({action:"done"})}),a.on("gopInfo",function(a){O.postMessage({action:"gopInfo",gopInfo:a})})},rb=function(){function a(b){ob(this,a),this.options=b||{},this.init()}return pb(a,[{key:"init",value:function(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new nb.Transmuxer(this.options),qb(this.transmuxer)}},{key:"push",value:function(a){var b=new Uint8Array(a.data,a.byteOffset,a.byteLength);this.transmuxer.push(b)}},{key:"reset",value:function(){this.init()}},{key:"setTimestampOffset",value:function(a){var b=a.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(9e4*b))}},{key:"setAudioAppendStart",value:function(a){this.transmuxer.setAudioAppendStart(Math.ceil(9e4*a.appendStart))}},{key:"flush",value:function(a){this.transmuxer.flush()}},{key:"resetCaptions",value:function(){this.transmuxer.resetCaptions()}},{key:"alignGopsWith",value:function(a){this.transmuxer.alignGopsWith(a.gopsToAlignWith.slice())}}]),a}(),sb=function(a){a.onmessage=function(a){return"init"===a.data.action&&a.data.options?void(this.messageHandlers=new rb(a.data.options)):(this.messageHandlers||(this.messageHandlers=new rb),void(a.data&&a.data.action&&"init"!==a.data.action&&this.messageHandlers[a.data.action]&&this.messageHandlers[a.data.action](a.data)))}},tb=new sb(c);return tb})()}),Nk=function(a){return/mp4a\.\d+.\d+/i.test(a)},Ok=function(a){return/avc1\.[\da-f]+/i.test(a)},Pk=function(a){var b={type:"",parameters:{}},c=a.trim().split(";");return b.type=c.shift().trim(),c.forEach(function(a){var c=a.trim().split("=");if(c.length>1){var d=c[0].replace(/"/g,"").trim(),e=c[1].replace(/"/g,"").trim();b.parameters[d]=e}}),b},Qk=function(a){return a.map(function(a){return a.replace(/avc1\.(\d+)\.(\d+)/i,function(a,b,c){var d=("00"+Number(b).toString(16)).slice(-2),e=("00"+Number(c).toString(16)).slice(-2);return"avc1."+d+"00"+e})})},Rk=function(a,b){var c=a.addSourceBuffer(b),d=Object.create(null);d.updating=!1,d.realBuffer_=c;var e=function(a){"function"==typeof c[a]?d[a]=function(){return c[a].apply(c,arguments)}:"undefined"==typeof d[a]&&Object.defineProperty(d,a,{get:function(){return c[a]},set:function(b){return c[a]=b}})};for(var f in c)e(f);return d},Sk=function(a,b,c){if(!b||!a.length)return[];var d=Math.ceil(9e4*(b.currentTime()-c+3)),e=void 0;for(e=0;e<a.length&&!(a[e].pts>d);e++);return a.slice(e)},Tk=function(a,b,c){if(!b.length)return a;if(c)return b.slice();var d=b[0].pts,e=0;for(e;e<a.length&&!(a[e].pts>=d);e++);return a.slice(0,e).concat(b)},Uk=function(a,b,c,d){for(var e=Math.ceil(9e4*(b-d)),f=Math.ceil(9e4*(c-d)),g=a.slice(),h=a.length;h--&&!(a[h].pts<=f););if(-1===h)return g;for(var i=h+1;i--&&!(a[i].pts<=e););return i=Math.max(i,0),g.splice(i,h-i+1),g},Vk=function(a){function b(c,d){Ib(this,b);var e=Kb(this,a.call(this,kb.EventTarget));e.timestampOffset_=0,e.pendingBuffers_=[],e.bufferUpdating_=!1,e.mediaSource_=c,e.codecs_=d,e.audioCodec_=null,e.videoCodec_=null,e.audioDisabled_=!1,e.appendAudioInitSegment_=!0,e.gopBuffer_=[],e.timeMapping_=0,e.safeAppend_=kb.browser.IE_VERSION>=11;var f={remux:!1,alignGopsAtEnd:e.safeAppend_};return e.codecs_.forEach(function(a){Nk(a)?e.audioCodec_=a:Ok(a)&&(e.videoCodec_=a)}),e.transmuxer_=new Mk,e.transmuxer_.postMessage({action:"init",options:f}),e.transmuxer_.onmessage=function(a){return"data"===a.data.action?e.data_(a):"done"===a.data.action?e.done_(a):"gopInfo"===a.data.action?e.appendGopInfo_(a):void 0},Object.defineProperty(e,"timestampOffset",{get:function(){return this.timestampOffset_},set:function(a){"number"==typeof a&&a>=0&&(this.timestampOffset_=a,this.appendAudioInitSegment_=!0,this.gopBuffer_.length=0,this.timeMapping_=0,this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:a}))}}),Object.defineProperty(e,"appendWindowStart",{get:function(){return(this.videoBuffer_||this.audioBuffer_).appendWindowStart},set:function(a){this.videoBuffer_&&(this.videoBuffer_.appendWindowStart=a),this.audioBuffer_&&(this.audioBuffer_.appendWindowStart=a)}}),Object.defineProperty(e,"updating",{get:function(){return!!(this.bufferUpdating_||!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.updating||this.videoBuffer_&&this.videoBuffer_.updating)}}),Object.defineProperty(e,"buffered",{get:function(){var a=null,b=null,c=0,d=[],e=[];if(!this.videoBuffer_&&!this.audioBuffer_)return kb.createTimeRange();if(!this.videoBuffer_)return this.audioBuffer_.buffered;if(!this.audioBuffer_)return this.videoBuffer_.buffered;if(this.audioDisabled_)return this.videoBuffer_.buffered;if(0===this.videoBuffer_.buffered.length&&0===this.audioBuffer_.buffered.length)return kb.createTimeRange();for(var f=this.videoBuffer_.buffered,g=this.audioBuffer_.buffered,h=f.length;h--;)d.push({time:f.start(h),type:"start"}),d.push({time:f.end(h),type:"end"});for(h=g.length;h--;)d.push({time:g.start(h),type:"start"}),d.push({time:g.end(h),type:"end"});for(d.sort(function(a,b){return a.time-b.time}),h=0;h<d.length;h++)"start"===d[h].type?(c++,2===c&&(a=d[h].time)):"end"===d[h].type&&(c--,1===c&&(b=d[h].time)),null!==a&&null!==b&&(e.push([a,b]),a=null,b=null);return kb.createTimeRanges(e)}}),e}return Jb(b,a),b.prototype.data_=function(a){var b=a.data.segment;b.data=new Uint8Array(b.data,a.data.byteOffset,a.data.byteLength),b.initSegment=new Uint8Array(b.initSegment.data,b.initSegment.byteOffset,b.initSegment.byteLength),xk(this,this.mediaSource_,b),this.pendingBuffers_.push(b)},b.prototype.done_=function(a){return"closed"===this.mediaSource_.readyState?void(this.pendingBuffers_.length=0):void this.processPendingSegments_()},b.prototype.createRealSourceBuffers_=function(){var a=this,b=["audio","video"];b.forEach(function(c){if(a[c+"Codec_"]&&!a[c+"Buffer_"]){var d=null;if(a.mediaSource_[c+"Buffer_"])d=a.mediaSource_[c+"Buffer_"],d.updating=!1;else{var e=c+"Codec_",f=c+'/mp4;codecs="'+a[e]+'"';d=Rk(a.mediaSource_.nativeMediaSource_,f),a.mediaSource_[c+"Buffer_"]=d}a[c+"Buffer_"]=d,["update","updatestart","updateend"].forEach(function(e){d.addEventListener(e,function(){if("audio"!==c||!a.audioDisabled_){"updateend"===e&&(a[c+"Buffer_"].updating=!1);var d=b.every(function(b){return"audio"===b&&a.audioDisabled_?!0:c!==b&&a[b+"Buffer_"]&&a[b+"Buffer_"].updating?!1:!0});return d?a.trigger(e):void 0}})})}})},b.prototype.appendBuffer=function(a){if(this.bufferUpdating_=!0,this.audioBuffer_&&this.audioBuffer_.buffered.length){var b=this.audioBuffer_.buffered;this.transmuxer_.postMessage({action:"setAudioAppendStart",appendStart:b.end(b.length-1)})}this.videoBuffer_&&this.transmuxer_.postMessage({action:"alignGopsWith",gopsToAlignWith:Sk(this.gopBuffer_,this.mediaSource_.player_,this.timeMapping_)}),this.transmuxer_.postMessage({action:"push",data:a.buffer,byteOffset:a.byteOffset,byteLength:a.byteLength},[a.buffer]),this.transmuxer_.postMessage({action:"flush"})},b.prototype.appendGopInfo_=function(a){this.gopBuffer_=Tk(this.gopBuffer_,a.data.gopInfo,this.safeAppend_)},b.prototype.remove=function(a,b){if(this.videoBuffer_&&(this.videoBuffer_.updating=!0,this.videoBuffer_.remove(a,b),this.gopBuffer_=Uk(this.gopBuffer_,a,b,this.timeMapping_)),!this.audioDisabled_&&this.audioBuffer_&&(this.audioBuffer_.updating=!0,this.audioBuffer_.remove(a,b)),yk(a,b,this.metadataTrack_),this.inbandTextTracks_)for(var c in this.inbandTextTracks_)yk(a,b,this.inbandTextTracks_[c])},b.prototype.processPendingSegments_=function(){var a={video:{segments:[],bytes:0},audio:{segments:[],bytes:0},captions:[],metadata:[]};a=this.pendingBuffers_.reduce(function(a,b){var c=b.type,d=b.data,e=b.initSegment;return a[c].segments.push(d),a[c].bytes+=d.byteLength,a[c].initSegment=e,b.captions&&(a.captions=a.captions.concat(b.captions)),b.info&&(a[c].info=b.info),b.metadata&&(a.metadata=a.metadata.concat(b.metadata)),a},a),this.videoBuffer_||this.audioBuffer_||(0===a.video.bytes&&(this.videoCodec_=null),0===a.audio.bytes&&(this.audioCodec_=null),this.createRealSourceBuffers_()),a.audio.info&&this.mediaSource_.trigger({type:"audioinfo",info:a.audio.info}),a.video.info&&this.mediaSource_.trigger({type:"videoinfo",info:a.video.info}),this.appendAudioInitSegment_&&(!this.audioDisabled_&&this.audioBuffer_&&(a.audio.segments.unshift(a.audio.initSegment),a.audio.bytes+=a.audio.initSegment.byteLength),this.appendAudioInitSegment_=!1);var b=!1;this.videoBuffer_&&a.video.bytes?(a.video.segments.unshift(a.video.initSegment),a.video.bytes+=a.video.initSegment.byteLength,this.concatAndAppendSegments_(a.video,this.videoBuffer_),Bk(this,a.captions,a.metadata)):!this.videoBuffer_||!this.audioDisabled_&&this.audioBuffer_||(b=!0),!this.audioDisabled_&&this.audioBuffer_&&this.concatAndAppendSegments_(a.audio,this.audioBuffer_),this.pendingBuffers_.length=0,b&&this.trigger("updateend"),this.bufferUpdating_=!1},b.prototype.concatAndAppendSegments_=function(a,b){var c=0,d=void 0;if(a.bytes){d=new Uint8Array(a.bytes),a.segments.forEach(function(a){d.set(a,c),c+=a.byteLength});try{b.updating=!0,b.appendBuffer(d)}catch(e){this.mediaSource_.player_&&this.mediaSource_.player_.error({code:-3,type:"APPEND_BUFFER_ERR",message:e.message,originalError:e})}}},b.prototype.abort=function(){this.videoBuffer_&&this.videoBuffer_.abort(),!this.audioDisabled_&&this.audioBuffer_&&this.audioBuffer_.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"reset"}),this.pendingBuffers_.length=0,this.bufferUpdating_=!1},b}(kb.EventTarget),Wk=function(a){function b(){Ib(this,b);var c=Kb(this,a.call(this)),d=void 0;c.nativeMediaSource_=new vb.MediaSource;for(d in c.nativeMediaSource_)d in b.prototype||"function"!=typeof c.nativeMediaSource_[d]||(c[d]=c.nativeMediaSource_[d].bind(c.nativeMediaSource_));return c.duration_=NaN,Object.defineProperty(c,"duration",{get:function(){return this.duration_===1/0?this.duration_:this.nativeMediaSource_.duration},set:function(a){return this.duration_=a,a!==1/0?void(this.nativeMediaSource_.duration=a):void 0}}),Object.defineProperty(c,"seekable",{get:function(){return this.duration_===1/0?kb.createTimeRanges([[0,this.nativeMediaSource_.duration]]):this.nativeMediaSource_.seekable}}),Object.defineProperty(c,"readyState",{get:function(){return this.nativeMediaSource_.readyState}}),Object.defineProperty(c,"activeSourceBuffers",{get:function(){return this.activeSourceBuffers_}}),c.sourceBuffers=[],c.activeSourceBuffers_=[],c.updateActiveSourceBuffers_=function(){if(c.activeSourceBuffers_.length=0,1===c.sourceBuffers.length){var a=c.sourceBuffers[0];return a.appendAudioInitSegment_=!0,a.audioDisabled_=!a.audioCodec_,void c.activeSourceBuffers_.push(a)}for(var b=!1,d=!0,e=0;e<c.player_.audioTracks().length;e++){var f=c.player_.audioTracks()[e];if(f.enabled&&"main"!==f.kind){b=!0,d=!1;break}}c.sourceBuffers.forEach(function(a,e){if(a.appendAudioInitSegment_=!0,a.videoCodec_&&a.audioCodec_)a.audioDisabled_=b;else if(a.videoCodec_&&!a.audioCodec_)a.audioDisabled_=!0,d=!1;else if(!a.videoCodec_&&a.audioCodec_&&(a.audioDisabled_=e?d:!d,a.audioDisabled_))return;c.activeSourceBuffers_.push(a)})},c.onPlayerMediachange_=function(){c.sourceBuffers.forEach(function(a){a.appendAudioInitSegment_=!0})},c.onHlsReset_=function(){c.sourceBuffers.forEach(function(a){a.transmuxer_&&a.transmuxer_.postMessage({action:"resetCaptions"})})},c.onHlsSegmentTimeMapping_=function(a){c.sourceBuffers.forEach(function(b){return b.timeMapping_=a.mapping})},["sourceopen","sourceclose","sourceended"].forEach(function(a){this.nativeMediaSource_.addEventListener(a,this.trigger.bind(this))},c),c.on("sourceopen",function(a){var b=Ab.querySelector('[src="'+c.url_+'"]');b&&(c.player_=kb(b.parentNode),c.player_.tech_.on("hls-reset",c.onHlsReset_),c.player_.tech_.on("hls-segment-time-mapping",c.onHlsSegmentTimeMapping_),c.player_.audioTracks&&c.player_.audioTracks()&&(c.player_.audioTracks().on("change",c.updateActiveSourceBuffers_),c.player_.audioTracks().on("addtrack",c.updateActiveSourceBuffers_),c.player_.audioTracks().on("removetrack",c.updateActiveSourceBuffers_)),c.player_.on("mediachange",c.onPlayerMediachange_))}),c.on("sourceended",function(a){for(var b=Ak(c.duration),d=0;d<c.sourceBuffers.length;d++){var e=c.sourceBuffers[d],f=e.metadataTrack_&&e.metadataTrack_.cues;f&&f.length&&(f[f.length-1].endTime=b)}}),c.on("sourceclose",function(a){this.sourceBuffers.forEach(function(a){a.transmuxer_&&a.transmuxer_.terminate()}),this.sourceBuffers.length=0,this.player_&&(this.player_.audioTracks&&this.player_.audioTracks()&&(this.player_.audioTracks().off("change",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("addtrack",this.updateActiveSourceBuffers_),this.player_.audioTracks().off("removetrack",this.updateActiveSourceBuffers_)),this.player_.el_&&(this.player_.off("mediachange",this.onPlayerMediachange_),this.player_.tech_.off("hls-reset",this.onHlsReset_),this.player_.tech_.off("hls-segment-time-mapping",this.onHlsSegmentTimeMapping_)))}),c}return Jb(b,a),b.prototype.addSeekableRange_=function(a,b){var c=void 0;if(this.duration!==1/0)throw c=new Error("MediaSource.addSeekableRange() can only be invoked when the duration is Infinity"),c.name="InvalidStateError",c.code=11,c;(b>this.nativeMediaSource_.duration||isNaN(this.nativeMediaSource_.duration))&&(this.nativeMediaSource_.duration=b)},b.prototype.addSourceBuffer=function(a){var b=void 0,c=Pk(a);if(/^(video|audio)\/mp2t$/i.test(c.type)){var d=[];c.parameters&&c.parameters.codecs&&(d=c.parameters.codecs.split(","),d=Qk(d),d=d.filter(function(a){return Nk(a)||Ok(a)})),0===d.length&&(d=["avc1.4d400d","mp4a.40.2"]),b=new Vk(this,d),0!==this.sourceBuffers.length&&(this.sourceBuffers[0].createRealSourceBuffers_(),b.createRealSourceBuffers_(),this.sourceBuffers[0].audioDisabled_=!0)}else b=this.nativeMediaSource_.addSourceBuffer(a);return this.sourceBuffers.push(b),b},b}(kb.EventTarget),Xk=0;kb.mediaSources={};var Yk=function(a,b){var c=kb.mediaSources[a];if(!c)throw new Error("Media Source not found (Video.js)");c.trigger({type:"sourceopen",swfId:b})},Zk=function(){return!!vb.MediaSource&&!!vb.MediaSource.isTypeSupported&&vb.MediaSource.isTypeSupported('video/mp4;codecs="avc1.4d400d,mp4a.40.2"')},$k=function(){if(this.MediaSource={open:Yk,supportsNativeMediaSources:Zk},Zk())return new Wk;throw new Error("Cannot use create a virtual MediaSource for this video")};$k.open=Yk,$k.supportsNativeMediaSources=Zk;var _k={createObjectURL:function(a){var b="blob:vjs-media-source/",c=void 0;return a instanceof Wk?(c=vb.URL.createObjectURL(a.nativeMediaSource_),a.url_=c,c):a instanceof Wk?(c=b+Xk,Xk++,kb.mediaSources[c]=a,c):(c=vb.URL.createObjectURL(a),a.url_=c,c)}};kb.MediaSource=$k,kb.URL=_k;var al=kb.EventTarget,bl=kb.mergeOptions,cl=function(a,b){for(var c=bl(a,{duration:b.duration,minimumUpdatePeriod:b.minimumUpdatePeriod}),d=0;d<b.playlists.length;d++){var e=Bj(c,b.playlists[d]);e&&(c=e)}return yj(b,function(a,b,d,e){if(a.playlists&&a.playlists.length){var f=a.playlists[0].uri,g=Bj(c,a.playlists[0]);g&&(c=g,c.mediaGroups[b][d][e].playlists[0]=c.playlists[f])}}),c},dl=function(a){function b(c,d,e,f){Ib(this,b);var g=Kb(this,a.call(this));if(g.hls_=d,g.withCredentials=e,!c)throw new Error("A non-empty playlist URL or playlist is required");return g.on("minimumUpdatePeriod",function(){g.refreshXml_()}),g.on("mediaupdatetimeout",function(){g.refreshMedia_()}),"string"==typeof c?(g.srcUrl=c,g.state="HAVE_NOTHING",Kb(g)):(g.masterPlaylistLoader_=f,g.state="HAVE_METADATA",g.started=!0,g.media(c),vb.setTimeout(function(){g.trigger("loadedmetadata")},0),g)}return Jb(b,a),b.prototype.dispose=function(){this.stopRequest(),vb.clearTimeout(this.mediaUpdateTimeout)},b.prototype.stopRequest=function(){if(this.request){var a=this.request;this.request=null,a.onreadystatechange=null,a.abort()}},b.prototype.media=function(a){if(!a)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var b=this.state;if("string"==typeof a){if(!this.master.playlists[a])throw new Error("Unknown playlist URI: "+a);a=this.master.playlists[a]}var c=!this.media_||a.uri!==this.media_.uri;this.state="HAVE_METADATA",c&&(this.media_&&this.trigger("mediachanging"),this.media_=a,this.refreshMedia_(),"HAVE_MASTER"!==b&&this.trigger("mediachange"))},b.prototype.pause=function(){this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1)},b.prototype.load=function(){return this.started?void this.trigger("loadedplaylist"):void this.start()},b.prototype.parseMasterXml=function(){var a=Lh(this.masterXml_,{manifestUri:this.srcUrl,clientOffset:this.clientOffset_});a.uri=this.srcUrl;for(var b=0;b<a.playlists.length;b++){var c="placeholder-uri-"+b;a.playlists[b].uri=c,a.playlists[c]=a.playlists[b]}return yj(a,function(b,c,d,e){if(b.playlists&&b.playlists.length){var f="placeholder-uri-"+c+"-"+d+"-"+e;b.playlists[0].uri=f,a.playlists[f]=b.playlists[0]}}),Cj(a),Dj(a),a},b.prototype.start=function(){var a=this;this.started=!0,this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials
- },function(b,c){if(a.request){if(a.request=null,b)return a.error={status:c.status,message:"DASH playlist request error at URL: "+a.srcUrl,responseText:c.responseText,code:2},"HAVE_NOTHING"===a.state&&(a.started=!1),a.trigger("error");a.masterXml_=c.responseText,c.responseHeaders&&c.responseHeaders.date?a.masterLoaded_=Date.parse(c.responseHeaders.date):a.masterLoaded_=Date.now(),a.syncClientServerClock_(a.onClientServerClockSync_.bind(a))}})},b.prototype.syncClientServerClock_=function(a){var b=this,c=Mh(this.masterXml_);return null===c?(this.clientOffset_=this.masterLoaded_-Date.now(),a()):"DIRECT"===c.method?(this.clientOffset_=c.value-Date.now(),a()):void(this.request=this.hls_.xhr({uri:uj(this.srcUrl,c.value),method:c.method,withCredentials:this.withCredentials},function(d,e){if(b.request){if(d)return b.clientOffset_=b.masterLoaded_-Date.now(),a();var f=void 0;f="HEAD"===c.method?e.responseHeaders&&e.responseHeaders.date?Date.parse(e.responseHeaders.date):b.masterLoaded_:Date.parse(e.responseText),b.clientOffset_=f-Date.now(),a()}}))},b.prototype.onClientServerClockSync_=function(){var a=this;this.master=this.parseMasterXml(),this.state="HAVE_MASTER",this.trigger("loadedplaylist"),this.media_||this.media(this.master.playlists[0]),vb.setTimeout(function(){a.trigger("loadedmetadata")},0),this.master.minimumUpdatePeriod&&vb.setTimeout(function(){a.trigger("minimumUpdatePeriod")},this.master.minimumUpdatePeriod)},b.prototype.refreshXml_=function(){var a=this;this.request=this.hls_.xhr({uri:this.srcUrl,withCredentials:this.withCredentials},function(b,c){if(a.request){if(a.request=null,b)return a.error={status:c.status,message:"DASH playlist request error at URL: "+a.srcUrl,responseText:c.responseText,code:2},"HAVE_NOTHING"===a.state&&(a.started=!1),a.trigger("error");a.masterXml_=c.responseText;var d=a.parseMasterXml();a.master=cl(a.master,d),vb.setTimeout(function(){a.trigger("minimumUpdatePeriod")},a.master.minimumUpdatePeriod)}})},b.prototype.refreshMedia_=function(){var a=this,b=void 0,c=void 0;this.masterPlaylistLoader_?(b=this.masterPlaylistLoader_.master,c=this.masterPlaylistLoader_.parseMasterXml()):(b=this.master,c=this.parseMasterXml());var d=cl(b,c);d?(this.masterPlaylistLoader_?this.masterPlaylistLoader_.master=d:this.master=d,this.media_=d.playlists[this.media_.uri]):this.trigger("playlistunchanged"),this.media().endList||(this.mediaUpdateTimeout=vb.setTimeout(function(){a.trigger("mediaupdatetimeout")},Ej(this.media(),!!d))),this.trigger("loadedplaylist")},b}(al),el=function(a){return kb.log.debug?kb.log.debug.bind(kb,"VHS:",a+" >"):function(){}},fl=function(){function a(b,c,d,e){Ib(this,a),this.callbacks_=[],this.pendingCallback_=null,this.timestampOffset_=0,this.mediaSource=b,this.processedAppend_=!1,this.type_=d,this.mimeType_=c,this.logger_=el("SourceUpdater["+d+"]["+c+"]"),"closed"===b.readyState?b.addEventListener("sourceopen",this.createSourceBuffer_.bind(this,c,e)):this.createSourceBuffer_(c,e)}return a.prototype.createSourceBuffer_=function(a,b){var c=this;return this.sourceBuffer_=this.mediaSource.addSourceBuffer(a),this.logger_("created SourceBuffer"),b&&(b.trigger("sourcebufferadded"),this.mediaSource.sourceBuffers.length<2)?void b.on("sourcebufferadded",function(){c.start_()}):void this.start_()},a.prototype.start_=function(){var a=this;this.started_=!0,this.onUpdateendCallback_=function(){var b=a.pendingCallback_;a.pendingCallback_=null,a.logger_("buffered ["+uk(a.buffered())+"]"),b&&b(),a.runCallback_()},this.sourceBuffer_.addEventListener("updateend",this.onUpdateendCallback_),this.runCallback_()},a.prototype.abort=function(a){var b=this;this.processedAppend_&&this.queueCallback_(function(){b.sourceBuffer_.abort()},a)},a.prototype.appendBuffer=function(a,b){var c=this;this.processedAppend_=!0,this.queueCallback_(function(){c.sourceBuffer_.appendBuffer(a)},b)},a.prototype.buffered=function(){return this.sourceBuffer_?this.sourceBuffer_.buffered:kb.createTimeRanges()},a.prototype.remove=function(a,b){var c=this;this.processedAppend_&&this.queueCallback_(function(){c.logger_("remove ["+a+" => "+b+"]"),c.sourceBuffer_.remove(a,b)},qb)},a.prototype.updating=function(){return!this.sourceBuffer_||this.sourceBuffer_.updating||this.pendingCallback_},a.prototype.timestampOffset=function(a){var b=this;return"undefined"!=typeof a&&(this.queueCallback_(function(){b.sourceBuffer_.timestampOffset=a}),this.timestampOffset_=a),this.timestampOffset_},a.prototype.queueCallback_=function(a,b){this.callbacks_.push([a.bind(this),b]),this.runCallback_()},a.prototype.runCallback_=function(){var a=void 0;!this.updating()&&this.callbacks_.length&&this.started_&&(a=this.callbacks_.shift(),this.pendingCallback_=a[1],a[0]())},a.prototype.dispose=function(){this.sourceBuffer_.removeEventListener("updateend",this.onUpdateendCallback_),this.sourceBuffer_&&"open"===this.mediaSource.readyState&&this.sourceBuffer_.abort()},a}(),gl={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,GOAL_BUFFER_LENGTH_RATE:1,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,BUFFER_LOW_WATER_LINE_RATE:1},hl={FAILURE:2,TIMEOUT:-101,ABORTED:-102},il=function(a){var b=void 0,c=void 0;return c=a.offset+a.length-1,b=a.offset,"bytes="+b+"-"+c},jl=function(a){var b={};return a.byterange&&(b.Range=il(a.byterange)),b},kl=function(a){a.forEach(function(a){a.abort()})},ll=function(a){return{bandwidth:a.bandwidth,bytesReceived:a.bytesReceived||0,roundTripTime:a.roundTripTime||0}},ml=function(a){var b=a.target,c=Date.now()-b.requestTime,d={bandwidth:1/0,bytesReceived:0,roundTripTime:c||0};return d.bytesReceived=a.loaded,d.bandwidth=Math.floor(d.bytesReceived/d.roundTripTime*8*1e3),d},nl=function(a,b){return b.timedout?{status:b.status,message:"HLS request timed-out at URL: "+b.uri,code:hl.TIMEOUT,xhr:b}:b.aborted?{status:b.status,message:"HLS request aborted at URL: "+b.uri,code:hl.ABORTED,xhr:b}:a?{status:b.status,message:"HLS request errored at URL: "+b.uri,code:hl.FAILURE,xhr:b}:null},ol=function(a,b){return function(c,d){var e=d.response,f=nl(c,d);if(f)return b(f,a);if(16!==e.byteLength)return b({status:d.status,message:"Invalid HLS key at URL: "+d.uri,code:hl.FAILURE,xhr:d},a);var g=new DataView(e);return a.key.bytes=new Uint32Array([g.getUint32(0),g.getUint32(4),g.getUint32(8),g.getUint32(12)]),b(null,a)}},pl=function(a,b){return function(c,d){var e=d.response,f=nl(c,d);return f?b(f,a):0===e.byteLength?b({status:d.status,message:"Empty HLS segment content at URL: "+d.uri,code:hl.FAILURE,xhr:d},a):(a.map.bytes=new Uint8Array(d.response),b(null,a))}},ql=function(a,b){return function(c,d){var e=d.response,f=nl(c,d);return f?b(f,a):0===e.byteLength?b({status:d.status,message:"Empty HLS segment content at URL: "+d.uri,code:hl.FAILURE,xhr:d},a):(a.stats=ll(d),a.key?a.encryptedBytes=new Uint8Array(d.response):a.bytes=new Uint8Array(d.response),b(null,a))}},rl=function(a,b,c){var d=function e(d){if(d.data.source===b.requestId){a.removeEventListener("message",e);var f=d.data.decrypted;return b.bytes=new Uint8Array(f.bytes,f.byteOffset,f.byteLength),c(null,b)}};a.addEventListener("message",d),a.postMessage(ik({source:b.requestId,encrypted:b.encryptedBytes,key:b.key.bytes,iv:b.key.iv}),[b.encryptedBytes.buffer,b.key.bytes.buffer])},sl=function(a){return a.reduce(function(a,b){return b.code>a.code?b:a})},tl=function(a,b,c){var d=[],e=0;return function(f,g){if(f&&(kl(a),d.push(f)),e+=1,e===a.length){if(g.endOfAllRequests=Date.now(),d.length>0){var h=sl(d);return c(h,g)}return g.encryptedBytes?rl(b,g,c):c(null,g)}}},ul=function(a,b){return function(c){return a.stats=kb.mergeOptions(a.stats,ml(c)),!a.stats.firstBytesReceivedAt&&a.stats.bytesReceived&&(a.stats.firstBytesReceivedAt=Date.now()),b(c,a)}},vl=function(a,b,c,d,e,f){var g=[],h=tl(g,c,f);if(d.key){var i=kb.mergeOptions(b,{uri:d.key.resolvedUri,responseType:"arraybuffer"}),j=ol(d,h),k=a(i,j);g.push(k)}if(d.map&&!d.map.bytes){var l=kb.mergeOptions(b,{uri:d.map.resolvedUri,responseType:"arraybuffer",headers:jl(d.map)}),m=pl(d,h),n=a(l,m);g.push(n)}var o=kb.mergeOptions(b,{uri:d.resolvedUri,responseType:"arraybuffer",headers:jl(d)}),p=ql(d,h),q=a(o,p);return q.addEventListener("progress",ul(d,e)),g.push(q),function(){return kl(g)}},wl={videoCodec:"avc1",videoObjectTypeIndicator:".4d400d",audioProfile:"2"},xl=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",b={codecCount:0},c=void 0;return b.codecCount=a.split(",").length,b.codecCount=b.codecCount||2,c=/(^|\s|,)+(avc[13])([^ ,]*)/i.exec(a),c&&(b.videoCodec=c[2],b.videoObjectTypeIndicator=c[3]),b.audioProfile=/(^|\s|,)+mp4a.[0-9A-Fa-f]+\.([0-9A-Fa-f]+)/i.exec(a),b.audioProfile=b.audioProfile&&b.audioProfile[2],b},yl=function(a){return a.replace(/avc1\.(\d+)\.(\d+)/i,function(a){return Qk([a])[0]})},zl=function(a,b,c){return a+"/"+b+'; codecs="'+c.filter(function(a){return!!a}).join(", ")+'"'},Al=function(a){return a.segments&&a.segments.length&&a.segments[0].map?"mp4":"mp2t"},Bl=function(a){var b=a.attributes||{};return b.CODECS?xl(b.CODECS):wl},Cl=function(a,b){if(!a.mediaGroups.AUDIO||!b)return null;var c=a.mediaGroups.AUDIO[b];if(!c)return null;for(var d in c){var e=c[d];if(e["default"]&&e.playlists)return xl(e.playlists[0].attributes.CODECS).audioProfile}return null},Dl=function(a,b){var c=Al(b),d=Bl(b),e=b.attributes||{},f=!0,g=!1;if(!b)return[];if(a.mediaGroups.AUDIO&&e.AUDIO){var h=a.mediaGroups.AUDIO[e.AUDIO];if(h){g=!0,f=!1;for(var i in h)if(!h[i].uri&&!h[i].playlists){f=!0;break}}}g&&!d.audioProfile&&(f||(d.audioProfile=Cl(a,e.AUDIO)),d.audioProfile||(kb.log.warn("Multiple audio tracks present but no audio codec string is specified. Attempting to use the default audio codec (mp4a.40.2)"),d.audioProfile=wl.audioProfile));var j={};d.videoCodec&&(j.video=""+d.videoCodec+d.videoObjectTypeIndicator),d.audioProfile&&(j.audio="mp4a.40."+d.audioProfile);var k=zl("audio",c,[j.audio]),l=zl("video",c,[j.video]),m=zl("video",c,[j.video,j.audio]);return g?!f&&j.video?[l,k]:f||j.video?[m,k]:[k,k]:j.video?[m]:[k]},El=function(a,b){var c=void 0;return a?(c=vb.getComputedStyle(a),c?c[b]:""):""},Fl=function(a,b){var c=a.slice();a.sort(function(a,d){var e=b(a,d);return 0===e?c.indexOf(a)-c.indexOf(d):e})},Gl=function(a,b){var c=void 0,d=void 0;return a.attributes.BANDWIDTH&&(c=a.attributes.BANDWIDTH),c=c||vb.Number.MAX_VALUE,b.attributes.BANDWIDTH&&(d=b.attributes.BANDWIDTH),d=d||vb.Number.MAX_VALUE,c-d},Hl=function(a,b){var c=void 0,d=void 0;return a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width&&(c=a.attributes.RESOLUTION.width),c=c||vb.Number.MAX_VALUE,b.attributes.RESOLUTION&&b.attributes.RESOLUTION.width&&(d=b.attributes.RESOLUTION.width),d=d||vb.Number.MAX_VALUE,c===d&&a.attributes.BANDWIDTH&&b.attributes.BANDWIDTH?a.attributes.BANDWIDTH-b.attributes.BANDWIDTH:c-d},Il=function(a,b,c,d){var e=a.playlists.map(function(a){var b=void 0,c=void 0,d=void 0;return b=a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width,c=a.attributes.RESOLUTION&&a.attributes.RESOLUTION.height,d=a.attributes.BANDWIDTH,d=d||vb.Number.MAX_VALUE,{bandwidth:d,width:b,height:c,playlist:a}});Fl(e,function(a,b){return a.bandwidth-b.bandwidth}),e=e.filter(function(a){return!bk.isIncompatible(a.playlist)});var f=e.filter(function(a){return bk.isEnabled(a.playlist)});f.length||(f=e.filter(function(a){return!bk.isDisabled(a.playlist)}));var g=f.filter(function(a){return a.bandwidth*gl.BANDWIDTH_VARIANCE<b}),h=g[g.length-1],i=g.filter(function(a){return a.bandwidth===h.bandwidth})[0],j=g.filter(function(a){return a.width&&a.height});Fl(j,function(a,b){return a.width-b.width});var k=j.filter(function(a){return a.width===c&&a.height===d});h=k[k.length-1];var l=k.filter(function(a){return a.bandwidth===h.bandwidth})[0],m=void 0,n=void 0,o=void 0;l||(m=j.filter(function(a){return a.width>c||a.height>d}),n=m.filter(function(a){return a.width===m[0].width&&a.height===m[0].height}),h=n[n.length-1],o=n.filter(function(a){return a.bandwidth===h.bandwidth})[0]);var p=o||l||i||f[0]||e[0];return p?p.playlist:null},Jl=function(){return Il(this.playlists.master,this.systemBandwidth,parseInt(El(this.tech_.el(),"width"),10),parseInt(El(this.tech_.el(),"height"),10))},Kl=function(a){var b=a.master,c=a.currentTime,d=a.bandwidth,e=a.duration,f=a.segmentDuration,g=a.timeUntilRebuffer,h=a.currentTimeline,i=a.syncController,j=b.playlists.filter(function(a){return!bk.isIncompatible(a)}),k=j.filter(bk.isEnabled);k.length||(k=j.filter(function(a){return!bk.isDisabled(a)}));var l=k.filter(bk.hasAttribute.bind(null,"BANDWIDTH")),m=l.map(function(a){var b=i.getSyncPoint(a,e,h,c),j=b?1:2,k=bk.estimateSegmentRequestTime(f,d,a),l=k*j-g;return{playlist:a,rebufferingImpact:l}}),n=m.filter(function(a){return a.rebufferingImpact<=0});return Fl(n,function(a,b){return Gl(b.playlist,a.playlist)}),n.length?n[0]:(Fl(m,function(a,b){return a.rebufferingImpact-b.rebufferingImpact}),m[0]||null)},Ll=function(){var a=this.playlists.master.playlists.filter(bk.isEnabled);Fl(a,function(a,b){return Gl(a,b)});var b=a.filter(function(a){return xl(a.attributes.CODECS).videoCodec});return b[0]||null},Ml=500,Nl=function(a,b,c){if(!a||!b)return!1;var d=a.segments,e=c===d.length;return a.endList&&"open"===b.readyState&&e},Ol=function(a){return"number"==typeof a&&isFinite(a)},Pl=function(a,b,c){return"main"===a&&b&&c?c.containsAudio||c.containsVideo?b.containsVideo&&!c.containsVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!b.containsVideo&&c.containsVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null},Ql=function(a,b,c){var d=void 0;return d=a.length&&a.start(0)>0&&a.start(0)<b?a.start(0):b-30,Math.min(d,b-c)},Rl=function(a){var b=a.segment,c=b.start,d=b.end,e=a.playlist,f=e.mediaSequence,g=e.id,h=e.segments,i=void 0===h?[]:h,j=a.mediaIndex,k=a.timeline;return["appending ["+j+"] of ["+f+", "+(f+i.length)+"] from playlist ["+g+"]","["+c+" => "+d+"] in timeline ["+k+"]"].join(" ")},Sl=function(a){function b(c){Ib(this,b);var d=Kb(this,a.call(this));if(!c)throw new TypeError("Initialization settings are required");if("function"!=typeof c.currentTime)throw new TypeError("No currentTime getter specified");if(!c.mediaSource)throw new TypeError("No MediaSource specified");return d.bandwidth=c.bandwidth,d.throughput={rate:0,count:0},d.roundTrip=NaN,d.resetStats_(),d.mediaIndex=null,d.hasPlayed_=c.hasPlayed,d.currentTime_=c.currentTime,d.seekable_=c.seekable,d.seeking_=c.seeking,d.duration_=c.duration,d.mediaSource_=c.mediaSource,d.hls_=c.hls,d.loaderType_=c.loaderType,d.startingMedia_=void 0,d.segmentMetadataTrack_=c.segmentMetadataTrack,d.goalBufferLength_=c.goalBufferLength,d.sourceType_=c.sourceType,d.state_="INIT",d.checkBufferTimeout_=null,d.error_=void 0,d.currentTimeline_=-1,d.pendingSegment_=null,d.mimeType_=null,d.sourceUpdater_=null,d.xhrOptions_=null,d.activeInitSegmentId_=null,d.initSegments_={},d.decrypter_=c.decrypter,d.syncController_=c.syncController,d.syncPoint_={segmentIndex:0,time:0},d.syncController_.on("syncinfoupdate",function(){return d.trigger("syncinfoupdate")}),d.mediaSource_.addEventListener("sourceopen",function(){return d.ended_=!1}),d.fetchAtBuffer_=!1,d.logger_=el("SegmentLoader["+d.loaderType_+"]"),Object.defineProperty(d,"state",{get:function(){return this.state_},set:function(a){a!==this.state_&&(this.logger_(this.state_+" -> "+a),this.state_=a)}}),d}return Jb(b,a),b.prototype.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0},b.prototype.dispose=function(){this.state="DISPOSED",this.pause(),this.abort_(),this.sourceUpdater_&&this.sourceUpdater_.dispose(),this.resetStats_()},b.prototype.abort=function(){return"WAITING"!==this.state?void(this.pendingSegment_&&(this.pendingSegment_=null)):(this.abort_(),this.state="READY",void(this.paused()||this.monitorBuffer_()))},b.prototype.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null},b.prototype.error=function(a){return"undefined"!=typeof a&&(this.error_=a),this.pendingSegment_=null,this.error_},b.prototype.endOfStream=function(){this.ended_=!0,this.pause(),this.trigger("ended")},b.prototype.buffered_=function(){return this.sourceUpdater_?this.sourceUpdater_.buffered():kb.createTimeRanges()},b.prototype.initSegment=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!1;if(!a)return null;var c=jk(a),d=this.initSegments_[c];return b&&!d&&a.bytes&&(this.initSegments_[c]=d={resolvedUri:a.resolvedUri,byterange:a.byterange,bytes:a.bytes}),d||a},b.prototype.couldBeginLoading_=function(){return this.playlist_&&(this.sourceUpdater_||this.mimeType_&&"INIT"===this.state)&&!this.paused()},b.prototype.load=function(){return this.monitorBuffer_(),this.playlist_?(this.syncController_.setDateTimeMapping(this.playlist_),"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))):void 0},b.prototype.init_=function(){return this.state="READY",this.sourceUpdater_=new fl(this.mediaSource_,this.mimeType_,this.loaderType_,this.sourceBufferEmitter_),this.resetEverything(),this.monitorBuffer_()},b.prototype.playlist=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(a){var c=this.playlist_,d=this.pendingSegment_;this.playlist_=a,this.xhrOptions_=b,this.hasPlayed_()||(a.syncInfo={mediaSequence:a.mediaSequence,time:0});var e=c?c.id:null;if(this.logger_("playlist update ["+e+" => "+a.id+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!c||c.uri!==a.uri)return void(null!==this.mediaIndex&&this.resyncLoader());var f=a.mediaSequence-c.mediaSequence;this.logger_("live window shift ["+f+"]"),null!==this.mediaIndex&&(this.mediaIndex-=f),d&&(d.mediaIndex-=f,d.mediaIndex>=0&&(d.segment=a.segments[d.mediaIndex])),this.syncController_.saveExpiredSegmentInfo(c,a)}},b.prototype.pause=function(){this.checkBufferTimeout_&&(vb.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},b.prototype.paused=function(){return null===this.checkBufferTimeout_},b.prototype.mimeType=function(a,b){this.mimeType_||(this.mimeType_=a,this.sourceBufferEmitter_=b,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_())},b.prototype.resetEverything=function(){this.ended_=!1,this.resetLoader(),this.remove(0,this.duration_()),this.trigger("reseteverything")},b.prototype.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},b.prototype.resyncLoader=function(){this.mediaIndex=null,this.syncPoint_=null,this.abort()},b.prototype.remove=function(a,b){this.sourceUpdater_&&this.sourceUpdater_.remove(a,b),yk(a,b,this.segmentMetadataTrack_)},b.prototype.monitorBuffer_=function(){this.checkBufferTimeout_&&vb.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=vb.setTimeout(this.monitorBufferTick_.bind(this),1)},b.prototype.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&vb.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=vb.setTimeout(this.monitorBufferTick_.bind(this),Ml)},b.prototype.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var a=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(a){var b=Nl(this.playlist_,this.mediaSource_,a.mediaIndex);return b?void this.endOfStream():void((a.mediaIndex!==this.playlist_.segments.length-1||"ended"!==this.mediaSource_.readyState||this.seeking_())&&((a.timeline!==this.currentTimeline_||null!==a.startOfSegment&&a.startOfSegment<this.sourceUpdater_.timestampOffset())&&(this.syncController_.reset(),a.timestampOffset=a.startOfSegment),this.loadSegment_(a)))}}},b.prototype.checkBuffer_=function(a,b,c,d,e,f){var g=0,h=void 0;a.length&&(g=a.end(a.length-1));var i=Math.max(0,g-e);if(!b.segments.length)return null;if(i>=this.goalBufferLength_())return null;if(!d&&i>=1)return null;if(null===f)return c=this.getSyncSegmentCandidate_(b),this.generateSegmentInfo_(b,c,null,!0);if(null!==c){var j=b.segments[c];return h=j&&j.end?j.end:g,this.generateSegmentInfo_(b,c+1,h,!1)}if(this.fetchAtBuffer_){var k=bk.getMediaInfoForTime(b,g,f.segmentIndex,f.time);c=k.mediaIndex,h=k.startTime}else{var l=bk.getMediaInfoForTime(b,e,f.segmentIndex,f.time);c=l.mediaIndex,h=l.startTime}return this.generateSegmentInfo_(b,c,h,!1)},b.prototype.getSyncSegmentCandidate_=function(a){var b=this;if(-1===this.currentTimeline_)return 0;var c=a.segments.map(function(a,b){return{timeline:a.timeline,segmentIndex:b}}).filter(function(a){return a.timeline===b.currentTimeline_});return c.length?c[Math.min(c.length-1,1)].segmentIndex:Math.max(a.segments.length-1,0)},b.prototype.generateSegmentInfo_=function(a,b,c,d){if(0>b||b>=a.segments.length)return null;var e=a.segments[b];return{requestId:"segment-loader-"+Math.random(),uri:e.resolvedUri,mediaIndex:b,isSyncRequest:d,startOfSegment:c,playlist:a,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:e.timeline,duration:e.duration,segment:e}},b.prototype.abortRequestEarly_=function(a){if(this.hls_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH)return!1;if(Date.now()-(a.firstBytesReceivedAt||Date.now())<1e3)return!1;var b=this.currentTime_(),c=a.bandwidth,d=this.pendingSegment_.duration,e=bk.estimateSegmentRequestTime(d,c,this.playlist_,a.bytesReceived),f=vk(this.buffered_(),b,this.hls_.tech_.playbackRate())-1;if(f>=e)return!1;var g=Kl({master:this.hls_.playlists.master,currentTime:b,bandwidth:c,duration:this.duration_(),segmentDuration:d,timeUntilRebuffer:f,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(g){var h=e-f,i=h-g.rebufferingImpact,j=.5;return ok>=f&&(j=1),!g.playlist||g.playlist.uri===this.playlist_.uri||j>i?!1:(this.bandwidth=g.playlist.attributes.BANDWIDTH*gl.BANDWIDTH_VARIANCE+1,this.abort(),this.trigger("earlyabort"),!0)}},b.prototype.handleProgress_=function(a,b){this.pendingSegment_&&b.requestId===this.pendingSegment_.requestId&&!this.abortRequestEarly_(b.stats)&&this.trigger("progress")},b.prototype.loadSegment_=function(a){this.state="WAITING",this.pendingSegment_=a,this.trimBackBuffer_(a),a.abortRequests=vl(this.hls_.xhr,this.xhrOptions_,this.decrypter_,this.createSimplifiedSegmentObj_(a),this.handleProgress_.bind(this),this.segmentRequestFinished_.bind(this))},b.prototype.trimBackBuffer_=function(a){var b=Ql(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);b>0&&this.remove(0,b)},b.prototype.createSimplifiedSegmentObj_=function(a){var b=a.segment,c={resolvedUri:b.resolvedUri,byterange:b.byterange,requestId:a.requestId};if(b.key){var d=b.key.iv||new Uint32Array([0,0,0,a.mediaIndex+a.playlist.mediaSequence]);c.key={resolvedUri:b.key.resolvedUri,iv:d}}return b.map&&(c.map=this.initSegment(b.map)),c},b.prototype.segmentRequestFinished_=function(a,b){if(this.mediaRequests+=1,b.stats&&(this.mediaBytesTransferred+=b.stats.bytesReceived,this.mediaTransferDuration+=b.stats.roundTripTime),!this.pendingSegment_)return void(this.mediaRequestsAborted+=1);if(b.requestId===this.pendingSegment_.requestId){if(a)return this.pendingSegment_=null,this.state="READY",a.code===hl.ABORTED?void(this.mediaRequestsAborted+=1):(this.pause(),a.code===hl.TIMEOUT?(this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,void this.trigger("bandwidthupdate")):(this.mediaRequestsErrored+=1,this.error(a),void this.trigger("error")));this.bandwidth=b.stats.bandwidth,this.roundTrip=b.stats.roundTripTime,b.map&&(b.map=this.initSegment(b.map,!0)),this.processSegmentResponse_(b)}},b.prototype.processSegmentResponse_=function(a){var b=this.pendingSegment_;b.bytes=a.bytes,a.map&&(b.segment.map.bytes=a.map.bytes),b.endOfAllRequests=a.endOfAllRequests,this.handleSegment_()},b.prototype.handleSegment_=function(){var a=this;if(!this.pendingSegment_)return void(this.state="READY");var b=this.pendingSegment_,c=b.segment,d=this.syncController_.probeSegmentInfo(b);"undefined"==typeof this.startingMedia_&&d&&(d.containsAudio||d.containsVideo)&&(this.startingMedia_={containsAudio:d.containsAudio,containsVideo:d.containsVideo});var e=Pl(this.loaderType_,this.startingMedia_,d);if(e)return this.error({message:e,blacklistDuration:1/0}),void this.trigger("error");if(b.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");null!==b.timestampOffset&&b.timestampOffset!==this.sourceUpdater_.timestampOffset()&&(this.sourceUpdater_.timestampOffset(b.timestampOffset),this.trigger("timestampoffset"));var f=this.syncController_.mappingForTimeline(b.timeline);if(null!==f&&this.trigger({type:"segmenttimemapping",mapping:f}),this.state="APPENDING",c.map){var g=jk(c.map);if(!this.activeInitSegmentId_||this.activeInitSegmentId_!==g){var h=this.initSegment(c.map);this.sourceUpdater_.appendBuffer(h.bytes,function(){a.activeInitSegmentId_=g})}}b.byteLength=b.bytes.byteLength,"number"==typeof c.start&&"number"==typeof c.end?this.mediaSecondsLoaded+=c.end-c.start:this.mediaSecondsLoaded+=c.duration,this.logger_(Rl(b)),this.sourceUpdater_.appendBuffer(b.bytes,this.handleUpdateEnd_.bind(this))},b.prototype.handleUpdateEnd_=function(){if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var a=this.pendingSegment_,b=a.segment,c=null!==this.mediaIndex;if(this.pendingSegment_=null,this.recordThroughput_(a),this.addSegmentMetadataCue_(a),this.state="READY",this.mediaIndex=a.mediaIndex,this.fetchAtBuffer_=!0,this.currentTimeline_=a.timeline,this.trigger("syncinfoupdate"),b.end&&this.currentTime_()-b.end>3*a.playlist.targetDuration)return void this.resetEverything();c&&this.trigger("bandwidthupdate"),this.trigger("progress");var d=Nl(a.playlist,this.mediaSource_,a.mediaIndex+1);d&&this.endOfStream(),this.paused()||this.monitorBuffer_()},b.prototype.recordThroughput_=function(a){var b=this.throughput.rate,c=Date.now()-a.endOfAllRequests+1,d=Math.floor(a.byteLength/c*8*1e3);this.throughput.rate+=(d-b)/++this.throughput.count},b.prototype.addSegmentMetadataCue_=function(a){if(this.segmentMetadataTrack_){var b=a.segment,c=b.start,d=b.end;if(Ol(c)&&Ol(d)){yk(c,d,this.segmentMetadataTrack_);var e=vb.WebKitDataCue||vb.VTTCue,f={bandwidth:a.playlist.attributes.BANDWIDTH,resolution:a.playlist.attributes.RESOLUTION,codecs:a.playlist.attributes.CODECS,byteLength:a.byteLength,uri:a.uri,timeline:a.timeline,playlist:a.playlist.uri,start:c,end:d},g=JSON.stringify(f),h=new e(c,d,g);h.value=f,this.segmentMetadataTrack_.addCue(h)}}},b}(kb.EventTarget),Tl=new Uint8Array("\n\n".split("").map(function(a){return a.charCodeAt(0)})),Ul=function(a){return String.fromCharCode.apply(null,a)},Vl=function(a){function b(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ib(this,b);var e=Kb(this,a.call(this,c,d));return e.mediaSource_=null,e.subtitlesTrack_=null,e}return Jb(b,a),b.prototype.buffered_=function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return kb.createTimeRanges();var a=this.subtitlesTrack_.cues,b=a[0].startTime,c=a[a.length-1].startTime;return kb.createTimeRanges([[b,c]])},b.prototype.initSegment=function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:!1;if(!a)return null;var c=jk(a),d=this.initSegments_[c];if(b&&!d&&a.bytes){var e=Tl.byteLength+a.bytes.byteLength,f=new Uint8Array(e);f.set(a.bytes),f.set(Tl,a.bytes.byteLength),this.initSegments_[c]=d={resolvedUri:a.resolvedUri,byterange:a.byterange,bytes:f}}return d||a},b.prototype.couldBeginLoading_=function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()},b.prototype.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},b.prototype.track=function(a){return"undefined"==typeof a?this.subtitlesTrack_:(this.subtitlesTrack_=a,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)},b.prototype.remove=function(a,b){yk(a,b,this.subtitlesTrack_)},b.prototype.fillBuffer_=function(){var a=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var b=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(b=this.skipEmptySegments_(b)){if(null===this.syncController_.timestampOffsetForTimeline(b.timeline)){var c=function(){a.state="READY",a.paused()||a.monitorBuffer_()};return this.syncController_.one("timestampoffset",c),void(this.state="WAITING_ON_TIMELINE")}this.loadSegment_(b)}},b.prototype.skipEmptySegments_=function(a){for(;a&&a.segment.empty;)a=this.generateSegmentInfo_(a.playlist,a.mediaIndex+1,a.startOfSegment+a.duration,a.isSyncRequest);return a},b.prototype.handleSegment_=function(){var a=this;if(!this.pendingSegment_||!this.subtitlesTrack_)return void(this.state="READY");this.state="APPENDING";var b=this.pendingSegment_,c=b.segment;if("function"!=typeof vb.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var d=function(){a.handleSegment_()};return this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",d),void this.subtitlesTrack_.tech_.one("vttjserror",function(){a.subtitlesTrack_.tech_.off("vttjsloaded",d),a.error({message:"Error loading vtt.js"}),a.state="READY",a.pause(),a.trigger("error")})}c.requested=!0;try{this.parseVTTCues_(b)}catch(e){return this.error({message:e.message}),this.state="READY",this.pause(),this.trigger("error")}return this.updateTimeMapping_(b,this.syncController_.timelines[b.timeline],this.playlist_),b.isSyncRequest?(this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY")):(b.byteLength=b.bytes.byteLength,this.mediaSecondsLoaded+=c.duration,b.cues.length&&this.remove(b.cues[0].endTime,b.cues[b.cues.length-1].endTime),b.cues.forEach(function(b){a.subtitlesTrack_.addCue(b)}),void this.handleUpdateEnd_())},b.prototype.parseVTTCues_=function(a){var b=void 0,c=!1;"function"==typeof vb.TextDecoder?b=new vb.TextDecoder("utf8"):(b=vb.WebVTT.StringDecoder(),c=!0);var d=new vb.WebVTT.Parser(vb,vb.vttjs,b);if(a.cues=[],a.timestampmap={MPEGTS:0,LOCAL:0},d.oncue=a.cues.push.bind(a.cues),d.ontimestampmap=function(b){return a.timestampmap=b},d.onparsingerror=function(a){kb.log.warn("Error encountered when parsing cues: "+a.message)},a.segment.map){var e=a.segment.map.bytes;c&&(e=Ul(e)),d.parse(e)}var f=a.bytes;c&&(f=Ul(f)),d.parse(f),d.flush()},b.prototype.updateTimeMapping_=function(a,b,c){var d=a.segment;if(b){if(!a.cues.length)return void(d.empty=!0);var e=a.timestampmap,f=e.MPEGTS/9e4-e.LOCAL+b.mapping;if(a.cues.forEach(function(a){a.startTime+=f,a.endTime+=f}),!c.syncInfo){var g=a.cues[0].startTime,h=a.cues[a.cues.length-1].startTime;c.syncInfo={mediaSequence:c.mediaSequence+a.mediaIndex,time:Math.min(g,h-d.duration)}}}},b}(Sl),Wl=function(a,b){for(var c=a.cues,d=0;d<c.length;d++){var e=c[d];if(b>=e.adStartTime&&b<=e.adEndTime)return e}return null},Xl=function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(a.segments)for(var d=c,e=void 0,f=0;f<a.segments.length;f++){var g=a.segments[f];if(e||(e=Wl(b,d+g.duration/2)),e){if("cueIn"in g){e.endTime=d,e.adEndTime=d,d+=g.duration,e=null;continue}if(d<e.endTime){d+=g.duration;continue}e.endTime+=g.duration}else if("cueOut"in g&&(e=new vb.VTTCue(d,d+g.duration,g.cueOut),e.adStartTime=d,e.adEndTime=d+parseFloat(g.cueOut),b.addCue(e)),"cueOutCont"in g){var h=void 0,i=void 0,j=g.cueOutCont.split("/").map(parseFloat);
- h=j[0],i=j[1],e=new vb.VTTCue(d,d+g.duration,""),e.adStartTime=d-h,e.adEndTime=e.adStartTime+i,b.addCue(e)}d+=g.duration}},Yl=hj.inspect,Zl=[{name:"VOD",run:function(a,b,c,d,e){if(c!==1/0){var f={time:0,segmentIndex:0};return f}return null}},{name:"ProgramDateTime",run:function(a,b,c,d,e){if(!a.datetimeToDisplayTime)return null;var f=b.segments||[],g=null,h=null;e=e||0;for(var i=0;i<f.length;i++){var j=f[i];if(j.dateTimeObject){var k=j.dateTimeObject.getTime()/1e3,l=k+a.datetimeToDisplayTime,m=Math.abs(e-l);if(null!==h&&m>h)break;h=m,g={time:l,segmentIndex:i}}}return g}},{name:"Segment",run:function(a,b,c,d,e){var f=b.segments||[],g=null,h=null;e=e||0;for(var i=0;i<f.length;i++){var j=f[i];if(j.timeline===d&&"undefined"!=typeof j.start){var k=Math.abs(e-j.start);if(null!==h&&k>h)break;(!g||null===h||h>=k)&&(h=k,g={time:j.start,segmentIndex:i})}}return g}},{name:"Discontinuity",run:function(a,b,c,d,e){var f=null;if(e=e||0,b.discontinuityStarts&&b.discontinuityStarts.length)for(var g=null,h=0;h<b.discontinuityStarts.length;h++){var i=b.discontinuityStarts[h],j=b.discontinuitySequence+h+1,k=a.discontinuities[j];if(k){var l=Math.abs(e-k.time);if(null!==g&&l>g)break;(!f||null===g||g>=l)&&(g=l,f={time:k.time,segmentIndex:i})}}return f}},{name:"Playlist",run:function(a,b,c,d,e){if(b.syncInfo){var f={time:b.syncInfo.time,segmentIndex:b.syncInfo.mediaSequence-b.mediaSequence};return f}return null}}],$l=function(a){function b(){Ib(this,b);var c=Kb(this,a.call(this));return c.inspectCache_=void 0,c.timelines=[],c.discontinuities=[],c.datetimeToDisplayTime=null,c.logger_=el("SyncController"),c}return Jb(b,a),b.prototype.getSyncPoint=function(a,b,c,d){var e=this.runStrategies_(a,b,c,d);return e.length?this.selectSyncPoint_(e,{key:"time",value:d}):null},b.prototype.getExpiredTime=function(a,b){if(!a||!a.segments)return null;var c=this.runStrategies_(a,b,a.discontinuitySequence,0);if(!c.length)return null;var d=this.selectSyncPoint_(c,{key:"segmentIndex",value:0});return d.segmentIndex>0&&(d.time*=-1),Math.abs(d.time+Lj(a,d.segmentIndex,0))},b.prototype.runStrategies_=function(a,b,c,d){for(var e=[],f=0;f<Zl.length;f++){var g=Zl[f],h=g.run(this,a,b,c,d);h&&(h.strategy=g.name,e.push({strategy:g.name,syncPoint:h}))}return e},b.prototype.selectSyncPoint_=function(a,b){for(var c=a[0].syncPoint,d=Math.abs(a[0].syncPoint[b.key]-b.value),e=a[0].strategy,f=1;f<a.length;f++){var g=Math.abs(a[f].syncPoint[b.key]-b.value);d>g&&(d=g,c=a[f].syncPoint,e=a[f].strategy)}return this.logger_("syncPoint for ["+b.key+": "+b.value+"] chosen with strategy"+(" ["+e+"]: [time:"+c.time+",")+(" segmentIndex:"+c.segmentIndex+"]")),c},b.prototype.saveExpiredSegmentInfo=function(a,b){for(var c=b.mediaSequence-a.mediaSequence,d=c-1;d>=0;d--){var e=a.segments[d];if(e&&"undefined"!=typeof e.start){b.syncInfo={mediaSequence:a.mediaSequence+d,time:e.start},this.logger_("playlist refresh sync: [time:"+b.syncInfo.time+","+(" mediaSequence: "+b.syncInfo.mediaSequence+"]")),this.trigger("syncinfoupdate");break}}},b.prototype.setDateTimeMapping=function(a){if(!this.datetimeToDisplayTime&&a.segments&&a.segments.length&&a.segments[0].dateTimeObject){var b=a.segments[0].dateTimeObject.getTime()/1e3;this.datetimeToDisplayTime=-b}},b.prototype.reset=function(){this.inspectCache_=void 0},b.prototype.probeSegmentInfo=function(a){var b=a.segment,c=a.playlist,d=void 0;return d=b.map?this.probeMp4Segment_(a):this.probeTsSegment_(a),d&&this.calculateSegmentTimeMapping_(a,d)&&(this.saveDiscontinuitySyncInfo_(a),c.syncInfo||(c.syncInfo={mediaSequence:c.mediaSequence+a.mediaIndex,time:b.start})),d},b.prototype.probeMp4Segment_=function(a){var b=a.segment,c=Th.timescale(b.map.bytes),d=Th.startTime(c,a.bytes);return null!==a.timestampOffset&&(a.timestampOffset-=d),{start:d,end:d+b.duration}},b.prototype.probeTsSegment_=function(a){var b=Yl(a.bytes,this.inspectCache_),c=void 0,d=void 0;return b?(b.video&&2===b.video.length?(this.inspectCache_=b.video[1].dts,c=b.video[0].dtsTime,d=b.video[1].dtsTime):b.audio&&2===b.audio.length&&(this.inspectCache_=b.audio[1].dts,c=b.audio[0].dtsTime,d=b.audio[1].dtsTime),{start:c,end:d,containsVideo:b.video&&2===b.video.length,containsAudio:b.audio&&2===b.audio.length}):null},b.prototype.timestampOffsetForTimeline=function(a){return"undefined"==typeof this.timelines[a]?null:this.timelines[a].time},b.prototype.mappingForTimeline=function(a){return"undefined"==typeof this.timelines[a]?null:this.timelines[a].mapping},b.prototype.calculateSegmentTimeMapping_=function(a,b){var c=a.segment,d=this.timelines[a.timeline];if(null!==a.timestampOffset)d={time:a.startOfSegment,mapping:a.startOfSegment-b.start},this.timelines[a.timeline]=d,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+a.timeline+": "+("[time: "+d.time+"] [mapping: "+d.mapping+"]")),c.start=a.startOfSegment,c.end=b.end+d.mapping;else{if(!d)return!1;c.start=b.start+d.mapping,c.end=b.end+d.mapping}return!0},b.prototype.saveDiscontinuitySyncInfo_=function(a){var b=a.playlist,c=a.segment;if(c.discontinuity)this.discontinuities[c.timeline]={time:c.start,accuracy:0};else if(b.discontinuityStarts&&b.discontinuityStarts.length)for(var d=0;d<b.discontinuityStarts.length;d++){var e=b.discontinuityStarts[d],f=b.discontinuitySequence+d+1,g=e-a.mediaIndex,h=Math.abs(g);if(!this.discontinuities[f]||this.discontinuities[f].accuracy>h){var i=void 0;i=0>g?c.start-Lj(b,a.mediaIndex,e):c.end+Lj(b,a.mediaIndex+1,e),this.discontinuities[f]={time:i,accuracy:h}}}},b}(kb.EventTarget),_l=new nb("./decrypter-worker.worker.js",function(a,b){var c=this;(function(){function b(a){return a.subarray(0,a.byteLength-a[a.byteLength-1])}var d,e="undefined"!=typeof a?a:"undefined"!=typeof global?global:"undefined"!=typeof c?c:{};d="undefined"!=typeof a?a:"undefined"!=typeof e?e:"undefined"!=typeof c?c:{};var f=d,g=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},h=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),i=function(a,b){if("function"!=typeof b&&null!==b)throw new TypeError("Super expression must either be null or a function, not "+("undefined"==typeof b?"undefined":Hb(b)));a.prototype=Object.create(b&&b.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(a,b):a.__proto__=b)},j=function(a,b){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!b||"object"!==("undefined"==typeof b?"undefined":Hb(b))&&"function"!=typeof b?a:b},k=function(){var a=[[[],[],[],[],[]],[[],[],[],[],[]]],b=a[0],c=a[1],d=b[4],e=c[4],f=void 0,g=void 0,h=void 0,i=[],j=[],k=void 0,l=void 0,m=void 0,n=void 0,o=void 0,p=void 0;for(f=0;256>f;f++)j[(i[f]=f<<1^283*(f>>7))^f]=f;for(g=h=0;!d[g];g^=k||1,h=j[h]||1)for(n=h^h<<1^h<<2^h<<3^h<<4,n=n>>8^255&n^99,d[g]=n,e[n]=g,m=i[l=i[k=i[g]]],p=16843009*m^65537*l^257*k^16843008*g,o=257*i[n]^16843008*n,f=0;4>f;f++)b[f][g]=o=o<<24^o>>>8,c[f][n]=p=p<<24^p>>>8;for(f=0;5>f;f++)b[f]=b[f].slice(0),c[f]=c[f].slice(0);return a},l=null,m=function(){function a(b){g(this,a),l||(l=k()),this._tables=[[l[0][0].slice(),l[0][1].slice(),l[0][2].slice(),l[0][3].slice(),l[0][4].slice()],[l[1][0].slice(),l[1][1].slice(),l[1][2].slice(),l[1][3].slice(),l[1][4].slice()]];var c=void 0,d=void 0,e=void 0,f=void 0,h=void 0,i=this._tables[0][4],j=this._tables[1],m=b.length,n=1;if(4!==m&&6!==m&&8!==m)throw new Error("Invalid aes key size");for(f=b.slice(0),h=[],this._key=[f,h],c=m;4*m+28>c;c++)e=f[c-1],(c%m===0||8===m&&c%m===4)&&(e=i[e>>>24]<<24^i[e>>16&255]<<16^i[e>>8&255]<<8^i[255&e],c%m===0&&(e=e<<8^e>>>24^n<<24,n=n<<1^283*(n>>7))),f[c]=f[c-m]^e;for(d=0;c;d++,c--)e=f[3&d?c:c-4],4>=c||4>d?h[d]=e:h[d]=j[0][i[e>>>24]]^j[1][i[e>>16&255]]^j[2][i[e>>8&255]]^j[3][i[255&e]]}return a.prototype.decrypt=function(a,b,c,d,e,f){var g=this._key[1],h=a^g[0],i=d^g[1],j=c^g[2],k=b^g[3],l=void 0,m=void 0,n=void 0,o=g.length/4-2,p=void 0,q=4,r=this._tables[1],s=r[0],t=r[1],u=r[2],v=r[3],w=r[4];for(p=0;o>p;p++)l=s[h>>>24]^t[i>>16&255]^u[j>>8&255]^v[255&k]^g[q],m=s[i>>>24]^t[j>>16&255]^u[k>>8&255]^v[255&h]^g[q+1],n=s[j>>>24]^t[k>>16&255]^u[h>>8&255]^v[255&i]^g[q+2],k=s[k>>>24]^t[h>>16&255]^u[i>>8&255]^v[255&j]^g[q+3],q+=4,h=l,i=m,j=n;for(p=0;4>p;p++)e[(3&-p)+f]=w[h>>>24]<<24^w[i>>16&255]<<16^w[j>>8&255]<<8^w[255&k]^g[q++],l=h,h=i,i=j,j=k,k=l},a}(),n=function(){function a(){g(this,a),this.listeners={}}return a.prototype.on=function(a,b){this.listeners[a]||(this.listeners[a]=[]),this.listeners[a].push(b)},a.prototype.off=function(a,b){if(!this.listeners[a])return!1;var c=this.listeners[a].indexOf(b);return this.listeners[a].splice(c,1),c>-1},a.prototype.trigger=function(a){var b=this.listeners[a];if(b)if(2===arguments.length)for(var c=b.length,d=0;c>d;++d)b[d].call(this,arguments[1]);else for(var e=Array.prototype.slice.call(arguments,1),f=b.length,g=0;f>g;++g)b[g].apply(this,e)},a.prototype.dispose=function(){this.listeners={}},a.prototype.pipe=function(a){this.on("data",function(b){a.push(b)})},a}(),o=function(a){function b(){g(this,b);var c=j(this,a.call(this,n));return c.jobs=[],c.delay=1,c.timeout_=null,c}return i(b,a),b.prototype.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},b.prototype.push=function(a){this.jobs.push(a),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},b}(n),p=function(a){return a<<24|(65280&a)<<8|(16711680&a)>>8|a>>>24},q=function(a,b,c){var d=new Int32Array(a.buffer,a.byteOffset,a.byteLength>>2),e=new m(Array.prototype.slice.call(b)),f=new Uint8Array(a.byteLength),g=new Int32Array(f.buffer),h=void 0,i=void 0,j=void 0,k=void 0,l=void 0,n=void 0,o=void 0,q=void 0,r=void 0;for(h=c[0],i=c[1],j=c[2],k=c[3],r=0;r<d.length;r+=4)l=p(d[r]),n=p(d[r+1]),o=p(d[r+2]),q=p(d[r+3]),e.decrypt(l,n,o,q,g,r),g[r]=p(g[r]^h),g[r+1]=p(g[r+1]^i),g[r+2]=p(g[r+2]^j),g[r+3]=p(g[r+3]^k),h=l,i=n,j=o,k=q;return f},r=function(){function a(c,d,e,f){g(this,a);var h=a.STEP,i=new Int32Array(c.buffer),j=new Uint8Array(c.byteLength),k=0;for(this.asyncStream_=new o,this.asyncStream_.push(this.decryptChunk_(i.subarray(k,k+h),d,e,j)),k=h;k<i.length;k+=h)e=new Uint32Array([p(i[k-4]),p(i[k-3]),p(i[k-2]),p(i[k-1])]),this.asyncStream_.push(this.decryptChunk_(i.subarray(k,k+h),d,e,j));this.asyncStream_.push(function(){f(null,b(j))})}return a.prototype.decryptChunk_=function(a,b,c,d){return function(){var e=q(a,b,c);d.set(e,a.byteOffset)}},h(a,null,[{key:"STEP",get:function(){return 32e3}}]),a}(),s=function(a){var b={};return Object.keys(a).forEach(function(c){var d=a[c];ArrayBuffer.isView(d)?b[c]={bytes:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength}:b[c]=d}),b},t=function(a){a.onmessage=function(a){var b=a.data,c=new Uint8Array(b.encrypted.bytes,b.encrypted.byteOffset,b.encrypted.byteLength),d=new Uint32Array(b.key.bytes,b.key.byteOffset,b.key.byteLength/4),e=new Uint32Array(b.iv.bytes,b.iv.byteOffset,b.iv.byteLength/4);new r(c,d,e,function(a,c){f.postMessage(s({source:b.source,decrypted:c}),[c.buffer])})}},u=new t(c);return u})()}),am=function(a){var b=a["default"]?"main":"alternative";return a.characteristics&&a.characteristics.indexOf("public.accessibility.describes-video")>=0&&(b="main-desc"),b},bm=function(a,b){a.abort(),a.pause(),b&&b.activePlaylistLoader&&(b.activePlaylistLoader.pause(),b.activePlaylistLoader=null)},cm=function(a,b){b.activePlaylistLoader=a,a.load()},dm=function(a,b){return function(){var c=b.segmentLoaders,d=c[a],e=c.main,f=b.mediaTypes[a],g=f.activeTrack(),h=f.activeGroup(g),i=f.activePlaylistLoader;if(bm(d,f),h){if(!h.playlistLoader)return void(i&&e.resetEverything());d.resyncLoader(),cm(h.playlistLoader,f)}}},em=function(a,b){return function(){var c=b.segmentLoaders,d=c[a],e=c.main,f=b.mediaTypes[a],g=f.activeTrack(),h=f.activeGroup(g),i=f.activePlaylistLoader;if(bm(d,f),h){if(!h.playlistLoader)return void e.resetEverything();if(i===h.playlistLoader)return void cm(h.playlistLoader,f);d.track&&d.track(g),d.resetEverything(),cm(h.playlistLoader,f)}}},fm={AUDIO:function(a,b){return function(){var c=b.segmentLoaders[a],d=b.mediaTypes[a],e=b.blacklistCurrentPlaylist;bm(c,d);var f=d.activeTrack(),g=d.activeGroup(),h=(g.filter(function(a){return a["default"]})[0]||g[0]).id,i=d.tracks[h];if(f===i)return void e({message:"Problem encountered loading the default audio track."});kb.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(var j in d.tracks)d.tracks[j].enabled=d.tracks[j]===i;d.onTrackChanged()}},SUBTITLES:function(a,b){return function(){var c=b.segmentLoaders[a],d=b.mediaTypes[a];kb.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),bm(c,d);var e=d.activeTrack();e&&(e.mode="disabled"),d.onTrackChanged()}}},gm={AUDIO:function(a,b,c){if(b){var d=c.tech,e=c.requestOptions,f=c.segmentLoaders[a];b.on("loadedmetadata",function(){var a=b.media();f.playlist(a,e),(!d.paused()||a.endList&&"none"!==d.preload())&&f.load()}),b.on("loadedplaylist",function(){f.playlist(b.media(),e),d.paused()||f.load()}),b.on("error",fm[a](a,c))}},SUBTITLES:function(a,b,c){var d=c.tech,e=c.requestOptions,f=c.segmentLoaders[a],g=c.mediaTypes[a];b.on("loadedmetadata",function(){var a=b.media();f.playlist(a,e),f.track(g.activeTrack()),(!d.paused()||a.endList&&"none"!==d.preload())&&f.load()}),b.on("loadedplaylist",function(){f.playlist(b.media(),e),d.paused()||f.load()}),b.on("error",fm[a](a,c))}},hm=function(a,b){return function(c){return c.attributes[a]===b}},im=function(a){return function(b){return b.resolvedUri===a}},jm={AUDIO:function(a,b){var c=b.hls,d=b.sourceType,e=b.segmentLoaders[a],f=b.requestOptions.withCredentials,g=b.master,h=g.mediaGroups,i=g.playlists,j=b.mediaTypes[a],k=j.groups,l=j.tracks,m=b.masterPlaylistLoader;h[a]&&0!==Object.keys(h[a]).length||(h[a]={main:{"default":{"default":!0}}});for(var n in h[a]){k[n]||(k[n]=[]);var o=i.filter(hm(a,n));for(var p in h[a][n]){var q=h[a][n][p],r=o.filter(im(q.resolvedUri));r.length&&delete q.resolvedUri;var s=void 0;if(s=q.resolvedUri?new Fj(q.resolvedUri,c,f):q.playlists&&"dash"===d?new dl(q.playlists[0],c,f,m):null,q=kb.mergeOptions({id:p,playlistLoader:s},q),gm[a](a,q.playlistLoader,b),k[n].push(q),"undefined"==typeof l[p]){var t=new kb.AudioTrack({id:p,kind:am(q),enabled:!1,language:q.language,"default":q["default"],label:p});l[p]=t}}}e.on("error",fm[a](a,b))},SUBTITLES:function(a,b){var c=b.tech,d=b.hls,e=b.sourceType,f=b.segmentLoaders[a],g=b.requestOptions.withCredentials,h=b.master.mediaGroups,i=b.mediaTypes[a],j=i.groups,k=i.tracks,l=b.masterPlaylistLoader;for(var m in h[a]){j[m]||(j[m]=[]);for(var n in h[a][m])if(!h[a][m][n].forced){var o=h[a][m][n],p=void 0;if("hls"===e?p=new Fj(o.resolvedUri,d,g):"dash"===e&&(p=new dl(o.playlists[0],d,g,l)),o=kb.mergeOptions({id:n,playlistLoader:p},o),gm[a](a,o.playlistLoader,b),j[m].push(o),"undefined"==typeof k[n]){var q=c.addRemoteTextTrack({id:n,kind:"subtitles",enabled:!1,language:o.language,label:n},!1).track;k[n]=q}}}f.on("error",fm[a](a,b))},"CLOSED-CAPTIONS":function(a,b){var c=b.tech,d=b.master.mediaGroups,e=b.mediaTypes[a],f=e.groups,g=e.tracks;for(var h in d[a]){f[h]||(f[h]=[]);for(var i in d[a][h]){var j=d[a][h][i];if(j.instreamId.match(/CC\d/)&&(f[h].push(kb.mergeOptions({id:i},j)),"undefined"==typeof g[i])){var k=c.addRemoteTextTrack({id:j.instreamId,kind:"captions",enabled:!1,language:j.language,label:i},!1).track;g[i]=k}}}}},km=function(a,b){return function(c){var d=b.masterPlaylistLoader,e=b.mediaTypes[a].groups,f=d.media();if(!f)return null;var g=null;return f.attributes[a]&&(g=e[f.attributes[a]]),g=g||e.main,"undefined"==typeof c?g:null===c?null:g.filter(function(a){return a.id===c.id})[0]||null}},lm={AUDIO:function(a,b){return function(){var c=b.mediaTypes[a].tracks;for(var d in c)if(c[d].enabled)return c[d];return null}},SUBTITLES:function(a,b){return function(){var c=b.mediaTypes[a].tracks;for(var d in c)if("showing"===c[d].mode)return c[d];return null}}},mm=function(a){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){jm[b](b,a)});var b=a.mediaTypes,c=a.masterPlaylistLoader,d=a.tech,e=a.hls;["AUDIO","SUBTITLES"].forEach(function(c){b[c].activeGroup=km(c,a),b[c].activeTrack=lm[c](c,a),b[c].onGroupChanged=dm(c,a),b[c].onTrackChanged=em(c,a)});var f=b.AUDIO.activeGroup(),g=(f.filter(function(a){return a["default"]})[0]||f[0]).id;b.AUDIO.tracks[g].enabled=!0,b.AUDIO.onTrackChanged(),c.on("mediachange",function(){["AUDIO","SUBTITLES"].forEach(function(a){return b[a].onGroupChanged()})});var h=function(){b.AUDIO.onTrackChanged(),d.trigger({type:"usage",name:"hls-audio-change"})};d.audioTracks().addEventListener("change",h),d.remoteTextTracks().addEventListener("change",b.SUBTITLES.onTrackChanged),e.on("dispose",function(){d.audioTracks().removeEventListener("change",h),d.remoteTextTracks().removeEventListener("change",b.SUBTITLES.onTrackChanged)}),d.clearTracks("audio");for(var i in b.AUDIO.tracks)d.audioTracks().addTrack(b.AUDIO.tracks[i])},nm=function(){var a={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(function(b){a[b]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:qb,activeTrack:qb,onGroupChanged:qb,onTrackChanged:qb}}),a},om=120,pm=void 0,qm=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred"],rm=function(a){return this.audioSegmentLoader_[a]+this.mainSegmentLoader_[a]},sm=function(a){function b(c){Ib(this,b);var d=Kb(this,a.call(this)),e=c.url,f=c.withCredentials,g=c.tech,h=c.bandwidth,i=c.externHls,j=c.useCueTags,k=c.blacklistDuration,l=c.enableLowInitialPlaylist,m=c.sourceType;if(!e)throw new Error("A non-empty playlist URL is required");pm=i,d.withCredentials=f,d.tech_=g,d.hls_=g.hls,d.sourceType_=m,d.useCueTags_=j,d.blacklistDuration=k,d.enableLowInitialPlaylist=l,d.useCueTags_&&(d.cueTagsTrack_=d.tech_.addTextTrack("metadata","ad-cues"),d.cueTagsTrack_.inBandMetadataTrackDispatchType=""),d.requestOptions_={withCredentials:d.withCredentials,timeout:null},d.mediaTypes_=nm(),d.mediaSource=new kb.MediaSource,d.mediaSource.addEventListener("sourceopen",d.handleSourceOpen_.bind(d)),d.seekable_=kb.createTimeRanges(),d.hasPlayed_=function(){return!1},d.syncController_=new $l(c),d.segmentMetadataTrack_=g.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,d.decrypter_=new _l;var n={hls:d.hls_,mediaSource:d.mediaSource,currentTime:d.tech_.currentTime.bind(d.tech_),seekable:function(){return d.seekable()},seeking:function(){return d.tech_.seeking()},duration:function(){return d.mediaSource.duration},hasPlayed:function(){return d.hasPlayed_()},goalBufferLength:function(){return d.goalBufferLength()},bandwidth:h,syncController:d.syncController_,decrypter:d.decrypter_,sourceType:d.sourceType_};return d.masterPlaylistLoader_="dash"===d.sourceType_?new dl(e,d.hls_,d.withCredentials):new Fj(e,d.hls_,d.withCredentials),d.setupMasterPlaylistLoaderListeners_(),d.mainSegmentLoader_=new Sl(kb.mergeOptions(n,{segmentMetadataTrack:d.segmentMetadataTrack_,loaderType:"main"}),c),d.audioSegmentLoader_=new Sl(kb.mergeOptions(n,{loaderType:"audio"}),c),d.subtitleSegmentLoader_=new Vl(kb.mergeOptions(n,{loaderType:"vtt"}),c),d.setupSegmentLoaderListeners_(),qm.forEach(function(a){d[a+"_"]=rm.bind(d,a)}),d.logger_=el("MPC"),d.masterPlaylistLoader_.load(),d}return Jb(b,a),b.prototype.setupMasterPlaylistLoaderListeners_=function(){var a=this;this.masterPlaylistLoader_.on("loadedmetadata",function(){var b=a.masterPlaylistLoader_.media(),c=1.5*a.masterPlaylistLoader_.targetDuration*1e3;ak(a.masterPlaylistLoader_.master,a.masterPlaylistLoader_.media())?a.requestOptions_.timeout=0:a.requestOptions_.timeout=c,b.endList&&"none"!==a.tech_.preload()&&(a.mainSegmentLoader_.playlist(b,a.requestOptions_),a.mainSegmentLoader_.load()),mm({sourceType:a.sourceType_,segmentLoaders:{AUDIO:a.audioSegmentLoader_,SUBTITLES:a.subtitleSegmentLoader_,main:a.mainSegmentLoader_},tech:a.tech_,requestOptions:a.requestOptions_,masterPlaylistLoader:a.masterPlaylistLoader_,hls:a.hls_,master:a.master(),mediaTypes:a.mediaTypes_,blacklistCurrentPlaylist:a.blacklistCurrentPlaylist.bind(a)}),a.triggerPresenceUsage_(a.master(),b);try{a.setupSourceBuffers_()}catch(d){return kb.log.warn("Failed to create SourceBuffers",d),a.mediaSource.endOfStream("decode")}a.setupFirstPlay(),a.trigger("selectedinitialmedia")}),this.masterPlaylistLoader_.on("loadedplaylist",function(){var b=a.masterPlaylistLoader_.media();if(!b){a.excludeUnsupportedVariants_();var c=void 0;return a.enableLowInitialPlaylist&&(c=a.selectInitialPlaylist()),c||(c=a.selectPlaylist()),a.initialMedia_=c,void a.masterPlaylistLoader_.media(a.initialMedia_)}if(a.useCueTags_&&a.updateAdCues_(b),a.mainSegmentLoader_.playlist(b,a.requestOptions_),a.updateDuration(),a.tech_.paused()||a.mainSegmentLoader_.load(),!b.endList){var d=function(){var b=a.seekable();0!==b.length&&a.mediaSource.addSeekableRange_(b.start(0),b.end(0))};if(a.duration()!==1/0){var e=function f(){a.duration()===1/0?d():a.tech_.one("durationchange",f)};a.tech_.one("durationchange",e)}else d()}}),this.masterPlaylistLoader_.on("error",function(){a.blacklistCurrentPlaylist(a.masterPlaylistLoader_.error)}),this.masterPlaylistLoader_.on("mediachanging",function(){a.mainSegmentLoader_.abort(),a.mainSegmentLoader_.pause()}),this.masterPlaylistLoader_.on("mediachange",function(){var b=a.masterPlaylistLoader_.media(),c=1.5*a.masterPlaylistLoader_.targetDuration*1e3;ak(a.masterPlaylistLoader_.master,a.masterPlaylistLoader_.media())?a.requestOptions_.timeout=0:a.requestOptions_.timeout=c,a.mainSegmentLoader_.playlist(b,a.requestOptions_),a.mainSegmentLoader_.load(),a.tech_.trigger({type:"mediachange",bubbles:!0})}),this.masterPlaylistLoader_.on("playlistunchanged",function(){var b=a.masterPlaylistLoader_.media(),c=a.stuckAtPlaylistEnd_(b);c&&(a.blacklistCurrentPlaylist({message:"Playlist no longer updating."}),a.tech_.trigger("playliststuck"))}),this.masterPlaylistLoader_.on("renditiondisabled",function(){a.tech_.trigger({type:"usage",name:"hls-rendition-disabled"})}),this.masterPlaylistLoader_.on("renditionenabled",function(){a.tech_.trigger({type:"usage",name:"hls-rendition-enabled"})})},b.prototype.triggerPresenceUsage_=function(a,b){var c=a.mediaGroups||{},d=!0,e=Object.keys(c.AUDIO);for(var f in c.AUDIO)for(var g in c.AUDIO[f]){var h=c.AUDIO[f][g];h.uri||(d=!1)}d&&this.tech_.trigger({type:"usage",name:"hls-demuxed"}),Object.keys(c.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"hls-webvtt"}),pm.Playlist.isAes(b)&&this.tech_.trigger({type:"usage",name:"hls-aes"}),pm.Playlist.isFmp4(b)&&this.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.length&&Object.keys(c.AUDIO[e[0]]).length>1&&this.tech_.trigger({type:"usage",name:"hls-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"})},b.prototype.setupSegmentLoaderListeners_=function(){var a=this;this.mainSegmentLoader_.on("bandwidthupdate",function(){var b=a.selectPlaylist(),c=a.masterPlaylistLoader_.media(),d=a.tech_.buffered(),e=d.length?d.end(d.length-1)-a.tech_.currentTime():0,f=a.bufferLowWaterLine();(!c.endList||a.duration()<gl.MAX_BUFFER_LOW_WATER_LINE||b.attributes.BANDWIDTH<c.attributes.BANDWIDTH||e>=f)&&a.masterPlaylistLoader_.media(b),a.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){a.trigger("progress")}),this.mainSegmentLoader_.on("error",function(){a.blacklistCurrentPlaylist(a.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("syncinfoupdate",function(){a.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){a.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){a.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("ended",function(){a.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(){a.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},om)}),this.mainSegmentLoader_.on("reseteverything",function(){a.tech_.trigger("hls-reset")}),this.mainSegmentLoader_.on("segmenttimemapping",function(b){a.tech_.trigger({type:"hls-segment-time-mapping",mapping:b.mapping})}),this.audioSegmentLoader_.on("ended",function(){a.onEndOfStream()})},b.prototype.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},b.prototype.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},b.prototype.fastQualityChange_=function(){var a=this.selectPlaylist();a!==this.masterPlaylistLoader_.media()&&(this.masterPlaylistLoader_.media(a),this.mainSegmentLoader_.resetLoader())},b.prototype.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_()&&this.load();var a=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<a.start(0)?this.tech_.setCurrentTime(a.end(a.length-1)):void 0}},b.prototype.setupFirstPlay=function(){var a=this,b=this.masterPlaylistLoader_.media();if(!b||this.tech_.paused()||this.hasPlayed_())return!1;if(!b.endList){var c=this.seekable();if(!c.length)return!1;if(kb.browser.IE_VERSION&&0===this.tech_.readyState())return this.tech_.one("loadedmetadata",function(){a.trigger("firstplay"),a.tech_.setCurrentTime(c.end(0)),a.hasPlayed_=function(){return!0}}),!1;this.trigger("firstplay"),this.tech_.setCurrentTime(c.end(0))}return this.hasPlayed_=function(){return!0},this.load(),!0},b.prototype.handleSourceOpen_=function(){try{this.setupSourceBuffers_()}catch(a){return kb.log.warn("Failed to create Source Buffers",a),this.mediaSource.endOfStream("decode")}if(this.tech_.autoplay()){var b=this.tech_.play();"undefined"!=typeof b&&"function"==typeof b.then&&b.then(null,function(a){})}this.trigger("sourceopen")},b.prototype.onEndOfStream=function(){var a=this.mainSegmentLoader_.ended_;this.mediaTypes_.AUDIO.activePlaylistLoader&&(a=!this.mainSegmentLoader_.startingMedia_||this.mainSegmentLoader_.startingMedia_.containsVideo?a&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_),a&&this.mediaSource.endOfStream()},b.prototype.stuckAtPlaylistEnd_=function(a){var b=this.seekable();if(!b.length)return!1;var c=this.syncController_.getExpiredTime(a,this.mediaSource.duration);if(null===c)return!1;var d=pm.Playlist.playlistEnd(a,c),e=this.tech_.currentTime(),f=this.tech_.buffered();if(!f.length)return pk>=d-e;var g=f.end(f.length-1);return pk>=g-e&&pk>=d-g},b.prototype.blacklistCurrentPlaylist=function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},b=arguments[1],c=void 0,d=void 0;if(c=a.playlist||this.masterPlaylistLoader_.media(),b=b||a.blacklistDuration||this.blacklistDuration,!c){this.error=a;try{return this.mediaSource.endOfStream("network")}catch(e){return this.trigger("error")}}var f=1===this.masterPlaylistLoader_.master.playlists.filter(Wj).length;return f?(kb.log.warn("Problem encountered with the current HLS playlist. Trying again since it is the final playlist."),this.tech_.trigger("retryplaylist"),this.masterPlaylistLoader_.load(f)):(c.excludeUntil=Date.now()+1e3*b,this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"}),d=this.selectPlaylist(),kb.log.warn("Problem encountered with the current HLS playlist."+(a.message?" "+a.message:"")+" Switching to another playlist."),this.masterPlaylistLoader_.media(d))},b.prototype.pauseLoading=function(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()},b.prototype.setCurrentTime=function(a){var b=rk(this.tech_.buffered(),a);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?b&&b.length?a:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},b.prototype.duration=function(){return this.masterPlaylistLoader_?this.mediaSource?this.mediaSource.duration:pm.Playlist.duration(this.masterPlaylistLoader_.media()):0},b.prototype.seekable=function(){return this.seekable_},b.prototype.onSyncInfoUpdate_=function(){var a=void 0,b=void 0;if(this.masterPlaylistLoader_){var c=this.masterPlaylistLoader_.media();if(c){var d=this.syncController_.getExpiredTime(c,this.mediaSource.duration);if(null!==d&&(a=pm.Playlist.seekable(c,d),0!==a.length)){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(c=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),d=this.syncController_.getExpiredTime(c,this.mediaSource.duration),null===d)return;if(b=pm.Playlist.seekable(c,d),0===b.length)return}b?b.start(0)>a.end(0)||a.start(0)>b.end(0)?this.seekable_=a:this.seekable_=kb.createTimeRanges([[b.start(0)>a.start(0)?b.start(0):a.start(0),b.end(0)<a.end(0)?b.end(0):a.end(0)]]):this.seekable_=a,this.logger_("seekable updated ["+uk(this.seekable_)+"]"),this.tech_.trigger("seekablechanged")}}}},b.prototype.updateDuration=function(){var a=this,b=this.mediaSource.duration,c=pm.Playlist.duration(this.masterPlaylistLoader_.media()),d=this.tech_.buffered(),e=function f(){a.mediaSource.duration=c,a.tech_.trigger("durationchange"),a.mediaSource.removeEventListener("sourceopen",f)};d.length>0&&(c=Math.max(c,d.end(d.length-1))),b!==c&&("open"!==this.mediaSource.readyState?this.mediaSource.addEventListener("sourceopen",e):e())},b.prototype.dispose=function(){var a=this;this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),["AUDIO","SUBTITLES"].forEach(function(b){var c=a.mediaTypes_[b].groups;for(var d in c)c[d].forEach(function(a){a.playlistLoader&&a.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose()},b.prototype.master=function(){return this.masterPlaylistLoader_.master},b.prototype.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},b.prototype.setupSourceBuffers_=function(){var a=this.masterPlaylistLoader_.media(),b=void 0;if(a&&"open"===this.mediaSource.readyState){if(b=Dl(this.masterPlaylistLoader_.master,a),b.length<1)return this.error="No compatible SourceBuffer configuration for the variant stream:"+a.resolvedUri,this.mediaSource.endOfStream("decode");this.configureLoaderMimeTypes_(b),this.excludeIncompatibleVariants_(a)}},b.prototype.configureLoaderMimeTypes_=function(a){var b=a.length>1&&-1===a[0].indexOf(",")&&a[0]!==a[1]?new kb.EventTarget:null;this.mainSegmentLoader_.mimeType(a[0],b),a[1]&&this.audioSegmentLoader_.mimeType(a[1],b)},b.prototype.excludeUnsupportedVariants_=function(){this.master().playlists.forEach(function(a){a.attributes.CODECS&&vb.MediaSource&&vb.MediaSource.isTypeSupported&&!vb.MediaSource.isTypeSupported('video/mp4; codecs="'+yl(a.attributes.CODECS)+'"')&&(a.excludeUntil=1/0)})},b.prototype.excludeIncompatibleVariants_=function(a){var b=2,c=null,d=void 0;a.attributes.CODECS&&(d=xl(a.attributes.CODECS),c=d.videoCodec,b=d.codecCount),this.master().playlists.forEach(function(a){var d={codecCount:2,videoCodec:null};a.attributes.CODECS&&(d=xl(a.attributes.CODECS)),d.codecCount!==b&&(a.excludeUntil=1/0),d.videoCodec!==c&&(a.excludeUntil=1/0)})},b.prototype.updateAdCues_=function(a){var b=0,c=this.seekable();c.length&&(b=c.start(0)),
- Xl(a,this.cueTagsTrack_,b)},b.prototype.goalBufferLength=function(){var a=this.tech_.currentTime(),b=gl.GOAL_BUFFER_LENGTH,c=gl.GOAL_BUFFER_LENGTH_RATE,d=Math.max(b,gl.MAX_GOAL_BUFFER_LENGTH);return Math.min(b+a*c,d)},b.prototype.bufferLowWaterLine=function(){var a=this.tech_.currentTime(),b=gl.BUFFER_LOW_WATER_LINE,c=gl.BUFFER_LOW_WATER_LINE_RATE,d=Math.max(b,gl.MAX_BUFFER_LOW_WATER_LINE);return Math.min(b+a*c,d)},b}(kb.EventTarget),tm=function(a,b,c){return function(d){var e=a.master.playlists[b],f=Vj(e),g=Wj(e);return"undefined"==typeof d?g:(d?delete e.disabled:e.disabled=!0,d===g||f||(c(),d?a.trigger("renditionenabled"):a.trigger("renditiondisabled")),d)}},um=function Pm(a,b,c){Ib(this,Pm);var d=a.masterPlaylistController_.fastQualityChange_.bind(a.masterPlaylistController_);if(b.attributes.RESOLUTION){var e=b.attributes.RESOLUTION;this.width=e.width,this.height=e.height}this.bandwidth=b.attributes.BANDWIDTH,this.id=c,this.enabled=tm(a.playlists,b.uri,d)},vm=function(a){var b=a.playlists;a.representations=function(){return b.master.playlists.filter(function(a){return!Vj(a)}).map(function(b,c){return new um(a,b,b.uri)})}},wm=["seeking","seeked","pause","playing","error"],xm=function(){function a(b){var c=this;Ib(this,a),this.tech_=b.tech,this.seekable=b.seekable,this.consecutiveUpdates=0,this.lastRecordedTime=null,this.timer_=null,this.checkCurrentTimeTimeout_=null,this.logger_=el("PlaybackWatcher"),this.logger_("initialize");var d=function(){return c.monitorCurrentTime_()},e=function(){return c.techWaiting_()},f=function(){return c.cancelTimer_()},g=function(){return c.fixesBadSeeks_()};this.tech_.on("seekablechanged",g),this.tech_.on("waiting",e),this.tech_.on(wm,f),this.tech_.on("canplay",d),this.dispose=function(){c.logger_("dispose"),c.tech_.off("seekablechanged",g),c.tech_.off("waiting",e),c.tech_.off(wm,f),c.tech_.off("canplay",d),c.checkCurrentTimeTimeout_&&vb.clearTimeout(c.checkCurrentTimeTimeout_),c.cancelTimer_()}}return a.prototype.monitorCurrentTime_=function(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&vb.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=vb.setTimeout(this.monitorCurrentTime_.bind(this),250)},a.prototype.checkCurrentTime_=function(){if(this.tech_.seeking()&&this.fixesBadSeeks_())return this.consecutiveUpdates=0,void(this.lastRecordedTime=this.tech_.currentTime());if(!this.tech_.paused()&&!this.tech_.seeking()){var a=this.tech_.currentTime(),b=this.tech_.buffered();return this.lastRecordedTime===a&&(!b.length||a+pk>=b.end(b.length-1))?this.techWaiting_():void(this.consecutiveUpdates>=5&&a===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):a===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=a))}},a.prototype.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},a.prototype.fixesBadSeeks_=function(){var a=this.tech_.seeking(),b=this.seekable(),c=this.tech_.currentTime(),d=void 0;if(a&&this.afterSeekableWindow_(b,c)){var e=b.end(b.length-1);d=e}if(a&&this.beforeSeekableWindow_(b,c)){var f=b.start(0);d=f+pk}return"undefined"!=typeof d?(this.logger_("Trying to seek outside of seekable at time "+c+" with "+("seekable range "+uk(b)+". Seeking to ")+(d+".")),this.tech_.setCurrentTime(d),!0):!1},a.prototype.waiting_=function(){if(!this.techWaiting_()){var a=this.tech_.currentTime(),b=this.tech_.buffered(),c=rk(b,a);return c.length&&a+3<=c.end(0)?(this.cancelTimer_(),this.tech_.setCurrentTime(a),this.logger_("Stopped at "+a+" while inside a buffered region "+("["+c.start(0)+" -> "+c.end(0)+"]. Attempting to resume ")+"playback by seeking to the current time."),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},a.prototype.techWaiting_=function(){var a=this.seekable(),b=this.tech_.currentTime();if(this.tech_.seeking()&&this.fixesBadSeeks_())return!0;if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(a,b)){var c=a.end(a.length-1);return this.logger_("Fell out of live window at time "+b+". Seeking to live point (seekable end) "+c),this.cancelTimer_(),this.tech_.setCurrentTime(c),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var d=this.tech_.buffered(),e=sk(d,b);if(this.videoUnderflow_(e,d,b))return this.cancelTimer_(),this.tech_.setCurrentTime(b),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;if(e.length>0){var f=e.start(0)-b;return this.logger_("Stopped at "+b+", setting timer for "+f+", seeking to "+e.start(0)),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*f,b),!0}return!1},a.prototype.afterSeekableWindow_=function(a,b){return a.length&&b>a.end(a.length-1)+pk?!0:!1},a.prototype.beforeSeekableWindow_=function(a,b){return a.length&&a.start(0)>0&&b<a.start(0)-pk?!0:!1},a.prototype.videoUnderflow_=function(a,b,c){if(0===a.length){var d=this.gapFromVideoUnderflow_(b,c);if(d)return this.logger_("Encountered a gap in video from "+d.start+" to "+d.end+". Seeking to current time "+c),!0}return!1},a.prototype.skipTheGap_=function(a){var b=this.tech_.buffered(),c=this.tech_.currentTime(),d=sk(b,c);this.cancelTimer_(),0!==d.length&&c===a&&(this.logger_("skipTheGap_:","currentTime:",c,"scheduled currentTime:",a,"nextRange start:",d.start(0)),this.tech_.setCurrentTime(d.start(0)+ok),this.tech_.trigger({type:"usage",name:"hls-gap-skip"}))},a.prototype.gapFromVideoUnderflow_=function(a,b){for(var c=tk(a),d=0;d<c.length;d++){var e=c.start(d),f=c.end(d);if(4>b-e&&b-e>2)return{start:e,end:f}}return null},a}(),ym={errorInterval:30,getSource:function(a){var b=this.tech({IWillNotUseThisInPlugins:!0}),c=b.currentSource_;return a(c)}},zm=function Qm(a,b){var c=0,d=0,e=kb.mergeOptions(ym,b);a.ready(function(){a.trigger({type:"usage",name:"hls-error-reload-initialized"})});var f=function(){d&&a.currentTime(d)},g=function(b){null!==b&&void 0!==b&&(d=a.duration()!==1/0&&a.currentTime()||0,a.one("loadedmetadata",f),a.src(b),a.trigger({type:"usage",name:"hls-error-reload"}),a.play())},h=function(){return Date.now()-c<1e3*e.errorInterval?void a.trigger({type:"usage",name:"hls-error-reload-canceled"}):e.getSource&&"function"==typeof e.getSource?(c=Date.now(),e.getSource.call(a,g)):void kb.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},i=function k(){a.off("loadedmetadata",f),a.off("error",h),a.off("dispose",k)},j=function(b){i(),Qm(a,b)};a.on("error",h),a.on("dispose",i),a.reloadSourceOnError=j},Am=function(a){zm(this,a)},Bm="1.0.0",Cm={PlaylistLoader:Fj,Playlist:bk,Decrypter:tj,AsyncStream:qj,decrypt:sj,utils:nk,STANDARD_PLAYLIST_SELECTOR:Jl,INITIAL_PLAYLIST_SELECTOR:Ll,comparePlaylistBandwidth:Gl,comparePlaylistResolution:Hl,xhr:ek()},Dm=4194304;["GOAL_BUFFER_LENGTH","MAX_GOAL_BUFFER_LENGTH","GOAL_BUFFER_LENGTH_RATE","BUFFER_LOW_WATER_LINE","MAX_BUFFER_LOW_WATER_LINE","BUFFER_LOW_WATER_LINE_RATE","BANDWIDTH_VARIANCE"].forEach(function(a){Object.defineProperty(Cm,a,{get:function(){return kb.log.warn("using Hls."+a+" is UNSAFE be sure you know what you are doing"),gl[a]},set:function(b){return kb.log.warn("using Hls."+a+" is UNSAFE be sure you know what you are doing"),"number"!=typeof b||0>b?void kb.log.warn("value of Hls."+a+" must be greater than or equal to 0"):void(gl[a]=b)}})});var Em=function(a){var b=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i;if(b.test(a))return"hls";var c=/^application\/dash\+xml/i;return c.test(a)?"dash":null},Fm=function(a,b){for(var c=b.media(),d=-1,e=0;e<a.length;e++)if(a[e].id===c.uri){d=e;break}a.selectedIndex_=d,a.trigger({selectedIndex:d,type:"change"})},Gm=function(a,b){b.representations().forEach(function(b){a.addQualityLevel(b)}),Fm(a,b.playlists)};Cm.canPlaySource=function(){return kb.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Hm=function(a,b,c){if(!a)return a;var d={};for(var e in a)d[e]={audioContentType:'audio/mp4; codecs="'+c.attributes.CODECS+'"',videoContentType:'video/mp4; codecs="'+b.attributes.CODECS+'"'},b.contentProtection&&b.contentProtection[e]&&b.contentProtection[e].pssh&&(d[e].pssh=b.contentProtection[e].pssh),"string"==typeof a[e]&&(d[e].url=a[e]);return kb.mergeOptions(a,d)},Im=function(a){if("dash"===a.options_.sourceType){var b=kb.players[a.tech_.options_.playerId];if(b.eme){var c=Hm(a.source_.keySystems,a.playlists.media(),a.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader.media());c&&(b.currentSource().keySystems=c)}}};Cm.supportsNativeHls=function(){var a=Ab.createElement("video");if(!kb.getTech("Html5").isSupported())return!1;var b=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return b.some(function(b){return/maybe|probably/i.test(a.canPlayType(b))})}(),Cm.supportsNativeDash=function(){return kb.getTech("Html5").isSupported()?/maybe|probably/i.test(Ab.createElement("video").canPlayType("application/dash+xml")):!1}(),Cm.supportsTypeNatively=function(a){return"hls"===a?Cm.supportsNativeHls:"dash"===a?Cm.supportsNativeDash:!1},Cm.isSupported=function(){return kb.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")};var Jm=kb.getComponent("Component"),Km=function(a){function b(c,d,e){Ib(this,b);var f=Kb(this,a.call(this,d,e.hls));if(d.options_&&d.options_.playerId){var g=kb(d.options_.playerId);g.hasOwnProperty("hls")||Object.defineProperty(g,"hls",{get:function(){return kb.log.warn("player.hls is deprecated. Use player.tech_.hls instead."),d.trigger({type:"usage",name:"hls-player-access"}),f}}),g.vhs=f,g.dash=f}if(f.tech_=d,f.source_=c,f.stats={},f.ignoreNextSeekingEvent_=!1,f.setOptions_(),f.options_.overrideNative&&(d.featuresNativeVideoTracks||d.featuresNativeAudioTracks))throw new Error("Overriding native HLS requires emulated tracks. See https://git.io/vMpjB");return f.on(Ab,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],function(a){var b=Ab.fullscreenElement||Ab.webkitFullscreenElement||Ab.mozFullScreenElement||Ab.msFullscreenElement;b&&b.contains(f.tech_.el())&&f.masterPlaylistController_.fastQualityChange_()}),f.on(f.tech_,"seeking",function(){return this.ignoreNextSeekingEvent_?void(this.ignoreNextSeekingEvent_=!1):void this.setCurrentTime(this.tech_.currentTime())}),f.on(f.tech_,"error",function(){this.masterPlaylistController_&&this.masterPlaylistController_.pauseLoading()}),f.on(f.tech_,"play",f.play),f}return Jb(b,a),b.prototype.setOptions_=function(){var a=this;this.options_.withCredentials=this.options_.withCredentials||!1,"number"!=typeof this.options_.blacklistDuration&&(this.options_.blacklistDuration=300),"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Dm),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Dm,["withCredentials","bandwidth"].forEach(function(b){"undefined"!=typeof a.source_[b]&&(a.options_[b]=a.source_[b])}),this.bandwidth=this.options_.bandwidth},b.prototype.src=function(a,b){var c=this;a&&(this.setOptions_(),this.options_.url=this.source_.src,this.options_.tech=this.tech_,this.options_.externHls=Cm,this.options_.sourceType=Em(b),this.masterPlaylistController_=new sm(this.options_),this.playbackWatcher_=new xm(kb.mergeOptions(this.options_,{seekable:function(){return c.seekable()}})),this.masterPlaylistController_.on("error",function(){var a=kb.players[c.tech_.options_.playerId];a.error(c.masterPlaylistController_.error)}),this.masterPlaylistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):Cm.STANDARD_PLAYLIST_SELECTOR.bind(this),this.masterPlaylistController_.selectInitialPlaylist=Cm.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.masterPlaylistController_.masterPlaylistLoader_,this.mediaSource=this.masterPlaylistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get:function(){return this.masterPlaylistController_.selectPlaylist},set:function(a){this.masterPlaylistController_.selectPlaylist=a.bind(this)}},throughput:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate},set:function(a){this.masterPlaylistController_.mainSegmentLoader_.throughput.rate=a,this.masterPlaylistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get:function(){return this.masterPlaylistController_.mainSegmentLoader_.bandwidth},set:function(a){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=a,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var a=1/(this.bandwidth||1),b=void 0;b=this.throughput>0?1/this.throughput:0;var c=Math.floor(1/(a+b));return c},set:function(){kb.log.error('The "systemBandwidth" property is read-only')}}}),Object.defineProperties(this.stats,{bandwidth:{get:function(){return c.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return c.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return c.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return c.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return c.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return c.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return c.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return c.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},buffered:{get:function(){return wk(c.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return c.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return c.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return c.tech_.name_},enumerable:!0},duration:{get:function(){return c.tech_.duration()},enumerable:!0},master:{get:function(){return c.playlists.master},enumerable:!0},playerDimensions:{get:function(){return c.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return wk(c.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return c.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.masterPlaylistController_.on("selectedinitialmedia",function(){vm(c),Im(c)}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.tech_.ready(function(){return c.setupQualityLevels_()}),this.tech_.el()&&this.tech_.src(kb.URL.createObjectURL(this.masterPlaylistController_.mediaSource)))},b.prototype.setupQualityLevels_=function(){var a=this,b=kb.players[this.tech_.options_.playerId];b&&b.qualityLevels&&(this.qualityLevels_=b.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){Gm(a.qualityLevels_,a)}),this.playlists.on("mediachange",function(){Fm(a.qualityLevels_,a.playlists)}))},b.prototype.play=function(){this.masterPlaylistController_.play()},b.prototype.setCurrentTime=function(a){this.masterPlaylistController_.setCurrentTime(a)},b.prototype.duration=function(){return this.masterPlaylistController_.duration()},b.prototype.seekable=function(){return this.masterPlaylistController_.seekable()},b.prototype.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),a.prototype.dispose.call(this)},b}(Jm),Lm={name:"videojs-http-streaming",VERSION:Bm,canHandleSource:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=kb.mergeOptions(kb.options,b);return Lm.canPlayType(a.type,c)},handleSource:function(a,b){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=kb.mergeOptions(kb.options,c);return b.hls=new Km(a,b,d),b.hls.xhr=ek(),b.hls.src(a.src,a.type),b.hls},canPlayType:function(a){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=kb.mergeOptions(kb.options,b),d=c.hls.overrideNative,e=Em(a),f=e&&(!Cm.supportsTypeNatively(e)||d);return f?"maybe":""}};return("undefined"==typeof kb.MediaSource||"undefined"==typeof kb.URL)&&(kb.MediaSource=$k,kb.URL=_k),$k.supportsNativeMediaSources()&&kb.getTech("Html5").registerSourceHandler(Lm,0),kb.HlsHandler=Km,kb.HlsSourceHandler=Lm,kb.Hls=Cm,kb.use||kb.registerComponent("Hls",Cm),kb.options.hls=kb.options.hls||{},kb.registerPlugin?kb.registerPlugin("reloadSourceOnError",Am):kb.plugin("reloadSourceOnError",Am),kb});
|