filesbox/web/dist/design/designstatic/chatroom/video/video.min.7.js

69 lines
469 KiB
JavaScript
Raw Permalink Normal View History

2024-07-26 06:10:54 +00:00
/**
* @license
* Video.js 7.6.5 <http://videojs.com/>
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
* Available under Apache License Version 2.0
* <https://github.com/videojs/video.js/blob/master/LICENSE>
*
* Includes vtt.js <https://github.com/mozilla/vtt.js>
* Available under Apache License Version 2.0
* <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
*/(function(k,U){typeof exports=="object"&&typeof module!="undefined"?module.exports=U(require("global/window"),require("global/document")):typeof define=="function"&&define.amd?define(["global/window","global/document"],U):(k=k||self).videojs=U(k.window,k.document)})(this,function(k,U){k=k&&k.hasOwnProperty("default")?k.default:k,U=U&&U.hasOwnProperty("default")?U.default:U;var as="7.6.5",zt=[],vc=function(t,i){return function(n,e,r){var a=i.levels[e],s=new RegExp("^("+a+")$");if(n!=="log"&&r.unshift(n.toUpperCase()+":"),r.unshift(t+":"),zt&&zt.push([].concat(r)),k.console){var o=k.console[n];o||n!=="debug"||(o=k.console.info||k.console.log),o&&a&&s.test(n)&&o[Array.isArray(r)?"apply":"call"](k.console,r)}}},Z=function t(i){function n(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];e("log",r,s)}var e,r="info";return e=vc(i,n),n.createLogger=function(a){return t(i+": "+a)},n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},n.level=function(a){if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error('"'+a+'" in not a valid log level');r=a}return r},(n.history=function(){return zt?[].concat(zt):[]}).filter=function(a){return(zt||[]).filter(function(s){return new RegExp(".*"+a+".*").test(s[0])})},n.history.clear=function(){zt&&(zt.length=0)},n.history.disable=function(){zt!==null&&(zt.length=0,zt=null)},n.history.enable=function(){zt===null&&(zt=[])},n.error=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("error",r,s)},n.warn=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("warn",r,s)},n.debug=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];return e("debug",r,s)},n}("VIDEOJS"),ss=Z.createLogger,_c=Object.prototype.toString,os=function(t){return de(t)?Object.keys(t):[]};function We(t,i){os(t).forEach(function(n){return i(t[n],n)})}function lt(t){for(var i=arguments.length,n=new Array(1<i?i-1:0),e=1;e<i;e++)n[e-1]=arguments[e];return Object.assign?Object.assign.apply(Object,[t].concat(n)):(n.forEach(function(r){r&&We(r,function(a,s){t[s]=a})}),t)}function de(t){return!!t&&typeof t=="object"}function bi(t){return de(t)&&_c.call(t)==="[object Object]"&&t.constructor===Object}function Zi(t,i){if(!t||!i||typeof k.getComputedStyle!="function")return"";var n=k.getComputedStyle(t);return n?n.getPropertyValue(i)||n[i]:""}function us(t){return typeof t=="string"&&/\S/.test(t)}function ls(t){if(/\s/.test(t))throw new Error("class has illegal whitespace characters")}function ze(){return U===k.document}function Ti(t){return de(t)&&t.nodeType===1}function cs(){try{return k.parent!==k.self}catch(t){return!0}}function hs(t){return function(i,n){if(!us(i))return U[t](null);us(n)&&(n=U.querySelector(n));var e=Ti(n)?n:U;return e[t]&&e[t](i)}}function vt(t,i,n,e){t===void 0&&(t="div"),i===void 0&&(i={}),n===void 0&&(n={});var r=U.createElement(t);return Object.getOwnPropertyNames(i).forEach(function(a){var s=i[a];a.indexOf("aria-")!==-1||a==="role"||a==="type"?(Z.warn(`Setting attributes in the second argument of createEl()
has been deprecated. Use the third argument instead.
createEl(type, properties, attributes). Attempting to set `+a+" to "+s+"."),r.setAttribute(a,s)):a==="textContent"?$e(r,s):r[a]=s}),Object.getOwnPropertyNames(n).forEach(function(a){r.setAttribute(a,n[a])}),e&&Jn(r,e),r}function $e(t,i){return typeof t.textContent=="undefined"?t.innerText=i:t.textContent=i,t}function Kn(t,i){i.firstChild?i.insertBefore(t,i.firstChild):i.appendChild(t)}function Te(t,i){return ls(i),t.classList?t.classList.contains(i):function(n){return new RegExp("(^|\\s)"+n+"($|\\s)")}(i).test(t.className)}function oe(t,i){return t.classList?t.classList.add(i):Te(t,i)||(t.className=(t.className+" "+i).trim()),t}function Si(t,i){return t.classList?t.classList.remove(i):(ls(i),t.className=t.className.split(/\s+/).filter(function(n){return n!==i}).join(" ")),t}function ds(t,i,n){var e=Te(t,i);if(typeof n=="function"&&(n=n(t,i)),typeof n!="boolean"&&(n=!e),n!==e)return n?oe(t,i):Si(t,i),t}function ps(t,i){Object.getOwnPropertyNames(i).forEach(function(n){var e=i[n];e===null||typeof e=="undefined"||e===!1?t.removeAttribute(n):t.setAttribute(n,e===!0?"":e)})}function ue(t){var i={},n=",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";if(t&&t.attributes&&0<t.attributes.length)for(var e=t.attributes,r=e.length-1;0<=r;r--){var a=e[r].name,s=e[r].value;typeof t[a]!="boolean"&&n.indexOf(","+a+",")===-1||(s=s!==null),i[a]=s}return i}function fs(t,i){return t.getAttribute(i)}function ki(t,i,n){t.setAttribute(i,n)}function tn(t,i){t.removeAttribute(i)}function ms(){U.body.focus(),U.onselectstart=function(){return!1}}function gs(){U.onselectstart=function(){return!0}}function Ci(t){if(t&&t.getBoundingClientRect&&t.parentNode){var i=t.getBoundingClientRect(),n={};return["bottom","height","left","right","top","width"].forEach(function(e){i[e]!==void 0&&(n[e]=i[e])}),n.height||(n.height=parseFloat(Zi(t,"height"))),n.width||(n.width=parseFloat(Zi(t,"width"))),n}}function ys(t){var i;if(t.getBoundingClientRect&&t.parentNode&&(i=t.getBoundingClientRect()),!i)return{left:0,top:0};var n=U.documentElement,e=U.body,r=n.clientLeft||e.clientLeft||0,a=k.pageXOffset||e.scrollLeft,s=i.left+a-r,o=n.clientTop||e.clientTop||0,u=k.pageYOffset||e.scrollTop,c=i.top+u-o;return{left:Math.round(s),top:Math.round(c)}}function Yn(t,i){var n={},e=ys(t),r=t.offsetWidth,a=t.offsetHeight,s=e.top,o=e.left,u=i.pageY,c=i.pageX;return i.changedTouches&&(c=i.changedTouches[0].pageX,u=i.changedTouches[0].pageY),n.y=Math.max(0,Math.min(1,(s-u+a)/a)),n.x=Math.max(0,Math.min(1,(c-o)/r)),n}function vs(t){return de(t)&&t.nodeType===3}function Qn(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function _s(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(function(i){return typeof i=="function"&&(i=i()),Ti(i)||vs(i)?i:typeof i=="string"&&/\S/.test(i)?U.createTextNode(i):void 0}).filter(function(i){return i})}function Jn(t,i){return _s(i).forEach(function(n){return t.appendChild(n)}),t}function bs(t,i){return Jn(Qn(t),i)}function Ge(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||t.button===0&&t.buttons===1}var Zn,pe=hs("querySelector"),Ts=hs("querySelectorAll"),Ss=Object.freeze({isReal:ze,isEl:Ti,isInFrame:cs,createEl:vt,textContent:$e,prependTo:Kn,hasClass:Te,addClass:oe,removeClass:Si,toggleClass:ds,setAttributes:ps,getAttributes:ue,getAttribute:fs,setAttribute:ki,removeAttribute:tn,blockTextSelection:ms,unblockTextSelection:gs,getBoundingClientRect:Ci,findPosition:ys,getPointerPosition:Yn,isTextNode:vs,emptyEl:Qn,normalizeContent:_s,appendContent:Jn,insertContent:bs,isSingleLeftClick:Ge,$:pe,$$:Ts}),ks=!1,bc=function(){if(ze()&&Zn.options.autoSetup!==!1){var t=Array.prototype.slice.call(U.getElementsByTagName("video")),i=Array.prototype.slice.call(U.getElementsByTagName("audio")),n=Array.prototype.slice.call(U.getElementsByTagName("video-js")),e=t.concat(i,n);if(e&&0<e.length)for(var r=0,a=e.length;r<a;r++){var s=e[r];if(!s||!s.getAttribute){tr(1);break}s.player===void 0&&s.getAttribute("data-setup")!==null&&Zn(s)}else ks||tr(1)}}
`),function(n){var e=n.indexOf(":"),r=xr(n.slice(0,e)).toLowerCase(),a=xr(n.slice(e+1));typeof i[r]=="undefined"?i[r]=a:function(s){return Object.prototype.toString.call(s)==="[object Array]"}(i[r])?i[r].push(a):i[r]=[i[r],a]}),i},gh=function(){for(var t={},i=0;i<arguments.length;i++){var n=arguments[i];for(var e in n)yh.call(n,e)&&(t[e]=n[e])}return t},yh=Object.prototype.hasOwnProperty,_o=ye;function bo(t,i,n){var e=t;return Fc(i)?(n=i,typeof t=="string"&&(e={uri:t})):e=gh(i,{uri:t}),e.callback=n,e}function ye(t,i,n){return To(i=bo(t,i,n))}function To(t){if(typeof t.callback=="undefined")throw new Error("callback argument missing");var i=!1,n=function(E,S,C){i||(i=!0,t.callback(E,S,C))};function e(E){return clearTimeout(o),E instanceof Error||(E=new Error(""+(E||"Unknown XMLHttpRequest Error"))),E.statusCode=0,n(E,_)}function r(){if(!s){var E;clearTimeout(o),E=t.useXDR&&u.status===void 0?200:u.status===1223?204:u.status;var S=_,C=null;return E!==0?(S={body:function(){var L=void 0;if(L=u.response?u.response:u.responseText||function(D){if(D.responseType==="document")return D.responseXML;var F=D.responseXML&&D.responseXML.documentElement.nodeName==="parsererror";return D.responseType!==""||F?null:D.responseXML}(u),b)try{L=JSON.parse(L)}catch(D){}return L}(),statusCode:E,method:d,headers:{},url:c,rawRequest:u},u.getAllResponseHeaders&&(S.headers=mh(u.getAllResponseHeaders()))):C=new Error("Internal XMLHttpRequest Error"),n(C,S,S.body)}}var a,s,o,u=t.xhr||null,c=(u=u||(t.cors||t.useXDR?new ye.XDomainRequest:new ye.XMLHttpRequest)).url=t.uri||t.url,d=u.method=t.method||"GET",h=t.body||t.data,f=u.headers=t.headers||{},y=!!t.sync,b=!1,_={body:void 0,headers:{},statusCode:0,method:d,url:c,rawRequest:u};if("json"in t&&t.json!==!1&&(b=!0,f.accept||f.Accept||(f.Accept="application/json"),d!=="GET"&&d!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),h=JSON.stringify(t.json===!0?h:t.json))),u.onreadystatechange=function(){u.readyState===4&&setTimeout(r,0)},u.onload=r,u.onerror=e,u.onprogress=function(){},u.onabort=function(){s=!0},u.ontimeout=e,u.open(d,c,!y,t.username,t.password),y||(u.withCredentials=!!t.withCredentials),!y&&0<t.timeout&&(o=setTimeout(function(){if(!s){s=!0,u.abort("timeout");var E=new Error("XMLHttpRequest timeout");E.code="ETIMEDOUT",e(E)}},t.timeout)),u.setRequestHeader)for(a in f)f.hasOwnProperty(a)&&u.setRequestHeader(a,f[a]);else if(t.headers&&!function(E){for(var S in E)if(E.hasOwnProperty(S))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(u.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(u),u.send(h||null),u}ye.XMLHttpRequest=k.XMLHttpRequest||function(){},ye.XDomainRequest="withCredentials"in new ye.XMLHttpRequest?ye.XMLHttpRequest:k.XDomainRequest,function(t,i){for(var n=0;n<t.length;n++)i(t[n])}(["get","put","post","patch","head","delete"],function(t){ye[t==="delete"?"del":t]=function(i,n,e){return(n=bo(i,n,e)).method=t.toUpperCase(),To(n)}});function So(t,i){var n=new k.WebVTT.Parser(k,k.vttjs,k.WebVTT.StringDecoder()),e=[];n.oncue=function(r){i.addCue(r)},n.onparsingerror=function(r){e.push(r)},n.onflush=function(){i.trigger({type:"loadeddata",target:i})},n.parse(t),0<e.length&&(k.console&&k.console.groupCollapsed&&k.console.groupCollapsed("Text Track parsing errors for "+i.src),e.forEach(function(r){return Z.error(r)}),k.console&&k.console.groupEnd&&k.console.groupEnd()),n.flush()}var Li=function(t){function i(e){var r;if(e===void 0&&(e={}),!e.tech)throw new Error("A tech was not provided.");var a=at(e,{kind:Bc[e.kind]||"subtitles",language:e.language||e.srclang||""}),s=Ks[a.mode]||"disabled",o=a.default;a.kind!=="metadata"&&a.kind!=="chapters"||(s="hidden"),(r=t.call(this,a)||this).tech_=a.tech,r.cues_=[],r.activeCues_=[];var u=new Xs(r.cues_),c=new Xs(r.activeCues_),d=!1,h=J(K(r),function(){this.activeCues=this.activeCues,d&&(this.trigger("cuechange"),d=!1)});return s!=="disabled"&&r.tech_.ready(function(){r.tech_.on("timeupdate",h)},!0),
`;)++c;var d=u.substr(0,c);return u[c]==="\r"&&++c,u[c]===`
`&&++c,i.buffer=u.substr(c),d}function e(u){u.match(/X-TIMESTAMP-MAP/)?Di(u,function(c,d){switch(c){case"X-TIMESTAMP-MAP":(function(h){var f=new xi;Di(h,function(y,b){switch(y){case"MPEGT":f.integer(y+"S",b);break;case"LOCA":f.set(y+"L",Ur(b))}},/[^\d]:/,/,/),i.ontimestampmap&&i.ontimestampmap({MPEGTS:f.get("MPEGTS"),LOCAL:f.get("LOCAL")})})(d)}},/=/):Di(u,function(c,d){switch(c){case"Region":(function(h){var f=new xi;if(Di(h,function(b,_){switch(b){case"id":f.set(b,_);break;case"width":f.percent(b,_);break;case"lines":f.integer(b,_);break;case"regionanchor":case"viewportanchor":var E=_.split(",");if(E.length!==2)break;var S=new xi;if(S.percent("x",E[0]),S.percent("y",E[1]),!S.has("x")||!S.has("y"))break;f.set(b+"X",S.get("x")),f.set(b+"Y",S.get("y"));break;case"scroll":f.alt(b,_,["up"])}},/=/,/\s/),f.has("id")){var y=new(i.vttjs.VTTRegion||i.window.VTTRegion);y.width=f.get("width",100),y.lines=f.get("lines",3),y.regionAnchorX=f.get("regionanchorX",0),y.regionAnchorY=f.get("regionanchorY",100),y.viewportAnchorX=f.get("viewportanchorX",0),y.viewportAnchorY=f.get("viewportanchorY",100),y.scroll=f.get("scroll",""),i.onregion&&i.onregion(y),i.regionList.push({id:f.get("id"),region:y})}})(d)}},/:/)}t&&(i.buffer+=i.decoder.decode(t,{stream:!0}));try{var r;if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;var a=(r=n()).match(/^WEBVTT([ \t].*)?$/);if(!a||!a[0])throw new te(te.Errors.BadSignature);i.state="HEADER"}for(var s=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(s?s=!1:r=n(),i.state){case"HEADER":/:/.test(r)?e(r):r||(i.state="ID");continue;case"NOTE":r||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){i.state="NOTE";break}if(!r)continue;if(i.cue=new(i.vttjs.VTTCue||i.window.VTTCue)(0,0,""),i.state="CUE",r.indexOf("-->")===-1){i.cue.id=r;continue}case"CUE":try{vh(r,i.cue,i.regionList)}catch(u){i.reportOrThrowError(u),i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":var o=r.indexOf("-->")!==-1;if(!r||o&&(s=!0)){i.oncue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}i.cue.text&&(i.cue.text+=`
`),i.cue.text+=r;continue;case"BADCUE":r||(i.state="ID");continue}}}catch(u){i.reportOrThrowError(u),i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),!t.cue&&t.state!=="HEADER"||(t.buffer+=`
`,t.parse()),t.state==="INITIAL")throw new te(te.Errors.BadSignature)}catch(i){t.reportOrThrowError(i)}return t.onflush&&t.onflush(),this}};var Ch=Ui,Eh={"":1,lr:1,rl:1},wh={start:1,middle:1,end:1,left:1,right:1};function Mr(t){return typeof t=="string"&&!!wh[t.toLowerCase()]&&t.toLowerCase()}function Io(t,i,n){this.hasBeenReset=!1;var e="",r=!1,a=t,s=i,o=n,u=null,c="",d=!0,h="auto",f="start",y=50,b="middle",_=50,E="middle";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return e},set:function(S){e=""+S}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(S){r=!!S}},startTime:{enumerable:!0,get:function(){return a},set:function(S){if(typeof S!="number")throw new TypeError("Start time must be set to a number.");a=S,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return s},set:function(S){if(typeof S!="number")throw new TypeError("End time must be set to a number.");s=S,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(S){o=""+S,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(S){u=S,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(S){var C=function(L){return typeof L=="string"&&!!Eh[L.toLowerCase()]&&L.toLowerCase()}(S);if(C===!1)throw new SyntaxError("An invalid or illegal string was specified.");c=C,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(S){d=!!S,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return h},set:function(S){if(typeof S!="number"&&S!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");h=S,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return f},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");f=C,this.hasBeenReset=!0}},position:{enumerable:!0,get:function(){return y},set:function(S){if(S<0||100<S)throw new Error("Position must be between 0 and 100.");y=S,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return b},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");b=C,this.hasBeenReset=!0}},size:{enumerable:!0,get:function(){return _},set:function(S){if(S<0||100<S)throw new Error("Size must be between 0 and 100.");_=S,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return E},set:function(S){var C=Mr(S);if(!C)throw new SyntaxError("An invalid or illegal string was specified.");E=C,this.hasBeenReset=!0}}}),this.displayState=void 0}Io.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Ah=Io,Ph={"":!0,up:!0};function Ri(t){return typeof t=="number"&&0<=t&&t<=100}function Ih(){var t=100,i=3,n=0,e=100,r=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(o){if(!Ri(o))throw new Error("Width must be between 0 and 100.");t=o}},lines:{enumerable:!0,get:function(){return i},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");i=o}},regionAnchorY:{enumerable:!0,get:function(){return e},set:function(o){if(!Ri(o))throw new Error("RegionAnchorX must be between 0 and 100.");e=o}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(o){if(!Ri(o))throw new Error("RegionAnchorY must be between 0 and 100.");n=o}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(o){if(!Ri(o))throw new Error("ViewportAnchorY must be between 0 and 100.");a=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Ri(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return s},set:function(o){var u=function(c){return typeof c=="string"&&!!Ph[c.toLowerCase()]&&c.toLowerCase()}(o);if(u===!1)throw new SyntaxError("An invalid or illegal string was specified.");s=u}}})}var Mi=vr(function(t){var i=t.exports={WebVTT:Ch,VTTCue:Ah,VTTRegion:Ih};k.vttjs=i,k.WebVTT=i.WebVTT;var n=i.VTTCue,e=i.VTTRegion,r=k.VTTCue,a=k.VTTRegion;i.shim=function(){k
<span aria-hidden="true" class="vjs-icon-placeholder"></span>
<span class="vjs-control-text"> `+this.localize("Captions")+`</span>
`),a+="</span>",t.prototype.createEl.call(this,n,lt({innerHTML:a},e),r)},i}(Bi);x.registerComponent("SubsCapsMenuItem",$o);var na=function(t){function i(e,r){var a;return r===void 0&&(r={}),(a=t.call(this,e,r)||this).label_="subtitles",-1<["en","en-us","en-ca","fr-ca"].indexOf(a.player_.language_)&&(a.label_="captions"),a.menuButton_.controlText(ft(a.label_)),a}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+t.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(){var e=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(e.push(new ea(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=t.prototype.createItems.call(this,e,$o)},i}(ii);na.prototype.kinds_=["captions","subtitles"],na.prototype.controlText_="Subtitles",x.registerComponent("SubsCapsButton",na);var Go=function(t){function i(e,r){var a,s=r.track,o=e.audioTracks();r.label=s.label||s.language||"Unknown",r.selected=s.enabled,(a=t.call(this,e,r)||this).track=s,a.addClass("vjs-"+s.kind+"-menu-item");function u(){for(var c=arguments.length,d=new Array(c),h=0;h<c;h++)d[h]=arguments[h];a.handleTracksChange.apply(K(a),d)}return o.addEventListener("change",u),a.on("dispose",function(){o.removeEventListener("change",u)}),a}j(i,t);var n=i.prototype;return n.createEl=function(e,r,a){var s='<span class="vjs-menu-item-text">'+this.localize(this.options_.label);return this.options_.track.kind==="main-desc"&&(s+=`
<span aria-hidden="true" class="vjs-icon-placeholder"></span>
<span class="vjs-control-text"> `+this.localize("Descriptions")+`</span>
`),s+="</span>",t.prototype.createEl.call(this,e,lt({innerHTML:s},r),a)},n.handleClick=function(e){var r=this.player_.audioTracks();t.prototype.handleClick.call(this,e);for(var a=0;a<r.length;a++){var s=r[a];s.enabled=s===this.track}},n.handleTracksChange=function(e){this.selected(this.track.enabled)},i}(Ni);x.registerComponent("AudioTrackMenuItem",Go);var Xo=function(t){function i(e,r){return r===void 0&&(r={}),r.tracks=e.audioTracks(),t.call(this,e,r)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-audio-button "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-audio-button "+t.prototype.buildWrapperCSSClass.call(this)},n.createItems=function(e){e===void 0&&(e=[]),this.hideThreshold_=1;for(var r=this.player_.audioTracks(),a=0;a<r.length;a++){var s=r[a];e.push(new Go(this.player_,{track:s,selectable:!0,multiSelectable:!1}))}return e},i}(Qr);Xo.prototype.controlText_="Audio Track",x.registerComponent("AudioTrackButton",Xo);var ra=function(t){function i(e,r){var a,s=r.rate,o=parseFloat(s,10);return r.label=s,r.selected=o===1,r.selectable=!0,r.multiSelectable=!1,(a=t.call(this,e,r)||this).label=s,a.rate=o,a.on(e,"ratechange",a.update),a}j(i,t);var n=i.prototype;return n.handleClick=function(e){t.prototype.handleClick.call(this),this.player().playbackRate(this.rate)},n.update=function(e){this.selected(this.player().playbackRate()===this.rate)},i}(Ni);ra.prototype.contentElType="button",x.registerComponent("PlaybackRateMenuItem",ra);var Ko=function(t){function i(e,r){var a;return(a=t.call(this,e,r)||this).updateVisibility(),a.updateLabel(),a.on(e,"loadstart",a.updateVisibility),a.on(e,"ratechange",a.updateLabel),a}j(i,t);var n=i.prototype;return n.createEl=function(){var e=t.prototype.createEl.call(this);return this.labelEl_=vt("div",{className:"vjs-playback-rate-value",innerHTML:"1x"}),e.appendChild(this.labelEl_),e},n.dispose=function(){this.labelEl_=null,t.prototype.dispose.call(this)},n.buildCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildCSSClass.call(this)},n.buildWrapperCSSClass=function(){return"vjs-playback-rate "+t.prototype.buildWrapperCSSClass.call(this)},n.createMenu=function(){var e=new Kr(this.player()),r=this.playbackRates();if(r)for(var a=r.length-1;0<=a;a--)e.addChild(new ra(this.player(),{rate:r[a]+"x"}));return e},n.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},n.handleClick=function(e){for(var r=this.player().playbackRate(),a=this.playbackRates(),s=a[0],o=0;o<a.length;o++)if(a[o]>r){s=a[o];break}this.player().playbackRate(s)},n.playbackRates=function(){return this.options_.playbackRates||this.options_.playerOptions&&this.options_.playerOptions.playbackRates},n.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length},n.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},n.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.innerHTML=this.player().playbackRate()+"x")},i}(Yr);Ko.prototype.controlText_="Playback Rate",x.registerComponent("PlaybackRateMenuButton",Ko);var Yo=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-spacer "+t.prototype.buildCSSClass.call(this)},n.createEl=function(){return t.prototype.createEl.call(this,"div",{className:this.buildCSSClass()})},i}(x);x.registerComponent("Spacer",Yo);var Gh=function(t){function i(){return t.apply(this,arguments)||this}j(i,t);var n=i.prototype;return n.buildCSSClass=function(){return"vjs-custom-control-spacer "+t.prototype.buildCSSClass.call(this)},n.createEl=function(){var e=t.prototype.createEl.call(this,{className:this.buildCSSClass()});return e.innerHTML="\xA0",e},i}(Yo);x.registerComponent("CustomControlSpacer",Gh);var _n=function(t){function i(){return t.apply(this,arguments)||this}return j(i,t),i.prototype.createEl=function(){return t.prototype.creat
This may prevent text tracks from loading.`),a.restoreMetadataTracksInIOSNativePlayer_(),(wi||hr||Ns)&&e.nativeControlsForTouch===!0&&a.setControls(!0),a.proxyWebkitFullscreen_(),a.triggerReady(),a}j(i,t);var n=i.prototype;return n.dispose=function(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),i.disposeMediaElement(this.el_),this.options_=null,t.prototype.dispose.call(this)},n.setupSourcesetHandling_=function(){Qh(this)},n.restoreMetadataTracksInIOSNativePlayer_=function(){function e(){r=[];for(var o=0;o<a.length;o++){var u=a[o];u.kind==="metadata"&&r.push({track:u,storedMode:u.mode})}}var r,a=this.textTracks();e(),a.addEventListener("change",e),this.on("dispose",function(){return a.removeEventListener("change",e)});function s(){for(var o=0;o<r.length;o++){var u=r[o];u.track.mode==="disabled"&&u.track.mode!==u.storedMode&&(u.track.mode=u.storedMode)}a.removeEventListener("change",s)}this.on("webkitbeginfullscreen",function(){a.removeEventListener("change",e),a.removeEventListener("change",s),a.addEventListener("change",s)}),this.on("webkitendfullscreen",function(){a.removeEventListener("change",e),a.addEventListener("change",e),a.removeEventListener("change",s)})},n.overrideNative_=function(e,r){var a=this;if(r===this["featuresNative"+e+"Tracks"]){var s=e.toLowerCase();this[s+"TracksListeners_"]&&Object.keys(this[s+"TracksListeners_"]).forEach(function(o){a.el()[s+"Tracks"].removeEventListener(o,a[s+"TracksListeners_"][o])}),this["featuresNative"+e+"Tracks"]=!r,this[s+"TracksListeners_"]=null,this.proxyNativeTracksForType_(s)}},n.overrideNativeAudioTracks=function(e){this.overrideNative_("Audio",e)},n.overrideNativeVideoTracks=function(e){this.overrideNative_("Video",e)},n.proxyNativeTracksForType_=function(e){var r=this,a=$t[e],s=this.el()[a.getterName],o=this[a.getterName]();if(this["featuresNative"+a.capitalName+"Tracks"]&&s&&s.addEventListener){let d=function(){for(var h=[],f=0;f<o.length;f++){for(var y=!1,b=0;b<s.length;b++)if(s[b]===o[f]){y=!0;break}y||h.push(o[f])}for(;h.length;)o.removeTrack(h.shift())};var c=d,u={change:function(h){o.trigger({type:"change",target:o,currentTarget:o,srcElement:o})},addtrack:function(h){o.addTrack(h.track)},removetrack:function(h){o.removeTrack(h.track)}};this[a.getterName+"Listeners_"]=u,Object.keys(u).forEach(function(h){var f=u[h];s.addEventListener(h,f),r.on("dispose",function(y){return s.removeEventListener(h,f)})}),this.on("loadstart",d),this.on("dispose",function(h){return r.off("loadstart",d)})}},n.proxyNativeTracks_=function(){var e=this;$t.names.forEach(function(r){e.proxyNativeTracksForType_(r)})},n.createEl=function(){var e=this.options_.tag;if(!e||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(e){var r=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(r,e),i.disposeMediaElement(e),e=r}else{e=U.createElement("video");var a=at({},this.options_.tag&&ue(this.options_.tag));wi&&this.options_.nativeControlsForTouch===!0||delete a.controls,ps(e,lt(a,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload!="undefined"&&ki(e,"preload",this.options_.preload);for(var s=["loop","muted","playsinline","autoplay"],o=0;o<s.length;o++){var u=s[o],c=this.options_[u];typeof c!="undefined"&&(c?ki(e,u,u):tn(e,u),e[u]=c)}return e},n.handleLateInit_=function(e){if(e.networkState!==0&&e.networkState!==3){if(e.readyState===0){let u=function(){r=!0},c=function(){r||this.trigger("loadstart")};var s=u,o=c,r=!1;return this.on("loadstart",u),this.on("loadedmetadata",c),void this.ready(function(){this.off("loadstart",u),this.off("loadedmetadata",c),r||this.trigger("loadstart")})}var a=["loadstart"];a.push("loadedmetadata"),2<=e.readyState&&a.push("loadeddata"),3<=e.readyState&&a.push("canplay"),4<=e.readyState&&a.push("canplaythrough"),this.ready(function(){a.forEach(function(u){this.trigger(u)},this)})}},n.setCurrentTime=function(e){try{this.el_.currentTime=e}catch(r){Z(r,"Video is not ready. (Video.js)")}},n.duration=function(){var e=this;return this.el_.duration===1/0&&me&&le&&this.el_.currentTime===0?
.`+a+` {
width: `+e+`px;
height: `+r+`px;
}
.`+a+`.vjs-fluid {
padding-top: `+100*o+`%;
}
`)}else{var u=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,d=this.tech_&&this.tech_.el();d&&(0<=u&&(d.width=u),0<=c&&(d.height=c))}},n.loadTech_=function(e,r){var a=this;this.tech_&&this.unloadTech_();var s=ft(e),o=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(st.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;var u={source:r,autoplay:typeof this.autoplay()!="string"&&this.autoplay(),nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:this.id()+"_"+o+"_api",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,Promise:this.options_.Promise};Lt.names.forEach(function(d){var h=Lt[d];u[h.getterName]=a[h.privateName]}),lt(u,this.options_[s]),lt(u,this.options_[o]),lt(u,this.options_[e.toLowerCase()]),this.tag&&(u.tag=this.tag),r&&r.src===this.cache_.src&&0<this.cache_.currentTime&&(u.startTime=this.cache_.currentTime);var c=st.getTech(e);if(!c)throw new Error("No Tech named '"+s+"' exists! '"+s+"' should be registered using videojs.registerTech()'");this.tech_=new c(u),this.tech_.ready(J(this,this.handleTechReady_),!0),Oc(this.textTracksJson_||[],this.tech_),hu.forEach(function(d){a.on(a.tech_,d,a["handleTech"+ft(d)+"_"])}),Object.keys(la).forEach(function(d){a.on(a.tech_,d,function(h){a.tech_.playbackRate()===0&&a.tech_.seeking()?a.queuedCallbacks_.push({callback:a["handleTech"+la[d]+"_"].bind(a),event:h}):a["handleTech"+la[d]+"_"](h)})}),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_,"enterpictureinpicture",this.handleTechEnterPictureInPicture_),this.on(this.tech_,"leavepictureinpicture",this.handleTechLeavePictureInPicture_),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()||s==="Html5"&&this.tag||Kn(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},n.unloadTech_=function(){var e=this;Lt.names.forEach(function(r){var a=Lt[r];e[a.privateName]=e[a.getterName]()}),this.textTracksJson_=Lc(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},n.tech=function(e){return e===void 0&&Z.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
See https://github.com/videojs/video.js/issues/2617 for more info.
`),this.tech_},n.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"mouseup",this.handleTechClick_),this.on(this.tech_,"dblclick",this.handleTechDoubleClick_),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_)},n.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_,"mouseup",this.handleTechClick_),this.off(this.tech_,"dblclick",this.handleTechDoubleClick_)},n.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},n.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(this.autoplay())},n.manualAutoplay_=function(e){var r=this;if(this.tech_&&typeof e=="string"){let o=function(){var u=r.muted();r.muted(!0);function c(){r.muted(u)}r.playTerminatedQueue_.push(c);var d=r.play();if(Pi(d))return d.catch(c)};var s=o,a;if(e==="any"&&this.muted()!==!0?Pi(a=this.play())&&(a=a.catch(o)):a=e==="muted"&&this.muted()!==!0?o():this.play(),Pi(a))return a.then(function(){r.trigger({type:"autoplay-success",autoplay:e})}).catch(function(u){r.trigger({type:"autoplay-failure",autoplay:e})})}},n.updateSourceCaches_=function(e){e===void 0&&(e="");var r=e,a="";typeof r!="string"&&(r=e.src,a=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],r&&!a&&(a=function(f,y){if(!y)return"";if(f.cache_.source.src===y&&f.cache_.source.type)return f.cache_.source.type;var b=f.cache_.sources.filter(function(C){return C.src===y});if(b.length)return b[0].type;for(var _=f.$$("source"),E=0;E<_.length;E++){var S=_[E];if(S.type&&S.src&&S.src===y)return S.type}return gn(y)}(this,r)),this.cache_.source=at({},e,{src:r,type:a});for(var s=this.cache_.sources.filter(function(f){return f.src&&f.src===r}),o=[],u=this.$$("source"),c=[],d=0;d<u.length;d++){var h=ue(u[d]);o.push(h),h.src&&h.src===r&&c.push(h.src)}c.length&&!s.length?this.cache_.sources=o:s.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=r},n.handleTechSourceset_=function(e){var r=this;if(!this.changingSrc_){var a=function(u){return r.updateSourceCaches_(u)},s=this.currentSource().src,o=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(o)&&(this.lastSource_&&(this.lastSource_.tech===o||this.lastSource_.player===s)||(a=function(){})),a(o),e.src||this.tech_.any(["sourceset","loadstart"],function(u){if(u.type!=="sourceset"){var c=r.techGet("currentSrc");r.lastSource_.tech=c,r.updateSourceCaches_(c)}})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})},n.hasStarted=function(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?(this.addClass("vjs-has-started"),this.trigger("firstplay")):this.removeClass("vjs-has-started"))},n.handleTechPlay_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")},n.handleTechRateChange_=function(){0<this.tech_.playbackRate()&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},n.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var r=this.currentTime();this.on("timeupdate",function a(){r!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",a))})},
.video-js {
width: 300px;
height: 150px;
}
.vjs-fluid {
padding-top: 56.25%
}
`)}}tr(1,w),w.VERSION=as,w.options=_t.prototype.options_,w.getPlayers=function(){return _t.players},w.getPlayer=function(t){var i,n=_t.players;if(typeof t=="string"){var e=fu(t),r=n[e];if(r)return r;i=pe("#"+e)}else i=t;if(Ti(i)){var a=i,s=a.player,o=a.playerId;if(s||n[o])return s||n[o]}},w.getAllPlayers=function(){return Object.keys(_t.players).map(function(t){return _t.players[t]}).filter(Boolean)},w.players=_t.players,w.getComponent=x.getComponent,w.registerComponent=function(t,i){st.isTech(i)&&Z.warn("The "+t+" tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),x.registerComponent.call(x,t,i)},w.getTech=st.getTech,w.registerTech=st.registerTech,w.use=function(t,i){Pe[t]=Pe[t]||[],Pe[t].push(i)},Object.defineProperty(w,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(w.middleware,"TERMINATOR",{value:mn,writeable:!1,enumerable:!0}),w.browser=Pc,w.TOUCH_ENABLED=wi,w.extend=function(t,i){i===void 0&&(i={});var n=function(){t.apply(this,arguments)},e={};for(var r in typeof i=="object"?(i.constructor!==Object.prototype.constructor&&(n=i.constructor),e=i):typeof i=="function"&&(n=i),function(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s&&(a.super_=s)}(n,t),e)e.hasOwnProperty(r)&&(n.prototype[r]=e[r]);return n},w.mergeOptions=at,w.bind=J,w.registerPlugin=ne.registerPlugin,w.deregisterPlugin=ne.deregisterPlugin,w.plugin=function(t,i){return Z.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ne.registerPlugin(t,i)},w.getPlugins=ne.getPlugins,w.getPlugin=ne.getPlugin,w.getPluginVersion=ne.getPluginVersion,w.addLanguage=function(t,i){var n;return t=(""+t).toLowerCase(),w.options.languages=at(w.options.languages,((n={})[t]=i,n)),w.options.languages[t]},w.log=Z,w.createLogger=ss,w.createTimeRange=w.createTimeRanges=Ee,w.formatTime=ti,w.setFormatTime=function(t){Hr=t},w.resetFormatTime=function(){Hr=Ro},w.parseUrl=Sr,w.isCrossOrigin=un,w.EventTarget=Pt,w.on=Ht,w.one=nn,w.off=Ct,w.trigger=Xe,w.xhr=_o,w.TextTrack=Li,w.AudioTrack=ko,w.VideoTrack=Co,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(function(t){w[t]=function(){return Z.warn("videojs."+t+"() is deprecated; use videojs.dom."+t+"() instead"),Ss[t].apply(null,arguments)}}),w.computedStyle=Zi,w.dom=Ss,w.url=jc;var mu=vr(function(t,i){var n,e,r,a,s;n=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/\?#]*\/)*.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,e=/^([^\/?#]*)(.*)$/,r=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(o,u,c){if(c=c||{},o=o.trim(),!(u=u.trim())){if(!c.alwaysNormalize)return o;var d=s.parseURL(o);if(!d)throw new Error("Error trying to parse base URL.");return d.path=s.normalizePath(d.path),s.buildURLFromParts(d)}var h=s.parseURL(u);if(!h)throw new Error("Error trying to parse relative URL.");if(h.scheme)return c.alwaysNormalize?(h.path=s.normalizePath(h.path),s.buildURLFromParts(h)):u;var f=s.parseURL(o);if(!f)throw new Error("Error trying to parse base URL.");if(!f.netLoc&&f.path&&f.path[0]!=="/"){var y=e.exec(f.path);f.netLoc=y[1],f.path=y[2]}f.netLoc&&!f.path&&(f.path="/");var b={scheme:f.scheme,netLoc:h.netLoc,path:null,params:h.params,query:h.query,fragment:h.fragment};if(!h.netLoc&&(b.netLoc=f.netLoc,h.path[0]!=="/"))if(h.path){var _=f.path,E=_.substring(0,_.lastIndexOf("/")+1)+h.path;b.path=s.normalizePath(E)}else b.path=f.path,h.params||(b.params=f.params,h.query||(b.query=f.query));return b.path===null&&(b.path=c.alwaysNormalize?s.normalizePath(h.path):h.path),s.buildURLFromParts(b)},parseURL:function(o){var u=n.exec(o);return u?{scheme:u[1]||"",netLoc:u[2]||"",path:u[3]||"",params:u[4]||"",query:u[5]||"",fragment:u[6]||""}:null},normalizePath:function(o){for(o=o.split("").reverse().join("").replace(r,"");o.l
`);-1<e;e=this.buffer.indexOf(`
`))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)},i}(pa),nd=function(t){function i(){var e;return(e=t.call(this)||this).customParsers=[],e.tagMappers=[],e}da(i,t);var n=i.prototype;return n.push=function(e){var r,a,s=this;(e=e.trim()).length!==0&&(e[0]==="#"?this.tagMappers.reduce(function(o,u){var c=u(e);return c===e?o:o.concat([c])},[e]).forEach(function(o){for(var u=0;u<s.customParsers.length;u++)if(s.customParsers[u].call(s,o))return;if(o.indexOf("#EXT")===0)if(o=o.replace("\r",""),r=/^#EXTM3U/.exec(o))s.trigger("data",{type:"tag",tagType:"m3u"});else{if(r=/^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(o))return a={type:"tag",tagType:"inf"},r[1]&&(a.duration=parseFloat(r[1])),r[2]&&(a.title=r[2]),void s.trigger("data",a);if(r=/^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"targetduration"},r[1]&&(a.duration=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"totalduration"},r[1]&&(a.duration=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-VERSION:?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"version"},r[1]&&(a.version=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"media-sequence"},r[1]&&(a.number=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(o))return a={type:"tag",tagType:"discontinuity-sequence"},r[1]&&(a.number=parseInt(r[1],10)),void s.trigger("data",a);if(r=/^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(o))return a={type:"tag",tagType:"playlist-type"},r[1]&&(a.playlistType=r[1]),void s.trigger("data",a);if(r=/^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(o))return a={type:"tag",tagType:"byterange"},r[1]&&(a.length=parseInt(r[1],10)),r[2]&&(a.offset=parseInt(r[2],10)),void s.trigger("data",a);if(r=/^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(o))return a={type:"tag",tagType:"allow-cache"},r[1]&&(a.allowed=!/NO/.test(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-MAP:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"map"},r[1]){var c=Fi(r[1]);if(c.URI&&(a.uri=c.URI),c.BYTERANGE){var d=c.BYTERANGE.split("@"),h=d[0],f=d[1];a.byterange={},h&&(a.byterange.length=parseInt(h,10)),f&&(a.byterange.offset=parseInt(f,10))}}s.trigger("data",a)}else if(r=/^#EXT-X-STREAM-INF:?(.*)$/.exec(o)){if(a={type:"tag",tagType:"stream-inf"},r[1]){if(a.attributes=Fi(r[1]),a.attributes.RESOLUTION){var y=a.attributes.RESOLUTION.split("x"),b={};y[0]&&(b.width=parseInt(y[0],10)),y[1]&&(b.height=parseInt(y[1],10)),a.attributes.RESOLUTION=b}a.attributes.BANDWIDTH&&(a.attributes.BANDWIDTH=parseInt(a.attributes.BANDWIDTH,10)),a.attributes["PROGRAM-ID"]&&(a.attributes["PROGRAM-ID"]=parseInt(a.attributes["PROGRAM-ID"],10))}s.trigger("data",a)}else{if(r=/^#EXT-X-MEDIA:?(.*)$/.exec(o))return a={type:"tag",tagType:"media"},r[1]&&(a.attributes=Fi(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-ENDLIST/.exec(o))s.trigger("data",{type:"tag",tagType:"endlist"});else if(r=/^#EXT-X-DISCONTINUITY/.exec(o))s.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(r=/^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(o))return a={type:"tag",tagType:"program-date-time"},r[1]&&(a.dateTimeString=r[1],a.dateTimeObject=new Date(r[1])),void s.trigger("data",a);if(r=/^#EXT-X-KEY:?(.*)$/.exec(o))return a={type:"tag",tagType:"key"},r[1]&&(a.attributes=Fi(r[1]),a.attributes.IV&&(a.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(a.attributes.IV=a.attributes.IV.substring(2)),a.attributes.IV=a.attributes.IV.match(/.{8}/g),a.attributes.IV[0]=parseInt(a.attributes.IV[0],16),a.attributes.IV[1]=parseInt(a.attributes.IV[1],16),a.attributes.IV[2]=parseInt(a.attributes.IV[2],16),a.attributes.IV[3]=parseInt(a.attributes.IV[3],16),a.attributes.IV=new Uint32Array(a.attributes.IV))),void s.trigger("data",a);if(r=/^#EXT-X-START:?(.*)$/.exec(o))return a={type:"tag",tagType:"start"},r[1]&&(a.attributes=Fi(r[1]),a.attributes["TIME-OFFSET"]=parseFloat(a.attributes["TIME-OFFSET"]),a.attributes.PRECISE=/YES/.test(a.attributes.PRECISE)),void s.t
`)},n.addParser=function(e){this.parseStream.addParser(e)},n.addTagMapper=function(e){this.parseStream.addTagMapper(e)},i}(pa),rd="INVALID_NUMBER_OF_PERIOD",ad="DASH_EMPTY_MANIFEST",sd="DASH_INVALID_XML",od="NO_BASE_URL",ud="SEGMENT_TIME_UNSPECIFIED",ld="UNSUPPORTED_UTC_TIMING_SCHEME";/*! @name mpd-parser @version 0.8.1 @license Apache-2.0 */function fa(t,i){return/^[a-z]+:/i.test(i)?i:(/\/\//i.test(t)||(t=Eu.buildAbsoluteURL(k.location.href,t)),Eu.buildAbsoluteURL(t,i))}function Hi(t){var i=t.baseUrl,n=i===void 0?"":i,e=t.source,r=e===void 0?"":e,a=t.range,s=a===void 0?"":a,o=t.indexRange,u=o===void 0?"":o,c={uri:r,resolvedUri:fa(n||"",r)};if(s||u){var d=(s||u).split("-"),h=parseInt(d[0],10),f=parseInt(d[1],10);c.byterange={length:f-h+1,offset:h}}return c}function ma(t){var i=t.type,n=i===void 0?"static":i,e=t.duration,r=t.timescale,a=r===void 0?1:r,s=t.sourceDuration,o=gd[n](t),u=function(d,h){for(var f=[],y=d;y<h;y++)f.push(y);return f}(o.start,o.end).map(function(d){return function(h,f){var y=d.duration,b=d.timescale,_=b===void 0?1:b,E=d.periodIndex,S=d.startNumber;return{number:(S===void 0?1:S)+h,duration:y/_,timeline:E,time:f*y}}}(t));if(n==="static"){var c=u.length-1;u[c].duration=s-e/a*c}return u}function bu(t){var i=t.baseUrl,n=t.initialization,e=n===void 0?{}:n,r=t.sourceDuration,a=t.timescale,s=a===void 0?1:a,o=t.indexRange,u=o===void 0?"":o,c=t.duration;if(!i)throw new Error(od);var d=Hi({baseUrl:i,source:e.sourceURL,range:e.range}),h=Hi({baseUrl:i,source:i,indexRange:u});if(h.map=d,c){var f=ma(t);f.length&&(h.duration=f[0].duration,h.timeline=f[0].timeline)}else r&&(h.duration=r/s,h.timeline=0);return h.number=0,[h]}function cd(t,i,n){for(var e=t.sidx.map?t.sidx.map:null,r=t.sidx.duration,a=t.timeline||0,s=t.sidx.byterange,o=s.offset+s.length,u=i.timescale,c=i.references.filter(function(S){return S.referenceType!==1}),d=[],h=o+i.firstOffset,f=0;f<c.length;f++){var y=i.references[f],b=y.referencedSize,_=y.subsegmentDuration,E=bu({baseUrl:n,timescale:u,timeline:a,periodIndex:a,duration:_,sourceDuration:r,indexRange:h+"-"+(h+b-1)})[0];e&&(E.map=e),d.push(E),h+=b}return t.segments=d,t}function Tu(t){return function(i){return Object.keys(i).map(function(n){return i[n]})}(t.reduce(function(i,n){var e,r=n.attributes.id+(n.attributes.lang||"");return i[r]?(n.segments[0]&&(n.segments[0].discontinuity=!0),(e=i[r].segments).push.apply(e,n.segments),n.attributes.contentProtection&&(i[r].attributes.contentProtection=n.attributes.contentProtection)):i[r]=n,i},{})).map(function(i){return i.discontinuityStarts=function(n,e){return n.reduce(function(r,a,s){return a[e]&&r.push(s),r},[])}(i.segments,"discontinuity"),i})}function ga(t,i){if(i===void 0&&(i={}),!Object.keys(i).length)return t;for(var n in t){var e=t[n];if(e.sidx){var r=e.sidx.uri+"-"+(s=e.sidx.byterange,o=s.offset+s.length-1,s.offset+"-"+o),a=i[r]&&i[r].sidx;e.sidx&&a&&cd(e,a,e.sidx.resolvedUri)}}var s,o;return t}function hd(t){var i,n=t.attributes,e=t.segments,r=t.sidx,a={attributes:(i={NAME:n.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:n.width,height:n.height},CODECS:n.codecs,BANDWIDTH:n.bandwidth},i["PROGRAM-ID"]=1,i),uri:"",endList:(n.type||"static")==="static",timeline:n.periodIndex,resolvedUri:"",targetDuration:n.duration,segments:e,mediaSequence:e.length?e[0].number:1};return n.contentProtection&&(a.contentProtection=n.contentProtection),r&&(a.sidx=r),a}function dd(t,i){var n;if(i===void 0&&(i={}),!t.length)return{};var e=t[0].attributes,r=e.sourceDuration,a=e.minimumUpdatePeriod,s=a===void 0?0:a,o=Tu(t.filter(function(h){var f=h.attributes;return f.mimeType==="video/mp4"||f.contentType==="video"})).map(hd),u=Tu(t.filter(function(h){var f=h.attributes;return f.mimeType==="audio/mp4"||f.contentType==="audio"})),c=t.filter(function(h){var f=h.attributes;return f.mimeType==="text/vtt"||f.contentType==="text"}),d={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(n={AUDIO:{},VIDEO:{}},n["CLOSED-CAPTIONS"]={},n.SUBTITLES={},n),uri:"",duration:r,playlists:ga(o,i),minimumUpdatePeriod:1e3*s};return u.length&&(d.mediaGroups.AUDIO.aud
`+Object.keys(e).filter(function(a){return a!=="type"&&a!=="boxes"}).map(function(a){var s=n+" "+a+": ",o=e[a];if(o instanceof Uint8Array||o instanceof Uint32Array){var u=Array.prototype.slice.call(new Uint8Array(o.buffer,o.byteOffset,o.byteLength)).map(function(c){return" "+("00"+c.toString(16)).slice(-2)}).join("").match(/.{1,24}/g);return u?u.length===1?s+"<"+u.join("").slice(1)+">":s+`<
`+u.map(function(c){return n+" "+c}).join(`
`)+`
`+n+" >":s+"<>"}return s+JSON.stringify(o,null,2).split(`
`).map(function(c,d){return d===0?c:n+" "+c}).join(`
`)}).join(`
`)+(e.boxes?`
`+Uu(e.boxes,i+1):"")}).join(`
`)},parseTfdt:De.tfdt,parseHdlr:De.hdlr,parseTfhd:De.tfhd,parseTrun:De.trun,parseSidx:De.sidx},kd=function(t){for(var i=0,n={payloadType:-1,payloadSize:0},e=0,r=0;i<t.byteLength&&t[i]!==128;){for(;t[i]===255;)e+=255,i++;for(e+=t[i++];t[i]===255;)r+=255,i++;if(r+=t[i++],!n.payload&&e===4){n.payloadType=e,n.payloadSize=r,n.payload=t.subarray(i,i+r);break}i+=r,r=e=0}return n},Cd=function(t){return t.payload[0]!==181||(t.payload[1]<<8|t.payload[2])!=49||String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])!=="GA94"||t.payload[7]!==3?null:t.payload.subarray(8,t.payload.length-1)},Ed=function(t,i){var n,e,r,a,s=[];if(!(64&i[0]))return s;for(e=31&i[0],n=0;n<e;n++)a={type:3&i[2+(r=3*n)],pts:t},4&i[2+r]&&(a.ccData=i[3+r]<<8|i[4+r],s.push(a));return s},wd=function(t){for(var i,n,e=t.byteLength,r=[],a=1;a<e-2;)t[a]===0&&t[a+1]===0&&t[a+2]===3?(r.push(a+2),a+=2):a++;if(r.length===0)return t;i=e-r.length,n=new Uint8Array(i);var s=0;for(a=0;a<i;s++,a++)s===r[0]&&(s++,r.shift()),n[a]=t[s];return n},Ad=4;xe.prototype.pipe=function(t){return this.on("data",function(i){t.push(i)}),this.on("done",function(i){t.flush(i)}),this.on("partialdone",function(i){t.partialFlush(i)}),this.on("endedtimeline",function(i){t.endTimeline(i)}),this.on("reset",function(i){t.reset(i)}),t},xe.prototype.push=function(t){this.trigger("data",t)},xe.prototype.flush=function(t){this.trigger("done",t)},xe.prototype.partialFlush=function(t){this.trigger("partialdone",t)},xe.prototype.endTimeline=function(t){this.trigger("endedtimeline",t)},xe.prototype.reset=function(t){this.trigger("reset",t)};function Xt(){Xt.prototype.init.call(this),this.captionPackets_=[],this.ccStreams_=[new pt(0,0),new pt(0,1),new pt(1,0),new pt(1,1)],this.reset(),this.ccStreams_.forEach(function(t){t.on("data",this.trigger.bind(this,"data")),t.on("partialdone",this.trigger.bind(this,"partialdone")),t.on("done",this.trigger.bind(this,"done"))},this)}var _a=xe;(Xt.prototype=new _a).push=function(t){var i,n,e;if(t.nalUnitType==="sei_rbsp"&&(i=kd(t.escapedRBSP)).payloadType===Ad&&(n=Cd(i)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));e=Ed(t.pts,n),this.captionPackets_=this.captionPackets_.concat(e),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},Xt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach(function(i){return t==="flush"?i.flush():i.partialFlush()},this)},Xt.prototype.flushStream=function(t){this.captionPackets_.length&&(this.captionPackets_.forEach(function(i,n){i.presortIndex=n}),this.captionPackets_.sort(function(i,n){return i.pts===n.pts?i.presortIndex-n.presortIndex:i.pts-n.pts}),this.captionPackets_.forEach(function(i){i.type<2&&this.dispatchCea608Packet(i)},this),this.captionPackets_.length=0),this.flushCCStreams(t)},Xt.prototype.flush=function(){return this.flushStream("flush")},Xt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Xt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(t){t.reset()})},Xt.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),this.activeCea608Channel_[t.type]!==null&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},Xt.prototype.setsChannel1Active=function(t){return(30720&t.ccData)==4096},Xt.prototype.setsChannel2Active=function(t){return(30720&t.ccData)==6144},Xt.prototype.setsTextOrXDSActive=function(t){return(28928&t.ccData)==256||(30974&t.ccData)==4138||(30974&t.ccData)==6186};function On(t){return t===null?"":(t=Pd[t]||t,String.fromCharCode(t))}function Ue(){for(var t=[],i=15;i--;)t.push("");return t}var Pd={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,
`).replace(/^\n+|\n+$/g,"");i.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,text:i,stream:this.name_})},pt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ue(),this.nonDisplayed_=Ue(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},pt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(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_},pt.prototype.isSpecialCharacter=function(t,i){return t===this.EXT_&&48<=i&&i<=63},pt.prototype.isExtCharacter=function(t,i){return(t===this.EXT_+1||t===this.EXT_+2)&&32<=i&&i<=63},pt.prototype.isMidRowCode=function(t,i){return t===this.EXT_&&32<=i&&i<=47},pt.prototype.isOffsetControlCode=function(t,i){return t===this.OFFSET_&&33<=i&&i<=35},pt.prototype.isPAC=function(t,i){return t>=this.BASE_&&t<this.BASE_+8&&64<=i&&i<=127},pt.prototype.isColorPAC=function(t){return 64<=t&&t<=79||96<=t&&t<=127},pt.prototype.isNormalChar=function(t){return 32<=t&&t<=127},pt.prototype.setRollUp=function(t,i){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=Ue(),this.displayed_=Ue()),i!==void 0&&i!==this.row_)for(var n=0;n<this.rollUpRows_;n++)this.displayed_[i-n]=this.displayed_[this.row_-n],this.displayed_[this.row_-n]="";i===void 0&&(i=this.row_),this.topRow_=i-this.rollUpRows_+1},pt.prototype.addFormatting=function(t,i){this.formatting_=this.formatting_.concat(i);var n=i.reduce(function(e,r){return e+"<"+r+">"},"");this[this.mode_](t,n)},pt.prototype.clearFormatting=function(t){if(this.formatting_.length){var i=this.formatting_.reverse().reduce(function(n,e){return n+"</"+e+">"},"");this.formatting_=[],this[this.mode_](t,i)}},pt.prototype.popOn=function(t,i){var n=this.nonDisplayed_[this.row_];n+=i,this.nonDisplayed_[this.row_]=n},pt.prototype.rollUp=function(t,i){var n=this.displayed_[this.row_];n+=i,this.displayed_[this.row_]=n},pt.prototype.shiftRowsUp_=function(){var t;for(t=0;t<this.topRow_;t++)this.displayed_[t]="";for(t=this.row_+1;t<15;t++)this.displayed_[t]="";for(t=this.topRow_;t<this.row_;t++)this.displayed_[t]=this.displayed_[t+1];this.displayed_[this.row_]=""},pt.prototype.paintOn=function(t,i){var n=this.displayed_[this.row_];n+=i,this.displayed_[this.row_]=n};function Ld(t,i){for(var n=t,e=0;e<i.length;e++){var r=i[e];if(n<r.size)return r;n-=r.size}return null}function Od(t,i){var n=re.findBox(t,["moof","traf"]),e=re.findBox(t,["mdat"]),r={},a=[];return e.forEach(function(s,o){var u=n[o];a.push({mdat:s,traf:u})}),a.forEach(function(s){var o,u=s.mdat,c=s.traf,d=re.findBox(c,["tfhd"]),h=Ln.parseTfhd(d[0]),f=h.trackId,y=re.findBox(c,["tfdt"]),b=0<y.length?Ln.parseTfdt(y[0]).baseMediaDecodeTime:0,_=re.findBox(c,["trun"]);i===f&&0<_.length&&(o=function(E,S,C){var L,D,F,B,H=new DataView(E.buffer,E.byteOffset,E.byteLength),V=[];for(D=0;D+4<E.length;D+=F)if(F=H.getUint32(D),D+=4,!(F<=0))switch(31&E[D]){case 6:var R=E.subarray(D+1,D+1+F),W=Ld(D,S);L={nalUnitType:"sei_rbsp",size:F,data:R,escapedRBSP:Dd(R),trackId:C},W?(L.pts=W.pts,L.dts=W.dts,B=W):(L.pts=B.pts,L.dts=B.dts),V.push(L)}return V}(u,function(E,S,C){var L=S,D=C.defaultSampleDuration||0,F=C.defaultSampleSize||0,B=C.trackId,H=[];return E.forEach(function(V){var R=Ln.parseTrun(V).samples;R.forEach(function(W){W.duration===void 0&&(W.duration=D),W.size===void 0&&(W.size=F),W.trackId=B,W.dts=L,W.compositionTimeOffset===void 0&&(W.compositionTimeOffset=0),W.pts=L+W.compositionTimeOffset,L+=W.duration}),H=H.concat(R)}),H}(_,b,h),f),
* @videojs/http-streaming
* @version 1.10.6
* @copyright 2019 Brightcove, Inc
* @license Apache-2.0
*/var ie=function(t,i,n){return i&&Wu(t.prototype,i),n&&Wu(t,n),t};function Wu(t,i){for(var n=0;n<i.length;n++){var e=i[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(t,e.key,e)}}function ce(t,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof i);t.prototype=Object.create(i&&i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i&&(Object.setPrototypeOf?Object.setPrototypeOf(t,i):t.__proto__=i)}function ae(t,i){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!i||typeof i!="object"&&typeof i!="function"?t:i}function Mn(t,i){["AUDIO","SUBTITLES"].forEach(function(n){for(var e in t.mediaGroups[n])for(var r in t.mediaGroups[n][e]){var a=t.mediaGroups[n][e][r];i(a,n,e,r)}})}function Sa(t,i){var n=ka(t,{}),e=n.playlists[i.uri];if(!e||e.segments&&i.segments&&e.segments.length===i.segments.length&&e.endList===i.endList&&e.mediaSequence===i.mediaSequence)return null;var r=ka(e,i);e.segments&&(r.segments=function(s,o,u){var c=o.slice();u=u||0;for(var d=Math.min(s.length,o.length+u),h=u;h<d;h++)c[h-u]=ka(s[h],c[h-u]);return c}(e.segments,i.segments,i.mediaSequence-e.mediaSequence)),r.segments.forEach(function(s){(function(o,u){o.resolvedUri||(o.resolvedUri=Ne(u,o.uri)),o.key&&!o.key.resolvedUri&&(o.key.resolvedUri=Ne(u,o.key.uri)),o.map&&!o.map.resolvedUri&&(o.map.resolvedUri=Ne(u,o.map.uri))})(s,r.resolvedUri)});for(var a=0;a<n.playlists.length;a++)n.playlists[a].uri===i.uri&&(n.playlists[a]=r);return n.playlists[i.uri]=r,n}function zu(t){for(var i=t.playlists.length;i--;){var n=t.playlists[i];(t.playlists[n.uri]=n).resolvedUri=Ne(t.uri,n.uri),n.id=i,n.attributes||(n.attributes={},Zd.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute."))}}function $u(t){Mn(t,function(i){i.uri&&(i.resolvedUri=Ne(t.uri,i.uri))})}function Gu(t,i){var n=t.segments[t.segments.length-1];return i&&n&&n.duration?1e3*n.duration:500*(t.targetDuration||10)}var Jd=function(t,i){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(n,e){var r=[],a=!0,s=!1,o=void 0;try{for(var u,c=n[Symbol.iterator]();!(a=(u=c.next()).done)&&(r.push(u.value),!e||r.length!==e);a=!0);}catch(d){s=!0,o=d}finally{try{!a&&c.return&&c.return()}finally{if(s)throw o}}return r}(t,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")},ka=w.mergeOptions,Zd=w.log,Nn=(ce(si,w.EventTarget),ie(si,[{key:"playlistRequestError",value:function(t,i,n){this.request=null,n&&(this.state=n),this.error={playlist:this.master.playlists[i],status:t.status,message:"HLS playlist request error at URL: "+i+".",responseText:t.responseText,code:500<=t.status?4:2},this.trigger("error")}},{key:"haveMetadata",value:function(t,i){var n=this;this.request=null,this.state="HAVE_METADATA";var e=new _u;this.customTagParsers.forEach(function(a){return e.addParser(a)}),this.customTagMappers.forEach(function(a){return e.addTagMapper(a)}),e.push(t.responseText),e.end(),e.manifest.uri=i,e.manifest.attributes=e.manifest.attributes||{};var r=Sa(this.master,e.manifest);this.targetDuration=e.manifest.targetDuration,r?(this.master=r,this.media_=this.master.playlists[e.manifest.uri]):this.trigger("playlistunchanged"),this.media().endList||(k.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=k.setTimeout(function(){n.trigger("mediaupdatetimeout")},Gu(this.media(),!!r))),this.trigger("loadedplaylist")}},{key:"dispose",value:function(){this.stopRequest(),k.clearTimeout(this.mediaUpdateTimeout),k.clearTimeout(this.finalRenditionTimeout)}},{key:"stopRequest",value:function(){if(this.request){var t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}},{key:"media",value:function(t,i){var n=this;if(!t)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof t=="string"){if(!this.master.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.master.playlists[t]}if(k.c
`;return n}function ip(t){var i=t.playlist,n=t.time,e=n===void 0?void 0:n,r=t.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(u,c){if(!c||!c.segments||c.segments.length===0)return null;for(var d=0,h=void 0,f=0;f<c.segments.length&&!(u<=(d=(h=c.segments[f]).videoTimingInfo?h.videoTimingInfo.transmuxedPresentationEnd:d+h.duration));f++);var y=c.segments[c.segments.length-1];if(y.videoTimingInfo&&y.videoTimingInfo.transmuxedPresentationEnd<u)return null;if(d<u){if(u>d+.25*y.duration)return null;h=y}return{segment:h,estimatedStart:h.videoTimingInfo?h.videoTimingInfo.transmuxedPresentationStart:d-h.duration,type:h.videoTimingInfo?"accurate":"estimate"}}(e,i);if(!a)return r({message:"valid programTime was not found"});if(a.type==="estimate")return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:e},o=function(u,c){if(!c.dateTimeObject)return null;var d=c.videoTimingInfo.transmuxerPrependedSeconds,h=u-(c.videoTimingInfo.transmuxedPresentationStart+d);return new Date(c.dateTimeObject.getTime()+1e3*h)}(e,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)}function sl(t){var i=t.programTime,n=t.playlist,e=t.retryCount,r=e===void 0?2:e,a=t.seekTo,s=t.pauseAfterSeek,o=s===void 0||s,u=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(typeof i=="undefined"||!n||!a)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!u.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(b){if(!b.segments||b.segments.length===0)return!1;for(var _=0;_<b.segments.length;_++)if(!b.segments[_].dateTimeObject)return!1;return!0}(n))return c({message:"programDateTime tags must be provided in the manifest "+n.resolvedUri});var d=function(b,_){var E=void 0;try{E=new Date(b)}catch(B){return null}if(!_||!_.segments||_.segments.length===0)return null;var S=_.segments[0];if(E<S.dateTimeObject)return null;for(var C=0;C<_.segments.length-1&&(S=_.segments[C],!(E<_.segments[C+1].dateTimeObject));C++);var L=_.segments[_.segments.length-1],D=L.dateTimeObject,F=L.videoTimingInfo?function(B){return B.transmuxedPresentationEnd-B.transmuxedPresentationStart-B.transmuxerPrependedSeconds}(L.videoTimingInfo):L.duration+.25*L.duration;return new Date(D.getTime()+1e3*F)<E?null:(D<E&&(S=L),{segment:S,estimatedStart:S.videoTimingInfo?S.videoTimingInfo.transmuxedPresentationStart:Bt.duration(_,_.mediaSequence+_.segments.indexOf(S)),type:S.videoTimingInfo?"accurate":"estimate"})}(i,n);if(!d)return c({message:i+" was not found in the stream"});var h=d.segment,f=function(b,_){var E=void 0,S=void 0;try{E=new Date(b),S=new Date(_)}catch(L){}var C=E.getTime();return(S.getTime()-C)/1e3}(h.dateTimeObject,i);if(d.type==="estimate")return r===0?c({message:i+" is not buffered yet. Try again"}):(a(d.estimatedStart+f),void u.one("seeked",function(){sl({programTime:i,playlist:n,retryCount:r-1,seekTo:a,pauseAfterSeek:o,tech:u,callback:c})}));var y=h.start+f;u.one("seeked",function(){return c(null,u.currentTime())}),o&&u.pause(),a(y)}function ol(t,i){var n=[],e=void 0;if(t&&t.length)for(e=0;e<t.length;e++)i(t.start(e),t.end(e))&&n.push([t.start(e),t.end(e)]);return w.createTimeRanges(n)}function ul(t,i){return ol(t,function(n,e){return n-.1<=i&&i<=e+.1})}function ll(t,i){return ol(t,function(n){return i<=n-1/30})}function Aa(t){var i=[];if(!t||!t.length)return"";for(var n=0;n<t.length;n++)i.push(t.start(n)+" => "+t.end(n));return i.join(", ")}function cl(t){for(var i=[],n=0;n<t.length;n++)i.push({start:t.start(n),end:t.end(n)});return i}function oi(t,i,n){var e=void 0,r=void 0;if(n&&n.cues)for(e=n.cues.length;e--;)(r=n.cues[e]).startTime<=i&&r.endTime>=t&&n.removeCue(r)}function hl(t){return isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}function np(t,i,n){var e=k.WebKitDataCue||k.VTTCue;if(i&&i.forEach(functio
`).replace(/^\n+|\n+$/g,"");p.length&&this.trigger("data",{startPts:this.startPts_,endPts:l,text:p,stream:this.name_})},ct.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ve(),this.nonDisplayed_=Ve(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},ct.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(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_},ct.prototype.isSpecialCharacter=function(l,p){return l===this.EXT_&&48<=p&&p<=63},ct.prototype.isExtCharacter=function(l,p){return(l===this.EXT_+1||l===this.EXT_+2)&&32<=p&&p<=63},ct.prototype.isMidRowCode=function(l,p){return l===this.EXT_&&32<=p&&p<=47},ct.prototype.isOffsetControlCode=function(l,p){return l===this.OFFSET_&&33<=p&&p<=35},ct.prototype.isPAC=function(l,p){return l>=this.BASE_&&l<this.BASE_+8&&64<=p&&p<=127},ct.prototype.isColorPAC=function(l){return 64<=l&&l<=79||96<=l&&l<=127},ct.prototype.isNormalChar=function(l){return 32<=l&&l<=127},ct.prototype.setRollUp=function(l,p){if(this.mode_!=="rollUp"&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(l),this.nonDisplayed_=Ve(),this.displayed_=Ve()),p!==void 0&&p!==this.row_)for(var m=0;m<this.rollUpRows_;m++)this.displayed_[p-m]=this.displayed_[this.row_-m],this.displayed_[this.row_-m]="";p===void 0&&(p=this.row_),this.topRow_=p-this.rollUpRows_+1},ct.prototype.addFormatting=function(l,p){this.formatting_=this.formatting_.concat(p);var m=p.reduce(function(g,v){return g+"<"+v+">"},"");this[this.mode_](l,m)},ct.prototype.clearFormatting=function(l){if(this.formatting_.length){var p=this.formatting_.reverse().reduce(function(m,g){return m+"</"+g+">"},"");this.formatting_=[],this[this.mode_](l,p)}},ct.prototype.popOn=function(l,p){var m=this.nonDisplayed_[this.row_];m+=p,this.nonDisplayed_[this.row_]=m},ct.prototype.rollUp=function(l,p){var m=this.displayed_[this.row_];m+=p,this.displayed_[this.row_]=m},ct.prototype.shiftRowsUp_=function(){var l;for(l=0;l<this.topRow_;l++)this.displayed_[l]="";for(l=this.row_+1;l<15;l++)this.displayed_[l]="";for(l=this.topRow_;l<this.row_;l++)this.displayed_[l]=this.displayed_[l+1];this.displayed_[this.row_]=""},ct.prototype.paintOn=function(l,p){var m=this.displayed_[this.row_];m+=p,this.displayed_[this.row_]=m};function tc(l,p){var m=1;for(p<l&&(m=-1);4294967296<Math.abs(p-l);)l+=8589934592*m;return l}function Ga(l){var p,m;Ga.prototype.init.call(this),this.type_=l||"shared",this.push=function(g){this.type_!=="shared"&&g.type!==this.type_||(m===void 0&&(m=g.dts),g.dts=tc(g.dts,m),g.pts=tc(g.pts,m),p=g.dts,this.trigger("data",g))},this.flush=function(){m=p,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){p=m=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}}var ec={CaptionStream:Jt,Cea608Stream:ct},Wt={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21};Ga.prototype=new Rt;function ic(l,p,m){var g,v="";for(g=p;g<m;g++)v+="%"+("00"+l[g].toString(16)).slice(-2);return v}function Wn(l,p,m){return decodeURIComponent(ic(l,p,m))}function zn(l){return l[0]<<21|l[1]<<14|l[2]<<7|l[3]}var Xa,tf=Ga,nc={TXXX:function(l){var p;if(l.data[0]===3){for(p=1;p<l.data.length;p++)if(l.data[p]===0){l.description=Wn(l.data,1,p),l.value=Wn(l.data,p+1,l.data.length).replace(/\0*$/,"");break}l.data=l.value}},WXXX:function(l){var p;if(l.data[0]===3){for(p=1;p<l.data.length;p++)if(l.data[p]===0){l.description=Wn(l.data,1,p),l.url=Wn(l.data,p+1,l.d
`.split("").map(function(t){return t.charCodeAt(0)})),vp=(ce(fi,Ba),ie(fi,[{key:"buffered_",value:function(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues.length)return w.createTimeRanges();var t=this.subtitlesTrack_.cues,i=t[0].startTime,n=t[t.length-1].startTime;return w.createTimeRanges([[i,n]])}},{key:"initSegment",value:function(t,i){var n=1<arguments.length&&i!==void 0&&i;if(!t)return null;var e=jn(t),r=this.initSegments_[e];if(n&&!r&&t.bytes){var a=Ul.byteLength+t.bytes.byteLength,s=new Uint8Array(a);s.set(t.bytes),s.set(Ul,t.bytes.byteLength),this.initSegments_[e]=r={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:s}}return r||t}},{key:"couldBeginLoading_",value:function(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}},{key:"init_",value:function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}},{key:"track",value:function(t){return typeof t=="undefined"||(this.subtitlesTrack_=t,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}},{key:"remove",value:function(t,i){oi(t,i,this.subtitlesTrack_)}},{key:"fillBuffer_",value:function(){var t=this;this.syncPoint_||(this.syncPoint_=this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_()));var i=this.checkBuffer_(this.buffered_(),this.playlist_,this.mediaIndex,this.hasPlayed_(),this.currentTime_(),this.syncPoint_);if(i=this.skipEmptySegments_(i)){if(this.syncController_.timestampOffsetForTimeline(i.timeline)===null)return this.syncController_.one("timestampoffset",function(){t.state="READY",t.paused()||t.monitorBuffer_()}),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(i)}}},{key:"skipEmptySegments_",value:function(t){for(;t&&t.segment.empty;)t=this.generateSegmentInfo_(t.playlist,t.mediaIndex+1,t.startOfSegment+t.duration,t.isSyncRequest);return t}},{key:"handleSegment_",value:function(){var t=this;if(this.pendingSegment_&&this.subtitlesTrack_){this.state="APPENDING";var i=this.pendingSegment_,n=i.segment;if(typeof k.WebVTT!="function"&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){let a=function(){t.subtitlesTrack_.tech_.off("vttjsloaded",e),t.error({message:"Error loading vtt.js"}),t.state="READY",t.pause(),t.trigger("error")};var r=a,e=void 0;return e=function(){t.subtitlesTrack_.tech_.off("vttjserror",a),t.handleSegment_()},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",e),void this.subtitlesTrack_.tech_.one("vttjserror",a)}n.requested=!0;try{this.parseVTTCues_(i)}catch(a){return this.error({message:a.message}),this.state="READY",this.pause(),this.trigger("error")}if(this.updateTimeMapping_(i,this.syncController_.timelines[i.timeline],this.playlist_),i.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");i.byteLength=i.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,i.cues.length&&this.remove(i.cues[0].endTime,i.cues[i.cues.length-1].endTime),i.cues.forEach(function(a){t.subtitlesTrack_.addCue(a)}),this.handleUpdateEnd_()}else this.state="READY"}},{key:"parseVTTCues_",value:function(t){var i=void 0,n=!1;typeof k.TextDecoder=="function"?i=new k.TextDecoder("utf8"):(i=k.WebVTT.StringDecoder(),n=!0);var e=new k.WebVTT.Parser(k,k.vttjs,i);if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},e.oncue=t.cues.push.bind(t.cues),e.ontimestampmap=function(s){return t.timestampmap=s},e.onparsingerror=function(s){w.log.warn("Error encountered when parsing cues: "+s.message)},t.segment.map){var r=t.segment.map.bytes;n&&(r=Dl(r)),e.parse(r)}var a=t.bytes;n&&(a=Dl(a)),e.parse(a),e.flush()}},{key:"updateTimeMapping_",value:function(t,i,n){var e=t.segment;if(i)if(t.cues.length){var r=t.timestampmap,a=r.MPEGTS/9e4-r.LOCAL+i.mapping;if(t.cues.forEach(function(u){u.startTime+=a,u.endTime+=a}),!n.syncInfo){var s=t.cues[0].startTime,o=t.cues[t.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+t.mediaIndex,time:Math.min(s,o-e.duration)}}}else e.empty=!0}}]),fi);function fi(t){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};Qt(this,fi