You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1262 lines
654 KiB
1262 lines
654 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define("../../chunks/tslib.es6 ../../core/Accessor ../../core/Logger ../../core/mathUtils ../../core/reactiveUtils ../../core/XHRAdapter ../../core/accessorSupport/decorators/property ../../core/has ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ./VideoCameraSensorModel ./videoUtils ../../chunks/_commonjsHelpers".split(" "),function(ya,fm,gm,hm,Gd,im,Aa,Gr,Hr,jm,km,Hd,jb){function pc(d,f){if(!(this instanceof pc))return new pc(d,f);this.nodeValue=this.data=d;this.length=d.length; |
|
this.ownerDocument=f||null}function Sb(d,f){if(!(this instanceof Sb))return new Sb(d);this.data=d||"";this.length=this.data.length;this.ownerDocument=f||null}function oh(d){switch(d.nodeType){case 3:return We(d.data);case 8:return"\x3c!--"+d.data+"--\x3e";default:var f=[],k=d.tagName;"http://www.w3.org/1999/xhtml"===d.namespaceURI&&(k=k.toLowerCase());var n=f.push,u="\x3c"+k;var a=[];for(var b in d){var c=d;var e=b,g=typeof c[e];c="style"===e&&0<Object.keys(c.style).length?!0:c.hasOwnProperty(e)&& |
|
("string"===g||"boolean"===g||"number"===g)&&"nodeName"!==e&&"className"!==e&&"tagName"!==e&&"textContent"!==e&&"innerText"!==e&&"namespaceURI"!==e&&"innerHTML"!==e;c&&a.push({name:b,value:d[b]})}for(var l in d._attributes)for(var p in d._attributes[l])b=d._attributes[l][p],a.push({name:(b.prefix?b.prefix+":":"")+p,value:b.value});d.className&&a.push({name:"class",value:d.className});a=a.length?ph(a):"";u+=a;a=d.dataset;l=[];for(t in a)l.push({name:"data-"+t,value:a[t]});var t=l.length?ph(l):"";n.call(f, |
|
u+t);-1<lm.indexOf(k)?f.push(" /\x3e"):(f.push("\x3e"),d.childNodes.length?f.push.apply(f,d.childNodes.map(oh)):d.textContent||d.innerText?f.push(We(d.textContent||d.innerText)):d.innerHTML&&f.push(d.innerHTML),f.push("\x3c/"+k+"\x3e"));return f.join("")}}function mm(d){if("string"===typeof d)return d;var f="";Object.keys(d).forEach(function(k){var n=d[k];k=k.replace(/[A-Z]/g,function(u){return"-"+u.toLowerCase()});f+=k+":"+n+";"});return f}function ph(d){var f=[];d.forEach(function(k){var n=k.name; |
|
k=k.value;"style"===n&&(k=mm(k));f.push(n+'\x3d"'+We(k).replace(/"/g,"\x26quot;")+'"')});return f.length?" "+f.join(" "):""}function We(d){var f="";"string"===typeof d?f=d:d&&(f=d.toString());return f.replace(/&/g,"\x26amp;").replace(/</g,"\x26lt;").replace(/>/g,"\x26gt;")}function fa(d,f,k){if(!(this instanceof fa))return new fa(d);k=void 0===k?"http://www.w3.org/1999/xhtml":k||null;this.nodeName=this.tagName="http://www.w3.org/1999/xhtml"===k?String(d).toUpperCase():d;this.className="";this.dataset= |
|
{};this.childNodes=[];this.parentNode=null;this.style={};this.ownerDocument=f||null;this.namespaceURI=k;this._attributes={};"INPUT"===this.tagName&&(this.type="text")}function tb(d){if(!(this instanceof tb))return new tb;this.childNodes=[];this.parentNode=null;this.ownerDocument=d||null}function Xe(d){}function Id(){if(!(this instanceof Id))return new Id;this.head=this.createElement("head");this.body=this.createElement("body");this.documentElement=this.createElement("html");this.documentElement.appendChild(this.head); |
|
this.documentElement.appendChild(this.body);this.childNodes=[this.documentElement];this.nodeType=9}function nm(d){void 0===d&&(d="");return d.toLowerCase().split(";").reduce(function(f,k){k=k.split("\x3d");var n=k[1];return"charset"===k[0].trim()?n.trim():f},"utf-8")}function om(d){for(var f in d)if(d.hasOwnProperty(f))return!1;return!0}function qh(d,f,k){var n=d;if(f){var u=pm.call(f);u="[object Function]"===u||"function"===typeof f&&"[object RegExp]"!==u||"undefined"!==typeof window&&(f===window.setTimeout|| |
|
f===window.alert||f===window.confirm||f===window.prompt)}else u=!1;u?(k=f,"string"===typeof d&&(n={uri:d})):n=qm({},f,{uri:d});n.callback=k;return n}function ub(d,f,k){f=qh(d,f,k);return rh(f)}function rh(d){function f(A){clearTimeout(x);A instanceof Error||(A=Error(""+(A||"Unknown XMLHttpRequest Error")));A.statusCode=0;var z=y;n||(n=!0,d.callback(A,z,void 0))}function k(){if(!b){clearTimeout(x);var A=d.useXDR&&void 0===u.status?200:1223===u.status?204:u.status;var z=y,E=null;if(0!==A){z=void 0; |
|
if(u.response)var I=u.response;else{if(!(z=u.responseText))a:{try{if("document"===u.responseType){z=u.responseXML;break a}I=u.responseXML&&"parsererror"===u.responseXML.documentElement.nodeName;if(""===u.responseType&&!I){z=u.responseXML;break a}}catch(G){}z=null}I=z}z=I;if(t)try{z=JSON.parse(z)}catch(G){}z={body:z,statusCode:A,method:e,headers:{},url:c,rawRequest:u};u.getAllResponseHeaders&&(z.headers=rm(u.getAllResponseHeaders()))}else E=Error("Internal XMLHttpRequest Error");A=z.body;n||(n=!0, |
|
d.callback(E,z,A))}}if("undefined"===typeof d.callback)throw Error("callback argument missing");var n=!1,u=d.xhr||null;u||=d.cors||d.useXDR?new ub.XDomainRequest:new ub.XMLHttpRequest;var a,b,c=u.url=d.uri||d.url,e=u.method=d.method||"GET",g=d.body||d.data,l=u.headers=d.headers||{},p=!!d.sync,t=!1,x,y={body:void 0,headers:{},statusCode:0,method:e,url:c,rawRequest:u};"json"in d&&!1!==d.json&&(t=!0,l.accept||l.Accept||(l.Accept="application/json"),"GET"!==e&&"HEAD"!==e&&(l["content-type"]||l["Content-Type"]|| |
|
(l["Content-Type"]="application/json"),g=JSON.stringify(!0===d.json?g:d.json)));u.onreadystatechange=function(){4===u.readyState&&setTimeout(k,0)};u.onload=k;u.onerror=f;u.onprogress=function(){};u.onabort=function(){b=!0};u.ontimeout=f;u.open(e,c,!p,d.username,d.password);p||(u.withCredentials=!!d.withCredentials);!p&&0<d.timeout&&(x=setTimeout(function(){if(!b){b=!0;u.abort("timeout");var A=Error("XMLHttpRequest timeout");A.code="ETIMEDOUT";f(A)}},d.timeout));if(u.setRequestHeader)for(a in l)l.hasOwnProperty(a)&& |
|
u.setRequestHeader(a,l[a]);else if(d.headers&&!om(d.headers))throw Error("Headers cannot be set on an XDomainRequest object");"responseType"in d&&(u.responseType=d.responseType);"beforeSend"in d&&"function"===typeof d.beforeSend&&d.beforeSend(u);u.send(g||null);return u}function sm(){}function $a(d,f){this.name="ParsingError";this.code=d.code;this.message=f||d.message}function Ye(d){d=d.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!d)return null;if(d[3]){var f=d[3].replace(":","");return 3600* |
|
(d[1]|0)+60*(d[2]|0)+(f|0)+(d[4]|0)/1E3}return 59<d[1]?3600*(d[1]|0)+60*(d[2]|0)+(d[4]|0)/1E3:60*(d[1]|0)+(d[2]|0)+(d[4]|0)/1E3}function Wc(){this.values=Ze(null)}function Xc(d,f,k,n){d=n?d.split(n):[d];for(var u in d)if("string"===typeof d[u]){var a=d[u].split(k);2===a.length&&(n=a[0].trim(),a=a[1].trim(),f(n,a))}}function tm(d,f,k){function n(){var b=Ye(d);if(null===b)throw new $a($a.Errors.BadTimeStamp,"Malformed timestamp: "+a);d=d.replace(/^[^\sa-zA-Z-]+/,"");return b}function u(){d=d.replace(/^\s+/, |
|
"")}var a=d;u();f.startTime=n();u();if("--\x3e"!==d.substr(0,3))throw new $a($a.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);d=d.substr(3);u();f.endTime=n();u();(function(b,c){var e=new Wc;Xc(b,function(g,l){switch(g){case "region":for(var p=k.length-1;0<=p;p--)if(k[p].id===l){e.set(g,k[p].region);break}break;case "vertical":e.alt(g,l,["rl","lr"]);break;case "line":l=l.split(",");p=l[0];e.integer(g,p);e.percent(g,p)?e.set("snapToLines",!1):null;e.alt(g, |
|
p,["auto"]);2===l.length&&e.alt("lineAlign",l[1],["start","center","end"]);break;case "position":l=l.split(",");e.percent(g,l[0]);2===l.length&&e.alt("positionAlign",l[1],["start","center","end"]);break;case "size":e.percent(g,l);break;case "align":e.alt(g,l,["start","center","end","left","right"])}},/:/,/\s/);c.region=e.get("region",null);c.vertical=e.get("vertical","");try{c.line=e.get("line","auto")}catch(g){}c.lineAlign=e.get("lineAlign","start");c.snapToLines=e.get("snapToLines",!0);c.size=e.get("size", |
|
100);try{c.align=e.get("align","center")}catch(g){c.align=e.get("align","middle")}try{c.position=e.get("position","auto")}catch(g){c.position=e.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},c.align)}c.positionAlign=e.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},c.align)})(d,f)}function sh(d,f){function k(){if(!f)return null;var p=f.match(/^([^<]*)(<[^>]*>?)?/);p=p[1]?p[1]:p[2];f=f.substr(p.length);return p}function n(p){$e.innerHTML= |
|
p;p=$e.textContent;$e.textContent="";return p}function u(p,t){var x=um[p];if(!x)return null;x=d.document.createElement(x);(p=vm[p])&&t&&(x[p]=t.trim());return x}for(var a=d.document.createElement("div"),b=a,c,e=[];null!==(c=k());)if("\x3c"===c[0])if("/"===c[1])e.length&&e[e.length-1]===c.substr(2).replace("\x3e","")&&(e.pop(),b=b.parentNode);else{var g=Ye(c.substr(1,c.length-2));if(g){var l=d.document.createProcessingInstruction("timestamp",g);b.appendChild(l)}else if(c=c.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/))!(l= |
|
u(c[1],c[3]))||th[l.localName]&&th[l.localName]!==b.localName||(c[2]&&(g=c[2].split("."),g.forEach(function(p){var t=/^bg_/.test(p);p=t?p.slice(3):p;uh.hasOwnProperty(p)&&(l.style[t?"background-color":"color"]=uh[p])}),l.className=g.join(" ")),e.push(c[1]),b.appendChild(l),b=l)}else b.appendChild(d.document.createTextNode(n(c)));return a}function wm(d){for(var f=0;f<vh.length;f++){var k=vh[f];if(d>=k[0]&&d<=k[1])return!0}return!1}function xm(d){function f(b,c){for(var e=c.childNodes.length-1;0<=e;e--)b.push(c.childNodes[e])} |
|
function k(b){if(!b||!b.length)return null;var c=b.pop(),e=c.textContent||c.innerText;if(e)return(c=e.match(/^.*(\n|\r)/))?(b.length=0,c[0]):e;if("ruby"===c.tagName)return k(b);if(c.childNodes)return f(b,c),k(b)}var n=[],u="";if(!d||!d.childNodes)return"ltr";for(f(n,d);u=k(n);)for(var a=0;a<u.length;a++)if(d=u.charCodeAt(a),wm(d))return"rtl";return"ltr"}function af(){}function Jd(d,f,k){this.cue=f;this.cueDiv=sh(d,f.text);var n={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:""===f.vertical?"horizontal-tb":"lr"===f.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv);this.div=d.document.createElement("div");n={direction:xm(this.cueDiv),writingMode:""===f.vertical?"horizontal-tb":"lr"===f.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===f.align?"center":f.align,font:k.font,whiteSpace:"pre-line",position:"absolute"};this.applyStyles(n); |
|
this.div.appendChild(this.cueDiv);d=0;switch(f.positionAlign){case "start":case "line-left":d=f.position;break;case "center":d=f.position-f.size/2;break;case "end":case "line-right":d=f.position-f.size}""===f.vertical?this.applyStyles({left:this.formatStyle(d,"%"),width:this.formatStyle(f.size,"%")}):this.applyStyles({top:this.formatStyle(d,"%"),height:this.formatStyle(f.size,"%")});this.move=function(u){this.applyStyles({top:this.formatStyle(u.top,"px"),bottom:this.formatStyle(u.bottom,"px"),left:this.formatStyle(u.left, |
|
"px"),right:this.formatStyle(u.right,"px"),height:this.formatStyle(u.height,"px"),width:this.formatStyle(u.width,"px")})}}function Pa(d){if(d.div){var f=d.div.offsetHeight;var k=d.div.offsetWidth;var n=d.div.offsetTop;var u=(u=d.div.childNodes)&&(u=u[0])&&u.getClientRects&&u.getClientRects();d=d.div.getBoundingClientRect();var a=u?Math.max(u[0]&&u[0].height||0,d.height/u.length):0}this.left=d.left;this.right=d.right;this.top=d.top||n;this.height=d.height||f;this.bottom=d.bottom||n+(d.height||f);this.width= |
|
d.width||k;this.lineHeight=void 0!==a?a:d.lineHeight}function qc(){}function bf(d){return"string"!==typeof d?!1:ym[d.toLowerCase()]?d.toLowerCase():!1}function wh(d,f,k){this.hasBeenReset=!1;var n="",u=!1,a=d,b=f,c=k,e=null,g="",l=!0,p="auto",t="start",x="auto",y="auto",A=100,z="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(E){n=""+E}},pauseOnExit:{enumerable:!0,get:function(){return u},set:function(E){u=!!E}},startTime:{enumerable:!0,get:function(){return a}, |
|
set:function(E){if("number"!==typeof E)throw new TypeError("Start time must be set to a number.");a=E;this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return b},set:function(E){if("number"!==typeof E)throw new TypeError("End time must be set to a number.");b=E;this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return c},set:function(E){c=""+E;this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return e},set:function(E){e=E;this.hasBeenReset=!0}},vertical:{enumerable:!0, |
|
get:function(){return g},set:function(E){E="string"!==typeof E?!1:zm[E.toLowerCase()]?E.toLowerCase():!1;if(!1===E)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");g=E;this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return l},set:function(E){l=!!E;this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return p},set:function(E){if("number"!==typeof E&&"auto"!==E)throw new SyntaxError("Line: an invalid number or illegal string was specified."); |
|
p=E;this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return t},set:function(E){(E=bf(E))?(t=E,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return x},set:function(E){if(0>E||100<E)throw Error("Position must be between 0 and 100.");x=E;this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return y},set:function(E){(E=bf(E))?(y=E,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}}, |
|
size:{enumerable:!0,get:function(){return A},set:function(E){if(0>E||100<E)throw Error("Size must be between 0 and 100.");A=E;this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return z},set:function(E){E=bf(E);if(!E)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");z=E;this.hasBeenReset=!0}}});this.displayState=void 0}function Yc(d){return"number"===typeof d&&0<=d&&100>=d}function nb(){nb=Object.assign?Object.assign.bind():function(d){for(var f=1;f<arguments.length;f++){var k= |
|
arguments[f],n;for(n in k)Object.prototype.hasOwnProperty.call(k,n)&&(d[n]=k[n])}return d};return nb.apply(this,arguments)}function Kd(d,f){void 0===f&&(f=Object);return f&&"function"===typeof f.freeze?f.freeze(d):d}function Am(d){return""!==d}function Bm(d,f){d.hasOwnProperty(f)||(d[f]=!0);return d}function xh(d){if(!d)return[];d=d?d.split(/[\t\n\f\r ]+/).filter(Am):[];return Object.keys(d.reduce(Bm,{}))}function Cm(d){return function(f){return d&&-1!==d.indexOf(f)}}function Zc(d,f){for(var k in d)Object.prototype.hasOwnProperty.call(d, |
|
k)&&(f[k]=d[k])}function Ua(d,f){var k=d.prototype;if(!(k instanceof f)){function n(){}n.prototype=f.prototype;n=new n;Zc(k,n);d.prototype=k=n}k.constructor!=d&&("function"!=typeof d&&console.error("unknown Class:"+d),k.constructor=d)}function Ba(d,f){if(f instanceof Error)var k=f;else k=this,Error.call(this,Ea[d]),this.message=Ea[d],Error.captureStackTrace&&Error.captureStackTrace(this,Ba);k.code=d;f&&(this.message=this.message+": "+f);return k}function Tb(){}function rc(d,f){this._node=d;this._refresh= |
|
f;cf(this)}function cf(d){var f=d._node._inc||d._node.ownerDocument._inc;if(d._inc!==f){var k=d._refresh(d._node);yh(d,"length",k.length);if(!d.$$length||k.length<d.$$length)for(var n=k.length;n in d;n++)Object.prototype.hasOwnProperty.call(d,n)&&delete d[n];Zc(k,d);d._inc=f}}function Ld(){}function zh(d,f){for(var k=d.length;k--;)if(d[k]===f)return k}function Ah(d,f,k,n){n?f[zh(f,n)]=k:f[f.length++]=k;d&&(k.ownerElement=d,f=d.ownerDocument)&&(n&&(f&&f._inc++,n.namespaceURI===sc.XMLNS&&delete d._nsMap[n.prefix? |
|
n.localName:""]),f&&f._inc++,k.namespaceURI===sc.XMLNS&&(d._nsMap[k.prefix?k.localName:""]=k.value))}function Bh(d,f,k){var n=zh(f,k);if(0<=n){for(var u=f.length-1;n<u;)f[n]=f[++n];f.length=u;d&&(f=d.ownerDocument)&&(f&&f._inc++,k.namespaceURI===sc.XMLNS&&delete d._nsMap[k.prefix?k.localName:""],k.ownerElement=null)}else throw new Ba(Ch,Error(d.tagName+"@"+k));}function Dh(){}function ka(){}function Eh(d){return"\x3c"==d&&"\x26lt;"||"\x3e"==d&&"\x26gt;"||"\x26"==d&&"\x26amp;"||'"'==d&&"\x26quot;"|| |
|
"\x26#"+d.charCodeAt()+";"}function $c(d,f){if(f(d))return!0;if(d=d.firstChild){do if($c(d,f))return!0;while(d=d.nextSibling)}}function ad(){this.ownerDocument=this}function df(d,f,k){if(d&&d._inc)if(d._inc++,d=f.childNodes,k)d[d.length++]=k;else{f=f.firstChild;for(k=0;f;)d[k++]=f,f=f.nextSibling;d.length=k;delete d[d.length]}}function Fh(d,f){var k=f.previousSibling,n=f.nextSibling;k?k.nextSibling=n:d.firstChild=n;n?n.previousSibling=k:d.lastChild=k;f.parentNode=null;f.previousSibling=null;f.nextSibling= |
|
null;df(d.ownerDocument,d);return f}function Ib(d){return d&&d.nodeType===ka.DOCUMENT_TYPE_NODE}function vb(d){return d&&d.nodeType===ka.ELEMENT_NODE}function ef(d){return d&&d.nodeType===ka.TEXT_NODE}function Gh(d,f){d=d.childNodes||[];if(wb(d,vb)||Ib(f))return!1;var k=wb(d,Ib);return!(f&&k&&d.indexOf(k)>d.indexOf(f))}function Hh(d,f){d=d.childNodes||[];if(wb(d,function(n){return vb(n)&&n!==f}))return!1;var k=wb(d,Ib);return!(f&&k&&d.indexOf(k)>d.indexOf(f))}function Dm(d,f,k){var n=d.childNodes|| |
|
[],u=f.childNodes||[];if(f.nodeType===ka.DOCUMENT_FRAGMENT_NODE){var a=u.filter(vb);if(1<a.length||wb(u,ef))throw new Ba(Va,"More than one element or text in fragment");if(1===a.length&&!Gh(d,k))throw new Ba(Va,"Element in fragment can not be inserted before doctype");}if(vb(f)&&!Gh(d,k))throw new Ba(Va,"Only one element can be added and only after doctype");if(Ib(f)){if(wb(n,Ib))throw new Ba(Va,"Only one doctype is allowed");d=wb(n,vb);if(k&&n.indexOf(d)<n.indexOf(k))throw new Ba(Va,"Doctype can only be inserted before an element"); |
|
if(!k&&d)throw new Ba(Va,"Doctype can not be appended since element is present");}}function Ih(d,f,k){var n=d.childNodes||[],u=f.childNodes||[];if(f.nodeType===ka.DOCUMENT_FRAGMENT_NODE){var a=u.filter(vb);if(1<a.length||wb(u,ef))throw new Ba(Va,"More than one element or text in fragment");if(1===a.length&&!Hh(d,k))throw new Ba(Va,"Element in fragment can not be inserted before doctype");}if(vb(f)&&!Hh(d,k))throw new Ba(Va,"Only one element can be added and only after doctype");if(Ib(f)){if(wb(n, |
|
function(b){return Ib(b)&&b!==k}))throw new Ba(Va,"Only one doctype is allowed");d=wb(n,vb);if(k&&n.indexOf(d)<n.indexOf(k))throw new Ba(Va,"Doctype can only be inserted before an element");}}function Md(d,f,k,n){if(!d||d.nodeType!==ka.DOCUMENT_NODE&&d.nodeType!==ka.DOCUMENT_FRAGMENT_NODE&&d.nodeType!==ka.ELEMENT_NODE)throw new Ba(Va,"Unexpected parent node type "+d.nodeType);if(k&&k.parentNode!==d)throw new Ba(Ch,"child not in parent");if(!f||!(vb(f)||ef(f)||Ib(f)||f.nodeType===ka.DOCUMENT_FRAGMENT_NODE|| |
|
f.nodeType===ka.COMMENT_NODE||f.nodeType===ka.PROCESSING_INSTRUCTION_NODE)||Ib(f)&&d.nodeType!==ka.DOCUMENT_NODE)throw new Ba(Va,"Unexpected node type "+f.nodeType+" for parent node type "+d.nodeType);d.nodeType===ka.DOCUMENT_NODE&&(n||Dm)(d,f,k);(n=f.parentNode)&&n.removeChild(f);if(f.nodeType===Jb){n=f.firstChild;if(null==n)return f;var u=f.lastChild}else n=u=f;var a=k?k.previousSibling:d.lastChild;n.previousSibling=a;u.nextSibling=k;a?a.nextSibling=n:d.firstChild=n;null==k?d.lastChild=u:k.previousSibling= |
|
u;do n.parentNode=d;while(n!==u&&(n=n.nextSibling));df(d.ownerDocument||d,d);f.nodeType==Jb&&(f.firstChild=f.lastChild=null);return f}function tc(){this._nsMap={}}function Nd(){}function bd(){}function ff(){}function gf(){}function hf(){}function jf(){}function Jh(){}function Kh(){}function kf(){}function Od(){}function lf(){}function Lh(d,f,k){f=d.prefix||"";d=d.namespaceURI;if(!d||"xml"===f&&d===sc.XML||d===sc.XMLNS)return!1;for(var n=k.length;n--;){var u=k[n];if(u.prefix===f)return u.namespace!== |
|
d}return!0}function mf(d,f,k){d.push(" ",f,'\x3d"',k.replace(/[<>&"\t\n\r]/g,Eh),'"')}function uc(d,f,k,n,u){u||=[];if(n)if(d=n(d)){if("string"==typeof d){f.push(d);return}}else return;switch(d.nodeType){case ob:var a=d.attributes,b=a.length,c=d.firstChild,e=d.tagName;k=sc.isHTML(d.namespaceURI)||k;var g=e;if(!k&&!d.prefix&&d.namespaceURI){for(var l,p=0;p<a.length;p++)if("xmlns"===a.item(p).name){l=a.item(p).value;break}if(!l)for(p=u.length-1;0<=p;p--){var t=u[p];if(""===t.prefix&&t.namespace===d.namespaceURI){l= |
|
t.namespace;break}}if(l!==d.namespaceURI)for(p=u.length-1;0<=p;p--)if(t=u[p],t.namespace===d.namespaceURI){t.prefix&&(g=t.prefix+":"+e);break}}f.push("\x3c",g);for(l=0;l<b;l++)p=a.item(l),"xmlns"==p.prefix?u.push({prefix:p.localName,namespace:p.value}):"xmlns"==p.nodeName&&u.push({prefix:"",namespace:p.value});for(l=0;l<b;l++){p=a.item(l);if(Lh(p,k,u)){t=p.prefix||"";var x=p.namespaceURI;mf(f,t?"xmlns:"+t:"xmlns",x);u.push({prefix:t,namespace:x})}uc(p,f,k,n,u)}e===g&&Lh(d,k,u)&&(t=d.prefix||"",x= |
|
d.namespaceURI,mf(f,t?"xmlns:"+t:"xmlns",x),u.push({prefix:t,namespace:x}));if(c||k&&!/^(?:meta|link|img|br|hr|input)$/i.test(e)){f.push("\x3e");if(k&&/^script$/i.test(e))for(;c;)c.data?f.push(c.data):uc(c,f,k,n,u.slice()),c=c.nextSibling;else for(;c;)uc(c,f,k,n,u.slice()),c=c.nextSibling;f.push("\x3c/",g,"\x3e")}else f.push("/\x3e");break;case Mh:case Jb:for(c=d.firstChild;c;)uc(c,f,k,n,u.slice()),c=c.nextSibling;break;case vc:return mf(f,d.name,d.value);case Pd:return f.push(d.data.replace(/[<&>]/g, |
|
Eh));case Nh:return f.push("\x3c![CDATA[",d.data,"]]\x3e");case Oh:return f.push("\x3c!--",d.data,"--\x3e");case Ph:k=d.publicId;n=d.systemId;f.push("\x3c!DOCTYPE ",d.name);k?(f.push(" PUBLIC ",k),n&&"."!=n&&f.push(" ",n),f.push("\x3e")):n&&"."!=n?f.push(" SYSTEM ",n,"\x3e"):((d=d.internalSubset)&&f.push(" [",d,"]"),f.push("\x3e"));break;case Qh:return f.push("\x3c?",d.target," ",d.data,"?\x3e");case Rh:return f.push("\x26",d.nodeName,";");default:f.push("??",d.nodeName)}}function Sh(d,f,k){switch(f.nodeType){case ob:var n= |
|
f.cloneNode(!1);n.ownerDocument=d;case Jb:break;case vc:k=!0}n||=f.cloneNode(!1);n.ownerDocument=d;n.parentNode=null;if(k)for(f=f.firstChild;f;)n.appendChild(Sh(d,f,k)),f=f.nextSibling;return n}function nf(d,f,k){var n=new f.constructor;for(a in f)if(Object.prototype.hasOwnProperty.call(f,a)){var u=f[a];"object"!=typeof u&&u!=n[a]&&(n[a]=u)}f.childNodes&&(n.childNodes=new Tb);n.ownerDocument=d;switch(n.nodeType){case ob:var a=f.attributes;var b=n.attributes=new Ld;u=a.length;b._ownerElement=n;for(b= |
|
0;b<u;b++)n.setAttributeNode(nf(d,a.item(b),!0));break;case vc:k=!0}if(k)for(f=f.firstChild;f;)n.appendChild(nf(d,f,k)),f=f.nextSibling;return n}function yh(d,f,k){d[f]=k}function wc(d,f){this.message=d;this.locator=f;Error.captureStackTrace&&Error.captureStackTrace(this,wc)}function Th(){}function Em(d,f,k,n,u){function a(W){var Da=W.slice(1,-1);if(Object.hasOwnProperty.call(k,Da))return k[Da];if("#"===Da.charAt(0))return W=parseInt(Da.substr(1).replace("x","0x")),65535<W?(W-=65536,W=String.fromCharCode(55296+ |
|
(W>>10),56320+(W&1023))):W=String.fromCharCode(W),W;u.error("entity not found:"+W);return W}function b(W){if(W>x){var Da=d.substring(x,W).replace(/&#?\w+;/g,a);p&&c(x);n.characters(Da,0,W-x);x=W}}function c(W,Da){for(;W>=g&&(Da=l.exec(d));)e=Da.index,g=e+Da[0].length,p.lineNumber++;p.columnNumber=W-e+1}var e=0,g=0,l=/.*(?:\r\n?|\n)|.*$/g,p=n.locator;f=[{currentNSMap:f}];for(var t={},x=0;;){try{var y=d.indexOf("\x3c",x);if(0>y){if(!d.substr(x).match(/^\s*$/)){var A=n.doc,z=A.createTextNode(d.substr(x)); |
|
A.appendChild(z);n.currentElement=z}break}y>x&&b(y);switch(d.charAt(y+1)){case "/":var E=d.indexOf("\x3e",y+3),I=d.substring(y+2,E).replace(/[ \t\n\r]+$/g,""),G=f.pop();0>E?(I=d.substring(y+2).replace(/[\s<].*/,""),u.error("end tag name: "+I+" is not complete:"+G.tagName),E=y+1+I.length):I.match(/\s</)&&(I=I.replace(/[\s<].*/,""),u.error("end tag name: "+I+" maybe not complete"),E=y+1+I.length);var O=G.localNSMap,Q=G.tagName==I;if(Q||G.tagName&&G.tagName.toLowerCase()==I.toLowerCase()){n.endElement(G.uri, |
|
G.localName,I);if(O)for(var V in O)Object.prototype.hasOwnProperty.call(O,V)&&n.endPrefixMapping(V);Q||u.fatalError("end tag name: "+I+" is not match the current start tagName:"+G.tagName)}else f.push(G);E++;break;case "?":p&&c(y);E=Fm(d,y,n);break;case "!":p&&c(y);E=Gm(d,y,n,u);break;default:p&&c(y);var T=new Uh,ca=f[f.length-1].currentNSMap;E=Hm(d,y,T,ca,a,u);var K=T.length;!T.closed&&Im(d,E,T.tagName,t)&&(T.closed=!0,k.nbsp||u.warning("unclosed xml attribute"));if(p&&K){for(var ba=Vh(p,{}),ta= |
|
0;ta<K;ta++){var Fa=T[ta];c(Fa.offset);Fa.locator=Vh(p,{})}n.locator=ba;Wh(T,n,ca)&&f.push(T);n.locator=p}else Wh(T,n,ca)&&f.push(T);cd.isHTML(T.uri)&&!T.closed?E=Jm(d,E,T.tagName,a,n):E++}}catch(W){if(W instanceof wc)throw W;u.error("element parse error: "+W);E=-1}E>x?x=E:b(Math.max(y,x)+1)}}function Vh(d,f){f.lineNumber=d.lineNumber;f.columnNumber=d.columnNumber;return f}function Hm(d,f,k,n,u,a){function b(t,x,y){k.attributeNames.hasOwnProperty(t)&&a.fatalError("Attribute "+t+" redefined");k.addValue(t, |
|
x.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,u),y)}for(var c,e,g=++f,l=0;;){var p=d.charAt(g);switch(p){case "\x3d":if(1===l)c=d.slice(f,g),l=3;else if(2===l)l=3;else throw Error("attribute equal must after attrName");break;case "'":case '"':if(3===l||1===l)if(1===l&&(a.warning('attribute value must after "\x3d"'),c=d.slice(f,g)),f=g+1,g=d.indexOf(p,f),0<g)e=d.slice(f,g),b(c,e,f-1),l=5;else throw Error("attribute value no end '"+p+"' match");else if(4==l)e=d.slice(f,g),b(c,e,f),a.warning('attribute "'+ |
|
c+'" missed start quot('+p+")!!"),f=g+1,l=5;else throw Error('attribute value must after "\x3d"');break;case "/":switch(l){case 0:k.setTagName(d.slice(f,g));case 5:case 6:case 7:l=7,k.closed=!0;case 4:case 1:break;case 2:k.closed=!0;break;default:throw Error("attribute invalid close char('/')");}break;case "":return a.error("unexpected end of input"),0==l&&k.setTagName(d.slice(f,g)),g;case "\x3e":switch(l){case 0:k.setTagName(d.slice(f,g));case 5:case 6:case 7:break;case 4:case 1:e=d.slice(f,g),"/"=== |
|
e.slice(-1)&&(k.closed=!0,e=e.slice(0,-1));case 2:2===l&&(e=c);4==l?(a.warning('attribute "'+e+'" missed quot(")!'),b(c,e,f)):(cd.isHTML(n[""])&&e.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+e+'" missed value!! "'+e+'" instead!!'),b(e,e,f));break;case 3:throw Error("attribute value missed!!");}return g;case "\u0080":p=" ";default:if(" ">=p)switch(l){case 0:k.setTagName(d.slice(f,g));l=6;break;case 1:c=d.slice(f,g);l=2;break;case 4:e=d.slice(f,g),a.warning('attribute "'+e+'" missed quot(")!!'), |
|
b(c,e,f);case 5:l=6}else switch(l){case 2:k.tagName;cd.isHTML(n[""])&&c.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+c+'" missed value!! "'+c+'" instead2!!');b(c,c,f);f=g;l=1;break;case 5:a.warning('attribute space is required"'+c+'"!!');case 6:l=1;f=g;break;case 3:l=4;f=g;break;case 7:throw Error("elements closed character '/' and '\x3e' must be connected to");}}g++}}function Wh(d,f,k){for(var n=d.tagName,u=null,a=d.length;a--;){var b=d[a],c=b.qName,e=b.value,g=c.indexOf(":"); |
|
if(0<g){var l=b.prefix=c.slice(0,g);g=c.slice(g+1);l="xmlns"===l&&g}else g=c,l=null,l="xmlns"===c&&"";b.localName=g;!1!==l&&(null==u&&(u={},Xh(k,k={})),k[l]=u[l]=e,b.uri=cd.XMLNS,f.startPrefixMapping(l,e))}for(a=d.length;a--;)if(b=d[a],l=b.prefix)"xml"===l&&(b.uri=cd.XML),"xmlns"!==l&&(b.uri=k[l||""]);g=n.indexOf(":");0<g?(l=d.prefix=n.slice(0,g),g=d.localName=n.slice(g+1)):(l=null,g=d.localName=n);a=d.uri=k[l||""];f.startElement(a,g,n,d);if(d.closed){if(f.endElement(a,g,n),u)for(l in u)Object.prototype.hasOwnProperty.call(u, |
|
l)&&f.endPrefixMapping(l)}else return d.currentNSMap=k,d.localNSMap=u,!0}function Jm(d,f,k,n,u){if(/^(?:script|textarea)$/i.test(k)){var a=d.indexOf("\x3c/"+k+"\x3e",f);d=d.substring(f+1,a);if(/[&<]/.test(d)){if(/^script$/i.test(k))return u.characters(d,0,d.length),a;d=d.replace(/&#?\w+;/g,n);u.characters(d,0,d.length);return a}}return f+1}function Im(d,f,k,n){var u=n[k];null==u&&(u=d.lastIndexOf("\x3c/"+k+"\x3e"),u<f&&(u=d.lastIndexOf("\x3c/"+k)),n[k]=u);return u<f}function Xh(d,f){for(var k in d)Object.prototype.hasOwnProperty.call(d, |
|
k)&&(f[k]=d[k])}function Gm(d,f,k,n){switch(d.charAt(f+2)){case "-":if("-"===d.charAt(f+3)){var u=d.indexOf("--\x3e",f+4);if(u>f)return k.comment(d,f+4,u-f-4),u+3;n.error("Unclosed comment")}break;default:if("CDATA["==d.substr(f+3,6))return u=d.indexOf("]]\x3e",f+9),k.startCDATA(),k.characters(d,f+9,u-f-9),k.endCDATA(),u+3;a:{n=[];u=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;u.lastIndex=f;for(u.exec(d);f=u.exec(d);)if(n.push(f),f[1]){u=n;break a}u=void 0}var a=u.length;if(1<a&&/!doctype/i.test(u[0][0]))return d= |
|
u[1][0],n=f=!1,3<a&&(/^public$/i.test(u[2][0])?(f=u[3][0],n=4<a&&u[4][0]):/^system$/i.test(u[2][0])&&(n=u[3][0])),u=u[a-1],k.startDTD(d,f,n),k.endDTD(),u.index+u[0].length}return-1}function Fm(d,f,k){var n=d.indexOf("?\x3e",f);return n&&(d=d.substring(f,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/))?(d[0].length,k.processingInstruction(d[1],d[2]),n+2):-1}function Uh(){this.attributeNames={}}function Km(d){return d.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Yh(d){this.options= |
|
d||{locator:{}}}function Lm(d,f,k){function n(b){var c=d[b];!c&&a&&(c=2==d.length?function(e){d(b,e)}:d);u[b]=c&&function(e){c("[xmldom "+b+"]\t"+e+of(k))}||function(){}}if(!d){if(f instanceof Qd)return f;d=f}var u={},a=d instanceof Function;k=k||{};n("warning");n("error");n("fatalError");return u}function Qd(){this.cdata=!1}function xc(d,f){f.lineNumber=d.lineNumber;f.columnNumber=d.columnNumber}function of(d){if(d)return"\n@"+(d.systemId||"")+"#[line:"+d.lineNumber+",col:"+d.columnNumber+"]"}function Zh(d, |
|
f,k){return"string"==typeof d?d.substr(f,k):d.length>=f+k||f?new java.lang.String(d,f,k)+"":d}function Rd(d,f){d.currentElement?d.currentElement.appendChild(f):d.doc.appendChild(f)}function pf(d,f=":",k=""){let n="info",u;const a=function(...b){u("log",n,b)};u=Mm(d,a,k);a.createLogger=(b,c,e)=>{c=void 0!==c?c:f;return pf(`${d} ${c} ${b}`,c,void 0!==e?e:k)};a.createNewLogger=(b,c,e)=>pf(b,c,e);a.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error", |
|
error:"error",DEFAULT:n};a.level=b=>{if("string"===typeof b){if(!a.levels.hasOwnProperty(b))throw Error(`"${b}" in not a valid log level`);n=b}return n};a.history=()=>Wa?[].concat(Wa):[];a.history.filter=b=>(Wa||[]).filter(c=>(new RegExp(`.*${b}.*`)).test(c[0]));a.history.clear=()=>{Wa&&(Wa.length=0)};a.history.disable=()=>{null!==Wa&&(Wa.length=0,Wa=null)};a.history.enable=()=>{null===Wa&&(Wa=[])};a.error=(...b)=>u("error",n,b);a.warn=(...b)=>u("warn",n,b);a.debug=(...b)=>u("debug",n,b);return a} |
|
function yc(d,f){$h(d).forEach(k=>f(d[k],k))}function ai(d,f,k=0){return $h(d).reduce((n,u)=>f(n,d[u],u),k)}function xb(d){return!!d&&"object"===typeof d}function zc(d){return xb(d)&&"[object Object]"===Nm.call(d)&&d.constructor===Object}function ma(...d){const f={};d.forEach(k=>{k&&yc(k,(n,u)=>{zc(n)?(zc(f[u])||(f[u]={}),f[u]=ma(f[u],n)):f[u]=n})});return f}function bi(d={}){const f=[];for(const k in d)d.hasOwnProperty(k)&&f.push(d[k]);return f}function Sd(d,f,k,n=!0){const u=b=>Object.defineProperty(d, |
|
f,{value:b,enumerable:!0,writable:!0}),a={configurable:!0,enumerable:!0,get(){const b=k();u(b);return b}};n&&(a.set=u);return Object.defineProperty(d,f,a)}function Ac(){return P===D.document}function Bc(d){return xb(d)&&1===d.nodeType}function ci(){try{return D.parent!==D.self}catch(d){return!0}}function di(d){return function(f,k){if("string"!==typeof f||!f.trim())return P[d](null);"string"===typeof k&&k.trim()&&(k=P.querySelector(k));k=Bc(k)?k:P;return k[d]&&k[d](f)}}function aa(d="div",f={},k={}, |
|
n){const u=P.createElement(d);Object.getOwnPropertyNames(f).forEach(function(a){const b=f[a];if("textContent"===a)Ub(u,b);else if(u[a]!==b||"tabIndex"===a)u[a]=b});Object.getOwnPropertyNames(k).forEach(function(a){u.setAttribute(a,k[a])});n&&qf(u,n);return u}function Ub(d,f){"undefined"===typeof d.textContent?d.innerText=f:d.textContent=f;return d}function rf(d,f){f.firstChild?f.insertBefore(d,f.firstChild):f.appendChild(d)}function dd(d,f){if(0<=f.indexOf(" "))throw Error("class has illegal whitespace characters"); |
|
return d.classList.contains(f)}function cc(d,...f){d.classList.add(...f.reduce((k,n)=>k.concat(n.split(/\s+/)),[]));return d}function Td(d,...f){if(!d)return da.warn("removeClass was called with an element that doesn't exist"),null;d.classList.remove(...f.reduce((k,n)=>k.concat(n.split(/\s+/)),[]));return d}function ei(d,f,k){"function"===typeof k&&(k=k(d,f));"boolean"!==typeof k&&(k=void 0);f.split(/\s+/).forEach(n=>d.classList.toggle(n,k));return d}function fi(d,f){Object.getOwnPropertyNames(f).forEach(function(k){const n= |
|
f[k];null===n||"undefined"===typeof n||!1===n?d.removeAttribute(k):d.setAttribute(k,!0===n?"":n)})}function Vb(d){const f={},k="autoplay controls playsinline loop muted default defaultMuted".split(" ");if(d&&d.attributes&&0<d.attributes.length){d=d.attributes;for(let n=d.length-1;0<=n;n--){const u=d[n].name;let a=d[n].value;k.includes(u)&&(a=null!==a?!0:!1);f[u]=a}}return f}function gi(){P.body.focus();P.onselectstart=function(){return!1}}function hi(){P.onselectstart=function(){return!0}}function Cc(d){if(d&& |
|
d.getBoundingClientRect&&d.parentNode){const f=d.getBoundingClientRect(),k={};"bottom height left right top width".split(" ").forEach(n=>{void 0!==f[n]&&(k[n]=f[n])});k.height||(k.height=parseFloat(Dc(d,"height")));k.width||(k.width=parseFloat(Dc(d,"width")));return k}}function ed(d){if(!d||d&&!d.offsetParent)return{left:0,top:0,width:0,height:0};const f=d.offsetWidth,k=d.offsetHeight;let n=0,u=0;for(;d.offsetParent&&d!==P[Ud.fullscreenElement];)n+=d.offsetLeft,u+=d.offsetTop,d=d.offsetParent;return{left:n, |
|
top:u,width:f,height:k}}function Vd(d,f){var k=0,n=0;if(Qa)for(var u=d;u&&"html"!==u.nodeName.toLowerCase();){var a=Dc(u,"transform");/^matrix/.test(a)?(a=a.slice(7,-1).split(/,\s/).map(Number),k+=a[4],n+=a[5]):/^matrix3d/.test(a)&&(a=a.slice(9,-1).split(/,\s/).map(Number),k+=a[12],n+=a[13]);u=u.parentNode}u={};a=ed(f.target);d=ed(d);const b=d.width,c=d.height;let e=f.offsetY-(d.top-a.top);a=f.offsetX-(d.left-a.left);f.changedTouches&&(a=f.changedTouches[0].pageX-d.left,e=f.changedTouches[0].pageY+ |
|
d.top,Qa&&(a-=k,e-=n));u.y=1-Math.max(0,Math.min(1,e/c));u.x=Math.max(0,Math.min(1,a/b));return u}function ii(d){return xb(d)&&3===d.nodeType}function Wd(d){for(;d.firstChild;)d.removeChild(d.firstChild);return d}function ji(d){"function"===typeof d&&(d=d());return(Array.isArray(d)?d:[d]).map(f=>{"function"===typeof f&&(f=f());if(Bc(f)||ii(f))return f;if("string"===typeof f&&/\S/.test(f))return P.createTextNode(f)}).filter(f=>f)}function qf(d,f){ji(f).forEach(k=>d.appendChild(k));return d}function ki(d, |
|
f){return qf(Wd(d),f)}function fd(d){return void 0===d.button&&void 0===d.buttons||0===d.button&&void 0===d.buttons||"mouseup"===d.type&&0===d.button&&0===d.buttons?!0:0!==d.button||1!==d.buttons?!1:!0}function Dc(d,f){if(!d||!f)return"";if("function"===typeof D.getComputedStyle){let k;try{k=D.getComputedStyle(d)}catch(n){return""}return k?k.getPropertyValue(f)||k[f]:""}return""}function li(d){[...P.styleSheets].forEach(f=>{try{var k=[...f.cssRules].map(u=>u.cssText).join("");const n=P.createElement("style"); |
|
n.textContent=k;d.document.head.appendChild(n)}catch(n){k=P.createElement("link"),k.rel="stylesheet",k.type=f.type,k.media=f.media.mediaText,k.href=f.href,d.document.head.appendChild(k)}})}function sf(d,f){Ac()&&(f&&(tf=f),D.setTimeout(Om,d))}function uf(){mi=!0;D.removeEventListener("load",uf)}function ni(d,f){if(Ra.has(d)){var k=Ra.get(d);0===k.handlers[f].length&&(delete k.handlers[f],d.removeEventListener?d.removeEventListener(f,k.dispatcher,!1):d.detachEvent&&d.detachEvent("on"+f,k.dispatcher)); |
|
0>=Object.getOwnPropertyNames(k.handlers).length&&(delete k.handlers,delete k.dispatcher,delete k.disabled);0===Object.getOwnPropertyNames(k).length&&Ra.delete(d)}}function vf(d,f,k,n){k.forEach(function(u){d(f,u,n)})}function Xd(d){function f(){return!0}function k(){return!1}if(d.fixed_)return d;if(!d||!d.isPropagationStopped||!d.isImmediatePropagationStopped){const u=d||D.event;d={};for(var n in u)"layerX"!==n&&"layerY"!==n&&"keyLocation"!==n&&"webkitMovementX"!==n&&"webkitMovementY"!==n&&"path"!== |
|
n&&("returnValue"===n&&u.preventDefault||(d[n]=u[n]));d.target||(d.target=d.srcElement||P);d.relatedTarget||(d.relatedTarget=d.fromElement===d.target?d.toElement:d.fromElement);d.preventDefault=function(){u.preventDefault&&u.preventDefault();d.returnValue=!1;u.returnValue=!1;d.defaultPrevented=!0};d.defaultPrevented=!1;d.stopPropagation=function(){u.stopPropagation&&u.stopPropagation();d.cancelBubble=!0;u.cancelBubble=!0;d.isPropagationStopped=f};d.isPropagationStopped=k;d.stopImmediatePropagation= |
|
function(){u.stopImmediatePropagation&&u.stopImmediatePropagation();d.isImmediatePropagationStopped=f;d.stopPropagation()};d.isImmediatePropagationStopped=k;if(null!==d.clientX&&void 0!==d.clientX){n=P.documentElement;const a=P.body;d.pageX=d.clientX+(n&&n.scrollLeft||a&&a.scrollLeft||0)-(n&&n.clientLeft||a&&a.clientLeft||0);d.pageY=d.clientY+(n&&n.scrollTop||a&&a.scrollTop||0)-(n&&n.clientTop||a&&a.clientTop||0)}d.which=d.charCode||d.keyCode;null!==d.button&&void 0!==d.button&&(d.button=d.button& |
|
1?0:d.button&4?1:d.button&2?2:0)}d.fixed_=!0;return d}function ab(d,f,k){if(Array.isArray(f))return vf(ab,d,f,k);Ra.has(d)||Ra.set(d,{});const n=Ra.get(d);n.handlers||(n.handlers={});n.handlers[f]||(n.handlers[f]=[]);k.guid||(k.guid=pb++);n.handlers[f].push(k);n.dispatcher||(n.disabled=!1,n.dispatcher=function(u,a){if(!n.disabled){u=Xd(u);var b=n.handlers[u.type];if(b){b=b.slice(0);for(let c=0,e=b.length;c<e&&!u.isImmediatePropagationStopped();c++)try{b[c].call(d,u,a)}catch(g){da.error(g)}}}});1=== |
|
n.handlers[f].length&&(d.addEventListener?(k=!1,Pm()&&-1<Qm.indexOf(f)&&(k={passive:!0}),d.addEventListener(f,n.dispatcher,k)):d.attachEvent&&d.attachEvent("on"+f,n.dispatcher))}function Ma(d,f,k){if(Ra.has(d)){var n=Ra.get(d);if(n.handlers){if(Array.isArray(f))return vf(Ma,d,f,k);if(void 0===f)for(var u in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},u)&&(f=d,k=u,n.handlers[k]=[],ni(f,k));else if(u=n.handlers[f]){if(!k)n.handlers[f]=[];else if(k.guid)for(n=0;n<u.length;n++)u[n].guid=== |
|
k.guid&&u.splice(n--,1);ni(d,f)}}}}function Ec(d,f,k){const n=Ra.has(d)?Ra.get(d):{},u=d.parentNode||d.ownerDocument;"string"===typeof f?f={type:f,target:d}:f.target||(f.target=d);f=Xd(f);n.dispatcher&&n.dispatcher.call(d,f,k);if(u&&!f.isPropagationStopped()&&!0===f.bubbles)Ec.call(null,u,f,k);else if(!u&&!f.defaultPrevented&&f.target&&f.target[f.type]&&(Ra.has(f.target)||Ra.set(f.target,{}),d=Ra.get(f.target),f.target[f.type])){d.disabled=!0;if("function"===typeof f.target[f.type])f.target[f.type](); |
|
d.disabled=!1}return!f.defaultPrevented}function Yd(d,f,k){if(Array.isArray(f))return vf(Yd,d,f,k);const n=function(){Ma(d,f,n);k.apply(this,arguments)};n.guid=k.guid=k.guid||pb++;ab(d,f,n)}function wf(d,f,k){const n=function(){Ma(d,f,n);k.apply(this,arguments)};n.guid=k.guid=k.guid||pb++;ab(d,f,n)}function xf(d,f={}){({eventBusKey:f}=f);if(f){if(!d[f].nodeName)throw Error(`The eventBusKey "${f}" does not refer to an element.`);d.eventBusEl_=d[f]}else d.eventBusEl_=aa("span",{className:"vjs-event-bus"}); |
|
Object.assign(d,Rm);d.eventedCallbacks&&d.eventedCallbacks.forEach(k=>{k()});d.on("dispose",()=>{d.off();[d,d.el_,d.eventBusEl_].forEach(function(k){k&&Ra.has(k)&&Ra.delete(k)});D.setTimeout(()=>{d.eventBusEl_=null},0)});return d}function oi(d,f){Object.assign(d,Sm);d.state=Object.assign({},d.state,f);if("function"===typeof d.handleStateChanged&&Kb(d))d.on("statechanged",d.handleStateChanged);return d}function pi(d,f,k,n){var u=k.length-1;if("number"!==typeof n||0>n||n>u)throw Error(`Failed to execute '${d}' on 'TimeRanges': The index provided (${n}) is non-numeric or out of bounds (0-${u}).`); |
|
return k[n][f]}function yf(d){let f;f=void 0===d||0===d.length?{length:0,start(){throw Error("This TimeRanges object is empty");},end(){throw Error("This TimeRanges object is empty");}}:{length:d.length,start:pi.bind(null,"start",0,d),end:pi.bind(null,"end",1,d)};D.Symbol&&D.Symbol.iterator&&(f[D.Symbol.iterator]=()=>(d||[]).values());return f}function qb(d,f){return Array.isArray(d)?yf(d):void 0===d||void 0===f?yf():yf([[d,f]])}function qi(d){zf=d}function ri(){zf=si}function dc(d,f=d){return zf(d, |
|
f)}function ti(d,f){let k=0,n,u;if(!f)return 0;d&&d.length||(d=qb(0,0));for(let a=0;a<d.length;a++)n=d.start(a),u=d.end(a),u>f&&(u=f),k+=u-n;return k/f}function ua(d){if(d instanceof ua)return d;"number"===typeof d?this.code=d:"string"===typeof d?this.message=d:xb(d)&&("number"===typeof d.code&&(this.code=d.code),Object.assign(this,d));this.message||(this.message=ua.defaultMessages[this.code]||"")}function gd(d){return void 0!==d&&null!==d&&"function"===typeof d.then}function yb(d){gd(d)&&d.then(null, |
|
f=>{})}function Tm(d,f,k,n,u={}){const a=d.textTracks();u.kind=f;k&&(u.label=k);n&&(u.language=n);u.tech=d;d=new Sa.text.TrackClass(u);a.addTrack(d);return d}function Um(d,f,k){d.setTimeout(()=>ec(f,fc[f.type],k,d),1)}function Vm(d,f){d.forEach(k=>k.setTech&&k.setTech(f))}function ui(d,f,k,n=null){var u="call"+wa(k);u=d.reduce(Af(u),n);f=(n=u===Zd)?null:f[k](u);for(u=d.length-1;0<=u;u--){const a=d[u];if(a[k])a[k](n,f)}return f}function Af(d){return(f,k)=>f===Zd?Zd:k[d]?k[d](f):f}function Wm(d,f){const k= |
|
Bf[d.id()];let n=null;if(void 0===k||null===k)return n=f(d),Bf[d.id()]=[[f,n]],n;for(let u=0;u<k.length;u++){const [a,b]=k[u];a===f&&(n=b)}null===n&&(n=f(d),k.push([f,n]));return n}function ec(d={},f=[],k,n,u=[],a=!1){const [b,...c]=f;if("string"===typeof b)ec(d,fc[b],k,n,u,a);else if(b){const e=Wm(n,b);if(!e.setSource)return u.push(e),ec(d,c,k,n,u,a);e.setSource(Object.assign({},d),function(g,l){if(g)return ec(d,c,k,n,u,a);u.push(e);ec(l,d.type===l.type?c:fc[l.type],k,n,u,a)})}else c.length?ec(d, |
|
c,k,n,u,a):a?k(d,u):ec(d,fc["*"],k,n,u,!0)}function vi(d){if(!d.type){const f=$d(d.src);f&&(d.type=f)}return d}function Cf(d,f){if(4===d.length)d=d[1]+d[1]+d[2]+d[2]+d[3]+d[3];else if(7===d.length)d=d.slice(1);else throw Error("Invalid color code provided, "+d+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(d.slice(0,2),16)+","+parseInt(d.slice(2,4),16)+","+parseInt(d.slice(4,6),16)+","+f+")"}function hd(d,f,k){try{d.style[f]=k}catch(n){}}function gc(d,f,k){d=Number(d);return Math.min(k, |
|
Math.max(f,isNaN(d)?f:d))}function wi(d,f){f&&(d=f(d));if(d&&"none"!==d)return d}function Xm(d,f){let k=!1;return function(...n){k||da.warn(d);k=!0;return f.apply(this,n)}}function rb(d,f,k,n){return Xm(`${f} is deprecated and will be removed in ${d}.0; please use ${k} instead.`,n)}function H(d,f,k){let n=H.getPlayer(d);if(n)return f&&da.warn(`Player "${d}" is already initialised. Options will not be applied.`),k&&n.ready(k),n;const u="string"===typeof d?Wb("#"+xi(d)):d;if(!Bc(u))throw new TypeError("The element or ID supplied is not valid. (videojs)"); |
|
d="getRootNode"in u&&u.getRootNode()instanceof D.ShadowRoot?u.getRootNode():u.ownerDocument.body;u.ownerDocument.defaultView&&d.contains(u)||da.warn("The element supplied is not included in the DOM");f=f||{};!0===f.restoreEl&&(f.restoreEl=(u.parentNode&&u.parentNode.hasAttribute("data-vjs-player")?u.parentNode:u).cloneNode(!0));Xb("beforesetup").forEach(a=>{a=a(u,ma(f));!xb(a)||Array.isArray(a)?da.error("please return an object in beforesetup hooks"):f=ma(f,a)});n=new (M.getComponent("Player"))(u, |
|
f,k);Xb("setup").forEach(a=>a(n));return n}function ia(...d){const f=H.obj||H;return(f.merge||f.mergeOptions).apply(f,d)}function Na(...d){const f=H.time||H;return(f.createTimeRanges||f.createTimeRanges).apply(f,d)}function yi(d){try{return(new URL(d)).pathname.split("/").slice(-2).join("/")}catch(f){return""}}function Lb(){}var bb="undefined"!==typeof window?window:"undefined"!==typeof jb.commonjsGlobal?jb.commonjsGlobal:"undefined"!==typeof self?self:{};const D=jb.getDefaultExportFromCjs(bb);var zi= |
|
Array.prototype.slice,ae=function(d,f){"length"in d||(d=[d]);for(d=zi.call(d);d.length;){var k=d.shift(),n=f(k);if(n)return n;k.childNodes&&k.childNodes.length&&(d=zi.call(k.childNodes).concat(d))}};pc.prototype.nodeType=8;pc.prototype.nodeName="#comment";pc.prototype.toString=function(){return"[object Comment]"};Sb.prototype.type="DOMTextNode";Sb.prototype.nodeType=3;Sb.prototype.nodeName="#text";Sb.prototype.toString=function(){return this.data};Sb.prototype.replaceData=function(d,f,k){var n=this.data, |
|
u=n.substring(0,d);d=n.substring(d+f,n.length);this.data=u+k+d;this.length=this.data.length};var Ai=function(d){var f=this,k=d.type;d.target||(d.target=f);f.listeners||(f.listeners={});if(k=f.listeners[k])return k.forEach(function(n){d.currentTarget=f;"function"===typeof n?n(d):n.handleEvent(d)});f.parentNode&&f.parentNode.dispatchEvent(d)},Bi=function(d,f){this.listeners||(this.listeners={});this.listeners[d]||(this.listeners[d]=[]);-1===this.listeners[d].indexOf(f)&&this.listeners[d].push(f)},Ci= |
|
function(d,f){this.listeners&&this.listeners[d]&&(d=this.listeners[d],f=d.indexOf(f),-1!==f&&d.splice(f,1))},lm="area base br col embed hr img input keygen link menuitem meta param source track wbr".split(" ");fa.prototype.type="DOMElement";fa.prototype.nodeType=1;fa.prototype.appendChild=function(d){d.parentNode&&d.parentNode.removeChild(d);this.childNodes.push(d);d.parentNode=this;return d};fa.prototype.replaceChild=function(d,f){d.parentNode&&d.parentNode.removeChild(d);var k=this.childNodes.indexOf(f); |
|
f.parentNode=null;this.childNodes[k]=d;d.parentNode=this;return f};fa.prototype.removeChild=function(d){var f=this.childNodes.indexOf(d);this.childNodes.splice(f,1);d.parentNode=null;return d};fa.prototype.insertBefore=function(d,f){d.parentNode&&d.parentNode.removeChild(d);f=null===f||void 0===f?-1:this.childNodes.indexOf(f);-1<f?this.childNodes.splice(f,0,d):this.childNodes.push(d);d.parentNode=this;return d};fa.prototype.setAttributeNS=function(d,f,k){var n=null,u=f,a=f.indexOf(":");-1<a&&(n=f.substr(0, |
|
a),u=f.substr(a+1));"INPUT"===this.tagName&&"type"===f?this.type=k:(this._attributes[d]||(this._attributes[d]={}))[u]={value:k,prefix:n}};fa.prototype.getAttributeNS=function(d,f){d=(d=this._attributes[d])&&d[f]&&d[f].value;return"INPUT"===this.tagName&&"type"===f?this.type:"string"!==typeof d?null:d};fa.prototype.removeAttributeNS=function(d,f){(d=this._attributes[d])&&delete d[f]};fa.prototype.hasAttributeNS=function(d,f){d=this._attributes[d];return!!d&&f in d};fa.prototype.setAttribute=function(d, |
|
f){return this.setAttributeNS(null,d,f)};fa.prototype.getAttribute=function(d){return this.getAttributeNS(null,d)};fa.prototype.removeAttribute=function(d){return this.removeAttributeNS(null,d)};fa.prototype.hasAttribute=function(d){return this.hasAttributeNS(null,d)};fa.prototype.removeEventListener=Ci;fa.prototype.addEventListener=Bi;fa.prototype.dispatchEvent=Ai;fa.prototype.focus=function(){};fa.prototype.toString=function(){return oh(this)};fa.prototype.getElementsByClassName=function(d){var f= |
|
d.split(" "),k=[];ae(this,function(n){if(1===n.nodeType){var u=(n.className||"").split(" ");f.every(function(a){return-1!==u.indexOf(a)})&&k.push(n)}});return k};fa.prototype.getElementsByTagName=function(d){d=d.toLowerCase();var f=[];ae(this.childNodes,function(k){1!==k.nodeType||"*"!==d&&k.tagName.toLowerCase()!==d||f.push(k)});return f};fa.prototype.contains=function(d){return ae(this,function(f){return d===f})||!1};tb.prototype.type="DocumentFragment";tb.prototype.nodeType=11;tb.prototype.nodeName= |
|
"#document-fragment";tb.prototype.appendChild=fa.prototype.appendChild;tb.prototype.replaceChild=fa.prototype.replaceChild;tb.prototype.removeChild=fa.prototype.removeChild;tb.prototype.toString=function(){return this.childNodes.map(function(d){return String(d)}).join("")};Xe.prototype.initEvent=function(d,f,k){this.type=d;this.bubbles=f;this.cancelable=k};Xe.prototype.preventDefault=function(){};var cb=Id.prototype;cb.createTextNode=function(d){return new Sb(d,this)};cb.createElementNS=function(d, |
|
f){return new fa(f,this,null===d?null:String(d))};cb.createElement=function(d){return new fa(d,this)};cb.createDocumentFragment=function(){return new tb(this)};cb.createEvent=function(d){return new Xe};cb.createComment=function(d){return new pc(d,this)};cb.getElementById=function(d){d=String(d);return ae(this.childNodes,function(f){if(String(f.id)===d)return f})||null};cb.getElementsByClassName=fa.prototype.getElementsByClassName;cb.getElementsByTagName=fa.prototype.getElementsByTagName;cb.contains= |
|
fa.prototype.contains;cb.removeEventListener=Ci;cb.addEventListener=Bi;cb.dispatchEvent=Ai;var Ym=new Id,Di="undefined"!==typeof jb.commonjsGlobal?jb.commonjsGlobal:"undefined"!==typeof window?window:{};if("undefined"!==typeof document)var Df=document;else(Df=Di["__GLOBAL_DOCUMENT_CACHE@4"])||(Df=Di["__GLOBAL_DOCUMENT_CACHE@4"]=Ym);var Ef=Df;const P=jb.getDefaultExportFromCjs(Ef);var Ff={exports:{}};(function(d,f){function k(c){if(c&&"object"===typeof c){var e=c.which||c.keyCode||c.charCode;e&&(c= |
|
e)}if("number"===typeof c)return a[c];c=String(c);if((e=n[c.toLowerCase()])||(e=u[c.toLowerCase()]))return e;if(1===c.length)return c.charCodeAt(0)}k.isEventKey=function(c,e){if(c&&"object"===typeof c){c=c.which||c.keyCode||c.charCode;if(null===c||void 0===c)return!1;if("string"===typeof e){var g=n[e.toLowerCase()];if(g||(g=u[e.toLowerCase()]))return g===c}else if("number"===typeof e)return e===c;return!1}};f=d.exports=k;var n=f.code=f.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19, |
|
"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"\x3d":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},u=f.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17, |
|
option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(d=97;123>d;d++)n[String.fromCharCode(d)]=d-32;for(d=48;58>d;d++)n[d-48]=d;for(d=1;13>d;d++)n["f"+d]=d+111;for(d=0;10>d;d++)n["numpad "+d]=d+96;var a=f.names=f.title={};for(d in n)a[n[d]]=d;for(var b in u)n[b]=u[b]})(Ff,Ff.exports);const Y=jb.getDefaultExportFromCjs(Ff.exports),Zm=jb.getDefaultExportFromCjs(function(d,f){var k=null;try{var n=JSON.parse(d,f)}catch(u){k=u}return[k,n]}); |
|
var Gf={},Ei={exports:{}};(function(d){function f(){d.exports=f=Object.assign?Object.assign.bind():function(k){for(var n=1;n<arguments.length;n++){var u=arguments[n],a;for(a in u)Object.prototype.hasOwnProperty.call(u,a)&&(k[a]=u[a])}return k};d.exports.__esModule=!0;d.exports["default"]=d.exports;return f.apply(this,arguments)}d.exports=f;d.exports.__esModule=!0;d.exports["default"]=d.exports})(Ei);var pm=Object.prototype.toString,qm=Ei.exports;ub.httpHandler=function(d,f){void 0===f&&(f=!1);return function(k, |
|
n,u){if(k)d(k);else if(400<=n.statusCode&&599>=n.statusCode){k=u;if(f)if(bb.TextDecoder){n=nm(n.headers&&n.headers["content-type"]);try{k=(new TextDecoder(n)).decode(u)}catch(a){}}else k=String.fromCharCode.apply(null,new Uint8Array(u));d({cause:k})}else d(null,u)}};var rm=function(d){var f={};if(!d)return f;d.trim().split("\n").forEach(function(k){var n=k.indexOf(":"),u=k.slice(0,n).trim().toLowerCase();k=k.slice(n+1).trim();"undefined"===typeof f[u]?f[u]=k:Array.isArray(f[u])?f[u].push(k):f[u]= |
|
[f[u],k]});return f};Gf=ub;Gf.default=ub;ub.XMLHttpRequest=bb.XMLHttpRequest||sm;ub.XDomainRequest="withCredentials"in new ub.XMLHttpRequest?ub.XMLHttpRequest:bb.XDomainRequest;(function(d,f){for(var k=0;k<d.length;k++)f(d[k])})("get put post patch head delete".split(" "),function(d){ub["delete"===d?"del":d]=function(f,k,n){k=qh(f,k,n);k.method=d.toUpperCase();return rh(k)}});const Fi=jb.getDefaultExportFromCjs(Gf);var Gi={},Ze=Object.create||function(){function d(){}return function(f){if(1!==arguments.length)throw Error("Object.create shim only accepts one parameter."); |
|
d.prototype=f;return new d}}();$a.prototype=Ze(Error.prototype);$a.prototype.constructor=$a;$a.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};Wc.prototype={set:function(d,f){this.get(d)||""===f||(this.values[d]=f)},get:function(d,f,k){return k?this.has(d)?this.values[d]:f[k]:this.has(d)?this.values[d]:f},has:function(d){return d in this.values},alt:function(d,f,k){for(var n=0;n<k.length;++n)if(f===k[n]){this.set(d,f);break}}, |
|
integer:function(d,f){/^-?\d+$/.test(f)&&this.set(d,parseInt(f,10))},percent:function(d,f){return f.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(f=parseFloat(f),0<=f&&100>=f)?(this.set(d,f),!0):!1}};var $e=Ef.createElement&&Ef.createElement("textarea"),um={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},uh={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"}, |
|
vm={v:"title",lang:"lang"},th={rt:"ruby"},vh=[[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]];af.prototype.applyStyles=function(d,f){f=f||this.div;for(var k in d)d.hasOwnProperty(k)&&(f.style[k]=d[k])};af.prototype.formatStyle=function(d,f){return 0===d?0:d+f};Jd.prototype=Ze(af.prototype);Jd.prototype.constructor=Jd;Pa.prototype.move=function(d,f){f=void 0!==f?f:this.lineHeight;switch(d){case "+x":this.left+=f;this.right+=f;break;case "-x":this.left-=f;this.right-=f;break;case "+y":this.top+=f;this.bottom+=f;break;case "-y":this.top-=f,this.bottom-=f}};Pa.prototype.overlaps=function(d){return this.left< |
|
d.right&&this.right>d.left&&this.top<d.bottom&&this.bottom>d.top};Pa.prototype.overlapsAny=function(d){for(var f=0;f<d.length;f++)if(this.overlaps(d[f]))return!0;return!1};Pa.prototype.within=function(d){return this.top>=d.top&&this.bottom<=d.bottom&&this.left>=d.left&&this.right<=d.right};Pa.prototype.overlapsOppositeAxis=function(d,f){switch(f){case "+x":return this.left<d.left;case "-x":return this.right>d.right;case "+y":return this.top<d.top;case "-y":return this.bottom>d.bottom}};Pa.prototype.intersectPercentage= |
|
function(d){return Math.max(0,Math.min(this.right,d.right)-Math.max(this.left,d.left))*Math.max(0,Math.min(this.bottom,d.bottom)-Math.max(this.top,d.top))/(this.height*this.width)};Pa.prototype.toCSSCompatValues=function(d){return{top:this.top-d.top,bottom:d.bottom-this.bottom,left:this.left-d.left,right:d.right-this.right,height:this.height,width:this.width}};Pa.getSimpleBoxPosition=function(d){var f=d.div?d.div.offsetHeight:d.tagName?d.offsetHeight:0,k=d.div?d.div.offsetWidth:d.tagName?d.offsetWidth: |
|
0,n=d.div?d.div.offsetTop:d.tagName?d.offsetTop:0;d=d.div?d.div.getBoundingClientRect():d.tagName?d.getBoundingClientRect():d;return{left:d.left,right:d.right,top:d.top||n,height:d.height||f,bottom:d.bottom||n+(d.height||f),width:d.width||k}};qc.StringDecoder=function(){return{decode:function(d){if(!d)return"";if("string"!==typeof d)throw Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(d))}}};qc.convertCueToDOMTree=function(d,f){return d&&f?sh(d,f):null};qc.processCues= |
|
function(d,f,k){if(!d||!f||!k)return null;for(;k.firstChild;)k.removeChild(k.firstChild);var n=d.document.createElement("div");n.style.position="absolute";n.style.left="0";n.style.right="0";n.style.top="0";n.style.bottom="0";n.style.margin="1.5%";k.appendChild(n);if(function(c){for(var e=0;e<c.length;e++)if(c[e].hasBeenReset||!c[e].displayState)return!0;return!1}(f)){var u=[],a=Pa.getSimpleBoxPosition(n),b={font:Math.round(5*a.height)/100+"px sans-serif"};(function(){for(var c,e,g=0;g<f.length;g++){e= |
|
f[g];c=new Jd(d,e,b);n.appendChild(c.div);var l=void 0,p=void 0,t=void 0,x=c,y=a;p=u;var A=new Pa(x),z=x.cue;if("number"===typeof z.line&&(z.snapToLines||0<=z.line&&100>=z.line))var E=z.line;else if(z.track&&z.track.textTrackList&&z.track.textTrackList.mediaElement){E=z.track;for(var I=E.textTrackList,G=0,O=0;O<I.length&&I[O]!==E;O++)"showing"===I[O].mode&&G++;E=-1*++G}else E=-1;I=[];if(z.snapToLines){switch(z.vertical){case "":I=["+y","-y"];t="height";break;case "rl":I=["+x","-x"];t="width";break; |
|
case "lr":I=["-x","+x"],t="width"}G=A.lineHeight;O=G*Math.round(E);t=y[t]+G;var Q=I[0];Math.abs(O)>t&&(O=(0>O?-1:1)*Math.ceil(t/G)*G);0>E&&(O+=""===z.vertical?y.height:y.width,I=I.reverse());A.move(Q,O)}else{A=A.lineHeight/y.height*100;switch(z.lineAlign){case "center":E-=A/2;break;case "end":E-=A}switch(z.vertical){case "":x.applyStyles({top:x.formatStyle(E,"%")});break;case "rl":x.applyStyles({left:x.formatStyle(E,"%")});break;case "lr":x.applyStyles({right:x.formatStyle(E,"%")})}I=["+y","-x","+x", |
|
"-y"];A=new Pa(x)}a:{z=A;A=I;t=new Pa(z);E=1;for(I=0;I<A.length;I++){for(;z.overlapsOppositeAxis(y,A[I])||z.within(y)&&z.overlapsAny(p);)z.move(A[I]);if(z.within(y)){p=z;break a}G=z.intersectPercentage(y);E>G&&(l=new Pa(z),E=G);z=new Pa(t)}p=l||t}x.move(p.toCSSCompatValues(y));e.displayState=c.div;u.push(Pa.getSimpleBoxPosition(c))}})()}else for(k=0;k<f.length;k++)n.appendChild(f[k].displayState)};qc.Parser=function(d,f,k){k||(k=f,f={});f||={};this.window=d;this.vttjs=f;this.state="INITIAL";this.buffer= |
|
"";this.decoder=k||new TextDecoder("utf8");this.regionList=[]};qc.Parser.prototype={reportOrThrowError:function(d){if(d instanceof $a)this.onparsingerror&&this.onparsingerror(d);else throw d;},parse:function(d){function f(){for(var g=a.buffer,l=0;l<g.length&&"\r"!==g[l]&&"\n"!==g[l];)++l;var p=g.substr(0,l);"\r"===g[l]&&++l;"\n"===g[l]&&++l;a.buffer=g.substr(l);return p}function k(g){var l=new Wc;Xc(g,function(p,t){switch(p){case "id":l.set(p,t);break;case "width":l.percent(p,t);break;case "lines":l.integer(p, |
|
t);break;case "regionanchor":case "viewportanchor":t=t.split(",");if(2!==t.length)break;var x=new Wc;x.percent("x",t[0]);x.percent("y",t[1]);if(!x.has("x")||!x.has("y"))break;l.set(p+"X",x.get("x"));l.set(p+"Y",x.get("y"));break;case "scroll":l.alt(p,t,["up"])}},/=/,/\s/);l.has("id")&&(g=new (a.vttjs.VTTRegion||a.window.VTTRegion),g.width=l.get("width",100),g.lines=l.get("lines",3),g.regionAnchorX=l.get("regionanchorX",0),g.regionAnchorY=l.get("regionanchorY",100),g.viewportAnchorX=l.get("viewportanchorX", |
|
0),g.viewportAnchorY=l.get("viewportanchorY",100),g.scroll=l.get("scroll",""),a.onregion&&a.onregion(g),a.regionList.push({id:l.get("id"),region:g}))}function n(g){var l=new Wc;Xc(g,function(p,t){switch(p){case "MPEGT":l.integer(p+"S",t);break;case "LOCA":l.set(p+"L",Ye(t))}},/[^\d]:/,/,/);a.ontimestampmap&&a.ontimestampmap({MPEGTS:l.get("MPEGTS"),LOCAL:l.get("LOCAL")})}function u(g){g.match(/X-TIMESTAMP-MAP/)?Xc(g,function(l,p){switch(l){case "X-TIMESTAMP-MAP":n(p)}},/=/):Xc(g,function(l,p){switch(l){case "Region":k(p)}}, |
|
/:/)}var a=this;d&&(a.buffer+=a.decoder.decode(d,{stream:!0}));try{if("INITIAL"===a.state){if(!/\r\n|\n/.test(a.buffer))return this;var b=f();var c=b.match(/^WEBVTT([ \t].*)?$/);if(!c||!c[0])throw new $a($a.Errors.BadSignature);a.state="HEADER"}for(d=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;d?d=!1:b=f();switch(a.state){case "HEADER":/:/.test(b)?u(b):b||(a.state="ID");continue;case "NOTE":b||(a.state="ID");continue;case "ID":if(/^NOTE($|[ \t])/.test(b)){a.state="NOTE";break}if(!b)continue; |
|
a.cue=new (a.vttjs.VTTCue||a.window.VTTCue)(0,0,"");try{a.cue.align="center"}catch(g){a.cue.align="middle"}a.state="CUE";if(-1===b.indexOf("--\x3e")){a.cue.id=b;continue}case "CUE":try{tm(b,a.cue,a.regionList)}catch(g){a.reportOrThrowError(g);a.cue=null;a.state="BADCUE";continue}a.state="CUETEXT";continue;case "CUETEXT":var e=-1!==b.indexOf("--\x3e");if(!b||e&&(d=!0)){a.oncue&&a.oncue(a.cue);a.cue=null;a.state="ID";continue}a.cue.text&&(a.cue.text+="\n");a.cue.text+=b.replace(/\u2028/g,"\n").replace(/u2029/g, |
|
"\n");continue;case "BADCUE":b||(a.state="ID")}}}catch(g){a.reportOrThrowError(g);if("CUETEXT"===a.state&&a.cue&&a.oncue)a.oncue(a.cue);a.cue=null;a.state="INITIAL"===a.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){try{this.buffer+=this.decoder.decode();if(this.cue||"HEADER"===this.state)this.buffer+="\n\n",this.parse();if("INITIAL"===this.state)throw new $a($a.Errors.BadSignature);}catch(d){this.reportOrThrowError(d)}this.onflush&&this.onflush();return this}};var zm={"":1,lr:1,rl:1},ym= |
|
{start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};wh.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var $m={"":!0,up:!0},hc=Gi={WebVTT:qc,VTTCue:wh,VTTRegion:function(){var d=100,f=3,k=0,n=100,u=0,a=100,b="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return d},set:function(c){if(!Yc(c))throw Error("Width must be between 0 and 100.");d=c}},lines:{enumerable:!0,get:function(){return f},set:function(c){if("number"!== |
|
typeof c)throw new TypeError("Lines must be set to a number.");f=c}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(c){if(!Yc(c))throw Error("RegionAnchorX must be between 0 and 100.");n=c}},regionAnchorX:{enumerable:!0,get:function(){return k},set:function(c){if(!Yc(c))throw Error("RegionAnchorY must be between 0 and 100.");k=c}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(c){if(!Yc(c))throw Error("ViewportAnchorY must be between 0 and 100.");a=c}},viewportAnchorX:{enumerable:!0, |
|
get:function(){return u},set:function(c){if(!Yc(c))throw Error("ViewportAnchorX must be between 0 and 100.");u=c}},scroll:{enumerable:!0,get:function(){return b},set:function(c){c="string"!==typeof c?!1:$m[c.toLowerCase()]?c.toLowerCase():!1;!1===c?console.warn("Scroll: an invalid or illegal string was specified."):b=c}}})}};bb.vttjs=hc;bb.WebVTT=hc.WebVTT;var an=hc.VTTCue,bn=hc.VTTRegion,cn=bb.VTTCue,dn=bb.VTTRegion;hc.shim=function(){bb.VTTCue=an;bb.VTTRegion=bn};hc.restore=function(){bb.VTTCue= |
|
cn;bb.VTTRegion=dn};bb.VTTCue||hc.shim();const Hi=jb.getDefaultExportFromCjs(Gi);var Ii={exports:{}};(function(d,f){(function(k){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,u=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,b=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,c={buildAbsoluteURL:function(e,g,l){l=l||{};e=e.trim();g=g.trim();if(!g){if(!l.alwaysNormalize)return e;l=c.parseURL(e);if(!l)throw Error("Error trying to parse base URL."); |
|
l.path=c.normalizePath(l.path);return c.buildURLFromParts(l)}var p=c.parseURL(g);if(!p)throw Error("Error trying to parse relative URL.");if(p.scheme){if(!l.alwaysNormalize)return g;p.path=c.normalizePath(p.path);return c.buildURLFromParts(p)}g=c.parseURL(e);if(!g)throw Error("Error trying to parse base URL.");!g.netLoc&&g.path&&"/"!==g.path[0]&&(e=u.exec(g.path),g.netLoc=e[1],g.path=e[2]);g.netLoc&&!g.path&&(g.path="/");e={scheme:g.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment}; |
|
p.netLoc||(e.netLoc=g.netLoc,"/"!==p.path[0]&&(p.path?(g=g.path,g=g.substring(0,g.lastIndexOf("/")+1)+p.path,e.path=c.normalizePath(g)):(e.path=g.path,p.params||(e.params=g.params,p.query||(e.query=g.query)))));null===e.path&&(e.path=l.alwaysNormalize?c.normalizePath(p.path):p.path);return c.buildURLFromParts(e)},parseURL:function(e){return(e=n.exec(e))?{scheme:e[1]||"",netLoc:e[2]||"",path:e[3]||"",params:e[4]||"",query:e[5]||"",fragment:e[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(a, |
|
"");e.length!==(e=e.replace(b,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};d.exports=c})()})(Ii);const Ji=jb.getDefaultExportFromCjs(Ii.exports);var Ja=function(d,f){if(/^[a-z]+:/i.test(f))return f;/^data:/.test(d)&&(d=D.location&&D.location.href||"");var k="function"===typeof D.URL,n=/^\/\//.test(d),u=!D.location&&!/\/\//i.test(d);k?d=new D.URL(d,D.location||"http://example.com"):/\/\//i.test(d)|| |
|
(d=Ji.buildAbsoluteURL(D.location&&D.location.href||"",d));return k?(d=new URL(f,d),u?d.href.slice(18):n?d.href.slice(d.protocol.length):d.href):Ji.buildAbsoluteURL(d,f)},Hf=function(){function d(){this.listeners={}}var f=d.prototype;f.on=function(k,n){this.listeners[k]||(this.listeners[k]=[]);this.listeners[k].push(n)};f.off=function(k,n){if(!this.listeners[k])return!1;n=this.listeners[k].indexOf(n);this.listeners[k]=this.listeners[k].slice(0);this.listeners[k].splice(n,1);return-1<n};f.trigger= |
|
function(k){var n=this.listeners[k];if(n)if(2===arguments.length)for(var u=n.length,a=0;a<u;++a)n[a].call(this,arguments[1]);else{u=Array.prototype.slice.call(arguments,1);a=n.length;for(var b=0;b<a;++b)n[b].apply(this,u)}};f.dispose=function(){this.listeners={}};f.pipe=function(k){this.on("data",function(n){k.push(n)})};return d}();class en extends Hf{constructor(){super();this.buffer=""}push(d){this.buffer+=d;for(d=this.buffer.indexOf("\n");-1<d;d=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0, |
|
d)),this.buffer=this.buffer.substring(d+1)}}const fn=String.fromCharCode(9),If=function(d){d=/([0-9.]*)?@?([0-9.]*)?/.exec(d||"");const f={};d[1]&&(f.length=parseInt(d[1],10));d[2]&&(f.offset=parseInt(d[2],10));return f},db=function(d){const f={};if(!d)return f;d=d.split.call(d,RegExp('(?:^|,)((?:[^\x3d]*)\x3d(?:"[^"]*"|[^,]*))'));let k=d.length,n;for(;k--;)""!==d[k]&&(n=/([^=]*)=(.*)/.exec(d[k]).slice(1),n[0]=n[0].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^\s+|\s+$/g,""),n[1]=n[1].replace(/^['"](.*)['"]$/g, |
|
"$1"),f[n[0]]=n[1]);return f};class gn extends Hf{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(d){let f,k;d=d.trim();0!==d.length&&("#"!==d[0]?this.trigger("data",{type:"uri",uri:d}):this.tagMappers.reduce((n,u)=>{u=u(d);return u===d?n:n.concat([u])},[d]).forEach(n=>{for(var u=0;u<this.customParsers.length;u++)if(this.customParsers[u].call(this,n))return;if(0!==n.indexOf("#EXT"))this.trigger("data",{type:"comment",text:n.slice(1)});else if(n=n.replace("\r",""),f=/^#EXTM3U/.exec(n))this.trigger("data", |
|
{type:"tag",tagType:"m3u"});else if(f=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(n))k={type:"tag",tagType:"inf"},f[1]&&(k.duration=parseFloat(f[1])),f[2]&&(k.title=f[2]),this.trigger("data",k);else if(f=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(n))k={type:"tag",tagType:"targetduration"},f[1]&&(k.duration=parseInt(f[1],10)),this.trigger("data",k);else if(f=/^#EXT-X-VERSION:([0-9.]*)?/.exec(n))k={type:"tag",tagType:"version"},f[1]&&(k.version=parseInt(f[1],10)),this.trigger("data",k);else if(f=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(n))k= |
|
{type:"tag",tagType:"media-sequence"},f[1]&&(k.number=parseInt(f[1],10)),this.trigger("data",k);else if(f=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(n))k={type:"tag",tagType:"discontinuity-sequence"},f[1]&&(k.number=parseInt(f[1],10)),this.trigger("data",k);else if(f=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(n))k={type:"tag",tagType:"playlist-type"},f[1]&&(k.playlistType=f[1]),this.trigger("data",k);else if(f=/^#EXT-X-BYTERANGE:(.*)?$/.exec(n))k=nb(If(f[1]),{type:"tag",tagType:"byterange"}),this.trigger("data", |
|
k);else if(f=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(n))k={type:"tag",tagType:"allow-cache"},f[1]&&(k.allowed=!/NO/.test(f[1])),this.trigger("data",k);else if(f=/^#EXT-X-MAP:(.*)$/.exec(n)){k={type:"tag",tagType:"map"};if(f[1]){var a=db(f[1]);a.URI&&(k.uri=a.URI);a.BYTERANGE&&(k.byterange=If(a.BYTERANGE))}this.trigger("data",k)}else if(f=/^#EXT-X-STREAM-INF:(.*)$/.exec(n))k={type:"tag",tagType:"stream-inf"},f[1]&&(k.attributes=db(f[1]),k.attributes.RESOLUTION&&(a=k.attributes.RESOLUTION.split("x"),n= |
|
{},a[0]&&(n.width=parseInt(a[0],10)),a[1]&&(n.height=parseInt(a[1],10)),k.attributes.RESOLUTION=n),k.attributes.BANDWIDTH&&(k.attributes.BANDWIDTH=parseInt(k.attributes.BANDWIDTH,10)),k.attributes["FRAME-RATE"]&&(k.attributes["FRAME-RATE"]=parseFloat(k.attributes["FRAME-RATE"])),k.attributes["PROGRAM-ID"]&&(k.attributes["PROGRAM-ID"]=parseInt(k.attributes["PROGRAM-ID"],10))),this.trigger("data",k);else if(f=/^#EXT-X-MEDIA:(.*)$/.exec(n))k={type:"tag",tagType:"media"},f[1]&&(k.attributes=db(f[1])), |
|
this.trigger("data",k);else if(f=/^#EXT-X-ENDLIST/.exec(n))this.trigger("data",{type:"tag",tagType:"endlist"});else if(f=/^#EXT-X-DISCONTINUITY/.exec(n))this.trigger("data",{type:"tag",tagType:"discontinuity"});else if(f=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(n))k={type:"tag",tagType:"program-date-time"},f[1]&&(k.dateTimeString=f[1],k.dateTimeObject=new Date(f[1])),this.trigger("data",k);else if(f=/^#EXT-X-KEY:(.*)$/.exec(n))k={type:"tag",tagType:"key"},f[1]&&(k.attributes=db(f[1]),k.attributes.IV&& |
|
("0x"===k.attributes.IV.substring(0,2).toLowerCase()&&(k.attributes.IV=k.attributes.IV.substring(2)),k.attributes.IV=k.attributes.IV.match(/.{8}/g),k.attributes.IV[0]=parseInt(k.attributes.IV[0],16),k.attributes.IV[1]=parseInt(k.attributes.IV[1],16),k.attributes.IV[2]=parseInt(k.attributes.IV[2],16),k.attributes.IV[3]=parseInt(k.attributes.IV[3],16),k.attributes.IV=new Uint32Array(k.attributes.IV))),this.trigger("data",k);else if(f=/^#EXT-X-START:(.*)$/.exec(n))k={type:"tag",tagType:"start"},f[1]&& |
|
(k.attributes=db(f[1]),k.attributes["TIME-OFFSET"]=parseFloat(k.attributes["TIME-OFFSET"]),k.attributes.PRECISE=/YES/.test(k.attributes.PRECISE)),this.trigger("data",k);else if(f=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(n))k={type:"tag",tagType:"cue-out-cont"},k.data=f[1]?f[1]:"",this.trigger("data",k);else if(f=/^#EXT-X-CUE-OUT:(.*)?$/.exec(n))k={type:"tag",tagType:"cue-out"},k.data=f[1]?f[1]:"",this.trigger("data",k);else if(f=/^#EXT-X-CUE-IN:(.*)?$/.exec(n))k={type:"tag",tagType:"cue-in"},k.data=f[1]? |
|
f[1]:"",this.trigger("data",k);else if((f=/^#EXT-X-SKIP:(.*)$/.exec(n))&&f[1])k={type:"tag",tagType:"skip"},k.attributes=db(f[1]),k.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(k.attributes["SKIPPED-SEGMENTS"]=parseInt(k.attributes["SKIPPED-SEGMENTS"],10)),k.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(k.attributes["RECENTLY-REMOVED-DATERANGES"]=k.attributes["RECENTLY-REMOVED-DATERANGES"].split(fn)),this.trigger("data",k);else if((f=/^#EXT-X-PART:(.*)$/.exec(n))&&f[1])k={type:"tag", |
|
tagType:"part"},k.attributes=db(f[1]),["DURATION"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=parseFloat(k.attributes[b]))}),["INDEPENDENT","GAP"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=/YES/.test(k.attributes[b]))}),k.attributes.hasOwnProperty("BYTERANGE")&&(k.attributes.byterange=If(k.attributes.BYTERANGE)),this.trigger("data",k);else if((f=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(n))&&f[1])k={type:"tag",tagType:"server-control"},k.attributes=db(f[1]), |
|
["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=parseFloat(k.attributes[b]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=/YES/.test(k.attributes[b]))}),this.trigger("data",k);else if((f=/^#EXT-X-PART-INF:(.*)$/.exec(n))&&f[1])k={type:"tag",tagType:"part-inf"},k.attributes=db(f[1]),["PART-TARGET"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]= |
|
parseFloat(k.attributes[b]))}),this.trigger("data",k);else if((f=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(n))&&f[1])k={type:"tag",tagType:"preload-hint"},k.attributes=db(f[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=parseInt(k.attributes[b],10),k.attributes.byterange=k.attributes.byterange||{},k.attributes.byterange["BYTERANGE-LENGTH"===b?"length":"offset"]=k.attributes[b],delete k.attributes[b])}),this.trigger("data",k);else if((f=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(n))&& |
|
f[1])k={type:"tag",tagType:"rendition-report"},k.attributes=db(f[1]),["LAST-MSN","LAST-PART"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=parseInt(k.attributes[b],10))}),this.trigger("data",k);else if((f=/^#EXT-X-DATERANGE:(.*)$/.exec(n))&&f[1]){k={type:"tag",tagType:"daterange"};k.attributes=db(f[1]);["ID","CLASS"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=String(k.attributes[b]))});["START-DATE","END-DATE"].forEach(function(b){k.attributes.hasOwnProperty(b)&& |
|
(k.attributes[b]=new Date(k.attributes[b]))});["DURATION","PLANNED-DURATION"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=parseFloat(k.attributes[b]))});["END-ON-NEXT"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=/YES/i.test(k.attributes[b]))});["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(b){k.attributes.hasOwnProperty(b)&&(k.attributes[b]=k.attributes[b].toString(16))});n=/^X-([A-Z]+-)+[A-Z]+$/;for(a in k.attributes){if(!n.test(a))continue; |
|
u=/[0-9A-Fa-f]{6}/g.test(k.attributes[a]);const b=/^\d+(\.\d+)?$/.test(k.attributes[a]);k.attributes[a]=u?k.attributes[a].toString(16):b?parseFloat(k.attributes[a]):String(k.attributes[a])}this.trigger("data",k)}else(f=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(n))?this.trigger("data",{type:"tag",tagType:"independent-segments"}):(f=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(n))?(k={type:"tag",tagType:"content-steering"},k.attributes=db(f[1]),this.trigger("data",k)):this.trigger("data",{type:"tag",data:n.slice(4)})}))}addParser({expression:d, |
|
customType:f,dataParser:k,segment:n}){"function"!==typeof k&&(k=u=>u);this.customParsers.push(u=>{if(d.exec(u))return this.trigger("data",{type:"custom",data:k(u),customType:f,segment:n}),!0})}addTagMapper({expression:d,map:f}){this.tagMappers.push(k=>d.test(k)?f(k):k)}}const hn=d=>d.toLowerCase().replace(/-(\w)/g,f=>f[1].toUpperCase()),Yb=function(d){const f={};Object.keys(d).forEach(function(k){f[hn(k)]=d[k]});return f},Jf=function(d){const {serverControl:f,targetDuration:k,partTargetDuration:n}= |
|
d;if(f){d=k&&3*k;var u=n&&2*n;k&&!f.hasOwnProperty("holdBack")&&(f.holdBack=d,this.trigger("info",{message:`${"#EXT-X-SERVER-CONTROL"} defaulting HOLD-BACK to targetDuration * 3 (${d}).`}));d&&f.holdBack<d&&(this.trigger("warn",{message:`${"#EXT-X-SERVER-CONTROL"} clamping HOLD-BACK (${f.holdBack}) to targetDuration * 3 (${d})`}),f.holdBack=d);n&&!f.hasOwnProperty("partHoldBack")&&(f.partHoldBack=3*n,this.trigger("info",{message:`${"#EXT-X-SERVER-CONTROL"} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${f.partHoldBack}).`})); |
|
n&&f.partHoldBack<u&&(this.trigger("warn",{message:`${"#EXT-X-SERVER-CONTROL"} clamping PART-HOLD-BACK (${f.partHoldBack}) to partTargetDuration * 2 (${u}).`}),f.partHoldBack=u)}};class jn extends Hf{constructor(){super();this.lineStream=new en;this.parseStream=new gn;this.lineStream.pipe(this.parseStream);this.lastProgramDateTime=null;const d=this,f=[];let k={},n,u,a=!1;const b=function(){},c={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let e=0;this.manifest={allowCache:!0,discontinuityStarts:[], |
|
dateRanges:[],segments:[]};let g=0,l=0;const p={};this.on("end",()=>{k.uri||!k.parts&&!k.preloadHints||(!k.map&&n&&(k.map=n),!k.key&&u&&(k.key=u),k.timeline||"number"!==typeof e||(k.timeline=e),this.manifest.preloadSegment=k)});this.parseStream.on("data",function(t){let x,y;({tag(){({version(){t.version&&(this.manifest.version=t.version)},["allow-cache"](){this.manifest.allowCache=t.allowed;"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)}, |
|
byterange(){const A={};"length"in t&&(k.byterange=A,A.length=t.length,"offset"in t||(t.offset=g));"offset"in t&&(k.byterange=A,A.offset=t.offset);g=A.offset+A.length},endlist(){this.manifest.endList=!0},inf(){"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"}));t.title&& |
|
(k.title=t.title);0<t.duration&&(k.duration=t.duration);0===t.duration&&(k.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"}));this.manifest.segments=f},key(){if(t.attributes)if("NONE"===t.attributes.METHOD)u=null;else if(t.attributes.URI)if("com.apple.streamingkeydelivery"===t.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:t.attributes};else if("com.microsoft.playready"=== |
|
t.attributes.KEYFORMAT)this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:t.attributes.URI};else if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===t.attributes.KEYFORMAT)if(-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD))this.trigger("warn",{message:"invalid key method provided for Widevine"});else if("SAMPLE-AES-CENC"===t.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}), |
|
"data:text/plain;base64,"!==t.attributes.URI.substring(0,23))this.trigger("warn",{message:"invalid key URI provided for Widevine"});else if(t.attributes.KEYID&&"0x"===t.attributes.KEYID.substring(0,2)){this.manifest.contentProtection=this.manifest.contentProtection||{};var A=this.manifest.contentProtection,z={schemeIdUri:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)};var E=t.attributes.URI.split(",")[1];E=D.atob?D.atob(E):Buffer.from(E,"base64").toString("binary");for(var I=new Uint8Array(E.length), |
|
G=0;G<E.length;G++)I[G]=E.charCodeAt(G);A["com.widevine.alpha"]={attributes:z,pssh:I}}else this.trigger("warn",{message:"invalid key ID provided for Widevine"});else t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),u={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},"undefined"!==typeof t.attributes.IV&&(u.iv=t.attributes.IV);else this.trigger("warn",{message:"ignoring key declaration without URI"});else this.trigger("warn",{message:"ignoring key declaration without attribute list"})}, |
|
["media-sequence"](){isFinite(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},["discontinuity-sequence"](){isFinite(t.number)?e=this.manifest.discontinuitySequence=t.number:this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},["playlist-type"](){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})}, |
|
map(){n={};t.uri&&(n.uri=t.uri);t.byterange&&(n.byterange=t.byterange);u&&(n.key=u)},["stream-inf"](){this.manifest.playlists=f;this.manifest.mediaGroups=this.manifest.mediaGroups||c;t.attributes?(k.attributes||(k.attributes={}),nb(k.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||c;if(t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME){var A=this.manifest.mediaGroups[t.attributes.TYPE]; |
|
A[t.attributes["GROUP-ID"]]=A[t.attributes["GROUP-ID"]]||{};x=A[t.attributes["GROUP-ID"]];y={default:/yes/i.test(t.attributes.DEFAULT)};y.autoselect=y.default?!0:/yes/i.test(t.attributes.AUTOSELECT);t.attributes.LANGUAGE&&(y.language=t.attributes.LANGUAGE);t.attributes.URI&&(y.uri=t.attributes.URI);t.attributes["INSTREAM-ID"]&&(y.instreamId=t.attributes["INSTREAM-ID"]);t.attributes.CHARACTERISTICS&&(y.characteristics=t.attributes.CHARACTERISTICS);t.attributes.FORCED&&(y.forced=/yes/i.test(t.attributes.FORCED)); |
|
x[t.attributes.NAME]=y}else this.trigger("warn",{message:"ignoring incomplete or missing media group"})},discontinuity(){e+=1;k.discontinuity=!0;this.manifest.discontinuityStarts.push(f.length)},["program-date-time"](){"undefined"===typeof this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject);k.dateTimeString=t.dateTimeString;k.dateTimeObject=t.dateTimeObject;const {lastProgramDateTime:A}=this;this.lastProgramDateTime=(new Date(t.dateTimeString)).getTime(); |
|
null===A&&this.manifest.segments.reduceRight((z,E)=>{E.programDateTime=z-1E3*E.duration;return E.programDateTime},this.lastProgramDateTime)},targetduration(){!isFinite(t.duration)||0>t.duration?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):(this.manifest.targetDuration=t.duration,Jf.call(this,this.manifest))},start(){!t.attributes||isNaN(t.attributes["TIME-OFFSET"])?this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"}):this.manifest.start= |
|
{timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}},["cue-out"](){k.cueOut=t.data},["cue-out-cont"](){k.cueOutCont=t.data},["cue-in"](){k.cueIn=t.data},skip(){this.manifest.skip=Yb(t.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",t.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const A=this.manifest.segments.length,z=Yb(t.attributes);k.parts=k.parts||[];k.parts.push(z);z.byterange&&(z.byterange.hasOwnProperty("offset")||(z.byterange.offset=l),l=z.byterange.offset+z.byterange.length); |
|
this.warnOnMissingAttributes_(`#EXT-X-PART #${k.parts.length-1} for segment #${A}`,t.attributes,["URI","DURATION"]);this.manifest.renditionReports&&this.manifest.renditionReports.forEach((E,I)=>{E.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${I} lacks required attribute(s): LAST-PART`})})},["server-control"](){const A=this.manifest.serverControl=Yb(t.attributes);A.hasOwnProperty("canBlockReload")||(A.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})); |
|
Jf.call(this,this.manifest);A.canSkipDateranges&&!A.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},["preload-hint"](){const A=this.manifest.segments.length,z=Yb(t.attributes);var E=z.type&&"PART"===z.type;k.preloadHints=k.preloadHints||[];k.preloadHints.push(z);z.byterange&&!z.byterange.hasOwnProperty("offset")&&(z.byterange.offset=E?l:0,E&&(l=z.byterange.offset+z.byterange.length)); |
|
E=k.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${E} for segment #${A}`,t.attributes,["TYPE","URI"]);if(z.type)for(let I=0;I<k.preloadHints.length-1;I++){const G=k.preloadHints[I];G.type&&G.type===z.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${E} for segment #${A} has the same TYPE ${z.type} as preload hint #${I}`})}},["rendition-report"](){var A=Yb(t.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[];this.manifest.renditionReports.push(A); |
|
A=this.manifest.renditionReports.length-1;const z=["LAST-MSN","URI"];a&&z.push("LAST-PART");this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${A}`,t.attributes,z)},["part-inf"](){this.manifest.partInf=Yb(t.attributes);this.warnOnMissingAttributes_("#EXT-X-PART-INF",t.attributes,["PART-TARGET"]);this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget);Jf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(Yb(t.attributes));var A=this.manifest.dateRanges.length- |
|
1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${A}`,t.attributes,["ID","START-DATE"]);const z=this.manifest.dateRanges[A];z.endDate&&z.startDate&&new Date(z.endDate)<new Date(z.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"});z.duration&&0>z.duration&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"});z.plannedDuration&&0>z.plannedDuration&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"}); |
|
var E=!!z.endOnNext;E&&!z.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT\x3dYES attribute must have a CLASS attribute"});E&&(z.duration||z.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT\x3dYES attribute must not contain DURATION or END-DATE attributes"});z.duration&&z.endDate&&(E=z.startDate.getTime()+1E3*z.duration,this.manifest.dateRanges[A].endDate=new Date(E));if(p[z.id]){for(const I in p[z.id])if(z[I]&&JSON.stringify(p[z.id][I])!==JSON.stringify(z[I])){this.trigger("warn", |
|
{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}A=this.manifest.dateRanges.findIndex(I=>I.id===z.id);this.manifest.dateRanges[A]=nb(this.manifest.dateRanges[A],z);p[z.id]=nb(p[z.id],z);this.manifest.dateRanges.pop()}else p[z.id]=z},["independent-segments"](){this.manifest.independentSegments=!0},["content-steering"](){this.manifest.contentSteering=Yb(t.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",t.attributes,["SERVER-URI"])}}[t.tagType]|| |
|
b).call(d)},uri(){k.uri=t.uri;f.push(k);!this.manifest.targetDuration||"duration"in k||(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),k.duration=this.manifest.targetDuration);u&&(k.key=u);k.timeline=e;n&&(k.map=n);l=0;null!==this.lastProgramDateTime&&(k.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1E3*k.duration);k={}},comment(){},custom(){t.segment?(k.custom=k.custom||{},k.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom|| |
|
{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(d)})}warnOnMissingAttributes_(d,f,k){const n=[];k.forEach(function(u){f.hasOwnProperty(u)||n.push(u)});n.length&&this.trigger("warn",{message:`${d} lacks required attribute(s): ${n.join(", ")}`})}push(d){this.lineStream.push(d)}end(){this.lineStream.push("\n");this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}); |
|
this.lastProgramDateTime=null;this.trigger("end")}addParser(d){this.parseStream.addParser(d)}addTagMapper(d){this.parseStream.addTagMapper(d)}}var ic={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/}, |
|
kn=["video","audio","text"],Ki=["Video","Audio","Text"],Li=function(d){return d?d.replace(/avc1\.(\d+)\.(\d+)/i,function(f,k,n){f=("00"+Number(k).toString(16)).slice(-2);n=("00"+Number(n).toString(16)).slice(-2);return"avc1."+f+"00"+n}):d},zb=function(d){void 0===d&&(d="");var f=[];d.split(",").forEach(function(k){k=k.trim();var n;kn.forEach(function(u){var a=ic[u].exec(k.toLowerCase());if(a&&!(1>=a.length)){n=u;a=k.substring(0,a[1].length);var b=k.replace(a,"");f.push({type:a,details:b,mediaType:u})}}); |
|
n||f.push({type:k,details:"",mediaType:"unknown"})});return f},ln=function(d,f){if(!d.mediaGroups.AUDIO||!f)return null;d=d.mediaGroups.AUDIO[f];if(!d)return null;for(var k in d)if(f=d[k],f.default&&f.playlists)return zb(f.playlists[0].attributes.CODECS);return null},Mi=function(d){void 0===d&&(d="");return ic.audio.test(d.trim().toLowerCase())},mn=function(d){void 0===d&&(d="");return ic.text.test(d.trim().toLowerCase())},id=function(d){if(d&&"string"===typeof d){var f=d.toLowerCase().split(",").map(function(u){return Li(u.trim())}), |
|
k="video";1===f.length&&Mi(f[0])?k="audio":1===f.length&&mn(f[0])&&(k="application");var n="mp4";f.every(function(u){return ic.mp4.test(u)})?n="mp4":f.every(function(u){return ic.webm.test(u)})?n="webm":f.every(function(u){return ic.ogg.test(u)})&&(n="ogg");return k+"/"+n+';codecs\x3d"'+d+'"'}},be=function(d){void 0===d&&(d="");return D.MediaSource&&D.MediaSource.isTypeSupported&&D.MediaSource.isTypeSupported(id(d))||!1},Kf=function(d){void 0===d&&(d="");return d.toLowerCase().split(",").every(function(f){f= |
|
f.trim();for(var k=0;k<Ki.length;k++)if(ic["muxer"+Ki[k]].test(f))return!0;return!1})},nn=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,on=/^application\/dash\+xml/i,Ni=function(d){return nn.test(d)?"hls":on.test(d)?"dash":"application/vnd.videojs.vhs+json"===d?"vhs-json":null},Oi=function(d){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(d):d&&d.buffer instanceof ArrayBuffer},U=function(d){if(d instanceof Uint8Array)return d;Array.isArray(d)||Oi(d)||d instanceof ArrayBuffer|| |
|
(d="number"!==typeof d||"number"===typeof d&&d!==d?0:[d]);return new Uint8Array(d&&d.buffer||d,d&&d.byteOffset||0,d&&d.byteLength||0)},Ka=D.BigInt||Number,Lf=[Ka("0x1"),Ka("0x100"),Ka("0x10000"),Ka("0x1000000"),Ka("0x100000000"),Ka("0x10000000000"),Ka("0x1000000000000"),Ka("0x100000000000000"),Ka("0x10000000000000000")];(function(){var d=new Uint16Array([65484]);d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);return 255===d[0]?"big":204===d[0]?"little":"unknown"})();var pn=function(d,f){var k= |
|
void 0===f?{}:f;f=k.signed;f=void 0===f?!1:f;k=k.le;var n=void 0===k?!1:k;d=U(d);k=n?"reduce":"reduceRight";k=(d[k]?d[k]:Array.prototype[k]).call(d,function(u,a,b){return u+Ka(a)*Lf[n?b:Math.abs(b+1-d.length)]},Ka(0));f&&(f=Lf[d.length]/Ka(2)-Ka(1),k=Ka(k),k>f&&(k=k-f-f-Ka(2)));return Number(k)},qn=function(d,f){f={}.le;f=void 0===f?!1:f;if("bigint"!==typeof d&&"number"!==typeof d||"number"===typeof d&&d!==d)d=0;d=Ka(d);for(var k=Math.ceil(d.toString(2).length/8),n=new Uint8Array(new ArrayBuffer(k)), |
|
u=0;u<k;u++){var a=f?u:Math.abs(u+1-n.length);n[a]=Number(d/Lf[u]&Ka(255));0>d&&(n[a]=Math.abs(~n[a]),n[a]-=0===u?1:2)}return n},Pi=function(d,f){"string"!==typeof d&&d&&"function"===typeof d.toString&&(d=d.toString());if("string"!==typeof d)return new Uint8Array;f||(d=unescape(encodeURIComponent(d)));f=new Uint8Array(d.length);for(var k=0;k<d.length;k++)f[k]=d.charCodeAt(k);return f},rn=function(){for(var d=arguments.length,f=Array(d),k=0;k<d;k++)f[k]=arguments[k];f=f.filter(function(a){return a&& |
|
(a.byteLength||a.length)&&"string"!==typeof a});if(1>=f.length)return U(f[0]);d=f.reduce(function(a,b,c){return a+(b.byteLength||b.length)},0);var n=new Uint8Array(d),u=0;f.forEach(function(a){a=U(a);n.set(a,u);u+=a.byteLength});return n},pa=function(d,f,k){k=void 0===k?{}:k;var n=k.offset,u=void 0===n?0:n;k=k.mask;var a=void 0===k?[]:k;d=U(d);f=U(f);k=f.every?f.every:Array.prototype.every;return f.length&&d.length-u>=f.length&&k.call(f,function(b,c){return b===(a[c]?a[c]&d[u+c]:d[u+c])})},sn=function(d, |
|
f,k){f.forEach(function(n){for(var u in d.mediaGroups[n])for(var a in d.mediaGroups[n][u])k(d.mediaGroups[n][u][a],n,u,a)})},tn=Kd({HTML:"text/html",isHTML:function(d){return d===tn.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Qi=Kd({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(d){return d===Qi.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}); |
|
var ce=Qi;var wb=function(d,f,k){void 0===k&&(k=Array.prototype);if(d&&"function"===typeof k.find)return k.find.call(d,f);for(k=0;k<d.length;k++)if(Object.prototype.hasOwnProperty.call(d,k)){var n=d[k];if(f.call(void 0,n,k,d))return n}},sc=ce,Xa={},ob=Xa.ELEMENT_NODE=1,vc=Xa.ATTRIBUTE_NODE=2,Pd=Xa.TEXT_NODE=3,Nh=Xa.CDATA_SECTION_NODE=4,Rh=Xa.ENTITY_REFERENCE_NODE=5,un=Xa.ENTITY_NODE=6,Qh=Xa.PROCESSING_INSTRUCTION_NODE=7,Oh=Xa.COMMENT_NODE=8,Mh=Xa.DOCUMENT_NODE=9,Ph=Xa.DOCUMENT_TYPE_NODE=10,Jb=Xa.DOCUMENT_FRAGMENT_NODE= |
|
11,vn=Xa.NOTATION_NODE=12,Oa={},Ea={};Oa.INDEX_SIZE_ERR=(Ea[1]="Index size error",1);Oa.DOMSTRING_SIZE_ERR=(Ea[2]="DOMString size error",2);var Va=Oa.HIERARCHY_REQUEST_ERR=(Ea[3]="Hierarchy request error",3);Oa.WRONG_DOCUMENT_ERR=(Ea[4]="Wrong document",4);Oa.INVALID_CHARACTER_ERR=(Ea[5]="Invalid character",5);Oa.NO_DATA_ALLOWED_ERR=(Ea[6]="No data allowed",6);Oa.NO_MODIFICATION_ALLOWED_ERR=(Ea[7]="No modification allowed",7);var Ch=Oa.NOT_FOUND_ERR=(Ea[8]="Not found",8);Oa.NOT_SUPPORTED_ERR=(Ea[9]= |
|
"Not supported",9);var Ri=Oa.INUSE_ATTRIBUTE_ERR=(Ea[10]="Attribute in use",10);Oa.INVALID_STATE_ERR=(Ea[11]="Invalid state",11);Oa.SYNTAX_ERR=(Ea[12]="Syntax error",12);Oa.INVALID_MODIFICATION_ERR=(Ea[13]="Invalid modification",13);Oa.NAMESPACE_ERR=(Ea[14]="Invalid namespace",14);Oa.INVALID_ACCESS_ERR=(Ea[15]="Invalid access",15);Ba.prototype=Error.prototype;Zc(Oa,Ba);Tb.prototype={length:0,item:function(d){return 0<=d&&d<this.length?this[d]:null},toString:function(d,f){for(var k=[],n=0;n<this.length;n++)uc(this[n], |
|
k,d,f);return k.join("")},filter:function(d){return Array.prototype.filter.call(this,d)},indexOf:function(d){return Array.prototype.indexOf.call(this,d)}};rc.prototype.item=function(d){cf(this);return this[d]||null};Ua(rc,Tb);Ld.prototype={length:0,item:Tb.prototype.item,getNamedItem:function(d){for(var f=this.length;f--;){var k=this[f];if(k.nodeName==d)return k}},setNamedItem:function(d){var f=d.ownerElement;if(f&&f!=this._ownerElement)throw new Ba(Ri);f=this.getNamedItem(d.nodeName);Ah(this._ownerElement, |
|
this,d,f);return f},setNamedItemNS:function(d){var f=d.ownerElement;if(f&&f!=this._ownerElement)throw new Ba(Ri);f=this.getNamedItemNS(d.namespaceURI,d.localName);Ah(this._ownerElement,this,d,f);return f},removeNamedItem:function(d){d=this.getNamedItem(d);Bh(this._ownerElement,this,d);return d},removeNamedItemNS:function(d,f){d=this.getNamedItemNS(d,f);Bh(this._ownerElement,this,d);return d},getNamedItemNS:function(d,f){for(var k=this.length;k--;){var n=this[k];if(n.localName==f&&n.namespaceURI== |
|
d)return n}return null}};Dh.prototype={hasFeature:function(d,f){return!0},createDocument:function(d,f,k){var n=new ad;n.implementation=this;n.childNodes=new Tb;n.doctype=k||null;k&&n.appendChild(k);f&&(d=n.createElementNS(d,f),n.appendChild(d));return n},createDocumentType:function(d,f,k){var n=new jf;n.name=d;n.nodeName=d;n.publicId=f||"";n.systemId=k||"";return n}};ka.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null, |
|
ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(d,f){return Md(this,d,f)},replaceChild:function(d,f){Md(this,d,f,Ih);f&&this.removeChild(f)},removeChild:function(d){return Fh(this,d)},appendChild:function(d){return this.insertBefore(d,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(d){return nf(this.ownerDocument||this,this,d)},normalize:function(){for(var d=this.firstChild;d;){var f=d.nextSibling;f&&f.nodeType== |
|
Pd&&d.nodeType==Pd?(this.removeChild(f),d.appendData(f.data)):(d.normalize(),d=f)}},isSupported:function(d,f){return this.ownerDocument.implementation.hasFeature(d,f)},hasAttributes:function(){return 0<this.attributes.length},lookupPrefix:function(d){for(var f=this;f;){var k=f._nsMap;if(k)for(var n in k)if(Object.prototype.hasOwnProperty.call(k,n)&&k[n]===d)return n;f=f.nodeType==vc?f.ownerDocument:f.parentNode}return null},lookupNamespaceURI:function(d){for(var f=this;f;){var k=f._nsMap;if(k&&Object.prototype.hasOwnProperty.call(k, |
|
d))return k[d];f=f.nodeType==vc?f.ownerDocument:f.parentNode}return null},isDefaultNamespace:function(d){return null==this.lookupPrefix(d)}};Zc(Xa,ka);Zc(Xa,ka.prototype);ad.prototype={nodeName:"#document",nodeType:Mh,doctype:null,documentElement:null,_inc:1,insertBefore:function(d,f){if(d.nodeType==Jb){for(var k=d.firstChild;k;){var n=k.nextSibling;this.insertBefore(k,f);k=n}return d}Md(this,d,f);d.ownerDocument=this;null===this.documentElement&&d.nodeType===ob&&(this.documentElement=d);return d}, |
|
removeChild:function(d){this.documentElement==d&&(this.documentElement=null);return Fh(this,d)},replaceChild:function(d,f){Md(this,d,f,Ih);d.ownerDocument=this;f&&this.removeChild(f);vb(d)&&(this.documentElement=d)},importNode:function(d,f){return Sh(this,d,f)},getElementById:function(d){var f=null;$c(this.documentElement,function(k){if(k.nodeType==ob&&k.getAttribute("id")==d)return f=k,!0});return f},getElementsByClassName:function(d){var f=xh(d);return new rc(this,function(k){var n=[];0<f.length&& |
|
$c(k.documentElement,function(u){if(u!==k&&u.nodeType===ob){var a=u.getAttribute("class");if(a){var b=d===a;b||(a=xh(a),b=f.every(Cm(a)));b&&n.push(u)}}});return n})},createElement:function(d){var f=new tc;f.ownerDocument=this;f.nodeName=d;f.tagName=d;f.localName=d;f.childNodes=new Tb;return(f.attributes=new Ld)._ownerElement=f},createDocumentFragment:function(){var d=new Od;d.ownerDocument=this;d.childNodes=new Tb;return d},createTextNode:function(d){var f=new ff;f.ownerDocument=this;f.appendData(d); |
|
return f},createComment:function(d){var f=new gf;f.ownerDocument=this;f.appendData(d);return f},createCDATASection:function(d){var f=new hf;f.ownerDocument=this;f.appendData(d);return f},createProcessingInstruction:function(d,f){var k=new lf;k.ownerDocument=this;k.tagName=k.nodeName=k.target=d;k.nodeValue=k.data=f;return k},createAttribute:function(d){var f=new Nd;f.ownerDocument=this;f.name=d;f.nodeName=d;f.localName=d;f.specified=!0;return f},createEntityReference:function(d){var f=new kf;f.ownerDocument= |
|
this;f.nodeName=d;return f},createElementNS:function(d,f){var k=new tc,n=f.split(":"),u=k.attributes=new Ld;k.childNodes=new Tb;k.ownerDocument=this;k.nodeName=f;k.tagName=f;k.namespaceURI=d;2==n.length?(k.prefix=n[0],k.localName=n[1]):k.localName=f;return u._ownerElement=k},createAttributeNS:function(d,f){var k=new Nd,n=f.split(":");k.ownerDocument=this;k.nodeName=f;k.name=f;k.namespaceURI=d;k.specified=!0;2==n.length?(k.prefix=n[0],k.localName=n[1]):k.localName=f;return k}};Ua(ad,ka);tc.prototype= |
|
{nodeType:ob,hasAttribute:function(d){return null!=this.getAttributeNode(d)},getAttribute:function(d){return(d=this.getAttributeNode(d))&&d.value||""},getAttributeNode:function(d){return this.attributes.getNamedItem(d)},setAttribute:function(d,f){d=this.ownerDocument.createAttribute(d);d.value=d.nodeValue=""+f;this.setAttributeNode(d)},removeAttribute:function(d){(d=this.getAttributeNode(d))&&this.removeAttributeNode(d)},appendChild:function(d){if(d.nodeType===Jb)return this.insertBefore(d,null); |
|
d.parentNode&&d.parentNode.removeChild(d);d.parentNode=this;d.previousSibling=this.lastChild;d.nextSibling=null;d.previousSibling?d.previousSibling.nextSibling=d:this.firstChild=d;this.lastChild=d;df(this.ownerDocument,this,d);return d},setAttributeNode:function(d){return this.attributes.setNamedItem(d)},setAttributeNodeNS:function(d){return this.attributes.setNamedItemNS(d)},removeAttributeNode:function(d){return this.attributes.removeNamedItem(d.nodeName)},removeAttributeNS:function(d,f){(d=this.getAttributeNodeNS(d, |
|
f))&&this.removeAttributeNode(d)},hasAttributeNS:function(d,f){return null!=this.getAttributeNodeNS(d,f)},getAttributeNS:function(d,f){return(d=this.getAttributeNodeNS(d,f))&&d.value||""},setAttributeNS:function(d,f,k){d=this.ownerDocument.createAttributeNS(d,f);d.value=d.nodeValue=""+k;this.setAttributeNode(d)},getAttributeNodeNS:function(d,f){return this.attributes.getNamedItemNS(d,f)},getElementsByTagName:function(d){return new rc(this,function(f){var k=[];$c(f,function(n){n===f||n.nodeType!=ob|| |
|
"*"!==d&&n.tagName!=d||k.push(n)});return k})},getElementsByTagNameNS:function(d,f){return new rc(this,function(k){var n=[];$c(k,function(u){u===k||u.nodeType!==ob||"*"!==d&&u.namespaceURI!==d||"*"!==f&&u.localName!=f||n.push(u)});return n})}};ad.prototype.getElementsByTagName=tc.prototype.getElementsByTagName;ad.prototype.getElementsByTagNameNS=tc.prototype.getElementsByTagNameNS;Ua(tc,ka);Nd.prototype.nodeType=vc;Ua(Nd,ka);bd.prototype={data:"",substringData:function(d,f){return this.data.substring(d, |
|
d+f)},appendData:function(d){this.nodeValue=this.data=d=this.data+d;this.length=d.length},insertData:function(d,f){this.replaceData(d,0,f)},appendChild:function(d){throw Error(Ea[Va]);},deleteData:function(d,f){this.replaceData(d,f,"")},replaceData:function(d,f,k){var n=this.data.substring(0,d);d=this.data.substring(d+f);this.nodeValue=this.data=k=n+k+d;this.length=k.length}};Ua(bd,ka);ff.prototype={nodeName:"#text",nodeType:Pd,splitText:function(d){var f=this.data,k=f.substring(d);this.data=this.nodeValue= |
|
f=f.substring(0,d);this.length=f.length;d=this.ownerDocument.createTextNode(k);this.parentNode&&this.parentNode.insertBefore(d,this.nextSibling);return d}};Ua(ff,bd);gf.prototype={nodeName:"#comment",nodeType:Oh};Ua(gf,bd);hf.prototype={nodeName:"#cdata-section",nodeType:Nh};Ua(hf,bd);jf.prototype.nodeType=Ph;Ua(jf,ka);Jh.prototype.nodeType=vn;Ua(Jh,ka);Kh.prototype.nodeType=un;Ua(Kh,ka);kf.prototype.nodeType=Rh;Ua(kf,ka);Od.prototype.nodeName="#document-fragment";Od.prototype.nodeType=Jb;Ua(Od,ka); |
|
lf.prototype.nodeType=Qh;Ua(lf,ka);ka.prototype.toString=function(d,f){var k=[],n=9==this.nodeType&&this.documentElement||this,u=n.prefix,a=n.namespaceURI;if(a&&null==u&&(u=n.lookupPrefix(a),null==u))var b=[{namespace:a,prefix:null}];uc(this,k,d,f,b);return k.join("")};try{if(Object.defineProperty){Object.defineProperty(rc.prototype,"length",{get:function(){cf(this);return this.$$length}});Object.defineProperty(ka.prototype,"textContent",{get:function(){return d(this)},set:function(f){switch(this.nodeType){case ob:case Jb:for(;this.firstChild;)this.removeChild(this.firstChild); |
|
(f||String(f))&&this.appendChild(this.ownerDocument.createTextNode(f));break;default:this.nodeValue=this.value=this.data=f}}});function d(f){switch(f.nodeType){case ob:case Jb:var k=[];for(f=f.firstChild;f;)7!==f.nodeType&&8!==f.nodeType&&k.push(d(f)),f=f.nextSibling;return k.join("");default:return f.nodeValue}}yh=function(f,k,n){f["$$"+k]=n}}}catch(d){}var Mf={};(function(d){d.XML_ENTITIES=Kd({amp:"\x26",apos:"'",gt:"\x3e",lt:"\x3c",quot:'"'});d.HTML_ENTITIES=Kd({Aacute:"\u00c1",aacute:"\u00e1", |
|
Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\u00c2",acirc:"\u00e2",acute:"\u00b4",Acy:"\u0410",acy:"\u0430",AElig:"\u00c6",aelig:"\u00e6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\u00c0",agrave:"\u00e0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"\x26",amp:"\x26",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4", |
|
angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\u00c5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\u00c5",aring:"\u00e5", |
|
Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\u00c3",atilde:"\u00e3",Auml:"\u00c4",auml:"\u00e4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235", |
|
because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4", |
|
blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"\x3d\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564", |
|
boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8", |
|
breve:"\u02d8",brvbar:"\u00a6",Bscr:"\u212c",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d", |
|
Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\u00c7",ccedil:"\u00e7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\u00b8",Cedilla:"\u00b8",cemptyv:"\u29b2",cent:"\u00a2",CenterDot:"\u00b7",centerdot:"\u00b7",Cfr:"\u212d",cfr:"\ud835\udd20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b", |
|
circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\u00ae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201", |
|
complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\ud835\udd54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\u00a9",copy:"\u00a9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df", |
|
cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\u00a4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3", |
|
darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\u00b0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\u00b4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`", |
|
DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\u00a8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\u00f7",divide:"\u00f7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\u00a8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1", |
|
doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\u00a8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5", |
|
DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf", |
|
dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\u00c9",eacute:"\u00e9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\u00ca",ecirc:"\u00ea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\u00c8",egrave:"\u00e8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7", |
|
ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96", |
|
eqslantless:"\u2a95",Equal:"\u2a75",equals:"\x3d",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\u00d0",eth:"\u00f0",Euml:"\u00cb",euml:"\u00eb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444", |
|
female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\u00bd",frac13:"\u2153",frac14:"\u00bc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156", |
|
frac34:"\u00be",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\ud835\udcbb",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e", |
|
gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2", |
|
GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:"\x3e",gt:"\x3e",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\u00bd",hamilt:"\u210b",HARDcy:"\u042a", |
|
hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\ud835\udd25",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\ud835\udd59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\ud835\udcbd",hslash:"\u210f",Hstrok:"\u0126", |
|
hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\u00cd",iacute:"\u00ed",ic:"\u2063",Icirc:"\u00ce",icirc:"\u00ee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\u00a1",iff:"\u21d4",Ifr:"\u2111",ifr:"\ud835\udd26",Igrave:"\u00cc",igrave:"\u00ec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148", |
|
imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9", |
|
iprod:"\u2a3c",iquest:"\u00bf",Iscr:"\u2110",iscr:"\ud835\udcbe",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\u00cf",iuml:"\u00ef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454", |
|
Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\u00ab", |
|
Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c", |
|
ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4", |
|
leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d", |
|
les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a", |
|
lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7", |
|
longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\ud835\udcc1", |
|
Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"\x3c",lt:"\x3c",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\u00af",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6", |
|
mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\u00b5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\u00b7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44", |
|
mopf:"\ud835\udd5e",mp:"\u2213",Mscr:"\u2133",mscr:"\ud835\udcc2",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\u00a0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338", |
|
ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271", |
|
ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338", |
|
nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\u00a0",Nopf:"\u2115",nopf:"\ud835\udd5f",Not:"\u2aec",not:"\u00ac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338", |
|
NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338", |
|
NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2", |
|
NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf", |
|
nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281", |
|
nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\u00d1",ntilde:"\u00f1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:"\x3e\u20d2",nvHarr:"\u2904",nvinfin:"\u29de", |
|
nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"\x3c\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\u00d3",oacute:"\u00f3",oast:"\u229b",ocir:"\u229a",Ocirc:"\u00d4",ocirc:"\u00f4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c", |
|
ogon:"\u02db",Ograve:"\u00d2",ograve:"\u00f2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134", |
|
orderof:"\u2134",ordf:"\u00aa",ordm:"\u00ba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\u00d8",oslash:"\u00f8",osol:"\u2298",Otilde:"\u00d5",otilde:"\u00f5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\u00d6",ouml:"\u00f6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\u00b6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202", |
|
Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\u00b1",plusmn:"\u00b1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\u00b1",Poincareplane:"\u210c", |
|
pointint:"\u2a15",Popf:"\u2119",popf:"\ud835\udd61",pound:"\u00a3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f", |
|
profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",Qopf:"\u211a",qopf:"\ud835\udd62",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154", |
|
racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\u00bb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}", |
|
rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\u00ae",reg:"\u00ae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\ud835\udd2f", |
|
rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc", |
|
rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed", |
|
roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\ud835\udcc7",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b", |
|
sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\u00a7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16", |
|
sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\u00ad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190", |
|
SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292", |
|
sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\u00af",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd", |
|
subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6", |
|
succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\u00b9",sup2:"\u00b2",sup3:"\u00b3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc", |
|
supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\u00df",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248", |
|
thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\u00de",thorn:"\u00fe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\u00d7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5", |
|
triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\u00da",uacute:"\u00fa",Uarr:"\u219f", |
|
uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\u00db",ucirc:"\u00fb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\u00d9",ugrave:"\u00f9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\u00a8",UnderBar:"_",UnderBrace:"\u23df", |
|
UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5", |
|
upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\u00dc",uuml:"\u00fc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1", |
|
varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|", |
|
VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118", |
|
Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\ud835\udcb3", |
|
xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\u00dd",yacute:"\u00fd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\u00a5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\u00ff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417", |
|
zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\ud835\udd37",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\ud835\udd6b",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"});d.entityMap=d.HTML_ENTITIES})(Mf);var cd=ce,Nf=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,Si=new RegExp("[\\-\\.0-9"+ |
|
Nf.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Ti=new RegExp("^"+Nf.source+Si.source+"*(?::"+Nf.source+Si.source+"*)?$");wc.prototype=Error();wc.prototype.name=wc.name;Th.prototype={parse:function(d,f,k){var n=this.domBuilder;n.startDocument();Xh(f,f={});Em(d,f,k,n,this.errorHandler);n.endDocument()}};Uh.prototype={setTagName:function(d){if(!Ti.test(d))throw Error("invalid tagName:"+d);this.tagName=d},addValue:function(d,f,k){if(!Ti.test(d))throw Error("invalid attribute:"+d);this.attributeNames[d]= |
|
this.length;this[this.length++]={qName:d,value:f,offset:k}},length:0,getLocalName:function(d){return this[d].localName},getLocator:function(d){return this[d].locator},getQName:function(d){return this[d].qName},getURI:function(d){return this[d].uri},getValue:function(d){return this[d].value}};Yh.prototype.parseFromString=function(d,f){var k=this.options,n=new Th,u=k.domBuilder||new Qd,a=k.errorHandler,b=k.locator,c=k.xmlns||{},e=/\/x?html?$/.test(f);f=e?Mf.HTML_ENTITIES:Mf.XML_ENTITIES;b&&u.setDocumentLocator(b); |
|
n.errorHandler=Lm(a,u,b);n.domBuilder=k.domBuilder||u;e&&(c[""]=ce.HTML);c.xml=c.xml||ce.XML;k=k.normalizeLineEndings||Km;d&&"string"===typeof d?n.parse(k(d),c,f):n.errorHandler.error("invalid doc source");return u.doc};Qd.prototype={startDocument:function(){this.doc=(new Dh).createDocument(null,null,null);this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(d,f,k,n){var u=this.doc;f=u.createElementNS(d,k||f);var a=n.length;Rd(this,f);this.currentElement=f;this.locator&& |
|
xc(this.locator,f);for(var b=0;b<a;b++){d=n.getURI(b);var c=n.getValue(b);k=n.getQName(b);d=u.createAttributeNS(d,k);this.locator&&xc(n.getLocator(b),d);d.value=d.nodeValue=c;f.setAttributeNode(d)}},endElement:function(d,f,k){d=this.currentElement;d.tagName;this.currentElement=d.parentNode},startPrefixMapping:function(d,f){},endPrefixMapping:function(d){},processingInstruction:function(d,f){d=this.doc.createProcessingInstruction(d,f);this.locator&&xc(this.locator,d);Rd(this,d)},ignorableWhitespace:function(d, |
|
f,k){},characters:function(d,f,k){if(d=Zh.apply(this,arguments)){var n=this.cdata?this.doc.createCDATASection(d):this.doc.createTextNode(d);this.currentElement?this.currentElement.appendChild(n):/^\s*$/.test(d)&&this.doc.appendChild(n);this.locator&&xc(this.locator,n)}},skippedEntity:function(d){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(d){if(this.locator=d)d.lineNumber=0},comment:function(d,f,k){d=Zh.apply(this,arguments);var n=this.doc.createComment(d);this.locator&& |
|
xc(this.locator,n);Rd(this,n)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(d,f,k){var n=this.doc.implementation;n&&n.createDocumentType&&(d=n.createDocumentType(d,f,k),this.locator&&xc(this.locator,d),Rd(this,d),this.doc.doctype=d)},warning:function(d){console.warn("[xmldom warning]\t"+d,of(this.locator))},error:function(d){console.error("[xmldom error]\t"+d,of(this.locator))},fatalError:function(d){throw new wc(d,this.locator);}};"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, |
|
function(d){Qd.prototype[d]=function(){return null}});const Ui=d=>!!d&&"object"===typeof d,Ga=(...d)=>d.reduce((f,k)=>{if("object"!==typeof k)return f;Object.keys(k).forEach(n=>{Array.isArray(f[n])&&Array.isArray(k[n])?f[n]=f[n].concat(k[n]):Ui(f[n])&&Ui(k[n])?f[n]=Ga(f[n],k[n]):f[n]=k[n]});return f},{}),Vi=d=>Object.keys(d).map(f=>d[f]),Fc=d=>d.reduce((f,k)=>f.concat(k),[]),Wi=d=>{if(!d.length)return[];const f=[];for(let k=0;k<d.length;k++)f.push(d[k]);return f},wn=(d,f)=>d.reduce((k,n,u)=>{n[f]&& |
|
k.push(u);return k},[]),xn=(d,f)=>Vi(d.reduce((k,n)=>{n.forEach(u=>{k[f(u)]=u});return k},{})),jd=({baseUrl:d="",source:f="",range:k="",indexRange:n=""})=>{d={uri:f,resolvedUri:Ja(d||"",f)};if(k||n)n=(k?k:n).split("-"),k=D.BigInt?D.BigInt(n[0]):parseInt(n[0],10),n=D.BigInt?D.BigInt(n[1]):parseInt(n[1],10),k<Number.MAX_SAFE_INTEGER&&"bigint"===typeof k&&(k=Number(k)),n<Number.MAX_SAFE_INTEGER&&"bigint"===typeof n&&(n=Number(n)),n="bigint"===typeof n||"bigint"===typeof k?D.BigInt(n)-D.BigInt(k)+D.BigInt(1): |
|
n-k+1,"bigint"===typeof n&&n<Number.MAX_SAFE_INTEGER&&(n=Number(n)),d.byterange={length:n,offset:k};return d},Xi=d=>{d&&"number"!==typeof d&&(d=parseInt(d,10));return isNaN(d)?null:d},yn={static(d){const {duration:f,timescale:k=1,sourceDuration:n,periodDuration:u}=d;d=Xi(d.endNumber);const a=f/k;return"number"===typeof d?{start:0,end:d}:"number"===typeof u?{start:0,end:u/a}:{start:0,end:n/a}},dynamic(d){const {NOW:f,clientOffset:k,availabilityStartTime:n,timescale:u=1,duration:a,periodStart:b=0,minimumUpdatePeriod:c= |
|
0,timeShiftBufferDepth:e=Infinity}=d;d=Xi(d.endNumber);const g=(f+k)/1E3,l=n+b,p=Math.ceil((g+c-l)*u/a),t=Math.floor((g-l)*u/a);return{start:Math.max(0,Math.floor((g-l-e)*u/a)),end:"number"===typeof d?d:Math.min(p,t)}}},zn=d=>f=>{const {duration:k,timescale:n=1,periodStart:u,startNumber:a=1}=d;return{number:a+f,duration:k/n,timeline:u,time:f*k}},Of=d=>{const {type:f,duration:k,timescale:n=1,periodDuration:u,sourceDuration:a}=d,{start:b,end:c}=yn[f](d);var e=[];for(let g=b;g<c;g++)e.push(g);d=e.map(zn(d)); |
|
"static"===f&&(e=d.length-1,d[e].duration=("number"===typeof u?u:a)-k/n*e);return d},Yi=d=>{const {baseUrl:f,initialization:k={},sourceDuration:n,indexRange:u="",periodStart:a,presentationTime:b,number:c=0,duration:e}=d;if(!f)throw Error("NO_BASE_URL");const g=jd({baseUrl:f,source:k.sourceURL,range:k.range}),l=jd({baseUrl:f,source:f,indexRange:u});l.map=g;e?(d=Of(d),d.length&&(l.duration=d[0].duration,l.timeline=d[0].timeline)):n&&(l.duration=n,l.timeline=a);l.presentationTime=b||a;l.number=c;return[l]}, |
|
Pf=(d,f,k)=>{const n=d.sidx.map?d.sidx.map:null,u=d.sidx.duration,a=d.timeline||0;var b=d.sidx.byterange,c=b.offset+b.length;b=f.timescale;const e=f.references.filter(z=>1!==z.referenceType),g=[],l=d.endList?"static":"dynamic",p=d.sidx.timeline;let t=p,x=d.mediaSequence||0;c="bigint"===typeof f.firstOffset?D.BigInt(c)+f.firstOffset:c+f.firstOffset;for(let z=0;z<e.length;z++){var y=f.references[z];const E=y.referencedSize;y=y.subsegmentDuration;var A=void 0;A="bigint"===typeof c?c+D.BigInt(E)-D.BigInt(1): |
|
c+E-1;A=Yi({baseUrl:k,timescale:b,timeline:a,periodStart:p,presentationTime:t,number:x,duration:y,sourceDuration:u,indexRange:`${c}-${A}`,type:l})[0];n&&(A.map=n);g.push(A);c="bigint"===typeof c?c+D.BigInt(E):c+E;t+=y/b;x++}d.segments=g;return d},An=["AUDIO","SUBTITLES"],Bn=1/60,Zi=d=>xn(d,({timeline:f})=>f).sort((f,k)=>f.timeline>k.timeline?1:-1),Cn=(d,f)=>{for(let k=0;k<d.length;k++)if(d[k].attributes.NAME===f)return d[k];return null},$i=d=>{let f=[];sn(d,An,(k,n,u,a)=>{f=f.concat(k.playlists|| |
|
[])});return f},aj=({playlist:d,mediaSequence:f})=>{d.mediaSequence=f;d.segments.forEach((k,n)=>{k.number=d.mediaSequence+n})},Dn=({oldPlaylists:d,newPlaylists:f,timelineStarts:k})=>{f.forEach(n=>{n.discontinuitySequence=k.findIndex(function({timeline:c}){return c===n.timeline});const u=Cn(d,n.attributes.NAME);if(u&&!n.sidx){var a=n.segments[0],b=u.segments.findIndex(function(c){return Math.abs(c.presentationTime-a.presentationTime)<Bn});-1===b?(aj({playlist:n,mediaSequence:u.mediaSequence+u.segments.length}), |
|
n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!u.segments.length&&n.timeline>u.timeline||u.segments.length&&n.timeline>u.segments[u.segments.length-1].timeline)&&n.discontinuitySequence--):(u.segments[b].discontinuity&&!a.discontinuity&&(a.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),aj({playlist:n,mediaSequence:u.segments[b].number}))}})},En=({oldManifest:d,newManifest:f})=>{const k=d.playlists.concat($i(d)),n=f.playlists.concat($i(f));f.timelineStarts= |
|
Zi([d.timelineStarts,f.timelineStarts]);Dn({oldPlaylists:k,newPlaylists:n,timelineStarts:f.timelineStarts});return f},de=d=>{var f;if(f=d){f=d.uri+"-";d=d.byterange;let k;k="bigint"===typeof d.offset||"bigint"===typeof d.length?D.BigInt(d.offset)+D.BigInt(d.length)-D.BigInt(1):d.offset+d.length-1;f+=`${d.offset}-${k}`}return f},Qf=d=>{d=d.reduce(function(k,n){k[n.attributes.baseUrl]||(k[n.attributes.baseUrl]=[]);k[n.attributes.baseUrl].push(n);return k},{});let f=[];Object.values(d).forEach(k=>{k= |
|
Vi(k.reduce((n,u)=>{const a=u.attributes.id+(u.attributes.lang||"");n[a]?(u.segments&&(u.segments[0]&&(u.segments[0].discontinuity=!0),n[a].segments.push(...u.segments)),u.attributes.contentProtection&&(n[a].attributes.contentProtection=u.attributes.contentProtection)):(n[a]=u,n[a].attributes.timelineStarts=[]);n[a].attributes.timelineStarts.push({start:u.attributes.periodStart,timeline:u.attributes.periodStart});return n},{}));f=f.concat(k)});return f.map(k=>{k.discontinuityStarts=wn(k.segments|| |
|
[],"discontinuity");return k})},Rf=(d,f)=>{const k=de(d.sidx);(f=k&&f[k]&&f[k].sidx)&&Pf(d,f,d.sidx.resolvedUri);return d},Fn=(d,f={})=>{if(!Object.keys(f).length)return d;for(const k in d)d[k]=Rf(d[k],f);return d},Gn=({attributes:d,segments:f,sidx:k,mediaSequence:n,discontinuitySequence:u,discontinuityStarts:a},b)=>{f={attributes:{NAME:d.id,BANDWIDTH:d.bandwidth,CODECS:d.codecs,["PROGRAM-ID"]:1},uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration, |
|
discontinuitySequence:u,discontinuityStarts:a,timelineStarts:d.timelineStarts,mediaSequence:n,segments:f};d.contentProtection&&(f.contentProtection=d.contentProtection);d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation);k&&(f.sidx=k);b&&(f.attributes.AUDIO="audio",f.attributes.SUBTITLES="subs");return f},Hn=({attributes:d,segments:f,mediaSequence:k,discontinuityStarts:n,discontinuitySequence:u})=>{"undefined"===typeof f&&(f=[{uri:d.baseUrl,timeline:d.periodStart,resolvedUri:d.baseUrl|| |
|
"",duration:d.sourceDuration,number:0}],d.duration=d.sourceDuration);const a={NAME:d.id,BANDWIDTH:d.bandwidth,["PROGRAM-ID"]:1};d.codecs&&(a.CODECS=d.codecs);f={attributes:a,uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration,timelineStarts:d.timelineStarts,discontinuityStarts:n,discontinuitySequence:u,mediaSequence:k,segments:f};d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation);return f},In=(d,f={},k=!1)=>{let n;d=d.reduce((u, |
|
a)=>{const b=a.attributes.role&&a.attributes.role.value||"";var c=a.attributes.lang||"";let e=a.attributes.label||"main";c&&!a.attributes.label&&(e=`${a.attributes.lang}${b?` (${b})`:""}`);u[e]||(u[e]={language:c,autoselect:!0,default:"main"===b,playlists:[],uri:""});c=Rf(Gn(a,k),f);u[e].playlists.push(c);"undefined"===typeof n&&"main"===b&&(n=a,n.default=!0);return u},{});if(!n){const u=Object.keys(d)[0];d[u].default=!0}return d},Jn=(d,f={})=>d.reduce((k,n)=>{const u=n.attributes.label||n.attributes.lang|| |
|
"text";k[u]||(k[u]={language:u,default:!1,autoselect:!1,playlists:[],uri:""});k[u].playlists.push(Rf(Hn(n),f));return k},{}),Kn=d=>d.reduce((f,k)=>{if(!k)return f;k.forEach(n=>{const {channel:u,language:a}=n;f[a]={autoselect:!1,default:!1,instreamId:u,language:a};n.hasOwnProperty("aspectRatio")&&(f[a].aspectRatio=n.aspectRatio);n.hasOwnProperty("easyReader")&&(f[a].easyReader=n.easyReader);n.hasOwnProperty("3D")&&(f[a]["3D"]=n["3D"])});return f},{}),Ln=({attributes:d,segments:f,sidx:k,discontinuityStarts:n})=> |
|
{f={attributes:{NAME:d.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:d.width,height:d.height},CODECS:d.codecs,BANDWIDTH:d.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:"static"===d.type,timeline:d.periodStart,resolvedUri:d.baseUrl||"",targetDuration:d.duration,discontinuityStarts:n,timelineStarts:d.timelineStarts,segments:f};d.frameRate&&(f.attributes["FRAME-RATE"]=d.frameRate);d.contentProtection&&(f.contentProtection=d.contentProtection);d.serviceLocation&&(f.attributes.serviceLocation=d.serviceLocation); |
|
k&&(f.sidx=k);return f},Mn=({attributes:d})=>"video/mp4"===d.mimeType||"video/webm"===d.mimeType||"video"===d.contentType,Nn=({attributes:d})=>"audio/mp4"===d.mimeType||"audio/webm"===d.mimeType||"audio"===d.contentType,On=({attributes:d})=>"text/vtt"===d.mimeType||"text"===d.contentType,Pn=(d,f)=>{d.forEach(k=>{k.mediaSequence=0;k.discontinuitySequence=f.findIndex(function({timeline:n}){return n===k.timeline});k.segments&&k.segments.forEach((n,u)=>{n.number=u})})},bj=d=>d?Object.keys(d).reduce((f, |
|
k)=>f.concat(d[k].playlists),[]):[],Qn=({dashPlaylists:d,locations:f,contentSteering:k,sidxMapping:n={},previousManifest:u,eventStream:a})=>{if(!d.length)return{};const {sourceDuration:b,type:c,suggestedPresentationDelay:e,minimumUpdatePeriod:g}=d[0].attributes;var l=Qf(d.filter(Mn)).map(Ln),p=Qf(d.filter(Nn)),t=Qf(d.filter(On));d=d.map(y=>y.attributes.captionServices).filter(Boolean);const x={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{}, |
|
SUBTITLES:{}},uri:"",duration:b,playlists:Fn(l,n)};0<=g&&(x.minimumUpdatePeriod=1E3*g);f&&(x.locations=f);k&&(x.contentSteering=k);"dynamic"===c&&(x.suggestedPresentationDelay=e);a&&0<a.length&&(x.eventStream=a);f=0===x.playlists.length;p=p.length?In(p,n,f):null;n=t.length?Jn(t,n):null;l=l.concat(bj(p),bj(n));t=l.map(({timelineStarts:y})=>y);x.timelineStarts=Zi(t);Pn(l,x.timelineStarts);p&&(x.mediaGroups.AUDIO.audio=p);n&&(x.mediaGroups.SUBTITLES.subs=n);d.length&&(x.mediaGroups["CLOSED-CAPTIONS"].cc= |
|
Kn(d));return u?En({oldManifest:u,newManifest:x}):x},cj=(d,f)=>{const {type:k,minimumUpdatePeriod:n=0,media:u="",sourceDuration:a,timescale:b=1,startNumber:c=1,periodStart:e}=d,g=[];let l=-1;for(let x=0;x<f.length;x++){var p=f[x];const y=p.d;var t=p.r||0;p=p.t||0;0>l&&(l=p);p&&p>l&&(l=p);if(0>t)if(t=x+1,t===f.length)if("dynamic"===k&&0<n&&0<u.indexOf("$Number$")){const {NOW:A,clientOffset:z,availabilityStartTime:E,timescale:I=1,periodStart:G=0,minimumUpdatePeriod:O=0}=d;t=Math.ceil((((A+z)/1E3+O- |
|
(E+G))*I-l)/y)}else t=(a*b-l)/y;else t=(f[t].t-l)/y;else t+=1;t=c+g.length+t;for(p=c+g.length;p<t;)g.push({number:p,duration:y/b,time:l,timeline:e}),l+=y,p++}return g},dj=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,ej=d=>(f,k,n,u)=>{if("$$"===f)return"$";if("undefined"===typeof d[k])return f;f=""+d[k];if("RepresentationID"===k)return f;u=n?parseInt(u,10):1;return f.length>=u?f:`${Array(u-f.length+1).join("0")}${f}`},Rn=(d,f)=>d.duration||f?d.duration?Of(d):cj(d,f):[{number:d.startNumber||1,duration:d.sourceDuration, |
|
time:0,timeline:d.periodStart}],Sn=(d,f)=>{const k={RepresentationID:d.id,Bandwidth:d.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=d,u=jd({baseUrl:d.baseUrl,source:n.sourceURL.replace(dj,ej(k)),range:n.range});return Rn(d,f).map(a=>{k.Number=a.number;k.Time=a.time;const b=(d.media||"").replace(dj,ej(k)),c=d.periodStart+(a.time-(d.presentationTimeOffset||0))/(d.timescale||1);return{uri:b,timeline:a.timeline,duration:a.duration,resolvedUri:Ja(d.baseUrl||"",b),map:u,number:a.number,presentationTime:c}})}, |
|
Tn=(d,f)=>{const {duration:k,segmentUrls:n=[],periodStart:u}=d;if(!k&&!f||k&&f)throw Error("SEGMENT_TIME_UNSPECIFIED");const a=n.map(c=>{const {baseUrl:e,initialization:g={}}=d,l=jd({baseUrl:e,source:g.sourceURL,range:g.range});c=jd({baseUrl:e,source:c.media,range:c.mediaRange});c.map=l;return c});let b;k&&(b=Of(d));f&&(b=cj(d,f));return b.map((c,e)=>{if(a[e]){e=a[e];const g=d.timescale||1,l=d.presentationTimeOffset||0;e.timeline=c.timeline;e.duration=c.duration;e.number=c.number;e.presentationTime= |
|
u+(c.time-l)/g;return e}}).filter(c=>c)},Un=({attributes:d,segmentInfo:f})=>{let k;if(f.template){var n=Sn;k=Ga(d,f.template)}else f.base?(n=Yi,k=Ga(d,f.base)):f.list&&(n=Tn,k=Ga(d,f.list));d={attributes:d};if(!n)return d;n=n(k,f.segmentTimeline);if(k.duration){const {duration:u,timescale:a=1}=k;k.duration=u/a}else k.duration=n.length?n.reduce((u,a)=>Math.max(u,Math.ceil(a.duration)),0):0;d.attributes=k;d.segments=n;f.base&&k.indexRange&&(d.sidx=n[0],d.segments=[]);return d},qa=(d,f)=>Wi(d.childNodes).filter(({tagName:k})=> |
|
k===f),Vn=d=>d.textContent.trim(),Wn=d=>parseFloat(d.split("/").reduce((f,k)=>f/k)),Gc=d=>{d=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(d);if(!d)return 0;const [f,k,n,u,a,b]=d.slice(1);return 31536E3*parseFloat(f||0)+2592E3*parseFloat(k||0)+86400*parseFloat(n||0)+3600*parseFloat(u||0)+60*parseFloat(a||0)+parseFloat(b||0)},fj={mediaPresentationDuration(d){return Gc(d)},availabilityStartTime(d){/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(d)&&(d+="Z");return Date.parse(d)/ |
|
1E3},minimumUpdatePeriod(d){return Gc(d)},suggestedPresentationDelay(d){return Gc(d)},type(d){return d},timeShiftBufferDepth(d){return Gc(d)},start(d){return Gc(d)},width(d){return parseInt(d,10)},height(d){return parseInt(d,10)},bandwidth(d){return parseInt(d,10)},frameRate(d){return Wn(d)},startNumber(d){return parseInt(d,10)},timescale(d){return parseInt(d,10)},presentationTimeOffset(d){return parseInt(d,10)},duration(d){const f=parseInt(d,10);return isNaN(f)?Gc(d):f},d(d){return parseInt(d,10)}, |
|
t(d){return parseInt(d,10)},r(d){return parseInt(d,10)},presentationTime(d){return parseInt(d,10)},DEFAULT(d){return d}},Ca=d=>d&&d.attributes?Wi(d.attributes).reduce((f,k)=>{f[k.name]=(fj[k.name]||fj.DEFAULT)(k.value);return f},{}):{},Xn={"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", |
|
"urn:mpeg:dash:mp4protection:2011":"mp4protection"},ee=(d,f)=>f.length?Fc(d.map(function(k){return f.map(function(n){const u=n.textContent.trim(),a=Ja(k.baseUrl,u);n=Ga(Ca(n),{baseUrl:a});a!==u&&!n.serviceLocation&&k.serviceLocation&&(n.serviceLocation=k.serviceLocation);return n})})):d,Sf=d=>{var f=qa(d,"SegmentTemplate")[0];const k=qa(d,"SegmentList")[0],n=k&&qa(k,"SegmentURL").map(c=>Ga({tag:"SegmentURL"},Ca(c)));d=qa(d,"SegmentBase")[0];var u=k||f;u=u&&qa(u,"SegmentTimeline")[0];var a=k||d||f; |
|
a=a&&qa(a,"Initialization")[0];(f=f&&Ca(f))&&a?f.initialization=a&&Ca(a):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const b={template:f,segmentTimeline:u&&qa(u,"S").map(c=>Ca(c)),list:k&&Ga(Ca(k),{segmentUrls:n,initialization:Ca(a)}),base:d&&Ga(Ca(d),{initialization:Ca(a)})};Object.keys(b).forEach(c=>{b[c]||delete b[c]});return b},Yn=(d,f,k)=>n=>{var u=qa(n,"BaseURL");u=ee(f,u);const a=Ga(d,Ca(n)),b=Sf(n);return u.map(c=>({segmentInfo:Ga(k,b),attributes:Ga(a,c)}))},Zn=d=> |
|
d.reduce((f,k)=>{var n=Ca(k);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());var u=Xn[n.schemeIdUri];if(u&&(f[u]={attributes:n},k=qa(k,"cenc:pssh")[0])){k=k.textContent.trim();u=f[u];if(n=k){k=D.atob?D.atob(k):Buffer.from(k,"base64").toString("binary");n=new Uint8Array(k.length);for(var a=0;a<k.length;a++)n[a]=k.charCodeAt(a)}u.pssh=n}return f},{}),$n=d=>{if("urn:scte:dash:cc:cea-608:2015"===d.schemeIdUri)return("string"!==typeof d.value?[]:d.value.split(";")).map(f=>{let k,n;n=f;/^CC\d=/.test(f)? |
|
[k,n]=f.split("\x3d"):/^CC\d$/.test(f)&&(k=f);return{channel:k,language:n}});if("urn:scte:dash:cc:cea-708:2015"===d.schemeIdUri)return("string"!==typeof d.value?[]:d.value.split(";")).map(f=>{const k={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(f)){const [n,u=""]=f.split("\x3d");k.channel=n;k.language=f;u.split(",").forEach(a=>{const [b,c]=a.split(":");"lang"===b?k.language=c:"er"===b?k.easyReader=Number(c):"war"===b?k.aspectRatio=Number(c):"3D"===b&&(k["3D"]=Number(c))})}else k.language= |
|
f;k.channel&&(k.channel="SERVICE"+k.channel);return k})},ao=d=>Fc(qa(d.node,"EventStream").map(f=>{const k=Ca(f),n=k.schemeIdUri;return qa(f,"Event").map(u=>{const a=Ca(u),b=k.timescale||1,c=(a.presentationTime||0)/b+d.attributes.start;return{schemeIdUri:n,value:k.value,id:a.id,start:c,end:c+(a.duration||0)/b,messageData:u.textContent.trim()||a.messageData,contentEncoding:k.contentEncoding,presentationTimeOffset:k.presentationTimeOffset||0}})})),bo=(d,f,k)=>n=>{var u=Ca(n);const a=ee(f,qa(n,"BaseURL")); |
|
var b=qa(n,"Role")[0];b={role:Ca(b)};u=Ga(d,u,b);b=qa(n,"Accessibility")[0];(b=$n(Ca(b)))&&(u=Ga(u,{captionServices:b}));(b=qa(n,"Label")[0])&&b.childNodes.length&&(b=b.childNodes[0].nodeValue.trim(),u=Ga(u,{label:b}));b=Zn(qa(n,"ContentProtection"));Object.keys(b).length&&(u=Ga(u,{contentProtection:b}));b=Sf(n);n=qa(n,"Representation");b=Ga(k,b);return Fc(n.map(Yn(u,a,b)))},co=(d,f)=>(k,n)=>{n=ee(f,qa(k.node,"BaseURL"));const u=Ga(d,{periodStart:k.attributes.start});"number"===typeof k.attributes.duration&& |
|
(u.periodDuration=k.attributes.duration);const a=qa(k.node,"AdaptationSet");k=Sf(k.node);return Fc(a.map(bo(u,n,k)))},eo=(d,f)=>{1<d.length&&f({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"});if(!d.length)return null;d=Ga({serverURL:d[0].textContent.trim()},Ca(d[0]));d.queryBeforeStart="true"===d.queryBeforeStart;return d},fo=({attributes:d,priorPeriodAttributes:f,mpdType:k})=>"number"===typeof d.start?d.start:f&&"number"===typeof f.start&&"number"===typeof f.duration? |
|
f.start+f.duration:f||"static"!==k?null:0,go=(d,f={})=>{const {manifestUri:k="",NOW:n=Date.now(),clientOffset:u=0,eventHandler:a=function(){}}=f;f=qa(d,"Period");if(!f.length)throw Error("INVALID_NUMBER_OF_PERIOD");const b=qa(d,"Location"),c=Ca(d),e=ee([{baseUrl:k}],qa(d,"BaseURL"));d=qa(d,"ContentSteering");c.type=c.type||"static";c.sourceDuration=c.mediaPresentationDuration||0;c.NOW=n;c.clientOffset=u;b.length&&(c.locations=b.map(Vn));const g=[];f.forEach((l,p)=>{const t=Ca(l);p=g[p-1];t.start= |
|
fo({attributes:t,priorPeriodAttributes:p?p.attributes:null,mpdType:c.type});g.push({node:l,attributes:t})});return{locations:c.locations,contentSteeringInfo:eo(d,a),representationInfo:Fc(g.map(co(c,e))),eventStream:Fc(g.map(ao))}},gj=d=>{if(""===d)throw Error("DASH_EMPTY_MANIFEST");const f=new Yh;let k,n;try{n=(k=f.parseFromString(d,"application/xml"))&&"MPD"===k.documentElement.tagName?k.documentElement:null}catch(u){}if(!n||n&&0<n.getElementsByTagName("parsererror").length)throw Error("DASH_INVALID_XML"); |
|
return n},ho=d=>{d=qa(d,"UTCTiming")[0];if(!d)return null;d=Ca(d);switch(d.schemeIdUri){case "urn:mpeg:dash:utc:http-head:2014":case "urn:mpeg:dash:utc:http-head:2012":d.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":d.method="GET";break;case "urn:mpeg:dash:utc:direct:2014":case "urn:mpeg:dash:utc:direct:2012":d.method="DIRECT";d.value=Date.parse(d.value);break;default:throw Error("UNSUPPORTED_UTC_TIMING_SCHEME"); |
|
}return d},io=(d,f={})=>{d=go(gj(d),f);const k=d.representationInfo.map(Un);return Qn({dashPlaylists:k,locations:d.locations,contentSteering:d.contentSteeringInfo,sidxMapping:f.sidxMapping,previousManifest:f.previousManifest,eventStream:d.eventStream})};var jo=Math.pow(2,32),hj=function(d){d=new DataView(d.buffer,d.byteOffset,d.byteLength);return d.getBigUint64?(d=d.getBigUint64(0),d<Number.MAX_SAFE_INTEGER?Number(d):d):d.getUint32(0)*jo+d.getUint32(4)};const ko=jb.getDefaultExportFromCjs(function(d){var f= |
|
new DataView(d.buffer,d.byteOffset,d.byteLength),k={version:d[0],flags:new Uint8Array(d.subarray(1,4)),references:[],referenceId:f.getUint32(4),timescale:f.getUint32(8)},n=12;0===k.version?(k.earliestPresentationTime=f.getUint32(n),k.firstOffset=f.getUint32(n+4),n+=8):(k.earliestPresentationTime=hj(d.subarray(n)),k.firstOffset=hj(d.subarray(n+8)),n+=16);n+=2;var u=f.getUint16(n);for(n+=2;0<u;n+=12,u--)k.references.push({referenceType:(d[n]&128)>>>7,referencedSize:f.getUint32(n)&2147483647,subsegmentDuration:f.getUint32(n+ |
|
4),startsWithSap:!!(d[n+8]&128),sapType:(d[n+8]&112)>>>4,sapDeltaTime:f.getUint32(n+8)&268435455});return k});var lo=U([73,68,51]),kd=function n(f,k){void 0===k&&(k=0);f=U(f);if(10>f.length-k||!pa(f,lo,{offset:k}))return k;var u=k;var a=k;void 0===a&&(a=0);k=U(f);var b=k[a+6]<<21|k[a+7]<<14|k[a+8]<<7|k[a+9];k=(k[a+5]&16)>>4?b+20:b+10;k=u+k;return n(f,k)},ij=function(f){return"string"===typeof f?Pi(f):f},mo=function(f){return Array.isArray(f)?f.map(function(k){return ij(k)}):[ij(f)]},no=function a(k, |
|
n,u){void 0===u&&(u=!1);n=mo(n);k=U(k);var b=[];if(!n.length)return b;for(var c=0;c<k.length;){var e=(k[c]<<24|k[c+1]<<16|k[c+2]<<8|k[c+3])>>>0,g=k.subarray(c+4,c+8);if(0===e)break;e=c+e;if(e>k.length){if(u)break;e=k.length}c=k.subarray(c+8,e);pa(g,n[0])&&(1===n.length?b.push(c):b.push.apply(b,a(c,n.slice(1),u)));c=e}return b},jj=U([26,69,223,163]),kj=U([66,130]);U([24,83,128,103]);U([21,73,169,102]);U([22,84,174,107]);U([174]);U([215]);U([35,227,131]);U([174]);U([131]);U([136]);U([134]);U([99,162]); |
|
U([224]);U([225]);U([31,67,182,117]);U([231]);U([42,215,177]);U([160]);U([155]);U([161]);U([163]);var Tf=[128,64,32,16,8,4,2,1],fe=function(k,n,u,a){void 0===u&&(u=!0);void 0===a&&(a=!1);var b=1;for(var c=0;c<Tf.length&&!(k[n]&Tf[c]);c++)b++;c=k.subarray(n,n+b);u&&(c=Array.prototype.slice.call(k,n,n+b),c[0]^=Tf[b-1]);return{length:b,value:pn(c,{signed:a}),bytes:c}},lj=function u(n){return"string"===typeof n?n.match(/.{1,2}/g).map(function(a){return u(a)}):"number"===typeof n?qn(n):n},oo=function(n){return Array.isArray(n)? |
|
n.map(function(u){return lj(u)}):[lj(n)]},po=function c(u,a,b){if(b>=a.length)return a.length;var e=fe(a,b,!1);if(pa(u.bytes,e.bytes))return b;var g=fe(a,b+e.length);return c(u,a,b+g.length+g.value+e.length)},mj=function c(a,b){b=oo(b);a=U(a);var e=[];if(!b.length)return e;for(var g=0;g<a.length;){var l=fe(a,g,!1),p=fe(a,g+l.length),t=g+l.length+p.length;127===p.value&&(p.value=po(l,a,t),p.value!==a.length&&(p.value-=t));t=a.subarray(t,t+p.value>a.length?a.length:t+p.value);pa(b[0],l.bytes)&&(1=== |
|
b.length?e.push(t):e=e.concat(c(t,b.slice(1))));g+=l.length+p.length+t.length}return e},qo=U([0,0,0,1]),ro=U([0,0,1]),so=U([0,0,3]),nj=function(a,b,c,e){a=U(a);c=[].concat(c);for(var g=0,l,p=0;g<a.length&&(p<e||l);){var t=void 0;pa(a.subarray(g),qo)?t=4:pa(a.subarray(g),ro)&&(t=3);if(t){p++;if(l){a=a.subarray(l,g);b=[];for(c=1;c<a.length-2;)pa(a.subarray(c,c+3),so)&&(b.push(c+2),c++),c++;if(0!==b.length){e=a.length-b.length;g=new Uint8Array(e);for(c=l=0;c<e;l++,c++)l===b[0]&&(l++,b.shift()),g[c]= |
|
a[l];a=g}return a}var x=void 0;"h264"===b?x=a[g+t]&31:"h265"===b&&(x=a[g+t]>>1&63);-1!==c.indexOf(x)&&(l=g+t);g+=t+("h264"===b?1:2)}else g++}return a.subarray(0,0)},Ta={webm:U([119,101,98,109]),matroska:U([109,97,116,114,111,115,107,97]),flac:U([102,76,97,67]),ogg:U([79,103,103,83]),ac3:U([11,119]),riff:U([82,73,70,70]),avi:U([65,86,73]),wav:U([87,65,86,69]),"3gp":U([102,116,121,112,51,103]),mp4:U([102,116,121,112]),fmp4:U([115,116,121,112]),mov:U([102,116,121,112,113,116]),moov:U([109,111,111,118]), |
|
moof:U([109,111,111,102])},Hc={aac:function(a){var b=kd(a);return pa(a,[255,16],{offset:b,mask:[255,22]})},mp3:function(a){var b=kd(a);return pa(a,[255,2],{offset:b,mask:[255,6]})},webm:function(a){a=mj(a,[jj,kj])[0];return pa(a,Ta.webm)},mkv:function(a){a=mj(a,[jj,kj])[0];return pa(a,Ta.matroska)},mp4:function(a){if(Hc["3gp"](a)||Hc.mov(a))return!1;if(pa(a,Ta.mp4,{offset:4})||pa(a,Ta.fmp4,{offset:4})||pa(a,Ta.moof,{offset:4})||pa(a,Ta.moov,{offset:4}))return!0},mov:function(a){return pa(a,Ta.mov, |
|
{offset:4})},"3gp":function(a){return pa(a,Ta["3gp"],{offset:4})},ac3:function(a){var b=kd(a);return pa(a,Ta.ac3,{offset:b})},ts:function(a){if(189>a.length&&1<=a.length)return 71===a[0];for(var b=0;b+188<a.length&&188>b;){if(71===a[b]&&71===a[b+188])return!0;b+=1}return!1},flac:function(a){var b=kd(a);return pa(a,Ta.flac,{offset:b})},ogg:function(a){return pa(a,Ta.ogg)},avi:function(a){return pa(a,Ta.riff)&&pa(a,Ta.avi,{offset:8})},wav:function(a){return pa(a,Ta.riff)&&pa(a,Ta.wav,{offset:8})},h264:function(a){return nj(a, |
|
"h264",7,3).length},h265:function(a){return nj(a,"h265",[32,33],3).length}},Uf=Object.keys(Hc).filter(function(a){return"ts"!==a&&"h264"!==a&&"h265"!==a}).concat(["ts","h264","h265"]);Uf.forEach(function(a){var b=Hc[a];Hc[a]=function(c){return b(U(c))}});var to=Hc,Vf=function(a){a=U(a);for(var b=0;b<Uf.length;b++){var c=Uf[b];if(to[c](a))return c}return""};const Mb={},Xb=function(a,b){Mb[a]=Mb[a]||[];b&&(Mb[a]=Mb[a].concat(b));return Mb[a]},oj=function(a,b){b=Xb(a).indexOf(b);if(-1>=b)return!1;Mb[a]= |
|
Mb[a].slice();Mb[a].splice(b,1);return!0},Ud={prefixed:!0},ge=["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror fullscreen".split(" "),"webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror -webkit-full-screen".split(" ")],pj=ge[0];let ld;for(let a=0;a<ge.length;a++)if(ge[a][1]in P){ld=ge[a];break}if(ld){for(let a=0;a<ld.length;a++)Ud[pj[a]]=ld[a];Ud.prefixed=ld[0]!== |
|
pj[0]}let Wa=[];const Mm=(a,b,c)=>(e,g,l)=>{g=b.levels[g];const p=new RegExp(`^(${g})$`);var t=a;"log"!==e&&l.unshift(e.toUpperCase()+":");c&&(t=`%c${a}`,l.unshift(c));l.unshift(t+":");Wa&&(Wa.push([].concat(l)),t=Wa.length-1E3,Wa.splice(0,0<t?t:0));if(D.console&&((t=D.console[e])||"debug"!==e||(t=D.console.info||D.console.log),t&&g&&p.test(e)))t[Array.isArray(l)?"apply":"call"](D.console,l)},da=pf("VIDEOJS"),qj=da.createLogger,Nm=Object.prototype.toString,$h=function(a){return xb(a)?Object.keys(a): |
|
[]};var uo=Object.freeze({__proto__:null,each:yc,reduce:ai,isObject:xb,isPlain:zc,merge:ma,values:bi,defineLazyProperty:Sd});let Wf=!1,rj=null,Ab=!1,sj,tj=!1,Ic=!1,Jc=!1,Bb=!1,Xf=null,he=null,uj=null,ie=!1,je=!1,ke=!1,le=!1,Yf=!1,Zf=!1,$f=!1;const md=!(!Ac()||!("ontouchstart"in D||D.navigator.maxTouchPoints||D.DocumentTouch&&D.document instanceof D.DocumentTouch)),Zb=D.navigator&&D.navigator.userAgentData;Zb&&Zb.platform&&Zb.brands&&(Ab="Android"===Zb.platform,Ic=!!Zb.brands.find(a=>"Microsoft Edge"=== |
|
a.brand),Jc=!!Zb.brands.find(a=>"Chromium"===a.brand),Bb=!Ic&&Jc,Xf=he=(Zb.brands.find(a=>"Chromium"===a.brand)||{}).version||null,je="Windows"===Zb.platform);if(!Jc){const a=D.navigator&&D.navigator.userAgent||"";Wf=/iPod/i.test(a);rj=function(){const b=a.match(/OS (\d+)_/i);return b&&b[1]?b[1]:null}();Ab=/Android/i.test(a);sj=function(){const b=a.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!b)return null;const c=b[1]&&parseFloat(b[1]),e=b[2]&&parseFloat(b[2]);return c&&e?parseFloat(b[1]+ |
|
"."+b[2]):c?c:null}();tj=/Firefox/i.test(a);Ic=/Edg/i.test(a);Jc=/Chrome/i.test(a)||/CriOS/i.test(a);Bb=!Ic&&Jc;Xf=he=function(){const b=a.match(/(Chrome|CriOS)\/(\d+)/);return b&&b[2]?parseFloat(b[2]):null}();uj=function(){var b=/MSIE\s(\d+)\.\d/.exec(a);b=b&&parseFloat(b[1]);!b&&/Trident\/7.0/i.test(a)&&/rv:11.0/.test(a)&&(b=11);return b}();Yf=/Tizen/i.test(a);Zf=/Web0S/i.test(a);$f=Yf||Zf;ie=/Safari/i.test(a)&&!Bb&&!Ab&&!Ic&&!$f;je=/Windows/i.test(a);ke=/iPad/i.test(a)||ie&&md&&!/iPhone/i.test(a); |
|
le=/iPhone/i.test(a)&&!ke}const Qa=le||ke||Wf,me=(ie||Qa)&&!Bb;var vj=Object.freeze({__proto__:null,get IS_IPOD(){return Wf},get IOS_VERSION(){return rj},get IS_ANDROID(){return Ab},get ANDROID_VERSION(){return sj},get IS_FIREFOX(){return tj},get IS_EDGE(){return Ic},get IS_CHROMIUM(){return Jc},get IS_CHROME(){return Bb},get CHROMIUM_VERSION(){return Xf},get CHROME_VERSION(){return he},get IE_VERSION(){return uj},get IS_SAFARI(){return ie},get IS_WINDOWS(){return je},get IS_IPAD(){return ke},get IS_IPHONE(){return le}, |
|
get IS_TIZEN(){return Yf},get IS_WEBOS(){return Zf},get IS_SMART_TV(){return $f},TOUCH_ENABLED:md,IS_IOS:Qa,IS_ANY_SAFARI:me});const Wb=di("querySelector"),wj=di("querySelectorAll");var xj=Object.freeze({__proto__:null,isReal:Ac,isEl:Bc,isInFrame:ci,createEl:aa,textContent:Ub,prependTo:rf,hasClass:dd,addClass:cc,removeClass:Td,toggleClass:ei,setAttributes:fi,getAttributes:Vb,getAttribute:function(a,b){return a.getAttribute(b)},setAttribute:function(a,b,c){a.setAttribute(b,c)},removeAttribute:function(a, |
|
b){a.removeAttribute(b)},blockTextSelection:gi,unblockTextSelection:hi,getBoundingClientRect:Cc,findPosition:ed,getPointerPosition:Vd,isTextNode:ii,emptyEl:Wd,normalizeContent:ji,appendContent:qf,insertContent:ki,isSingleLeftClick:fd,$:Wb,$$:wj,computedStyle:Dc,copyStyleSheetsToWindow:li});let mi=!1,tf;const Om=function(){if(!1!==tf.options.autoSetup){var a=Array.prototype.slice.call(P.getElementsByTagName("video")),b=Array.prototype.slice.call(P.getElementsByTagName("audio")),c=Array.prototype.slice.call(P.getElementsByTagName("video-js")); |
|
if((a=a.concat(b,c))&&0<a.length)for(let e=0,g=a.length;e<g;e++)if((b=a[e])&&b.getAttribute)void 0===b.player&&null!==b.getAttribute("data-setup")&&tf(b);else{sf(1);break}else mi||sf(1)}};Ac()&&("complete"===P.readyState?uf():D.addEventListener("load",uf));const yj=function(a){const b=P.createElement("style");b.className=a;return b},zj=function(a,b){a.styleSheet?a.styleSheet.cssText=b:a.textContent=b};var Ra=new WeakMap;let pb=3,ne;const Pm=function(){if("boolean"!==typeof ne){ne=!1;try{const a=Object.defineProperty({}, |
|
"passive",{get(){ne=!0}});D.addEventListener("test",null,a);D.removeEventListener("test",null,a)}catch(a){}}return ne},Qm=["touchstart","touchmove"];var vo=Object.freeze({__proto__:null,fixEvent:Xd,on:ab,off:Ma,trigger:Ec,one:Yd,any:wf});const na=function(a,b,c){b.guid||(b.guid=pb++);a=b.bind(a);a.guid=c?c+"_"+b.guid:b.guid;return a},Cb=function(a,b){let c=D.performance.now();return function(...e){const g=D.performance.now();g-c>=b&&(a(...e),c=g)}},Aj=function(a,b,c,e=D){let g;const l=function(){const p= |
|
this,t=arguments;let x=function(){x=g=null;c||a.apply(p,t)};!g&&c&&a.apply(p,t);e.clearTimeout(g);g=e.setTimeout(x,b)};l.cancel=()=>{e.clearTimeout(g);g=null};return l};var wo=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:30,bind_:na,throttle:Cb,debounce:Aj});let oe;class kb{on(a,b){const c=this.addEventListener;this.addEventListener=()=>{};ab(this,a,b);this.addEventListener=c}off(a,b){Ma(this,a,b)}one(a,b){const c=this.addEventListener;this.addEventListener=()=>{};Yd(this,a,b);this.addEventListener= |
|
c}any(a,b){const c=this.addEventListener;this.addEventListener=()=>{};wf(this,a,b);this.addEventListener=c}trigger(a){const b=a.type||a;"string"===typeof a&&(a={type:b});a=Xd(a);if(this.allowedEvents_[b]&&this["on"+b])this["on"+b](a);Ec(this,a)}queueTrigger(a){oe||=new Map;const b=a.type||a;let c=oe.get(this);c||(c=new Map,oe.set(this,c));var e=c.get(b);c.delete(b);D.clearTimeout(e);e=D.setTimeout(()=>{c.delete(b);0===c.size&&(c=null,oe.delete(this));this.trigger(a)},0);c.set(b,e)}}kb.prototype.allowedEvents_= |
|
{};kb.prototype.addEventListener=kb.prototype.on;kb.prototype.removeEventListener=kb.prototype.off;kb.prototype.dispatchEvent=kb.prototype.trigger;const pe=a=>"function"===typeof a.name?a.name():"string"===typeof a.name?a.name:a.name_?a.name_:a.constructor&&a.constructor.name?a.constructor.name:typeof a,Kb=a=>a instanceof kb||!!a.eventBusEl_&&["on","one","off","trigger"].every(b=>"function"===typeof a[b]),xo=(a,b)=>{Kb(a)?b():(a.eventedCallbacks||(a.eventedCallbacks=[]),a.eventedCallbacks.push(b))}, |
|
ag=a=>"string"===typeof a&&/\S/.test(a)||Array.isArray(a)&&!!a.length,qe=(a,b,c)=>{if(!a||!a.nodeName&&!Kb(a))throw Error(`Invalid target for ${pe(b)}#${c}; must be a DOM node or evented object.`);},Bj=(a,b,c)=>{if(!ag(a))throw Error(`Invalid event type for ${pe(b)}#${c}; must be a non-empty string or array.`);},Cj=(a,b,c)=>{if("function"!==typeof a)throw Error(`Invalid listener for ${pe(b)}#${c}; must be a function.`);},bg=(a,b,c)=>{const e=3>b.length||b[0]===a||b[0]===a.eventBusEl_;let g,l;e?(g= |
|
a.eventBusEl_,3<=b.length&&b.shift(),[b,l]=b):[g,b,l]=b;qe(g,a,c);Bj(b,a,c);Cj(l,a,c);l=na(a,l);return{isTargetingSelf:e,target:g,type:b,listener:l}},jc=(a,b,c,e)=>{qe(a,a,b);if(a.nodeName)vo[b](a,c,e);else a[b](c,e)},Rm={on(...a){const {isTargetingSelf:b,target:c,type:e,listener:g}=bg(this,a,"on");jc(c,"on",e,g);if(!b){const l=()=>this.off(c,e,g);l.guid=g.guid;a=()=>this.off("dispose",l);a.guid=g.guid;jc(this,"on","dispose",l);jc(c,"on","dispose",a)}},one(...a){const {isTargetingSelf:b,target:c, |
|
type:e,listener:g}=bg(this,a,"one");if(b)jc(c,"one",e,g);else{const l=(...p)=>{this.off(c,e,l);g.apply(null,p)};l.guid=g.guid;jc(c,"one",e,l)}},any(...a){const {isTargetingSelf:b,target:c,type:e,listener:g}=bg(this,a,"any");if(b)jc(c,"any",e,g);else{const l=(...p)=>{this.off(c,e,l);g.apply(null,p)};l.guid=g.guid;jc(c,"any",e,l)}},off(a,b,c){!a||ag(a)?Ma(this.eventBusEl_,a,b):(qe(a,this,"off"),Bj(b,this,"off"),Cj(c,this,"off"),c=na(this,c),this.off("dispose",c),a.nodeName?(Ma(a,b,c),Ma(a,"dispose", |
|
c)):Kb(a)&&(a.off(b,c),a.off("dispose",c)))},trigger(a,b){qe(this.eventBusEl_,this,"trigger");if(!ag(a&&"string"!==typeof a?a.type:a))throw Error(`Invalid event type for ${pe(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.");return Ec(this.eventBusEl_,a,b)}},Sm={state:{},setState(a){"function"===typeof a&&(a=a());let b;yc(a,(c,e)=>{this.state[e]!==c&&(b=b||{},b[e]={from:this.state[e],to:c});this.state[e]=c});b&&Kb(this)&&this.trigger({changes:b, |
|
type:"statechanged"});return b}},nd=function(a){return"string"!==typeof a?a:a.replace(/./,b=>b.toLowerCase())},wa=function(a){return"string"!==typeof a?a:a.replace(/./,b=>b.toUpperCase())},Dj=function(a,b){return wa(a)===wa(b)};var yo=Object.freeze({__proto__:null,toLowerCase:nd,toTitleCase:wa,titleCaseEquals:Dj});class M{constructor(a,b,c){this.player_=!a&&this.play?a=this:a;this.isDisposed_=!1;this.parentComponent_=null;this.options_=ma({},this.options_);b=this.options_=ma(this.options_,b);this.id_= |
|
b.id||b.el&&b.el.id;this.id_||(this.id_=`${a&&a.id&&a.id()||"no_player"}_component_${pb++}`);this.name_=b.name||null;b.el?this.el_=b.el:!1!==b.createEl&&(this.el_=this.createEl());b.className&&this.el_&&b.className.split(" ").forEach(e=>this.addClass(e));["on","off","one","any","trigger"].forEach(e=>{this[e]=void 0});!1!==b.evented&&(xf(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)); |
|
oi(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};this.setTimeoutIds_=new Set;this.setIntervalIds_=new Set;this.rafIds_=new Set;this.namedRafs_=new Map;this.clearingTimersOnDispose_=!1;!1!==b.initChildren&&this.initChildren();this.ready(c);!1!==b.reportTouchActivity&&this.enableTouchActivity()}on(a,b){}off(a,b){}one(a,b){}any(a,b){}trigger(a,b){}dispose(a={}){if(!this.isDisposed_){this.readyQueue_&&(this.readyQueue_.length=0);this.trigger({type:"dispose", |
|
bubbles:!1});this.isDisposed_=!0;if(this.children_)for(let b=this.children_.length-1;0<=b;b--)this.children_[b].dispose&&this.children_[b].dispose();this.parentComponent_=this.childNameIndex_=this.childIndex_=this.children_=null;this.el_&&(this.el_.parentNode&&(a.restoreEl?this.el_.parentNode.replaceChild(a.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null);this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(a){return a?this.options_= |
|
ma(this.options_,a):this.options_}el(){return this.el_}createEl(a,b,c){return aa(a,b,c)}localize(a,b,c=a){var e=this.player_.language&&this.player_.language(),g=this.player_.languages&&this.player_.languages();const l=g&&g[e];e=e&&e.split("-")[0];g=g&&g[e];l&&l[a]?c=l[a]:g&&g[a]&&(c=g[a]);b&&(c=c.replace(/\{(\d+)\}/g,function(p,t){let x=t=b[t-1];"undefined"===typeof t&&(x=p);return x}));return c}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(a){return this.childIndex_[a]}getChild(a){if(a)return this.childNameIndex_[a]}getDescendant(...a){a= |
|
a.reduce((c,e)=>c.concat(e),[]);let b=this;for(let c=0;c<a.length;c++)if(b=b.getChild(a[c]),!b||!b.getChild)return;return b}setIcon(a,b=this.el()){if(this.player_.options_.experimentalSvgIcons){var c=aa("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),e=P.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttributeNS(null,"viewBox","0 0 512 512");var g=P.createElementNS("http://www.w3.org/2000/svg","use");e.appendChild(g);g.setAttributeNS(null,"href",`#vjs-icon-${a}`); |
|
c.appendChild(e);this.iconIsSet_?b.replaceChild(c,b.querySelector(".vjs-icon-placeholder")):b.appendChild(c);this.iconIsSet_=!0;return c}}addChild(a,b={},c=this.children_.length){if("string"===typeof a){var e=wa(a);a=b.componentClass||e;b.name=e;const g=M.getComponent(a);if(!g)throw Error(`Component ${a} does not exist`);if("function"!==typeof g)return null;b=new g(this.player_||this,b)}else b=a;b.parentComponent_&&b.parentComponent_.removeChild(b);this.children_.splice(c,0,b);b.parentComponent_= |
|
this;"function"===typeof b.id&&(this.childIndex_[b.id()]=b);if(e=e||b.name&&wa(b.name()))this.childNameIndex_[e]=b,this.childNameIndex_[nd(e)]=b;"function"===typeof b.el&&b.el()&&(e=null,this.children_[c+1]&&(this.children_[c+1].el_?e=this.children_[c+1].el_:Bc(this.children_[c+1])&&(e=this.children_[c+1])),this.contentEl().insertBefore(b.el(),e));return b}removeChild(a){"string"===typeof a&&(a=this.getChild(a));if(a&&this.children_){var b=!1;for(let c=this.children_.length-1;0<=c;c--)if(this.children_[c]=== |
|
a){b=!0;this.children_.splice(c,1);break}b&&(a.parentComponent_=null,this.childIndex_[a.id()]=null,this.childNameIndex_[wa(a.name())]=null,this.childNameIndex_[nd(a.name())]=null,(b=a.el())&&b.parentNode===this.contentEl()&&this.contentEl().removeChild(a.el()))}}initChildren(){const a=this.options_.children;if(a){const b=this.options_;let c;const e=M.getComponent("Tech");c=Array.isArray(a)?a:Object.keys(a);c.concat(Object.keys(this.options_).filter(function(g){return!c.some(function(l){return"string"=== |
|
typeof l?g===l:g===l.name})})).map(g=>{let l;"string"===typeof g?(l=g,g=a[l]||this.options_[l]||{}):l=g.name;return{name:l,opts:g}}).filter(g=>(g=M.getComponent(g.opts.componentClass||wa(g.name)))&&!e.isTech(g)).forEach(g=>{const l=g.name;g=g.opts;void 0!==b[l]&&(g=b[l]);!1!==g&&(!0===g&&(g={}),g.playerOptions=this.options_.playerOptions,(g=this.addChild(l,g))&&(this[l]=g))})}}buildCSSClass(){return""}ready(a,b=!1){a&&(this.isReady_?b?a.call(this):this.setTimeout(a,1):(this.readyQueue_=this.readyQueue_|| |
|
[],this.readyQueue_.push(a)))}triggerReady(){this.isReady_=!0;this.setTimeout(function(){const a=this.readyQueue_;this.readyQueue_=[];a&&0<a.length&&a.forEach(function(b){b.call(this)},this);this.trigger("ready")},1)}$(a,b){return Wb(a,b||this.contentEl())}$$(a,b){return wj(a,b||this.contentEl())}hasClass(a){return dd(this.el_,a)}addClass(...a){cc(this.el_,...a)}removeClass(...a){Td(this.el_,...a)}toggleClass(a,b){ei(this.el_,a,b)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(a){return this.el_.getAttribute(a)}setAttribute(a, |
|
b){this.el_.setAttribute(a,b)}removeAttribute(a){this.el_.removeAttribute(a)}width(a,b){return this.dimension("width",a,b)}height(a,b){return this.dimension("height",a,b)}dimensions(a,b){this.width(a,!0);this.height(b)}dimension(a,b,c){if(void 0!==b){if(null===b||b!==b)b=0;-1!==(""+b).indexOf("%")||-1!==(""+b).indexOf("px")?this.el_.style[a]=b:this.el_.style[a]="auto"===b?"":b+"px";c||this.trigger("componentresize")}else{if(!this.el_)return 0;b=this.el_.style[a];c=b.indexOf("px");return-1!==c?parseInt(b.slice(0, |
|
c),10):parseInt(this.el_["offset"+wa(a)],10)}}currentDimension(a){let b=0;if("width"!==a&&"height"!==a)throw Error("currentDimension only accepts width or height value");b=Dc(this.el_,a);b=parseFloat(b);if(0===b||isNaN(b))a=`offset${wa(a)}`,b=this.el_[a];return b}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(a){this.player_&& |
|
(Y.isEventKey(a,"Tab")||a.stopPropagation(),this.player_.handleKeyDown(a))}handleKeyPress(a){this.handleKeyDown(a)}emitTapEvents(){let a=0,b=null,c;this.on("touchstart",function(g){1===g.touches.length&&(b={pageX:g.touches[0].pageX,pageY:g.touches[0].pageY},a=D.performance.now(),c=!0)});this.on("touchmove",function(g){if(1<g.touches.length)c=!1;else if(b){const l=g.touches[0].pageX-b.pageX;g=g.touches[0].pageY-b.pageY;10<Math.sqrt(l*l+g*g)&&(c=!1)}});const e=function(){c=!1};this.on("touchleave", |
|
e);this.on("touchcancel",e);this.on("touchend",function(g){b=null;!0===c&&200>D.performance.now()-a&&(g.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(this.player()&&this.player().reportUserActivity){var a=na(this.player(),this.player().reportUserActivity),b;this.on("touchstart",function(){a();this.clearInterval(b);b=this.setInterval(a,250)});var c=function(e){a();this.clearInterval(b)};this.on("touchmove",a);this.on("touchend",c);this.on("touchcancel",c)}}setTimeout(a,b){a=na(this, |
|
a);this.clearTimersOnDispose_();var c=D.setTimeout(()=>{this.setTimeoutIds_.has(c)&&this.setTimeoutIds_.delete(c);a()},b);this.setTimeoutIds_.add(c);return c}clearTimeout(a){this.setTimeoutIds_.has(a)&&(this.setTimeoutIds_.delete(a),D.clearTimeout(a));return a}setInterval(a,b){a=na(this,a);this.clearTimersOnDispose_();a=D.setInterval(a,b);this.setIntervalIds_.add(a);return a}clearInterval(a){this.setIntervalIds_.has(a)&&(this.setIntervalIds_.delete(a),D.clearInterval(a));return a}requestAnimationFrame(a){this.clearTimersOnDispose_(); |
|
a=na(this,a);var b=D.requestAnimationFrame(()=>{this.rafIds_.has(b)&&this.rafIds_.delete(b);a()});this.rafIds_.add(b);return b}requestNamedAnimationFrame(a,b){if(!this.namedRafs_.has(a)){this.clearTimersOnDispose_();b=na(this,b);var c=this.requestAnimationFrame(()=>{b();this.namedRafs_.has(a)&&this.namedRafs_.delete(a)});this.namedRafs_.set(a,c);return a}}cancelNamedAnimationFrame(a){this.namedRafs_.has(a)&&(this.cancelAnimationFrame(this.namedRafs_.get(a)),this.namedRafs_.delete(a))}cancelAnimationFrame(a){this.rafIds_.has(a)&& |
|
(this.rafIds_.delete(a),D.cancelAnimationFrame(a));return a}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([a,b])=>{this[a].forEach((c,e)=>this[b](e))});this.clearingTimersOnDispose_=!1}))}static registerComponent(a,b){if("string"!==typeof a||!a)throw Error(`Illegal component name, "${a}"; must be a non-empty string.`); |
|
var c=M.getComponent("Tech");c=c&&c.isTech(b);const e=M===b||M.prototype.isPrototypeOf(b.prototype);if(c||!e)throw Error(`Illegal component, "${a}"; ${c?"techs must be registered using Tech.registerTech()":"must be a Component subclass"}.`);a=wa(a);M.components_||(M.components_={});c=M.getComponent("Player");if("Player"===a&&c&&c.players){const g=c.players;c=Object.keys(g);if(g&&0<c.length&&c.map(l=>g[l]).every(Boolean))throw Error("Can not register Player component after player has been created."); |
|
}M.components_[a]=b;return M.components_[nd(a)]=b}static getComponent(a){if(a&&M.components_)return M.components_[a]}}M.registerComponent("Component",M);const si=function(a,b){a=0>a?0:a;let c=Math.floor(a%60),e=Math.floor(a/60%60),g=Math.floor(a/3600);const l=Math.floor(b/60%60);b=Math.floor(b/3600);if(isNaN(a)||Infinity===a)g=e=c="-";g=0<g||0<b?g+":":"";return g+(((g||10<=l)&&10>e?"0"+e:e)+":")+(10>c?"0"+c:c)};let zf=si;var zo=Object.freeze({__proto__:null,createTimeRanges:qb,createTimeRange:qb, |
|
setFormatTime:qi,resetFormatTime:ri,formatTime:dc});ua.prototype.code=0;ua.prototype.message="";ua.prototype.status=null;ua.prototype.metadata=null;ua.errorTypes="MEDIA_ERR_CUSTOM MEDIA_ERR_ABORTED MEDIA_ERR_NETWORK MEDIA_ERR_DECODE MEDIA_ERR_SRC_NOT_SUPPORTED MEDIA_ERR_ENCRYPTED".split(" ");ua.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."};ua.MEDIA_ERR_CUSTOM=0;ua.prototype.MEDIA_ERR_CUSTOM=0;ua.MEDIA_ERR_ABORTED=1;ua.prototype.MEDIA_ERR_ABORTED=1;ua.MEDIA_ERR_NETWORK=2;ua.prototype.MEDIA_ERR_NETWORK=2;ua.MEDIA_ERR_DECODE=3;ua.prototype.MEDIA_ERR_DECODE=3;ua.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ua.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;ua.MEDIA_ERR_ENCRYPTED= |
|
5;ua.prototype.MEDIA_ERR_ENCRYPTED=5;const cg=function(a){return"kind label language id inBandMetadataTrackDispatchType mode src".split(" ").reduce((b,c,e)=>{a[c]&&(b[c]=a[c]);return b},{cues:a.cues&&Array.prototype.map.call(a.cues,function(b){return{startTime:b.startTime,endTime:b.endTime,text:b.text,id:b.id}})})};var Ej={textTracksToJson:function(a){const b=a.$$("track"),c=Array.prototype.map.call(b,e=>e.track);return Array.prototype.map.call(b,function(e){const g=cg(e.track);e.src&&(g.src=e.src); |
|
return g}).concat(Array.prototype.filter.call(a.textTracks(),function(e){return-1===c.indexOf(e)}).map(cg))},jsonToTextTracks:function(a,b){a.forEach(function(c){const e=b.addRemoteTextTrack(c).track;!c.src&&c.cues&&c.cues.forEach(g=>e.addCue(g))});return b.textTracks()},trackToJson_:cg};class Kc extends M{constructor(a,b){super(a,b);this.handleKeyDown_=c=>this.handleKeyDown(c);this.close_=c=>this.close(c);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1;this.closeable(!this.options_.uncloseable); |
|
this.content(this.options_.content);this.contentEl_=aa("div",{className:"vjs-modal-dialog-content"},{role:"document"});this.descEl_=aa("p",{className:"vjs-modal-dialog-description vjs-control-text",id:this.el().getAttribute("aria-describedby")});Ub(this.descEl_,this.description());this.el_.appendChild(this.descEl_);this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true", |
|
"aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.previouslyActiveEl_=this.descEl_=this.contentEl_=null;super.dispose()}buildCSSClass(){return`${"vjs-modal-dialog"} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let a=this.options_.description||this.localize("This is a modal window.");this.closeable()&&(a+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")); |
|
return a}open(){if(this.opened_)this.options_.fillAlways&&this.fill();else{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.on("keydown",this.handleKeyDown_);this.hadControls_=a.controls();a.controls(!1);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen"); |
|
this.hasBeenOpened_=!0}}opened(a){if("boolean"===typeof a)this[a?"open":"close"]();return this.opened_}close(){if(this.opened_){var a=this.player();this.trigger("beforemodalclose");this.opened_=!1;this.wasPlaying_&&this.options_.pauseOnOpen&&a.play();this.off("keydown",this.handleKeyDown_);this.hadControls_&&a.controls(!0);this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();this.options_.temporary&&this.dispose()}}closeable(a){if("boolean"=== |
|
typeof a){a=this.closeable_=!!a;let b=this.getChild("closeButton");if(a&&!b){const c=this.contentEl_;this.contentEl_=this.el_;b=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=c;this.on(b,"close",this.close_)}!a&&b&&(this.off(b,"close",this.close_),this.removeChild(b),b.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(a){const b=this.contentEl(),c=b.parentNode,e=b.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=!0;c.removeChild(b); |
|
this.empty();ki(b,a);this.trigger("modalfill");e?c.insertBefore(b,e):c.appendChild(b);(a=this.getChild("closeButton"))&&c.appendChild(a.el_)}empty(){this.trigger("beforemodalempty");Wd(this.contentEl());this.trigger("modalempty")}content(a){"undefined"!==typeof a&&(this.content_=a);return this.content_}conditionalFocus_(){const a=P.activeElement,b=this.player_.el_;this.previouslyActiveEl_=null;if(b.contains(a)||b===a)this.previouslyActiveEl_=a,this.focus()}conditionalBlur_(){this.previouslyActiveEl_&& |
|
(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(a){a.stopPropagation();if(Y.isEventKey(a,"Escape")&&this.closeable())a.preventDefault(),this.close();else if(Y.isEventKey(a,"Tab")){var b=this.focusableEls_(),c=this.el_.querySelector(":focus");for(let g=0;g<b.length;g++)if(c===b[g]){var e=g;break}P.activeElement===this.el_&&(e=0);a.shiftKey&&0===e?(b[b.length-1].focus(),a.preventDefault()):a.shiftKey||e!==b.length-1||(b[0].focus(),a.preventDefault())}}focusableEls_(){const a= |
|
this.el_.querySelectorAll("*");return Array.prototype.filter.call(a,b=>(b instanceof D.HTMLAnchorElement||b instanceof D.HTMLAreaElement)&&b.hasAttribute("href")||(b instanceof D.HTMLInputElement||b instanceof D.HTMLSelectElement||b instanceof D.HTMLTextAreaElement||b instanceof D.HTMLButtonElement)&&!b.hasAttribute("disabled")||b instanceof D.HTMLIFrameElement||b instanceof D.HTMLObjectElement||b instanceof D.HTMLEmbedElement||b.hasAttribute("tabindex")&&-1!==b.getAttribute("tabindex")||b.hasAttribute("contenteditable"))}} |
|
Kc.prototype.options_={pauseOnOpen:!0,temporary:!0};M.registerComponent("ModalDialog",Kc);class Lc extends kb{constructor(a=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let b=0;b<a.length;b++)this.addTrack(a[b])}addTrack(a){const b=this.tracks_.length;""+b in this||Object.defineProperty(this,b,{get(){return this.tracks_[b]}});-1===this.tracks_.indexOf(a)&&(this.tracks_.push(a),this.trigger({track:a,type:"addtrack",target:this}));a.labelchange_= |
|
()=>{this.trigger({track:a,type:"labelchange",target:this})};Kb(a)&&a.addEventListener("labelchange",a.labelchange_)}removeTrack(a){let b;for(let c=0,e=this.length;c<e;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",target:this})}getTrackById(a){let b=null;for(let c=0,e=this.length;c<e;c++){const g=this[c];if(g.id===a){b=g;break}}return b}}Lc.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack", |
|
labelchange:"labelchange"};for(const a in Lc.prototype.allowedEvents_)Lc.prototype["on"+a]=null;const dg=function(a,b){for(let c=0;c<a.length;c++)Object.keys(a[c]).length&&b.id!==a[c].id&&(a[c].enabled=!1)};class Ao extends Lc{constructor(a=[]){for(let b=a.length-1;0<=b;b--)if(a[b].enabled){dg(a,a[b]);break}super(a);this.changing_=!1}addTrack(a){a.enabled&&dg(this,a);super.addTrack(a);a.addEventListener&&(a.enabledChange_=()=>{this.changing_||(this.changing_=!0,dg(this,a),this.changing_=!1,this.trigger("change"))}, |
|
a.addEventListener("enabledchange",a.enabledChange_))}removeTrack(a){super.removeTrack(a);a.removeEventListener&&a.enabledChange_&&(a.removeEventListener("enabledchange",a.enabledChange_),a.enabledChange_=null)}}const eg=function(a,b){for(let c=0;c<a.length;c++)Object.keys(a[c]).length&&b.id!==a[c].id&&(a[c].selected=!1)};class Bo extends Lc{constructor(a=[]){for(let b=a.length-1;0<=b;b--)if(a[b].selected){eg(a,a[b]);break}super(a);this.changing_=!1;Object.defineProperty(this,"selectedIndex",{get(){for(let b= |
|
0;b<this.length;b++)if(this[b].selected)return b;return-1},set(){}})}addTrack(a){a.selected&&eg(this,a);super.addTrack(a);a.addEventListener&&(a.selectedChange_=()=>{this.changing_||(this.changing_=!0,eg(this,a),this.changing_=!1,this.trigger("change"))},a.addEventListener("selectedchange",a.selectedChange_))}removeTrack(a){super.removeTrack(a);a.removeEventListener&&a.selectedChange_&&(a.removeEventListener("selectedchange",a.selectedChange_),a.selectedChange_=null)}}class Fj extends Lc{addTrack(a){super.addTrack(a); |
|
this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change"));this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange"));a.addEventListener("modechange",this.queueChange_);-1===["metadata","chapters"].indexOf(a.kind)&&a.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(a){super.removeTrack(a);a.removeEventListener&&(this.queueChange_&&a.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&& |
|
a.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class Co{constructor(a=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let b=0,c=a.length;b<c;b++)this.addTrackElement_(a[b])}addTrackElement_(a){const b=this.trackElements_.length;""+b in this||Object.defineProperty(this,b,{get(){return this.trackElements_[b]}});-1===this.trackElements_.indexOf(a)&&this.trackElements_.push(a)}getTrackElementByTrack_(a){let b;for(let c= |
|
0,e=this.trackElements_.length;c<e;c++)if(a===this.trackElements_[c].track){b=this.trackElements_[c];break}return b}removeTrackElement_(a){for(let b=0,c=this.trackElements_.length;b<c;b++)if(a===this.trackElements_[b]){this.trackElements_[b].track&&"function"===typeof this.trackElements_[b].track.off&&this.trackElements_[b].track.off();"function"===typeof this.trackElements_[b].off&&this.trackElements_[b].off();this.trackElements_.splice(b,1);break}}}class fg{constructor(a){fg.prototype.setCues_.call(this, |
|
a);Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(a){const b=this.length||0;let c=0;const e=a.length;this.cues_=a;this.length_=a.length;a=function(g){""+g in this||Object.defineProperty(this,""+g,{get(){return this.cues_[g]}})};if(b<e)for(c=b;c<e;c++)a.call(this,c)}getCueById(a){let b=null;for(let c=0,e=this.length;c<e;c++){const g=this[c];if(g.id===a){b=g;break}}return b}}const Do={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles", |
|
commentary:"commentary"},Eo={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Fo={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Gj={disabled:"disabled",hidden:"hidden",showing:"showing"};class gg extends kb{constructor(a={}){super();const b={id:a.id||"vjs_track_"+pb++,kind:a.kind||"",language:a.language||""};let c=a.label||"";for(const e in b)Object.defineProperty(this, |
|
e,{get(){return b[e]},set(){}});Object.defineProperty(this,"label",{get(){return c},set(e){e!==c&&(c=e,this.trigger("labelchange"))}})}}const hg=function(a){const b="protocol hostname port pathname search hash host".split(" "),c=P.createElement("a");c.href=a;a={};for(let e=0;e<b.length;e++)a[b[e]]=c[b[e]];"http:"===a.protocol&&(a.host=a.host.replace(/:80$/,""));"https:"===a.protocol&&(a.host=a.host.replace(/:443$/,""));a.protocol||(a.protocol=D.location.protocol);a.host||(a.host=D.location.host); |
|
return a},Hj=function(a){if(!a.match(/^https?:\/\//)){const b=P.createElement("a");b.href=a;a=b.href}return a},ig=function(a){return"string"===typeof a&&(a=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(a))?a.pop().toLowerCase():""},re=function(a,b=D.location){a=hg(a);return(":"===a.protocol?b.protocol:a.protocol)+a.host!==b.protocol+b.host};var Go=Object.freeze({__proto__:null,parseUrl:hg,getAbsoluteURL:Hj,getFileExtension:ig,isCrossOrigin:re});const Ij=function(a, |
|
b){const c=new D.WebVTT.Parser(D,D.vttjs,D.WebVTT.StringDecoder()),e=[];c.oncue=function(g){b.addCue(g)};c.onparsingerror=function(g){e.push(g)};c.onflush=function(){b.trigger({type:"loadeddata",target:b})};c.parse(a);0<e.length&&(D.console&&D.console.groupCollapsed&&D.console.groupCollapsed(`Text Track parsing errors for ${b.src}`),e.forEach(g=>da.error(g)),D.console&&D.console.groupEnd&&D.console.groupEnd());c.flush()},Jj=function(a,b){const c={uri:a};if(a=re(a))c.cors=a;if(a="use-credentials"=== |
|
b.tech_.crossOrigin())c.withCredentials=a;Fi(c,na(this,function(e,g,l){if(e)return da.error(e,g);b.loaded_=!0;"function"!==typeof D.WebVTT?b.tech_&&b.tech_.any(["vttjsloaded","vttjserror"],p=>{if("vttjserror"===p.type)da.error(`vttjs failed to load, stopping trying to process ${b.src}`);else return Ij(l,b)}):Ij(l,b)}))};class od extends gg{constructor(a={}){if(!a.tech)throw Error("A tech was not provided.");a=ma(a,{kind:Fo[a.kind]||"subtitles",language:a.language||a.srclang||""});let b=Gj[a.mode]|| |
|
"disabled";const c=a.default;if("metadata"===a.kind||"chapters"===a.kind)b="hidden";super(a);this.tech_=a.tech;this.cues_=[];this.activeCues_=[];this.preload_=!1!==this.tech_.preloadTextTracks;const e=new fg(this.cues_),g=new fg(this.activeCues_);let l=!1;this.timeupdateHandler=na(this,function(p={}){this.tech_.isDisposed()||(this.tech_.isReady_&&(this.activeCues=this.activeCues,l&&(this.trigger("cuechange"),l=!1)),"timeupdate"!==p.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}); |
|
this.tech_.one("dispose",()=>{this.stopTracking()});"disabled"!==b&&this.startTracking();Object.defineProperties(this,{default:{get(){return c},set(){}},mode:{get(){return b},set(p){Gj[p]&&b!==p&&(b=p,this.preload_||"disabled"===b||0!==this.cues.length||Jj(this.src,this),this.stopTracking(),"disabled"!==b&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?e:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return g;var p=this.tech_.currentTime(); |
|
const t=[];for(let x=0,y=this.cues.length;x<y;x++){const A=this.cues[x];A.startTime<=p&&A.endTime>=p&&t.push(A)}l=!1;if(t.length!==this.activeCues_.length)l=!0;else for(p=0;p<t.length;p++)-1===this.activeCues_.indexOf(t[p])&&(l=!0);this.activeCues_=t;g.setCues_(this.activeCues_);return g},set(){}}});a.src?(this.src=a.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==a.kind&&"captions"!==a.kind)&&Jj(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler); |
|
this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0);this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(a){let b=a;if(!("getCueAsHTML"in b)){b=new D.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}a=this.tech_.textTracks();for(c=0;c<a.length;c++)a[c]!==this&&a[c].removeCue(b);this.cues_.push(b);this.cues.setCues_(this.cues_)}removeCue(a){let b= |
|
this.cues_.length;for(;b--;){const c=this.cues_[b];if(c===a||c.originalCue_&&c.originalCue_===a){this.cues_.splice(b,1);this.cues.setCues_(this.cues_);break}}}}od.prototype.allowedEvents_={cuechange:"cuechange"};class Kj extends gg{constructor(a={}){a=ma(a,{kind:Eo[a.kind]||""});super(a);let b=!1;Object.defineProperty(this,"enabled",{get(){return b},set(c){"boolean"===typeof c&&c!==b&&(b=c,this.trigger("enabledchange"))}});a.enabled&&(this.enabled=a.enabled);this.loaded_=!0}}class Lj extends gg{constructor(a= |
|
{}){a=ma(a,{kind:Do[a.kind]||""});super(a);let b=!1;Object.defineProperty(this,"selected",{get(){return b},set(c){"boolean"===typeof c&&c!==b&&(b=c,this.trigger("selectedchange"))}});a.selected&&(this.selected=a.selected)}}class $b extends kb{constructor(a={}){super();let b;const c=new od(a);this.kind=c.kind;this.src=c.src;this.srclang=c.language;this.label=c.label;this.default=c.default;Object.defineProperties(this,{readyState:{get(){return b}},track:{get(){return c}}});b=$b.NONE;c.addEventListener("loadeddata", |
|
()=>{b=$b.LOADED;this.trigger({type:"load",target:this})})}}$b.prototype.allowedEvents_={load:"load"};$b.NONE=0;$b.LOADING=1;$b.LOADED=2;$b.ERROR=3;const lb={audio:{ListClass:Ao,TrackClass:Kj,capitalName:"Audio"},video:{ListClass:Bo,TrackClass:Lj,capitalName:"Video"},text:{ListClass:Fj,TrackClass:od,capitalName:"Text"}};Object.keys(lb).forEach(function(a){lb[a].getterName=`${a}Tracks`;lb[a].privateName=`${a}Tracks_`});const Mc={remoteText:{ListClass:Fj,TrackClass:od,capitalName:"RemoteText",getterName:"remoteTextTracks", |
|
privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Co,TrackClass:$b,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Sa=Object.assign({},lb,Mc);Mc.names=Object.keys(Mc);lb.names=Object.keys(lb);Sa.names=[].concat(Mc.names).concat(lb.names);class Z extends M{constructor(a={},b=function(){}){a.reportTouchActivity=!1;super(null,a,b);this.onDurationChange_=c=>this.onDurationChange(c);this.trackProgress_=c=>this.trackProgress(c);this.trackCurrentTime_= |
|
c=>this.trackCurrentTime(c);this.stopTrackingCurrentTime_=c=>this.stopTrackingCurrentTime(c);this.disposeSourceHandler_=c=>this.disposeSourceHandler(c);this.queuedHanders_=new Set;this.hasStarted_=!1;this.on("playing",function(){this.hasStarted_=!0});this.on("loadstart",function(){this.hasStarted_=!1});Sa.names.forEach(c=>{c=Sa[c];a&&a[c.getterName]&&(this[c.privateName]=a[c.getterName])});this.featuresProgressEvents||this.manualProgressOn();this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(); |
|
["Text","Audio","Video"].forEach(c=>{!1===a[`native${c}Tracks`]&&(this[`featuresNative${c}Tracks`]=!1)});if(!1===a.nativeCaptions||!1===a.nativeTextTracks)this.featuresNativeTextTracks=!1;else if(!0===a.nativeCaptions||!0===a.nativeTextTracks)this.featuresNativeTextTracks=!0;this.featuresNativeTextTracks||this.emulateTextTracks();this.preloadTextTracks=!1!==a.preloadTextTracks;this.autoRemoteTextTracks_=new Sa.text.ListClass;this.initTrackListeners();a.nativeControlsForTouch||this.emitTapEvents(); |
|
this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(a){if(!this.isReady_)this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(a),1));this.trigger({src:a,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=!0;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(a){this.stopTrackingProgress(); |
|
this.progressInterval=this.setInterval(na(this,function(){const b=this.bufferedPercent();this.bufferedPercent_!==b&&this.trigger("progress");this.bufferedPercent_=b;1===b&&this.stopTrackingProgress()}),500)}onDurationChange(a){this.duration_=this.duration()}buffered(){return qb(0,0)}bufferedPercent(){return ti(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0;this.on("play",this.trackCurrentTime_);this.on("pause", |
|
this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime();this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate", |
|
target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(lb.names);this.manualProgress&&this.manualProgressOff();this.manualTimeUpdates&&this.manualTimeUpdatesOff();super.dispose()}clearTracks(a){a=[].concat(a);a.forEach(b=>{const c=this[`${b}Tracks`]()||[];let e=c.length;for(;e--;){const g=c[e];"text"===b&&this.removeRemoteTextTrack(g);c.removeTrack(g)}})}cleanupAutoTextTracks(){const a=this.autoRemoteTextTracks_||[];let b=a.length;for(;b--;)this.removeRemoteTextTrack(a[b])}reset(){}crossOrigin(){}setCrossOrigin(){}error(a){void 0!== |
|
a&&(this.error_=new ua(a),this.trigger("error"));return this.error_}played(){return this.hasStarted_?qb(0,0):qb()}play(){}setScrubbing(a){}scrubbing(){}setCurrentTime(a){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){lb.names.forEach(a=>{const b=()=>{this.trigger(`${a}trackchange`)},c=this[lb[a].getterName]();c.addEventListener("removetrack",b);c.addEventListener("addtrack",b);this.on("dispose",()=>{c.removeEventListener("removetrack", |
|
b);c.removeEventListener("addtrack",b)})})}addWebVttScript_(){if(!D.WebVTT)if(P.body.contains(this.el()))if(!this.options_["vtt.js"]&&zc(Hi)&&0<Object.keys(Hi).length)this.trigger("vttjsloaded");else{var a=P.createElement("script");a.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";a.onload=()=>{this.trigger("vttjsloaded")};a.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",()=>{a.onload=null;a.onerror=null});D.WebVTT=!0;this.el().parentNode.appendChild(a)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const a= |
|
this.textTracks(),b=this.remoteTextTracks(),c=p=>a.addTrack(p.track),e=p=>a.removeTrack(p.track);b.on("addtrack",c);b.on("removetrack",e);this.addWebVttScript_();const g=()=>this.trigger("texttrackchange"),l=()=>{g();for(let p=0;p<a.length;p++){const t=a[p];t.removeEventListener("cuechange",g);"showing"===t.mode&&t.addEventListener("cuechange",g)}};l();a.addEventListener("change",l);a.addEventListener("addtrack",l);a.addEventListener("removetrack",l);this.on("dispose",function(){b.off("addtrack", |
|
c);b.off("removetrack",e);a.removeEventListener("change",l);a.removeEventListener("addtrack",l);a.removeEventListener("removetrack",l);for(let p=0;p<a.length;p++)a[p].removeEventListener("cuechange",g)})}addTextTrack(a,b,c){if(!a)throw Error("TextTrack kind is required but was not provided");return Tm(this,a,b,c)}createRemoteTextTrack(a){a=ma(a,{tech:this});return new Mc.remoteTextEl.TrackClass(a)}addRemoteTextTrack(a={},b){const c=this.createRemoteTextTrack(a);"boolean"!==typeof b&&(b=!1);this.remoteTextTrackEls().addTrackElement_(c); |
|
this.remoteTextTracks().addTrack(c.track);!1===b&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(c.track));return c}removeRemoteTextTrack(a){const b=this.remoteTextTrackEls().getTrackElementByTrack_(a);this.remoteTextTrackEls().removeTrackElement_(b);this.remoteTextTracks().removeTrack(a);this.autoRemoteTextTracks_.removeTrack(a)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(a){const b= |
|
pb++;!this.isReady_||this.paused()?(this.queuedHanders_.add(b),this.one("playing",()=>{this.queuedHanders_.has(b)&&(this.queuedHanders_.delete(b),a())})):this.requestNamedAnimationFrame(b,a);return b}cancelVideoFrameCallback(a){this.queuedHanders_.has(a)?this.queuedHanders_.delete(a):this.cancelNamedAnimationFrame(a)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(a){}overrideNativeVideoTracks(a){}canPlayType(a){return""}static canPlayType(a){return""}static canPlaySource(a, |
|
b){return Z.canPlayType(a.type)}static isTech(a){return a.prototype instanceof Z||a instanceof Z||a===Z}static registerTech(a,b){Z.techs_||(Z.techs_={});if(!Z.isTech(b))throw Error(`Tech ${a} must be a Tech`);if(!Z.canPlayType)throw Error("Techs must have a static canPlayType method on them");if(!Z.canPlaySource)throw Error("Techs must have a static canPlaySource method on them");a=wa(a);Z.techs_[a]=b;Z.techs_[nd(a)]=b;"Tech"!==a&&Z.defaultTechOrder_.push(a);return b}static getTech(a){if(a){if(Z.techs_&& |
|
Z.techs_[a])return Z.techs_[a];a=wa(a);if(D&&D.videojs&&D.videojs[a])return da.warn(`The ${a} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),D.videojs[a]}}}Sa.names.forEach(function(a){const b=Sa[a];Z.prototype[b.getterName]=function(){this[b.privateName]=this[b.privateName]||new b.ListClass;return this[b.privateName]}});Z.prototype.featuresVolumeControl=!0;Z.prototype.featuresMuteControl=!0;Z.prototype.featuresFullscreenResize=!1;Z.prototype.featuresPlaybackRate= |
|
!1;Z.prototype.featuresProgressEvents=!1;Z.prototype.featuresSourceset=!1;Z.prototype.featuresTimeupdateEvents=!1;Z.prototype.featuresNativeTextTracks=!1;Z.prototype.featuresVideoFrameCallback=!1;Z.withSourceHandlers=function(a){a.registerSourceHandler=function(b,c){let e=a.sourceHandlers;e||(e=a.sourceHandlers=[]);void 0===c&&(c=e.length);e.splice(c,0,b)};a.canPlayType=function(b){const c=a.sourceHandlers||[];let e;for(let g=0;g<c.length;g++)if(e=c[g].canPlayType(b))return e;return""};a.selectSourceHandler= |
|
function(b,c){const e=a.sourceHandlers||[];let g;for(let l=0;l<e.length;l++)if(g=e[l].canHandleSource(b,c))return e[l];return null};a.canPlaySource=function(b,c){const e=a.selectSourceHandler(b,c);return e?e.canHandleSource(b,c):""};["seekable","seeking","duration"].forEach(function(b){const c=this[b];"function"===typeof c&&(this[b]=function(){return this.sourceHandler_&&this.sourceHandler_[b]?this.sourceHandler_[b].apply(this.sourceHandler_,arguments):c.apply(this,arguments)})},a.prototype);a.prototype.setSource= |
|
function(b){let c=a.selectSourceHandler(b,this.options_);c||(a.nativeSourceHandler?c=a.nativeSourceHandler:da.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.one("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)}};M.registerComponent("Tech",Z);Z.registerTech("Tech",Z);Z.defaultTechOrder_=[];const fc={},Bf={},Zd={},Ho={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Io={setCurrentTime:1,setMuted:1,setVolume:1},Mj={play:1,pause:1},Jo={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4", |
|
mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},$d=function(a=""){a=ig(a);return Jo[a.toLowerCase()]||""},Ko=(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(e=>e.src=== |
|
b);if(c.length)return c[0].type;a=a.$$("source");for(c=0;c<a.length;c++){const e=a[c];if(e.type&&e.src&&e.src===b)return e.type}return $d(b)},Nj=function(a){if(Array.isArray(a)){let b=[];a.forEach(function(c){c=Nj(c);Array.isArray(c)?b=b.concat(c):xb(c)&&b.push(c)});a=b}else a="string"===typeof a&&a.trim()?[vi({src:a})]:xb(a)&&"string"===typeof a.src&&a.src&&a.src.trim()?[vi(a)]:[];return a};class Lo extends M{constructor(a,b,c){const e=ma({createEl:!1},b);super(a,e,c);if(b.playerOptions.sources&& |
|
0!==b.playerOptions.sources.length)a.src(b.playerOptions.sources);else for(let g=0,l=b.playerOptions.techOrder;g<l.length;g++)if(b=wa(l[g]),c=Z.getTech(b),b||(c=M.getComponent(b)),c&&c.isSupported()){a.loadTech_(b);break}}}M.registerComponent("MediaLoader",Lo);class se extends M{constructor(a,b){super(a,b);this.options_.controlText&&this.controlText(this.options_.controlText);this.handleMouseOver_=c=>this.handleMouseOver(c);this.handleMouseOut_=c=>this.handleMouseOut(c);this.handleClick_=c=>this.handleClick(c); |
|
this.handleKeyDown_=c=>this.handleKeyDown(c);this.emitTapEvents();this.enable()}createEl(a="div",b={},c={}){b=Object.assign({className:this.buildCSSClass(),tabIndex:0},b);"button"===a&&da.error(`Creating a ClickableComponent with an HTML element of ${a} is not supported; use a Button instead.`);c=Object.assign({role:"button"},c);this.tabIndex_=b.tabIndex;a=aa(a,b,c);this.player_.options_.experimentalSvgIcons||a.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));this.createControlTextEl(a); |
|
return a}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(a){this.controlTextEl_=aa("span",{className:"vjs-control-text"},{"aria-live":"polite"});a&&a.appendChild(this.controlTextEl_);this.controlText(this.controlText_,a);return this.controlTextEl_}controlText(a,b=this.el()){if(void 0===a)return this.controlText_||"Need Text";const c=this.localize(a);this.controlText_=a;Ub(this.controlTextEl_,c);this.nonIconControl||this.player_.options_.noUITitleAttributes||b.setAttribute("title", |
|
c)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){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("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");"undefined"!==typeof this.tabIndex_&& |
|
this.el_.removeAttribute("tabIndex");this.off("mouseover",this.handleMouseOver_);this.off("mouseout",this.handleMouseOut_);this.off(["tap","click"],this.handleClick_);this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(a){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(a){Y.isEventKey(a,"Space")||Y.isEventKey(a,"Enter")?(a.preventDefault(),a.stopPropagation(),this.trigger("click")):super.handleKeyDown(a)}} |
|
M.registerComponent("ClickableComponent",se);class jg extends se{constructor(a,b){super(a,b);this.update();this.update_=c=>this.update(c);a.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return aa("div",{className:"vjs-poster"})}crossOrigin(a){if("undefined"===typeof a)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin|| |
|
null;null!==a&&"anonymous"!==a&&"use-credentials"!==a?this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${a}"`):this.$("img")&&(this.$("img").crossOrigin=a)}update(a){a=this.player().poster();this.setSrc(a);a?this.show():this.hide()}setSrc(a){a?(this.$("img")||this.el_.appendChild(aa("picture",{className:"vjs-poster",tabIndex:-1},{},aa("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=a):this.el_.textContent=""}handleClick(a){this.player_.controls()&& |
|
(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?yb(this.player_.play()):this.player_.pause())}}jg.prototype.crossorigin=jg.prototype.crossOrigin;M.registerComponent("PosterImage",jg);const Mo={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'};class No extends M{constructor(a,b,c){super(a,b,c);const e=g=>{this.updateDisplayOverlay();this.updateDisplay(g)};a.on("loadstart",g=>this.toggleDisplay(g));a.on("texttrackchange",g=>this.updateDisplay(g));a.on("loadedmetadata",g=>{this.updateDisplayOverlay();this.preselectTrack(g)});a.ready(na(this,function(){if(a.tech_&&a.tech_.featuresNativeTextTracks)this.hide();else{a.on("fullscreenchange",e);a.on("playerresize",e);var g=D.screen.orientation|| |
|
D,l=D.screen.orientation?"change":"orientationchange";g.addEventListener(l,e);a.on("dispose",()=>g.removeEventListener(l,e));var p=this.options_.playerOptions.tracks||[];for(let t=0;t<p.length;t++)this.player_.addRemoteTextTrack(p[t],!0);this.preselectTrack()}}))}preselectTrack(){const a={captions:1,subtitles:1},b=this.player_.textTracks(),c=this.player_.cache_.selectedLanguage;let e,g,l;for(let p=0;p<b.length;p++){const t=b[p];c&&c.enabled&&c.language&&c.language===t.language&&t.kind in a?t.kind=== |
|
c.kind?l=t:l||=t:c&&!c.enabled?g=e=l=null:t.default&&("descriptions"!==t.kind||e?t.kind in a&&!g&&(g=t):e=t)}l?l.mode="showing":g?g.mode="showing":e&&(e.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"===typeof D.WebVTT&&D.WebVTT.processCues(D,[],this.el_)}updateDisplay(){const a= |
|
this.player_.textTracks();var b=this.options_.allowMultipleShowingTracks;this.clearDisplay();if(b){b=[];for(var c=0;c<a.length;++c){var e=a[c];"showing"===e.mode&&b.push(e)}this.updateForTrack(b)}else{c=b=null;for(e=a.length;e--;){const g=a[e];"showing"===g.mode&&("descriptions"===g.kind?b=g:c=g)}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))}}updateDisplayOverlay(){if(this.player_.videoHeight()&& |
|
D.CSS.supports("inset-inline: 10px")){var a=this.player_.currentWidth(),b=this.player_.currentHeight(),c=a/b,e=this.player_.videoWidth()/this.player_.videoHeight(),g=0,l=0;.1<Math.abs(c-e)&&(c>e?g=Math.round((a-b*e)/2):l=Math.round((b-a/e)/2));hd(this.el_,"insetInline",g?`${g}px`:"");hd(this.el_,"insetBlock",l?`${l}px`:"")}}updateDisplayState(a){const b=this.player_.textTrackSettings.getValues();a=a.activeCues;let c=a.length;for(;c--;){var e=a[c];if(e){e=e.displayState;b.color&&(e.firstChild.style.color= |
|
b.color);b.textOpacity&&hd(e.firstChild,"color",Cf(b.color||"#fff",b.textOpacity));b.backgroundColor&&(e.firstChild.style.backgroundColor=b.backgroundColor);b.backgroundOpacity&&hd(e.firstChild,"backgroundColor",Cf(b.backgroundColor||"#000",b.backgroundOpacity));b.windowColor&&(b.windowOpacity?hd(e,"backgroundColor",Cf(b.windowColor,b.windowOpacity)):e.style.backgroundColor=b.windowColor);b.edgeStyle&&("dropshadow"===b.edgeStyle?e.firstChild.style.textShadow="2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px #222": |
|
"raised"===b.edgeStyle?e.firstChild.style.textShadow="1px 1px #222, 2px 2px #222, 3px 3px #222":"depressed"===b.edgeStyle?e.firstChild.style.textShadow="1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px #222":"uniform"===b.edgeStyle&&(e.firstChild.style.textShadow="0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px #222"));if(b.fontPercent&&1!==b.fontPercent){const g=D.parseFloat(e.style.fontSize);e.style.fontSize=g*b.fontPercent+"px";e.style.height="auto";e.style.top="auto"}b.fontFamily&&"default"!== |
|
b.fontFamily&&("small-caps"===b.fontFamily?e.firstChild.style.fontVariant="small-caps":e.firstChild.style.fontFamily=Mo[b.fontFamily])}}}updateForTrack(a){Array.isArray(a)||(a=[a]);if("function"===typeof D.WebVTT&&!a.every(l=>!l.activeCues)){var b=[];for(var c=0;c<a.length;++c){var e=a[c];for(var g=0;g<e.activeCues.length;++g)b.push(e.activeCues[g])}D.WebVTT.processCues(D,b,this.el_);for(b=0;b<a.length;++b){c=a[b];for(e=0;e<c.activeCues.length;++e)g=c.activeCues[e].displayState,cc(g,"vjs-text-track-cue", |
|
"vjs-text-track-cue-"+(c.language?c.language:b)),c.language&&g.setAttribute("lang",c.language);this.player_.textTrackSettings&&this.updateDisplayState(c)}}}}M.registerComponent("TextTrackDisplay",No);class Oo extends M{createEl(){var a=this.player_.isAudio();a=this.localize(a?"Audio Player":"Video Player");a=aa("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[a])});const b=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});b.appendChild(a);return b}handleLanguagechange(){this.$(".vjs-control-text").textContent= |
|
this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}M.registerComponent("LoadingSpinner",Oo);class eb extends se{createEl(a,b={},c={}){a="button";b=Object.assign({className:this.buildCSSClass()},b);c=Object.assign({type:"button"},c);a=aa(a,b,c);this.player_.options_.experimentalSvgIcons||a.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0}));this.createControlTextEl(a);return a}addChild(a,b={}){da.warn(`Adding an actionable (user controllable) child to a Button (${this.constructor.name}) is not supported; use a ClickableComponent instead.`); |
|
return M.prototype.addChild.call(this,a,b)}enable(){super.enable();this.el_.removeAttribute("disabled")}disable(){super.disable();this.el_.setAttribute("disabled","disabled")}handleKeyDown(a){Y.isEventKey(a,"Space")||Y.isEventKey(a,"Enter")?a.stopPropagation():super.handleKeyDown(a)}}M.registerComponent("Button",eb);class Oj extends eb{constructor(a,b){super(a,b);this.mouseused_=!1;this.setIcon("play");this.on("mousedown",c=>this.handleMouseDown(c))}buildCSSClass(){return"vjs-big-play-button"}handleClick(a){const b= |
|
this.player_.play();if(this.mouseused_&&"clientX"in a&&"clientY"in a)yb(b),this.player_.tech(!0)&&this.player_.tech(!0).focus();else{var c=(a=this.player_.getChild("controlBar"))&&a.getChild("playToggle");c?(a=()=>c.focus(),gd(b)?b.then(a,()=>{}):this.setTimeout(a,1)):this.player_.tech(!0).focus()}}handleKeyDown(a){this.mouseused_=!1;super.handleKeyDown(a)}handleMouseDown(a){this.mouseused_=!0}}Oj.prototype.controlText_="Play Video";M.registerComponent("BigPlayButton",Oj);class Po extends eb{constructor(a, |
|
b){super(a,b);this.setIcon("cancel");this.controlText(b&&b.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(a){this.trigger({type:"close",bubbles:!1})}handleKeyDown(a){Y.isEventKey(a,"Esc")?(a.preventDefault(),a.stopPropagation(),this.trigger("click")):super.handleKeyDown(a)}}M.registerComponent("CloseButton",Po);class Pj extends eb{constructor(a,b={}){super(a,b);b.replay=void 0===b.replay||b.replay;this.setIcon("play");this.on(a,"play", |
|
c=>this.handlePlay(c));this.on(a,"pause",c=>this.handlePause(c));if(b.replay)this.on(a,"ended",c=>this.handleEnded(c))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(a){this.player_.paused()?yb(this.player_.play()):this.player_.pause()}handleSeeked(a){this.removeClass("vjs-ended");this.player_.paused()?this.handlePause(a):this.handlePlay(a)}handlePlay(a){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(a){this.removeClass("vjs-playing"); |
|
this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(a){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",b=>this.handleSeeked(b))}}Pj.prototype.controlText_="Play";M.registerComponent("PlayToggle",Pj);class Nc extends M{constructor(a,b){super(a,b);this.on(a,["timeupdate","ended","seeking"],c=>this.update(c));this.updateTextNode_()}createEl(){const a=this.buildCSSClass(),b=super.createEl("div", |
|
{className:`${a} vjs-time-control vjs-control`}),c=aa("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});b.appendChild(c);this.contentEl_=aa("span",{className:`${a}-display`},{role:"presentation"});b.appendChild(this.contentEl_);return b}dispose(){this.textNode_=this.contentEl_=null;super.dispose()}update(a){(this.player_.options_.enableSmoothSeeking||"seeking"!==a.type)&&this.updateContent(a)}updateTextNode_(a=0){a=dc(a);this.formattedTime_!== |
|
a&&(this.formattedTime_=a,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(this.contentEl_){var b=this.textNode_;b&&this.contentEl_.firstChild!==b&&(b=null,da.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead."));(this.textNode_=P.createTextNode(this.formattedTime_))&&(b?this.contentEl_.replaceChild(this.textNode_,b):this.contentEl_.appendChild(this.textNode_))}}))}updateContent(a){}} |
|
Nc.prototype.labelText_="Time";Nc.prototype.controlText_="Time";M.registerComponent("TimeDisplay",Nc);class kg extends Nc{buildCSSClass(){return"vjs-current-time"}updateContent(a){a=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();this.updateTextNode_(a)}}kg.prototype.labelText_="Current Time";kg.prototype.controlText_="Current Time";M.registerComponent("CurrentTimeDisplay",kg);class lg extends Nc{constructor(a,b){super(a, |
|
b);b=c=>this.updateContent(c);this.on(a,"durationchange",b);this.on(a,"loadstart",b);this.on(a,"loadedmetadata",b)}buildCSSClass(){return"vjs-duration"}updateContent(a){a=this.player_.duration();this.updateTextNode_(a)}}lg.prototype.labelText_="Duration";lg.prototype.controlText_="Duration";M.registerComponent("DurationDisplay",lg);class Qo extends M{createEl(){const a=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),b=super.createEl("div"),c=super.createEl("span", |
|
{textContent:"/"});b.appendChild(c);a.appendChild(b);return a}}M.registerComponent("TimeDivider",Qo);class mg extends Nc{constructor(a,b){super(a,b);this.on(a,"durationchange",c=>this.updateContent(c))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const a=super.createEl();!1!==this.options_.displayNegative&&a.insertBefore(aa("span",{},{"aria-hidden":!0},"-"),this.contentEl_);return a}updateContent(a){"number"===typeof this.player_.duration()&&(a=this.player_.ended()?0:this.player_.remainingTimeDisplay? |
|
this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(a))}}mg.prototype.labelText_="Remaining Time";mg.prototype.controlText_="Remaining Time";M.registerComponent("RemainingTimeDisplay",mg);class Ro extends M{constructor(a,b){super(a,b);this.updateShowing();this.on(this.player(),"durationchange",c=>this.updateShowing(c))}createEl(){const a=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=aa("div",{className:"vjs-live-display"},{"aria-live":"off"}); |
|
this.contentEl_.appendChild(aa("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`}));this.contentEl_.appendChild(P.createTextNode(this.localize("LIVE")));a.appendChild(this.contentEl_);return a}dispose(){this.contentEl_=null;super.dispose()}updateShowing(a){Infinity===this.player().duration()?this.show():this.hide()}}M.registerComponent("LiveDisplay",Ro);class Qj extends eb{constructor(a,b){super(a,b);this.updateLiveEdgeStatus();this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_= |
|
c=>this.updateLiveEdgeStatus(c),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const a=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",a);this.textEl_=aa("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});a.appendChild(this.textEl_);return a}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled", |
|
!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_);this.textEl_=null;super.dispose()}}Qj.prototype.controlText_="Seek to live, currently playing live"; |
|
M.registerComponent("SeekToLive",Qj);var So=Object.freeze({__proto__:null,clamp:gc});class ng extends M{constructor(a,b){super(a,b);this.handleMouseDown_=c=>this.handleMouseDown(c);this.handleMouseUp_=c=>this.handleMouseUp(c);this.handleKeyDown_=c=>this.handleKeyDown(c);this.handleClick_=c=>this.handleClick(c);this.handleMouseMove_=c=>this.handleMouseMove(c);this.update_=c=>this.update(c);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(!this.enabled()){this.on("mousedown", |
|
this.handleMouseDown_);this.on("touchstart",this.handleMouseDown_);this.on("keydown",this.handleKeyDown_);this.on("click",this.handleClick_);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent)this.on(this.player_,this.playerEvent,this.update);this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=!0}}disable(){if(this.enabled()){var a=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_);this.off("touchstart",this.handleMouseDown_);this.off("keydown", |
|
this.handleKeyDown_);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}}createEl(a,b={},c={}){b.className+=" vjs-slider";b=Object.assign({tabIndex:0}, |
|
b);c=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},c);return super.createEl(a,b,c)}handleMouseDown(a){const b=this.bar.el_.ownerDocument;"mousedown"===a.type&&a.preventDefault();"touchstart"!==a.type||Bb||a.preventDefault();gi();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, |
|
!0)}handleMouseMove(a){}handleMouseUp(a){a=this.bar.el_.ownerDocument;hi();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()}update(){if(this.el_&&this.bar){var a=this.getProgress();if(a===this.progress_)return a;this.progress_=a;this.requestNamedAnimationFrame("Slider#update",()=>{const b=this.vertical()? |
|
"height":"width";this.bar.el().style[b]=(100*a).toFixed(2)+"%"});return a}}getProgress(){return Number(gc(this.getPercent(),0,1).toFixed(4))}calculateDistance(a){a=Vd(this.el_,a);return this.vertical()?a.y:a.x}handleKeyDown(a){Y.isEventKey(a,"Left")||Y.isEventKey(a,"Down")?(a.preventDefault(),a.stopPropagation(),this.stepBack()):Y.isEventKey(a,"Right")||Y.isEventKey(a,"Up")?(a.preventDefault(),a.stopPropagation(),this.stepForward()):super.handleKeyDown(a)}handleClick(a){a.stopPropagation();a.preventDefault()}vertical(a){if(void 0=== |
|
a)return this.vertical_||!1;(this.vertical_=!!a)?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}M.registerComponent("Slider",ng);class To extends M{constructor(a,b){super(a,b);this.partEls_=[];this.on(a,"progress",c=>this.update(c))}createEl(){const a=super.createEl("div",{className:"vjs-load-progress"}),b=aa("span",{className:"vjs-control-text"}),c=aa("span",{textContent:this.localize("Loaded")}),e=P.createTextNode(": ");this.percentageEl_=aa("span",{className:"vjs-control-text-loaded-percentage", |
|
textContent:"0%"});a.appendChild(b);b.appendChild(c);b.appendChild(e);b.appendChild(this.percentageEl_);return a}dispose(){this.percentageEl_=this.partEls_=null;super.dispose()}update(a){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{var b=this.player_.liveTracker;const c=this.player_.buffered();var e=b&&b.isLive()?b.seekableEnd():this.player_.duration(),g=this.player_.bufferedEnd();b=this.partEls_;e=gc(g/e*100,0,100).toFixed(2)+"%";this.percent_!==e&&(this.el_.style.width=e,Ub(this.percentageEl_, |
|
e),this.percent_=e);for(e=0;e<c.length;e++){const l=c.start(e),p=c.end(e);let t=b[e];t||(t=this.el_.appendChild(aa()),b[e]=t);if(t.dataset.start!==l||t.dataset.end!==p)t.dataset.start=l,t.dataset.end=p,t.style.left=gc(l/g*100,0,100).toFixed(2)+"%",t.style.width=gc((p-l)/g*100,0,100).toFixed(2)+"%"}for(g=b.length;g>c.length;g--)this.el_.removeChild(b[g-1]);b.length=c.length})}}M.registerComponent("LoadProgressBar",To);class Uo extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update), |
|
30)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(a,b,c){const e=ed(this.el_);var g=Cc(this.player_.el());const l=a.width*b;g&&e&&(b=a.left-g.left+l,g=a.width-l+(g.right-a.right),g||(g=a.width-l,b=l),a=e.width/2,b<a?a+=a-b:g<a&&(a=g),0>a?a=0:a>e.width&&(a=e.width),a=Math.round(a),this.el_.style.right=`-${a}px`,this.write(c))}write(a){Ub(this.el_,a)}updateTime(a,b,c,e){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{var g=this.player_.duration(); |
|
if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){g=this.player_.liveTracker.liveWindow();const l=g-b*g;g=(1>l?"":"-")+dc(l,g)}else g=dc(c,g);this.update(a,b,g);e&&e()})}}M.registerComponent("TimeTooltip",Uo);class og extends M{constructor(a,b){super(a,b);this.setIcon("circle");this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(a,b){const c=this.getChild("timeTooltip");if(c){var e= |
|
this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();c.updateTime(a,b,e)}}}og.prototype.options_={children:[]};Qa||Ab||og.prototype.options_.children.push("timeTooltip");M.registerComponent("PlayProgressBar",og);class Rj extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(a,b){const c=b*this.player_.duration();this.getChild("timeTooltip").updateTime(a,b,c,()=> |
|
{this.el_.style.left=`${a.width*b}px`})}}Rj.prototype.options_={children:["timeTooltip"]};M.registerComponent("MouseTimeDisplay",Rj);class pg extends ng{constructor(a,b){super(a,b);this.setEventHandlers_()}setEventHandlers_(){this.update_=na(this,this.update);this.update=Cb(this.update_,30);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker)this.on(this.player_.liveTracker,"liveedgechange",this.update);this.updateInterval=null;this.enableIntervalHandler_= |
|
a=>this.enableInterval_(a);this.disableIntervalHandler_=a=>this.disableInterval_(a);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in P&&"visibilityState"in P)this.on(P,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(a){"hidden"===P.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(a)):(this.player_.ended()|| |
|
this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,30))}disableInterval_(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&a&&"ended"!==a.type||!this.updateInterval||(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(a){if("hidden"!==P.visibilityState){var b= |
|
super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const c=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),e=this.player_.liveTracker;let g=this.player_.duration();e&&e.isLive()&&(g=this.player_.liveTracker.liveCurrentTime());this.percent_!==b&&(this.el_.setAttribute("aria-valuenow",(100*b).toFixed(2)),this.percent_=b);if(this.currentTime_!==c||this.duration_!==g)this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime\x3d{1} duration\x3d{2}", |
|
[dc(c,g),dc(g,g)],"{1} of {2}")),this.currentTime_=c,this.duration_=g;this.bar&&this.bar.update(Cc(this.el()),this.getProgress())});return b}}userSeek_(a){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser();this.player_.currentTime(a)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){var a=this.getCurrentTime_();const b=this.player_.liveTracker;b&&b.isLive()?(a=(a-b.seekableStart())/ |
|
b.liveWindow(),b.atLiveEdge()&&(a=1)):a/=this.player_.duration();return a}handleMouseDown(a){fd(a)&&(a.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(a))}handleMouseMove(a,b=!1){if(fd(a)&&!isNaN(this.player_.duration())){b||this.player_.scrubbing()||this.player_.scrubbing(!0);var c=this.calculateDistance(a);var e=this.player_.liveTracker;if(e&&e.isLive()){if(.99<=c){e.seekToLiveEdge();return}a=e.seekableStart();b=e.liveCurrentTime();c=a+c* |
|
e.liveWindow();c>=b&&(c=b);c<=a&&(c=a+.1);if(Infinity===c)return}else c*=this.player_.duration(),c===this.player_.duration()&&(c-=.1);this.userSeek_(c);this.player_.options_.enableSmoothSeeking&&this.update()}}enable(){super.enable();const a=this.getChild("mouseTimeDisplay");a&&a.show()}disable(){super.disable();const a=this.getChild("mouseTimeDisplay");a&&a.hide()}handleMouseUp(a){super.handleMouseUp(a);a&&a.stopPropagation();this.player_.scrubbing(!1);this.player_.trigger({type:"timeupdate",target:this, |
|
manuallyTriggered:!0});this.videoWasPlaying?yb(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+5)}stepBack(){this.userSeek_(this.player_.currentTime()-5)}handleAction(a){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(a){const b=this.player_.liveTracker;Y.isEventKey(a,"Space")||Y.isEventKey(a,"Enter")?(a.preventDefault(),a.stopPropagation(),this.handleAction(a)):Y.isEventKey(a,"Home")?(a.preventDefault(),a.stopPropagation(), |
|
this.userSeek_(0)):Y.isEventKey(a,"End")?(a.preventDefault(),a.stopPropagation(),b&&b.isLive()?this.userSeek_(b.liveCurrentTime()):this.userSeek_(this.player_.duration())):/^[0-9]$/.test(Y(a))?(a.preventDefault(),a.stopPropagation(),a=10*(Y.codes[Y(a)]-Y.codes["0"])/100,b&&b.isLive()?this.userSeek_(b.seekableStart()+b.liveWindow()*a):this.userSeek_(this.player_.duration()*a)):Y.isEventKey(a,"PgDn")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):Y.isEventKey(a, |
|
"PgUp")?(a.preventDefault(),a.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):super.handleKeyDown(a)}dispose(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],this.update);this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update);this.off(this.player_,["playing"],this.enableIntervalHandler_);this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);"hidden"in P&&"visibilityState"in P&&this.off(P, |
|
"visibilitychange",this.toggleVisibility_);super.dispose()}}pg.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};Qa||Ab||pg.prototype.options_.children.splice(1,0,"mouseTimeDisplay");M.registerComponent("SeekBar",pg);class Sj extends M{constructor(a,b){super(a,b);this.handleMouseMove=Cb(na(this,this.handleMouseMove),30);this.throttledHandleMouseSeek=Cb(na(this,this.handleMouseSeek),30);this.handleMouseUpHandler_=c=>this.handleMouseUp(c);this.handleMouseDownHandler_= |
|
c=>this.handleMouseDown(c);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(a){const b=this.getChild("seekBar");if(b){var c=b.getChild("playProgressBar"),e=b.getChild("mouseTimeDisplay");if(c||e){var g=b.el(),l=ed(g);a=Vd(g,a).x;a=gc(a,0,1);e&&e.update(l,a);c&&c.update(l,b.getProgress())}}}handleMouseSeek(a){const b=this.getChild("seekBar");b&&b.handleMouseMove(a)}enabled(){return this.enabled_}disable(){this.children().forEach(a=> |
|
a.disable&&a.disable());if(this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const a=this.getChild("seekBar");this.player_.scrubbing(!1);a.videoWasPlaying&&yb(this.player_.play())}}enable(){this.children().forEach(a=>a.enable&&a.enable());this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_), |
|
this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseSeek);this.off(a,"touchmove",this.throttledHandleMouseSeek);this.off(a,"mouseup",this.handleMouseUpHandler_);this.off(a,"touchend",this.handleMouseUpHandler_)}handleMouseDown(a){const 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.handleMouseUpHandler_);this.on(b,"touchend",this.handleMouseUpHandler_)}handleMouseUp(a){const b=this.getChild("seekBar");b&&b.handleMouseUp(a);this.removeListenersAddedOnMousedownAndTouchstart()}}Sj.prototype.options_={children:["seekBar"]};M.registerComponent("ProgressControl",Sj);class Tj extends eb{constructor(a,b){super(a,b);this.setIcon("picture-in-picture-enter");this.on(a,["enterpictureinpicture", |
|
"leavepictureinpicture"],c=>this.handlePictureInPictureChange(c));this.on(a,["disablepictureinpicturechanged","loadedmetadata"],c=>this.handlePictureInPictureEnabledChange(c));this.on(a,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange());this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()|| |
|
this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){P.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in D?this.enable():this.disable()}handlePictureInPictureChange(a){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")): |
|
(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture"));this.handlePictureInPictureEnabledChange()}handleClick(a){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"===typeof P.exitPictureInPicture&&super.show()}}Tj.prototype.controlText_="Picture-in-Picture";M.registerComponent("PictureInPictureToggle",Tj);class Uj extends eb{constructor(a,b){super(a,b);this.setIcon("fullscreen-enter");this.on(a, |
|
"fullscreenchange",c=>this.handleFullscreenChange(c));!1===P[a.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(a){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(a){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}Uj.prototype.controlText_="Fullscreen"; |
|
M.registerComponent("FullscreenToggle",Uj);const Vo=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")})};class Wo extends M{createEl(){const a=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",a);a.appendChild(super.createEl("span",{className:"vjs-control-text"}));return a}}M.registerComponent("VolumeLevel",Wo);class Xo extends M{constructor(a, |
|
b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(a,b,c,e){if(!c){c=Cc(this.el_);var g=Cc(this.player_.el());const l=a.width*b;if(!g||!c)return;b=a.left-g.left+l;a=a.width-l+(g.right-a.right);g=c.width/2;b<g?g+=g-b:a<g&&(g=a);0>g?g=0:g>c.width&&(g=c.width);this.el_.style.right=`-${g}px`}this.write(`${e}%`)}write(a){Ub(this.el_,a)}updateVolume(a,b,c,e,g){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume", |
|
()=>{this.update(a,b,c,e.toFixed(0));g&&g()})}}M.registerComponent("VolumeLevelTooltip",Xo);class Vj extends M{constructor(a,b){super(a,b);this.update=Cb(na(this,this.update),30)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(a,b,c){const e=100*b;this.getChild("volumeLevelTooltip").updateVolume(a,b,c,e,()=>{c?this.el_.style.bottom=`${a.height*b}px`:this.el_.style.left=`${a.width*b}px`})}}Vj.prototype.options_={children:["volumeLevelTooltip"]};M.registerComponent("MouseVolumeLevelDisplay", |
|
Vj);class te extends ng{constructor(a,b){super(a,b);this.on("slideractive",c=>this.updateLastVolume_(c));this.on(a,"volumechange",c=>this.updateARIAAttributes(c));a.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(a){fd(a)&&super.handleMouseDown(a)}handleMouseMove(a){const b=this.getChild("mouseVolumeLevelDisplay");if(b){var c=this.el();const e= |
|
Cc(c),g=this.vertical();c=Vd(c,a);c=g?c.y:c.x;c=gc(c,0,1);b.update(e,c,g)}fd(a)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(a)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(a){a=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow", |
|
a);this.el_.setAttribute("aria-valuetext",a+"%")}volumeAsPercentage_(){return Math.round(100*this.player_.volume())}updateLastVolume_(){const a=this.player_.volume();this.one("sliderinactive",()=>{0===this.player_.volume()&&this.player_.lastVolume_(a)})}}te.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};Qa||Ab||te.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");te.prototype.playerEvent="volumechange";M.registerComponent("VolumeBar",te);class Wj extends M{constructor(a, |
|
b={}){b.vertical=b.vertical||!1;if("undefined"===typeof b.volumeBar||zc(b.volumeBar))b.volumeBar=b.volumeBar||{},b.volumeBar.vertical=b.vertical;super(a,b);Vo(this,a);this.throttledHandleMouseMove=Cb(na(this,this.handleMouseMove),30);this.handleMouseUpHandler_=c=>this.handleMouseUp(c);this.on("mousedown",c=>this.handleMouseDown(c));this.on("touchstart",c=>this.handleMouseDown(c));this.on("mousemove",c=>this.handleMouseMove(c));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"); |
|
this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let a="vjs-volume-horizontal";this.options_.vertical&&(a="vjs-volume-vertical");return super.createEl("div",{className:`vjs-volume-control vjs-control ${a}`})}handleMouseDown(a){a=this.el_.ownerDocument;this.on(a,"mousemove",this.throttledHandleMouseMove); |
|
this.on(a,"touchmove",this.throttledHandleMouseMove);this.on(a,"mouseup",this.handleMouseUpHandler_);this.on(a,"touchend",this.handleMouseUpHandler_)}handleMouseUp(a){a=this.el_.ownerDocument;this.off(a,"mousemove",this.throttledHandleMouseMove);this.off(a,"touchmove",this.throttledHandleMouseMove);this.off(a,"mouseup",this.handleMouseUpHandler_);this.off(a,"touchend",this.handleMouseUpHandler_)}handleMouseMove(a){this.volumeBar.handleMouseMove(a)}}Wj.prototype.options_={children:["volumeBar"]};M.registerComponent("VolumeControl", |
|
Wj);const Yo=function(a,b){b.tech_&&!b.tech_.featuresMuteControl&&a.addClass("vjs-hidden");a.on(b,"loadstart",function(){b.tech_.featuresMuteControl?a.removeClass("vjs-hidden"):a.addClass("vjs-hidden")})};class Xj extends eb{constructor(a,b){super(a,b);Yo(this,a);this.on(a,["loadstart","volumechange"],c=>this.update(c))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(a){a=this.player_.volume();const b=this.player_.lastVolume_();0===a?(this.player_.volume(.1>b?.1:b),this.player_.muted(!1)): |
|
this.player_.muted(this.player_.muted()?!1:!0)}update(a){this.updateIcon_();this.updateControlText_()}updateIcon_(){const a=this.player_.volume();let b=3;this.setIcon("volume-high");Qa&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted);0===a||this.player_.muted()?(this.setIcon("volume-mute"),b=0):.33>a?(this.setIcon("volume-low"),b=1):.67>a&&(this.setIcon("volume-medium"),b=2);Td(this.el_,[0,1,2,3].reduce((c,e)=>c+`${e?" ":""}vjs-vol-${e}`,""));cc(this.el_, |
|
`vjs-vol-${b}`)}updateControlText_(){const a=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==a&&this.controlText(a)}}Xj.prototype.controlText_="Mute";M.registerComponent("MuteToggle",Xj);class Yj extends M{constructor(a,b={}){b.inline="undefined"!==typeof b.inline?b.inline:!0;if("undefined"===typeof b.volumeControl||zc(b.volumeControl))b.volumeControl=b.volumeControl||{},b.volumeControl.vertical=!b.inline;super(a,b);this.handleKeyPressHandler_=c=>this.handleKeyPress(c); |
|
this.on(a,["loadstart"],c=>this.volumePanelState_(c));this.on(this.muteToggle,"keyup",c=>this.handleKeyPress(c));this.on(this.volumeControl,"keyup",c=>this.handleVolumeControlKeyUp(c));this.on("keydown",c=>this.handleKeyPress(c));this.on("mouseover",c=>this.handleMouseOver(c));this.on("mouseout",c=>this.handleMouseOut(c));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&& |
|
this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden");this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let a="vjs-volume-panel-horizontal";this.options_.inline||(a="vjs-volume-panel-vertical");return super.createEl("div",{className:`vjs-volume-panel vjs-control ${a}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(a){Y.isEventKey(a,"Esc")&&this.muteToggle.focus()}handleMouseOver(a){this.addClass("vjs-hover"); |
|
ab(P,"keyup",this.handleKeyPressHandler_)}handleMouseOut(a){this.removeClass("vjs-hover");Ma(P,"keyup",this.handleKeyPressHandler_)}handleKeyPress(a){Y.isEventKey(a,"Esc")&&this.handleMouseOut()}}Yj.prototype.options_={children:["muteToggle","volumeControl"]};M.registerComponent("VolumePanel",Yj);class Zj extends eb{constructor(a,b){super(a,b);this.validOptions=[5,10,30];(this.skipTime=this.getSkipForwardTime())&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`), |
|
this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(a.language())])),this.show()):this.hide()}getSkipForwardTime(){const a=this.options_.playerOptions;return a.controlBar&&a.controlBar.skipButtons&&a.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(a){if(!isNaN(this.player_.duration())){a=this.player_.currentTime();var b=this.player_.liveTracker;b=b&&b.isLive()?b.seekableEnd(): |
|
this.player_.duration();this.player_.currentTime(a+this.skipTime<=b?a+this.skipTime:b)}}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Zj.prototype.controlText_="Skip Forward";M.registerComponent("SkipForward",Zj);class ak extends eb{constructor(a,b){super(a,b);this.validOptions=[5,10,30];(this.skipTime=this.getSkipBackwardTime())&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds", |
|
[this.skipTime.toLocaleString(a.language())])),this.show()):this.hide()}getSkipBackwardTime(){const a=this.options_.playerOptions;return a.controlBar&&a.controlBar.skipButtons&&a.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(a){a=this.player_.currentTime();var b=this.player_.liveTracker;b=b&&b.isLive()&&b.seekableStart();this.player_.currentTime(b&&a-this.skipTime<=b?b:a>=this.skipTime?a-this.skipTime:0)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds", |
|
[this.skipTime]))}}ak.prototype.controlText_="Skip Backward";M.registerComponent("SkipBackward",ak);class bk extends M{constructor(a,b){super(a,b);b&&(this.menuButton_=b.menuButton);this.focusedChild_=-1;this.on("keydown",c=>this.handleKeyDown(c));this.boundHandleBlur_=c=>this.handleBlur(c);this.boundHandleTapClick_=c=>this.handleTapClick(c)}addEventListenerForItem(a){a instanceof M&&(this.on(a,"blur",this.boundHandleBlur_),this.on(a,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(a){a instanceof |
|
M&&(this.off(a,"blur",this.boundHandleBlur_),this.off(a,["tap","click"],this.boundHandleTapClick_))}removeChild(a){"string"===typeof a&&(a=this.getChild(a));this.removeEventListenerForItem(a);super.removeChild(a)}addItem(a){(a=this.addChild(a))&&this.addEventListenerForItem(a)}createEl(){this.contentEl_=aa(this.options_.contentElType||"ul",{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const a=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});a.appendChild(this.contentEl_); |
|
ab(a,"click",function(b){b.preventDefault();b.stopImmediatePropagation()});return a}dispose(){this.boundHandleTapClick_=this.boundHandleBlur_=this.contentEl_=null;super.dispose()}handleBlur(a){const b=a.relatedTarget||P.activeElement;this.children().some(c=>c.el()===b)||(a=this.menuButton_)&&a.buttonPressed_&&b!==a.el().firstChild&&a.unpressButton()}handleTapClick(a){if(this.menuButton_){this.menuButton_.unpressButton();var b=this.children();Array.isArray(b)&&(b=b.filter(c=>c.el()===a.target)[0])&& |
|
"CaptionSettingsMenuItem"!==b.name()&&this.menuButton_.focus()}}handleKeyDown(a){if(Y.isEventKey(a,"Left")||Y.isEventKey(a,"Down"))a.preventDefault(),a.stopPropagation(),this.stepForward();else if(Y.isEventKey(a,"Right")||Y.isEventKey(a,"Up"))a.preventDefault(),a.stopPropagation(),this.stepBack()}stepForward(){let a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_+1);this.focus(a)}stepBack(){let a=0;void 0!==this.focusedChild_&&(a=this.focusedChild_-1);this.focus(a)}focus(a=0){const b=this.children().slice(); |
|
b.length&&b[0].hasClass("vjs-menu-title")&&b.shift();0<b.length&&(0>a?a=0:a>=b.length&&(a=b.length-1),this.focusedChild_=a,b[a].el_.focus())}}M.registerComponent("Menu",bk);class qg extends M{constructor(a,b={}){super(a,b);this.menuButton_=new eb(a,b);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");a=eb.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+a;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_); |
|
this.update();this.enabled_=!0;a=c=>this.handleClick(c);this.handleMenuKeyUp_=c=>this.handleMenuKeyUp(c);this.on(this.menuButton_,"tap",a);this.on(this.menuButton_,"click",a);this.on(this.menuButton_,"keydown",c=>this.handleKeyDown(c));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();ab(P,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",c=>this.handleMouseLeave(c));this.on("keydown",c=>this.handleSubmenuKeyDown(c))}update(){const 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.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const a=new bk(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){var b=aa("li",{className:"vjs-menu-title",textContent:wa(this.options_.title), |
|
tabIndex:-1});b=new M(this.player_,{el:b});a.addItem(b)}if(this.items=this.createItems())for(b=0;b<this.items.length;b++)a.addItem(this.items[b]);return a}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(a){super.setIcon(a,this.menuButton_.el_)}buildWrapperCSSClass(){let a="vjs-menu-button";a=!0===this.options_.inline?a+"-inline":a+"-popup";const b=eb.prototype.buildCSSClass();return`vjs-menu-button ${a} ${b} ${super.buildCSSClass()}`}buildCSSClass(){let a= |
|
"vjs-menu-button";a=!0===this.options_.inline?a+"-inline":a+"-popup";return`vjs-menu-button ${a} ${super.buildCSSClass()}`}controlText(a,b=this.menuButton_.el()){return this.menuButton_.controlText(a,b)}dispose(){this.handleMouseLeave();super.dispose()}handleClick(a){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(a){this.removeClass("vjs-hover");Ma(P,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(a){Y.isEventKey(a, |
|
"Esc")||Y.isEventKey(a,"Tab")?(this.buttonPressed_&&this.unpressButton(),Y.isEventKey(a,"Tab")||(a.preventDefault(),this.menuButton_.focus())):!Y.isEventKey(a,"Up")&&!Y.isEventKey(a,"Down")||this.buttonPressed_||(a.preventDefault(),this.pressButton())}handleMenuKeyUp(a){(Y.isEventKey(a,"Esc")||Y.isEventKey(a,"Tab"))&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(a){this.handleSubmenuKeyDown(a)}handleSubmenuKeyDown(a){if(Y.isEventKey(a,"Esc")||Y.isEventKey(a,"Tab"))this.buttonPressed_&&this.unpressButton(), |
|
Y.isEventKey(a,"Tab")||(a.preventDefault(),this.menuButton_.focus())}pressButton(){this.enabled_&&(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Qa&&ci()||this.menu.focus())}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton();this.enabled_=!1;this.addClass("vjs-disabled");this.menuButton_.disable()}enable(){this.enabled_= |
|
!0;this.removeClass("vjs-disabled");this.menuButton_.enable()}}M.registerComponent("MenuButton",qg);class rg extends qg{constructor(a,b){const c=b.tracks;super(a,b);1>=this.items.length&&this.hide();if(c){var e=na(this,this.update);c.addEventListener("removetrack",e);c.addEventListener("addtrack",e);c.addEventListener("labelchange",e);this.player_.on("ready",e);this.player_.on("dispose",function(){c.removeEventListener("removetrack",e);c.removeEventListener("addtrack",e);c.removeEventListener("labelchange", |
|
e)})}}}M.registerComponent("TrackButton",rg);const Zo="Tab Esc Up Down Right Left".split(" ");class pd extends se{constructor(a,b){super(a,b);this.selectable=b.selectable;this.isSelected_=b.selected||!1;this.multiSelectable=b.multiSelectable;this.selected(this.isSelected_);this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(a,b,c){this.nonIconControl=!0;a=super.createEl("li", |
|
Object.assign({className:"vjs-menu-item",tabIndex:-1},b),c);b=aa("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});this.player_.options_.experimentalSvgIcons?a.appendChild(b):a.replaceChild(b,a.querySelector(".vjs-icon-placeholder"));return a}handleKeyDown(a){Zo.some(b=>Y.isEventKey(a,b))||super.handleKeyDown(a)}handleClick(a){this.selected(!0)}selected(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))}}M.registerComponent("MenuItem",pd);class qd extends pd{constructor(a,b){const c=b.track,e=a.textTracks();b.label=c.label||c.language||"Unknown";b.selected="showing"===c.mode;super(a,b);this.track=c;this.kinds=(b.kinds||[b.kind||this.track.kind]).filter(Boolean);const g=(...p)=>{this.handleTracksChange.apply(this,p)},l=(...p)=>{this.handleSelectedLanguageChange.apply(this, |
|
p)};a.on(["loadstart","texttrackchange"],g);e.addEventListener("change",g);e.addEventListener("selectedlanguagechange",l);this.on("dispose",function(){a.off(["loadstart","texttrackchange"],g);e.removeEventListener("change",g);e.removeEventListener("selectedlanguagechange",l)});if(void 0===e.onchange){let p;this.on(["tap","click"],function(){if("object"!==typeof D.Event)try{p=new D.Event("change")}catch(t){}p||(p=P.createEvent("Event"),p.initEvent("change",!0,!0));e.dispatchEvent(p)})}this.handleTracksChange()}handleClick(a){const b= |
|
this.track,c=this.player_.textTracks();super.handleClick(a);if(c)for(a=0;a<c.length;a++){const e=c[a];-1!==this.kinds.indexOf(e.kind)&&(e===b?"showing"!==e.mode&&(e.mode="showing"):"disabled"!==e.mode&&(e.mode="disabled"))}}handleTracksChange(a){a="showing"===this.track.mode;a!==this.isSelected_&&this.selected(a)}handleSelectedLanguageChange(a){"showing"===this.track.mode&&(a=this.player_.cache_.selectedLanguage,a&&a.enabled&&a.language===this.track.language&&a.kind!==this.track.kind||(this.player_.cache_.selectedLanguage= |
|
{enabled:!0,language:this.track.language,kind:this.track.kind}))}dispose(){this.track=null;super.dispose()}}M.registerComponent("TextTrackMenuItem",qd);class ck extends qd{constructor(a,b){b.track={player:a,kind:b.kind,kinds:b.kinds,default:!1,mode:"disabled"};b.kinds||(b.kinds=[b.kind]);b.track.label=b.label?b.label:b.kinds.join(" and ")+" off";b.selectable=!0;b.multiSelectable=!1;super(a,b)}handleTracksChange(a){a=this.player().textTracks();let b=!0;for(let c=0,e=a.length;c<e;c++){const g=a[c]; |
|
if(-1<this.options_.kinds.indexOf(g.kind)&&"showing"===g.mode){b=!1;break}}b!==this.isSelected_&&this.selected(b)}handleSelectedLanguageChange(a){a=this.player().textTracks();let b=!0;for(let c=0,e=a.length;c<e;c++){const g=a[c];if(-1<["captions","descriptions","subtitles"].indexOf(g.kind)&&"showing"===g.mode){b=!1;break}}b&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}} |
|
M.registerComponent("OffTextTrackMenuItem",ck);class Oc extends rg{constructor(a,b={}){b.tracks=a.textTracks();super(a,b)}createItems(a=[],b=qd){var c;this.label_&&(c=`${this.label_} off`);a.push(new ck(this.player_,{kinds:this.kinds_,kind:this.kind_,label:c}));this.hideThreshold_+=1;c=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let e=0;e<c.length;e++){const g=c[e];if(-1<this.kinds_.indexOf(g.kind)){const l=new b(this.player_,{track:g,kinds:this.kinds_,kind:this.kind_, |
|
selectable:!0,multiSelectable:!1});l.addClass(`vjs-${g.kind}-menu-item`);a.push(l)}}return a}}M.registerComponent("TextTrackButton",Oc);class dk extends pd{constructor(a,b){const c=b.track,e=b.cue,g=a.currentTime();b.selectable=!0;b.multiSelectable=!1;b.label=e.text;b.selected=e.startTime<=g&&g<e.endTime;super(a,b);this.track=c;this.cue=e}handleClick(a){super.handleClick();this.player_.currentTime(this.cue.startTime)}}M.registerComponent("ChaptersTrackMenuItem",dk);class sg extends Oc{constructor(a, |
|
b,c){super(a,b,c);this.setIcon("chapters");this.selectCurrentItem_=()=>{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(a){a&&a.track&&"chapters"!==a.track.kind||(a=this.findChaptersTrack(),a!==this.track_?(this.setTrack(a),super.update()):(!this.items||a&&a.cues&&a.cues.length!==this.items.length)&&super.update())}setTrack(a){if(this.track_!== |
|
a){this.updateHandler_||(this.updateHandler_=this.update.bind(this));if(this.track_){const b=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);b&&b.removeEventListener("load",this.updateHandler_);this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}if(this.track_=a)this.track_.mode="hidden",(a=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_))&&a.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange", |
|
this.selectCurrentItem_)}}findChaptersTrack(){const a=this.player_.textTracks()||[];for(let b=a.length-1;0<=b;b--){const c=a[b];if(c.kind===this.kind_)return c}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(wa(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const a=[];if(!this.track_)return a;const b=this.track_.cues;if(!b)return a;for(let c=0,e=b.length;c<e;c++){const g=new dk(this.player_,{track:this.track_, |
|
cue:b[c]});a.push(g)}return a}}sg.prototype.kind_="chapters";sg.prototype.controlText_="Chapters";M.registerComponent("ChaptersButton",sg);class tg extends Oc{constructor(a,b,c){super(a,b,c);this.setIcon("audio-description");const e=a.textTracks(),g=na(this,this.handleTracksChange);e.addEventListener("change",g);this.on("dispose",function(){e.removeEventListener("change",g)})}handleTracksChange(a){a=this.player().textTracks();let b=!1;for(let c=0,e=a.length;c<e;c++){const g=a[c];if(g.kind!==this.kind_&& |
|
"showing"===g.mode){b=!0;break}}b?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}tg.prototype.kind_="descriptions";tg.prototype.controlText_="Descriptions";M.registerComponent("DescriptionsButton",tg);class ug extends Oc{constructor(a,b,c){super(a,b,c);this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}} |
|
ug.prototype.kind_="subtitles";ug.prototype.controlText_="Subtitles";M.registerComponent("SubtitlesButton",ug);class vg extends qd{constructor(a,b){b.track={player:a,kind:b.kind,label:b.kind+" settings",selectable:!1,default:!1,mode:"disabled"};b.selectable=!1;b.name="CaptionSettingsMenuItem";super(a,b);this.addClass("vjs-texttrack-settings");this.controlText(", opens "+b.kind+" settings dialog")}handleClick(a){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent= |
|
this.player_.localize(this.options_.kind+" settings");super.handleLanguagechange()}}M.registerComponent("CaptionSettingsMenuItem",vg);class wg extends Oc{constructor(a,b,c){super(a,b,c);this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const a=[];this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")|| |
|
(a.push(new vg(this.player_,{kind:this.kind_})),this.hideThreshold_+=1);return super.createItems(a)}}wg.prototype.kind_="captions";wg.prototype.controlText_="Captions";M.registerComponent("CaptionsButton",wg);class ek extends qd{createEl(a,b,c){a=super.createEl(a,b,c);b=a.querySelector(".vjs-menu-item-text");"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",a):b.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),b.appendChild(aa("span", |
|
{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`})));return a}}M.registerComponent("SubsCapsMenuItem",ek);class xg extends Oc{constructor(a,b={}){super(a,b);this.label_="subtitles";this.setIcon("subtitles");-1<["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)&&(this.label_="captions",this.setIcon("captions"));this.menuButton_.controlText(wa(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let a= |
|
[];this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(a.push(new vg(this.player_,{kind:this.label_})),this.hideThreshold_+=1);return a=super.createItems(a,ek)}}xg.prototype.kinds_=["captions","subtitles"];xg.prototype.controlText_="Subtitles";M.registerComponent("SubsCapsButton",xg);class fk extends pd{constructor(a,b){const c=b.track,e=a.audioTracks();b.label=c.label||c.language||"Unknown";b.selected=c.enabled;super(a,b);this.track=c; |
|
this.addClass(`vjs-${c.kind}-menu-item`);const g=(...l)=>{this.handleTracksChange.apply(this,l)};e.addEventListener("change",g);this.on("dispose",()=>{e.removeEventListener("change",g)})}createEl(a,b,c){a=super.createEl(a,b,c);b=a.querySelector(".vjs-menu-item-text");0<=["main-desc","description"].indexOf(this.options_.track.kind)&&(b.appendChild(aa("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),b.appendChild(aa("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))); |
|
return a}handleClick(a){super.handleClick(a);this.track.enabled=!0;if(this.player_.tech_.featuresNativeAudioTracks){a=this.player_.audioTracks();for(let b=0;b<a.length;b++){const c=a[b];c!==this.track&&(c.enabled=c===this.track)}}}handleTracksChange(a){this.selected(this.track.enabled)}}M.registerComponent("AudioTrackMenuItem",fk);class gk extends rg{constructor(a,b={}){b.tracks=a.audioTracks();super(a,b);this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(a= |
|
[]){this.hideThreshold_=1;const b=this.player_.audioTracks();for(let c=0;c<b.length;c++)a.push(new fk(this.player_,{track:b[c],selectable:!0,multiSelectable:!1}));return a}}gk.prototype.controlText_="Audio Track";M.registerComponent("AudioTrackButton",gk);class yg extends pd{constructor(a,b){const c=b.rate,e=parseFloat(c,10);b.label=c;b.selected=e===a.playbackRate();b.selectable=!0;b.multiSelectable=!1;super(a,b);this.label=c;this.rate=e;this.on(a,"ratechange",g=>this.update(g))}handleClick(a){super.handleClick(); |
|
this.player().playbackRate(this.rate)}update(a){this.selected(this.player().playbackRate()===this.rate)}}yg.prototype.contentElType="button";M.registerComponent("PlaybackRateMenuItem",yg);class hk extends qg{constructor(a,b){super(a,b);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(a,"loadstart",c=>this.updateVisibility(c));this.on(a,"ratechange",c=>this.updateLabel(c));this.on(a,"playbackrateschange",c=>this.handlePlaybackRateschange(c))}createEl(){const a= |
|
super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=aa("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});a.appendChild(this.labelEl_);return a}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const a=this.playbackRates(),b=[];for(let c=a.length-1;0<=c;c--)b.push(new yg(this.player(), |
|
{rate:a[c]+"x"}));return b}handlePlaybackRateschange(a){this.update()}playbackRates(){const a=this.player();return a.playbackRates&&a.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&0<this.playbackRates().length}updateVisibility(a){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(a){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+ |
|
"x")}}hk.prototype.controlText_="Playback Rate";M.registerComponent("PlaybackRateMenuButton",hk);class ik extends M{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(a="div",b={},c={}){b.className||(b.className=this.buildCSSClass());return super.createEl(a,b,c)}}M.registerComponent("Spacer",ik);class $o extends ik{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\u00a0"})}} |
|
M.registerComponent("CustomControlSpacer",$o);class jk extends M{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}jk.prototype.options_={children:"playToggle skipBackward skipForward volumePanel currentTimeDisplay timeDivider durationDisplay progressControl liveDisplay seekToLive remainingTimeDisplay customControlSpacer playbackRateMenuButton chaptersButton descriptionsButton subsCapsButton audioTrackButton pictureInPictureToggle fullscreenToggle".split(" ")};M.registerComponent("ControlBar", |
|
jk);class kk extends Kc{constructor(a,b){super(a,b);this.on(a,"error",c=>{this.open(c)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const a=this.player().error();return a?this.localize(a.message):""}}kk.prototype.options_=Object.assign({},Kc.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});M.registerComponent("ErrorDisplay",kk);const lk=["#000","Black"],mk=["#00F","Blue"],nk=["#0FF","Cyan"],ok=["#0F0","Green"],pk=["#F0F","Magenta"],qk= |
|
["#F00","Red"],rk=["#FFF","White"],sk=["#FF0","Yellow"],zg=["1","Opaque"],Ag=["0.5","Semi-Transparent"],tk=["0","Transparent"],kc={backgroundColor:{selector:".vjs-bg-color \x3e select",id:"captions-background-color-%s",label:"Color",options:[lk,rk,qk,ok,mk,sk,pk,nk]},backgroundOpacity:{selector:".vjs-bg-opacity \x3e select",id:"captions-background-opacity-%s",label:"Opacity",options:[zg,Ag,tk]},color:{selector:".vjs-text-color \x3e select",id:"captions-foreground-color-%s",label:"Color",options:[rk, |
|
lk,qk,ok,mk,sk,pk,nk]},edgeStyle:{selector:".vjs-edge-style \x3e select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family \x3e 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 \x3e 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:a=>"1.00"===a?null:Number(a)},textOpacity:{selector:".vjs-text-opacity \x3e select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[zg,Ag]},windowColor:{selector:".vjs-window-color \x3e select", |
|
id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity \x3e select",id:"captions-window-opacity-%s",label:"Opacity",options:[tk,Ag,zg]}};kc.windowColor.options=kc.backgroundColor.options;class ap extends Kc{constructor(a,b){b.temporary=!1;super(a,b);this.updateDisplay=this.updateDisplay.bind(this);this.fill();this.hasBeenOpened_=this.hasBeenFilled_=!0;this.endDialog=aa("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")});this.el().appendChild(this.endDialog); |
|
this.setDefaults();void 0===b.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings);this.on(this.$(".vjs-done-button"),"click",()=>{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults();this.updateDisplay()});yc(kc,c=>{this.on(this.$(c.selector),"change",this.updateDisplay)});this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null;super.dispose()}createElSelect_(a, |
|
b="",c="label"){a=kc[a];const e=a.id.replace("%s",this.id_),g=[b,e].join(" ").trim();b=`vjs_select_${pb++}`;return[`<${c} id="${e}"${"label"===c?` for="${b}" class="vjs-label"`:""}>`,this.localize(a.label),`</${c}>`,`<select aria-labelledby="${g}" id="${b}">`].concat(a.options.map(l=>{const p=e+"-"+l[1].replace(/\W+/g,"");return[`<option id="${p}" value="${l[0]}" `,`aria-labelledby="${g} ${p}">`,this.localize(l[1]),"\x3c/option\x3e"].join("")})).concat("\x3c/select\x3e").join("")}createElFgColor_(){const a= |
|
`captions-text-legend-${this.id_}`;return['\x3cfieldset class\x3d"vjs-fg vjs-track-setting"\x3e',`<legend id="${a}">`,this.localize("Text"),'\x3c/legend\x3e\x3cspan class\x3d"vjs-text-color"\x3e',this.createElSelect_("color",a),'\x3c/span\x3e\x3cspan class\x3d"vjs-text-opacity vjs-opacity"\x3e',this.createElSelect_("textOpacity",a),"\x3c/span\x3e\x3c/fieldset\x3e"].join("")}createElBgColor_(){const a=`captions-background-${this.id_}`;return['\x3cfieldset class\x3d"vjs-bg vjs-track-setting"\x3e',`<legend id="${a}">`, |
|
this.localize("Text Background"),'\x3c/legend\x3e\x3cspan class\x3d"vjs-bg-color"\x3e',this.createElSelect_("backgroundColor",a),'\x3c/span\x3e\x3cspan class\x3d"vjs-bg-opacity vjs-opacity"\x3e',this.createElSelect_("backgroundOpacity",a),"\x3c/span\x3e\x3c/fieldset\x3e"].join("")}createElWinColor_(){const a=`captions-window-${this.id_}`;return['\x3cfieldset class\x3d"vjs-window vjs-track-setting"\x3e',`<legend id="${a}">`,this.localize("Caption Area Background"),'\x3c/legend\x3e\x3cspan class\x3d"vjs-window-color"\x3e', |
|
this.createElSelect_("windowColor",a),'\x3c/span\x3e\x3cspan class\x3d"vjs-window-opacity vjs-opacity"\x3e',this.createElSelect_("windowOpacity",a),"\x3c/span\x3e\x3c/fieldset\x3e"].join("")}createElColors_(){return aa("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return aa("div",{className:"vjs-track-settings-font",innerHTML:['\x3cfieldset class\x3d"vjs-font-percent vjs-track-setting"\x3e', |
|
this.createElSelect_("fontPercent","","legend"),'\x3c/fieldset\x3e\x3cfieldset class\x3d"vjs-edge-style vjs-track-setting"\x3e',this.createElSelect_("edgeStyle","","legend"),'\x3c/fieldset\x3e\x3cfieldset class\x3d"vjs-font-family vjs-track-setting"\x3e',this.createElSelect_("fontFamily","","legend"),"\x3c/fieldset\x3e"].join("")})}createElControls_(){const a=this.localize("restore all settings to the default values");return aa("div",{className:"vjs-track-settings-controls",innerHTML:[`<button type="button" class="vjs-default-button" title="${a}">`, |
|
this.localize("Reset"),`<span class="vjs-control-text"> ${a}</span>`,"\x3c/button\x3e",`<button type="button" class="vjs-done-button">${this.localize("Done")}</button>`].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return ai(kc, |
|
(a,b,c)=>{var e=this.$(b.selector);b=wi(e.options[e.options.selectedIndex].value,b.parser);void 0!==b&&(a[c]=b);return a},{})}setValues(a){yc(kc,(b,c)=>{var e=this.$(b.selector);c=a[c];b=b.parser;if(c)for(let g=0;g<e.options.length;g++)if(wi(e.options[g].value,b)===c){e.selectedIndex=g;break}})}setDefaults(){yc(kc,a=>{const b=a.hasOwnProperty("default")?a.default:0;this.$(a.selector).selectedIndex=b})}restoreSettings(){let a;try{a=JSON.parse(D.localStorage.getItem("vjs-text-track-settings"))}catch(b){da.warn(b)}a&& |
|
this.setValues(a)}saveSettings(){if(this.options_.persistTextTrackSettings){var a=this.getValues();try{Object.keys(a).length?D.localStorage.setItem("vjs-text-track-settings",JSON.stringify(a)):D.localStorage.removeItem("vjs-text-track-settings")}catch(b){da.warn(b)}}}updateDisplay(){const a=this.player_.getChild("textTrackDisplay");a&&a.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;var a=this.player_.controlBar;const b=a&&a.subsCapsButton;a=a&&a.captionsButton;b?b.focus():a&&a.focus()}handleLanguagechange(){this.fill()}} |
|
M.registerComponent("TextTrackSettings",ap);class bp extends M{constructor(a,b){let c=b.ResizeObserver||D.ResizeObserver;null===b.ResizeObserver&&(c=!1);const e=ma({createEl:!c,reportTouchActivity:!1},b);super(a,e);this.ResizeObserver=b.ResizeObserver||D.ResizeObserver;this.resizeObserver_=this.loadListener_=null;this.debouncedHandler_=Aj(()=>{this.resizeHandler()},100,!1,this);c?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(a.el())):(this.loadListener_= |
|
()=>{if(this.el_&&this.el_.contentWindow){var g=this.debouncedHandler_,l=this.unloadListener_=function(){Ma(this,"resize",g);Ma(this,"unload",l);l=null};ab(this.el_.contentWindow,"unload",l);ab(this.el_.contentWindow,"resize",g)}},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&& |
|
this.debouncedHandler_.cancel();this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect());this.loadListener_&&this.off("load",this.loadListener_);this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow);this.loadListener_=this.debouncedHandler_=this.resizeObserver=this.ResizeObserver=null;super.dispose()}}M.registerComponent("ResizeManager",bp);const cp={trackingThreshold:20,liveTolerance:15}; |
|
class dp extends M{constructor(a,b){b=ma(cp,b,{createEl:!1});super(a,b);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=c=>this.handlePlay(c);this.handleFirstTimeupdate_=c=>this.handleFirstTimeupdate(c);this.handleSeeked_=c=>this.handleSeeked(c);this.seekToLiveEdge_=c=>this.seekToLiveEdge(c);this.reset_();this.on(this.player_,"durationchange",c=>this.handleDurationchange(c));this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){var a=this.player_.seekable();if(a&&a.length){a= |
|
Number(D.performance.now().toFixed(4));var b=-1===this.lastTime_?0:(a-this.lastTime_)/1E3;this.lastTime_=a;this.pastSeekEnd_=this.pastSeekEnd()+b;a=this.liveCurrentTime();b=this.player_.currentTime();b=this.player_.paused()||this.seekedBehindLive_||Math.abs(a-b)>this.options_.liveTolerance;this.timeupdateSeen_&&Infinity!==a||(b=!1);b!==this.behindLiveEdge_&&(this.behindLiveEdge_=b,this.trigger("liveedgechange"))}}handleDurationchange(){this.toggleTracking()}toggleTracking(){Infinity===this.player_.duration()&& |
|
this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){if(!this.isTracking())if(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,30),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_)this.on(this.player_, |
|
"seeked",this.handleSeeked_);else this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}handleFirstTimeupdate(){this.timeupdateSeen_=!0;this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const a=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&2<a;this.nextSeekedFromUser_=!1;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_= |
|
-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=!0;this.nextSeekedFromUser_=this.seekedBehindLive_=this.timeupdateSeen_=!1;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.off(this.player_,["play","pause"],this.trackLiveHandler_);this.off(this.player_,"seeked",this.handleSeeked_);this.off(this.player_,"play",this.handlePlay_);this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_);this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_= |
|
!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const a=this.player_.seekable(),b=[];let c=a?a.length:0;for(;c--;)b.push(a.end(c));return b.length?b.sort()[b.length-1]:Infinity}seekableStart(){const a=this.player_.seekable(),b=[];let c=a?a.length:0;for(;c--;)b.push(a.start(c));return b.length?b.sort()[0]:0}liveWindow(){const a=this.liveCurrentTime();return Infinity===a?0:a-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+ |
|
this.seekableEnd()}pastSeekEnd(){const a=this.seekableEnd();-1!==this.lastSeekEnd_&&a!==this.lastSeekEnd_&&(this.pastSeekEnd_=0);this.lastSeekEnd_=a;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"===typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1;this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking();super.dispose()}}M.registerComponent("LiveTracker", |
|
dp);class ep extends M{constructor(a,b){super(a,b);this.on("statechanged",c=>this.updateDom_());this.updateDom_()}createEl(){this.els={title:aa("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${pb++}`}),description:aa("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${pb++}`})};return aa("div",{className:"vjs-title-bar"},{},bi(this.els))}updateDom_(){const a=this.player_.tech_,b=a&&a.el_,c={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=> |
|
{const g=this.state[e],l=this.els[e];e=c[e];Wd(l);g&&Ub(l,g);b&&(b.removeAttribute(e),g&&b.setAttribute(e,l.id))});this.state.title||this.state.description?this.show():this.hide()}update(a){this.setState(a)}dispose(){var a=this.player_.tech_;if(a=a&&a.el_)a.removeAttribute("aria-labelledby"),a.removeAttribute("aria-describedby");super.dispose();this.els=null}}M.registerComponent("TitleBar",ep);const Bg=a=>{var b=a.el();if(b.hasAttribute("src"))return a.triggerSourceset(b.src),!0;b=a.$$("source"); |
|
const c=[];let e="";if(!b.length)return!1;for(let g=0;g<b.length;g++){const l=b[g].src;l&&-1===c.indexOf(l)&&c.push(l)}if(!c.length)return!1;1===c.length&&(e=c[0]);a.triggerSourceset(e);return!0},fp=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(a){const b=P.createElement(this.nodeName.toLowerCase());b.innerHTML=a;for(a=P.createDocumentFragment();b.childNodes.length;)a.appendChild(b.childNodes[0]);this.innerText="";D.Element.prototype.appendChild.call(this,a); |
|
return this.innerHTML}}),uk=(a,b)=>{let c={};for(let e=0;e<a.length&&!((c=Object.getOwnPropertyDescriptor(a[e],b))&&c.set&&c.get);e++);c.enumerable=!0;c.configurable=!0;return c},vk=function(a){const b=a.el();if(!b.resetSourceWatch_){var c={},e=uk([a.el(),D.HTMLMediaElement.prototype,D.Element.prototype,fp],"innerHTML"),g=l=>(...p)=>{p=l.apply(b,p);Bg(a);return p};["append","appendChild","insertAdjacentHTML"].forEach(l=>{b[l]&&(c[l]=b[l],b[l]=g(c[l]))});Object.defineProperty(b,"innerHTML",ma(e,{set:g(e.set)})); |
|
b.resetSourceWatch_=()=>{b.resetSourceWatch_=null;Object.keys(c).forEach(l=>{b[l]=c[l]});Object.defineProperty(b,"innerHTML",e)};a.one("sourceset",b.resetSourceWatch_)}},gp=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Hj(D.Element.prototype.getAttribute.call(this,"src")):""},set(a){D.Element.prototype.setAttribute.call(this,"src",a);return a}}),hp=function(a){if(a.featuresSourceset){var b=a.el();if(!b.resetSourceset_){var c=uk([a.el(),D.HTMLMediaElement.prototype,gp],"src"), |
|
e=b.setAttribute,g=b.load;Object.defineProperty(b,"src",ma(c,{set:l=>{l=c.set.call(b,l);a.triggerSourceset(b.src);return l}}));b.setAttribute=(l,p)=>{p=e.call(b,l,p);/src/i.test(l)&&a.triggerSourceset(b.src);return p};b.load=()=>{const l=g.call(b);Bg(a)||(a.triggerSourceset(""),vk(a));return l};b.currentSrc?a.triggerSourceset(b.currentSrc):Bg(a)||vk(a);b.resetSourceset_=()=>{b.resetSourceset_=null;b.load=g;b.setAttribute=e;Object.defineProperty(b,"src",c);b.resetSourceWatch_&&b.resetSourceWatch_()}}}}; |
|
class R extends Z{constructor(a,b){super(a,b);var c=a.source;b=!1;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName;c&&(this.el_.currentSrc!==c.src||a.tag&&3===a.tag.initNetworkState_)?this.setSource(c):this.handleLateInit_(this.el_);a.enableSourceset&&this.setupSourcesetHandling_();this.isScrubbing_=!1;if(this.el_.hasChildNodes()){var e=this.el_.childNodes;let g=e.length;for(c=[];g--;){const l=e[g];"track"===l.nodeName.toLowerCase()&&(this.featuresNativeTextTracks? |
|
(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),b||this.el_.hasAttribute("crossorigin")||!re(l.src)||(b=!0)):c.push(l))}for(e=0;e<c.length;e++)this.el_.removeChild(c[e])}this.proxyNativeTracks_();this.featuresNativeTextTracks&&b&&da.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading.");this.restoreMetadataTracksInIOSNativePlayer_();(md|| |
|
le)&&!0===a.nativeControlsForTouch&&this.setControls(!0);this.proxyWebkitFullscreen_();this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_();R.disposeMediaElement(this.el_);this.options_=null;super.dispose()}setupSourcesetHandling_(){hp(this)}restoreMetadataTracksInIOSNativePlayer_(){const a=this.textTracks();let b;const c=()=>{b=[];for(let g=0;g<a.length;g++){const l=a[g];"metadata"===l.kind&&b.push({track:l,storedMode:l.mode})}};c();a.addEventListener("change", |
|
c);this.on("dispose",()=>a.removeEventListener("change",c));const e=()=>{for(let g=0;g<b.length;g++){const l=b[g];"disabled"===l.track.mode&&l.track.mode!==l.storedMode&&(l.track.mode=l.storedMode)}a.removeEventListener("change",e)};this.on("webkitbeginfullscreen",()=>{a.removeEventListener("change",c);a.removeEventListener("change",e);a.addEventListener("change",e)});this.on("webkitendfullscreen",()=>{a.removeEventListener("change",c);a.addEventListener("change",c);a.removeEventListener("change", |
|
e)})}overrideNative_(a,b){if(b===this[`featuresNative${a}Tracks`]){var c=a.toLowerCase();this[`${c}TracksListeners_`]&&Object.keys(this[`${c}TracksListeners_`]).forEach(e=>{this.el()[`${c}Tracks`].removeEventListener(e,this[`${c}TracksListeners_`][e])});this[`featuresNative${a}Tracks`]=!b;this[`${c}TracksListeners_`]=null;this.proxyNativeTracksForType_(c)}}overrideNativeAudioTracks(a){this.overrideNative_("Audio",a)}overrideNativeVideoTracks(a){this.overrideNative_("Video",a)}proxyNativeTracksForType_(a){const b= |
|
lb[a],c=this.el()[b.getterName],e=this[b.getterName]();if(this[`featuresNative${b.capitalName}Tracks`]&&c&&c.addEventListener){var g={change:p=>{p={type:"change",target:e,currentTarget:e,srcElement:e};e.trigger(p);"text"===a&&this[Mc.remoteText.getterName]().trigger(p)},addtrack(p){e.addTrack(p.track)},removetrack(p){e.removeTrack(p.track)}},l=function(){const p=[];for(let t=0;t<e.length;t++){let x=!1;for(let y=0;y<c.length;y++)if(c[y]===e[t]){x=!0;break}x||p.push(e[t])}for(;p.length;)e.removeTrack(p.shift())}; |
|
this[b.getterName+"Listeners_"]=g;Object.keys(g).forEach(p=>{const t=g[p];c.addEventListener(p,t);this.on("dispose",x=>c.removeEventListener(p,t))});this.on("loadstart",l);this.on("dispose",p=>this.off("loadstart",l))}}proxyNativeTracks_(){lb.names.forEach(a=>{this.proxyNativeTracksForType_(a)})}createEl(){let a=this.options_.tag;if(!a||!this.options_.playerElIngest&&!this.movingMediaElementInDOM){if(a){var b=a.cloneNode(!0);a.parentNode&&a.parentNode.insertBefore(b,a);R.disposeMediaElement(a);a= |
|
b}else a=P.createElement("video"),b=this.options_.tag&&Vb(this.options_.tag),b=ma({},b),md&&!0===this.options_.nativeControlsForTouch||delete b.controls,fi(a,Object.assign(b,{id:this.options_.techId,class:"vjs-tech"}));a.playerId=this.options_.playerId}"undefined"!==typeof this.options_.preload&&a.setAttribute("preload",this.options_.preload);void 0!==this.options_.disablePictureInPicture&&(a.disablePictureInPicture=this.options_.disablePictureInPicture);b=["loop","muted","playsinline","autoplay"]; |
|
for(let c=0;c<b.length;c++){const e=b[c],g=this.options_[e];"undefined"!==typeof g&&(g?a.setAttribute(e,e):a.removeAttribute(e),a[e]=g)}return a}handleLateInit_(a){if(0!==a.networkState&&3!==a.networkState)if(0===a.readyState){let c=!1;const e=function(){c=!0};this.on("loadstart",e);const g=function(){c||this.trigger("loadstart")};this.on("loadedmetadata",g);this.ready(function(){this.off("loadstart",e);this.off("loadedmetadata",g);c||this.trigger("loadstart")})}else{var b=["loadstart"];b.push("loadedmetadata"); |
|
2<=a.readyState&&b.push("loadeddata");3<=a.readyState&&b.push("canplay");4<=a.readyState&&b.push("canplaythrough");this.ready(function(){b.forEach(function(c){this.trigger(c)},this)})}}setScrubbing(a){this.isScrubbing_=a}scrubbing(){return this.isScrubbing_}setCurrentTime(a){try{this.isScrubbing_&&this.el_.fastSeek&&me?this.el_.fastSeek(a):this.el_.currentTime=a}catch(b){da(b,"Video is not ready. (Video.js)")}}duration(){if(Infinity===this.el_.duration&&Ab&&Bb&&0===this.el_.currentTime){const a=()=> |
|
{0<this.el_.currentTime&&(Infinity===this.el_.duration&&this.trigger("durationchange"),this.off("timeupdate",a))};this.on("timeupdate",a);return NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if("webkitDisplayingFullscreen"in this.el_){var a=function(){this.trigger("fullscreenchange",{isFullscreen:!1});this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},b=function(){"webkitPresentationMode"in |
|
this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",a),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",b);this.on("dispose",()=>{this.off("webkitbeginfullscreen",b);this.off("webkitendfullscreen",a)})}}supportsFullScreen(){return"function"===typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const a=this.el_;if(a.paused&&a.networkState<=a.HAVE_METADATA)yb(this.el_.play()),this.setTimeout(function(){a.pause(); |
|
try{a.webkitEnterFullScreen()}catch(b){this.trigger("fullscreenerror",b)}},0);else try{a.webkitEnterFullScreen()}catch(b){this.trigger("fullscreenerror",b)}}exitFullScreen(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(a){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(a): |
|
super.requestVideoFrameCallback(a)}cancelVideoFrameCallback(a){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(a):super.cancelVideoFrameCallback(a)}src(a){if(void 0===a)return this.el_.src;this.setSrc(a)}reset(){R.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(a){this.el_.controls=!!a}addTextTrack(a,b,c){return this.featuresNativeTextTracks?this.el_.addTextTrack(a,b,c):super.addTextTrack(a, |
|
b,c)}createRemoteTextTrack(a){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(a);const b=P.createElement("track");a.kind&&(b.kind=a.kind);a.label&&(b.label=a.label);if(a.language||a.srclang)b.srclang=a.language||a.srclang;a.default&&(b.default=a.default);a.id&&(b.id=a.id);a.src&&(b.src=a.src);return b}addRemoteTextTrack(a,b){a=super.addRemoteTextTrack(a,b);this.featuresNativeTextTracks&&this.el().appendChild(a);return a}removeRemoteTextTrack(a){super.removeRemoteTextTrack(a); |
|
if(this.featuresNativeTextTracks){const b=this.$$("track");let c=b.length;for(;c--;)a!==b[c]&&a!==b[c].track||this.el().removeChild(b[c])}}getVideoPlaybackQuality(){if("function"===typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const a={};"undefined"!==typeof this.el().webkitDroppedFrameCount&&"undefined"!==typeof this.el().webkitDecodedFrameCount&&(a.droppedVideoFrames=this.el().webkitDroppedFrameCount,a.totalVideoFrames=this.el().webkitDecodedFrameCount);D.performance&& |
|
(a.creationTime=D.performance.now());return a}}Sd(R,"TEST_VID",function(){if(Ac()){var a=P.createElement("video"),b=P.createElement("track");b.kind="captions";b.srclang="en";b.label="English";a.appendChild(b);return a}});R.isSupported=function(){try{R.TEST_VID.volume=.5}catch(a){return!1}return!(!R.TEST_VID||!R.TEST_VID.canPlayType)};R.canPlayType=function(a){return R.TEST_VID.canPlayType(a)};R.canPlaySource=function(a,b){return R.canPlayType(a.type)};R.canControlVolume=function(){try{const a=R.TEST_VID.volume; |
|
R.TEST_VID.volume=a/2+.1;const b=a!==R.TEST_VID.volume;return b&&Qa?(D.setTimeout(()=>{R&&R.prototype&&(R.prototype.featuresVolumeControl=a!==R.TEST_VID.volume)}),!1):b}catch(a){return!1}};R.canMuteVolume=function(){try{const a=R.TEST_VID.muted;R.TEST_VID.muted=!a;R.TEST_VID.muted?R.TEST_VID.setAttribute("muted","muted"):R.TEST_VID.removeAttribute("muted");return a!==R.TEST_VID.muted}catch(a){return!1}};R.canControlPlaybackRate=function(){if(Ab&&Bb&&58>he)return!1;try{const a=R.TEST_VID.playbackRate; |
|
R.TEST_VID.playbackRate=a/2+.1;return a!==R.TEST_VID.playbackRate}catch(a){return!1}};R.canOverrideAttributes=function(){try{const a=()=>{};Object.defineProperty(P.createElement("video"),"src",{get:a,set:a});Object.defineProperty(P.createElement("audio"),"src",{get:a,set:a});Object.defineProperty(P.createElement("video"),"innerHTML",{get:a,set:a});Object.defineProperty(P.createElement("audio"),"innerHTML",{get:a,set:a})}catch(a){return!1}return!0};R.supportsNativeTextTracks=function(){return me|| |
|
Qa&&Bb};R.supportsNativeVideoTracks=function(){return!(!R.TEST_VID||!R.TEST_VID.videoTracks)};R.supportsNativeAudioTracks=function(){return!(!R.TEST_VID||!R.TEST_VID.audioTracks)};R.Events="loadstart suspend abort error emptied stalled loadedmetadata loadeddata canplay canplaythrough playing waiting seeking seeked ended durationchange timeupdate progress play pause ratechange resize volumechange".split(" ");[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"], |
|
["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([a,b]){Sd(R.prototype,a,()=>R[b](),!0)});R.prototype.featuresVolumeControl=R.canControlVolume();R.prototype.movingMediaElementInDOM=!Qa;R.prototype.featuresFullscreenResize=!0;R.prototype.featuresProgressEvents=!0;R.prototype.featuresTimeupdateEvents=!0;R.prototype.featuresVideoFrameCallback= |
|
!(!R.TEST_VID||!R.TEST_VID.requestVideoFrameCallback);R.disposeMediaElement=function(a){if(a){for(a.parentNode&&a.parentNode.removeChild(a);a.hasChildNodes();)a.removeChild(a.firstChild);a.removeAttribute("src");if("function"===typeof a.load)try{a.load()}catch(b){}}};R.resetMediaElement=function(a){if(a){for(var b=a.querySelectorAll("source"),c=b.length;c--;)a.removeChild(b[c]);a.removeAttribute("src");if("function"===typeof a.load)try{a.load()}catch(e){}}};"muted defaultMuted autoplay controls loop playsinline".split(" ").forEach(function(a){R.prototype[a]= |
|
function(){return this.el_[a]||this.el_.hasAttribute(a)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(a){R.prototype["set"+wa(a)]=function(b){(this.el_[a]=b)?this.el_.setAttribute(a,a):this.el_.removeAttribute(a)}});"paused currentTime buffered volume poster preload error seeking seekable ended playbackRate defaultPlaybackRate disablePictureInPicture played networkState readyState videoWidth videoHeight crossOrigin".split(" ").forEach(function(a){R.prototype[a]=function(){return this.el_[a]}}); |
|
"volume src poster preload playbackRate defaultPlaybackRate disablePictureInPicture crossOrigin".split(" ").forEach(function(a){R.prototype["set"+wa(a)]=function(b){this.el_[a]=b}});["pause","load","play"].forEach(function(a){R.prototype[a]=function(){return this.el_[a]()}});Z.withSourceHandlers(R);R.nativeSourceHandler={};R.nativeSourceHandler.canPlayType=function(a){try{return R.TEST_VID.canPlayType(a)}catch(b){return""}};R.nativeSourceHandler.canHandleSource=function(a,b){return a.type?R.nativeSourceHandler.canPlayType(a.type): |
|
a.src?(a=ig(a.src),R.nativeSourceHandler.canPlayType(`video/${a}`)):""};R.nativeSourceHandler.handleSource=function(a,b,c){b.setSrc(a.src)};R.nativeSourceHandler.dispose=function(){};R.registerSourceHandler(R.nativeSourceHandler);Z.registerTech("Html5",R);const wk="progress abort suspend emptied stalled loadedmetadata loadeddata timeupdate resize volumechange texttrackchange".split(" "),Cg={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Dg="tiny xsmall small medium large xlarge huge".split(" "), |
|
ue={};Dg.forEach(a=>{const b="x"===a.charAt(0)?`x-${a.substring(1)}`:a;ue[a]=`vjs-layout-${b}`});const ip={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class ra extends M{constructor(a,b,c){a.id=a.id||b.id||`vjs_video_${pb++}`;b=Object.assign(ra.getTagSettings(a),b);b.initChildren=!1;b.createEl=!1;b.evented=!1;b.reportTouchActivity=!1;if(!b.language){const e=a.closest("[lang]");e&&(b.language=e.getAttribute("lang"))}super(null,b,c);this.boundDocumentFullscreenChange_= |
|
e=>this.documentFullscreenChange_(e);this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e);this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e);this.boundApplyInitTime_=e=>this.applyInitTime_(e);this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e);this.boundHandleTechClick_=e=>this.handleTechClick_(e);this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e);this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e);this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e); |
|
this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e);this.boundHandleTechTap_=e=>this.handleTechTap_(e);this.isFullscreen_=!1;this.log=qj(this.id_);this.fsApi_=Ud;this.isPosterFromTech_=!1;this.queuedCallbacks_=[];this.audioPosterMode_=this.audioOnlyMode_=this.debugEnabled_=this.userActive_=this.hasStarted_=this.isReady_=!1;this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]};if(!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?"); |
|
this.tagAttributes=(this.tag=a)&&Vb(a);this.language(this.options_.language);if(b.languages){const e={};Object.getOwnPropertyNames(b.languages).forEach(function(g){e[g.toLowerCase()]=b.languages[g]});this.languages_=e}else this.languages_=ra.prototype.options_.languages;this.resetCache_();this.poster_=b.poster||"";this.controls_=!!b.controls;a.controls=!1;a.removeAttribute("controls");this.changingSrc_=!1;this.playCallbacks_=[];this.playTerminatedQueue_=[];a.hasAttribute("autoplay")?this.autoplay(!0): |
|
this.autoplay(this.options_.autoplay);b.plugins&&Object.keys(b.plugins).forEach(e=>{if("function"!==typeof this[e])throw Error(`plugin "${e}" does not exist`);});this.scrubbing_=!1;this.el_=this.createEl();xf(this,{eventBusKey:"el_"});this.fsApi_.requestFullscreen&&(ab(P,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_));if(this.fluid_)this.on(["playerreset","resize"],this.boundUpdateStyleEl_);c=ma(this.options_); |
|
b.plugins&&Object.keys(b.plugins).forEach(e=>{this[e](b.plugins[e])});b.debug&&this.debug(!0);this.options_.playerOptions=c;this.middleware_=[];this.playbackRates(b.playbackRates);b.experimentalSvgIcons&&(c=(new D.DOMParser).parseFromString('\x3csvg xmlns\x3d"http://www.w3.org/2000/svg"\x3e\n \x3cdefs\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-play"\x3e\n \x3cpath d\x3d"M16 10v28l22-14z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-pause"\x3e\n \x3cpath d\x3d"M12 38h8V10h-8v28zm16-28v28h8V10h-8z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-audio"\x3e\n \x3cpath d\x3d"M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-captions"\x3e\n \x3cpath d\x3d"M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-subtitles"\x3e\n \x3cpath d\x3d"M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-fullscreen-enter"\x3e\n \x3cpath d\x3d"M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-fullscreen-exit"\x3e\n \x3cpath d\x3d"M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-play-circle"\x3e\n \x3cpath d\x3d"M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-volume-mute"\x3e\n \x3cpath d\x3d"M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-volume-low"\x3e\n \x3cpath d\x3d"M14 18v12h8l10 10V8L22 18h-8z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-volume-medium"\x3e\n \x3cpath d\x3d"M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-volume-high"\x3e\n \x3cpath d\x3d"M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-spinner"\x3e\n \x3cpath d\x3d"M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 24 24" id\x3d"vjs-icon-hd"\x3e\n \x3cpath d\x3d"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-chapters"\x3e\n \x3cpath d\x3d"M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 40 40" id\x3d"vjs-icon-downloading"\x3e\n \x3cpath d\x3d"M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-file-download"\x3e\n \x3cpath d\x3d"M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-file-download-done"\x3e\n \x3cpath d\x3d"M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-file-download-off"\x3e\n \x3cpath d\x3d"M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-share"\x3e\n \x3cpath d\x3d"M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-cog"\x3e\n \x3cpath d\x3d"M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-square"\x3e\n \x3cpath d\x3d"M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-circle"\x3e\n \x3ccircle cx\x3d"24" cy\x3d"24" r\x3d"20"\x3e\x3c/circle\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-circle-outline"\x3e\n \x3cpath d\x3d"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-circle-inner-circle"\x3e\n \x3cpath d\x3d"M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-cancel"\x3e\n \x3cpath d\x3d"M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-replay"\x3e\n \x3cpath d\x3d"M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-repeat"\x3e\n \x3cpath d\x3d"M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-replay-5"\x3e\n \x3cpath d\x3d"M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-replay-10"\x3e\n \x3cpath d\x3d"M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-replay-30"\x3e\n \x3cpath d\x3d"M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-forward-5"\x3e\n \x3cpath d\x3d"M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-forward-10"\x3e\n \x3cpath d\x3d"M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 96 48 48" id\x3d"vjs-icon-forward-30"\x3e\n \x3cpath d\x3d"M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 512 512" id\x3d"vjs-icon-audio-description"\x3e\n \x3cg fill-rule\x3d"evenodd"\x3e\x3cpath d\x3d"M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"\x3e\x3c/path\x3e\x3cpath d\x3d"M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"\x3e\x3c/path\x3e\x3cpath d\x3d"M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"\x3e\x3c/path\x3e\x3cpath d\x3d"M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"\x3e\x3c/path\x3e\x3c/g\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-next-item"\x3e\n \x3cpath d\x3d"M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-previous-item"\x3e\n \x3cpath d\x3d"M12 12h4v24h-4zm7 12l17 12V12z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-shuffle"\x3e\n \x3cpath d\x3d"M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-cast"\x3e\n \x3cpath d\x3d"M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 48 48" id\x3d"vjs-icon-picture-in-picture-enter"\x3e\n \x3cpath d\x3d"M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 22 18" id\x3d"vjs-icon-picture-in-picture-exit"\x3e\n \x3cpath d\x3d"M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"\x3e\x3c/path\x3e\n \x3cpath fill\x3d"none" d\x3d"M-1-3h24v24H-1z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 1792 1792" id\x3d"vjs-icon-facebook"\x3e\n \x3cpath d\x3d"M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 1792 1792" id\x3d"vjs-icon-linkedin"\x3e\n \x3cpath d\x3d"M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 1792 1792" id\x3d"vjs-icon-twitter"\x3e\n \x3cpath d\x3d"M1684 408q-67 98-162 167 1 14 1 42 0 130-38 259.5T1369.5 1125 1185 1335.5t-258 146-323 54.5q-271 0-496-145 35 4 78 4 225 0 401-138-105-2-188-64.5T285 1033q33 5 61 5 43 0 85-11-112-23-185.5-111.5T172 710v-4q68 38 146 41-66-44-105-115t-39-154q0-88 44-163 121 149 294.5 238.5T884 653q-8-38-8-74 0-134 94.5-228.5T1199 256q140 0 236 102 109-21 205-78-37 115-142 178 93-10 186-50z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 1792 1792" id\x3d"vjs-icon-tumblr"\x3e\n \x3cpath d\x3d"M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3csymbol viewBox\x3d"0 0 1792 1792" id\x3d"vjs-icon-pinterest"\x3e\n \x3cpath d\x3d"M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"\x3e\x3c/path\x3e\n \x3c/symbol\x3e\n \x3c/defs\x3e\n\x3c/svg\x3e', |
|
"image/svg+xml"),c.querySelector("parsererror")?(da.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null):(c=c.documentElement,c.style.display="none",this.el_.appendChild(c),this.addClass("vjs-svg-icons-enabled")));this.initChildren();this.isAudio("audio"===a.nodeName.toLowerCase());this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled");this.el_.setAttribute("role","region");this.isAudio()?this.el_.setAttribute("aria-label", |
|
this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player"));this.isAudio()&&this.addClass("vjs-audio");md&&this.addClass("vjs-touch-enabled");Qa||this.addClass("vjs-workinghover");ra.players[this.id_]=this;this.addClass("vjs-v8");this.userActive(!0);this.reportUserActivity();this.one("play",e=>this.listenForUserActivity_(e));this.on("keydown",e=>this.handleKeyDown(e));this.on("languagechange",e=>this.handleLanguagechange(e));this.breakpoints(this.options_.breakpoints); |
|
this.responsive(this.options_.responsive);this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode);this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose");this.off("dispose");Ma(P,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);Ma(P,"keydown",this.boundFullWindowOnEscKey_);this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null);ra.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);Bf[this.id()]=null;Sa.names.forEach(a=>{(a=this[Sa[a].getterName]())&&a.off&&a.off()});super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let a=this.tag,b,c=this.playerElIngest_=a.parentNode&&a.parentNode.hasAttribute&&a.parentNode.hasAttribute("data-vjs-player"); |
|
const e="video-js"===this.tag.tagName.toLowerCase();c?b=this.el_=a.parentNode:e||(b=this.el_=super.createEl("div"));const g=Vb(a);if(e){b=this.el_=a;for(a=this.tag=P.createElement("video");b.children.length;)a.appendChild(b.firstChild);dd(b,"video-js")||cc(b,"video-js");b.appendChild(a);c=this.playerElIngest_=b;Object.keys(b).forEach(t=>{try{a[t]=b[t]}catch(x){}})}a.setAttribute("tabindex","-1");g.tabindex="-1";Bb&&je&&(a.setAttribute("role","application"),g.role="application");a.removeAttribute("width"); |
|
a.removeAttribute("height");"width"in g&&delete g.width;"height"in g&&delete g.height;Object.getOwnPropertyNames(g).forEach(function(t){e&&"class"===t||b.setAttribute(t,g[t]);e&&a.setAttribute(t,g[t])});a.playerId=a.id;a.id+="_html5_api";a.className="vjs-tech";a.player=b.player=this;this.addClass("vjs-paused");var l="IS_SMART_TV IS_TIZEN IS_WEBOS IS_ANDROID IS_IPAD IS_IPHONE".split(" ").filter(t=>vj[t]).map(t=>"vjs-device-"+t.substring(3).toLowerCase().replace(/_/g,"-"));this.addClass(...l);if(!0!== |
|
D.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=yj("vjs-styles-dimensions");l=Wb(".vjs-styles-defaults");var p=Wb("head");p.insertBefore(this.styleEl_,l?l.nextSibling:p.firstChild)}this.fluid_=this.fill_=!1;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);l=a.getElementsByTagName("a");for(p=0;p<l.length;p++){const t= |
|
l.item(p);cc(t,"vjs-hidden");t.setAttribute("hidden","hidden")}a.initNetworkState_=a.networkState;a.parentNode&&!c&&a.parentNode.insertBefore(b,a);rf(a,b);this.children_.unshift(a);this.el_.setAttribute("lang",this.language_);this.el_.setAttribute("translate","no");return this.el_=b}crossOrigin(a){if("undefined"===typeof a)return this.techGet_("crossOrigin");null!==a&&"anonymous"!==a&&"use-credentials"!==a?da.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${a}"`):(this.techCall_("setCrossOrigin", |
|
a),this.posterImage&&this.posterImage.crossOrigin(a))}width(a){return this.dimension("width",a)}height(a){return this.dimension("height",a)}dimension(a,b){const c=a+"_";if(void 0===b)return this[c]||0;if(""===b||"auto"===b)this[c]=void 0,this.updateStyleEl_();else{var e=parseFloat(b);isNaN(e)?da.error(`Improper value "${b}" supplied for for ${a}`):(this[c]=e,this.updateStyleEl_())}}fluid(a){if(void 0===a)return!!this.fluid_;this.fluid_=!!a;Kb(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_); |
|
a?(this.addClass("vjs-fluid"),this.fill(!1),xo(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid");this.updateStyleEl_()}fill(a){if(void 0===a)return!!this.fill_;this.fill_=!!a;a?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(a){if(void 0===a)return this.aspectRatio_;if(!/^\d+:\d+$/.test(a))throw 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_()}updateStyleEl_(){if(!0===D.VIDEOJS_NO_DYNAMIC_STYLE){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();c&&(0<=a&&(c.width=a),0<=b&&(c.height=b))}else{a=(void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:0<this.videoWidth()?this.videoWidth()+":"+this.videoHeight():"16:9").split(":");var e=a[1]/a[0];a=void 0!==this.width_?this.width_: |
|
void 0!==this.height_?this.height_/e:this.videoWidth()||300;b=void 0!==this.height_?this.height_:a*e;c=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions";this.addClass(c);zj(this.styleEl_,`\n .${c} {\n width: ${a}px;\n height: ${b}px;\n }\n\n .${c}.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ${100*e}%;\n }\n `)}}loadTech_(a,b){this.tech_&&this.unloadTech_();const c=wa(a),e=a.charAt(0).toLowerCase()+a.slice(1);"Html5"!== |
|
c&&this.tag&&(Z.getTech("Html5").disposeMediaElement(this.tag),this.tag=this.tag.player=null);this.techName_=c;this.isReady_=!1;let g=this.autoplay();if("string"===typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)g=!1;const l={source:b,autoplay:g,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${e}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture, |
|
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};Sa.names.forEach(p=>{p=Sa[p];l[p.getterName]=this[p.privateName]});Object.assign(l,this.options_[c]);Object.assign(l,this.options_[e]);Object.assign(l,this.options_[a.toLowerCase()]);this.tag&&(l.tag=this.tag);b&&b.src===this.cache_.src&&0<this.cache_.currentTime&& |
|
(l.startTime=this.cache_.currentTime);a=Z.getTech(a);if(!a)throw Error(`No Tech named '${c}' exists! '${c}' should be registered using videojs.registerTech()'`);this.tech_=new a(l);this.tech_.ready(na(this,this.handleTechReady_),!0);Ej.jsonToTextTracks(this.textTracksJson_||[],this.tech_);wk.forEach(p=>{this.on(this.tech_,p,t=>this[`handleTech${wa(p)}_`](t))});Object.keys(Cg).forEach(p=>{this.on(this.tech_,p,t=>{if(0===this.tech_.playbackRate()&&this.tech_.seeking())this.queuedCallbacks_.push({callback:this[`handleTech${Cg[p]}_`].bind(this), |
|
event:t});else this[`handleTech${Cg[p]}_`](t)})});this.on(this.tech_,"loadstart",p=>this.handleTechLoadStart_(p));this.on(this.tech_,"sourceset",p=>this.handleTechSourceset_(p));this.on(this.tech_,"waiting",p=>this.handleTechWaiting_(p));this.on(this.tech_,"ended",p=>this.handleTechEnded_(p));this.on(this.tech_,"seeking",p=>this.handleTechSeeking_(p));this.on(this.tech_,"play",p=>this.handleTechPlay_(p));this.on(this.tech_,"pause",p=>this.handleTechPause_(p));this.on(this.tech_,"durationchange",p=> |
|
this.handleTechDurationChange_(p));this.on(this.tech_,"fullscreenchange",(p,t)=>this.handleTechFullscreenChange_(p,t));this.on(this.tech_,"fullscreenerror",(p,t)=>this.handleTechFullscreenError_(p,t));this.on(this.tech_,"enterpictureinpicture",p=>this.handleTechEnterPictureInPicture_(p));this.on(this.tech_,"leavepictureinpicture",p=>this.handleTechLeavePictureInPicture_(p));this.on(this.tech_,"error",p=>this.handleTechError_(p));this.on(this.tech_,"posterchange",p=>this.handleTechPosterChange_(p)); |
|
this.on(this.tech_,"textdata",p=>this.handleTechTextData_(p));this.on(this.tech_,"ratechange",p=>this.handleTechRateChange_(p));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_();this.tech_.el().parentNode===this.el()||"Html5"===c&&this.tag||rf(this.tech_.el(),this.el());this.tag&&(this.tag=this.tag.player=null)}unloadTech_(){Sa.names.forEach(a=>{a=Sa[a];this[a.privateName]= |
|
this[a.getterName]()});this.textTracksJson_=Ej.textTracksToJson(this.tech_);this.isReady_=!1;this.tech_.dispose();this.tech_=!1;this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange"));this.isPosterFromTech_=!1}tech(a){void 0===a&&da.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n");return this.tech_}version(){return{"video.js":"8.12.0"}}addTechControlsListeners_(){this.removeTechControlsListeners_(); |
|
this.on(this.tech_,"click",this.boundHandleTechClick_);this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_);this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_); |
|
this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.off(this.tech_,"click",this.boundHandleTechClick_);this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady();this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume);this.handleTechPosterChange_();this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking");this.error(null); |
|
this.handleTechDurationChange_();this.paused()&&this.hasStarted(!1);this.trigger("loadstart");this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(a){if(this.tech_&&"string"===typeof a){var b=()=>{const e=this.muted();this.muted(!0);const g=()=>{this.muted(e)};this.playTerminatedQueue_.push(g);const l=this.play();if(gd(l))return l.catch(p=>{g();throw Error(`Rejection at manualAutoplay. Restoring muted value. ${p?p:""}`);})};if("any"!== |
|
a||this.muted())var c="muted"!==a||this.muted()?this.play():b();else c=this.play(),gd(c)&&(c=c.catch(b));if(gd(c))return c.then(()=>{this.trigger({type:"autoplay-success",autoplay:a})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:a})})}}updateSourceCaches_(a=""){let b=a;var 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=Ko(this,b));this.cache_.source=ma({},a,{src:b,type:c});a=this.cache_.sources.filter(l=> |
|
l.src&&l.src===b);c=[];const e=this.$$("source"),g=[];for(let l=0;l<e.length;l++){const p=Vb(e[l]);c.push(p);p.src&&p.src===b&&g.push(p.src)}g.length&&!a.length?this.cache_.sources=c:a.length||(this.cache_.sources=[this.cache_.source]);this.cache_.src=b}handleTechSourceset_(a){if(!this.changingSrc_){let b=g=>this.updateSourceCaches_(g);const c=this.currentSource().src,e=a.src;c&&!/^blob:/.test(c)&&/^blob:/.test(e)&&(!this.lastSource_||this.lastSource_.tech!==e&&this.lastSource_.player!==c)&&(b=()=> |
|
{});b(e);a.src||this.tech_.any(["sourceset","loadstart"],g=>{"sourceset"!==g.type&&(g=this.techGet_("currentSrc"),this.lastSource_.tech=g,this.updateSourceCaches_(g))})}this.lastSource_={player:this.currentSource().src,tech:a.src};this.trigger({src:a.src,type:"sourceset"})}hasStarted(a){if(void 0===a)return this.hasStarted_;a!==this.hasStarted_&&((this.hasStarted_=a)?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"); |
|
this.addClass("vjs-playing");this.hasStarted(!0);this.trigger("play")}handleTechRateChange_(){0<this.tech_.playbackRate()&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(a=>a.callback(a.event)),this.queuedCallbacks_=[]);this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const a=this.currentTime(),b=()=>{a!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate", |
|
b))};this.on("timeupdate",b)}handleTechCanPlay_(){this.removeClass("vjs-waiting");this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting");this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking");this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended");this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing");this.addClass("vjs-paused"); |
|
this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended");this.removeClass("vjs-waiting");this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause();this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(a){!this.controls_||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&& |
|
"function"===typeof this.options_.userActions.click?this.options_.userActions.click.call(this,a):this.paused()?yb(this.play()):this.pause())}handleTechDoubleClick_(a){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),b=>b.contains(a.target))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"=== |
|
typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,a):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(a){a.cancelable&&a.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(a){a= |
|
a.target.player;if(!a||a===this){a=this.el();var b=P[this.fsApi_.fullscreenElement]===a;!b&&a.matches&&(b=a.matches(":"+this.fsApi_.fullscreen));this.isFullscreen(b)}}handleTechFullscreenChange_(a,b){b&&(b.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(b.isFullscreen))}handleTechFullscreenError_(a,b){this.trigger("fullscreenerror",b)}togglePictureInPictureClass_(){this.isInPictureInPicture()? |
|
this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(a){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(a){this.isInPictureInPicture(!1)}handleTechError_(){const a=this.tech_.error();a&&this.error(a)}handleTechTextData_(){let a=null;1<arguments.length&&(a=arguments[1]);this.trigger("textdata",a)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout, |
|
duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(a,b){this.ready(function(){if(a in Io)return this.tech_[a](this.middleware_.reduce(Af(a),b));if(a in Mj)return ui(this.middleware_,this.tech_,a,b);try{if(this.tech_)this.tech_[a](b)}catch(c){throw da(c),c;}},!0)}techGet_(a){if(this.tech_&&this.tech_.isReady_){if(a in Ho){var b=this.tech_;return this.middleware_.reduceRight(Af(a),b[a]())}if(a in Mj)return ui(this.middleware_, |
|
this.tech_,a);try{return this.tech_[a]()}catch(c){if(void 0===this.tech_[a])throw da(`Video.js: ${a} method not defined for ${this.techName_} playback technology.`,c),c;if("TypeError"===c.name)throw da(`Video.js: ${a} unavailable on ${this.techName_} playback technology element.`,c),this.tech_.isReady_=!1,c;da(c);throw c;}}}play(){return new Promise(a=>{this.play_(a)})}play_(a=yb){this.playCallbacks_.push(a);var b=!(this.changingSrc_||!this.src()&&!this.currentSrc());a=!(!me&&!Qa);this.waitToPlay_&& |
|
(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null);this.isReady_&&b?(b=this.techGet_("play"),a&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===b?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(b)):(this.waitToPlay_=c=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!b&&a&&this.load())}runPlayTerminatedQueue_(){const a=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];a.forEach(function(b){b()})}runPlayCallbacks_(a){const b=this.playCallbacks_.slice(0); |
|
this.playCallbacks_=[];this.playTerminatedQueue_=[];b.forEach(function(c){c(a)})}pause(){this.techCall_("pause")}paused(){return!1===this.techGet_("paused")?!1:!0}played(){return this.techGet_("played")||qb(0,0)}scrubbing(a){if("undefined"===typeof a)return this.scrubbing_;this.scrubbing_=!!a;this.techCall_("setScrubbing",this.scrubbing_);a?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(a){if(void 0===a)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime; |
|
0>a&&(a=0);this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",a),this.cache_.initTime=0,isFinite(a)&&(this.cache_.currentTime=Number(a))):(this.cache_.initTime=a,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(a){if(void 0===a)return void 0!==this.cache_.duration?this.cache_.duration:NaN;a=parseFloat(a);0>a&&(a=Infinity);a!==this.cache_.duration&& |
|
(this.cache_.duration=a,Infinity===a?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(a)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let a=this.techGet_("buffered");a&&a.length||(a=qb(0,0));return a}seekable(){let a=this.techGet_("seekable");a&&a.length||(a=qb(0,0));return a}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return ti(this.buffered(), |
|
this.duration())}bufferedEnd(){var a=this.buffered();const b=this.duration();a=a.end(a.length-1);a>b&&(a=b);return a}volume(a){if(void 0!==a)a=Math.max(0,Math.min(1,a)),this.cache_.volume=a,this.techCall_("setVolume",a),0<a&&this.lastVolume_(a);else return a=parseFloat(this.techGet_("volume")),isNaN(a)?1:a}muted(a){if(void 0!==a)this.techCall_("setMuted",a);else return this.techGet_("muted")||!1}defaultMuted(a){void 0!==a&&this.techCall_("setDefaultMuted",a);return this.techGet_("defaultMuted")|| |
|
!1}lastVolume_(a){if(void 0!==a&&0!==a)this.cache_.lastVolume=a;else return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(a){if(void 0!==a){const b=this.isFullscreen_;this.isFullscreen_=!!a;this.isFullscreen_!==b&&this.fsApi_.prefixed&&this.trigger("fullscreenchange");this.toggleFullscreenClass_()}else return this.isFullscreen_}requestFullscreen(a){this.isInPictureInPicture()&&this.exitPictureInPicture();const b=this;return new Promise((c, |
|
e)=>{function g(){b.off("fullscreenerror",p);b.off("fullscreenchange",l)}function l(){g();c()}function p(x,y){g();e(y)}b.one("fullscreenchange",l);b.one("fullscreenerror",p);const t=b.requestFullscreenHelper_(a);t&&(t.then(g,g),t.then(c,e))})}requestFullscreenHelper_(a){let b;this.fsApi_.prefixed||(b=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==a&&(b=a));if(this.fsApi_.requestFullscreen)return(a=this.el_[this.fsApi_.requestFullscreen](b))&&a.then(()=>this.isFullscreen(!0), |
|
()=>this.isFullscreen(!1)),a;this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const a=this;return new Promise((b,c)=>{function e(){a.off("fullscreenerror",l);a.off("fullscreenchange",g)}function g(){e();b()}function l(t,x){e();c(x)}a.one("fullscreenchange",g);a.one("fullscreenerror",l);const p=a.exitFullscreenHelper_();p&&(p.then(e,e),p.then(b,c))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const a= |
|
P[this.fsApi_.exitFullscreen]();a&&yb(a.then(()=>this.isFullscreen(!1)));return a}this.tech_.supportsFullScreen()&&!0===!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0);this.isFullWindow=!0;this.docOrigOverflow=P.documentElement.style.overflow;ab(P,"keydown",this.boundFullWindowOnEscKey_);P.documentElement.style.overflow="hidden";cc(P.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(a){Y.isEventKey(a, |
|
"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1);this.isFullWindow=!1;Ma(P,"keydown",this.boundFullWindowOnEscKey_);P.documentElement.style.overflow=this.docOrigOverflow;Td(P.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(a){if(void 0===a)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",a);this.options_.disablePictureInPicture=a;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(a){if(void 0!== |
|
a)this.isInPictureInPicture_=!!a,this.togglePictureInPictureClass_();else return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&D.documentPictureInPicture){const a=P.createElement(this.el().tagName);a.classList=this.el().classList;a.classList.add("vjs-pip-container");this.posterImage&&a.appendChild(this.posterImage.el().cloneNode(!0));this.titleBar&&a.appendChild(this.titleBar.el().cloneNode(!0));a.appendChild(aa("p",{className:"vjs-pip-text"}, |
|
{},this.localize("Playing in picture-in-picture")));return D.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(b=>{li(b);this.el_.parentNode.insertBefore(a,this.el_);b.document.body.appendChild(this.el_);b.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(!0);this.player_.trigger({type:"enterpictureinpicture",pipWindow:b});b.addEventListener("pagehide",c=>{c=c.target.querySelector(".video-js");a.parentNode.replaceChild(c, |
|
a);this.player_.isInPictureInPicture(!1);this.player_.trigger("leavepictureinpicture")});return b})}return"pictureInPictureEnabled"in P&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(D.documentPictureInPicture&&D.documentPictureInPicture.window)return D.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in P)return P.exitPictureInPicture()}handleKeyDown(a){const {userActions:b}= |
|
this.options_;if(b&&b.hotkeys){{var c=this.el_.ownerDocument.activeElement;const g=c.tagName.toLowerCase();if(c.isContentEditable)c=!0;else{var e="button checkbox hidden radio reset submit".split(" ");c="input"===g?-1===e.indexOf(c.type):-1!==["textarea"].indexOf(g)}}c||("function"===typeof b.hotkeys?b.hotkeys.call(this,a):this.handleHotkeys(a))}}handleHotkeys(a){const {fullscreenKey:b=g=>Y.isEventKey(g,"f"),muteKey:c=g=>Y.isEventKey(g,"m"),playPauseKey:e=g=>Y.isEventKey(g,"k")||Y.isEventKey(g,"Space")}= |
|
this.options_.userActions?this.options_.userActions.hotkeys:{};if(b.call(this,a)){a.preventDefault();a.stopPropagation();const g=M.getComponent("FullscreenToggle");!1!==P[this.fsApi_.fullscreenEnabled]&&g.prototype.handleClick.call(this,a)}else c.call(this,a)?(a.preventDefault(),a.stopPropagation(),M.getComponent("MuteToggle").prototype.handleClick.call(this,a)):e.call(this,a)&&(a.preventDefault(),a.stopPropagation(),M.getComponent("PlayToggle").prototype.handleClick.call(this,a))}canPlayType(a){for(let c= |
|
0,e=this.options_.techOrder;c<e.length;c++){var b=e[c];let g=Z.getTech(b);g||=M.getComponent(b);if(!g)da.error(`The "${b}" tech is undefined. Skipped browser support check for that tech.`);else if(g.isSupported()&&(b=g.canPlayType(a)))return b}return""}selectSource(a){const b=this.options_.techOrder.map(l=>[l,Z.getTech(l)]).filter(([l,p])=>{if(p)return p.isSupported();da.error(`The "${l}" tech is undefined. Skipped browser support check for that tech.`);return!1}),c=function(l,p,t){let x;l.some(y=> |
|
p.some(A=>{if(x=t(y,A))return!0}));return x},e=l=>(p,t)=>l(t,p),g=([l,p],t)=>{if(p.canPlaySource(t,this.options_[l.toLowerCase()]))return{source:t,tech:l}};return(this.options_.sourceOrder?c(a,b,e(g)):c(b,a,g))||!1}handleSrc_(a,b){if("undefined"===typeof a)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const c=Nj(a);if(c.length){if(this.changingSrc_=!0,b||(this.cache_.sources=c),this.updateSourceCaches_(c[0]),Um(this,c[0],(e,g)=>{this.middleware_=g;b||(this.cache_.sources= |
|
c);this.updateSourceCaches_(e);if(this.src_(e)){if(1<c.length)return this.handleSrc_(c.slice(1));this.changingSrc_=!1;this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);this.triggerReady()}else Vm(g,this.tech_)}),1<c.length){const e=()=>{this.error(null);this.handleSrc_(c.slice(1),!0)},g=()=>{this.off("error",e)};this.one("error",e);this.one("playing",g);this.resetRetryOnError_=()=>{this.off("error",e);this.off("playing",g)}}}else this.setTimeout(function(){this.error({code:4, |
|
message:this.options_.notSupportedMessage})},0)}src(a){return this.handleSrc_(a,!1)}src_(a){const b=this.selectSource([a]);if(!b)return!0;if(!Dj(b.tech,this.techName_))return this.changingSrc_=!0,this.loadTech_(b.tech,b.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1;this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",a):this.techCall_("src",a.src);this.changingSrc_=!1},!0);return!1}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()): |
|
this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const a=this.play();yb(a.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text");this.removeClass("vjs-playing");this.addClass("vjs-paused");this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();this.error(null);this.titleBar&&this.titleBar.update({title:void 0,description:void 0});Kb(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(); |
|
this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const {currentTimeDisplay:a,durationDisplay:b,progressControl:c,remainingTimeDisplay:e}=this.controlBar||{},{seekBar:g}=c||{};a&&a.updateContent();b&&b.updateContent();e&&e.updateContent();g&&(g.update(),g.loadProgressBar&&g.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const a= |
|
this.currentSource(),b=[];0!==Object.keys(a).length&&b.push(a);return this.cache_.sources||b}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(a){if(void 0!==a)this.techCall_("setPreload",a),this.options_.preload=a;else return this.techGet_("preload")}autoplay(a){if(void 0===a)return this.options_.autoplay||!1;let b;"string"===typeof a&&/(any|play|muted)/.test(a)|| |
|
!0===a&&this.options_.normalizeAutoplay?(this.options_.autoplay=a,this.manualAutoplay_("string"===typeof a?a:"play"),b=!1):this.options_.autoplay=a?!0:!1;b="undefined"===typeof b?this.options_.autoplay:b;this.tech_&&this.techCall_("setAutoplay",b)}playsinline(a){void 0!==a&&(this.techCall_("setPlaysinline",a),this.options_.playsinline=a);return this.techGet_("playsinline")}loop(a){if(void 0!==a)this.techCall_("setLoop",a),this.options_.loop=a;else return this.techGet_("loop")}poster(a){if(void 0=== |
|
a)return this.poster_;a||="";a!==this.poster_&&(this.poster_=a,this.techCall_("setPoster",a),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const a=this.tech_.poster()||"";a!==this.poster_&&(this.poster_=a,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(a){if(void 0===a)return!!this.controls_;a=!!a;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_()))}usingNativeControls(a){if(void 0===a)return!!this.usingNativeControls_;a=!!a;this.usingNativeControls_!== |
|
a&&((this.usingNativeControls_=a)?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(a){if(void 0===a)return this.error_||null;Xb("beforeerror").forEach(b=>{b=b(this,a);xb(b)&&!Array.isArray(b)||"string"===typeof b||"number"===typeof b||null===b?a=b:this.log.error("please return a value that MediaError expects in beforeerror hooks")});if(this.options_.suppressNotSupportedError&& |
|
a&&4===a.code){const b=function(){this.error(a)};this.options_.suppressNotSupportedError=!1;this.any(["click","touchstart"],b);this.one("loadstart",function(){this.off(["click","touchstart"],b)})}else null===a?(this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close()):(this.error_=new ua(a),this.addClass("vjs-error"),da.error(`(CODE:${this.error_.code} ${ua.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Xb("error").forEach(b=> |
|
b(this,this.error_)))}reportUserActivity(a){this.userActivity_=!0}userActive(a){if(void 0===a)return this.userActive_;a=!!a;if(a!==this.userActive_)if(this.userActive_=a)this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");else{if(this.tech_)this.tech_.one("mousemove",function(b){b.stopPropagation();b.preventDefault()});this.userActivity_=!1;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}}listenForUserActivity_(){let a, |
|
b,c;const e=na(this,this.reportUserActivity);var g=function(p){e();this.clearInterval(a)};this.on("mousedown",function(){e();this.clearInterval(a);a=this.setInterval(e,250)});this.on("mousemove",function(p){if(p.screenX!==b||p.screenY!==c)b=p.screenX,c=p.screenY,e()});this.on("mouseup",g);this.on("mouseleave",g);!(g=this.getChild("controlBar"))||Qa||Ab||(g.on("mouseenter",function(p){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout); |
|
this.player().options_.inactivityTimeout=0}),g.on("mouseleave",function(p){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}));this.on("keydown",e);this.on("keyup",e);let l;this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1;this.userActive(!0);this.clearTimeout(l);var p=this.options_.inactivityTimeout;0>=p||(l=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},p))}},250)}playbackRate(a){if(void 0!==a)this.techCall_("setPlaybackRate", |
|
a);else return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(a){return void 0!==a?this.techCall_("setDefaultPlaybackRate",a):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(a){if(void 0!==a)this.isAudio_=!!a;else return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const a=this.children(),b=this.getChild("ControlBar"),c=b&&b.currentHeight();a.forEach(e=> |
|
{e!==b&&e.el_&&!e.hasClass("vjs-hidden")&&(e.hide(),this.audioOnlyCache_.hiddenChildren.push(e))});this.audioOnlyCache_.playerHeight=this.currentHeight();this.height(c);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");this.audioOnlyCache_.hiddenChildren.forEach(a=>a.show());this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(a){return"boolean"!==typeof a||a===this.audioOnlyMode_?this.audioOnlyMode_:(this.audioOnlyMode_= |
|
a)?(a=[],this.isInPictureInPicture()&&a.push(this.exitPictureInPicture()),this.isFullscreen()&&a.push(this.exitFullscreen()),this.audioPosterMode()&&a.push(this.audioPosterMode(!1)),Promise.all(a).then(()=>this.enableAudioOnlyUI_())):Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show();this.removeClass("vjs-audio-poster-mode"); |
|
this.trigger("audiopostermodechange")}audioPosterMode(a){return"boolean"!==typeof a||a===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=a)?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(a,b,c){if(this.tech_)return this.tech_.addTextTrack(a,b,c)}addRemoteTextTrack(a,b){if(this.tech_)return this.tech_.addRemoteTextTrack(a, |
|
b)}removeRemoteTextTrack(a={}){let {track:b}=a;b||=a;if(this.tech_)return this.tech_.removeRemoteTextTrack(b)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(a){if(void 0===a)return this.language_;this.language_!==String(a).toLowerCase()&&(this.language_=String(a).toLowerCase(),Kb(this)&&this.trigger("languagechange"))}languages(){return ma(ra.prototype.options_.languages, |
|
this.languages_)}toJSON(){const a=ma(this.options_),b=a.tracks;a.tracks=[];for(let c=0;c<b.length;c++){let e=b[c];e=ma(e);e.player=void 0;a.tracks[c]=e}return a}createModal(a,b){b=b||{};b.content=a||"";const c=new Kc(this,b);this.addChild(c);c.on("dispose",()=>{this.removeChild(c)});c.open();return c}updateCurrentBreakpoint_(){if(this.responsive()){var a=this.currentBreakpoint(),b=this.currentWidth();for(let c=0;c<Dg.length;c++){const e=Dg[c];if(b<=this.breakpoints_[e]){if(a===e)break;a&&this.removeClass(ue[a]); |
|
this.addClass(ue[e]);this.breakpoint_=e;break}}}}removeCurrentBreakpoint_(){const a=this.currentBreakpointClass();this.breakpoint_="";a&&this.removeClass(a)}breakpoints(a){if(void 0===a)return Object.assign(this.breakpoints_);this.breakpoint_="";this.breakpoints_=Object.assign({},ip,a);this.updateCurrentBreakpoint_();return Object.assign(this.breakpoints_)}responsive(a){if(void 0===a)return this.responsive_;a=!!a;if(a!==this.responsive_)return(this.responsive_=a)?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_), |
|
this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),a}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return ue[this.breakpoint_]||""}loadMedia(a,b){if(a&&"object"===typeof a){var c=this.crossOrigin();this.reset();this.cache_.media=ma(a);var {artist:e,artwork:g,description:l,poster:p,src:t,textTracks:x,title:y}=this.cache_.media;!g&&p&&(this.cache_.media.artwork=[{src:p,type:$d(p)}]);c&&this.crossOrigin(c); |
|
t&&this.src(t);p&&this.poster(p);Array.isArray(x)&&x.forEach(A=>this.addRemoteTextTrack(A,!1));this.titleBar&&this.titleBar.update({title:y,description:l||e||""});this.ready(b)}}getMedia(){if(!this.cache_.media){const b=this.poster();var a=this.currentSources();const c=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}));a={src:a,textTracks:c};b&&(a.poster=b,a.artwork=[{src:a.poster,type:$d(a.poster)}]);return a}return ma(this.cache_.media)}static getTagSettings(a){const b= |
|
{sources:[],tracks:[]};var c=Vb(a),e=c["data-setup"];dd(a,"vjs-fill")&&(c.fill=!0);dd(a,"vjs-fluid")&&(c.fluid=!0);if(null!==e){const [g,l]=Zm(e||"{}");g&&da.error(g);Object.assign(c,l)}Object.assign(b,c);if(a.hasChildNodes()){a=a.childNodes;for(let g=0,l=a.length;g<l;g++)c=a[g],e=c.nodeName.toLowerCase(),"source"===e?b.sources.push(Vb(c)):"track"===e&&b.tracks.push(Vb(c))}return b}debug(a){if(void 0===a)return this.debugEnabled_;a?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"), |
|
this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(a){if(void 0===a)return this.cache_.playbackRates;Array.isArray(a)&&a.every(b=>"number"===typeof b)&&(this.cache_.playbackRates=a,this.trigger("playbackrateschange"))}}Sa.names.forEach(function(a){const b=Sa[a];ra.prototype[b.getterName]=function(){if(this.tech_)return this.tech_[b.getterName]();this[b.privateName]=this[b.privateName]||new b.ListClass; |
|
return this[b.privateName]}});ra.prototype.crossorigin=ra.prototype.crossOrigin;ra.players={};const rd=D.navigator;ra.prototype.options_={techOrder:Z.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2E3,playbackRates:[],liveui:!1,children:"mediaLoader posterImage titleBar textTrackDisplay loadingSpinner bigPlayButton liveTracker controlBar errorDisplay textTrackSettings resizeManager".split(" "),language:rd&&(rd.languages&&rd.languages[0]||rd.userLanguage||rd.language)||"en",languages:{}, |
|
notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1};wk.forEach(function(a){ra.prototype[`handleTech${wa(a)}_`]=function(){return this.trigger(a)}});M.registerComponent("Player",ra);const Nb={},ve=a=>Nb.hasOwnProperty(a)?Nb[a]:void 0,we=(a,b,c)=>{c=(c?"before":"")+"pluginsetup";a.trigger(c,b);a.trigger(c+":"+b.name,b)},jp=function(a, |
|
b){const c=function(){we(this,{name:a,plugin:b,instance:null},!0);const e=b.apply(this,arguments);this.activePlugins_=this.activePlugins_||{};this.activePlugins_[a]=!0;we(this,{name:a,plugin:b,instance:e});return e};Object.keys(b).forEach(function(e){c[e]=b[e]});return c},xk=(a,b)=>{b.prototype.name=a;return function(...c){we(this,{name:a,plugin:b,instance:null},!0);const e=new b(...[this,...c]);this[a]=()=>e;we(this,e.getEventHash());return e}};class fb{constructor(a){if(this.constructor===fb)throw Error("Plugin must be sub-classed; not directly instantiated."); |
|
this.player=a;this.log||(this.log=this.player.log.createLogger(this.name));xf(this);delete this.trigger;oi(this,this.constructor.defaultState);var b=this.name;a.activePlugins_=a.activePlugins_||{};a.activePlugins_[b]=!0;this.dispose=this.dispose.bind(this);a.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(a={}){a.name=this.name;a.plugin=this.constructor;a.instance=this;return a}trigger(a,b={}){return Ec(this.eventBusEl_,a,this.getEventHash(b))}handleStateChanged(a){}dispose(){const {name:a, |
|
player:b}=this;this.trigger("dispose");this.off();b.off("dispose",this.dispose);b.activePlugins_[a]=!1;this.player=this.state=null;b[a]=xk(a,Nb[a])}static isBasic(a){a="string"===typeof a?ve(a):a;return"function"===typeof a&&!fb.prototype.isPrototypeOf(a.prototype)}static registerPlugin(a,b){if("string"!==typeof a)throw Error(`Illegal plugin name, "${a}", must be a string, was ${typeof a}.`);if(Nb.hasOwnProperty(a))da.warn(`A plugin named "${a}" already exists. You may want to avoid re-registering plugins!`); |
|
else if(ra.prototype.hasOwnProperty(a))throw Error(`Illegal plugin name, "${a}", cannot share a name with an existing player method!`);if("function"!==typeof b)throw Error(`Illegal plugin for "${a}", must be a function, was ${typeof b}.`);Nb[a]=b;"plugin"!==a&&(fb.isBasic(b)?ra.prototype[a]=jp(a,b):ra.prototype[a]=xk(a,b));return b}static deregisterPlugin(a){if("plugin"===a)throw Error("Cannot de-register base plugin.");Nb.hasOwnProperty(a)&&(delete Nb[a],delete ra.prototype[a])}static getPlugins(a= |
|
Object.keys(Nb)){let b;a.forEach(c=>{const e=ve(c);e&&(b=b||{},b[c]=e)});return b}static getPluginVersion(a){return(a=ve(a))&&a.VERSION||""}}fb.getPlugin=ve;fb.BASE_PLUGIN_NAME="plugin";fb.registerPlugin("plugin",fb);ra.prototype.usingPlugin=function(a){return!!this.activePlugins_&&!0===this.activePlugins_[a]};ra.prototype.hasPlugin=function(a){return!!Nb.hasOwnProperty(a)};const xi=a=>0===a.indexOf("#")?a.slice(1):a;H.hooks_=Mb;H.hooks=Xb;H.hook=function(a,b){Xb(a,b)};H.hookOnce=function(a,b){Xb(a, |
|
[].concat(b).map(c=>{const e=(...g)=>{oj(a,e);return c(...g)};return e}))};H.removeHook=oj;if(!0!==D.VIDEOJS_NO_DYNAMIC_STYLE&&Ac()){let a=Wb(".vjs-styles-defaults");if(!a){a=yj("vjs-styles-defaults");const b=Wb("head");b&&b.insertBefore(a,b.firstChild);zj(a,"\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n ")}}sf(1,H);H.VERSION="8.12.0";H.options=ra.prototype.options_;H.getPlayers= |
|
()=>ra.players;H.getPlayer=a=>{const b=ra.players;if("string"===typeof a){a=xi(a);const c=b[a];if(c)return c;a=Wb("#"+a)}if(Bc(a)){const {player:c,playerId:e}=a;if(c||b[e])return c||b[e]}};H.getAllPlayers=()=>Object.keys(ra.players).map(a=>ra.players[a]).filter(Boolean);H.players=ra.players;H.getComponent=M.getComponent;H.registerComponent=(a,b)=>{Z.isTech(b)&&da.warn(`The ${a} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`);return M.registerComponent.call(M, |
|
a,b)};H.getTech=Z.getTech;H.registerTech=Z.registerTech;H.use=function(a,b){fc[a]=fc[a]||[];fc[a].push(b)};Object.defineProperty(H,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(H.middleware,"TERMINATOR",{value:Zd,writeable:!1,enumerable:!0});H.browser=vj;H.obj=uo;H.mergeOptions=rb(9,"videojs.mergeOptions","videojs.obj.merge",ma);H.defineLazyProperty=rb(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Sd);H.bind=rb(9,"videojs.bind","native Function.prototype.bind", |
|
na);H.registerPlugin=fb.registerPlugin;H.deregisterPlugin=fb.deregisterPlugin;H.plugin=(a,b)=>{da.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return fb.registerPlugin(a,b)};H.getPlugins=fb.getPlugins;H.getPlugin=fb.getPlugin;H.getPluginVersion=fb.getPluginVersion;H.addLanguage=function(a,b){a=(""+a).toLowerCase();H.options.languages=ma(H.options.languages,{[a]:b});return H.options.languages[a]};H.log=da;H.createLogger=qj;H.time=zo;H.createTimeRange=rb(9,"videojs.createTimeRange", |
|
"videojs.time.createTimeRanges",qb);H.createTimeRanges=rb(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",qb);H.formatTime=rb(9,"videojs.formatTime","videojs.time.formatTime",dc);H.setFormatTime=rb(9,"videojs.setFormatTime","videojs.time.setFormatTime",qi);H.resetFormatTime=rb(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ri);H.parseUrl=rb(9,"videojs.parseUrl","videojs.url.parseUrl",hg);H.isCrossOrigin=rb(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",re);H.EventTarget= |
|
kb;H.any=wf;H.on=ab;H.one=Yd;H.off=Ma;H.trigger=Ec;H.xhr=Fi;H.TextTrack=od;H.AudioTrack=Kj;H.VideoTrack=Lj;"isEl isTextNode createEl hasClass addClass removeClass toggleClass setAttributes getAttributes emptyEl appendContent insertContent".split(" ").forEach(a=>{H[a]=function(){da.warn(`videojs.${a}() is deprecated; use videojs.dom.${a}() instead`);return xj[a].apply(null,arguments)}});H.computedStyle=rb(9,"videojs.computedStyle","videojs.dom.computedStyle",Dc);H.dom=xj;H.fn=wo;H.num=So;H.str=yo; |
|
H.url=Go;H.Error={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error", |
|
VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video", |
|
EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session",EMEFailedToRemoveKeysFromSession:"eme-failed-remove-keys",EMEFailedToLoadSessionBySessionId:"eme-failed-load-session"};class kp{constructor(a){let b=this;b.id=a.id; |
|
b.label=b.id;b.width=a.width;b.height=a.height;b.bitrate=a.bandwidth;b.frameRate=a.frameRate;b.enabled_=a.enabled;Object.defineProperty(b,"enabled",{get(){return b.enabled_()},set(c){b.enabled_(c)}});return b}}class xe extends H.EventTarget{constructor(){super();let a=this;a.levels_=[];a.selectedIndex_=-1;Object.defineProperty(a,"selectedIndex",{get(){return a.selectedIndex_}});Object.defineProperty(a,"length",{get(){return a.levels_.length}});a[Symbol.iterator]=()=>a.levels_.values();return a}addQualityLevel(a){let b= |
|
this.getQualityLevelById(a.id);if(b)return b;const c=this.levels_.length;b=new kp(a);""+c in this||Object.defineProperty(this,c,{get(){return this.levels_[c]}});this.levels_.push(b);this.trigger({qualityLevel:b,type:"addqualitylevel"});return b}removeQualityLevel(a){let b=null;for(let c=0,e=this.length;c<e;c++)if(this[c]===a){b=this.levels_.splice(c,1)[0];this.selectedIndex_===c?this.selectedIndex_=-1:this.selectedIndex_>c&&this.selectedIndex_--;break}b&&this.trigger({qualityLevel:a,type:"removequalitylevel"}); |
|
return b}getQualityLevelById(a){for(let b=0,c=this.length;b<c;b++){const e=this[b];if(e.id===a)return e}return null}dispose(){this.selectedIndex_=-1;this.levels_.length=0}}xe.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const a in xe.prototype.allowedEvents_)xe.prototype["on"+a]=null;const lp=function(a,b){const c=a.qualityLevels,e=new xe,g=function(){e.dispose();a.qualityLevels=c;a.off("dispose",g)};a.on("dispose",g);a.qualityLevels= |
|
()=>e;a.qualityLevels.VERSION="4.1.0";return e},yk=function(a){return lp(this,H.obj.merge({},a))};H.registerPlugin("qualityLevels",yk);yk.VERSION="4.1.0";const ye=(a,b)=>b&&b.responseURL&&a!==b.responseURL?b.responseURL:a,mb=a=>H.log.debug?H.log.debug.bind(H,"VHS:",`${a} >`):function(){},Db=1/30,Eb=3*Db,zk=function(a,b){const c=[];let e;if(a&&a.length)for(e=0;e<a.length;e++)b(a.start(e),a.end(e))&&c.push([a.start(e),a.end(e)]);return Na(c)},Pc=function(a,b){return zk(a,function(c,e){return c-Eb<= |
|
b&&e+Eb>=b})},ze=function(a,b){return zk(a,function(c){return c-Db>=b})},mp=function(a,b){let c=null,e=null,g=0;const l=[],p=[];if(!(a&&a.length&&b&&b.length))return Na();let t=a.length;for(;t--;)l.push({time:a.start(t),type:"start"}),l.push({time:a.end(t),type:"end"});for(t=b.length;t--;)l.push({time:b.start(t),type:"start"}),l.push({time:b.end(t),type:"end"});l.sort(function(x,y){return x.time-y.time});for(t=0;t<l.length;t++)"start"===l[t].type?(g++,2===g&&(c=l[t].time)):"end"===l[t].type&&(g--, |
|
1===g&&(e=l[t].time)),null!==c&&null!==e&&(p.push([c,e]),e=c=null);return Na(p)},Ak=a=>{const b=[];if(!a||!a.length)return"";for(let c=0;c<a.length;c++)b.push(a.start(c)+" \x3d\x3e "+a.end(c));return b.join(", ")},np=function(a,b,c=1){return((a.length?a.end(a.length-1):0)-b)/c},lc=a=>{const b=[];for(let c=0;c<a.length;c++)b.push({start:a.start(c),end:a.end(c)});return b},op=function(a,b){if(a===b)return!1;if(!a&&b||!b&&a||a.length!==b.length)return!0;for(let c=0;c<a.length;c++)if(a.start(c)!==b.start(c)|| |
|
a.end(c)!==b.end(c))return!0;return!1},Eg=function(a){if(a&&a.length&&a.end)return a.end(a.length-1)},Fg=function(a,b){let c=0;if(!a||!a.length)return c;for(let e=0;e<a.length;e++){const g=a.start(e),l=a.end(e);b>l||(c=b>g&&b<=l?c+(l-b):c+(l-g))}return c},Gg=(a,b)=>{if(!b.preload)return b.duration;let c=0;(b.parts||[]).forEach(function(e){c+=e.duration});(b.preloadHints||[]).forEach(function(e){"PART"===e.type&&(c+=a.partTargetDuration)});return c},Hg=a=>(a.segments||[]).reduce((b,c,e)=>{c.parts? |
|
c.parts.forEach(function(g,l){b.push({duration:g.duration,segmentIndex:e,partIndex:l,part:g,segment:c})}):b.push({duration:c.duration,segmentIndex:e,partIndex:null,segment:c,part:null});return b},[]),Bk=a=>(a=a.segments&&a.segments.length&&a.segments[a.segments.length-1])&&a.parts||[],Ck=({preloadSegment:a})=>{if(a){var {parts:b,preloadHints:c}=a;a=(c||[]).reduce((e,g)=>e+("PART"===g.type?1:0),0);return a+=b&&b.length?b.length:0}},Dk=(a,b)=>b.endList?0:a&&a.suggestedPresentationDelay?a.suggestedPresentationDelay: |
|
(a=0<Bk(b).length)&&b.serverControl&&b.serverControl.partHoldBack?b.serverControl.partHoldBack:a&&b.partTargetDuration?3*b.partTargetDuration:b.serverControl&&b.serverControl.holdBack?b.serverControl.holdBack:b.targetDuration?3*b.targetDuration:0,pp=function(a,b){let c=0;b-=a.mediaSequence;let e=a.segments[b];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(;b--;){e=a.segments[b];if("undefined"!==typeof e.end)return{result:c+ |
|
e.end,precise:!0};c+=Gg(a,e);if("undefined"!==typeof e.start)return{result:c+e.start,precise:!0}}return{result:c,precise:!1}},Ek=function(a,b,c){"undefined"===typeof b&&(b=a.mediaSequence+a.segments.length);if(b<a.mediaSequence)return 0;const e=pp(a,b);if(e.precise)return e.result;a:{let g=0,l=b-a.mediaSequence;for(;l<a.segments.length;l++){b=a.segments[l];if("undefined"!==typeof b.start){a={result:b.start-g,precise:!0};break a}g+=Gg(a,b);if("undefined"!==typeof b.end){a={result:b.end-g,precise:!0}; |
|
break a}}a={result:-1,precise:!1}}return a.precise?a.result:e.result+c},Fk=function(a,b,c){if(!a)return 0;"number"!==typeof c&&(c=0);if("undefined"===typeof b){if(a.totalDuration)return a.totalDuration;if(!a.endList)return D.Infinity}return Ek(a,b,c)},sd=function({defaultDuration:a,durationList:b,startIndex:c,endIndex:e}){let g=0;c>e&&([c,e]=[e,c]);if(0>c){for(;c<Math.min(0,e);c++)g+=a;c=0}for(a=c;a<e;a++)g+=b[a].duration;return g},Gk=function(a,b,c,e){if(!a||!a.segments)return null;if(a.endList)return Fk(a); |
|
if(null===b)return null;b=Ek(a,a.mediaSequence+a.segments.length,b||0);c&&(e="number"===typeof e?e:Dk(null,a),b-=e);return Math.max(0,b)},Hk=function(a){return a.excludeUntil&&a.excludeUntil>Date.now()},Ig=function(a){return a.excludeUntil&&Infinity===a.excludeUntil},Ae=function(a){const b=Hk(a);return!a.disabled&&!b},Ik=function(a,b){return b.attributes&&b.attributes[a]},Jg=(a,b)=>{if(1===a.playlists.length)return!0;const c=b.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===a.playlists.filter(e=> |
|
Ae(e)?(e.attributes.BANDWIDTH||0)<c:!1).length},Kg=(a,b)=>!a&&!b||!a&&b||a&&!b?!1:a===b||a.id&&b.id&&a.id===b.id||a.resolvedUri&&b.resolvedUri&&a.resolvedUri===b.resolvedUri||a.uri&&b.uri&&a.uri===b.uri?!0:!1,Jk=function(a,b){a=a&&a.mediaGroups&&a.mediaGroups.AUDIO||{};let c=!1;for(const e in a){for(const g in a[e])if(c=b(a[e][g]))break;if(c)break}return!!c},td=a=>{if(!a||!a.playlists||!a.playlists.length)return Jk(a,b=>b.playlists&&b.playlists.length||b.uri);for(let b=0;b<a.playlists.length;b++){const c= |
|
a.playlists[b],e=c.attributes&&c.attributes.CODECS;if(!(e&&e.split(",").every(g=>Mi(g))||Jk(a,g=>Kg(c,g))))return!1}return!0};var Ya={liveEdgeDelay:Dk,duration:Fk,seekable:function(a,b,c){const e=b||0;a=Gk(a,b,!0,c);if(null===a)return Na();a<e&&(a=e);return Na(e,a)},getMediaInfoForTime:function({playlist:a,currentTime:b,startingSegmentIndex:c,startingPartIndex:e,startTime:g,exactManifestTimings:l}){let p=b-g;const t=Hg(a);var x=0;for(var y=0;y<t.length;y++){const A=t[y];if(c===A.segmentIndex&&("number"!== |
|
typeof e||"number"!==typeof A.partIndex||e===A.partIndex)){x=y;break}}if(0>p){if(0<x)for(c=x-1;0<=c;c--){e=t[c];p+=e.duration;if(l){if(0>p)continue}else if(0>=p+Db)continue;return{partIndex:e.partIndex,segmentIndex:e.segmentIndex,startTime:g-sd({defaultDuration:a.targetDuration,durationList:t,startIndex:x,endIndex:c})}}return{partIndex:t[0]&&t[0].partIndex||null,segmentIndex:t[0]&&t[0].segmentIndex||0,startTime:b}}if(0>x){for(;0>x;x++)if(p-=a.targetDuration,0>p)return{partIndex:t[0]&&t[0].partIndex|| |
|
null,segmentIndex:t[0]&&t[0].segmentIndex||0,startTime:b};x=0}for(c=x;c<t.length;c++)if(e=t[c],p-=e.duration,y=e.duration>Db&&0<=p+Db,0!==p&&!y||c===t.length-1){if(l){if(0<p)continue}else if(0<=p-Db)continue;return{partIndex:e.partIndex,segmentIndex:e.segmentIndex,startTime:g+sd({defaultDuration:a.targetDuration,durationList:t,startIndex:x,endIndex:c})}}return{segmentIndex:t[t.length-1].segmentIndex,partIndex:t[t.length-1].partIndex,startTime:b}},isEnabled:Ae,isDisabled:function(a){return a.disabled}, |
|
isExcluded:Hk,isIncompatible:Ig,playlistEnd:Gk,isAes:function(a){for(let b=0;b<a.segments.length;b++)if(a.segments[b].key)return!0;return!1},hasAttribute:Ik,estimateSegmentRequestTime:function(a,b,c,e=0){return Ik("BANDWIDTH",c)?(a*c.attributes.BANDWIDTH-8*e)/b:NaN},isLowestEnabledRendition:Jg,isAudioOnly:td,playlistMatch:Kg,segmentDurationWithParts:Gg};const {log:Kk}=H,Lk=(a,b,c)=>`placeholder-uri-${a}-${b}-${c}`,qp=({onwarn:a,oninfo:b,manifestString:c,customTagParsers:e=[],customTagMappers:g=[], |
|
llhls:l})=>{const p=new jn;if(a)p.on("warn",a);if(b)p.on("info",b);e.forEach(x=>p.addParser(x));g.forEach(x=>p.addTagMapper(x));p.push(c);p.end();const t=p.manifest;l||("preloadSegment skip serverControl renditionReports partInf partTargetDuration".split(" ").forEach(function(x){t.hasOwnProperty(x)&&delete t[x]}),t.segments&&t.segments.forEach(function(x){["parts","preloadHints"].forEach(function(y){x.hasOwnProperty(y)&&delete x[y]})}));t.targetDuration||(b=10,t.segments&&t.segments.length&&(b=t.segments.reduce((x, |
|
y)=>Math.max(x,y.duration),0)),a&&a({message:`manifest has no targetDuration defaulting to ${b}`}),t.targetDuration=b);b=Bk(t);b.length&&!t.partTargetDuration&&(b=b.reduce((x,y)=>Math.max(x,y.duration),0),a&&(a({message:`manifest has no partTargetDuration defaulting to ${b}`}),Kk.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),t.partTargetDuration= |
|
b);return t},Qc=(a,b)=>{a.mediaGroups&&["AUDIO","SUBTITLES"].forEach(c=>{if(a.mediaGroups[c])for(const e in a.mediaGroups[c])for(const g in a.mediaGroups[c][e])b(a.mediaGroups[c][e][g],c,e,g)})},Mk=({playlist:a,uri:b,id:c})=>{a.id=c;a.playlistErrors_=0;b&&(a.uri=b);a.attributes=a.attributes||{}},rp=a=>{let b=a.playlists.length;for(;b--;){const c=a.playlists[b];Mk({playlist:c,id:`${b}-${c.uri}`});c.resolvedUri=Ja(a.uri,c.uri);a.playlists[c.id]=c;a.playlists[c.uri]=c;c.attributes.BANDWIDTH||Kk.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}, |
|
sp=a=>{Qc(a,b=>{b.uri&&(b.resolvedUri=Ja(a.uri,b.uri))})},tp=(a,b)=>{a=`${0}-${b}`;const c={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:D.location.href,resolvedUri:D.location.href,playlists:[{uri:b,id:a,resolvedUri:b,attributes:{}}]};c.playlists[a]=c.playlists[0];c.playlists[b]=c.playlists[0];return c},Nk=(a,b,c=Lk)=>{a.uri=b;for(b=0;b<a.playlists.length;b++)a.playlists[b].uri||(a.playlists[b].uri=`placeholder-uri-${b}`);const e=td(a);Qc(a,(g,l,p,t)=>{if(!g.playlists||!g.playlists.length){if(e&& |
|
"AUDIO"===l&&!g.uri)for(let x=0;x<a.playlists.length;x++){const y=a.playlists[x];if(y.attributes&&y.attributes.AUDIO&&y.attributes.AUDIO===p)return}g.playlists=[nb({},g)]}g.playlists.forEach(function(x,y){const A=c(l,p,t,x),z=`${y}-${A}`;x.uri?x.resolvedUri=x.resolvedUri||Ja(a.uri,x.uri):(x.uri=0===y?A:z,x.resolvedUri=x.uri);x.id=x.id||z;x.attributes=x.attributes||{};a.playlists[x.id]=x;a.playlists[x.uri]=x})});rp(a);sp(a)};class Ok{constructor(){this.offset_=null;this.pendingDateRanges_=new Map; |
|
this.processedDateRanges_=new Map}setOffset(a=[]){null===this.offset_&&a.length&&([a]=a,void 0!==a.programDateTime&&(this.offset_=a.programDateTime/1E3))}setPendingDateRanges(a=[]){if(a.length){var [b]=a;b=b.startDate.getTime();this.trimProcessedDateRanges_(b);this.pendingDateRanges_=a.reduce((c,e)=>{c.set(e.id,e);return c},new Map)}}processDateRange(a){this.pendingDateRanges_.delete(a.id);this.processedDateRanges_.set(a.id,a)}getDateRangesToProcess(){if(null===this.offset_)return[];const a={},b= |
|
[];this.pendingDateRanges_.forEach((c,e)=>{this.processedDateRanges_.has(e)||(c.startTime=c.startDate.getTime()/1E3-this.offset_,c.processDateRange=()=>this.processDateRange(c),b.push(c),c.class&&(a[c.class]?(e=a[c.class].push(c),c.classListIndex=e-1):(a[c.class]=[c],c.classListIndex=0)))});for(const c of b){const e=a[c.class]||[];c.endTime=c.endDate?c.endDate.getTime()/1E3-this.offset_:c.endOnNext&&e[c.classListIndex+1]?e[c.classListIndex+1].startTime:c.duration?c.startTime+c.duration:c.plannedDuration? |
|
c.startTime+c.plannedDuration:c.startTime}return b}trimProcessedDateRanges_(a){(new Map(this.processedDateRanges_)).forEach((b,c)=>{b.startDate.getTime()<a&&this.processedDateRanges_.delete(c)})}}const {EventTarget:up}=H,vp=(a,b)=>{if(b.endList||!b.serverControl)return a;const c={};if(b.serverControl.canBlockReload){var {preloadSegment:e}=b;let g=b.mediaSequence+b.segments.length;if(e){e=e.parts||[];const l=Ck(b)-1;-1<l&&l!==e.length-1&&(c._HLS_part=l);(-1<l||e.length)&&g--}c._HLS_msn=g}b.serverControl&& |
|
b.serverControl.canSkipUntil&&(c._HLS_skip=b.serverControl.canSkipDateranges?"v2":"YES");if(Object.keys(c).length){const g=new D.URL(a);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(l){c.hasOwnProperty(l)&&g.searchParams.set(l,c[l])});a=g.toString()}return a},wp=(a,b,c)=>{a=a.slice();b=b.slice();c=c||0;const e=[];let g;for(let y=0;y<b.length;y++){var l=a[y+c],p=b[y];if(l){g=l.map||g;var t=e,x=t.push;a:{if(!l){l=p;break a}const A=ia(l,p);l.preloadHints&&!p.preloadHints&&delete A.preloadHints; |
|
if(l.parts&&!p.parts)delete A.parts;else if(l.parts&&p.parts)for(let z=0;z<p.parts.length;z++)l.parts&&l.parts[z]&&(A.parts[z]=ia(l.parts[z],p.parts[z]));!l.skipped&&p.skipped&&(A.skipped=!1);l.preload&&!p.preload&&(A.preload=!1);l=A}x.call(t,l)}else g&&!p.map&&(p.map=g),e.push(p)}return e},Pk=(a,b)=>{!a.resolvedUri&&a.uri&&(a.resolvedUri=Ja(b,a.uri));a.key&&!a.key.resolvedUri&&(a.key.resolvedUri=Ja(b,a.key.uri));a.map&&!a.map.resolvedUri&&(a.map.resolvedUri=Ja(b,a.map.uri));a.map&&a.map.key&&!a.map.key.resolvedUri&& |
|
(a.map.key.resolvedUri=Ja(b,a.map.key.uri));a.parts&&a.parts.length&&a.parts.forEach(c=>{c.resolvedUri||(c.resolvedUri=Ja(b,c.uri))});a.preloadHints&&a.preloadHints.length&&a.preloadHints.forEach(c=>{c.resolvedUri||(c.resolvedUri=Ja(b,c.uri))})},Qk=function(a){const b=a.segments||[],c=a.preloadSegment;if(c&&c.parts&&c.parts.length){if(c.preloadHints)for(let e=0;e<c.preloadHints.length;e++)if("MAP"===c.preloadHints[e].type)return b;c.duration=a.targetDuration;c.preload=!0;b.push(c)}return b},Rk=(a, |
|
b)=>a===b||a.segments&&b.segments&&a.segments.length===b.segments.length&&a.endList===b.endList&&a.mediaSequence===b.mediaSequence&&a.preloadSegment===b.preloadSegment,Lg=(a,b,c=Rk)=>{const e=ia(a,{});var g=e.playlists[b.id];if(!g||c(g,b))return null;b.segments=Qk(b);const l=ia(g,b);l.preloadSegment&&!b.preloadSegment&&delete l.preloadSegment;if(g.segments){if(b.skip)for(b.segments=b.segments||[],c=0;c<b.skip.skippedSegments;c++)b.segments.unshift({skipped:!0});l.segments=wp(g.segments,b.segments, |
|
b.mediaSequence-g.mediaSequence)}l.segments.forEach(p=>{Pk(p,l.resolvedUri)});for(g=0;g<e.playlists.length;g++)e.playlists[g].id===b.id&&(e.playlists[g]=l);e.playlists[b.id]=l;e.playlists[b.uri]=l;Qc(a,(p,t,x,y)=>{if(p.playlists)for(t=0;t<p.playlists.length;t++)b.id===p.playlists[t].id&&(p.playlists[t]=l)});return e},Mg=(a,b)=>{var c=a.segments||[];const e=(c=c[c.length-1])&&c.parts&&c.parts[c.parts.length-1];c=e&&e.duration||c&&c.duration;return b&&c?1E3*c:500*(a.partTargetDuration||a.targetDuration|| |
|
10)};class Rc extends up{constructor(a,b,c={}){super();if(!a)throw Error("A non-empty playlist URL or object is required");this.logger_=mb("PlaylistLoader");const {withCredentials:e=!1}=c;this.src=a;this.vhs_=b;this.withCredentials=e;this.addDateRangesToTextTrack_=c.addDateRangesToTextTrack;this.customTagParsers=(a=b.options_)&&a.customTagParsers||[];this.customTagMappers=a&&a.customTagMappers||[];this.llhls=a&&a.llhls;this.dateRangesStorage_=new Ok;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_= |
|
this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){var a=this.media();a&&(this.dateRangesStorage_.setOffset(a.segments),this.dateRangesStorage_.setPendingDateRanges(a.dateRanges),a=this.dateRangesStorage_.getDateRangesToProcess(),a.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(a))}handleMediaupdatetimeout_(){if("HAVE_METADATA"===this.state){var a= |
|
this.media(),b=Ja(this.main.uri,a.uri);this.llhls&&(b=vp(b,a));this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:b,withCredentials:this.withCredentials,requestType:"hls-playlist"},(c,e)=>{if(this.request){if(c)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}}playlistRequestError(a,b,c){const {uri:e,id:g}=b;this.request=null;c&&(this.state=c);this.error= |
|
{playlist:this.main.playlists[g],status:a.status,message:`HLS playlist request error at URL: ${e}.`,responseText:a.responseText,code:500<=a.status?4:2,metadata:{errorType:H.Error.HlsPlaylistRequestError}};this.trigger("error")}parseManifest_({url:a,manifestString:b}){return qp({onwarn:({message:c})=>this.logger_(`m3u8-parser warn for ${a}: ${c}`),oninfo:({message:c})=>this.logger_(`m3u8-parser info for ${a}: ${c}`),manifestString:b,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers, |
|
llhls:this.llhls})}haveMetadata({playlistString:a,playlistObject:b,url:c,id:e}){this.request=null;this.state="HAVE_METADATA";a=b||this.parseManifest_({url:c,manifestString:a});a.lastRequest=Date.now();Mk({playlist:a,uri:c,id:e});c=Lg(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration;this.pendingMedia_=null;c?(this.main=c,this.media_=this.main.playlists[e]):this.trigger("playlistunchanged");this.updateMediaUpdateTimeout_(Mg(this.media(),!!c));this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"); |
|
this.stopRequest();D.clearTimeout(this.mediaUpdateTimeout);D.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new Ok;this.off()}stopRequest(){if(this.request){const a=this.request;this.request=null;a.onreadystatechange=null;a.abort()}}media(a,b){if(!a)return this.media_;if("HAVE_NOTHING"===this.state)throw Error("Cannot switch media playlist from "+this.state);if("string"===typeof a){if(!this.main.playlists[a])throw Error("Unknown playlist URI: "+a);a=this.main.playlists[a]}D.clearTimeout(this.finalRenditionTimeout); |
|
if(b)b=(a.partTargetDuration||a.targetDuration)/2*1E3||5E3,this.finalRenditionTimeout=D.setTimeout(this.media.bind(this,a,!1),b);else{var c=this.state;b=!this.media_||a.id!==this.media_.id;var e=this.main.playlists[a.id];if(e&&e.endList||a.endList&&a.segments.length)this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=a,b&&(this.trigger("mediachanging"),"HAVE_MAIN_MANIFEST"===c?this.trigger("loadedmetadata"):this.trigger("mediachange")); |
|
else if(this.updateMediaUpdateTimeout_(Mg(a,!0)),b){this.state="SWITCHING_MEDIA";if(this.request){if(a.resolvedUri===this.request.url)return;this.request.onreadystatechange=null;this.request.abort();this.request=null}this.media_&&this.trigger("mediachanging");this.pendingMedia_=a;this.request=this.vhs_.xhr({uri:a.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(g,l)=>{if(this.request){a.lastRequest=Date.now();a.resolvedUri=ye(a.resolvedUri,l);if(g)return this.playlistRequestError(this.request, |
|
a,c);this.haveMetadata({playlistString:l.responseText,url:a.uri,id:a.id});"HAVE_MAIN_MANIFEST"===c?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}}pause(){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);this.stopRequest();"HAVE_NOTHING"===this.state&&(this.started=!1);"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(a){this.mediaUpdateTimeout&& |
|
(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const b=this.media();a?this.mediaUpdateTimeout=D.setTimeout(()=>{this.mediaUpdateTimeout=null;this.load()},b?(b.partTargetDuration||b.targetDuration)/2*1E3:5E3):this.started?b&&!b.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()}updateMediaUpdateTimeout_(a){this.mediaUpdateTimeout&&(D.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);this.media()&&!this.media().endList&&(this.mediaUpdateTimeout= |
|
D.setTimeout(()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(a)},a))}start(){this.started=!0;"object"===typeof this.src?(this.src.uri||(this.src.uri=D.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0)):this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(a,b)=>{if(this.request){this.request=null;if(a)return this.error={status:b.status,message:`HLS playlist request error at URL: ${this.src}.`, |
|
responseText:b.responseText,code:2,metadata:{errorType:H.Error.HlsPlaylistRequestError}},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.src=ye(this.src,b);a=this.parseManifest_({manifestString:b.responseText,url:this.src});this.setupInitialPlaylist(a)}})}srcUri(){return"string"===typeof this.src?this.src:this.src.uri}setupInitialPlaylist(a){this.state="HAVE_MAIN_MANIFEST";if(a.playlists)this.main=a,Nk(this.main,this.srcUri()),a.playlists.forEach(c=>{c.segments=Qk(c);c.segments.forEach(e=> |
|
{Pk(e,c.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);else{var b=this.srcUri()||D.location.href;this.main=tp(a,b);this.haveMetadata({playlistObject:a,url:b,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}}updateOrDeleteClone(a,b){const c=this.main,e=a.ID;let g=c.playlists.length;for(;g--;){var l=c.playlists[g];if(l.attributes["PATHWAY-ID"]===e){const p=l.resolvedUri,t=l.id;if(b){const x=this.createCloneURI_(l.resolvedUri,a),y=`${e}-${x}`, |
|
A=this.createCloneAttributes_(e,l.attributes);l=this.createClonePlaylist_(l,y,a,A);c.playlists[g]=l;c.playlists[y]=l;c.playlists[x]=l}else c.playlists.splice(g,1);delete c.playlists[t];delete c.playlists[p]}}this.updateOrDeleteCloneMedia(a,b)}updateOrDeleteCloneMedia(a,b){const c=this.main,e=a.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(g=>{if(c.mediaGroups[g]&&c.mediaGroups[g][e])for(const l in c.mediaGroups[g])if(l===e){for(const p in c.mediaGroups[g][l])c.mediaGroups[g][l][p].playlists.forEach((t, |
|
x)=>{t=c.playlists[t.id];x=t.resolvedUri;delete c.playlists[t.id];delete c.playlists[x]});delete c.mediaGroups[g][l]}});b&&this.createClonedMediaGroups_(a)}addClonePathway(a,b={}){const c=this.main,e=c.playlists.length,g=this.createCloneURI_(b.resolvedUri,a),l=`${a.ID}-${g}`,p=this.createCloneAttributes_(a.ID,b.attributes);b=this.createClonePlaylist_(b,l,a,p);c.playlists[e]=b;c.playlists[l]=b;c.playlists[g]=b;this.createClonedMediaGroups_(a)}createClonedMediaGroups_(a){const b=a.ID,c=a["BASE-ID"], |
|
e=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(g=>{if(e.mediaGroups[g]&&!e.mediaGroups[g][b])for(const l in e.mediaGroups[g])if(l===c){e.mediaGroups[g][b]={};for(const p in e.mediaGroups[g][l]){const t=e.mediaGroups[g][l][p];e.mediaGroups[g][b][p]=nb({},t);const x=e.mediaGroups[g][b][p],y=this.createCloneURI_(t.resolvedUri,a);x.resolvedUri=y;x.uri=y;x.playlists=[];t.playlists.forEach((A,z)=>{var E=e.playlists[A.id],I=Lk(g,b,p);I=`${b}-${I}`;if(E&&!e.playlists[I]){E=this.createClonePlaylist_(E, |
|
I,a);const G=E.resolvedUri;e.playlists[I]=E;e.playlists[G]=E}x.playlists[z]=this.createClonePlaylist_(A,I,a)})}}})}createClonePlaylist_(a,b,c,e){c=this.createCloneURI_(a.resolvedUri,c);b={resolvedUri:c,uri:c,id:b};a.segments&&(b.segments=[]);e&&(b.attributes=e);return ia(a,b)}createCloneURI_(a,b){a=new URL(a);a.hostname=b["URI-REPLACEMENT"].HOST;b=b["URI-REPLACEMENT"].PARAMS;for(const c of Object.keys(b))a.searchParams.set(c,b[c]);return a.href}createCloneAttributes_(a,b){const c={["PATHWAY-ID"]:a}; |
|
["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{b[e]&&(c[e]=a)});return c}getKeyIdSet(a){if(a.contentProtection){const b=new Set;for(const c in a.contentProtection){const e=a.contentProtection[c].attributes.keyId;e&&b.add(e.toLowerCase())}return b}}}const Ng=function(a,b,c,e){const g="arraybuffer"===a.responseType?a.response:a.responseText;!b&&g&&(a.responseTime=Date.now(),a.roundTripTime=a.responseTime-a.requestTime,a.bytesReceived=g.byteLength||g.length,a.bandwidth||(a.bandwidth=Math.floor(a.bytesReceived/ |
|
a.roundTripTime*8E3)));c.headers&&(a.responseHeaders=c.headers);b&&"ETIMEDOUT"===b.code&&(a.timedout=!0);b||a.aborted||200===c.statusCode||206===c.statusCode||0===c.statusCode||(b=Error("XHR Failed with a response of: "+(a&&(g||a.responseText))));e(b,a)},xp=(a,b)=>{if(a&&a.size){var c=b;a.forEach(e=>{c=e(c)});return c}},yp=(a,b,c,e)=>{a&&a.size&&a.forEach(g=>{g(b,c,e)})},Sk=function(){const a=function g(c,e){c=ia({timeout:45E3},c);const l=g.beforeRequest||H.Vhs.xhr.beforeRequest,p=g._requestCallbackSet|| |
|
H.Vhs.xhr._requestCallbackSet||new Set,t=g._responseCallbackSet||H.Vhs.xhr._responseCallbackSet;l&&"function"===typeof l&&(H.log.warn("beforeRequest is deprecated, use onRequest instead."),p.add(l));const x=!0===H.Vhs.xhr.original?H.xhr:H.Vhs.xhr,y=xp(p,c);p.delete(l);const A=x(y||c,function(E,I){yp(t,A,E,I);return Ng(A,E,I,e)}),z=A.abort;A.abort=function(){A.aborted=!0;return z.apply(A,arguments)};A.uri=c.uri;A.requestTime=Date.now();return A};a.original=!0;return a},Og=function(a){const b={};if(a.byterange){var c= |
|
a.byterange;a=c.offset;c="bigint"===typeof c.offset||"bigint"===typeof c.length?D.BigInt(c.offset)+D.BigInt(c.length)-D.BigInt(1):c.offset+c.length-1;b.Range="bytes\x3d"+a+"-"+c}return b},zp=function(a,b){a=a.toString(16);return"00".substring(0,2-a.length)+a+(b%2?" ":"")},Ap=function(a){return 32<=a&&126>a?String.fromCharCode(a):"."},Tk=function(a){const b={};Object.keys(a).forEach(c=>{const e=a[c];Oi(e)?b[c]={bytes:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength}:b[c]=e});return b},Be=function(a){const b= |
|
a.byterange||{length:Infinity,offset:0};return[b.length,b.offset,a.resolvedUri].join()},Uk=a=>{a=Array.prototype.slice.call(a);let b="",c,e;for(let g=0;g<a.length/16;g++)c=a.slice(16*g,16*g+16).map(zp).join(""),e=a.slice(16*g,16*g+16).map(Ap).join(""),b+=c+" "+e+"\n";return b};var Bp=Object.freeze({__proto__:null,createTransferableMessage:Tk,initSegmentId:Be,segmentKeyId:function(a){return a.resolvedUri},hexDump:Uk,tagDump:({bytes:a})=>Uk(a),textRanges:a=>{var b="";let c;for(c=0;c<a.length;c++){var e= |
|
a;var g=c;e=e.start(g)+"-"+e.end(g);b+=e+" "}return b}});const Cp=(a,b)=>{let c;try{c=new Date(a)}catch(p){return null}if(!b||!b.segments||0===b.segments.length)return null;a=b.segments[0];if(c<new Date(a.dateTimeObject))return null;for(var e=0;e<b.segments.length-1&&!(a=b.segments[e],c<new Date(b.segments[e+1].dateTimeObject));e++);e=b.segments[b.segments.length-1];const g=e.dateTimeObject;if(e.videoTimingInfo){var l=e.videoTimingInfo;l=l.transmuxedPresentationEnd-l.transmuxedPresentationStart-l.transmuxerPrependedSeconds}else l= |
|
e.duration+.25*e.duration;l=new Date(g.getTime()+1E3*l);if(c>l)return null;c>new Date(g)&&(a=e);return{segment:a,estimatedStart:a.videoTimingInfo?a.videoTimingInfo.transmuxedPresentationStart:Ya.duration(b,b.mediaSequence+b.segments.indexOf(a)),type:a.videoTimingInfo?"accurate":"estimate"}},Dp=(a,b)=>{if(!b||!b.segments||0===b.segments.length)return null;let c=0,e;for(let g=0;g<b.segments.length&&!(e=b.segments[g],c=e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationEnd:c+e.duration,a<=c);g++); |
|
b=b.segments[b.segments.length-1];if(b.videoTimingInfo&&b.videoTimingInfo.transmuxedPresentationEnd<a)return null;if(a>c){if(a>c+.25*b.duration)return null;e=b}return{segment:e,estimatedStart:e.videoTimingInfo?e.videoTimingInfo.transmuxedPresentationStart:c-e.duration,type:e.videoTimingInfo?"accurate":"estimate"}},Ep=(a,b)=>{let c,e;try{c=new Date(a),e=new Date(b)}catch(g){}a=c.getTime();return(e.getTime()-a)/1E3},Fp=a=>{if(!a.segments||0===a.segments.length)return!1;for(let b=0;b<a.segments.length;b++)if(!a.segments[b].dateTimeObject)return!1; |
|
return!0},Gp=({playlist:a,time:b,callback:c})=>{if(!c)throw Error("getProgramTime: callback must be provided");if(!a||void 0===b)return c({message:"getProgramTime: playlist and time must be provided"});var e=Dp(b,a);if(!e)return c({message:"valid programTime was not found"});if("estimate"===e.type)return c({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:e.estimatedStart});a={mediaSeconds:b};e=e.segment;e.dateTimeObject?(b-=e.videoTimingInfo.transmuxedPresentationStart+ |
|
e.videoTimingInfo.transmuxerPrependedSeconds,b=new Date(e.dateTimeObject.getTime()+1E3*b)):b=null;b&&(a.programDateTime=b.toISOString());return c(null,a)},Vk=({programTime:a,playlist:b,retryCount:c=2,seekTo:e,pauseAfterSeek:g=!0,tech:l,callback:p})=>{if(!p)throw Error("seekToProgramTime: callback must be provided");if("undefined"===typeof a||!b||!e)return p({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!b.endList&&!l.hasStarted_)return p({message:"player must be playing a live stream to start buffering"}); |
|
if(!Fp(b))return p({message:"programDateTime tags must be provided in the manifest "+b.resolvedUri});var t=Cp(a,b);if(!t)return p({message:`${a} was not found in the stream`});const x=t.segment,y=Ep(x.dateTimeObject,a);if("estimate"===t.type){if(0===c)return p({message:`${a} is not buffered yet. Try again`});e(t.estimatedStart+y);l.one("seeked",()=>{Vk({programTime:a,playlist:b,retryCount:c-1,seekTo:e,pauseAfterSeek:g,tech:l,callback:p})})}else t=x.start+y,l.one("seeked",()=>p(null,l.currentTime())), |
|
g&&l.pause(),e(t)},Wk=(a,b)=>{if(4===a.readyState)return b()},Hp=(a,b,c)=>{let e=[],g,l=!1;const p=function(y,A,z,E){A.abort();l=!0;return c(y,A,z,E)},t=function(y,A){if(!l){if(y)return p(y,A,"",e);var z=A.responseText.substring(e&&e.byteLength||0,A.responseText.length);e=rn(e,Pi(z,!0));g=g||kd(e);if(10>e.length||g&&e.length<g+2)return Wk(A,()=>p(y,A,"",e));z=Vf(e);return"ts"===z&&188>e.length||!z&&376>e.length?Wk(A,()=>p(y,A,"",e)):p(null,A,z,e)}},x=b({uri:a,beforeSend(y){y.overrideMimeType("text/plain; charset\x3dx-user-defined"); |
|
y.addEventListener("progress",function({}){return Ng(y,null,{statusCode:y.status},t)})}},function(y,A){return Ng(x,y,A,t)});return x},{EventTarget:Ip}=H,Xk=function(a,b){if(!Rk(a,b)||a.sidx&&b.sidx&&(a.sidx.offset!==b.sidx.offset||a.sidx.length!==b.sidx.length)||!a.sidx&&b.sidx||a.sidx&&!b.sidx||a.segments&&!b.segments||!a.segments&&b.segments)return!1;if(!a.segments&&!b.segments)return!0;for(let g=0;g<a.segments.length;g++){var c=a.segments[g],e=b.segments[g];if(c.uri!==e.uri)return!1;if(c.byterange|| |
|
e.byterange)if(c=c.byterange,e=e.byterange,c&&!e||!c&&e||c.offset!==e.offset||c.length!==e.length)return!1}return!0},Jp=(a,b,c,e)=>`placeholder-uri-${a}-${b}-${e.attributes.NAME||c}`,Kp=({mainXml:a,srcUrl:b,clientOffset:c,sidxMapping:e,previousManifest:g})=>{a=io(a,{manifestUri:b,clientOffset:c,sidxMapping:e,previousManifest:g});Nk(a,b,Jp);return a},Lp=(a,b)=>{Qc(a,(c,e,g,l)=>{l in b.mediaGroups[e][g]||delete a.mediaGroups[e][g][l]})},Mp=(a,b,c)=>{let e=!0,g=ia(a,{duration:b.duration,minimumUpdatePeriod:b.minimumUpdatePeriod, |
|
timelineStarts:b.timelineStarts});for(let p=0;p<b.playlists.length;p++){var l=b.playlists[p];if(l.sidx){const t=de(l.sidx);c&&c[t]&&c[t].sidx&&Pf(l,c[t].sidx,l.sidx.resolvedUri)}if(l=Lg(g,l,Xk))g=l,e=!1}Qc(b,(p,t,x,y)=>{if(p.playlists&&p.playlists.length){const A=p.playlists[0].id,z=Lg(g,p.playlists[0],Xk);z&&(g=z,y in g.mediaGroups[t][x]||(g.mediaGroups[t][x][y]=p),g.mediaGroups[t][x][y].playlists[0]=g.playlists[A],e=!1)}});Lp(g,b);b.minimumUpdatePeriod!==a.minimumUpdatePeriod&&(e=!1);return e?null: |
|
g},Yk=(a,b)=>{const c={};for(const e in a){const g=a[e].sidx;if(g){const l=de(g);if(!b[l])break;const p=b[l].sidxInfo;(!p.map&&!g.map||p.map&&g.map&&p.map.byterange.offset===g.map.byterange.offset&&p.map.byterange.length===g.map.byterange.length)&&p.uri===g.uri&&p.byterange.offset===g.byterange.offset&&p.byterange.length===g.byterange.length&&(c[l]=b[l])}}return c},Np=(a,b)=>{let c=Yk(a.playlists,b);Qc(a,(e,g,l,p)=>{e.playlists&&e.playlists.length&&(c=ia(c,Yk(e.playlists,b)))});return c};class Pg extends Ip{constructor(a, |
|
b,c={},e){super();this.mainPlaylistLoader_=e||this;e||(this.isMain_=!0);({withCredentials:e=!1}=c);this.vhs_=b;this.withCredentials=e;this.addMetadataToTextTrack=c.addMetadataToTextTrack;if(!a)throw Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()});this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)});this.state="HAVE_NOTHING";this.loadedPlaylists_={};this.logger_=mb("DashPlaylistLoader");this.isMain_?(this.mainPlaylistLoader_.srcUrl= |
|
a,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=a}requestErrored_(a,b,c){if(!this.request)return!0;this.request=null;if(a)return this.error="object"!==typeof a||a instanceof Error?{status:b.status,message:"DASH request error at URL: "+b.uri,response:b.response,code:2,metadata:a.metadata}:a,c&&(this.state=c),this.trigger("error"),!0}addSidxSegments_(a,b,c){const e=a.sidx&&de(a.sidx);if(a.sidx&&e&&!this.mainPlaylistLoader_.sidxMapping_[e]){var g=ye(a.sidx.resolvedUri),l=(p,t)=>{if(!this.requestErrored_(p, |
|
t,b)){p=this.mainPlaylistLoader_.sidxMapping_;try{var x=ko(U(t.response).subarray(8))}catch(y){y.metadata={errorType:H.Error.DashManifestSidxParsingError};this.requestErrored_(y,t,b);return}p[e]={sidxInfo:a.sidx,sidx:x};Pf(a,x,a.sidx.resolvedUri);return c(!0)}};this.request=Hp(g,this.vhs_.xhr,(p,t,x,y)=>{if(p)return l(p,t);if(!x||"mp4"!==x)return p=x||"unknown",l({status:t.status,message:`Unsupported ${p} container type for sidx segment at URL: ${g}`,response:"",playlist:a,internal:!0,playlistExclusionDuration:Infinity, |
|
code:2,metadata:{errorType:H.Error.UnsupportedSidxContainer,sidxContainer:p}},t);const {offset:A,length:z}=a.sidx.byterange;if(y.length>=z+A)return l(p,{response:y.subarray(A,A+z),status:t.status,uri:t.uri});this.request=this.vhs_.xhr({uri:g,responseType:"arraybuffer",headers:Og({byterange:a.sidx.byterange})},l)})}else this.mediaRequest_=D.setTimeout(()=>c(!1),0)}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};D.clearTimeout(this.minimumUpdatePeriodTimeout_);D.clearTimeout(this.mediaRequest_); |
|
D.clearTimeout(this.mediaUpdateTimeout);this.minimumUpdatePeriodTimeout_=this.mediaRequest_=this.mediaUpdateTimeout=null;this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null);this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const a=this.request;this.request=null;a.onreadystatechange=null;a.abort()}}media(a){if(!a)return this.media_;if("HAVE_NOTHING"=== |
|
this.state)throw Error("Cannot switch media playlist from "+this.state);const b=this.state;if("string"===typeof a){if(!this.mainPlaylistLoader_.main.playlists[a])throw Error("Unknown playlist URI: "+a);a=this.mainPlaylistLoader_.main.playlists[a]}const c=!this.media_||a.id!==this.media_.id;c&&this.loadedPlaylists_[a.id]&&this.loadedPlaylists_[a.id].endList?(this.state="HAVE_METADATA",this.media_=a,c&&(this.trigger("mediachanging"),this.trigger("mediachange"))):c&&(this.media_&&this.trigger("mediachanging"), |
|
this.addSidxSegments_(a,b,e=>{this.haveMetadata({startingState:b,playlist:a})}))}haveMetadata({startingState:a,playlist:b}){this.state="HAVE_METADATA";this.loadedPlaylists_[b.id]=b;this.mediaRequest_=null;this.refreshMedia_(b.id);"HAVE_MAIN_MANIFEST"===a?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null);this.stopRequest(); |
|
D.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.isMain_&&(D.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null);"HAVE_NOTHING"===this.state&&(this.started=!1)}load(a){D.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const b=this.media();a?this.mediaUpdateTimeout=D.setTimeout(()=>this.load(),b?b.targetDuration/2*1E3:5E3):this.started?b&&!b.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&& |
|
(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){this.started=!0;this.isMain_?this.requestMain_((a,b)=>{this.haveMain_();this.hasPendingRequest()||this.media_||this.media(this.mainPlaylistLoader_.main.playlists[0])}):this.mediaRequest_=D.setTimeout(()=>this.haveMain_(),0)}requestMain_(a){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials, |
|
requestType:"dash-manifest"},(b,c)=>{if(this.requestErrored_(b,c))"HAVE_NOTHING"===this.state&&(this.started=!1);else{var e=c.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=c.responseText;this.mainLoaded_=c.responseHeaders&&c.responseHeaders.date?Date.parse(c.responseHeaders.date):Date.now();this.mainPlaylistLoader_.srcUrl=ye(this.mainPlaylistLoader_.srcUrl,c);if(e)this.handleMain_(),this.syncClientServerClock_(()=>a(c,e));else return a(c,e)}})}syncClientServerClock_(a){const b= |
|
ho(gj(this.mainPlaylistLoader_.mainXml_));if(null===b)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),a();if("DIRECT"===b.method)return this.mainPlaylistLoader_.clientOffset_=b.value-Date.now(),a();this.request=this.vhs_.xhr({uri:Ja(this.mainPlaylistLoader_.srcUrl,b.value),method:b.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(c,e)=>{if(this.request){if(c)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),a();c="HEAD"=== |
|
b.method?e.responseHeaders&&e.responseHeaders.date?Date.parse(e.responseHeaders.date):this.mainLoaded_:Date.parse(e.responseText);this.mainPlaylistLoader_.clientOffset_=c-Date.now();a()}})}haveMain_(){this.state="HAVE_MAIN_MANIFEST";this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const a=this.mainPlaylistLoader_.main;let b=Kp({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_, |
|
sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:a});a&&(b=Mp(a,b,this.mainPlaylistLoader_.sidxMapping_));this.mainPlaylistLoader_.main=b?b:a;const c=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];c&&c!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=c);(!a||b&&b.minimumUpdatePeriod!==a.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_();this.addEventStreamToMetadataTrack_(b);return!!b}updateMinimumUpdatePeriodTimeout_(){const a= |
|
this.mainPlaylistLoader_;a.createMupOnMedia_&&(a.off("loadedmetadata",a.createMupOnMedia_),a.createMupOnMedia_=null);a.minimumUpdatePeriodTimeout_&&(D.clearTimeout(a.minimumUpdatePeriodTimeout_),a.minimumUpdatePeriodTimeout_=null);let b=a.main&&a.main.minimumUpdatePeriod;0===b&&(a.media()?b=1E3*a.media().targetDuration:(a.createMupOnMedia_=a.updateMinimumUpdatePeriodTimeout_,a.one("loadedmetadata",a.createMupOnMedia_)));"number"!==typeof b||0>=b?0>b&&this.logger_(`found invalid minimumUpdatePeriod of ${b}, not setting a timeout`): |
|
this.createMUPTimeout_(b)}createMUPTimeout_(a){const b=this.mainPlaylistLoader_;b.minimumUpdatePeriodTimeout_=D.setTimeout(()=>{b.minimumUpdatePeriodTimeout_=null;b.trigger("minimumUpdatePeriod");b.createMUPTimeout_(a)},a)}refreshXml_(){this.requestMain_((a,b)=>{b&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Np(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state, |
|
c=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(a){if(!a)throw Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const b=this.mainPlaylistLoader_.main.playlists,c=!this.media_||this.media_!==b[a];c?this.media_=b[a]:this.trigger("playlistunchanged");if(!this.mediaUpdateTimeout){const e=()=>{this.media().endList||(this.mediaUpdateTimeout=D.setTimeout(()=>{this.trigger("mediaupdatetimeout");e()},Mg(this.media(),!!c)))};e()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(a){a&& |
|
this.mainPlaylistLoader_.main.eventStream&&(a=this.mainPlaylistLoader_.main.eventStream.map(b=>({cueTime:b.start,frames:[{data:b.messageData}]})),this.addMetadataToTextTrack("EventStream",a,this.mainPlaylistLoader_.main.duration))}getKeyIdSet(a){if(a.contentProtection){const b=new Set;for(const c in a.contentProtection){const e=a.contentProtection[c].attributes["cenc:default_KID"];e&&b.add(e.replace(/-/g,"").toLowerCase())}return b}}}var Ha={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30, |
|
GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const Zk=function(a){a.on=a.addEventListener;a.off=a.removeEventListener;return a},Op=function(a){try{return URL.createObjectURL(new Blob([a],{type:"application/javascript"}))}catch(b){const c=new BlobBuilder;c.append(a);return URL.createObjectURL(c.getBlob())}},$k=function(a){return function(){const b= |
|
Op(a),c=Zk(new Worker(b));c.objURL=b;const e=c.terminate;c.on=c.addEventListener;c.off=c.removeEventListener;c.terminate=function(){URL.revokeObjectURL(b);return e.call(this)};return c}},al=function(a){return`var browserWorkerPolyFill = ${Zk.toString()};\n`+"browserWorkerPolyFill(self);\n"+a},bl=function(a){return a.toString().replace(/^function.+?{/,"").slice(0,-1)},wq=al(bl(function(){var a="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global? |
|
global:"undefined"!==typeof self?self:{},b=function(){this.init=function(){var h={};this.on=function(m,r){h[m]||(h[m]=[]);h[m]=h[m].concat(r)};this.off=function(m,r){if(!h[m])return!1;r=h[m].indexOf(r);h[m]=h[m].slice();h[m].splice(r,1);return-1<r};this.trigger=function(m){var r,q;if(r=h[m])if(2===arguments.length){var v=r.length;for(q=0;q<v;++q)r[q].call(this,arguments[1])}else{var w=[];q=arguments.length;for(q=1;q<arguments.length;++q)w.push(arguments[q]);v=r.length;for(q=0;q<v;++q)r[q].apply(this, |
|
w)}};this.dispose=function(){h={}}}};b.prototype.pipe=function(h){this.on("data",function(m){h.push(m)});this.on("done",function(m){h.flush(m)});this.on("partialdone",function(m){h.partialFlush(m)});this.on("endedtimeline",function(m){h.endTimeline(m)});this.on("reset",function(m){h.reset(m)});return h};b.prototype.push=function(h){this.trigger("data",h)};b.prototype.flush=function(h){this.trigger("done",h)};b.prototype.partialFlush=function(h){this.trigger("partialdone",h)};b.prototype.endTimeline= |
|
function(h){this.trigger("endedtimeline",h)};b.prototype.reset=function(h){this.trigger("reset",h)};var c=Math.pow(2,32),e=function(h){h=new DataView(h.buffer,h.byteOffset,h.byteLength);return h.getBigUint64?(h=h.getBigUint64(0),h<Number.MAX_SAFE_INTEGER?Number(h):h):h.getUint32(0)*c+h.getUint32(4)},g,l,p,t,x,y,A,z,E,I,G,O,Q,V,T,ca;(function(){var h;p={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[], |
|
sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]};if("undefined"!==typeof Uint8Array){for(h in p)p.hasOwnProperty(h)&&(p[h]=[h.charCodeAt(0),h.charCodeAt(1),h.charCodeAt(2),h.charCodeAt(3)]);t=new Uint8Array([105,115,111,109]);y=new Uint8Array([97,118,99,49]);x=new Uint8Array([0,0,0,1]);A=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]);z=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]);E={video:A,audio:z};O=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]);G=new Uint8Array([0,0,0,0,0,0,0,0]);V=Q=new Uint8Array([0,0,0,0,0,0,0,0]);T=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]);ca=Q;I=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})();var K=function(h){var m=[],r=0,q;for(q=1;q<arguments.length;q++)m.push(arguments[q]);for(q=m.length;q--;)r+=m[q].byteLength;var v=new Uint8Array(r+ |
|
8);(new DataView(v.buffer,v.byteOffset,v.byteLength)).setUint32(0,v.byteLength);v.set(h,4);q=0;for(r=8;q<m.length;q++)v.set(m[q],r),r+=m[q].byteLength;return v};var ba=function(){return K(p.dinf,K(p.dref,O))};var ta=function(h){return K(p.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,h.audioobjecttype<<3|h.samplingfrequencyindex>>>1,h.samplingfrequencyindex<<7|h.channelcount<<3,6,1,2]))};var Fa=function(){return K(p.ftyp,t,x,t,y)};var W=function(h){return K(p.hdlr, |
|
E[h])};var Da=function(h){var m=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,h.duration>>>24&255,h.duration>>>16&255,h.duration>>>8&255,h.duration&255,85,196,0,0]);h.samplerate&&(m[12]=h.samplerate>>>24&255,m[13]=h.samplerate>>>16&255,m[14]=h.samplerate>>>8&255,m[15]=h.samplerate&255);return K(p.mdhd,m)};var Qg=function(h){return K(p.mdia,Da(h),W(h.type),Ce(h))};var De=function(h){return K(p.mfhd,new Uint8Array([0,0,0,0,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255]))};var Ce=function(h){return K(p.minf, |
|
"video"===h.type?K(p.vmhd,I):K(p.smhd,G),ba(),Pp(h))};var cl=function(h){for(var m=h.length,r=[];m--;)r[m]=Qp(h[m]);return K.apply(null,[p.moov,Rp(4294967295)].concat(r).concat(Sp(h)))};var Sp=function(h){for(var m=h.length,r=[];m--;)r[m]=Tp(h[m]);return K.apply(null,[p.mvex].concat(r))};var Rp=function(h){h=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(h&4278190080)>>24,(h&16711680)>>16,(h&65280)>>8,h&255,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 K(p.mvhd,h)};var Up=function(h){h=h.samples||[];var m=new Uint8Array(4+h.length),r;for(r=0;r<h.length;r++){var q=h[r].flags;m[r+4]=q.dependsOn<<4|q.isDependedOn<<2|q.hasRedundancy}return K(p.sdtp,m)};var Pp=function(h){return K(p.stbl,g(h),K(p.stts,ca),K(p.stsc,V),K(p.stsz,T),K(p.stco,Q))};(function(){g=function(r){return K(p.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===r.type?h(r):m(r))};var h=function(r){var q= |
|
r.sps||[],v=r.pps||[],w=[],B=[],C;for(C=0;C<q.length;C++)w.push((q[C].byteLength&65280)>>>8),w.push(q[C].byteLength&255),w=w.concat(Array.prototype.slice.call(q[C]));for(C=0;C<v.length;C++)B.push((v[C].byteLength&65280)>>>8),B.push(v[C].byteLength&255),B=B.concat(Array.prototype.slice.call(v[C]));q=[p.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,(r.width&65280)>>8,r.width&255,(r.height&65280)>>8,r.height&255,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]),K(p.avcC,new Uint8Array([1,r.profileIdc,r.profileCompatibility,r.levelIdc,255].concat([q.length],w,[v.length],B))),K(p.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];r.sarRatio&&(v=r.sarRatio[0],r=r.sarRatio[1],q.push(K(p.pasp,new Uint8Array([(v&4278190080)>>24,(v&16711680)>>16,(v&65280)>>8,v&255,(r&4278190080)>>24,(r&16711680)>>16,(r&65280)>>8,r&255]))));return K.apply(null,q)};var m=function(r){return K(p.mp4a, |
|
new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(r.channelcount&65280)>>8,r.channelcount&255,(r.samplesize&65280)>>8,r.samplesize&255,0,0,0,0,(r.samplerate&65280)>>8,r.samplerate&255,0,0]),ta(r))}})();var Vp=function(h){h=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,0,(h.duration&4278190080)>>24,(h.duration&16711680)>>16,(h.duration&65280)>>8,h.duration&255,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,(h.width&65280)>>8,h.width&255,0,0,(h.height&65280)>>8,h.height&255,0,0]);return K(p.tkhd,h)};var Wp=function(h){var m=K(p.tfhd,new Uint8Array([0,0,0,58,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));var r=Math.floor(h.baseMediaDecodeTime/c);var q=Math.floor(h.baseMediaDecodeTime%c);r=K(p.tfdt,new Uint8Array([1,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,r&255,q>>>24&255,q>>>16&255,q>>>8&255,q&255]));if("audio"===h.type)return h= |
|
l(h,92),K(p.traf,m,r,h);q=Up(h);h=l(h,q.length+92);return K(p.traf,m,r,h,q)};var Qp=function(h){h.duration=h.duration||4294967295;return K(p.trak,Vp(h),Qg(h))};var Tp=function(h){var m=new Uint8Array([0,0,0,0,(h.id&4278190080)>>24,(h.id&16711680)>>16,(h.id&65280)>>8,h.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);"video"!==h.type&&(m[m.length-1]=0);return K(p.trex,m)};(function(){var h=function(q,v){var w=0,B=0,C=0,F=0;q.length&&(void 0!==q[0].duration&&(w=1),void 0!==q[0].size&&(B=2),void 0!==q[0].flags&& |
|
(C=4),void 0!==q[0].compositionTimeOffset&&(F=8));return[0,0,w|B|C|F,1,(q.length&4278190080)>>>24,(q.length&16711680)>>>16,(q.length&65280)>>>8,q.length&255,(v&4278190080)>>>24,(v&16711680)>>>16,(v&65280)>>>8,v&255]};var m=function(q,v){var w;q=q.samples||[];v+=20+16*q.length;var B=h(q,v);v=new Uint8Array(B.length+16*q.length);v.set(B);B=B.length;for(w=0;w<q.length;w++){var C=q[w];v[B++]=(C.duration&4278190080)>>>24;v[B++]=(C.duration&16711680)>>>16;v[B++]=(C.duration&65280)>>>8;v[B++]=C.duration& |
|
255;v[B++]=(C.size&4278190080)>>>24;v[B++]=(C.size&16711680)>>>16;v[B++]=(C.size&65280)>>>8;v[B++]=C.size&255;v[B++]=C.flags.isLeading<<2|C.flags.dependsOn;v[B++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample;v[B++]=C.flags.degradationPriority&61440;v[B++]=C.flags.degradationPriority&15;v[B++]=(C.compositionTimeOffset&4278190080)>>>24;v[B++]=(C.compositionTimeOffset&16711680)>>>16;v[B++]=(C.compositionTimeOffset&65280)>>>8;v[B++]=C.compositionTimeOffset& |
|
255}return K(p.trun,v)};var r=function(q,v){var w;q=q.samples||[];v+=20+8*q.length;var B=h(q,v);v=new Uint8Array(B.length+8*q.length);v.set(B);B=B.length;for(w=0;w<q.length;w++){var C=q[w];v[B++]=(C.duration&4278190080)>>>24;v[B++]=(C.duration&16711680)>>>16;v[B++]=(C.duration&65280)>>>8;v[B++]=C.duration&255;v[B++]=(C.size&4278190080)>>>24;v[B++]=(C.size&16711680)>>>16;v[B++]=(C.size&65280)>>>8;v[B++]=C.size&255}return K(p.trun,v)};l=function(q,v){return"audio"===q.type?r(q,v):m(q,v)}})();var ud= |
|
{ftyp:Fa,mdat:function(h){return K(p.mdat,h)},moof:function(h,m){for(var r=[],q=m.length;q--;)r[q]=Wp(m[q]);return K.apply(null,[p.moof,De(h)].concat(r))},moov:cl,initSegment:function(h){var m=Fa();h=cl(h);var r=new Uint8Array(m.byteLength+h.byteLength);r.set(m);r.set(h,m.byteLength);return r}},dl=function(h,m){var r={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};r.dataOffset=m;r.compositionTimeOffset=h.pts-h.dts;r.duration=h.duration; |
|
r.size=4*h.length;r.size+=h.byteLength;h.keyFrame&&(r.flags.dependsOn=2,r.flags.isNonSyncSample=0);return r},ac=[33,16,5,32,164,27],Rg=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ja=function(h){for(var m=[];h--;)m.push(0);return m},Xp=function(h){return Object.keys(h).reduce(function(m,r){m[r]=new Uint8Array(h[r].reduce(function(q,v){return q.concat(v)},[]));return m},{})},Sg;var el=function(h){return 9E4*h};var fl=function(h,m){return h*m};var Tg=function(h){return h/9E4};var gl=function(h,m){return h/ |
|
m};var ha={ONE_SECOND_IN_TS:9E4,secondsToVideoTs:el,secondsToAudioTs:fl,videoTsToSeconds:Tg,audioTsToSeconds:gl,audioTsToVideoTs:function(h,m){return el(gl(h,m))},videoTsToAudioTs:function(h,m){return fl(Tg(h),m)},metadataTsToSeconds:function(h,m,r){return Tg(r?h:h-m)}},Yp=ha.ONE_SECOND_IN_TS,vd={parseSei:function(h){for(var m=0,r={payloadType:-1,payloadSize:0},q=0,v=0;m<h.byteLength&&128!==h[m];){for(;255===h[m];)q+=255,m++;for(q+=h[m++];255===h[m];)v+=255,m++;v+=h[m++];if(!r.payload&&4===q)if("GA94"=== |
|
String.fromCharCode(h[m+3],h[m+4],h[m+5],h[m+6])){r.payloadType=q;r.payloadSize=v;r.payload=h.subarray(m,m+v);break}else r.payload=void 0;m+=v;v=q=0}return r},parseUserData:function(h){return 181!==h.payload[0]||49!==(h.payload[1]<<8|h.payload[2])||"GA94"!==String.fromCharCode(h.payload[3],h.payload[4],h.payload[5],h.payload[6])||3!==h.payload[7]?null:h.payload.subarray(8,h.payload.length-1)},parseCaptionPackets:function(h,m){var r=[],q;if(!(m[0]&64))return r;var v=m[0]&31;for(q=0;q<v;q++){var w= |
|
3*q;var B={type:m[w+2]&3,pts:h};m[w+2]&4&&(B.ccData=m[w+3]<<8|m[w+4],r.push(B))}return r},discardEmulationPreventionBytes:function(h){for(var m=h.byteLength,r=[],q=1,v;q<m-2;)0===h[q]&&0===h[q+1]&&3===h[q+2]?(r.push(q+2),q+=2):q++;if(0===r.length)return h;m-=r.length;v=new Uint8Array(m);var w=0;for(q=0;q<m;w++,q++)w===r[0]&&(w++,r.shift()),v[q]=h[w];return v},USER_DATA_REGISTERED_ITU_T_T35:4},Za=function(h){h=h||{};Za.prototype.init.call(this);this.parse708captions_="boolean"===typeof h.parse708captions? |
|
h.parse708captions:!0;this.captionPackets_=[];this.ccStreams_=[new sa(0,0),new sa(0,1),new sa(1,0),new sa(1,1)];this.parse708captions_&&(this.cc708Stream_=new la({captionServices:h.captionServices}));this.reset();this.ccStreams_.forEach(function(m){m.on("data",this.trigger.bind(this,"data"));m.on("partialdone",this.trigger.bind(this,"partialdone"));m.on("done",this.trigger.bind(this,"done"))},this);this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone", |
|
this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};Za.prototype=new b;Za.prototype.push=function(h){if("sei_rbsp"===h.nalUnitType){var m=vd.parseSei(h.escapedRBSP);m.payload&&m.payloadType===vd.USER_DATA_REGISTERED_ITU_T_T35&&(m=vd.parseUserData(m))&&(h.dts<this.latestDts_?this.ignoreNextEqualDts_=!0:h.dts===this.latestDts_&&this.ignoreNextEqualDts_?(this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1)):(m=vd.parseCaptionPackets(h.pts, |
|
m),this.captionPackets_=this.captionPackets_.concat(m),this.latestDts_!==h.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=h.dts))}};Za.prototype.flushCCStreams=function(h){this.ccStreams_.forEach(function(m){return"flush"===h?m.flush():m.partialFlush()},this)};Za.prototype.flushStream=function(h){this.captionPackets_.length&&(this.captionPackets_.forEach(function(m,r){m.presortIndex=r}),this.captionPackets_.sort(function(m,r){return m.pts===r.pts?m.presortIndex-r.presortIndex:m.pts- |
|
r.pts}),this.captionPackets_.forEach(function(m){2>m.type?this.dispatchCea608Packet(m):this.dispatchCea708Packet(m)},this),this.captionPackets_.length=0);this.flushCCStreams(h)};Za.prototype.flush=function(){return this.flushStream("flush")};Za.prototype.partialFlush=function(){return this.flushStream("partialFlush")};Za.prototype.reset=function(){this.latestDts_=null;this.ignoreNextEqualDts_=!1;this.numSameDts_=0;this.activeCea608Channel_=[null,null];this.ccStreams_.forEach(function(h){h.reset()})}; |
|
Za.prototype.dispatchCea608Packet=function(h){this.setsTextOrXDSActive(h)?this.activeCea608Channel_[h.type]=null:this.setsChannel1Active(h)?this.activeCea608Channel_[h.type]=0:this.setsChannel2Active(h)&&(this.activeCea608Channel_[h.type]=1);null!==this.activeCea608Channel_[h.type]&&this.ccStreams_[(h.type<<1)+this.activeCea608Channel_[h.type]].push(h)};Za.prototype.setsChannel1Active=function(h){return 4096===(h.ccData&30720)};Za.prototype.setsChannel2Active=function(h){return 6144===(h.ccData&30720)}; |
|
Za.prototype.setsTextOrXDSActive=function(h){return 256===(h.ccData&28928)||4138===(h.ccData&30974)||6186===(h.ccData&30974)};Za.prototype.dispatchCea708Packet=function(h){this.parse708captions_&&this.cc708Stream_.push(h)};var Zp={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600}, |
|
$p=function(h){var m=Zp[h]||h;return h&4096&&h===m?"":String.fromCharCode(m)},Ee=function(h){return 32<=h&&127>=h||160<=h&&255>=h},Ob=function(h){this.windowNum=h;this.reset()};Ob.prototype.reset=function(){this.clearText();this.pendingNewLine=!1;this.winAttr={};this.penAttr={};this.penLoc={};this.penColor={};this.anchorPoint=this.anchorHorizontal=this.anchorVertical=this.relativePositioning=this.priority=this.columnLock=this.rowLock=this.visible=0;this.rowCount=1;this.virtualRowCount=this.rowCount+ |
|
1;this.columnCount=41;this.penStyle=this.windowStyle=0};Ob.prototype.getText=function(){return this.rows.join("\n")};Ob.prototype.clearText=function(){this.rows=[""];this.rowIdx=0};Ob.prototype.newLine=function(h){this.rows.length>=this.virtualRowCount&&"function"===typeof this.beforeRowOverflow&&this.beforeRowOverflow(h);0<this.rows.length&&(this.rows.push(""),this.rowIdx++);for(;this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--};Ob.prototype.isEmpty=function(){return 0===this.rows.length? |
|
!0:1===this.rows.length?""===this.rows[0]:!1};Ob.prototype.addText=function(h){this.rows[this.rowIdx]+=h};Ob.prototype.backspace=function(){if(!this.isEmpty()){var h=this.rows[this.rowIdx];this.rows[this.rowIdx]=h.substr(0,h.length-1)}};var Fe=function(h,m,r){this.serviceNum=h;this.text="";this.currentWindow=new Ob(-1);this.windows=[];this.stream=r;"string"===typeof m&&this.createTextDecoder(m)};Fe.prototype.init=function(h,m){this.startPts=h;for(h=0;8>h;h++)this.windows[h]=new Ob(h),"function"=== |
|
typeof m&&(this.windows[h].beforeRowOverflow=m)};Fe.prototype.setCurrentWindow=function(h){this.currentWindow=this.windows[h]};Fe.prototype.createTextDecoder=function(h){if("undefined"===typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(h)}catch(m){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+h+" encoding. "+m})}};var la=function(h){h= |
|
h||{};la.prototype.init.call(this);var m=this,r=h.captionServices||{},q={},v;Object.keys(r).forEach(w=>{v=r[w];/^SERVICE/.test(w)&&(q[w]=v.encoding)});this.serviceEncodings=q;this.current708Packet=null;this.services={};this.push=function(w){3===w.type?m.new708Packet():null===m.current708Packet&&m.new708Packet();m.add708Bytes(w)}};la.prototype=new b;la.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet();this.current708Packet={data:[],ptsVals:[]}};la.prototype.add708Bytes= |
|
function(h){var m=h.ccData,r=m>>>8;m&=255;this.current708Packet.ptsVals.push(h.pts);this.current708Packet.data.push(r);this.current708Packet.data.push(m)};la.prototype.push708Packet=function(){var h=this.current708Packet,m=h.data,r=null,q=null,v=0,w=m[v++];h.seq=w>>6;for(h.sizeCode=w&63;v<m.length;v++)w=m[v++],r=w>>5,q=w&31,7===r&&0<q&&(r=w=m[v++]),this.pushServiceBlock(r,v,q),0<q&&(v+=q-1)};la.prototype.pushServiceBlock=function(h,m,r){var q=m,v=this.current708Packet.data,w=this.services[h];for(w||= |
|
this.initService(h,q);q<m+r&&q<v.length;q++)h=v[q],Ee(h)?q=this.handleText(q,w):24===h?q=this.multiByteCharacter(q,w):16===h?q=this.extendedCommands(q,w):128<=h&&135>=h?q=this.setCurrentWindow(q,w):152<=h&&159>=h?q=this.defineWindow(q,w):136===h?q=this.clearWindows(q,w):140===h?q=this.deleteWindows(q,w):137===h?q=this.displayWindows(q,w):138===h?q=this.hideWindows(q,w):139===h?q=this.toggleWindows(q,w):151===h?q=this.setWindowAttributes(q,w):144===h?q=this.setPenAttributes(q,w):145===h?q=this.setPenColor(q, |
|
w):146===h?q=this.setPenLocation(q,w):143===h?w=this.reset(q,w):8===h?w.currentWindow.backspace():12===h?w.currentWindow.clearText():13===h?w.currentWindow.pendingNewLine=!0:14===h?w.currentWindow.clearText():141===h&&q++};la.prototype.extendedCommands=function(h,m){var r=this.current708Packet.data[++h];Ee(r)&&(h=this.handleText(h,m,{isExtended:!0}));return h};la.prototype.getPts=function(h){return this.current708Packet.ptsVals[Math.floor(h/2)]};la.prototype.initService=function(h,m){var r="SERVICE"+ |
|
h,q=this,v;r in this.serviceEncodings&&(v=this.serviceEncodings[r]);this.services[h]=new Fe(h,v,q);this.services[h].init(this.getPts(m),function(w){q.flushDisplayed(w,q.services[h])});return this.services[h]};la.prototype.handleText=function(h,m,r){function q(J){return J.map(N=>("0"+(N&255).toString(16)).slice(-2)).join("")}var v=r&&r.isExtended,w=r&&r.isMultiByte;r=this.current708Packet.data;var B=v?4096:0,C=r[h],F=r[h+1];r=m.currentWindow;w?(F=[C,F],h++):F=[C];m.textDecoder_&&!v?m=m.textDecoder_.decode(new Uint8Array(F)): |
|
w?(m=q(F),m=String.fromCharCode(parseInt(m,16))):m=$p(B|C);r.pendingNewLine&&!r.isEmpty()&&r.newLine(this.getPts(h));r.pendingNewLine=!1;r.addText(m);return h};la.prototype.multiByteCharacter=function(h,m){var r=this.current708Packet.data,q=r[h+2];Ee(r[h+1])&&Ee(q)&&(h=this.handleText(++h,m,{isMultiByte:!0}));return h};la.prototype.setCurrentWindow=function(h,m){m.setCurrentWindow(this.current708Packet.data[h]&7);return h};la.prototype.defineWindow=function(h,m){var r=this.current708Packet.data,q= |
|
r[h];m.setCurrentWindow(q&7);m=m.currentWindow;q=r[++h];m.visible=(q&32)>>5;m.rowLock=(q&16)>>4;m.columnLock=(q&8)>>3;m.priority=q&7;q=r[++h];m.relativePositioning=(q&128)>>7;m.anchorVertical=q&127;q=r[++h];m.anchorHorizontal=q;q=r[++h];m.anchorPoint=(q&240)>>4;m.rowCount=q&15;q=r[++h];m.columnCount=q&63;q=r[++h];m.windowStyle=(q&56)>>3;m.penStyle=q&7;m.virtualRowCount=m.rowCount+1;return h};la.prototype.setWindowAttributes=function(h,m){var r=this.current708Packet.data,q=r[h];m=m.currentWindow.winAttr; |
|
q=r[++h];m.fillOpacity=(q&192)>>6;m.fillRed=(q&48)>>4;m.fillGreen=(q&12)>>2;m.fillBlue=q&3;q=r[++h];m.borderType=(q&192)>>6;m.borderRed=(q&48)>>4;m.borderGreen=(q&12)>>2;m.borderBlue=q&3;q=r[++h];m.borderType+=(q&128)>>5;m.wordWrap=(q&64)>>6;m.printDirection=(q&48)>>4;m.scrollDirection=(q&12)>>2;m.justify=q&3;q=r[++h];m.effectSpeed=(q&240)>>4;m.effectDirection=(q&12)>>2;m.displayEffect=q&3;return h};la.prototype.flushDisplayed=function(h,m){for(var r=[],q=0;8>q;q++)m.windows[q].visible&&!m.windows[q].isEmpty()&& |
|
r.push(m.windows[q].getText());m.endPts=h;m.text=r.join("\n\n");this.pushCaption(m);m.startPts=h};la.prototype.pushCaption=function(h){""!==h.text&&(this.trigger("data",{startPts:h.startPts,endPts:h.endPts,text:h.text,stream:"cc708_"+h.serviceNum}),h.text="",h.startPts=h.endPts)};la.prototype.displayWindows=function(h,m){var r=this.current708Packet.data[++h],q=this.getPts(h);this.flushDisplayed(q,m);for(q=0;8>q;q++)r&1<<q&&(m.windows[q].visible=1);return h};la.prototype.hideWindows=function(h,m){var r= |
|
this.current708Packet.data[++h],q=this.getPts(h);this.flushDisplayed(q,m);for(q=0;8>q;q++)r&1<<q&&(m.windows[q].visible=0);return h};la.prototype.toggleWindows=function(h,m){var r=this.current708Packet.data[++h],q=this.getPts(h);this.flushDisplayed(q,m);for(q=0;8>q;q++)r&1<<q&&(m.windows[q].visible^=1);return h};la.prototype.clearWindows=function(h,m){var r=this.current708Packet.data[++h],q=this.getPts(h);this.flushDisplayed(q,m);for(q=0;8>q;q++)r&1<<q&&m.windows[q].clearText();return h};la.prototype.deleteWindows= |
|
function(h,m){var r=this.current708Packet.data[++h],q=this.getPts(h);this.flushDisplayed(q,m);for(q=0;8>q;q++)r&1<<q&&m.windows[q].reset();return h};la.prototype.setPenAttributes=function(h,m){var r=this.current708Packet.data,q=r[h];m=m.currentWindow.penAttr;q=r[++h];m.textTag=(q&240)>>4;m.offset=(q&12)>>2;m.penSize=q&3;q=r[++h];m.italics=(q&128)>>7;m.underline=(q&64)>>6;m.edgeType=(q&56)>>3;m.fontStyle=q&7;return h};la.prototype.setPenColor=function(h,m){var r=this.current708Packet.data,q=r[h];m= |
|
m.currentWindow.penColor;q=r[++h];m.fgOpacity=(q&192)>>6;m.fgRed=(q&48)>>4;m.fgGreen=(q&12)>>2;m.fgBlue=q&3;q=r[++h];m.bgOpacity=(q&192)>>6;m.bgRed=(q&48)>>4;m.bgGreen=(q&12)>>2;m.bgBlue=q&3;q=r[++h];m.edgeRed=(q&48)>>4;m.edgeGreen=(q&12)>>2;m.edgeBlue=q&3;return h};la.prototype.setPenLocation=function(h,m){var r=this.current708Packet.data,q=r[h],v=m.currentWindow.penLoc;m.currentWindow.pendingNewLine=!0;q=r[++h];v.row=q&15;q=r[++h];v.column=q&63;return h};la.prototype.reset=function(h,m){var r=this.getPts(h); |
|
this.flushDisplayed(r,m);return this.initService(m.serviceNum,h)};var aq={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},Ge=function(h){if(null===h)return"";h=aq[h]||h;return String.fromCharCode(h)},bq=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],mc=function(){for(var h=[],m=15;m--;)h.push({text:"", |
|
indent:0,offset:0});return h},sa=function(h,m){sa.prototype.init.call(this);this.field_=h||0;this.dataChannel_=m||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(r){var q=r.ccData&32639;if(q===this.lastControlCode_)this.lastControlCode_=null;else{4096===(q&61440)?this.lastControlCode_=q:q!==this.PADDING_&&(this.lastControlCode_=null);var v=q>>>8;var w=q&255;q!==this.PADDING_&&(q===this.RESUME_CAPTION_LOADING_?this.mode_="popOn":q===this.END_OF_CAPTION_? |
|
(this.mode_="popOn",this.clearFormatting(r.pts),this.flushDisplayed(r.pts),w=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=w,this.startPts_=r.pts):q===this.ROLL_UP_2_ROWS_?(this.rollUpRows_=2,this.setRollUp(r.pts)):q===this.ROLL_UP_3_ROWS_?(this.rollUpRows_=3,this.setRollUp(r.pts)):q===this.ROLL_UP_4_ROWS_?(this.rollUpRows_=4,this.setRollUp(r.pts)):q===this.CARRIAGE_RETURN_?(this.clearFormatting(r.pts),this.flushDisplayed(r.pts),this.shiftRowsUp_(),this.startPts_=r.pts):q=== |
|
this.BACKSPACE_?"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1):q===this.ERASE_DISPLAYED_MEMORY_?(this.flushDisplayed(r.pts),this.displayed_=mc()):q===this.ERASE_NON_DISPLAYED_MEMORY_?this.nonDisplayed_=mc():q===this.RESUME_DIRECT_CAPTIONING_?("paintOn"!==this.mode_&&(this.flushDisplayed(r.pts),this.displayed_=mc()),this.mode_="paintOn",this.startPts_=r.pts):this.isSpecialCharacter(v, |
|
w)?(q=Ge((v&3)<<8|w),this[this.mode_](r.pts,q),this.column_++):this.isExtCharacter(v,w)?("popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),q=Ge((v&3)<<8|w),this[this.mode_](r.pts,q),this.column_++):this.isMidRowCode(v,w)?(this.clearFormatting(r.pts),this[this.mode_](r.pts," "),this.column_++,14===(w&14)&&this.addFormatting(r.pts,["i"]),1===(w&1)&&this.addFormatting(r.pts, |
|
["u"])):this.isOffsetControlCode(v,w)?(r=w&3,this.nonDisplayed_[this.row_].offset=r,this.column_+=r):this.isPAC(v,w)?(v=bq.indexOf(q&7968),"rollUp"===this.mode_&&(0>v-this.rollUpRows_+1&&(v=this.rollUpRows_-1),this.setRollUp(r.pts,v)),v!==this.row_&&0<=v&&14>=v&&(this.clearFormatting(r.pts),this.row_=v),w&1&&-1===this.formatting_.indexOf("u")&&this.addFormatting(r.pts,["u"]),16===(q&16)&&(q=(q&14)>>1,this.column_=4*q,this.nonDisplayed_[this.row_].indent+=q),this.isColorPAC(w)&&14===(w&14)&&this.addFormatting(r.pts, |
|
["i"])):this.isNormalChar(v)&&(0===w&&(w=null),q=Ge(v),q+=Ge(w),this[this.mode_](r.pts,q),this.column_+=q.length))}}};sa.prototype=new b;sa.prototype.flushDisplayed=function(h){const m=q=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+q+"."})},r=[];this.displayed_.forEach((q,v)=>{if(q&&q.text&&q.text.length){try{q.text=q.text.trim()}catch(w){m(v)}q.text.length&&r.push({text:q.text,line:v+1,position:10+Math.min(70,10*q.indent)+2.5*q.offset})}else void 0!==q&& |
|
null!==q||m(v)});r.length&&this.trigger("data",{startPts:this.startPts_,endPts:h,content:r,stream:this.name_})};sa.prototype.reset=function(){this.mode_="popOn";this.startPts_=this.topRow_=0;this.displayed_=mc();this.nonDisplayed_=mc();this.lastControlCode_=null;this.column_=0;this.row_=14;this.rollUpRows_=2;this.formatting_=[]};sa.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_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};sa.prototype.isSpecialCharacter= |
|
function(h,m){return h===this.EXT_&&48<=m&&63>=m};sa.prototype.isExtCharacter=function(h,m){return(h===this.EXT_+1||h===this.EXT_+2)&&32<=m&&63>=m};sa.prototype.isMidRowCode=function(h,m){return h===this.EXT_&&32<=m&&47>=m};sa.prototype.isOffsetControlCode=function(h,m){return h===this.OFFSET_&&33<=m&&35>=m};sa.prototype.isPAC=function(h,m){return h>=this.BASE_&&h<this.BASE_+8&&64<=m&&127>=m};sa.prototype.isColorPAC=function(h){return 64<=h&&79>=h||96<=h&&127>=h};sa.prototype.isNormalChar=function(h){return 32<= |
|
h&&127>=h};sa.prototype.setRollUp=function(h,m){"rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(h),this.nonDisplayed_=mc(),this.displayed_=mc());if(void 0!==m&&m!==this.row_)for(h=0;h<this.rollUpRows_;h++)this.displayed_[m-h]=this.displayed_[this.row_-h],this.displayed_[this.row_-h]={text:"",indent:0,offset:0};void 0===m&&(m=this.row_);this.topRow_=m-this.rollUpRows_+1};sa.prototype.addFormatting=function(h,m){this.formatting_=this.formatting_.concat(m);m=m.reduce(function(r, |
|
q){return r+"\x3c"+q+"\x3e"},"");this[this.mode_](h,m)};sa.prototype.clearFormatting=function(h){if(this.formatting_.length){var m=this.formatting_.reverse().reduce(function(r,q){return r+"\x3c/"+q+"\x3e"},"");this.formatting_=[];this[this.mode_](h,m)}};sa.prototype.popOn=function(h,m){this.nonDisplayed_[this.row_].text+=m};sa.prototype.rollUp=function(h,m){this.displayed_[this.row_].text+=m};sa.prototype.shiftRowsUp_=function(){var h;for(h=0;h<this.topRow_;h++)this.displayed_[h]={text:"",indent:0, |
|
offset:0};for(h=this.row_+1;15>h;h++)this.displayed_[h]={text:"",indent:0,offset:0};for(h=this.topRow_;h<this.row_;h++)this.displayed_[h]=this.displayed_[h+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}};sa.prototype.paintOn=function(h,m){this.displayed_[this.row_].text+=m};var hl=Za,cq=sa,dq=la,La={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},bc=function(h,m){var r=1;for(h>m&&(r=-1);4294967296<Math.abs(m-h);)h+=8589934592*r;return h},Ug=function(h){var m,r;Ug.prototype.init.call(this); |
|
this.type_=h||"shared";this.push=function(q){if("metadata"===q.type)this.trigger("data",q);else if("shared"===this.type_||q.type===this.type_)void 0===r&&(r=q.dts),q.dts=bc(q.dts,r),q.pts=bc(q.pts,r),m=q.dts,this.trigger("data",q)};this.flush=function(){r=m;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){m=r=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};Ug.prototype=new b;var eq=Ug,He=(h,m,r)=> |
|
{if(!h)return-1;for(;r<h.length;r++)if(h[r]===m)return r;return-1},Fb=function(h,m,r){for(var q="";m<r;m++)q+="%"+("00"+h[m].toString(16)).slice(-2);return q},wd=function(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]},xd={APIC:function(h){var m=1;if(3===h.data[0]){var r=He(h.data,0,m);0>r||(h.mimeType=unescape(Fb(h.data,m,r)),m=r+1,h.pictureType=h.data[m],m++,r=He(h.data,0,m),0>r||(h.description=decodeURIComponent(Fb(h.data,m,r)),m=r+1,"--\x3e"===h.mimeType?h.url=unescape(Fb(h.data,m,h.data.length)):h.pictureData= |
|
h.data.subarray(m,h.data.length)))}},"T*":function(h){3===h.data[0]&&(h.value=decodeURIComponent(Fb(h.data,1,h.data.length)).replace(/\0*$/,""),h.values=h.value.split("\x00"))},TXXX:function(h){if(3===h.data[0]){var m=He(h.data,0,1);-1!==m&&(h.description=decodeURIComponent(Fb(h.data,1,m)),h.value=decodeURIComponent(Fb(h.data,m+1,h.data.length)).replace(/\0*$/,""),h.data=h.value)}},"W*":function(h){h.url=unescape(Fb(h.data,0,h.data.length)).replace(/\0.*$/,"")},WXXX:function(h){if(3===h.data[0]){var m= |
|
He(h.data,0,1);-1!==m&&(h.description=decodeURIComponent(Fb(h.data,1,m)),h.url=unescape(Fb(h.data,m+1,h.data.length)).replace(/\0.*$/,""))}},PRIV:function(h){var m;for(m=0;m<h.data.length;m++)if(0===h.data[m]){h.owner=unescape(Fb(h.data,0,m));break}h.privateData=h.data.subarray(m+1);h.data=h.privateData}},Pb={parseId3Frames:function(h){var m=10,r=0,q=[];if(!(10>h.length||73!==h[0]||68!==h[1]||51!==h[2])){r=wd(h.subarray(6,10));r+=10;h[5]&64&&(m=m+4+wd(h.subarray(10,14)),r-=wd(h.subarray(16,20))); |
|
do{var v=wd(h.subarray(m+4,m+8));if(1>v)break;var w=String.fromCharCode(h[m],h[m+1],h[m+2],h[m+3]);w={id:w,data:h.subarray(m+10,m+v+10)};w.key=w.id;if(xd[w.id])xd[w.id](w);else if("T"===w.id[0])xd["T*"](w);else if("W"===w.id[0])xd["W*"](w);q.push(w);m+=10;m+=v}while(m<r);return q}},parseSyncSafeInteger:wd,frameParsers:xd};var Vg=function(h){h=h&&h.descriptor;var m=0,r=[],q=0,v;Vg.prototype.init.call(this);this.dispatchType=La.METADATA_STREAM_TYPE.toString(16);if(h)for(v=0;v<h.length;v++)this.dispatchType+= |
|
("00"+h[v].toString(16)).slice(-2);this.push=function(w){var B;if("timed-metadata"===w.type)if(w.dataAlignmentIndicator&&(q=0,r.length=0),0===r.length&&(10>w.data.length||73!==w.data[0]||68!==w.data[1]||51!==w.data[2]))this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});else if(r.push(w),q+=w.data.byteLength,1===r.length&&(m=Pb.parseSyncSafeInteger(w.data.subarray(6,10)),m+=10),!(q<m)){w={data:new Uint8Array(m),frames:[],pts:r[0].pts,dts:r[0].dts};for(B=0;B<m;)w.data.set(r[0].data.subarray(0, |
|
m-B),B),B+=r[0].data.byteLength,q-=r[0].data.byteLength,r.shift();B=10;w.data[5]&64&&(B=B+4+Pb.parseSyncSafeInteger(w.data.subarray(10,14)),m-=Pb.parseSyncSafeInteger(w.data.subarray(16,20)));do{var C=Pb.parseSyncSafeInteger(w.data.subarray(B+4,B+8));if(1>C){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}var F=String.fromCharCode(w.data[B],w.data[B+1],w.data[B+2],w.data[B+3]);F={id:F,data:w.data.subarray(B+10,B+C+10)};F.key= |
|
F.id;if(Pb.frameParsers[F.id])Pb.frameParsers[F.id](F);else if("T"===F.id[0])Pb.frameParsers["T*"](F);else if("W"===F.id[0])Pb.frameParsers["W*"](F);if("com.apple.streaming.transportStreamTimestamp"===F.owner){var J=F.data,N=(J[3]&1)<<30|J[4]<<22|J[5]<<14|J[6]<<6|J[7]>>>2;N*=4;N+=J[7]&3;F.timeStamp=N;void 0===w.pts&&void 0===w.dts&&(w.pts=F.timeStamp,w.dts=F.timeStamp);this.trigger("timestamp",F)}w.frames.push(F);B+=10;B+=C}while(B<m);this.trigger("data",w)}}};Vg.prototype=new b;var Wg=function(){var h= |
|
new Uint8Array(188),m=0;Wg.prototype.init.call(this);this.push=function(r){var q=0,v=188;if(m){var w=new Uint8Array(r.byteLength+m);w.set(h.subarray(0,m));w.set(r,m);m=0}else w=r;for(;v<w.byteLength;)71===w[q]&&71===w[v]?(this.trigger("data",w.subarray(q,v)),q+=188,v+=188):(q++,v++);q<w.byteLength&&(h.set(w.subarray(q),0),m=w.byteLength-q)};this.flush=function(){188===m&&71===h[0]&&(this.trigger("data",h),m=0);this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}; |
|
this.reset=function(){m=0;this.trigger("reset")}};Wg.prototype=new b;var Ie=function(){Ie.prototype.init.call(this);var h=this;this.packetsWaitingForPmt=[];this.programMapTable=void 0;var m=function(v,w){var B=0;w.payloadUnitStartIndicator&&(B+=v[B]+1);"pat"===w.type?r(v.subarray(B),w):q(v.subarray(B),w)};var r=function(v,w){w.section_number=v[7];w.last_section_number=v[8];h.pmtPid=(v[10]&31)<<8|v[11];w.pmtPid=h.pmtPid};var q=function(v,w){var B;if(v[5]&1){h.programMapTable={video:null,audio:null, |
|
"timed-metadata":{}};var C=3+((v[1]&15)<<8|v[2])-4;for(B=12+((v[10]&15)<<8|v[11]);B<C;){var F=v[B],J=(v[B+1]&31)<<8|v[B+2];F===La.H264_STREAM_TYPE&&null===h.programMapTable.video?h.programMapTable.video=J:F===La.ADTS_STREAM_TYPE&&null===h.programMapTable.audio?h.programMapTable.audio=J:F===La.METADATA_STREAM_TYPE&&(h.programMapTable["timed-metadata"][J]=F);B+=((v[B+3]&15)<<8|v[B+4])+5}w.programMapTable=h.programMapTable}};this.push=function(v){var w={},B=4;w.payloadUnitStartIndicator=!!(v[1]&64); |
|
w.pid=v[1]&31;w.pid<<=8;w.pid|=v[2];1<(v[3]&48)>>>4&&(B+=v[B]+1);if(0===w.pid)w.type="pat",m(v.subarray(B),w),this.trigger("data",w);else if(w.pid===this.pmtPid)for(w.type="pmt",m(v.subarray(B),w),this.trigger("data",w);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([v,B,w]):this.processPes_(v,B,w)};this.processPes_=function(v,w,B){B.streamType=B.pid===this.programMapTable.video?La.H264_STREAM_TYPE: |
|
B.pid===this.programMapTable.audio?La.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][B.pid];B.type="pes";B.data=v.subarray(w);this.trigger("data",B)}};Ie.prototype=new b;Ie.STREAM_TYPES={h264:27,adts:15};var Xg=function(){var h=this,m=!1,r={data:[],size:0},q={data:[],size:0},v={data:[],size:0},w,B=function(C,F,J){var N=new Uint8Array(C.size),L={type:F},X=0,S=0;X=!1;if(C.data.length&&!(9>C.size)){L.trackId=C.data[0].pid;for(X=0;X<C.data.length;X++){var ea=C.data[X];N.set(ea.data,S);S+=ea.data.byteLength}S= |
|
N[0]<<16|N[1]<<8|N[2];L.data=new Uint8Array;1===S&&(L.packetLength=6+(N[4]<<8|N[5]),L.dataAlignmentIndicator=0!==(N[6]&4),S=N[7],S&192&&(L.pts=(N[9]&14)<<27|(N[10]&255)<<20|(N[11]&254)<<12|(N[12]&255)<<5|(N[13]&254)>>>3,L.pts*=4,L.pts+=(N[13]&6)>>>1,L.dts=L.pts,S&64&&(L.dts=(N[14]&14)<<27|(N[15]&255)<<20|(N[16]&254)<<12|(N[17]&255)<<5|(N[18]&254)>>>3,L.dts*=4,L.dts+=(N[18]&6)>>>1)),L.data=N.subarray(9+N[8]));X="video"===F||L.packetLength<=C.size;if(J||X)C.size=0,C.data.length=0;X&&h.trigger("data", |
|
L)}};Xg.prototype.init.call(this);this.push=function(C){({pat:function(){},pes:function(){switch(C.streamType){case La.H264_STREAM_TYPE:var F=r;var J="video";break;case La.ADTS_STREAM_TYPE:F=q;J="audio";break;case La.METADATA_STREAM_TYPE:F=v;J="timed-metadata";break;default:return}C.payloadUnitStartIndicator&&B(F,J,!0);F.data.push(C);F.size+=C.data.byteLength},pmt:function(){var F={type:"metadata",tracks:[]};w=C.programMapTable;null!==w.video&&F.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0}, |
|
id:+w.video,codec:"avc",type:"video"});null!==w.audio&&F.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+w.audio,codec:"adts",type:"audio"});m=!0;h.trigger("data",F)}})[C.type]()};this.reset=function(){r.size=0;r.data.length=0;q.size=0;q.data.length=0;this.trigger("reset")};this.flushStreams_=function(){B(r,"video");B(q,"audio");B(v,"timed-metadata")};this.flush=function(){if(!m&&w){var C={type:"metadata",tracks:[]};null!==w.video&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0}, |
|
id:+w.video,codec:"avc",type:"video"});null!==w.audio&&C.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+w.audio,codec:"adts",type:"audio"});h.trigger("data",C)}m=!1;this.flushStreams_();this.trigger("done")}};Xg.prototype=new b;var Gb={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:Wg,TransportParseStream:Ie,ElementaryStream:Xg,TimestampRolloverStream:eq,CaptionStream:hl,Cea608Stream:cq,Cea708Stream:dq,MetadataStream:Vg},Je;for(Je in La)La.hasOwnProperty(Je)&&(Gb[Je]=La[Je]);var fq= |
|
ha.ONE_SECOND_IN_TS,il=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350];var Ke=function(h){var m,r=0;Ke.prototype.init.call(this);this.skipWarn_=function(q,v){this.trigger("log",{level:"warn",message:`adts skiping bytes ${q} to ${v} in frame ${r} outside syncword`})};this.push=function(q){var v=0;h||(r=0);if("audio"===q.type){if(m&&m.length){var w=m;m=new Uint8Array(w.byteLength+q.data.byteLength);m.set(w);m.set(q.data,w.byteLength)}else m=q.data;for(var B;v+7<m.length;)if(255!== |
|
m[v]||240!==(m[v+1]&246))"number"!==typeof B&&(B=v),v++;else{"number"===typeof B&&(this.skipWarn_(B,v),B=null);var C=2*(~m[v+1]&1);w=(m[v+3]&3)<<11|m[v+4]<<3|(m[v+5]&224)>>5;var F=1024*((m[v+6]&3)+1);var J=F*fq/il[(m[v+2]&60)>>>2];if(m.byteLength-v<w)break;this.trigger("data",{pts:q.pts+r*J,dts:q.dts+r*J,sampleCount:F,audioobjecttype:(m[v+2]>>>6&3)+1,channelcount:(m[v+2]&1)<<2|(m[v+3]&192)>>>6,samplerate:il[(m[v+2]&60)>>>2],samplingfrequencyindex:(m[v+2]&60)>>>2,samplesize:16,data:m.subarray(v+7+ |
|
C,v+w)});r++;v+=w}"number"===typeof B&&(this.skipWarn_(B,v),B=null);m=m.subarray(v)}};this.flush=function(){r=0;this.trigger("done")};this.reset=function(){m=void 0;this.trigger("reset")};this.endTimeline=function(){m=void 0;this.trigger("endedtimeline")}};Ke.prototype=new b;var gq=function(h){var m=h.byteLength,r=0,q=0;this.length=function(){return 8*m};this.bitsAvailable=function(){return 8*m+q};this.loadWord=function(){var v=h.byteLength-m,w=new Uint8Array(4),B=Math.min(4,m);if(0===B)throw Error("no bytes available"); |
|
w.set(h.subarray(v,v+B));r=(new DataView(w.buffer)).getUint32(0);q=8*B;m-=B};this.skipBits=function(v){if(!(q>v)){v-=q;var w=Math.floor(v/8);v-=8*w;m-=w;this.loadWord()}r<<=v;q-=v};this.readBits=function(v){var w=Math.min(q,v),B=r>>>32-w;q-=w;0<q?r<<=w:0<m&&this.loadWord();w=v-w;return 0<w?B<<w|this.readBits(w):B};this.skipLeadingZeros=function(){var v;for(v=0;v<q;++v)if(0!==(r&2147483648>>>v))return r<<=v,q-=v,v;this.loadWord();return v+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+ |
|
this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var v=this.skipLeadingZeros();return this.readBits(v+1)-1};this.readExpGolomb=function(){var v=this.readUnsignedExpGolomb();return 1&v?1+v>>>1:-1*(v>>>1)};this.readBoolean=function(){return 1===this.readBits(1)};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var Yg=function(){var h=0,m,r;Yg.prototype.init.call(this);this.push=function(q){if(r){var v= |
|
new Uint8Array(r.byteLength+q.data.byteLength);v.set(r);v.set(q.data,r.byteLength);r=v}else r=q.data;for(q=r.byteLength;h<q-3;h++)if(1===r[h+2]){m=h+5;break}for(;m<q;)switch(r[m]){case 0:if(0!==r[m-1]){m+=2;break}else if(0!==r[m-2]){m++;break}h+3!==m-2&&this.trigger("data",r.subarray(h+3,m-2));do m++;while(1!==r[m]&&m<q);h=m-2;m+=3;break;case 1:if(0!==r[m-1]||0!==r[m-2]){m+=3;break}this.trigger("data",r.subarray(h+3,m-2));h=m-2;m+=3;break;default:m+=3}r=r.subarray(h);m-=h;h=0};this.reset=function(){r= |
|
null;h=0;this.trigger("reset")};this.flush=function(){r&&3<r.byteLength&&this.trigger("data",r.subarray(h+3));r=null;h=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};Yg.prototype=new b;var hq={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0};var Zg=function(){var h=new Yg,m,r,q;Zg.prototype.init.call(this);var v=this;this.push=function(F){"video"===F.type&&(m=F.trackId,r=F.pts,q=F.dts,h.push(F))};h.on("data",function(F){var J= |
|
{trackId:m,pts:r,dts:q,data:F,nalUnitTypeCode:F[0]&31};switch(J.nalUnitTypeCode){case 5:J.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:J.nalUnitType="sei_rbsp";J.escapedRBSP=B(F.subarray(1));break;case 7:J.nalUnitType="seq_parameter_set_rbsp";J.escapedRBSP=B(F.subarray(1));J.config=C(J.escapedRBSP);break;case 8:J.nalUnitType="pic_parameter_set_rbsp";break;case 9:J.nalUnitType="access_unit_delimiter_rbsp"}v.trigger("data",J)});h.on("done",function(){v.trigger("done")});h.on("partialdone", |
|
function(){v.trigger("partialdone")});h.on("reset",function(){v.trigger("reset")});h.on("endedtimeline",function(){v.trigger("endedtimeline")});this.flush=function(){h.flush()};this.partialFlush=function(){h.partialFlush()};this.reset=function(){h.reset()};this.endTimeline=function(){h.endTimeline()};var w=function(F,J){var N=8,L=8,X;for(X=0;X<F;X++)0!==L&&(L=J.readExpGolomb(),L=(N+L+256)%256),N=0===L?N:L};var B=function(F){for(var J=F.byteLength,N=[],L=1,X;L<J-2;)0===F[L]&&0===F[L+1]&&3===F[L+2]? |
|
(N.push(L+2),L+=2):L++;if(0===N.length)return F;J-=N.length;X=new Uint8Array(J);var S=0;for(L=0;L<J;S++,L++)S===N[0]&&(S++,N.shift()),X[L]=F[S];return X};var C=function(F){var J=0,N=0,L=0,X=0,S=[1,1];F=new gq(F);var ea=F.readUnsignedByte();var gb=F.readUnsignedByte();var yd=F.readUnsignedByte();F.skipUnsignedExpGolomb();if(hq[ea]){var Ia=F.readUnsignedExpGolomb();3===Ia&&F.skipBits(1);F.skipUnsignedExpGolomb();F.skipUnsignedExpGolomb();F.skipBits(1);if(F.readBoolean()){var zd=3!==Ia?8:12;for(Ia=0;Ia< |
|
zd;Ia++)F.readBoolean()&&(6>Ia?w(16,F):w(64,F))}}F.skipUnsignedExpGolomb();Ia=F.readUnsignedExpGolomb();if(0===Ia)F.readUnsignedExpGolomb();else if(1===Ia)for(F.skipBits(1),F.skipExpGolomb(),F.skipExpGolomb(),zd=F.readUnsignedExpGolomb(),Ia=0;Ia<zd;Ia++)F.skipExpGolomb();F.skipUnsignedExpGolomb();F.skipBits(1);Ia=F.readUnsignedExpGolomb();zd=F.readUnsignedExpGolomb();var jl=F.readBits(1);0===jl&&F.skipBits(1);F.skipBits(1);F.readBoolean()&&(J=F.readUnsignedExpGolomb(),N=F.readUnsignedExpGolomb(), |
|
L=F.readUnsignedExpGolomb(),X=F.readUnsignedExpGolomb());if(F.readBoolean()&&F.readBoolean()){var iq=F.readUnsignedByte();switch(iq){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break; |
|
case 255:S=[F.readUnsignedByte()<<8|F.readUnsignedByte(),F.readUnsignedByte()<<8|F.readUnsignedByte()]}S&&S[0]/S[1]}return{profileIdc:ea,levelIdc:yd,profileCompatibility:gb,width:16*(Ia+1)-2*J-2*N,height:(2-jl)*(zd+1)*16-2*L-2*X,sarRatio:S}}};Zg.prototype=new b;var jq=[96E3,88200,64E3,48E3,44100,32E3,24E3,22050,16E3,12E3,11025,8E3,7350],kl=function(h,m){var r=h[m+6]<<21|h[m+7]<<14|h[m+8]<<7|h[m+9];h=h[m+5];r=0<=r?r:0;return(h&16)>>4?r+20:r+10},ll=function(h,m){if(10>h.length-m||73!==h[m]||68!==h[m+ |
|
1]||51!==h[m+2])return m;m+=kl(h,m);return ll(h,m)},ml=function(h){return h[0]<<21|h[1]<<14|h[2]<<7|h[3]},Qb={isLikelyAacData:function(h){var m=ll(h,0);return h.length>=m+2&&255===(h[m]&255)&&240===(h[m+1]&240)&&16===(h[m+1]&22)},parseId3TagSize:kl,parseAdtsSize:function(h,m){return h[m+3]&6144|h[m+4]<<3|(h[m+5]&224)>>5},parseType:function(h,m){return 73===h[m]&&68===h[m+1]&&51===h[m+2]?"timed-metadata":h[m]&1&&240===(h[m+1]&240)?"audio":null},parseSampleRate:function(h){for(var m=0;m+5<h.length;)if(255!== |
|
h[m]||240!==(h[m+1]&246))m++;else return jq[(h[m+2]&60)>>>2];return null},parseAacTimestamp:function(h){var m=10;h[5]&64&&(m=m+4+ml(h.subarray(10,14)));do{var r=ml(h.subarray(m+4,m+8));if(1>r)break;var q=String.fromCharCode(h[m],h[m+1],h[m+2],h[m+3]);if("PRIV"===q){q=h.subarray(m+10,m+r+10);for(var v=0;v<q.byteLength;v++)if(0===q[v]){var w=unescape,B=void 0,C=q,F=v,J="";for(B=0;B<F;B++)J+="%"+("00"+C[B].toString(16)).slice(-2);if("com.apple.streaming.transportStreamTimestamp"===w(J))return h=q.subarray(v+ |
|
1),m=(h[3]&1)<<30|h[4]<<22|h[5]<<14|h[6]<<6|h[7]>>>2,m*=4,m+=h[7]&3;break}}m+=10;m+=r}while(m<h.byteLength);return null}};var $g=function(){var h=new Uint8Array,m=0;$g.prototype.init.call(this);this.setTimestamp=function(r){m=r};this.push=function(r){var q=0,v=0;h.length?(q=h.length,h=new Uint8Array(r.byteLength+q),h.set(h.subarray(0,q)),h.set(r,q)):h=r;for(;3<=h.length-v;)if(73===h[v]&&68===h[v+1]&&51===h[v+2]){if(10>h.length-v)break;q=Qb.parseId3TagSize(h,v);if(v+q>h.length)break;r={type:"timed-metadata", |
|
data:h.subarray(v,v+q)};this.trigger("data",r);v+=q}else if(255===(h[v]&255)&&240===(h[v+1]&240)){if(7>h.length-v)break;q=Qb.parseAdtsSize(h,v);if(v+q>h.length)break;r={type:"audio",data:h.subarray(v,v+q),pts:m,dts:m};this.trigger("data",r);v+=q}else v++;h=0<h.length-v?h.subarray(v):new Uint8Array};this.reset=function(){h=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){h=new Uint8Array;this.trigger("endedtimeline")}};$g.prototype=new b;var Ad={groupNalsIntoFrames:function(h){var m, |
|
r=[],q=[];q.byteLength=0;q.nalCount=0;q.duration=0;for(m=r.byteLength=0;m<h.length;m++){var v=h[m];"access_unit_delimiter_rbsp"===v.nalUnitType?(r.length&&(r.duration=v.dts-r.dts,q.byteLength+=r.byteLength,q.nalCount+=r.length,q.duration+=r.duration,q.push(r)),r=[v],r.byteLength=v.data.byteLength,r.pts=v.pts,r.dts=v.dts):("slice_layer_without_partitioning_rbsp_idr"===v.nalUnitType&&(r.keyFrame=!0),r.duration=v.dts-r.dts,r.byteLength+=v.data.byteLength,r.push(v))}q.length&&(!r.duration||0>=r.duration)&& |
|
(r.duration=q[q.length-1].duration);q.byteLength+=r.byteLength;q.nalCount+=r.length;q.duration+=r.duration;q.push(r);return q},groupFramesIntoGops:function(h){var m,r=[],q=[];r.byteLength=0;r.nalCount=0;r.duration=0;r.pts=h[0].pts;r.dts=h[0].dts;q.byteLength=0;q.nalCount=0;q.duration=0;q.pts=h[0].pts;q.dts=h[0].dts;for(m=0;m<h.length;m++){var v=h[m];v.keyFrame?(r.length&&(q.push(r),q.byteLength+=r.byteLength,q.nalCount+=r.nalCount,q.duration+=r.duration),r=[v],r.nalCount=v.length,r.byteLength=v.byteLength, |
|
r.pts=v.pts,r.dts=v.dts,r.duration=v.duration):(r.duration+=v.duration,r.nalCount+=v.length,r.byteLength+=v.byteLength,r.push(v))}q.length&&0>=r.duration&&(r.duration=q[q.length-1].duration);q.byteLength+=r.byteLength;q.nalCount+=r.nalCount;q.duration+=r.duration;q.push(r);return q},extendFirstKeyFrame:function(h){if(!h[0][0].keyFrame&&1<h.length){var m=h.shift();h.byteLength-=m.byteLength;h.nalCount-=m.nalCount;h[0][0].dts=m.dts;h[0][0].pts=m.pts;h[0][0].duration+=m.duration}return h},generateSampleTable:function(h, |
|
m){var r,q=m||0,v=[];for(m=0;m<h.length;m++){var w=h[m];for(r=0;r<w.length;r++){var B=w[r];B=dl(B,q);q+=B.size;v.push(B)}}return v},concatenateNalData:function(h){var m,r,q,v=0,w=new Uint8Array(h.byteLength+4*h.nalCount),B=new DataView(w.buffer);for(m=0;m<h.length;m++){var C=h[m];for(r=0;r<C.length;r++){var F=C[r];for(q=0;q<F.length;q++){var J=F[q];B.setUint32(v,J.data.byteLength);v+=4;w.set(J.data,v);v+=J.data.byteLength}}}return w},generateSampleTableForFrame:function(h,m){var r=[];h=dl(h,m||0); |
|
r.push(h);return r},concatenateNalDataForFrame:function(h){var m,r=0,q=new Uint8Array(h.byteLength+4*h.length),v=new DataView(q.buffer);for(m=0;m<h.length;m++){var w=h[m];v.setUint32(r,w.data.byteLength);r+=4;q.set(w.data,r);r+=w.data.byteLength}return q}},Le={prefixWithSilence:function(h,m,r,q){var v=0,w=0,B=w=0;if(m.length){var C=ha.audioTsToVideoTs(h.baseMediaDecodeTime,h.samplerate);v=Math.ceil(ha.ONE_SECOND_IN_TS/(h.samplerate/1024));r&&q&&(w=C-Math.max(r,q),w=Math.floor(w/v),B=w*v);if(!(1>w|| |
|
B>ha.ONE_SECOND_IN_TS/2)){Sg||(r={96E3:[ac,[227,64],ja(154),[56]],88200:[ac,[231],ja(170),[56]],64E3:[ac,[248,192],ja(240),[56]],48E3:[ac,[255,192],ja(268),[55,148,128],ja(54),[112]],44100:[ac,[255,192],ja(268),[55,163,128],ja(84),[112]],32E3:[ac,[255,192],ja(268),[55,234],ja(226),[112]],24E3:[ac,[255,192],ja(268),[55,255,128],ja(268),[111,112],ja(126),[224]],16E3:[ac,[255,192],ja(268),[55,255,128],ja(268),[111,255],ja(269),[223,108],ja(195),[1,192]],12E3:[Rg,ja(268),[3,127,248],ja(268),[6,255,240], |
|
ja(268),[13,255,224],ja(268),[27,253,128],ja(259),[56]],11025:[Rg,ja(268),[3,127,248],ja(268),[6,255,240],ja(268),[13,255,224],ja(268),[27,255,192],ja(268),[55,175,128],ja(108),[112]],8E3:[Rg,ja(268),[3,121,16],ja(47),[7]]},Sg=Xp(r));r=Sg[h.samplerate];r||(r=m[0].data);for(q=0;q<w;q++)C=m[0],m.splice(0,0,{data:r,dts:C.dts-v,pts:C.pts-v});h.baseMediaDecodeTime-=Math.floor(ha.videoTsToAudioTs(B,h.samplerate));return B}}},trimAdtsFramesByEarliestDts:function(h,m,r){if(m.minSegmentDts>=r)return h;m.minSegmentDts= |
|
Infinity;return h.filter(function(q){return q.dts>=r?(m.minSegmentDts=Math.min(m.minSegmentDts,q.dts),m.minSegmentPts=m.minSegmentDts,!0):!1})},generateSampleTable:function(h){var m,r=[];for(m=0;m<h.length;m++){var q=h[m];r.push({size:q.data.byteLength,duration:1024})}return r},concatenateFrameData:function(h){var m,r=0;var q=Uint8Array;var v=0;for(m=0;m<h.length;m++){var w=h[m];v+=w.data.byteLength}w=new q(v);for(q=0;q<h.length;q++)m=h[q],w.set(m.data,r),r+=m.data.byteLength;return w}},sb={clearDtsInfo:function(h){delete h.minSegmentDts; |
|
delete h.maxSegmentDts;delete h.minSegmentPts;delete h.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(h,m){var r=h.minSegmentDts;m||(r-=h.timelineStartInfo.dts);m=h.timelineStartInfo.baseMediaDecodeTime;m=Math.max(0,m+r);"audio"===h.type&&(h=h.samplerate/Yp,m=Math.floor(m*h));return m},collectDtsInfo:function(h,m){"number"===typeof m.pts&&(void 0===h.timelineStartInfo.pts&&(h.timelineStartInfo.pts=m.pts),h.minSegmentPts=void 0===h.minSegmentPts?m.pts:Math.min(h.minSegmentPts,m.pts),h.maxSegmentPts= |
|
void 0===h.maxSegmentPts?m.pts:Math.max(h.maxSegmentPts,m.pts));"number"===typeof m.dts&&(void 0===h.timelineStartInfo.dts&&(h.timelineStartInfo.dts=m.dts),h.minSegmentDts=void 0===h.minSegmentDts?m.dts:Math.min(h.minSegmentDts,m.dts),h.maxSegmentDts=void 0===h.maxSegmentDts?m.dts:Math.max(h.maxSegmentDts,m.dts))}},kq=Qb.isLikelyAacData,lq=ha.ONE_SECOND_IN_TS,nl=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],ol="width height profileIdc levelIdc profileCompatibility sarRatio".split(" "), |
|
mq=function(h,m){m.stream=h;this.trigger("log",m)},pl=function(h,m){for(var r=Object.keys(m),q=0;q<r.length;q++){var v=r[q];if("headOfPipeline"!==v&&m[v].on)m[v].on("log",mq.bind(h,v))}},ql=function(h,m){var r;if(h.length!==m.length)return!1;for(r=0;r<h.length;r++)if(h[r]!==m[r])return!1;return!0},rl=function(h,m,r,q,v,w){return{start:{dts:h,pts:h+(r-m)},end:{dts:h+(q-m),pts:h+(v-r)},prependedContentDuration:w,baseMediaDecodeTime:h}};var Me=function(h,m){var r=[],q=0,v=0,w=Infinity;m=m||{};var B= |
|
m.firstSequenceNumber||0;Me.prototype.init.call(this);this.push=function(C){sb.collectDtsInfo(h,C);h&&nl.forEach(function(F){h[F]=C[F]});r.push(C)};this.setEarliestDts=function(C){q=C};this.setVideoBaseMediaDecodeTime=function(C){w=C};this.setAudioAppendStart=function(C){v=C};this.flush=function(){if(0!==r.length){var C=Le.trimAdtsFramesByEarliestDts(r,h,q);h.baseMediaDecodeTime=sb.calculateTrackBaseMediaDecodeTime(h,m.keepOriginalTimestamps);var F=Le.prefixWithSilence(h,C,v,w);h.samples=Le.generateSampleTable(C); |
|
var J=ud.mdat(Le.concatenateFrameData(C));r=[];var N=ud.moof(B,[h]);var L=new Uint8Array(N.byteLength+J.byteLength);B++;L.set(N);L.set(J,N.byteLength);sb.clearDtsInfo(h);N=Math.ceil(1024*lq/h.samplerate);C.length&&(N*=C.length,this.trigger("segmentTimingInfo",rl(ha.audioTsToVideoTs(h.baseMediaDecodeTime,h.samplerate),C[0].dts,C[0].pts,C[0].dts+N,C[0].pts+N,F||0)),this.trigger("timingInfo",{start:C[0].pts,end:C[0].pts+N}));this.trigger("data",{track:h,boxes:L})}this.trigger("done","AudioSegmentStream")}; |
|
this.reset=function(){sb.clearDtsInfo(h);r=[];this.trigger("reset")}};Me.prototype=new b;var ah=function(h,m){var r=[],q=[],v,w;m=m||{};var B=m.firstSequenceNumber||0;ah.prototype.init.call(this);delete h.minPTS;this.gopCache_=[];this.push=function(C){sb.collectDtsInfo(h,C);"seq_parameter_set_rbsp"!==C.nalUnitType||v||(v=C.config,h.sps=[C.data],ol.forEach(function(F){h[F]=v[F]},this));"pic_parameter_set_rbsp"!==C.nalUnitType||w||(w=C.data,h.pps=[C.data]);r.push(C)};this.flush=function(){var C;var F= |
|
0;for(var J,N;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0!==r.length){var L=Ad.groupNalsIntoFrames(r);L=Ad.groupFramesIntoGops(L);L[0][0].keyFrame||((C=this.getGopForFusion_(r[0],h))?(F=C.duration,L.unshift(C),L.byteLength+=C.byteLength,L.nalCount+=C.nalCount,L.pts=C.pts,L.dts=C.dts,L.duration+=C.duration):L=Ad.extendFirstKeyFrame(L));if(q.length){C=m.alignGopsAtEnd?this.alignGopsAtEnd_(L):this.alignGopsAtStart_(L);if(!C){this.gopCache_.unshift({gop:L.pop(),pps:h.pps, |
|
sps:h.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);r=[];this.resetStream_();this.trigger("done","VideoSegmentStream");return}sb.clearDtsInfo(h);L=C}sb.collectDtsInfo(h,L);h.samples=Ad.generateSampleTable(L);C=ud.mdat(Ad.concatenateNalData(L));h.baseMediaDecodeTime=sb.calculateTrackBaseMediaDecodeTime(h,m.keepOriginalTimestamps);this.trigger("processedGopsInfo",L.map(function(X){return{pts:X.pts,dts:X.dts,byteLength:X.byteLength}}));J=L[0];N=L[L.length-1];this.trigger("segmentTimingInfo", |
|
rl(h.baseMediaDecodeTime,J.dts,J.pts,N.dts+N.duration,N.pts+N.duration,F));this.trigger("timingInfo",{start:L[0].pts,end:L[L.length-1].pts+L[L.length-1].duration});this.gopCache_.unshift({gop:L.pop(),pps:h.pps,sps:h.sps});this.gopCache_.length=Math.min(6,this.gopCache_.length);r=[];this.trigger("baseMediaDecodeTime",h.baseMediaDecodeTime);this.trigger("timelineStartInfo",h.timelineStartInfo);F=ud.moof(B,[h]);L=new Uint8Array(F.byteLength+C.byteLength);B++;L.set(F);L.set(C,F.byteLength);this.trigger("data", |
|
{track:h,boxes:L})}this.resetStream_();this.trigger("done","VideoSegmentStream")};this.reset=function(){this.resetStream_();r=[];this.gopCache_.length=0;q.length=0;this.trigger("reset")};this.resetStream_=function(){sb.clearDtsInfo(h);w=v=void 0};this.getGopForFusion_=function(C){var F=Infinity,J;for(J=0;J<this.gopCache_.length;J++){var N=this.gopCache_[J];var L=N.gop;if(h.pps&&ql(h.pps[0],N.pps[0])&&h.sps&&ql(h.sps[0],N.sps[0])&&!(L.dts<h.timelineStartInfo.dts)&&(L=C.dts-L.dts-L.duration,-1E4<=L&& |
|
45E3>=L&&(!X||F>L))){var X=N;F=L}}return X?X.gop:null};this.alignGopsAtStart_=function(C){var F,J;var N=C.byteLength;var L=C.nalCount;var X=C.duration;for(F=J=0;F<q.length&&J<C.length;){var S=q[F];var ea=C[J];if(S.pts===ea.pts)break;ea.pts>S.pts?F++:(J++,N-=ea.byteLength,L-=ea.nalCount,X-=ea.duration)}if(0===J)return C;if(J===C.length)return null;C=C.slice(J);C.byteLength=N;C.duration=X;C.nalCount=L;C.pts=C[0].pts;C.dts=C[0].dts;return C};this.alignGopsAtEnd_=function(C){var F;var J=q.length-1;var N= |
|
C.length-1;var L=null;for(F=!1;0<=J&&0<=N;){var X=q[J];var S=C[N];if(X.pts===S.pts){F=!0;break}X.pts>S.pts?J--:(J===q.length-1&&(L=N),N--)}if(!F&&null===L)return null;J=F?N:L;if(0===J)return C;C=C.slice(J);J=C.reduce(function(ea,gb){ea.byteLength+=gb.byteLength;ea.duration+=gb.duration;ea.nalCount+=gb.nalCount;return ea},{byteLength:0,duration:0,nalCount:0});C.byteLength=J.byteLength;C.duration=J.duration;C.nalCount=J.nalCount;C.pts=C[0].pts;C.dts=C[0].dts;return C};this.alignGopsWith=function(C){q= |
|
C}};ah.prototype=new b;var Sc=function(h,m){this.numberOfTracks=0;this.metadataStream=m;h=h||{};this.remuxTracks="undefined"!==typeof h.remux?!!h.remux:!0;this.keepOriginalTimestamps="boolean"===typeof h.keepOriginalTimestamps?h.keepOriginalTimestamps:!1;this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.emittedTracks=this.pendingBytes=0;Sc.prototype.init.call(this);this.push=function(r){if(r.content||r.text)return this.pendingCaptions.push(r); |
|
if(r.frames)return this.pendingMetadata.push(r);this.pendingTracks.push(r.track);this.pendingBytes+=r.boxes.byteLength;"video"===r.track.type&&(this.videoTrack=r.track,this.pendingBoxes.push(r.boxes));"audio"===r.track.type&&(this.audioTrack=r.track,this.pendingBoxes.unshift(r.boxes))}};Sc.prototype=new b;Sc.prototype.flush=function(h){var m=0,r={captions:[],captionStreams:{},metadata:[],info:{}},q=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==h&&"AudioSegmentStream"!== |
|
h||this.remuxTracks)return;if(0===this.pendingTracks.length){this.emittedTracks++;this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}this.videoTrack?(q=this.videoTrack.timelineStartInfo.pts,ol.forEach(function(v){r.info[v]=this.videoTrack[v]},this)):this.audioTrack&&(q=this.audioTrack.timelineStartInfo.pts,nl.forEach(function(v){r.info[v]=this.audioTrack[v]},this));if(this.videoTrack||this.audioTrack){r.type=1===this.pendingTracks.length?this.pendingTracks[0].type: |
|
"combined";this.emittedTracks+=this.pendingTracks.length;h=ud.initSegment(this.pendingTracks);r.initSegment=new Uint8Array(h.byteLength);r.initSegment.set(h);r.data=new Uint8Array(this.pendingBytes);for(h=0;h<this.pendingBoxes.length;h++)r.data.set(this.pendingBoxes[h],m),m+=this.pendingBoxes[h].byteLength;for(h=0;h<this.pendingCaptions.length;h++)m=this.pendingCaptions[h],m.startTime=ha.metadataTsToSeconds(m.startPts,q,this.keepOriginalTimestamps),m.endTime=ha.metadataTsToSeconds(m.endPts,q,this.keepOriginalTimestamps), |
|
r.captionStreams[m.stream]=!0,r.captions.push(m);for(h=0;h<this.pendingMetadata.length;h++)m=this.pendingMetadata[h],m.cueTime=ha.metadataTsToSeconds(m.pts,q,this.keepOriginalTimestamps),r.metadata.push(m);r.metadata.dispatchType=this.metadataStream.dispatchType;this.pendingTracks.length=0;this.videoTrack=null;this.pendingBoxes.length=0;this.pendingBytes=this.pendingCaptions.length=0;this.pendingMetadata.length=0;this.trigger("data",r);for(h=0;h<r.captions.length;h++)m=r.captions[h],this.trigger("caption", |
|
m);for(h=0;h<r.metadata.length;h++)m=r.metadata[h],this.trigger("id3Frame",m)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)};Sc.prototype.setRemux=function(h){this.remuxTracks=h};var bh=function(h){var m=this,r=!0,q,v;bh.prototype.init.call(this);h=h||{};this.baseMediaDecodeTime=h.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var w={};this.transmuxPipeline_=w;w.type="aac";w.metadataStream=new Gb.MetadataStream;w.aacStream= |
|
new $g;w.audioTimestampRolloverStream=new Gb.TimestampRolloverStream("audio");w.timedMetadataTimestampRolloverStream=new Gb.TimestampRolloverStream("timed-metadata");w.adtsStream=new Ke;w.coalesceStream=new Sc(h,w.metadataStream);w.headOfPipeline=w.aacStream;w.aacStream.pipe(w.audioTimestampRolloverStream).pipe(w.adtsStream);w.aacStream.pipe(w.timedMetadataTimestampRolloverStream).pipe(w.metadataStream).pipe(w.coalesceStream);w.metadataStream.on("timestamp",function(B){w.aacStream.setTimestamp(B.timeStamp)}); |
|
w.aacStream.on("data",function(B){"timed-metadata"!==B.type&&"audio"!==B.type||w.audioSegmentStream||(v=v||{timelineStartInfo:{baseMediaDecodeTime:m.baseMediaDecodeTime},codec:"adts",type:"audio"},w.coalesceStream.numberOfTracks++,w.audioSegmentStream=new Me(v,h),w.audioSegmentStream.on("log",m.getLogTrigger_("audioSegmentStream")),w.audioSegmentStream.on("timingInfo",m.trigger.bind(m,"audioTimingInfo")),w.adtsStream.pipe(w.audioSegmentStream).pipe(w.coalesceStream),m.trigger("trackinfo",{hasAudio:!!v, |
|
hasVideo:!!q}))});w.coalesceStream.on("data",this.trigger.bind(this,"data"));w.coalesceStream.on("done",this.trigger.bind(this,"done"));pl(this,w)};this.setupTsPipeline=function(){var w={};this.transmuxPipeline_=w;w.type="ts";w.metadataStream=new Gb.MetadataStream;w.packetStream=new Gb.TransportPacketStream;w.parseStream=new Gb.TransportParseStream;w.elementaryStream=new Gb.ElementaryStream;w.timestampRolloverStream=new Gb.TimestampRolloverStream;w.adtsStream=new Ke;w.h264Stream=new Zg;w.captionStream= |
|
new Gb.CaptionStream(h);w.coalesceStream=new Sc(h,w.metadataStream);w.headOfPipeline=w.packetStream;w.packetStream.pipe(w.parseStream).pipe(w.elementaryStream).pipe(w.timestampRolloverStream);w.timestampRolloverStream.pipe(w.h264Stream);w.timestampRolloverStream.pipe(w.adtsStream);w.timestampRolloverStream.pipe(w.metadataStream).pipe(w.coalesceStream);w.h264Stream.pipe(w.captionStream).pipe(w.coalesceStream);w.elementaryStream.on("data",function(B){var C;if("metadata"===B.type){for(C=B.tracks.length;C--;)q|| |
|
"video"!==B.tracks[C].type?v||"audio"!==B.tracks[C].type||(v=B.tracks[C],v.timelineStartInfo.baseMediaDecodeTime=m.baseMediaDecodeTime):(q=B.tracks[C],q.timelineStartInfo.baseMediaDecodeTime=m.baseMediaDecodeTime);q&&!w.videoSegmentStream&&(w.coalesceStream.numberOfTracks++,w.videoSegmentStream=new ah(q,h),w.videoSegmentStream.on("log",m.getLogTrigger_("videoSegmentStream")),w.videoSegmentStream.on("timelineStartInfo",function(F){v&&!h.keepOriginalTimestamps&&(v.timelineStartInfo=F,w.audioSegmentStream.setEarliestDts(F.dts- |
|
m.baseMediaDecodeTime))}),w.videoSegmentStream.on("processedGopsInfo",m.trigger.bind(m,"gopInfo")),w.videoSegmentStream.on("segmentTimingInfo",m.trigger.bind(m,"videoSegmentTimingInfo")),w.videoSegmentStream.on("baseMediaDecodeTime",function(F){v&&w.audioSegmentStream.setVideoBaseMediaDecodeTime(F)}),w.videoSegmentStream.on("timingInfo",m.trigger.bind(m,"videoTimingInfo")),w.h264Stream.pipe(w.videoSegmentStream).pipe(w.coalesceStream));v&&!w.audioSegmentStream&&(w.coalesceStream.numberOfTracks++, |
|
w.audioSegmentStream=new Me(v,h),w.audioSegmentStream.on("log",m.getLogTrigger_("audioSegmentStream")),w.audioSegmentStream.on("timingInfo",m.trigger.bind(m,"audioTimingInfo")),w.audioSegmentStream.on("segmentTimingInfo",m.trigger.bind(m,"audioSegmentTimingInfo")),w.adtsStream.pipe(w.audioSegmentStream).pipe(w.coalesceStream));m.trigger("trackinfo",{hasAudio:!!v,hasVideo:!!q})}});w.coalesceStream.on("data",this.trigger.bind(this,"data"));w.coalesceStream.on("id3Frame",function(B){B.dispatchType=w.metadataStream.dispatchType; |
|
m.trigger("id3Frame",B)});w.coalesceStream.on("caption",this.trigger.bind(this,"caption"));w.coalesceStream.on("done",this.trigger.bind(this,"done"));pl(this,w)};this.setBaseMediaDecodeTime=function(w){var B=this.transmuxPipeline_;h.keepOriginalTimestamps||(this.baseMediaDecodeTime=w);v&&(v.timelineStartInfo.dts=void 0,v.timelineStartInfo.pts=void 0,sb.clearDtsInfo(v),B.audioTimestampRolloverStream&&B.audioTimestampRolloverStream.discontinuity());q&&(B.videoSegmentStream&&(B.videoSegmentStream.gopCache_= |
|
[]),q.timelineStartInfo.dts=void 0,q.timelineStartInfo.pts=void 0,sb.clearDtsInfo(q),B.captionStream.reset());B.timestampRolloverStream&&B.timestampRolloverStream.discontinuity()};this.setAudioAppendStart=function(w){v&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(w)};this.setRemux=function(w){var B=this.transmuxPipeline_;h.remux=w;B&&B.coalesceStream&&B.coalesceStream.setRemux(w)};this.alignGopsWith=function(w){q&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(w)}; |
|
this.getLogTrigger_=function(w){var B=this;return function(C){C.stream=w;B.trigger("log",C)}};this.push=function(w){if(r){var B=kq(w);B&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():B||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline();r=!1}this.transmuxPipeline_.headOfPipeline.push(w)};this.flush=function(){r=!0;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){this.transmuxPipeline_.headOfPipeline&& |
|
this.transmuxPipeline_.headOfPipeline.reset()};this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}};bh.prototype=new b;var nc=function(h){var m=""+String.fromCharCode(h[0]);m+=String.fromCharCode(h[1]);m+=String.fromCharCode(h[2]);return m+=String.fromCharCode(h[3])},sl=function(h,m){var r=[],q;if(!m.length)return null;for(q=0;q<h.byteLength;){var v=(h[q]<<24|h[q+1]<<16|h[q+2]<<8|h[q+3])>>>0;var w=nc(h.subarray(q+4,q+8));v=1<v?q+v:h.byteLength; |
|
w===m[0]&&(1===m.length?r.push(h.subarray(q+8,v)):(q=sl(h.subarray(q+8,v),m.slice(1)),q.length&&(r=r.concat(q))));q=v}return r},oa=sl,tl=function(h){var m={version:h[0],flags:new Uint8Array(h.subarray(1,4))};m.baseMediaDecodeTime=1===m.version?e(h.subarray(4)):(h[4]<<24|h[5]<<16|h[6]<<8|h[7])>>>0;return m},ul=function(h){return{isLeading:(h[0]&12)>>>2,dependsOn:h[0]&3,isDependedOn:(h[1]&192)>>>6,hasRedundancy:(h[1]&48)>>>4,paddingValue:(h[1]&14)>>>1,isNonSyncSample:h[1]&1,degradationPriority:h[2]<< |
|
8|h[3]}},vl=function(h){var m={version:h[0],flags:new Uint8Array(h.subarray(1,4)),samples:[]},r=new DataView(h.buffer,h.byteOffset,h.byteLength),q=m.flags[2]&1,v=m.flags[2]&4,w=m.flags[1]&1,B=m.flags[1]&2,C=m.flags[1]&4,F=m.flags[1]&8,J=r.getUint32(4),N=8;q&&(m.dataOffset=r.getInt32(N),N+=4);v&&J&&(q={flags:ul(h.subarray(N,N+4))},N+=4,w&&(q.duration=r.getUint32(N),N+=4),B&&(q.size=r.getUint32(N),N+=4),F&&(q.compositionTimeOffset=1===m.version?r.getInt32(N):r.getUint32(N),N+=4),m.samples.push(q),J--); |
|
for(;J--;)q={},w&&(q.duration=r.getUint32(N),N+=4),B&&(q.size=r.getUint32(N),N+=4),C&&(q.flags=ul(h.subarray(N,N+4)),N+=4),F&&(q.compositionTimeOffset=1===m.version?r.getInt32(N):r.getUint32(N),N+=4),m.samples.push(q);return m},wl=function(h){var m=new DataView(h.buffer,h.byteOffset,h.byteLength);h={version:h[0],flags:new Uint8Array(h.subarray(1,4)),trackId:m.getUint32(4)};var r=h.flags[2]&1,q=h.flags[2]&2,v=h.flags[2]&8,w=h.flags[2]&16,B=h.flags[2]&32,C=h.flags[0]&65536,F=h.flags[0]&131072;var J= |
|
8;r&&(J+=4,h.baseDataOffset=m.getUint32(12),J+=4);q&&(h.sampleDescriptionIndex=m.getUint32(J),J+=4);v&&(h.defaultSampleDuration=m.getUint32(J),J+=4);w&&(h.defaultSampleSize=m.getUint32(J),J+=4);B&&(h.defaultSampleFlags=m.getUint32(J));C&&(h.durationIsEmpty=!0);!r&&F&&(h.baseDataOffsetIsMoof=!0);return h},Bd="undefined"!==typeof window?window:"undefined"!==typeof a?a:"undefined"!==typeof self?self:{},nq=vd.discardEmulationPreventionBytes,oq=function(h,m,r){var q=m,v=r.defaultSampleDuration||0,w=r.defaultSampleSize|| |
|
0,B=r.trackId,C=[];h.forEach(function(F){F=vl(F).samples;F.forEach(function(J){void 0===J.duration&&(J.duration=v);void 0===J.size&&(J.size=w);J.trackId=B;J.dts=q;void 0===J.compositionTimeOffset&&(J.compositionTimeOffset=0);"bigint"===typeof q?(J.pts=q+Bd.BigInt(J.compositionTimeOffset),q+=Bd.BigInt(J.duration)):(J.pts=q+J.compositionTimeOffset,q+=J.duration)});C=C.concat(F)});return C},pq=function(h,m){var r=oa(h,["moof","traf"]),q={},v=[];oa(h,["mdat"]).forEach(function(w,B){v.push({mdat:w,traf:r[B]})}); |
|
v.forEach(function(w){var B=w.mdat,C=w.traf;w=oa(C,["tfhd"]);var F=wl(w[0]);w=F.trackId;var J=oa(C,["tfdt"]);J=0<J.length?tl(J[0]).baseMediaDecodeTime:0;C=oa(C,["trun"]);if(m===w&&0<C.length){C=oq(C,J,F);F=new DataView(B.buffer,B.byteOffset,B.byteLength);J=[];var N=[],L;for(L=0;L+4<B.length;L+=X){var X=F.getUint32(L);L+=4;if(!(0>=X))switch(B[L]&31){case 6:var S=B.subarray(L+1,L+1+X);a:{var ea=L;for(var gb=0;gb<C.length;gb++){var yd=C[gb];if(ea<yd.size){ea=yd;break a}ea-=yd.size}ea=null}S={nalUnitType:"sei_rbsp", |
|
size:X,data:S,escapedRBSP:nq(S),trackId:w};if(ea){S.pts=ea.pts;S.dts=ea.dts;var Ia=ea}else if(Ia)S.pts=Ia.pts,S.dts=Ia.dts;else{J.push({level:"warn",message:"We've encountered a nal unit without data at "+L+" for trackId "+w+". See mux.js#223."});break}N.push(S)}}q[w]||(q[w]={seiNals:[],logs:[]});q[w].seiNals=q[w].seiNals.concat(N);q[w].logs=q[w].logs.concat(J)}});return q},qq=function(){var h=!1,m,r,q,v,w,B;this.isInitialized=function(){return h};this.init=function(C){m=new hl;h=!0;B=C?C.isPartial: |
|
!1;m.on("data",function(F){F.startTime=F.startPts/v;F.endTime=F.endPts/v;w.captions.push(F);w.captionStreams[F.stream]=!0});m.on("log",function(F){w.logs.push(F)})};this.isNewInit=function(C,F){return C&&0===C.length||F&&"object"===typeof F&&0===Object.keys(F).length?!1:q!==C[0]||v!==F[q]};this.parse=function(C,F,J){if(this.isInitialized()){if(!F||!J)return null;if(this.isNewInit(F,J))q=F[0],v=J[q];else if(null===q||!v)return r.push(C),null}else return null;for(;0<r.length;){var N=r.shift();this.parse(N, |
|
F,J)}J=q;F=v;null===J?C=null:(C=pq(C,J)[J]||{},C={seiNals:C.seiNals,logs:C.logs,timescale:F});C&&C.logs&&(w.logs=w.logs.concat(C.logs));if(null===C||!C.seiNals)return w.logs.length?{logs:w.logs,captions:[],captionStreams:[]}:null;this.pushNals(C.seiNals);this.flushStream();return w};this.pushNals=function(C){if(!this.isInitialized()||!C||0===C.length)return null;C.forEach(function(F){m.push(F)})};this.flushStream=function(){if(!this.isInitialized())return null;B?m.partialFlush():m.flush()};this.clearParsedCaptions= |
|
function(){w.captions=[];w.captionStreams={};w.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized())return null;m.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];v=q=null;w?this.clearParsedCaptions():w={captions:[],captionStreams:{},logs:[]};this.resetCaptionStream()};this.reset()},Ne=function(h){for(var m=0,r=String.fromCharCode(h[m]),q="";"\x00"!==r;)q+=r,m++,r=String.fromCharCode(h[m]);return q+r},xl=function(h){return void 0!== |
|
h||null!==h},Cd=function(h){return("00"+h.toString(16)).slice(-2)},ch={parseEmsgBox:function(h){var m=4,r=h[0];if(0===r){var q=Ne(h.subarray(m));m+=q.length;var v=Ne(h.subarray(m));m+=v.length;var w=new DataView(h.buffer);var B=w.getUint32(m);m+=4;var C=w.getUint32(m);m+=4;var F=w.getUint32(m);m+=4;w=w.getUint32(m);m+=4}else if(1===r){w=new DataView(h.buffer);B=w.getUint32(m);m+=4;var J=e(h.subarray(m));m+=8;F=w.getUint32(m);m+=4;w=w.getUint32(m);m+=4;q=Ne(h.subarray(m));m+=q.length;v=Ne(h.subarray(m)); |
|
m+=v.length}h=new Uint8Array(h.subarray(m,h.byteLength));q={scheme_id_uri:q,value:v,timescale:B?B:1,presentation_time:J,presentation_time_delta:C,event_duration:F,id:w,message_data:h};B="\x00"!==q.scheme_id_uri;v=0===r&&xl(q.presentation_time_delta)&&B;B=1===r&&xl(q.presentation_time)&&B;return!(1<r)&&v||B?q:void 0},scaleTime:function(h,m,r,q){return h||0===h?h/m:q+r/m}},rq=Pb.parseId3Frames;var yl=function(h){var m=0===h[0]?12:20;return(h[m]<<24|h[m+1]<<16|h[m+2]<<8|h[m+3])>>>0};var dh={findBox:oa, |
|
parseType:nc,timescale:function(h){return oa(h,["moov","trak"]).reduce(function(m,r){var q=oa(r,["tkhd"])[0];if(!q)return null;var v=q[0];v=0===v?12:20;q=(q[v]<<24|q[v+1]<<16|q[v+2]<<8|q[v+3])>>>0;r=oa(r,["mdia","mdhd"])[0];if(!r)return null;v=r[0];v=0===v?12:20;m[q]=(r[v]<<24|r[v+1]<<16|r[v+2]<<8|r[v+3])>>>0;return m},{})},startTime:function(h,m){m=oa(m,["moof","traf"]).reduce(function(r,q){var v=oa(q,["tfhd"])[0];v=h[(v[4]<<24|v[5]<<16|v[6]<<8|v[7])>>>0]||9E4;q=oa(q,["tfdt"])[0];var w=new DataView(q.buffer, |
|
q.byteOffset,q.byteLength);q=1===q[0]?e(q.subarray(4,12)):w.getUint32(4);let B;"bigint"===typeof q?B=q/Bd.BigInt(v):"number"!==typeof q||isNaN(q)||(B=q/v);B<Number.MAX_SAFE_INTEGER&&(B=Number(B));B<r&&(r=B);return r},Infinity);return"bigint"===typeof m||isFinite(m)?m:0},compositionStartTime:function(h,m){var r=oa(m,["moof","traf"]),q=m=0;if(r&&r.length){var v=oa(r[0],["tfhd"])[0],w=oa(r[0],["trun"])[0];r=oa(r[0],["tfdt"])[0];if(v)var B=wl(v).trackId;r&&(m=tl(r).baseMediaDecodeTime);w&&(v=vl(w),v.samples&& |
|
v.samples.length&&(q=v.samples[0].compositionTimeOffset||0))}h=h[B]||9E4;"bigint"===typeof m&&(q=Bd.BigInt(q),h=Bd.BigInt(h));h=(m+q)/h;"bigint"===typeof h&&h<Number.MAX_SAFE_INTEGER&&(h=Number(h));return h},videoTrackIds:function(h){var m=[];oa(h,["moov","trak"]).forEach(function(r){var q=oa(r,["mdia","hdlr"]),v=oa(r,["tkhd"]);q.forEach(function(w,B){w=nc(w.subarray(8,12));B=v[B];"vide"===w&&(B=new DataView(B.buffer,B.byteOffset,B.byteLength),w=B.getUint8(0),B=0===w?B.getUint32(12):B.getUint32(20), |
|
m.push(B))})});return m},tracks:function(h){var m=[];oa(h,["moov","trak"]).forEach(function(r){var q={},v=oa(r,["tkhd"])[0];if(v){v=new DataView(v.buffer,v.byteOffset,v.byteLength);var w=v.getUint8(0);q.id=0===w?v.getUint32(12):v.getUint32(20)}if(v=oa(r,["mdia","hdlr"])[0])v=nc(v.subarray(8,12)),q.type="vide"===v?"video":"soun"===v?"audio":v;if(v=oa(r,["mdia","minf","stbl","stsd"])[0])if(v=v.subarray(8),q.codec=nc(v.subarray(4,8)),v=oa(v,[q.codec])[0])/^[asm]vc[1-9]$/i.test(q.codec)?(v=v.subarray(78), |
|
w=nc(v.subarray(4,8)),"avcC"===w&&11<v.length?(q.codec+=".",q.codec+=Cd(v[9]),q.codec+=Cd(v[10]),q.codec+=Cd(v[11])):q.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(q.codec)?(v=v.subarray(28),w=nc(v.subarray(4,8)),"esds"===w&&20<v.length&&0!==v[19]?(q.codec+="."+Cd(v[19]),q.codec+="."+Cd(v[20]>>>2&63).replace(/^0/,"")):q.codec="mp4a.40.2"):q.codec=q.codec.toLowerCase();if(r=oa(r,["mdia","mdhd"])[0])q.timescale=yl(r);m.push(q)});return m},getTimescaleFromMediaHeader:yl,getEmsgID3:function(h,m=0){return oa(h, |
|
["emsg"]).map(r=>{r=ch.parseEmsgBox(new Uint8Array(r));var q=rq(r.message_data);return{cueTime:ch.scaleTime(r.presentation_time,r.timescale,r.presentation_time_delta,m),duration:ch.scaleTime(r.event_duration,r.timescale),frames:q}})}},zl=function(h){var m=h[1]&31;return m=m<<8|h[2]},Oe=function(h){return!!(h[1]&64)},Pe=function(h){var m=0;1<(h[3]&48)>>>4&&(m+=h[4]+1);return m},eh=function(h){switch(h){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}};var za={parseType:function(h,m){h=zl(h);return 0===h?"pat":h===m?"pmt":m?"pes":null},parsePat:function(h){var m=Oe(h),r=4+Pe(h);m&&(r+=h[r]+1);return(h[r+10]&31)<<8|h[r+11]},parsePmt:function(h){var m={},r=Oe(h),q=4+Pe(h);r&&(q+=h[q]+1);if(h[q+5]&1){r=3+((h[q+1]&15)<<8|h[q+2])-4;for(var v=12+((h[q+10]&15)<<8|h[q+11]);v<r;){var w=q+v;m[(h[w+1]&31)<<8|h[w+2]]=h[w];v+=((h[w+3]&15)<<8|h[w+4])+5}return m}}, |
|
parsePayloadUnitStartIndicator:Oe,parsePesType:function(h,m){h=zl(h);switch(m[h]){case La.H264_STREAM_TYPE:return"video";case La.ADTS_STREAM_TYPE:return"audio";case La.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(h){if(!Oe(h))return null;var m=4+Pe(h);if(m>=h.byteLength)return null;var r=null;var q=h[m+7];q&192&&(r={},r.pts=(h[m+9]&14)<<27|(h[m+10]&255)<<20|(h[m+11]&254)<<12|(h[m+12]&255)<<5|(h[m+13]&254)>>>3,r.pts*=4,r.pts+=(h[m+13]&6)>>>1,r.dts=r.pts,q& |
|
64&&(r.dts=(h[m+14]&14)<<27|(h[m+15]&255)<<20|(h[m+16]&254)<<12|(h[m+17]&255)<<5|(h[m+18]&254)>>>3,r.dts*=4,r.dts+=(h[m+18]&6)>>>1));return r},videoPacketContainsKeyFrame:function(h){var m=4+Pe(h);h=h.subarray(m);for(var r=m=0,q=!1;r<h.byteLength-3;r++)if(1===h[r+2]){m=r+5;break}for(;m<h.byteLength;)switch(h[m]){case 0:if(0!==h[m-1]){m+=2;break}else if(0!==h[m-2]){m++;break}r+3!==m-2&&(r=eh(h[r+3]&31),"slice_layer_without_partitioning_rbsp_idr"===r&&(q=!0));do m++;while(1!==h[m]&&m<h.length);r=m- |
|
2;m+=3;break;case 1:if(0!==h[m-1]||0!==h[m-2]){m+=3;break}r=eh(h[r+3]&31);"slice_layer_without_partitioning_rbsp_idr"===r&&(q=!0);r=m-2;m+=3;break;default:m+=3}h=h.subarray(r);m-=r;h&&3<h.byteLength&&(r=eh(h[3]&31),"slice_layer_without_partitioning_rbsp_idr"===r&&(q=!0));return q}};var oc=ha.ONE_SECOND_IN_TS,sq=function(h,m){for(var r=0,q=188,v,w;q<h.byteLength;)if(71===h[r]&&71===h[q]){v=h.subarray(r,q);w=za.parseType(v,m.pid);switch(w){case "pat":m.pid=za.parsePat(v);break;case "pmt":var B=za.parsePmt(v); |
|
m.table=m.table||{};Object.keys(B).forEach(function(C){m.table[C]=B[C]})}r+=188;q+=188}else r++,q++},Al=function(h,m,r){for(var q=0,v=188,w,B,C,F=!1;v<=h.byteLength;)if(71!==h[q]||71!==h[v]&&v!==h.byteLength)q++,v++;else{w=h.subarray(q,v);B=za.parseType(w,m.pid);switch(B){case "pes":if(B=za.parsePesType(w,m.table),C=za.parsePayloadUnitStartIndicator(w),"audio"===B&&C&&(w=za.parsePesTime(w)))w.type="audio",r.audio.push(w),F=!0}if(F)break;q+=188;v+=188}v=h.byteLength;q=v-188;for(F=!1;0<=q;)if(71!== |
|
h[q]||71!==h[v]&&v!==h.byteLength)q--,v--;else{w=h.subarray(q,v);B=za.parseType(w,m.pid);switch(B){case "pes":if(B=za.parsePesType(w,m.table),C=za.parsePayloadUnitStartIndicator(w),"audio"===B&&C&&(w=za.parsePesTime(w)))w.type="audio",r.audio.push(w),F=!0}if(F)break;q-=188;v-=188}},tq=function(h,m){if(h.audio&&h.audio.length){var r=m;if("undefined"===typeof r||isNaN(r))r=h.audio[0].dts;h.audio.forEach(function(v){v.dts=bc(v.dts,r);v.pts=bc(v.pts,r);v.dtsTime=v.dts/oc;v.ptsTime=v.pts/oc})}if(h.video&& |
|
h.video.length){var q=m;if("undefined"===typeof q||isNaN(q))q=h.video[0].dts;h.video.forEach(function(v){v.dts=bc(v.dts,q);v.pts=bc(v.pts,q);v.dtsTime=v.dts/oc;v.ptsTime=v.pts/oc});h.firstKeyFrame&&(h=h.firstKeyFrame,h.dts=bc(h.dts,q),h.pts=bc(h.pts,q),h.dtsTime=h.dts/oc,h.ptsTime=h.pts/oc)}},uq={inspect:function(h,m){if(Qb.isLikelyAacData(h))a:{for(var r=!1,q=0,v=null,w=null,B=0,C=0,F;3<=h.length-C;){switch(Qb.parseType(h,C)){case "timed-metadata":if(10>h.length-C){r=!0;break}B=Qb.parseId3TagSize(h, |
|
C);if(B>h.length){r=!0;break}null===w&&(F=h.subarray(C,C+B),w=Qb.parseAacTimestamp(F));C+=B;break;case "audio":if(7>h.length-C){r=!0;break}B=Qb.parseAdtsSize(h,C);if(B>h.length){r=!0;break}null===v&&(F=h.subarray(C,C+B),v=Qb.parseSampleRate(F));q++;C+=B;break;default:C++}if(r){h=null;break a}}null===v||null===w?h=null:(h=oc/v,h={audio:[{type:"audio",dts:w,pts:w},{type:"audio",dts:w+1024*q*h,pts:w+1024*q*h}]})}else{q={pid:null,table:null};w={};sq(h,q);for(r in q.table)if(q.table.hasOwnProperty(r))switch(q.table[r]){case La.H264_STREAM_TYPE:w.video= |
|
[];var J=void 0,N=void 0,L=void 0;v=N=L=N=L=void 0;B=h;C=q;F=w;var X=0,S=188,ea=!1,gb=[];for(J=0;S<B.byteLength;)if(71===B[X]&&71===B[S]){v=B.subarray(X,S);N=za.parseType(v,C.pid);switch(N){case "pes":if(L=za.parsePesType(v,C.table),N=za.parsePayloadUnitStartIndicator(v),"video"===L)if(N&&!ea&&(L=za.parsePesTime(v))&&(L.type="video",F.video.push(L),ea=!0),!F.firstKeyFrame){if(N&&0!==J){L=new Uint8Array(J);for(N=0;gb.length;)J=gb.shift(),L.set(J,N),N+=J.byteLength;za.videoPacketContainsKeyFrame(L)&& |
|
((J=za.parsePesTime(L))?(F.firstKeyFrame=J,F.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself."));J=0}gb.push(v);J+=v.byteLength}}if(ea&&F.firstKeyFrame)break;X+=188;S+=188}else X++,S++;S=B.byteLength;X=S-188;for(ea=!1;0<=X;)if(71=== |
|
B[X]&&71===B[S]){v=B.subarray(X,S);N=za.parseType(v,C.pid);switch(N){case "pes":if(L=za.parsePesType(v,C.table),N=za.parsePayloadUnitStartIndicator(v),"video"===L&&N&&(L=za.parsePesTime(v)))L.type="video",F.video.push(L),ea=!0}if(ea)break;X-=188;S-=188}else X--,S--;0===w.video.length&&delete w.video;break;case La.ADTS_STREAM_TYPE:w.audio=[],Al(h,q,w),0===w.audio.length&&delete w.audio}h=w}if(!h||!h.audio&&!h.video)return null;tq(h,m);return h},parseAudioPes_:Al};const vq=function(h,m){m.on("data", |
|
function(r){var q=r.initSegment;r.initSegment={data:q.buffer,byteOffset:q.byteOffset,byteLength:q.byteLength};q=r.data;r.data=q.buffer;h.postMessage({action:"data",segment:r,byteOffset:q.byteOffset,byteLength:q.byteLength},[r.data])});m.on("done",function(r){h.postMessage({action:"done"})});m.on("gopInfo",function(r){h.postMessage({action:"gopInfo",gopInfo:r})});m.on("videoSegmentTimingInfo",function(r){const q={start:{decode:ha.videoTsToSeconds(r.start.dts),presentation:ha.videoTsToSeconds(r.start.pts)}, |
|
end:{decode:ha.videoTsToSeconds(r.end.dts),presentation:ha.videoTsToSeconds(r.end.pts)},baseMediaDecodeTime:ha.videoTsToSeconds(r.baseMediaDecodeTime)};r.prependedContentDuration&&(q.prependedContentDuration=ha.videoTsToSeconds(r.prependedContentDuration));h.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:q})});m.on("audioSegmentTimingInfo",function(r){const q={start:{decode:ha.videoTsToSeconds(r.start.dts),presentation:ha.videoTsToSeconds(r.start.pts)},end:{decode:ha.videoTsToSeconds(r.end.dts), |
|
presentation:ha.videoTsToSeconds(r.end.pts)},baseMediaDecodeTime:ha.videoTsToSeconds(r.baseMediaDecodeTime)};r.prependedContentDuration&&(q.prependedContentDuration=ha.videoTsToSeconds(r.prependedContentDuration));h.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:q})});m.on("id3Frame",function(r){h.postMessage({action:"id3Frame",id3Frame:r})});m.on("caption",function(r){h.postMessage({action:"caption",caption:r})});m.on("trackinfo",function(r){h.postMessage({action:"trackinfo", |
|
trackInfo:r})});m.on("audioTimingInfo",function(r){h.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:ha.videoTsToSeconds(r.start),end:ha.videoTsToSeconds(r.end)}})});m.on("videoTimingInfo",function(r){h.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:ha.videoTsToSeconds(r.start),end:ha.videoTsToSeconds(r.end)}})});m.on("log",function(r){h.postMessage({action:"log",log:r})})};class Bl{constructor(h,m){this.options=m||{};this.self=h;this.init()}init(){this.transmuxer&&this.transmuxer.dispose(); |
|
this.transmuxer=new bh(this.options);vq(this.self,this.transmuxer)}pushMp4Captions(h){this.captionParser||(this.captionParser=new qq,this.captionParser.init());const m=new Uint8Array(h.data,h.byteOffset,h.byteLength);h=this.captionParser.parse(m,h.trackIds,h.timescales);this.self.postMessage({action:"mp4Captions",captions:h&&h.captions||[],logs:h&&h.logs||[],data:m.buffer},[m.buffer])}probeMp4StartTime({timescales:h,data:m}){h=dh.startTime(h,m);this.self.postMessage({action:"probeMp4StartTime",startTime:h, |
|
data:m},[m.buffer])}probeMp4Tracks({data:h}){const m=dh.tracks(h);this.self.postMessage({action:"probeMp4Tracks",tracks:m,data:h},[h.buffer])}probeEmsgID3({data:h,offset:m}){m=dh.getEmsgID3(h,m);this.self.postMessage({action:"probeEmsgID3",id3Frames:m,emsgData:h},[h.buffer])}probeTs({data:h,baseStartTime:m}){m="number"!==typeof m||isNaN(m)?void 0:m*ha.ONE_SECOND_IN_TS;m=uq.inspect(h,m);let r=null;m&&(r={hasVideo:m.video&&2===m.video.length||!1,hasAudio:m.audio&&2===m.audio.length||!1},r.hasVideo&& |
|
(r.videoStart=m.video[0].ptsTime),r.hasAudio&&(r.audioStart=m.audio[0].ptsTime));this.self.postMessage({action:"probeTs",result:r,data:h},[h.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(h){h=new Uint8Array(h.data,h.byteOffset,h.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(h){this.transmuxer.setBaseMediaDecodeTime(Math.round(ha.secondsToVideoTs(h.timestampOffset|| |
|
0)))}setAudioAppendStart(h){this.transmuxer.setAudioAppendStart(Math.ceil(ha.secondsToVideoTs(h.appendStart)))}setRemux(h){this.transmuxer.setRemux(h.remux)}flush(h){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(h){this.transmuxer.alignGopsWith(h.gopsToAlignWith.slice())}}self.onmessage=function(h){if("init"===h.data.action&&h.data.options)this.messageHandlers= |
|
new Bl(self,h.data.options);else if(this.messageHandlers||(this.messageHandlers=new Bl(self)),h.data&&h.data.action&&"init"!==h.data.action&&this.messageHandlers[h.data.action])this.messageHandlers[h.data.action](h.data)}}));var xq=$k(wq);const yq=({transmuxedData:a,callback:b})=>{a.buffer=[];b(a)},Cl=a=>{const {transmuxer:b,bytes:c,audioAppendStart:e,gopsToAlignWith:g,remux:l,onData:p,onTrackInfo:t,onAudioTimingInfo:x,onVideoTimingInfo:y,onVideoSegmentTimingInfo:A,onAudioSegmentTimingInfo:z,onId3:E, |
|
onCaptions:I,onDone:G,onEndedTimeline:O,onTransmuxerLog:Q,isEndOfTimeline:V}=a,T={buffer:[]};let ca=V;b.onmessage=K=>{if(b.currentTransmux===a){if("data"===K.data.action){const {type:ta,initSegment:Fa,captions:W,captionStreams:Da,metadata:Qg,videoFrameDtsTime:De,videoFramePtsTime:Ce}=K.data.segment;T.buffer.push({captions:W,captionStreams:Da,metadata:Qg});var ba=K.data.segment.boxes||{data:K.data.segment.data};ba={type:ta,data:new Uint8Array(ba.data,ba.data.byteOffset,ba.data.byteLength),initSegment:new Uint8Array(Fa.data, |
|
Fa.byteOffset,Fa.byteLength)};"undefined"!==typeof De&&(ba.videoFrameDtsTime=De);"undefined"!==typeof Ce&&(ba.videoFramePtsTime=Ce);p(ba)}"trackinfo"===K.data.action&&t(K.data.trackInfo);"gopInfo"===K.data.action&&(T.gopInfo=K.data.gopInfo);"audioTimingInfo"===K.data.action&&x(K.data.audioTimingInfo);"videoTimingInfo"===K.data.action&&y(K.data.videoTimingInfo);"videoSegmentTimingInfo"===K.data.action&&A(K.data.videoSegmentTimingInfo);"audioSegmentTimingInfo"===K.data.action&&z(K.data.audioSegmentTimingInfo); |
|
"id3Frame"===K.data.action&&E([K.data.id3Frame],K.data.id3Frame.dispatchType);"caption"===K.data.action&&I(K.data.caption);"endedtimeline"===K.data.action&&(ca=!1,O());"log"===K.data.action&&Q(K.data.log);"transmuxed"!==K.data.type||ca||(b.onmessage=null,yq({transmuxedData:T,callback:G}),fh(b))}};e&&b.postMessage({action:"setAudioAppendStart",appendStart:e});Array.isArray(g)&&b.postMessage({action:"alignGopsWith",gopsToAlignWith:g});"undefined"!==typeof l&&b.postMessage({action:"setRemux",remux:l}); |
|
if(c.byteLength){const K=c instanceof ArrayBuffer?c:c.buffer;b.postMessage({action:"push",data:K,byteOffset:c instanceof ArrayBuffer?0:c.byteOffset,byteLength:c.byteLength},[K])}V&&b.postMessage({action:"endTimeline"});b.postMessage({action:"flush"})},fh=a=>{a.currentTransmux=null;a.transmuxQueue.length&&(a.currentTransmux=a.transmuxQueue.shift(),"function"===typeof a.currentTransmux?a.currentTransmux():Cl(a.currentTransmux))},zq=(a,b)=>{a.postMessage({action:b});fh(a)},Dl=(a,b)=>{b.currentTransmux? |
|
b.transmuxQueue.push(zq.bind(null,b,a)):(b.currentTransmux=a,b.postMessage({action:a}),fh(b))},El=a=>{a.transmuxer.currentTransmux?a.transmuxer.transmuxQueue.push(a):(a.transmuxer.currentTransmux=a,Cl(a))};var gh={reset:a=>{Dl("reset",a)},endTimeline:a=>{Dl("endTimeline",a)},transmux:El,createTransmuxer:a=>{const b=new xq;b.currentTransmux=null;b.transmuxQueue=[];const c=b.terminate;b.terminate=()=>{b.currentTransmux=null;b.transmuxQueue.length=0;return c.call(b)};b.postMessage({action:"init",options:a}); |
|
return b}};const Dd=function(a){const b=a.transmuxer,c=a.endAction||a.action,e=a.callback,g=nb({},a,{endAction:null,transmuxer:null,callback:null}),l=p=>{p.data.action===c&&(b.removeEventListener("message",l),p.data.data&&(p.data.data=new Uint8Array(p.data.data,a.byteOffset||0,a.byteLength||p.data.data.byteLength),a.data&&(a.data=p.data.data)),e(p.data))};b.addEventListener("message",l);if(a.data){const p=a.data instanceof ArrayBuffer;g.byteOffset=p?0:a.data.byteOffset;g.byteLength=a.data.byteLength; |
|
b.postMessage(g,[p?a.data:a.data.buffer])}else b.postMessage(g)},hh=a=>{a.forEach(b=>{b.abort()})},ih=(a,b)=>b.timedout?{status:b.status,message:"HLS request timed-out at URL: "+b.uri,code:-101,xhr:b}:b.aborted?{status:b.status,message:"HLS request aborted at URL: "+b.uri,code:-102,xhr:b}:a?{status:b.status,message:"HLS request errored at URL: "+b.uri,code:2,xhr:b}:"arraybuffer"===b.responseType&&0===b.response.byteLength?{status:b.status,message:"Empty HLS response at URL: "+b.uri,code:2,xhr:b}: |
|
null,Fl=(a,b,c)=>(e,g)=>{var l=g.response;if(e=ih(e,g))return c(e,a);if(16!==l.byteLength)return c({status:g.status,message:"Invalid HLS key at URL: "+g.uri,code:2,xhr:g},a);g=new DataView(l);g=new Uint32Array([g.getUint32(0),g.getUint32(4),g.getUint32(8),g.getUint32(12)]);for(l=0;l<b.length;l++)b[l].bytes=g;return c(null,a)},Gl=(a,b)=>{var c=Vf(a.map.bytes);if("mp4"!==c)return c=c||"unknown",b({internal:!0,message:`Found unsupported ${c} container for initialization segment at URL: ${a.map.resolvedUri|| |
|
a.map.uri}`,code:2,metadata:{errorType:H.Error.UnsupportedMediaInitialization,mediaType:c}});Dd({action:"probeMp4Tracks",data:a.map.bytes,transmuxer:a.transmuxer,callback:({tracks:e,data:g})=>{a.map.bytes=g;e.forEach(function(l){a.map.tracks=a.map.tracks||{};a.map.tracks[l.type]||(a.map.tracks[l.type]=l,"number"===typeof l.id&&l.timescale&&(a.map.timescales=a.map.timescales||{},a.map.timescales[l.id]=l.timescale))});return b(null)}})},Aq=({segment:a,finishProcessingFn:b})=>(c,e)=>{if(c=ih(c,e))return b(c, |
|
a);c=new Uint8Array(e.response);if(a.map.key)return a.map.encryptedBytes=c,b(null,a);a.map.bytes=c;Gl(a,function(g){if(g)return g.xhr=e,g.status=e.status,b(g,a);b(null,a)})},Bq=({segment:a,finishProcessingFn:b,responseType:c})=>(e,g)=>{if(e=ih(e,g))return b(e,a);if("arraybuffer"!==c&&g.responseText){e=g.responseText.substring(a.lastReachedChar||0);const l=new Uint8Array(new ArrayBuffer(e.length));for(let p=0;p<e.length;p++)l[p]=e.charCodeAt(p);e=l.buffer}else e=g.response;a.stats={bandwidth:g.bandwidth, |
|
bytesReceived:g.bytesReceived||0,roundTripTime:g.roundTripTime||0};a.key?a.encryptedBytes=new Uint8Array(e):a.bytes=new Uint8Array(e);return b(null,a)},Cq=({segment:a,bytes:b,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})=>{const I=a.map&&a.map.tracks||{},G=!(!I.audio||!I.video);let O=e.bind(null,a,"audio","start");const Q=e.bind(null,a,"audio","end");let V=e.bind(null, |
|
a,"video","start");const T=e.bind(null,a,"video","end"),ca=()=>El({bytes:b,transmuxer:a.transmuxer,audioAppendStart:a.audioAppendStart,gopsToAlignWith:a.gopsToAlignWith,remux:G,onData:K=>{K.type="combined"===K.type?"video":K.type;A(a,K)},onTrackInfo:K=>{c&&(G&&(K.isMuxed=!0),c(a,K))},onAudioTimingInfo:K=>{O&&"undefined"!==typeof K.start&&(O(K.start),O=null);Q&&"undefined"!==typeof K.end&&Q(K.end)},onVideoTimingInfo:K=>{V&&"undefined"!==typeof K.start&&(V(K.start),V=null);T&&"undefined"!==typeof K.end&& |
|
T(K.end)},onVideoSegmentTimingInfo:K=>{g(K)},onAudioSegmentTimingInfo:K=>{l(K)},onId3:(K,ba)=>{p(a,K,ba)},onCaptions:K=>{t(a,[K])},isEndOfTimeline:x,onEndedTimeline:()=>{y()},onTransmuxerLog:E,onDone:K=>{z&&(K.type="combined"===K.type?"video":K.type,z(null,a,K))}});Dd({action:"probeTs",transmuxer:a.transmuxer,data:b,baseStartTime:a.baseStartTime,callback:K=>{a.bytes=b=K.data;if(K=K.result)c(a,{hasAudio:K.hasAudio,hasVideo:K.hasVideo,isMuxed:G}),c=null;ca()}})},Hl=({segment:a,bytes:b,trackInfoFn:c, |
|
timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})=>{let I=new Uint8Array(b);if(0<no(I,["moof"]).length){a.isFmp4=!0;const {tracks:G}=a.map,O={isFmp4:!0,hasVideo:!!G.video,hasAudio:!!G.audio};G.audio&&G.audio.codec&&"enca"!==G.audio.codec&&(O.audioCodec=G.audio.codec);G.video&&G.video.codec&&"encv"!==G.video.codec&&(O.videoCodec=G.video.codec);G.video&&G.audio&&(O.isMuxed=!0);c(a,O);const Q= |
|
(V,T)=>{A(a,{data:I,type:O.hasAudio&&!O.isMuxed?"audio":"video"});T&&T.length&&p(a,T);V&&V.length&&t(a,V);z(null,a,{})};Dd({action:"probeMp4StartTime",timescales:a.map.timescales,data:I,transmuxer:a.transmuxer,callback:({data:V,startTime:T})=>{b=V.buffer;a.bytes=I=V;O.hasAudio&&!O.isMuxed&&e(a,"audio","start",T);O.hasVideo&&e(a,"video","start",T);Dd({action:"probeEmsgID3",data:I,transmuxer:a.transmuxer,offset:T,callback:({emsgData:ca,id3Frames:K})=>{b=ca.buffer;a.bytes=I=ca;G.video&&ca.byteLength&& |
|
a.transmuxer?Dd({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:a.transmuxer,data:I,timescales:a.map.timescales,trackIds:[G.video.id],callback:ba=>{b=ba.data.buffer;a.bytes=I=ba.data;ba.logs.forEach(function(ta){E(ia(ta,{stream:"mp4CaptionParser"}))});Q(ba.captions,K)}}):Q(void 0,K)}})}})}else a.transmuxer?("undefined"===typeof a.container&&(a.container=Vf(I)),"ts"!==a.container&&"aac"!==a.container?(c(a,{hasAudio:!1,hasVideo:!1}),z(null,a,{})):Cq({segment:a,bytes:b,trackInfoFn:c,timingInfoFn:e, |
|
videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})):z(null,a,{})},Il=function({id:a,key:b,encryptedBytes:c,decryptionWorker:e},g){const l=t=>{t.data.source===a&&(e.removeEventListener("message",l),t=t.data.decrypted,g(new Uint8Array(t.bytes,t.byteOffset,t.byteLength)))};e.addEventListener("message",l);let p;p=b.bytes.slice?b.bytes.slice():new Uint32Array(Array.prototype.slice.call(b.bytes));e.postMessage(Tk({source:a, |
|
encrypted:c,key:p,iv:b.iv}),[c.buffer,p.buffer])},Dq=({decryptionWorker:a,segment:b,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})=>{Il({id:b.requestId,key:b.key,encryptedBytes:b.encryptedBytes,decryptionWorker:a},I=>{b.bytes=I;Hl({segment:b,bytes:b.bytes,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x, |
|
endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})})},Eq=({activeXhrs:a,decryptionWorker:b,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})=>{let I=0,G=!1;return(O,Q)=>{if(!G){if(O)return G=!0,hh(a),z(O,Q);I+=1;if(I===a.length){const V=function(){if(Q.encryptedBytes)return Dq({decryptionWorker:b,segment:Q,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l, |
|
id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E});Hl({segment:Q,bytes:Q.bytes,trackInfoFn:c,timingInfoFn:e,videoSegmentTimingInfoFn:g,audioSegmentTimingInfoFn:l,id3Fn:p,captionsFn:t,isEndOfTimeline:x,endedTimelineFn:y,dataFn:A,doneFn:z,onTransmuxerLog:E})};Q.endOfAllRequests=Date.now();if(Q.map&&Q.map.encryptedBytes&&!Q.map.bytes)return Il({decryptionWorker:b,id:Q.requestId+"-init",encryptedBytes:Q.map.encryptedBytes,key:Q.map.key},T=>{Q.map.bytes=T;Gl(Q, |
|
ca=>{if(ca)return hh(a),z(ca,Q);V()})});V()}}}},Fq=({loadendState:a,abortFn:b})=>c=>{c.target.aborted&&b&&!a.calledAbortFn&&(b(),a.calledAbortFn=!0)},Gq=({segment:a,progressFn:b})=>c=>{if(!c.target.aborted){var e=a.stats,g=c.target;g=Date.now()-g.requestTime;g={bandwidth:Infinity,bytesReceived:0,roundTripTime:g||0};g.bytesReceived=c.loaded;g.bandwidth=Math.floor(g.bytesReceived/g.roundTripTime*8E3);a.stats=ia(e,g);!a.stats.firstBytesReceivedAt&&a.stats.bytesReceived&&(a.stats.firstBytesReceivedAt= |
|
Date.now());return b(c,a)}},Hq=({xhr:a,xhrOptions:b,decryptionWorker:c,segment:e,abortFn:g,progressFn:l,trackInfoFn:p,timingInfoFn:t,videoSegmentTimingInfoFn:x,audioSegmentTimingInfoFn:y,id3Fn:A,captionsFn:z,isEndOfTimeline:E,endedTimelineFn:I,dataFn:G,doneFn:O,onTransmuxerLog:Q})=>{const V=[];c=Eq({activeXhrs:V,decryptionWorker:c,trackInfoFn:p,timingInfoFn:t,videoSegmentTimingInfoFn:x,audioSegmentTimingInfoFn:y,id3Fn:A,captionsFn:z,isEndOfTimeline:E,endedTimelineFn:I,dataFn:G,doneFn:O,onTransmuxerLog:Q}); |
|
e.key&&!e.key.bytes&&(Q=[e.key],e.map&&!e.map.bytes&&e.map.key&&e.map.key.resolvedUri===e.key.resolvedUri&&Q.push(e.map.key),O=ia(b,{uri:e.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Q=Fl(e,Q,c),O=a(O,Q),V.push(O));e.map&&!e.map.bytes&&(!e.map.key||e.key&&e.key.resolvedUri===e.map.key.resolvedUri||(O=ia(b,{uri:e.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),Q=Fl(e,[e.map.key],c),O=a(O,Q),V.push(O)),O=ia(b,{uri:e.map.resolvedUri,responseType:"arraybuffer", |
|
headers:Og(e.map),requestType:"segment-media-initialization"}),Q=Aq({segment:e,finishProcessingFn:c}),O=a(O,Q),V.push(O));b=ia(b,{uri:e.part&&e.part.resolvedUri||e.resolvedUri,responseType:"arraybuffer",headers:Og(e),requestType:"segment"});c=Bq({segment:e,finishProcessingFn:c,responseType:b.responseType});a=a(b,c);a.addEventListener("progress",Gq({segment:e,progressFn:l,trackInfoFn:p,timingInfoFn:t,videoSegmentTimingInfoFn:x,audioSegmentTimingInfoFn:y,id3Fn:A,captionsFn:z,isEndOfTimeline:E,endedTimelineFn:I, |
|
dataFn:G}));V.push(a);const T={};V.forEach(ca=>{ca.addEventListener("loadend",Fq({loadendState:T,abortFn:g}))});return()=>hh(V)},Iq=mb("CodecUtils"),Jl=(a,b)=>{b=b.attributes||{};return a&&a.mediaGroups&&a.mediaGroups.AUDIO&&b.AUDIO&&a.mediaGroups.AUDIO[b.AUDIO]},Qe=function(a){const b={};a.forEach(({mediaType:c,type:e,details:g})=>{b[c]=b[c]||[];b[c].push(Li(`${e}${g}`))});Object.keys(b).forEach(function(c){1<b[c].length?(Iq(`multiple ${c} codecs found as attributes: ${b[c].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`), |
|
b[c]=null):b[c]=b[c][0]});return b},Kl=function(a){let b=0;a.audio&&b++;a.video&&b++;return b},Ed=function(a,b){const c=b.attributes||{};var e=b.attributes||{};e=e.CODECS?zb(e.CODECS):void 0;e=Qe(e||[]);if(Jl(a,b)&&!e.audio){a:if(Jl(a,b)){b=a.mediaGroups.AUDIO[(b.attributes||{}).AUDIO];for(g in b)if(!b[g].uri&&!b[g].playlists){var g=!0;break a}g=!1}else g=!0;g||(a=Qe(ln(a,c.AUDIO)||[]),a.audio&&(e.audio=a.audio))}return e},Re=mb("PlaylistSelector"),Ll=function(a){if(a&&a.playlist){var b=a.playlist; |
|
return JSON.stringify({id:b.id,bandwidth:a.bandwidth,width:a.width,height:a.height,codecs:b.attributes&&b.attributes.CODECS||""})}},Se=function(a,b){return a?(a=D.getComputedStyle(a))?a[b]:"":""},Tc=function(a,b){const c=a.slice();a.sort(function(e,g){const l=b(e,g);return 0===l?c.indexOf(e)-c.indexOf(g):l})},jh=function(a,b){let c,e;a.attributes.BANDWIDTH&&(c=a.attributes.BANDWIDTH);c=c||D.Number.MAX_VALUE;b.attributes.BANDWIDTH&&(e=b.attributes.BANDWIDTH);e=e||D.Number.MAX_VALUE;return c-e};let Ml= |
|
function(a,b,c,e,g,l){if(a){var p={bandwidth:b,width:c,height:e,limitRenditionByPlayerDimensions:g},t=a.playlists;Ya.isAudioOnly(a)&&(t=l.getAudioTrackPlaylists_(),p.audioOnly=!0);var x=t.map(G=>{let O;const Q=G.attributes&&G.attributes.RESOLUTION&&G.attributes.RESOLUTION.width,V=G.attributes&&G.attributes.RESOLUTION&&G.attributes.RESOLUTION.height;O=(O=G.attributes&&G.attributes.BANDWIDTH)||D.Number.MAX_VALUE;return{bandwidth:O,width:Q,height:V,playlist:G}});Tc(x,(G,O)=>G.bandwidth-O.bandwidth); |
|
x=x.filter(G=>!Ya.isIncompatible(G.playlist));a=x.filter(G=>Ya.isEnabled(G.playlist));a.length||(a=x.filter(G=>!Ya.isDisabled(G.playlist)));var y=a.filter(G=>G.bandwidth*Ha.BANDWIDTH_VARIANCE<b),A=y[y.length-1];t=y.filter(G=>G.bandwidth===A.bandwidth)[0];if(!1===g){var z=t||a[0]||x[0];if(z&&z.playlist){var E="sortedPlaylistReps";t&&(E="bandwidthBestRep");a[0]&&(E="enabledPlaylistReps");Re(`choosing ${Ll(z)} using ${E} with options`,p);return z.playlist}Re("could not choose a playlist with options", |
|
p);return null}y=y.filter(G=>G.width&&G.height);Tc(y,(G,O)=>G.width-O.width);g=y.filter(G=>G.width===c&&G.height===e);A=g[g.length-1];g=g.filter(G=>G.bandwidth===A.bandwidth)[0];if(!g){var I=y.filter(G=>G.width>c||G.height>e);z=I.filter(G=>G.width===I[0].width&&G.height===I[0].height);A=z[z.length-1];z=z.filter(G=>G.bandwidth===A.bandwidth)[0]}l.leastPixelDiffSelector&&(E=y.map(G=>{G.pixelDiff=Math.abs(G.width-c)+Math.abs(G.height-e);return G}),Tc(E,(G,O)=>G.pixelDiff===O.pixelDiff?O.bandwidth-G.bandwidth: |
|
G.pixelDiff-O.pixelDiff),E=E[0]);if((l=E||z||g||t||a[0]||x[0])&&l.playlist)return x="sortedPlaylistReps",E?x="leastPixelDiffRep":z?x="resolutionPlusOneRep":g?x="resolutionBestRep":t?x="bandwidthBestRep":a[0]&&(x="enabledPlaylistReps"),Re(`choosing ${Ll(l)} using ${x} with options`,p),l.playlist;Re("could not choose a playlist with options",p);return null}};const Nl=function(){let a=this.useDevicePixelRatio?D.devicePixelRatio||1:1;isNaN(this.customPixelRatio)||(a=this.customPixelRatio);return Ml(this.playlists.main, |
|
this.systemBandwidth,parseInt(Se(this.tech_.el(),"width"),10)*a,parseInt(Se(this.tech_.el(),"height"),10)*a,this.limitRenditionByPlayerDimensions,this.playlistController_)},Jq=function(a){const {main:b,currentTime:c,bandwidth:e,duration:g,segmentDuration:l,timeUntilRebuffer:p,currentTimeline:t,syncController:x}=a;a=b.playlists.filter(A=>!Ya.isIncompatible(A));var y=a.filter(Ya.isEnabled);y.length||(y=a.filter(A=>!Ya.isDisabled(A)));a=y.filter(Ya.hasAttribute.bind(null,"BANDWIDTH")).map(A=>{var z= |
|
x.getSyncPoint(A,g,t,c)?1:2;z=Ya.estimateSegmentRequestTime(l,e,A)*z-p;return{playlist:A,rebufferingImpact:z}});y=a.filter(A=>0>=A.rebufferingImpact);Tc(y,(A,z)=>jh(z.playlist,A.playlist));if(y.length)return y[0];Tc(a,(A,z)=>A.rebufferingImpact-z.rebufferingImpact);return a[0]||null},Kq=a=>{let b=0,c;a.bytes&&(c=new Uint8Array(a.bytes),a.segments.forEach(e=>{c.set(e,b);b+=e.byteLength}));return c},Lq=function({inbandTextTracks:a,captionArray:b,timestampOffset:c}){if(b){var e=D.WebKitDataCue||D.VTTCue; |
|
b.forEach(g=>{const l=g.stream;g.content?g.content.forEach(p=>{const t=new e(g.startTime+c,g.endTime+c,p.text);t.line=p.line;t.align="left";t.position=p.position;t.positionAlign="line-left";a[l].addCue(t)}):a[l].addCue(new e(g.startTime+c,g.endTime+c,g.text))})}},Mq=function(a){Object.defineProperties(a.frame,{id:{get(){H.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return a.value.key}},value:{get(){H.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return a.value.data}}, |
|
privateData:{get(){H.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return a.value.data}}})},Nq=({inbandTextTracks:a,metadataArray:b,timestampOffset:c,videoDuration:e})=>{if(b){var g=D.WebKitDataCue||D.VTTCue,l=a.metadataTrack_;if(l&&(b.forEach(x=>{const y=x.cueTime+c;!("number"!==typeof y||D.isNaN(y)||0>y)&&Infinity>y&&x.frames&&x.frames.length&&x.frames.forEach(A=>{const z=new g(y,y,A.value||A.url||A.data||"");z.frame=A;z.value=A;Mq(z);l.addCue(z)})}),l.cues&&l.cues.length)){a= |
|
l.cues;b=[];for(let x=0;x<a.length;x++)a[x]&&b.push(a[x]);var p=b.reduce((x,y)=>{const A=x[y.startTime]||[];A.push(y);x[y.startTime]=A;return x},{}),t=Object.keys(p).sort((x,y)=>Number(x)-Number(y));t.forEach((x,y)=>{const A=p[x];x=isFinite(e)?e:x;const z=Number(t[y+1])||x;A.forEach(E=>{E.endTime=z})})}}},Oq={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},Pq= |
|
new Set("id class startDate duration endDate endOnNext startTime endTime processDateRange".split(" ")),Qq=({inbandTextTracks:a,dateRanges:b})=>{const c=a.metadataTrack_;if(c){var e=D.WebKitDataCue||D.VTTCue;b.forEach(g=>{for(const l of Object.keys(g)){if(Pq.has(l))continue;const p=new e(g.startTime,g.endTime,"");p.id=g.id;p.type="com.apple.quicktime.HLS";p.value={key:Oq[l],data:g[l]};if("scte35Out"===l||"scte35In"===l)p.value.data=(new Uint8Array(p.value.data.match(/[\da-f]{2}/gi))).buffer;c.addCue(p)}g.processDateRange()})}}, |
|
Ol=(a,b,c)=>{a.metadataTrack_||(a.metadataTrack_=c.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,H.browser.IS_ANY_SAFARI||(a.metadataTrack_.inBandMetadataTrackDispatchType=b))},Fd=function(a,b,c){let e,g;if(c&&c.cues)for(e=c.cues.length;e--;)g=c.cues[e],g.startTime>=a&&g.endTime<=b&&c.removeCue(g)},Rq=function(a){const b=a.cues;if(b){var c={};for(let e=b.length-1;0<=e;e--){const g=b[e],l=`${g.startTime}-${g.endTime}-${g.text}`;c[l]?a.removeCue(g):c[l]=g}}},Sq=(a,b,c,e)=>{b= |
|
Math.ceil(9E4*(b-e));var g=Math.ceil(9E4*(c-e));c=a.slice();for(e=a.length;e--&&!(a[e].pts<=g););if(-1===e)return c;for(g=e+1;g--&&!(a[g].pts<=b););g=Math.max(g,0);c.splice(g,e-g+1);return c},Tq=function(a,b){if(!a&&!b||!a&&b||a&&!b)return!1;if(a===b)return!0;const c=Object.keys(a).sort(),e=Object.keys(b).sort();if(c.length!==e.length)return!1;for(let g=0;g<c.length;g++){const l=c[g];if(l!==e[g]||a[l]!==b[l])return!1}return!0},Te=1/60,Uc=a=>{const {startOfSegment:b,duration:c,segment:e,part:g,playlist:{mediaSequence:l, |
|
id:p,segments:t=[]},mediaIndex:x,partIndex:y,timeline:A}=a,z=t.length-1;let E="mediaIndex/partIndex increment";a.getMediaInfoForTime?E=`getMediaInfoForTime (${a.getMediaInfoForTime})`:a.isSyncRequest&&(E="getSyncSegmentCandidate (isSyncRequest)");a.independent&&(E+=` with independent ${a.independent}`);const I="number"===typeof y;a=a.segment.uri?"segment":"pre-segment";const G=I?Ck({preloadSegment:e})-1:0;return`${a} [${l+x}/${l+z}]`+(I?` part [${y}/${G}]`:"")+` segment start/end [${e.start} => ${e.end}]`+ |
|
(I?` part start/end [${g.start} => ${g.end}]`:"")+` startOfSegment [${b}]`+` duration [${c}]`+` timeline [${A}]`+` selected by [${E}]`+` playlist [${p}]`},Uq=({segmentTimeline:a,currentTimeline:b,startOfSegment:c,buffered:e,overrideCheck:g})=>g||a!==b?a<b?c:e.length?e.end(e.length-1):c:null,Pl=({timelineChangeController:a,currentTimeline:b,segmentTimeline:c,loaderType:e,audioDisabled:g})=>b===c?!1:"audio"===e?(a=a.lastTimelineChange({type:"main"}),!a||a.to!==c):"main"===e&&g?(a=a.pendingTimelineChange({type:"audio"}))&& |
|
a.to===c?!1:!0:!1,Vq=a=>{let b=0;["video","audio"].forEach(function(c){if(c=a[`${c}TimingInfo`]){var {start:e,end:g}=c,l;"bigint"===typeof e||"bigint"===typeof g?l=D.BigInt(g)-D.BigInt(e):"number"===typeof e&&"number"===typeof g&&(l=g-e);"undefined"!==typeof l&&l>b&&(b=l)}});"bigint"===typeof b&&b<Number.MAX_SAFE_INTEGER&&(b=Number(b));return b},Ql=({segmentDuration:a,maxDuration:b})=>a?Math.round(a)>b+Db:!1;class kh extends H.EventTarget{constructor(a,b){super();if(!a)throw new TypeError("Initialization settings are required"); |
|
if("function"!==typeof a.currentTime)throw new TypeError("No currentTime getter specified");if(!a.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=a.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.partIndex=this.mediaIndex=null;this.hasPlayed_=a.hasPlayed;this.currentTime_=a.currentTime;this.seekable_=a.seekable;this.seeking_=a.seeking;this.duration_=a.duration;this.mediaSource_=a.mediaSource;this.vhs_=a.vhs;this.loaderType_=a.loaderType; |
|
this.startingMediaInfo_=this.currentMediaInfo_=void 0;this.segmentMetadataTrack_=a.segmentMetadataTrack;this.goalBufferLength_=a.goalBufferLength;this.sourceType_=a.sourceType;this.sourceUpdater_=a.sourceUpdater;this.inbandTextTracks_=a.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=a.timelineChangeController;this.shouldSaveSegmentTimingInfo_=!0;this.parse708captions_=a.parse708captions;this.useDtsForTimestampOffset_=a.useDtsForTimestampOffset;this.captionServices_=a.captionServices; |
|
this.exactManifestTimings=a.exactManifestTimings;this.addMetadataToTextTrack=a.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.shouldForceTimestampOffsetAfterResync_=!1;this.xhrOptions_=this.pendingSegment_=null;this.pendingSegments_=[];this.isPendingTimestampOffset_=this.audioDisabled_=!1;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=!1;this.appendInitSegment_={audio:!0,video:!0};this.playlistOfLastInitSegment_={audio:null,video:null}; |
|
this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=!1;this.activeInitSegmentId_=this.quotaExceededErrorRetryTimeout_=null;this.initSegments_={};this.cacheEncryptionKeys_=a.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=a.decrypter;this.syncController_=a.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate");this.syncController_.on("syncinfoupdate", |
|
this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)});this.fetchAtBuffer_=!1;this.logger_=mb(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(c){c!==this.state_&&(this.logger_(`${this.state_} -> ${c}`),this.state_=c,this.trigger("statechange"))}});this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()});if("main"===this.loaderType_)this.timelineChangeController_.on("pendingtimelinechange", |
|
()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()});if("audio"===this.loaderType_)this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_();this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return gh.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_, |
|
captionServices:this.captionServices_})}resetStats_(){this.mediaAppends=this.mediaSecondsLoaded=this.mediaTransferDuration=this.mediaRequestsErrored=this.mediaRequestsTimedout=this.mediaRequestsAborted=this.mediaRequests=this.mediaBytesTransferred=0}dispose(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();this.transmuxer_&&this.transmuxer_.terminate();this.resetStats_();this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_);this.syncController_&&this.triggerSyncInfoUpdate_&& |
|
this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_);this.off()}setAudio(a){this.audioDisabled_=!a;a?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){"WAITING"!==this.state?this.pendingSegment_&&(this.pendingSegment_=null):(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_())}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests();this.pendingSegment_=null;this.callQueue_= |
|
[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.waitingOnRemove_=!1;D.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(a){return"APPENDING"!==this.state||this.pendingSegment_?this.pendingSegment_&&this.pendingSegment_.requestId===a?!1:!0:(this.state="READY",!0)}error(a){"undefined"!==typeof a&&(this.logger_("error occurred:",a), |
|
this.error_=a);this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=!0;this.transmuxer_&&gh.reset(this.transmuxer_);this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const a=this.getMediaInfo_();if(!this.sourceUpdater_||!a)return Na();if("main"===this.loaderType_){const {hasAudio:b,hasVideo:c,isMuxed:e}=a;if(c&&b&&!this.audioDisabled_&&!e)return this.sourceUpdater_.buffered();if(c)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(a, |
|
b=!1){if(!a)return null;const c=Be(a);let e=this.initSegments_[c];b&&!e&&a.bytes&&(this.initSegments_[c]=e={resolvedUri:a.resolvedUri,byterange:a.byterange,bytes:a.bytes,tracks:a.tracks,timescales:a.timescales});return e||a}segmentKey(a,b=!1){if(!a)return null;const c=a.resolvedUri;let e=this.keyCache_[c];this.cacheEncryptionKeys_&&b&&!e&&a.bytes&&(this.keyCache_[c]=e={resolvedUri:a.resolvedUri,bytes:a.bytes});a={resolvedUri:(e||a).resolvedUri};e&&(a.bytes=e.bytes);return a}couldBeginLoading_(){return this.playlist_&& |
|
!this.paused()}load(){this.monitorBuffer_();if(this.playlist_){if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY")}}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(a,b={}){if(a){var c=this.playlist_,e=this.pendingSegment_;this.playlist_=a;this.xhrOptions_=b;"INIT"===this.state&&(a.syncInfo={mediaSequence:a.mediaSequence,time:0},"main"===this.loaderType_&& |
|
this.syncController_.setDateTimeMappingForStart(a));b=null;c&&(c.id?b=c.id:c.uri&&(b=c.uri));this.logger_(`playlist update [${b} => ${a.id||a.uri}]`);this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(a,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Eg(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics));this.trigger("syncinfoupdate");if("INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(c&&c.uri===a.uri){b= |
|
a.mediaSequence-c.mediaSequence;this.logger_(`live window shift [${b}]`);if(null!==this.mediaIndex)if(this.mediaIndex-=b,0>this.mediaIndex)this.partIndex=this.mediaIndex=null;else{var g=this.playlist_.segments[this.mediaIndex];!this.partIndex||g.parts&&g.parts.length&&g.parts[this.partIndex]||(g=this.mediaIndex,this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=g)}e&&(e.mediaIndex-=b,0>e.mediaIndex?(e.mediaIndex=null,e.partIndex= |
|
null):(0<=e.mediaIndex&&(e.segment=a.segments[e.mediaIndex]),0<=e.partIndex&&e.segment.parts&&(e.part=e.segment.parts[e.partIndex])));this.syncController_.saveExpiredSegmentInfo(c,a)}else null!==this.mediaIndex&&(a.endList||"number"!==typeof a.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate")}}pause(){this.checkBufferTimeout_&&(D.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(a){this.ended_= |
|
!1;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:!0,video:!0};this.resetLoader();this.remove(0,Infinity,a);this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1;this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus();this.resyncLoader()}resyncLoader(){this.transmuxer_&&gh.reset(this.transmuxer_);this.syncPoint_=this.partIndex=this.mediaIndex=null;this.isPendingTimestampOffset_= |
|
!1;const a=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;"hls"!==this.sourceType_||a||(this.shouldForceTimestampOffsetAfterResync_=!0);this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(a,b,c=()=>{},e=!1){Infinity===b&&(b=this.duration_());if(b<=a)this.logger_("skipping remove because end ${end} is \x3c\x3d start ${start}");else if(this.sourceUpdater_&& |
|
this.getMediaInfo_()){var g=1,l=()=>{g--;0===g&&c()};if(e||!this.audioDisabled_)g++,this.sourceUpdater_.removeAudio(a,b,l);if(e||"main"===this.loaderType_)this.gopBuffer_=Sq(this.gopBuffer_,a,b,this.timeMapping_),g++,this.sourceUpdater_.removeVideo(a,b,l);for(const p in this.inbandTextTracks_)Fd(a,b,this.inbandTextTracks_[p]);Fd(a,b,this.segmentMetadataTrack_);l()}else this.logger_("skipping remove because no source updater or starting media info")}monitorBuffer_(){this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_); |
|
this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_();this.checkBufferTimeout_&&D.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=D.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(!this.sourceUpdater_.updating()){var a=this.chooseNextRequest_();a&&("number"===typeof a.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_, |
|
from:this.currentTimeline_,to:a.timeline})),this.loadSegment_(a))}}isEndOfStream_(a=this.mediaIndex,b=this.playlist_,c=this.partIndex){if(!b||!this.mediaSource_)return!1;const e="number"===typeof a&&b.segments[a];a=a+1===b.segments.length;c=!e||!e.parts||c+1===e.parts.length;return b.endList&&"open"===this.mediaSource_.readyState&&a&&c}chooseNextRequest_(){var a=this.buffered_(),b=Eg(a)||0,c=Fg(a,this.currentTime_()),e=!this.hasPlayed_()&&1<=c,g=c>=this.goalBufferLength_();a=this.playlist_.segments; |
|
if(!a.length||e||g)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);e={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(e.isSyncRequest){a:{g=this.currentTimeline_;var l=a||[];var p=[];let t=0;for(let x=0;x<l.length;x++){const y=l[x];if(g===y.timeline&&(p.push(x),t+=y.duration,t>b)){b=x;break a}}b=0===p.length?0:p[p.length- |
|
1]}e.mediaIndex=b;this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${e.mediaIndex}`)}else if(null!==this.mediaIndex)g=a[this.mediaIndex],l="number"===typeof this.partIndex?this.partIndex:-1,e.startOfSegment=g.end?g.end:b,g.parts&&g.parts[l+1]?(e.mediaIndex=this.mediaIndex,e.partIndex=l+1):e.mediaIndex=this.mediaIndex+1;else{g=this.fetchAtBuffer_?b:this.currentTime_();this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:\nFor TargetTime: ${g}.\nCurrentTime: ${this.currentTime_()}\nBufferedEnd: ${b}\nFetch At Buffer: ${this.fetchAtBuffer_}\n`, |
|
this.mediaSequenceSync_.diagnostics);if(this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){p=this.getSyncInfoFromMediaSequenceSync_(g);if(!p)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${p.start} --\x3e ${p.end})`);b=p.segmentIndex;l=p.partIndex;p=p.start}else this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint."),p=Ya.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings, |
|
playlist:this.playlist_,currentTime:g,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),b=p.segmentIndex,l=p.partIndex,p=p.startTime;e.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${g}`:`currentTime ${g}`;e.mediaIndex=b;e.startOfSegment=p;e.partIndex=l;this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${e.mediaIndex} `)}g=(b=a[e.mediaIndex])&&"number"===typeof e.partIndex&& |
|
b.parts&&b.parts[e.partIndex];if(!b||"number"===typeof e.partIndex&&!g)return null;"number"!==typeof e.partIndex&&b.parts&&(e.partIndex=0,g=b.parts[0]);l=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;c||!g||l||g.independent||(0===e.partIndex?(c=a[e.mediaIndex-1],(b=c.parts&&c.parts.length&&c.parts[c.parts.length-1])&&b.independent&&(--e.mediaIndex,e.partIndex=c.parts.length-1,e.independent="previous segment")):b.parts[e.partIndex- |
|
1].independent&&(--e.partIndex,e.independent="previous part"));c=this.mediaSource_&&"ended"===this.mediaSource_.readyState;if(e.mediaIndex>=a.length-1&&c&&!this.seeking_())return null;this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,e.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync"));return this.generateSegmentInfo_(e)}getSyncInfoFromMediaSequenceSync_(a){if(!this.mediaSequenceSync_)return null;const b= |
|
Math.max(a,this.mediaSequenceSync_.start);a!==b&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${a} to ${b}`);a=this.mediaSequenceSync_.getSyncInfoForTime(b);if(!a)return null;if(!a.isAppended)return a;a=this.mediaSequenceSync_.getSyncInfoForTime(a.end);if(!a)return null;a.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!");return a}generateSegmentInfo_(a){const {independent:b, |
|
playlist:c,mediaIndex:e,startOfSegment:g,isSyncRequest:l,partIndex:p,forceTimestampOffset:t,getMediaInfoForTime:x}=a;var y=c.segments[e];a="number"===typeof p&&y.parts[p];a={requestId:"segment-loader-"+Math.random(),uri:a&&a.resolvedUri||y.resolvedUri,mediaIndex:e,partIndex:a?p:null,isSyncRequest:l,startOfSegment:g,playlist:c,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:y.timeline,duration:a&&a.duration||y.duration,segment:y,part:a,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:x, |
|
independent:b};var A="undefined"!==typeof t?t:this.isPendingTimestampOffset_;a.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:y.timeline,currentTimeline:this.currentTimeline_,startOfSegment:g,buffered:this.buffered_(),overrideCheck:A});y=Eg(this.sourceUpdater_.audioBuffered());"number"===typeof y&&(a.audioAppendStart=y-this.sourceUpdater_.audioTimestampOffset());if(this.sourceUpdater_.videoBuffered().length){y=this.gopBuffer_;A=this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(); |
|
if("undefined"!==typeof A&&null!==A&&y.length){A=Math.ceil(9E4*(A-this.timeMapping_+3));var z;for(z=0;z<y.length&&!(y[z].pts>A);z++);y=y.slice(z)}else y=[];a.gopsToAlignWith=y}return a}timestampOffsetForSegment_(a){return Uq(a)}earlyAbortWhenNeeded_(a){if(!this.vhs_.tech_.paused()&&this.xhrOptions_.timeout&&this.playlist_.attributes.BANDWIDTH&&!(1E3>Date.now()-(a.firstBytesReceivedAt||Date.now()))){var b=this.currentTime_(),c=a.bandwidth,e=this.pendingSegment_.duration,g=Ya.estimateSegmentRequestTime(e, |
|
c,this.playlist_,a.bytesReceived);a=np(this.buffered_(),b,this.vhs_.tech_.playbackRate())-1;g<=a||!(b=Jq({main:this.vhs_.playlists.main,currentTime:b,bandwidth:c,duration:this.duration_(),segmentDuration:e,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_}))||(c=g-a-b.rebufferingImpact,e=.5,a<=Db&&(e=1),!b.playlist||b.playlist.uri===this.playlist_.uri||c<e||(this.bandwidth=b.playlist.attributes.BANDWIDTH*Ha.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort")))}}handleAbort_(a){this.logger_(`Aborting ${Uc(a)}`); |
|
this.mediaRequestsAborted+=1}handleProgress_(a,b){this.earlyAbortWhenNeeded_(b.stats);this.checkForAbort_(b.requestId)||this.trigger("progress")}handleTrackInfo_(a,b){this.earlyAbortWhenNeeded_(a.stats);this.checkForAbort_(a.requestId)||this.checkForIllegalMediaSwitch(b)||(b=b||{},Tq(this.currentMediaInfo_,b)||(this.appendInitSegment_={audio:!0,video:!0},this.currentMediaInfo_=this.startingMediaInfo_=b,this.logger_("trackinfo update",b),this.trigger("trackinfo")),this.checkForAbort_(a.requestId)|| |
|
(this.pendingSegment_.trackInfo=b,this.hasEnoughInfoToAppend_()&&this.processCallQueue_()))}handleTimingInfo_(a,b,c,e){this.earlyAbortWhenNeeded_(a.stats);if(!this.checkForAbort_(a.requestId)){a=this.pendingSegment_;var g=`${b}TimingInfo`;a[g]=a[g]||{};a[g][c]=e;this.logger_(`timinginfo: ${b} - ${c} - ${e}`);this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}}handleCaptions_(a,b){this.earlyAbortWhenNeeded_(a.stats);if(!this.checkForAbort_(a.requestId))if(0===b.length)this.logger_("SegmentLoader received no captions from a caption event"); |
|
else if(this.pendingSegment_.hasAppendedData_){var c=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),e={};b.forEach(g=>{e[g.stream]=e[g.stream]||{startTime:Infinity,captions:[],endTime:0};const l=e[g.stream];l.startTime=Math.min(l.startTime,g.startTime+c);l.endTime=Math.max(l.endTime,g.endTime+c);l.captions.push(g)});Object.keys(e).forEach(g=>{const {startTime:l,endTime:p,captions:t}=e[g],x=this.inbandTextTracks_; |
|
this.logger_(`adding cues from ${l} -> ${p} for ${g}`);var y=this.vhs_.tech_;if(!x[g]){y.trigger({type:"usage",name:"vhs-608"});let z=g;/^cc708_/.test(g)&&(z="SERVICE"+g.split("_")[1]);var A=y.textTracks().getTrackById(z);if(A)x[g]=A;else{let E=A=g,I=!1;const G=(y.options_.vhs&&y.options_.vhs.captionServices||{})[z];G&&(A=G.label,E=G.language,I=G.default);x[g]=y.addRemoteTextTrack({kind:"captions",id:z,default:I,label:A,language:E},!1).track}}Fd(l,p,x[g]);Lq({captionArray:t,inbandTextTracks:x,timestampOffset:c})}); |
|
this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,a,b))}handleId3_(a,b,c){this.earlyAbortWhenNeeded_(a.stats);this.checkForAbort_(a.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(c,b,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,a,b,c)))}processMetadataQueue_(){this.metadataQueue_.id3.forEach(a=>a());this.metadataQueue_.caption.forEach(a=> |
|
a());this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const a=this.callQueue_;this.callQueue_=[];a.forEach(b=>b())}processLoadQueue_(){const a=this.loadQueue_;this.loadQueue_=[];a.forEach(b=>b())}hasEnoughInfoToLoad_(){if("audio"!==this.loaderType_)return!0;const a=this.pendingSegment_;return a?this.getCurrentMediaInfo_()?Pl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:a.timeline,loaderType:this.loaderType_, |
|
audioDisabled:this.audioDisabled_})?!1:!0:!0:!1}getCurrentMediaInfo_(a=this.pendingSegment_){return a&&a.trackInfo||this.currentMediaInfo_}getMediaInfo_(a=this.pendingSegment_){return this.getCurrentMediaInfo_(a)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const a=this.pendingSegment_,b=this.getCurrentMediaInfo_(); |
|
if(!a||!b)return!1;const {hasAudio:c,hasVideo:e,isMuxed:g}=b;return e&&!a.videoTimingInfo||c&&!this.audioDisabled_&&!g&&!a.audioTimingInfo||Pl({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:a.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})?!1:!0}handleData_(a,b){this.earlyAbortWhenNeeded_(a.stats);if(!this.checkForAbort_(a.requestId))if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())this.callQueue_.push(this.handleData_.bind(this, |
|
a,b));else{var c=this.pendingSegment_;this.setTimeMapping_(c.timeline);this.updateMediaSecondsLoaded_(c.part||c.segment);if("closed"!==this.mediaSource_.readyState){a.map&&(a.map=this.initSegmentForMap(a.map,!0),c.segment.map=a.map);a.key&&this.segmentKey(a.key,!0);c.isFmp4=a.isFmp4;c.timingInfo=c.timingInfo||{};if(c.isFmp4)this.trigger("fmp4"),c.timingInfo.start=c[`${b.type}TimingInfo`].start;else{a=this.getCurrentMediaInfo_();a="main"===this.loaderType_&&a&&a.hasVideo;if(a)var e=c.videoTimingInfo.start; |
|
c.timingInfo.start=this.trueSegmentStart_({currentStart:c.timingInfo.start,playlist:c.playlist,mediaIndex:c.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:a,firstVideoFrameTimeForData:e,videoTimingInfo:c.videoTimingInfo,audioTimingInfo:c.audioTimingInfo})}this.updateAppendInitSegmentStatus(c,b.type);this.updateSourceBufferTimestampOffset_(c);if(c.isSyncRequest){this.updateTimingInfoEnd_(c);this.syncController_.saveSegmentTimingInfo({segmentInfo:c, |
|
shouldSaveTimelineMapping:"main"===this.loaderType_});e=this.chooseNextRequest_();if(e.mediaIndex!==c.mediaIndex||e.partIndex!==c.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}c.hasAppendedData_=!0;this.processMetadataQueue_();this.appendData_(c,b)}}}updateAppendInitSegmentStatus(a,b){"main"!==this.loaderType_||"number"!==typeof a.timestampOffset||a.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}); |
|
this.playlistOfLastInitSegment_[b]!==a.playlist&&(this.appendInitSegment_[b]=!0)}getInitSegmentAndUpdateState_({type:a,initSegment:b,map:c,playlist:e}){if(c){const g=Be(c);if(this.activeInitSegmentId_===g)return null;b=this.initSegmentForMap(c,!0).bytes;this.activeInitSegmentId_=g}return b&&this.appendInitSegment_[a]?(this.playlistOfLastInitSegment_[a]=e,this.appendInitSegment_[a]=!1,this.activeInitSegmentId_=null,b):null}handleQuotaExceededError_({segmentInfo:a,type:b,bytes:c},e){e=this.sourceUpdater_.audioBuffered(); |
|
const g=this.sourceUpdater_.videoBuffered();1<e.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+lc(e).join(", "));1<g.length&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+lc(g).join(", "));const l=e.length?e.start(0):0,p=e.length?e.end(e.length-1):0,t=g.length?g.start(0):0,x=g.length?g.end(g.length-1):0;1>=p-l&&1>=x-t?(this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. "+`Appended byte length: ${c.byteLength}, `+ |
|
`audio buffer: ${lc(e).join(", ")}, `+`video buffer: ${lc(g).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity,metadata:{errorType:H.Error.SegmentExceedsSourceBufferQuota}}),this.trigger("error")):(this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:a,type:b,bytes:c})),a=this.currentTime_()-1,this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${a}`),this.remove(0, |
|
a,()=>{this.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s");this.waitingOnRemove_=!1;this.quotaExceededErrorRetryTimeout_=D.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()},1E3)},!0))}handleAppendError_({segmentInfo:a,type:b,bytes:c},e){e&&(22===e.code?this.handleQuotaExceededError_({segmentInfo:a,type:b,bytes:c}):(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",e),this.error({message:`${b} append of ${c.length}b failed for segment `+ |
|
`#${a.mediaIndex} in playlist ${a.playlist.id}`,metadata:{errorType:H.Error.SegmentAppendError}}),this.trigger("appenderror")))}appendToSourceBuffer_({segmentInfo:a,type:b,initSegment:c,data:e,bytes:g}){g||(g=[e],e=e.byteLength,c&&(g.unshift(c),e+=c.byteLength),g=Kq({bytes:e,segments:g}));this.sourceUpdater_.appendBuffer({segmentInfo:a,type:b,bytes:g},this.handleAppendError_.bind(this,{segmentInfo:a,type:b,bytes:g}))}handleSegmentTimingInfo_(a,b,c){this.pendingSegment_&&b===this.pendingSegment_.requestId&& |
|
(b=this.pendingSegment_.segment,a=`${a}TimingInfo`,b[a]||(b[a]={}),b[a].transmuxerPrependedSeconds=c.prependedContentDuration||0,b[a].transmuxedPresentationStart=c.start.presentation,b[a].transmuxedDecodeStart=c.start.decode,b[a].transmuxedPresentationEnd=c.end.presentation,b[a].transmuxedDecodeEnd=c.end.decode,b[a].baseMediaDecodeTime=c.baseMediaDecodeTime)}appendData_(a,b){const {type:c,data:e}=b;!e||!e.byteLength||"audio"===c&&this.audioDisabled_||(b=this.getInitSegmentAndUpdateState_({type:c, |
|
initSegment:b.initSegment,playlist:a.playlist,map:a.isFmp4?a.segment.map:null}),this.appendToSourceBuffer_({segmentInfo:a,type:c,initSegment:b,data:e}))}loadSegment_(a){this.state="WAITING";this.pendingSegment_=a;this.trimBackBuffer_(a);"number"===typeof a.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(a):this.loadQueue_.push(()=>{const b=nb({},a,{forceTimestampOffset:!0});nb(a,this.generateSegmentInfo_(b)); |
|
this.isPendingTimestampOffset_=!1;this.updateTransmuxerAndRequestSegment_(a)})}updateTransmuxerAndRequestSegment_(a){this.shouldUpdateTransmuxerTimestampOffset_(a.timestampOffset)&&(this.gopBuffer_.length=0,a.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:a.timestampOffset}));const b=this.createSimplifiedSegmentObj_(a);var c=this.isEndOfStream_(a.mediaIndex,a.playlist,a.partIndex);const e= |
|
null!==this.mediaIndex,g=a.timeline!==this.currentTimeline_&&0<a.timeline;c=c||e&&g;this.logger_(`Requesting\n${yi(a.uri)}\n${Uc(a)}`);b.map&&!b.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0});a.abortRequests=Hq({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:b,abortFn:this.handleAbort_.bind(this,a),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this), |
|
videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",a.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",a.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:c,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:l,level:p,stream:t})=>{this.logger_(`${Uc(a)} logged from transmuxer stream ${t} as a ${p}: ${l}`)}})}trimBackBuffer_(a){a= |
|
this.seekable_();var b=this.currentTime_(),c=this.playlist_.targetDuration||10;let e=b-Ha.BACK_BUFFER_LENGTH;a.length&&(e=Math.max(e,a.start(0)));a=Math.min(b-c,e);0<a&&this.remove(0,a)}createSimplifiedSegmentObj_(a){const b=a.segment;var c=a.part;c={resolvedUri:c?c.resolvedUri:b.resolvedUri,byterange:c?c.byterange:b.byterange,requestId:a.requestId,transmuxer:a.transmuxer,audioAppendStart:a.audioAppendStart,gopsToAlignWith:a.gopsToAlignWith,part:a.part};const e=a.playlist.segments[a.mediaIndex-1]; |
|
e&&e.timeline===b.timeline&&(e.videoTimingInfo?c.baseStartTime=e.videoTimingInfo.transmuxedDecodeEnd:e.audioTimingInfo&&(c.baseStartTime=e.audioTimingInfo.transmuxedDecodeEnd));b.key&&(a=b.key.iv||new Uint32Array([0,0,0,a.mediaIndex+a.playlist.mediaSequence]),c.key=this.segmentKey(b.key),c.key.iv=a);b.map&&(c.map=this.initSegmentForMap(b.map));return c}saveTransferStats_(a){this.mediaRequests+=1;a&&(this.mediaBytesTransferred+=a.bytesReceived,this.mediaTransferDuration+=a.roundTripTime)}saveBandwidthRelatedStats_(a, |
|
b){this.pendingSegment_.byteLength=b.bytesReceived;a<Te?this.logger_(`Ignoring segment's bandwidth because its duration of ${a}`+` is less than the min to record ${Te}`):(this.bandwidth=b.bandwidth,this.roundTrip=b.roundTripTime)}handleTimeout_(){this.mediaRequestsTimedout+=1;this.bandwidth=1;this.roundTrip=NaN;this.trigger("bandwidthupdate");this.trigger("timeout")}segmentRequestFinished_(a,b,c){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,a,b,c));else if(this.saveTransferStats_(b.stats), |
|
this.pendingSegment_&&b.requestId===this.pendingSegment_.requestId)if(a)this.pendingSegment_=null,this.state="READY",-102!==a.code&&(this.pause(),-101===a.code?this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(a),this.trigger("error")));else{a=this.pendingSegment_;this.saveBandwidthRelatedStats_(a.duration,b.stats);a.endOfAllRequests=b.endOfAllRequests;if(c.gopInfo){b=this.gopBuffer_;c=c.gopInfo;if(c.length)if(this.safeAppend_)b=c.slice();else{var e=c[0].pts,g=0;for(g;g<b.length&&!(b[g].pts>= |
|
e);g++);b=b.slice(0,g).concat(c)}this.gopBuffer_=b}this.state="APPENDING";this.trigger("appending");this.waitForAppendsToComplete_(a)}}setTimeMapping_(a){a=this.syncController_.mappingForTimeline(a);null!==a&&(this.timeMapping_=a)}updateMediaSecondsLoaded_(a){this.mediaSecondsLoaded="number"===typeof a.start&&"number"===typeof a.end?this.mediaSecondsLoaded+(a.end-a.start):this.mediaSecondsLoaded+a.duration}shouldUpdateTransmuxerTimestampOffset_(a){return null===a?!1:"main"===this.loaderType_&&a!== |
|
this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&a!==this.sourceUpdater_.audioTimestampOffset()?!0:!1}trueSegmentStart_({currentStart:a,playlist:b,mediaIndex:c,firstVideoFrameTimeForData:e,currentVideoTimestampOffset:g,useVideoTimingInfo:l,videoTimingInfo:p,audioTimingInfo:t}){if("undefined"!==typeof a)return a;if(!l)return t.start;a=b.segments[c-1];return 0!==c&&a&&"undefined"!==typeof a.start&&a.end===e+g?p.start:e}waitForAppendsToComplete_(a){var b=this.getCurrentMediaInfo_(a); |
|
if(b){var {hasAudio:c,hasVideo:e,isMuxed:g}=b;b="main"===this.loaderType_&&e;var l=!this.audioDisabled_&&c&&!g;a.waitingOnAppends=0;a.hasAppendedData_?(b&&a.waitingOnAppends++,l&&a.waitingOnAppends++,b&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,a)),l&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,a))):(a.timingInfo||"number"!==typeof a.timestampOffset||(this.isPendingTimestampOffset_=!0),a.timingInfo={start:0},a.waitingOnAppends++,this.isPendingTimestampOffset_|| |
|
(this.updateSourceBufferTimestampOffset_(a),this.processMetadataQueue_()),this.checkAppendsDone_(a))}else this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:Infinity,metadata:{errorType:H.Error.SegmentUnsupportedMediaFormat}}),this.trigger("error")}checkAppendsDone_(a){this.checkForAbort_(a.requestId)||(a.waitingOnAppends--,0===a.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(a){var b=this.getCurrentMediaInfo_(); |
|
return(a="main"===this.loaderType_&&b&&a?a.hasAudio||a.hasVideo?b.hasVideo&&!a.hasVideo?"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.hasVideo&&a.hasVideo?"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)?(this.error({message:a,playlistExclusionDuration:Infinity,metadata:{errorType:H.Error.SegmentSwitchError}}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(a){if(null!==a.timestampOffset&&"number"===typeof a.timingInfo.start&&!a.changedTimestampOffset&&"main"===this.loaderType_){var b=!1;a.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:a.segment.videoTimingInfo,audioTimingInfo:a.segment.audioTimingInfo,timingInfo:a.timingInfo});a.changedTimestampOffset= |
|
!0;a.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(a.timestampOffset),b=!0);a.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(a.timestampOffset),b=!0);b&&this.trigger("timestampoffset")}}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:a,audioTimingInfo:b,timingInfo:c}){return this.useDtsForTimestampOffset_?a&&"number"===typeof a.transmuxedDecodeStart?a.transmuxedDecodeStart: |
|
b&&"number"===typeof b.transmuxedDecodeStart?b.transmuxedDecodeStart:c.start:c.start}updateTimingInfoEnd_(a){a.timingInfo=a.timingInfo||{};var b=this.getMediaInfo_();if(b="main"===this.loaderType_&&b&&b.hasVideo&&a.videoTimingInfo?a.videoTimingInfo:a.audioTimingInfo)a.timingInfo.end="number"===typeof b.end?b.end:b.start+a.duration}handleAppendsDone_(){this.pendingSegment_&&this.trigger("appendsdone");if(this.pendingSegment_){var a=this.pendingSegment_;a.part&&a.part.syncInfo?a.part.syncInfo.markAppended(): |
|
a.segment.syncInfo&&a.segment.syncInfo.markAppended();this.updateTimingInfoEnd_(a);this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:"main"===this.loaderType_});if("hls"!==this.sourceType_)var b=null;else{var c=Vq({audioTimingInfo:a.audioTimingInfo,videoTimingInfo:a.videoTimingInfo});if(c){var e=a.playlist.targetDuration;b=Ql({segmentDuration:c,maxDuration:2*e});var g=Ql({segmentDuration:c,maxDuration:e});c=`Segment with index ${a.mediaIndex} `+ |
|
`from playlist ${a.playlist.id} `+`has a duration of ${c} `+`when the reported duration is ${a.duration} `+`and the target duration is ${e}. `+"For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";b=b||g?{severity:b?"warn":"info",message:c}:null}else b=null}b&&("warn"===b.severity?H.log.warn(b.message):this.logger_(b.message)); |
|
this.recordThroughput_(a);this.pendingSegment_=null;this.state="READY";if(a.isSyncRequest&&(this.trigger("syncinfoupdate"),!a.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Uc(a)}`);return}this.logger_(`Appended ${Uc(a)}`);this.addSegmentMetadataCue_(a);this.fetchAtBuffer_=!0;this.currentTimeline_!==a.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:a.timeline}),"main"!==this.loaderType_||this.audioDisabled_|| |
|
this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:a.timeline}));this.currentTimeline_=a.timeline;this.trigger("syncinfoupdate");g=a.segment;b=a.part;g=g.end&&this.currentTime_()-g.end>3*a.playlist.targetDuration;b=b&&b.end&&this.currentTime_()-b.end>3*a.playlist.partTargetDuration;g||b?(this.logger_(`bad ${g?"segment":"part"} ${Uc(a)}`),this.resetEverything()):(null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex= |
|
a.mediaIndex,this.partIndex=a.partIndex,this.isEndOfStream_(a.mediaIndex,a.playlist,a.partIndex)&&this.endOfStream(),this.trigger("appended"),a.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_())}else this.state="READY",this.paused()||this.monitorBuffer_()}recordThroughput_(a){if(a.duration<Te)this.logger_(`Ignoring segment's throughput because its duration of ${a.duration}`+` is less than the min to record ${Te}`);else{var b=this.throughput.rate,c=Date.now()-a.endOfAllRequests+ |
|
1;this.throughput.rate+=(Math.floor(a.byteLength/c*8E3)-b)/++this.throughput.count}}addSegmentMetadataCue_(a){if(this.segmentMetadataTrack_){var b=a.segment,c=b.start,e=b.end;if("number"===typeof c&&isFinite(c)&&"number"===typeof e&&isFinite(e)){Fd(c,e,this.segmentMetadataTrack_);var g=D.WebKitDataCue||D.VTTCue;a={custom:b.custom,dateTimeObject:b.dateTimeObject,dateTimeString:b.dateTimeString,programDateTime:b.programDateTime,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.id,start:c,end:e};b=JSON.stringify(a);c=new g(c,e,b);c.value=a;this.segmentMetadataTrack_.addCue(c)}}}}const Rl=function(a){return"string"!==typeof a?a:a.replace(/./,b=>b.toUpperCase())},Wq=["video","audio"],lh=(a,b)=>{const c=b[`${a}Buffer`];return c&&c.updating||b.queuePending[a]},Vc=(a,b)=>{if(0!==b.queue.length){var c=0,e=b.queue[c];if("mediaSource"===e.type)b.updating()||"closed"===b.mediaSource.readyState|| |
|
(b.queue.shift(),e.action(b),e.doneFn&&e.doneFn(),Vc("audio",b),Vc("video",b));else if("mediaSource"!==a&&b.ready()&&"closed"!==b.mediaSource.readyState&&!lh(a,b)){if(e.type!==a){a:{c=b.queue;for(e=0;e<c.length;e++){const g=c[e];if("mediaSource"===g.type){c=null;break a}if(g.type===a){c=e;break a}}c=null}if(null===c)return;e=b.queue[c]}b.queue.splice(c,1);b.queuePending[a]=e;e.action(a,b);e.doneFn||(b.queuePending[a]=null,Vc(a,b))}}},Sl=(a,b)=>{const c=b[`${a}Buffer`],e=Rl(a);c&&(c.removeEventListener("updateend", |
|
b[`on${e}UpdateEnd_`]),c.removeEventListener("error",b[`on${e}Error_`]),b.codecs[a]=null,b[`${a}Buffer`]=null)},Hb=(a,b)=>a&&b&&-1!==Array.prototype.indexOf.call(a.sourceBuffers,b),hb={appendBuffer:(a,b,c)=>(e,g)=>{const l=g[`${e}Buffer`];if(Hb(g.mediaSource,l)){g.logger_(`Appending segment ${b.mediaIndex}'s ${a.length} bytes to ${e}Buffer`);try{l.appendBuffer(a)}catch(p){g.logger_(`Error with code ${p.code} `+(22===p.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${b.mediaIndex} to ${e}Buffer`), |
|
g.queuePending[e]=null,c(p)}}},remove:(a,b)=>(c,e)=>{const g=e[`${c}Buffer`];if(Hb(e.mediaSource,g)){e.logger_(`Removing ${a} to ${b} from ${c}Buffer`);try{g.remove(a,b)}catch(l){e.logger_(`Remove ${a} to ${b} from ${c}Buffer failed`)}}},timestampOffset:a=>(b,c)=>{const e=c[`${b}Buffer`];Hb(c.mediaSource,e)&&(c.logger_(`Setting ${b}timestampOffset to ${a}`),e.timestampOffset=a)},callback:a=>(b,c)=>{a()},endOfStream:a=>b=>{if("open"===b.mediaSource.readyState){b.logger_(`Calling mediaSource endOfStream(${a|| |
|
""})`);try{b.mediaSource.endOfStream(a)}catch(c){H.log.warn("Failed to call media source endOfStream",c)}}},duration:a=>b=>{b.logger_(`Setting mediaSource duration to ${a}`);try{b.mediaSource.duration=a}catch(c){H.log.warn("Failed to set media source duration",c)}},abort:()=>(a,b)=>{if("open"===b.mediaSource.readyState){var c=b[`${a}Buffer`];if(Hb(b.mediaSource,c)){b.logger_(`calling abort on ${a}Buffer`);try{c.abort()}catch(e){H.log.warn(`Failed to abort on ${a}Buffer`,e)}}}},addSourceBuffer:(a, |
|
b)=>c=>{const e=Rl(a);var g=id(b);c.logger_(`Adding ${a}Buffer with codec ${b} to mediaSource`);g=c.mediaSource.addSourceBuffer(g);g.addEventListener("updateend",c[`on${e}UpdateEnd_`]);g.addEventListener("error",c[`on${e}Error_`]);c.codecs[a]=b;c[`${a}Buffer`]=g},removeSourceBuffer:a=>b=>{const c=b[`${a}Buffer`];Sl(a,b);if(Hb(b.mediaSource,c)){b.logger_(`Removing ${a}Buffer with codec ${b.codecs[a]} from mediaSource`);try{b.mediaSource.removeSourceBuffer(c)}catch(e){H.log.warn(`Failed to removeSourceBuffer ${a}Buffer`, |
|
e)}}},changeType:a=>(b,c)=>{const e=c[`${b}Buffer`],g=id(a);if(Hb(c.mediaSource,e)){var l=a.substring(0,a.indexOf(".")),p=c.codecs[b];if(p.substring(0,p.indexOf("."))!==l){c.logger_(`changing ${b}Buffer codec from ${c.codecs[b]} to ${a}`);try{e.changeType(g),c.codecs[b]=a}catch(t){H.log.warn(`Failed to changeType on ${b}Buffer`,t)}}}}},ib=({type:a,sourceUpdater:b,action:c,doneFn:e,name:g})=>{b.queue.push({type:a,action:c,doneFn:e,name:g});Vc(a,b)},Tl=(a,b)=>c=>{c=b[`${a}Buffered`]();if(0===c.length)c= |
|
"Buffered Ranges are empty";else{var e="Buffered Ranges: \n";for(let g=0;g<c.length;g++){const l=c.start(g),p=c.end(g);e+=`${l} --\x3e ${p}. Duration (${p-l})\n`}c=e}b.logger_(`received "updateend" event for ${a} Source Buffer: `,c);b.queuePending[a]&&(c=b.queuePending[a].doneFn,b.queuePending[a]=null,c&&c(b[`${a}Error_`]));Vc(a,b)};class Ul extends H.EventTarget{constructor(a){super();this.mediaSource=a;this.sourceopenListener_=()=>Vc("mediaSource",this);this.mediaSource.addEventListener("sourceopen", |
|
this.sourceopenListener_);this.logger_=mb("SourceUpdater");this.videoTimestampOffset_=this.audioTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=!1;this.codecs={};this.onVideoUpdateEnd_=Tl("video",this);this.onAudioUpdateEnd_=Tl("audio",this);this.onVideoError_=b=>{this.videoError_=b};this.onAudioError_=b=>{this.audioError_=b};this.triggeredReady_=this.initializedEme_=this.createdSourceBuffers_=!1}initializedEme(){this.initializedEme_= |
|
!0;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(a){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(a),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(a, |
|
b){ib({type:"mediaSource",sourceUpdater:this,action:hb.addSourceBuffer(a,b),name:"addSourceBuffer"})}abort(a){ib({type:a,sourceUpdater:this,action:hb.abort(a),name:"abort"})}removeSourceBuffer(a){this.canRemoveSourceBuffer()?ib({type:"mediaSource",sourceUpdater:this,action:hb.removeSourceBuffer(a),name:"removeSourceBuffer"}):H.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!H.browser.IS_FIREFOX&&D.MediaSource&&D.MediaSource.prototype&&"function"===typeof D.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return D.SourceBuffer&& |
|
D.SourceBuffer.prototype&&"function"===typeof D.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(a,b){this.canChangeType()?ib({type:a,sourceUpdater:this,action:hb.changeType(b),name:"changeType"}):H.log.error("changeType is not supported!")}addOrChangeSourceBuffers(a){if(!a||"object"!==typeof a||0===Object.keys(a).length)throw Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(a).forEach(b=>{const c=a[b];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(b, |
|
c);this.canChangeType()&&this.changeType(b,c)})}appendBuffer(a,b){const {segmentInfo:c,type:e,bytes:g}=a;this.processedAppend_=!0;"audio"===e&&this.videoBuffer&&!this.videoAppendQueued_?(this.delayedAudioAppendQueue_.push([a,b]),this.logger_(`delayed audio append of ${g.length} until video append`)):(ib({type:e,sourceUpdater:this,action:hb.appendBuffer(g,c||{mediaIndex:-1},b),doneFn:b,name:"appendBuffer"}),"video"===e&&(this.videoAppendQueued_=!0,this.delayedAudioAppendQueue_.length&&(a=this.delayedAudioAppendQueue_.slice(), |
|
this.logger_(`queuing delayed audio ${a.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,a.forEach(l=>{this.appendBuffer.apply(this,l)}))))}audioBuffered(){return Hb(this.mediaSource,this.audioBuffer)?this.audioBuffer.buffered?this.audioBuffer.buffered:Na():Na()}videoBuffered(){return Hb(this.mediaSource,this.videoBuffer)?this.videoBuffer.buffered?this.videoBuffer.buffered:Na():Na()}buffered(){const a=Hb(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,b=Hb(this.mediaSource, |
|
this.audioBuffer)?this.audioBuffer:null;return b&&!a?this.audioBuffered():a&&!b?this.videoBuffered():mp(this.audioBuffered(),this.videoBuffered())}setDuration(a,b=Lb){ib({type:"mediaSource",sourceUpdater:this,action:hb.duration(a),name:"duration",doneFn:b})}endOfStream(a=null,b=Lb){"string"!==typeof a&&(a=void 0);ib({type:"mediaSource",sourceUpdater:this,action:hb.endOfStream(a),name:"endOfStream",doneFn:b})}removeAudio(a,b,c=Lb){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?ib({type:"audio", |
|
sourceUpdater:this,action:hb.remove(a,b),doneFn:c,name:"remove"}):c()}removeVideo(a,b,c=Lb){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?ib({type:"video",sourceUpdater:this,action:hb.remove(a,b),doneFn:c,name:"remove"}):c()}updating(){return lh("audio",this)||lh("video",this)?!0:!1}audioTimestampOffset(a){"undefined"!==typeof a&&this.audioBuffer&&this.audioTimestampOffset_!==a&&(ib({type:"audio",sourceUpdater:this,action:hb.timestampOffset(a),name:"timestampOffset"}),this.audioTimestampOffset_= |
|
a);return this.audioTimestampOffset_}videoTimestampOffset(a){"undefined"!==typeof a&&this.videoBuffer&&this.videoTimestampOffset!==a&&(ib({type:"video",sourceUpdater:this,action:hb.timestampOffset(a),name:"timestampOffset"}),this.videoTimestampOffset_=a);return this.videoTimestampOffset_}audioQueueCallback(a){this.audioBuffer&&ib({type:"audio",sourceUpdater:this,action:hb.callback(a),name:"callback"})}videoQueueCallback(a){this.videoBuffer&&ib({type:"video",sourceUpdater:this,action:hb.callback(a), |
|
name:"callback"})}dispose(){this.trigger("dispose");Wq.forEach(a=>{this.abort(a);if(this.canRemoveSourceBuffer())this.removeSourceBuffer(a);else this[`${a}QueueCallback`](()=>Sl(a,this))});this.videoAppendQueued_=!1;this.delayedAudioAppendQueue_.length=0;this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_);this.off()}}const Xq=a=>{a=new Uint8Array(a);return Array.from(a).map(b=>b.toString(16).padStart(2,"0")).join("")},Vl=new Uint8Array(["\n","\n"].map(a=> |
|
a.charCodeAt(0)));class Yq extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Zq extends kh{constructor(a,b={}){super(a,b);this.subtitlesTrack_=this.mediaSource_=null;this.featuresNativeTextTracks_=a.featuresNativeTextTracks;this.loadVttJs=a.loadVttJs;this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Na(); |
|
const a=this.subtitlesTrack_.cues;return Na([[a[0].startTime,a[a.length-1].startTime]])}initSegmentForMap(a,b=!1){if(!a)return null;const c=Be(a);let e=this.initSegments_[c];b&&!e&&a.bytes&&(b=new Uint8Array(Vl.byteLength+a.bytes.byteLength),b.set(a.bytes),b.set(Vl,a.bytes.byteLength),this.initSegments_[c]=e={resolvedUri:a.resolvedUri,byterange:a.byterange,bytes:b});return e||a}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything(); |
|
return this.monitorBuffer_()}track(a){if("undefined"===typeof a)return this.subtitlesTrack_;this.subtitlesTrack_=a;"INIT"===this.state&&this.couldBeginLoading_()&&this.init_();return this.subtitlesTrack_}remove(a,b){Fd(a,b,this.subtitlesTrack_)}fillBuffer_(){const a=this.chooseNextRequest_();a&&(null===this.syncController_.timestampOffsetForTimeline(a.timeline)?(this.syncController_.one("timestampoffset",()=>{this.state="READY";this.paused()||this.monitorBuffer_()}),this.state="WAITING_ON_TIMELINE"): |
|
this.loadSegment_(a))}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(a){for(;a&&a.segment.empty;){if(a.mediaIndex+1>=a.playlist.segments.length){a=null;break}a=this.generateSegmentInfo_({playlist:a.playlist,mediaIndex:a.mediaIndex+1,startOfSegment:a.startOfSegment+a.duration,isSyncRequest:a.isSyncRequest})}return a}stopForError(a){this.error(a);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(a, |
|
b,c){if(this.subtitlesTrack_)if(this.saveTransferStats_(b.stats),this.pendingSegment_)if(a)-101===a.code&&this.handleTimeout_(),-102===a.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(a);else{var e=this.pendingSegment_;this.saveBandwidthRelatedStats_(e.duration,b.stats);b.key&&this.segmentKey(b.key,!0);this.state="APPENDING";this.trigger("appending");var g=e.segment;g.map&&(g.map.bytes=b.map.bytes);e.bytes=b.bytes;if("function"!==typeof D.WebVTT&&"function"===typeof this.loadVttJs)this.state= |
|
"WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(a,b,c),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:H.Error.VttLoadError}}));else{g.requested=!0;try{this.parseVTTCues_(e)}catch(l){this.stopForError({message:l.message,metadata:{errorType:H.Error.VttCueParsingError}});return}this.updateTimeMapping_(e,this.syncController_.timelines[e.timeline],this.playlist_);e.timingInfo=e.cues.length?{start:e.cues[0].startTime,end:e.cues[e.cues.length-1].endTime}: |
|
{start:e.startOfSegment,end:e.startOfSegment+e.duration};e.isSyncRequest?(this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY"):(e.byteLength=e.bytes.byteLength,this.mediaSecondsLoaded+=g.duration,e.cues.forEach(l=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new D.VTTCue(l.startTime,l.endTime,l.text):l)}),Rq(this.subtitlesTrack_),this.handleAppendsDone_())}}else this.state="READY",this.mediaRequestsAborted+=1;else this.state="READY"}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(a){let b= |
|
!1;if("function"!==typeof D.WebVTT)throw new Yq;if("function"===typeof D.TextDecoder)var c=new D.TextDecoder("utf8");else c=D.WebVTT.StringDecoder(),b=!0;c=new D.WebVTT.Parser(D,D.vttjs,c);a.cues=[];a.timestampmap={MPEGTS:0,LOCAL:0};c.oncue=a.cues.push.bind(a.cues);c.ontimestampmap=g=>{a.timestampmap=g};c.onparsingerror=g=>{H.log.warn("Error encountered when parsing cues: "+g.message)};if(a.segment.map){var e=a.segment.map.bytes;b&&(e=decodeURIComponent(escape(String.fromCharCode.apply(null,e)))); |
|
c.parse(e)}e=a.bytes;b&&(e=decodeURIComponent(escape(String.fromCharCode.apply(null,e))));c.parse(e);c.flush()}updateTimeMapping_(a,b,c){const e=a.segment;if(b)if(a.cues.length){var {MPEGTS:g,LOCAL:l}=a.timestampmap,p=g/9E4-l+b.mapping;a.cues.forEach(t=>{const x=t.endTime-t.startTime,y=0===g?t.startTime+p:this.handleRollover_(t.startTime+p,b.time);t.startTime=Math.max(y,0);t.endTime=Math.max(y+x,0)});c.syncInfo||(c.syncInfo={mediaSequence:c.mediaSequence+a.mediaIndex,time:Math.min(a.cues[0].startTime, |
|
a.cues[a.cues.length-1].startTime-e.duration)})}else e.empty=!0}handleRollover_(a,b){if(null===b)return a;a*=9E4;b*=9E4;let c;for(c=b<a?-8589934592:8589934592;4294967296<Math.abs(a-b);)a+=c;return a/9E4}}const $q=function(a,b,c=0){if(a.segments)for(let g=0;g<a.segments.length;g++){const l=a.segments[g];if(!e)a:{var e=c+l.duration/2;const p=b.cues;for(let t=0;t<p.length;t++){const x=p[t];if(e>=x.adStartTime&&e<=x.adEndTime){e=x;break a}}e=null}if(e){if("cueIn"in l){e.endTime=c;e.adEndTime=c;c+=l.duration; |
|
e=null;continue}if(c<e.endTime){c+=l.duration;continue}e.endTime+=l.duration}else if("cueOut"in l&&(e=new D.VTTCue(c,c+l.duration,l.cueOut),e.adStartTime=c,e.adEndTime=c+parseFloat(l.cueOut),b.addCue(e)),"cueOutCont"in l){const [p,t]=l.cueOutCont.split("/").map(parseFloat);e=new D.VTTCue(c,c+l.duration,"");e.adStartTime=c-p;e.adEndTime=e.adStartTime+t;b.addCue(e)}c+=l.duration}};class Wl{constructor({start:a,end:b,segmentIndex:c,partIndex:e=null,appended:g=!1}){this.start_=a;this.end_=b;this.segmentIndex_= |
|
c;this.partIndex_=e;this.appended_=g}isInRange(a){return a>=this.start&&a<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class ar{constructor(a,b=[]){this.segmentSyncInfo_=a;this.partsSyncInfo_=b}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return 0< |
|
this.partsSyncInfo_.length}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus();this.partsSyncInfo_.forEach(a=>a.resetAppendedStatus())}}class mh{constructor(){this.storage_=new Map;this.diagnostics_="";this.isReliable_=!1;this.start_=-Infinity;this.end_=Infinity}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(a=>a.resetAppendStatus())}update(a,b){const {mediaSequence:c, |
|
segments:e}=a;if(this.isReliable_=this.isReliablePlaylist_(c,e))return this.updateStorage_(e,c,this.calculateBaseTime_(c,b))}getSyncInfoForTime(a){for(const {segmentSyncInfo:b,partsSyncInfo:c}of this.storage_.values())if(c.length)for(const e of c){if(e.isInRange(a))return e}else if(b.isInRange(a))return b;return null}updateStorage_(a,b,c){const e=new Map;let g="\n",l=c,p=b;this.start_=l;a.forEach((t,x)=>{const y=this.storage_.get(p),A=l,z=A+t.duration,E=!!(y&&y.segmentSyncInfo&&y.segmentSyncInfo.isAppended), |
|
I=new Wl({start:A,end:z,appended:E,segmentIndex:x});t.syncInfo=I;let G=l;const O=(t.parts||[]).map((Q,V)=>{const T=G,ca=G+Q.duration,K=!!(y&&y.partsSyncInfo&&y.partsSyncInfo[V]&&y.partsSyncInfo[V].isAppended),ba=new Wl({start:T,end:ca,appended:K,segmentIndex:x,partIndex:V});G=ca;g+=`Media Sequence: ${p}.${V} | Range: ${T} --\x3e ${ca} | Appended: ${K}\n`;return Q.syncInfo=ba});e.set(p,new ar(I,O));g+=`${yi(t.resolvedUri)} | Media Sequence: ${p} | Range: ${A} --\x3e ${z} | Appended: ${E}\n`;p++;l= |
|
z});this.end_=l;this.storage_=e;this.diagnostics_=g}calculateBaseTime_(a,b){return this.storage_.size?this.storage_.has(a)?this.storage_.get(a).segmentSyncInfo.start:b:0}isReliablePlaylist_(a,b){return void 0!==a&&null!==a&&Array.isArray(b)&&b.length}}const nh=[{name:"VOD",run:(a,b,c,e,g)=>Infinity!==c?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(a,b,c,e,g,l)=>{a=a.getMediaSequenceSync(l);return a&&a.isReliable?(g=a.getSyncInfoForTime(g))?{time:g.start,partIndex:g.partIndex, |
|
segmentIndex:g.segmentIndex}:null:null}},{name:"ProgramDateTime",run:(a,b,c,e,g)=>{if(!Object.keys(a.timelineToDatetimeMappings).length)return null;e=c=null;const l=Hg(b);g=g||0;for(let x=0;x<l.length;x++){const y=l[b.endList||0===g?x:l.length-(x+1)];var p=y.segment,t=a.timelineToDatetimeMappings[p.timeline];if(t&&p.dateTimeObject){t=p.dateTimeObject.getTime()/1E3+t;if(p.parts&&"number"===typeof y.partIndex)for(let A=0;A<y.partIndex;A++)t+=p.parts[A].duration;p=Math.abs(g-t);if(null!==e&&(0===p|| |
|
e<p))break;e=p;c={time:t,segmentIndex:y.segmentIndex,partIndex:y.partIndex}}}return c}},{name:"Segment",run:(a,b,c,e,g)=>{c=a=null;g=g||0;const l=Hg(b);for(let t=0;t<l.length;t++){const x=l[b.endList||0===g?t:l.length-(t+1)];var p=x.segment;const y=x.part&&x.part.start||p&&p.start;if(p.timeline===e&&"undefined"!==typeof y){p=Math.abs(g-y);if(null!==c&&c<p)break;if(!a||null===c||c>=p)c=p,a={time:y,segmentIndex:x.segmentIndex,partIndex:x.partIndex}}}return a}},{name:"Discontinuity",run:(a,b,c,e,g)=> |
|
{c=null;g=g||0;if(b.discontinuityStarts&&b.discontinuityStarts.length){e=null;for(let l=0;l<b.discontinuityStarts.length;l++){const p=b.discontinuityStarts[l],t=a.discontinuities[b.discontinuitySequence+l+1];if(t){const x=Math.abs(g-t.time);if(null!==e&&e<x)break;if(!c||null===e||e>=x)e=x,c={time:t.time,segmentIndex:p,partIndex:null}}}}return c}},{name:"Playlist",run:(a,b,c,e,g)=>b.syncInfo?{time:b.syncInfo.time,segmentIndex:b.syncInfo.mediaSequence-b.mediaSequence,partIndex:null}:null}];class br extends H.EventTarget{constructor(a){super(); |
|
this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};this.mediaSequenceStorage_={main:new mh,audio:new mh,vtt:new mh};this.logger_=mb("SyncController")}getMediaSequenceSync(a){return this.mediaSequenceStorage_[a]||null}getSyncPoint(a,b,c,e,g){if(Infinity!==b)return nh.find(({name:l})=>"VOD"===l).run(this,a,b);b=this.runStrategies_(a,b,c,e,g);if(!b.length)return null;for(const l of b){const {syncPoint:p,strategy:t}=l,{segmentIndex:x,time:y}=p;if(!(0>x)&&(c=y,g=c+a.segments[x].duration, |
|
this.logger_(`Strategy: ${t}. Current time: ${e}. selected segment: ${x}. Time: [${c} -> ${g}]}`),e>=c&&e<g))return this.logger_("Found sync point with exact match: ",p),p}return this.selectSyncPoint_(b,{key:"time",value:e})}getExpiredTime(a,b){if(!a||!a.segments)return null;b=this.runStrategies_(a,b,a.discontinuitySequence,0);if(!b.length)return null;b=this.selectSyncPoint_(b,{key:"segmentIndex",value:0});0<b.segmentIndex&&(b.time*=-1);return Math.abs(b.time+sd({defaultDuration:a.targetDuration, |
|
durationList:a.segments,startIndex:b.segmentIndex,endIndex:0}))}runStrategies_(a,b,c,e,g){const l=[];for(let p=0;p<nh.length;p++){const t=nh[p],x=t.run(this,a,b,c,e,g);x&&(x.strategy=t.name,l.push({strategy:t.name,syncPoint:x}))}return l}selectSyncPoint_(a,b){let c=a[0].syncPoint,e=Math.abs(a[0].syncPoint[b.key]-b.value),g=a[0].strategy;for(let l=1;l<a.length;l++){const p=Math.abs(a[l].syncPoint[b.key]-b.value);p<e&&(e=p,c=a[l].syncPoint,g=a[l].strategy)}this.logger_(`syncPoint for [${b.key}: ${b.value}] chosen with strategy`+ |
|
` [${g}]: [time:${c.time},`+` segmentIndex:${c.segmentIndex}`+("number"===typeof c.partIndex?`,partIndex:${c.partIndex}`:"")+"]");return c}saveExpiredSegmentInfo(a,b){var c=b.mediaSequence-a.mediaSequence;if(86400<c)H.log.warn(`Not saving expired segment info. Media sequence gap ${c} is too large.`);else for(--c;0<=c;c--){const e=a.segments[c];if(e&&"undefined"!==typeof e.start){b.syncInfo={mediaSequence:a.mediaSequence+c,time:e.start};this.logger_(`playlist refresh sync: [time:${b.syncInfo.time},`+ |
|
` mediaSequence: ${b.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(a){this.timelineToDatetimeMappings={};if(a.segments&&a.segments.length&&a.segments[0].dateTimeObject){a=a.segments[0];const b=a.dateTimeObject.getTime()/1E3;this.timelineToDatetimeMappings[a.timeline]=-b}}saveSegmentTimingInfo({segmentInfo:a,shouldSaveTimelineMapping:b}){const c=this.calculateSegmentTimeMapping_(a,a.timingInfo,b),e=a.segment;c&&(this.saveDiscontinuitySyncInfo_(a),a.playlist.syncInfo|| |
|
(a.playlist.syncInfo={mediaSequence:a.playlist.mediaSequence+a.mediaIndex,time:e.start}));a=e.dateTimeObject;e.discontinuity&&b&&a&&(this.timelineToDatetimeMappings[e.timeline]=-(a.getTime()/1E3))}timestampOffsetForTimeline(a){return"undefined"===typeof this.timelines[a]?null:this.timelines[a].time}mappingForTimeline(a){return"undefined"===typeof this.timelines[a]?null:this.timelines[a].mapping}calculateSegmentTimeMapping_(a,b,c){const e=a.segment,g=a.part;let l=this.timelines[a.timeline];if("number"=== |
|
typeof a.timestampOffset)l={time:a.startOfSegment,mapping:a.startOfSegment-b.start},c&&(this.timelines[a.timeline]=l,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${a.timeline}: `+`[time: ${l.time}] [mapping: ${l.mapping}]`)),a=a.startOfSegment,b=b.end+l.mapping;else if(l)a=b.start+l.mapping,b=b.end+l.mapping;else return!1;g&&(g.start=a,g.end=b);if(!e.start||a<e.start)e.start=a;e.end=b;return!0}saveDiscontinuitySyncInfo_(a){const 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(let g=0;g<b.discontinuityStarts.length;g++){var e=b.discontinuityStarts[g];const l=b.discontinuitySequence+g+1,p=e-a.mediaIndex,t=Math.abs(p);if(!this.discontinuities[l]||this.discontinuities[l].accuracy>t)e=0>p?c.start-sd({defaultDuration:b.targetDuration,durationList:b.segments,startIndex:a.mediaIndex,endIndex:e}):c.end+sd({defaultDuration:b.targetDuration,durationList:b.segments,startIndex:a.mediaIndex+1, |
|
endIndex:e}),this.discontinuities[l]={time:e,accuracy:t}}}dispose(){this.trigger("dispose");this.off()}}class cr extends H.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(a){this.pendingTimelineChanges_[a]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:a,from:b,to:c}){"number"===typeof b&&"number"===typeof c&&(this.pendingTimelineChanges_[a]={type:a,from:b,to:c},this.trigger("pendingtimelinechange")); |
|
return this.pendingTimelineChanges_[a]}lastTimelineChange({type:a,from:b,to:c}){"number"===typeof b&&"number"===typeof c&&(this.lastTimelineChanges_[a]={type:a,from:b,to:c},delete this.pendingTimelineChanges_[a],this.trigger("timelinechange"));return this.lastTimelineChanges_[a]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const dr=al(bl(function(){var a=function(){function x(){this.listeners={}}var y=x.prototype;y.on=function(A,z){this.listeners[A]|| |
|
(this.listeners[A]=[]);this.listeners[A].push(z)};y.off=function(A,z){if(!this.listeners[A])return!1;z=this.listeners[A].indexOf(z);this.listeners[A]=this.listeners[A].slice(0);this.listeners[A].splice(z,1);return-1<z};y.trigger=function(A){var z=this.listeners[A];if(z)if(2===arguments.length)for(var E=z.length,I=0;I<E;++I)z[I].call(this,arguments[1]);else{E=Array.prototype.slice.call(arguments,1);I=z.length;for(var G=0;G<I;++G)z[G].apply(this,E)}};y.dispose=function(){this.listeners={}};y.pipe=function(A){this.on("data", |
|
function(z){A.push(z)})};return x}();let b=null;class c{constructor(x){if(!b){var y=[[[],[],[],[],[]],[[],[],[],[],[]]],A=y[0],z=y[1],E=A[4],I=z[4],G,O,Q;const T=[],ca=[];let K;let ba,ta;for(G=0;256>G;G++)ca[(T[G]=G<<1^283*(G>>7))^G]=G;for(O=Q=0;!E[O];O^=K||1,Q=ca[Q]||1){ba=Q^Q<<1^Q<<2^Q<<3^Q<<4;ba=ba>>8^ba&255^99;E[O]=ba;I[ba]=O;var V=T[G=T[K=T[O]]];ta=16843009*V^65537*G^257*K^16843008*O;V=257*T[ba]^16843008*ba;for(G=0;4>G;G++)A[G][O]=V=V<<24^V>>>8,z[G][ba]=ta=ta<<24^ta>>>8}for(G=0;5>G;G++)A[G]= |
|
A[G].slice(0),z[G]=z[G].slice(0);b=y}this._tables=[[b[0][0].slice(),b[0][1].slice(),b[0][2].slice(),b[0][3].slice(),b[0][4].slice()],[b[1][0].slice(),b[1][1].slice(),b[1][2].slice(),b[1][3].slice(),b[1][4].slice()]];y=this._tables[0][4];A=this._tables[1];E=x.length;I=1;if(4!==E&&6!==E&&8!==E)throw Error("Invalid aes key size");O=x.slice(0);Q=[];this._key=[O,Q];for(x=E;x<4*E+28;x++){z=O[x-1];if(0===x%E||8===E&&4===x%E)z=y[z>>>24]<<24^y[z>>16&255]<<16^y[z>>8&255]<<8^y[z&255],0===x%E&&(z=z<<8^z>>>24^ |
|
I<<24,I=I<<1^283*(I>>7));O[x]=O[x-E]^z}for(E=0;x;E++,x--)z=O[E&3?x:x-4],Q[E]=4>=x||4>E?z:A[0][y[z>>>24]]^A[1][y[z>>16&255]]^A[2][y[z>>8&255]]^A[3][y[z&255]]}decrypt(x,y,A,z,E,I){const G=this._key[1];x^=G[0];z^=G[1];A^=G[2];y^=G[3];let O,Q;const V=G.length/4-2;let T,ca=4;var K=this._tables[1];const ba=K[0],ta=K[1],Fa=K[2],W=K[3],Da=K[4];for(T=0;T<V;T++)K=ba[x>>>24]^ta[z>>16&255]^Fa[A>>8&255]^W[y&255]^G[ca],O=ba[z>>>24]^ta[A>>16&255]^Fa[y>>8&255]^W[x&255]^G[ca+1],Q=ba[A>>>24]^ta[y>>16&255]^Fa[x>>8& |
|
255]^W[z&255]^G[ca+2],y=ba[y>>>24]^ta[x>>16&255]^Fa[z>>8&255]^W[A&255]^G[ca+3],ca+=4,x=K,z=O,A=Q;for(T=0;4>T;T++)E[(3&-T)+I]=Da[x>>>24]<<24^Da[z>>16&255]<<16^Da[A>>8&255]<<8^Da[y&255]^G[ca++],K=x,x=z,z=A,A=y,y=K}}class e extends a{constructor(){super(a);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null}push(x){this.jobs.push(x);this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this), |
|
this.delay))}}const g=function(x){return x<<24|(x&65280)<<8|(x&16711680)>>8|x>>>24};class l{constructor(x,y,A,z){const E=l.STEP,I=new Int32Array(x.buffer),G=new Uint8Array(x.byteLength);x=0;this.asyncStream_=new e;this.asyncStream_.push(this.decryptChunk_(I.subarray(x,x+E),y,A,G));for(x=E;x<I.length;x+=E)A=new Uint32Array([g(I[x-4]),g(I[x-3]),g(I[x-2]),g(I[x-1])]),this.asyncStream_.push(this.decryptChunk_(I.subarray(x,x+E),y,A,G));this.asyncStream_.push(function(){z(null,G.subarray(0,G.byteLength- |
|
G[G.byteLength-1]))})}static get STEP(){return 32E3}decryptChunk_(x,y,A,z){return function(){const E=new Int32Array(x.buffer,x.byteOffset,x.byteLength>>2),I=new c(Array.prototype.slice.call(y)),G=new Uint8Array(x.byteLength),O=new Int32Array(G.buffer);let Q,V,T,ca,K,ba,ta,Fa,W;Q=A[0];V=A[1];T=A[2];ca=A[3];for(W=0;W<E.length;W+=4)K=g(E[W]),ba=g(E[W+1]),ta=g(E[W+2]),Fa=g(E[W+3]),I.decrypt(K,ba,ta,Fa,O,W),O[W]=g(O[W]^Q),O[W+1]=g(O[W+1]^V),O[W+2]=g(O[W+2]^T),O[W+3]=g(O[W+3]^ca),Q=K,V=ba,T=ta,ca=Fa;z.set(G, |
|
x.byteOffset)}}}var p="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{};p=("undefined"!==typeof window?window:"undefined"!==typeof p?p:"undefined"!==typeof self?self:{}).BigInt||Number;[p("0x1"),p("0x100"),p("0x10000"),p("0x1000000"),p("0x100000000"),p("0x10000000000"),p("0x1000000000000"),p("0x100000000000000"),p("0x10000000000000000")];(function(){var x=new Uint16Array([65484]);x=new Uint8Array(x.buffer, |
|
x.byteOffset,x.byteLength);return 255===x[0]?"big":204===x[0]?"little":"unknown"})();const t=function(x){const y={};Object.keys(x).forEach(A=>{const z=x[A];var E="function"===ArrayBuffer.isView?ArrayBuffer.isView(z):z&&z.buffer instanceof ArrayBuffer;y[A]=E?{bytes:z.buffer,byteOffset:z.byteOffset,byteLength:z.byteLength}:z});return y};self.onmessage=function(x){const y=x.data;x=new Uint8Array(y.encrypted.bytes,y.encrypted.byteOffset,y.encrypted.byteLength);const A=new Uint32Array(y.key.bytes,y.key.byteOffset, |
|
y.key.byteLength/4),z=new Uint32Array(y.iv.bytes,y.iv.byteOffset,y.iv.byteLength/4);new l(x,A,z,function(E,I){self.postMessage(t({source:y.source,decrypted:I}),[I.buffer])})}}));var er=$k(dr);const Xl=(a,b)=>{a.abort();a.pause();b&&b.activePlaylistLoader&&(b.activePlaylistLoader.pause(),b.activePlaylistLoader=null)},fr=(a,b)=>()=>{const {segmentLoaders:{[a]:c,main:e},mediaTypes:{[a]:g}}=b;var l=g.activeTrack();const p=g.getActiveGroup(),t=g.activePlaylistLoader,x=g.lastGroup_;p&&x&&p.id===x.id||(g.lastGroup_= |
|
p,g.lastTrack_=l,Xl(c,g),p&&!p.isMainPlaylist&&(p.playlistLoader?(c.resyncLoader(),l=p.playlistLoader,g.activePlaylistLoader=l,l.load()):t&&e.resetEverything()))},gr=(a,b)=>()=>{const {segmentLoaders:{[a]:c},mediaTypes:{[a]:e}}=b;e.lastGroup_=null;c.abort();c.pause()},hr=(a,b)=>()=>{const {mainPlaylistLoader:c,segmentLoaders:{[a]:e,main:g},mediaTypes:{[a]:l}}=b;var p=l.activeTrack(),t=l.getActiveGroup(),x=l.activePlaylistLoader;const y=l.lastTrack_;if(!y||!p||y.id!==p.id)if(l.lastGroup_=t,l.lastTrack_= |
|
p,Xl(e,l),t)if(t.isMainPlaylist)p&&y&&p.id!==y.id&&(t=b.vhs.playlistController_,x=t.selectPlaylist(),t.media()!==x&&(l.logger_(`track change. Switching main audio from ${y.id} to ${p.id}`),c.pause(),g.resetEverything(),t.fastQualityChange_(x)));else{if("AUDIO"===a){if(!t.playlistLoader){g.setAudio(!0);g.resetEverything();return}e.setAudio(!0);g.setAudio(!1)}x===t.playlistLoader?(p=t.playlistLoader,l.activePlaylistLoader=p,p.load()):(e.track&&e.track(p),e.resetEverything(),p=t.playlistLoader,l.activePlaylistLoader= |
|
p,p.load())}},Ue={AUDIO:(a,b)=>()=>{const {mediaTypes:{[a]:c},excludePlaylist:e}=b,g=c.activeTrack();var l=c.activeGroup();l=(l.filter(p=>p.default)[0]||l[0]).id;l=c.tracks[l];if(g===l)e({error:{message:"Problem encountered loading the default audio track."}});else{H.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const p in c.tracks)c.tracks[p].enabled=c.tracks[p]===l;c.onTrackChanged()}},SUBTITLES:(a,b)=>()=>{const {mediaTypes:{[a]:c}}=b;H.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."); |
|
const e=c.activeTrack();e&&(e.mode="disabled");c.onTrackChanged()}},Yl={AUDIO:(a,b,c)=>{if(b){var {tech:e,requestOptions:g,segmentLoaders:{[a]:l}}=c;b.on("loadedmetadata",()=>{const p=b.media();l.playlist(p,g);(!e.paused()||p.endList&&"none"!==e.preload())&&l.load()});b.on("loadedplaylist",()=>{l.playlist(b.media(),g);e.paused()||l.load()});b.on("error",Ue[a](a,c))}},SUBTITLES:(a,b,c)=>{const {tech:e,requestOptions:g,segmentLoaders:{[a]:l},mediaTypes:{[a]:p}}=c;b.on("loadedmetadata",()=>{const t= |
|
b.media();l.playlist(t,g);l.track(p.activeTrack());(!e.paused()||t.endList&&"none"!==e.preload())&&l.load()});b.on("loadedplaylist",()=>{l.playlist(b.media(),g);e.paused()||l.load()});b.on("error",Ue[a](a,c))}},ir={AUDIO:(a,b)=>{const {vhs:c,sourceType:e,segmentLoaders:{[a]:g},requestOptions:l,main:{mediaGroups:p},mediaTypes:{[a]:{groups:t,tracks:x,logger_:y}},mainPlaylistLoader:A}=b,z=td(A.main);p[a]&&0!==Object.keys(p[a]).length||(p[a]={main:{default:{default:!0}}},z&&(p[a].main.default.playlists= |
|
A.main.playlists));for(const G in p[a]){t[G]||(t[G]=[]);for(const O in p[a][G]){var E=p[a][G][O],I=void 0;z?(y(`AUDIO group '${G}' label '${O}' is a main playlist`),E.isMainPlaylist=!0,I=null):I="vhs-json"===e&&E.playlists?new Rc(E.playlists[0],c,l):E.resolvedUri?new Rc(E.resolvedUri,c,l):E.playlists&&"dash"===e?new Pg(E.playlists[0],c,l,A):null;E=ia({id:O,playlistLoader:I},E);Yl[a](a,E.playlistLoader,b);t[G].push(E);if("undefined"===typeof x[O]){I=H.AudioTrack;let Q=E.default?"main":"alternative"; |
|
E.characteristics&&0<=E.characteristics.indexOf("public.accessibility.describes-video")&&(Q="main-desc");E=new I({id:O,kind:Q,enabled:!1,language:E.language,default:E.default,label:O});x[O]=E}}}g.on("error",Ue[a](a,b))},SUBTITLES:(a,b)=>{const {tech:c,vhs:e,sourceType:g,segmentLoaders:{[a]:l},requestOptions:p,main:{mediaGroups:t},mediaTypes:{[a]:{groups:x,tracks:y}},mainPlaylistLoader:A}=b;for(const E in t[a]){x[E]||(x[E]=[]);for(const I in t[a][E]){if(!e.options_.useForcedSubtitles&&t[a][E][I].forced)continue; |
|
var z=t[a][E][I];let G;if("hls"===g)G=new Rc(z.resolvedUri,e,p);else if("dash"===g){if(!z.playlists.filter(O=>Infinity!==O.excludeUntil).length)return;G=new Pg(z.playlists[0],e,p,A)}else"vhs-json"===g&&(G=new Rc(z.playlists?z.playlists[0]:z.resolvedUri,e,p));z=ia({id:I,playlistLoader:G},z);Yl[a](a,z.playlistLoader,b);x[E].push(z);"undefined"===typeof y[I]&&(z=c.addRemoteTextTrack({id:I,kind:"subtitles",default:z.default&&z.autoselect,language:z.language,label:I},!1).track,y[I]=z)}}l.on("error",Ue[a](a, |
|
b))},"CLOSED-CAPTIONS":(a,b)=>{const {tech:c,main:{mediaGroups:e},mediaTypes:{[a]:{groups:g,tracks:l}}}=b;for(const p in e[a]){g[p]||(g[p]=[]);for(const t in e[a][p]){b=e[a][p][t];if(!/^(?:CC|SERVICE)/.test(b.instreamId))continue;const x=c.options_.vhs&&c.options_.vhs.captionServices||{};let y={label:t,language:b.language,instreamId:b.instreamId,default:b.default&&b.autoselect};x[y.instreamId]&&(y=ia(y,x[y.instreamId]));void 0===y.default&&delete y.default;g[p].push(ia({id:t},b));"undefined"===typeof l[t]&& |
|
(b=c.addRemoteTextTrack({id:y.instreamId,kind:"captions",default:y.default,language:y.language,label:y.label},!1).track,l[t]=b)}}}},Zl=(a,b)=>{for(let c=0;c<a.length;c++)if(Kg(b,a[c])||a[c].playlists&&Zl(a[c].playlists,b))return!0;return!1},jr=(a,b)=>c=>{const {mainPlaylistLoader:e,mediaTypes:{[a]:{groups:g}}}=b,l=e.media();if(!l)return null;let p=null;l.attributes[a]&&(p=g[l.attributes[a]]);const t=Object.keys(g);if(!p)if("AUDIO"===a&&1<t.length&&td(b.main))for(let x=0;x<t.length;x++){const y=g[t[x]]; |
|
if(Zl(y,l)){p=y;break}}else g.main?p=g.main:1===t.length&&(p=g[t[0]]);return"undefined"===typeof c?p:null!==c&&p?p.filter(x=>x.id===c.id)[0]||null:null},kr={AUDIO:(a,b)=>()=>{const {mediaTypes:{[a]:{tracks:c}}}=b;for(const e in c)if(c[e].enabled)return c[e];return null},SUBTITLES:(a,b)=>()=>{const {mediaTypes:{[a]:{tracks:c}}}=b;for(const e in c)if("showing"===c[e].mode||"hidden"===c[e].mode)return c[e];return null}},lr=(a,{mediaTypes:b})=>()=>{const c=b[a].activeTrack();return c?b[a].activeGroup(c): |
|
null},mr=a=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(y=>{ir[y](y,a)});const {mediaTypes:b,mainPlaylistLoader:c,tech:e,vhs:g,segmentLoaders:{AUDIO:l,main:p}}=a;["AUDIO","SUBTITLES"].forEach(y=>{b[y].activeGroup=jr(y,a);b[y].activeTrack=kr[y](y,a);b[y].onGroupChanged=fr(y,a);b[y].onGroupChanging=gr(y,a);b[y].onTrackChanged=hr(y,a);b[y].getActiveGroup=lr(y,a)});var t=b.AUDIO.activeGroup();t&&(t=(t.filter(y=>y.default)[0]||t[0]).id,b.AUDIO.tracks[t].enabled=!0,b.AUDIO.onGroupChanged(),b.AUDIO.onTrackChanged(), |
|
b.AUDIO.getActiveGroup().playlistLoader?(p.setAudio(!1),l.setAudio(!0)):p.setAudio(!0));c.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(y=>b[y].onGroupChanged())});c.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(y=>b[y].onGroupChanging())});const x=()=>{b.AUDIO.onTrackChanged();e.trigger({type:"usage",name:"vhs-audio-change"})};e.audioTracks().addEventListener("change",x);e.remoteTextTracks().addEventListener("change",b.SUBTITLES.onTrackChanged);g.on("dispose",()=>{e.audioTracks().removeEventListener("change", |
|
x);e.remoteTextTracks().removeEventListener("change",b.SUBTITLES.onTrackChanged)});e.clearTracks("audio");for(const y in b.AUDIO.tracks)e.audioTracks().addTrack(b.AUDIO.tracks[y])},nr=()=>{const a={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(b=>{a[b]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Lb,activeTrack:Lb,getActiveGroup:Lb,onGroupChanged:Lb,onTrackChanged:Lb,lastTrack_:null,logger_:mb(`MediaGroups[${b}]`)}});return a};class $l{constructor(){this.priority_=[];this.pathwayClones_= |
|
new Map}set version(a){1===a&&(this.version_=a)}set ttl(a){this.ttl_=a||300}set reloadUri(a){a&&(this.reloadUri_=Ja(this.reloadUri_,a))}set priority(a){a&&a.length&&(this.priority_=a)}set pathwayClones(a){a&&a.length&&(this.pathwayClones_=new Map(a.map(b=>[b.ID,b])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class or extends H.EventTarget{constructor(a,b){super(); |
|
this.defaultPathway=this.currentPathway=null;this.queryBeforeStart=!1;this.availablePathways_=new Set;this.steeringManifest=new $l;this.request_=this.ttlTimeout_=this.manifestType_=this.proxyServerUrl_=null;this.currentPathwayClones=new Map;this.nextPathwayClones=new Map;this.excludedSteeringManifestURLs=new Set;this.logger_=mb("Content Steering");this.xhr_=a;this.getBandwidth_=b}assignTagProperties(a,b){this.manifestType_=b.serverUri?"HLS":"DASH";const c=b.serverUri||b.serverURL;c?c.startsWith("data:")? |
|
this.decodeDataUriManifest_(c.substring(c.indexOf(",")+1)):(this.steeringManifest.reloadUri=Ja(a,c),this.defaultPathway=b.pathwayId||b.defaultServiceLocation,this.queryBeforeStart=b.queryBeforeStart,this.proxyServerUrl_=b.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")):(this.logger_(`steering manifest URL is ${c}, cannot request steering manifest.`),this.trigger("error"))}requestSteeringManifest(a){const b=this.steeringManifest.reloadUri;if(b){var c=a? |
|
b:this.getRequestURI(b);c?this.request_=this.xhr_({uri:c,requestType:"content-steering-manifest"},(e,g)=>{e?410===g.status?(this.logger_(`manifest request 410 ${e}.`),this.logger_(`There will be no more content steering requests to ${c} this session.`),this.excludedSteeringManifestURLs.add(c)):429===g.status?(g=g.responseHeaders["retry-after"],this.logger_(`manifest request 429 ${e}.`),this.logger_(`content steering will retry in ${g} seconds.`),this.startTTLTimeout_(parseInt(g,10))):(this.logger_(`manifest failed to load ${e}.`), |
|
this.startTTLTimeout_()):(e=JSON.parse(this.request_.responseText),this.assignSteeringProperties_(e),this.startTTLTimeout_())}):(this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose())}}setProxyServerUrl_(a){a=new D.URL(a);const b=new D.URL(this.proxyServerUrl_);b.searchParams.set("url",encodeURI(a.toString()));return this.setSteeringParams_(b.toString())}decodeDataUriManifest_(a){a=JSON.parse(D.atob(a));this.assignSteeringProperties_(a)}setSteeringParams_(a){a= |
|
new D.URL(a);const b=this.getPathway(),c=this.getBandwidth_();b&&a.searchParams.set(`_${this.manifestType_}_pathway`,b);c&&a.searchParams.set(`_${this.manifestType_}_throughput`,c);return a.toString()}assignSteeringProperties_(a){this.steeringManifest.version=a.VERSION;this.steeringManifest.version?(this.steeringManifest.ttl=a.TTL,this.steeringManifest.reloadUri=a["RELOAD-URI"],this.steeringManifest.priority=a["PATHWAY-PRIORITY"]||a["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones= |
|
a["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose()),a=(b=>{for(const c of b)if(this.availablePathways_.has(c))return c;return[...this.availablePathways_][0]})(this.steeringManifest.priority),this.currentPathway!==a&&(this.currentPathway=a,this.trigger("content-steering"))):(this.logger_(`manifest version is ${a.VERSION}, which is not supported.`), |
|
this.trigger("error"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(a){if(!a)return null;const b=c=>this.excludedSteeringManifestURLs.has(c);if(this.proxyServerUrl_){const c=this.setProxyServerUrl_(a);if(!b(c))return c}a=this.setSteeringParams_(a);return b(a)?null:a}startTTLTimeout_(a=this.steeringManifest.ttl){this.ttlTimeout_=D.setTimeout(()=>{this.requestSteeringManifest()},1E3*a)}clearTTLTimeout_(){D.clearTimeout(this.ttlTimeout_);this.ttlTimeout_=null}abort(){this.request_&& |
|
this.request_.abort();this.request_=null}dispose(){this.off("content-steering");this.off("error");this.abort();this.clearTTLTimeout_();this.request_=this.ttlTimeout_=this.manifestType_=this.proxyServerUrl_=this.queryBeforeStart=this.defaultPathway=this.currentPathway=null;this.excludedSteeringManifestURLs=new Set;this.availablePathways_=new Set;this.steeringManifest=new $l}addAvailablePathway(a){a&&this.availablePathways_.add(a)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(a){return this.availablePathways_.delete(a)}didDASHTagChange(a, |
|
b){return!b&&this.steeringManifest.reloadUri||b&&(Ja(a,b.serverURL)!==this.steeringManifest.reloadUri||b.defaultServiceLocation!==this.defaultPathway||b.queryBeforeStart!==this.queryBeforeStart||b.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let Rb;const pr="mediaRequests mediaRequestsAborted mediaRequestsTimedout mediaRequestsErrored mediaTransferDuration mediaBytesTransferred mediaAppends".split(" "),qr=function(a){return this.audioSegmentLoader_[a]+ |
|
this.mainSegmentLoader_[a]},rr=function({currentPlaylist:a,buffered:b,currentTime:c,nextPlaylist:e,bufferLowWaterLine:g,bufferHighWaterLine:l,duration:p,bufferBasedABR:t,log:x}){if(!e)return H.log.warn("We received no playlist to switch to. Please check your stream."),!1;const y=`allowing switch ${a&&a.id||"null"} -> ${e.id}`;if(!a)return x(`${y} as current playlist is not set`),!0;if(e.id===a.id)return!1;const A=!!Pc(b,c).length;if(!a.endList){if(!A&&"number"===typeof a.partTargetDuration)return x(`not ${y} as current playlist is live llhls, but currentTime isn't in buffered.`), |
|
!1;x(`${y} as current playlist is live`);return!0}b=Fg(b,c);c=t?Ha.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Ha.MAX_BUFFER_LOW_WATER_LINE;if(p<c)return x(`${y} as duration < max low water line (${p} < ${c})`),!0;e=e.attributes.BANDWIDTH;a=a.attributes.BANDWIDTH;if(e<a&&(!t||b<l))return g=`${y} as next bandwidth < current bandwidth (${e} < ${a})`,t&&(g+=` and forwardBuffer < bufferHighWaterLine (${b} < ${l})`),x(g),!0;if((!t||e>a)&&b>=g)return l=`${y} as forwardBuffer >= bufferLowWaterLine (${b} >= ${g})`, |
|
t&&(l+=` and next bandwidth > current bandwidth (${e} > ${a})`),x(l),!0;x(`not ${y} as no switching criteria met`);return!1};class sr extends H.EventTarget{constructor(a){super();const {src:b,withCredentials:c,tech:e,bandwidth:g,externVhs:l,useCueTags:p,playlistExclusionDuration:t,enableLowInitialPlaylist:x,sourceType:y,cacheEncryptionKeys:A,bufferBasedABR:z,leastPixelDiffSelector:E,captionServices:I}=a;if(!b)throw Error("A non-empty playlist URL or JSON manifest string is required");var {maxPlaylistRetries:G}= |
|
a;if(null===G||"undefined"===typeof G)G=Infinity;Rb=l;this.bufferBasedABR=!!z;this.leastPixelDiffSelector=!!E;this.withCredentials=c;this.tech_=e;this.vhs_=e.vhs;this.sourceType_=y;this.useCueTags_=p;this.playlistExclusionDuration=t;this.maxPlaylistRetries=G;this.enableLowInitialPlaylist=x;this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType="");this.requestOptions_={withCredentials:c,maxPlaylistRetries:G,timeout:null}; |
|
this.on("error",this.pauseLoading);this.mediaTypes_=nr();this.mediaSource=new D.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_= |
|
Na();this.hasPlayed_=!1;this.syncController_=new br(a);this.segmentMetadataTrack_=e.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track;this.decrypter_=new er;this.sourceUpdater_=new Ul(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new cr;this.keyStatusMap_=new Map;G={vhs:this.vhs_,parse708captions:a.parse708captions,useDtsForTimestampOffset:a.useDtsForTimestampOffset,captionServices:I,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_), |
|
seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:g,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:A,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:a.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)}; |
|
this.mainPlaylistLoader_="dash"===this.sourceType_?new Pg(b,this.vhs_,ia(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Rc(b,this.vhs_,ia(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new kh(ia(G,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),a);this.audioSegmentLoader_=new kh(ia(G,{loaderType:"audio"}),a);this.subtitleSegmentLoader_= |
|
new Zq(ia(G,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((O,Q)=>{function V(){e.off("vttjserror",T);O()}function T(){e.off("vttjsloaded",V);Q()}e.one("vttjsloaded",V);e.one("vttjserror",T);e.addWebVttScript_()})}),a);this.contentSteeringController_=new or(this.vhs_.xhr,()=>this.mainSegmentLoader_.bandwidth);this.setupSegmentLoaderListeners_();this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause", |
|
()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_()));pr.forEach(O=>{this[O+"_"]=qr.bind(this,O)});this.logger_=mb("pc");this.triggeredFmp4Usage=!1;"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load();this.audioAppendsToLoadedData__=this.mainAppendsToLoadedData__=this.timeToLoadedData__=-1;a="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(a, |
|
()=>{const O=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-O;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const a=this.mainAppendsToLoadedData_(),b=this.audioAppendsToLoadedData_();return-1===a||-1===b?-1:a+b}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(a= |
|
"abr"){const b=this.selectPlaylist();b&&this.shouldSwitchToMedia_(b)&&this.switchMedia_(b,a)}switchMedia_(a,b,c){var e=this.media();e=e&&(e.id||e.uri);const g=a&&(a.id||a.uri);e&&e!==g&&(this.logger_(`switch media ${e} -> ${g} from ${b}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${b}`}));this.mainPlaylistLoader_.media(a,c)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(a=>{var b=this.mediaTypes_[a];b=b?b.activeGroup():null;const c=this.contentSteeringController_.getPathway(); |
|
b&&c&&(b=(b.length?b[0].playlists:b.playlists).filter(e=>e.attributes.serviceLocation===c),b.length&&this.mediaTypes_[a].activePlaylistLoader.media(b[0]))})}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=D.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(D.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const a=this.main(),b=a&&a.playlists||[];if(!a||!a.mediaGroups||!a.mediaGroups.AUDIO)return b;const c=a.mediaGroups.AUDIO; |
|
var e=Object.keys(c);let g;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)g=this.mediaTypes_.AUDIO.activeTrack();else{e=c.main||e.length&&c[e[0]];for(var l in e)if(e[l].default){g={label:l};break}}if(!g)return b;l=[];for(const p in c)if(c[p][g.label])if(e=c[p][g.label],e.playlists&&e.playlists.length)l.push.apply(l,e.playlists);else if(e.uri)l.push(e);else if(a.playlists.length)for(e=0;e<a.playlists.length;e++){const t=a.playlists[e];t.attributes&&t.attributes.AUDIO&&t.attributes.AUDIO===p&& |
|
l.push(t)}return l.length?l:b}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const a=this.mainPlaylistLoader_.media(),b=1500*a.targetDuration;Jg(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=b;a.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(a,this.requestOptions_),this.mainSegmentLoader_.load());mr({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_, |
|
SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),a);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media())this.trigger("selectedinitialmedia");else this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata", |
|
()=>{this.trigger("selectedinitialmedia")})});this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let a=this.mainPlaylistLoader_.media();if(!a){this.attachContentSteeringListeners_();this.initContentSteeringController_();this.excludeUnsupportedVariants_();let b;this.enableLowInitialPlaylist&&(b=this.selectInitialPlaylist());b||=this.selectPlaylist();if(!b||!this.shouldSwitchToMedia_(b))return;this.initialMedia_=b;this.switchMedia_(this.initialMedia_, |
|
"initial");if("vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;a=this.initialMedia_}this.handleUpdatedMediaPlaylist(a)});this.mainPlaylistLoader_.on("error",()=>{const a=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:a.playlist,error:a})});this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()});this.mainPlaylistLoader_.on("mediachange",()=>{const a=this.mainPlaylistLoader_.media(),b=1500*a.targetDuration; |
|
Jg(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=b;"dash"===this.sourceType_&&this.mainPlaylistLoader_.load();this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(a,this.requestOptions_);this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load();this.tech_.trigger({type:"mediachange",bubbles:!0})});this.mainPlaylistLoader_.on("playlistunchanged",()=>{const a=this.mainPlaylistLoader_.media(); |
|
"playlist-unchanged"!==a.lastExcludeReason_&&this.stuckAtPlaylistEnd_(a)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))});this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})});this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(a){this.useCueTags_&&this.updateAdCues_(a); |
|
this.mainSegmentLoader_.pause();this.mainSegmentLoader_.playlist(a,this.requestOptions_);this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_();this.updateDuration(!a.endList);this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(a,b){a=a.mediaGroups||{};let c=!0;const e=Object.keys(a.AUDIO);for(const g in a.AUDIO)for(const l in a.AUDIO[g])a.AUDIO[g][l].uri||(c=!1);c&&this.tech_.trigger({type:"usage", |
|
name:"vhs-demuxed"});Object.keys(a.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"});Rb.Playlist.isAes(b)&&this.tech_.trigger({type:"usage",name:"vhs-aes"});e.length&&1<Object.keys(a.AUDIO[e[0]]).length&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"});this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(a){const b=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,c=this.tech_.currentTime(), |
|
e=this.bufferLowWaterLine(),g=this.bufferHighWaterLine(),l=this.tech_.buffered();return rr({buffered:l,currentTime:c,currentPlaylist:b,nextPlaylist:a,bufferLowWaterLine:e,bufferHighWaterLine:g,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}); |
|
if(!this.bufferBasedABR)this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")});this.mainSegmentLoader_.on("error",()=>{const b=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:b.playlist,error:b})});this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage", |
|
name:"vhs-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended");this.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",b=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."}, |
|
playlistExclusionDuration:10}))});const a=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const b=this.getCodecsOrExclude_();b&&this.sourceUpdater_.addOrChangeSourceBuffers(b)};this.mainSegmentLoader_.on("trackinfo",a);this.audioSegmentLoader_.on("trackinfo",a);this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)});this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage|| |
|
(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)});this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load();this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(a= |
|
this.selectPlaylist()){a&&a===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(a,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0); |
|
this.hasPlayed_&&this.load();var a=this.tech_.seekable();if(Infinity===this.tech_.duration()&&this.tech_.currentTime()<a.start(0))return this.tech_.setCurrentTime(a.end(a.length-1))}}setupFirstPlay(){var a=this.mainPlaylistLoader_.media();if(!a||this.tech_.paused()||this.hasPlayed_)return!1;if(!a.endList||a.start){const b=this.seekable();if(!b.length)return!1;const c=b.end(0);let e=c;a.start&&(a=a.start.timeOffset,e=0>a?Math.max(c+a,b.start(0)):Math.min(c,a));this.trigger("firstplay");this.tech_.setCurrentTime(e)}this.hasPlayed_= |
|
!0;this.load();return!0}handleSourceOpen_(){this.tryToCreateSourceBuffers_();if(this.tech_.autoplay()){const a=this.tech_.play();"undefined"!==typeof a&&"function"===typeof a.then&&a.then(null,b=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(this.inbandTextTracks_.metadataTrack_){var a=this.inbandTextTracks_.metadataTrack_.cues;if(a&&a.length){var b=this.duration();a[a.length-1].endTime=isNaN(b)||Infinity===Math.abs(b)?Number.MAX_VALUE:b}}}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let a= |
|
this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const b=this.mainSegmentLoader_.getCurrentMediaInfo_();a=!b||b.hasVideo?a&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}a&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(a){if(!this.seekable().length)return!1;var b=this.syncController_.getExpiredTime(a,this.duration());if(null===b)return!1;a=Rb.Playlist.playlistEnd(a,b);b=this.tech_.currentTime();var c=this.tech_.buffered(); |
|
if(!c.length)return a-b<=Eb;c=c.end(c.length-1);return c-b<=Eb&&a-c<=Eb}excludePlaylist({playlistToExclude:a=this.mainPlaylistLoader_.media(),error:b={},playlistExclusionDuration:c}){a=a||this.mainPlaylistLoader_.media();c=c||b.playlistExclusionDuration||this.playlistExclusionDuration;if(a){a.playlistErrors_++;var e=this.mainPlaylistLoader_.main.playlists,g=e.filter(Ae);g=1===g.length&&g[0]===a;if(1===e.length&&Infinity!==c)return H.log.warn(`Problem encountered with playlist ${a.id}. `+"Trying again since it is the only playlist."), |
|
this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(g);if(g){if(this.main().contentSteering){const p=this.pathwayAttribute_(a);g=1E3*this.contentSteeringController_.steeringManifest.ttl;this.contentSteeringController_.excludePathway(p);this.excludeThenChangePathway_();setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(p)},g);return}let l=!1;e.forEach(p=>{if(p!==a){var t=p.excludeUntil;"undefined"!==typeof t&&Infinity!==t&&(l=!0,delete p.excludeUntil)}});l&&(H.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."), |
|
this.tech_.trigger("retryplaylist"))}c=a.playlistErrors_>this.maxPlaylistRetries?Infinity:Date.now()+1E3*c;a.excludeUntil=c;b.reason&&(a.lastExcludeReason_=b.reason);this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});if(c=this.selectPlaylist())return(b.internal?this.logger_:H.log.warn)(`${b.internal?"Internal problem":"Problem"} encountered with playlist ${a.id}.`+`${b.message?" "+b.message:""} Switching to playlist ${c.id}.`),c.attributes.AUDIO!== |
|
a.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==a.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]),b=c.targetDuration/2*1E3||5E3,b="number"===typeof c.lastRequest&&Date.now()-c.lastRequest<=b,this.switchMedia_(c,"exclude",g||b);this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error")}else this.error=b,"open"!==this.mediaSource.readyState? |
|
this.trigger("error"):this.sourceUpdater_.endOfStream("network")}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(a,b){const c=[],e="all"===a;(e||"main"===a)&&c.push(this.mainPlaylistLoader_);const g=[];(e||"audio"===a)&&g.push("AUDIO");if(e||"subtitle"===a)g.push("CLOSED-CAPTIONS"),g.push("SUBTITLES");g.forEach(l=>{(l=this.mediaTypes_[l]&&this.mediaTypes_[l].activePlaylistLoader)&&c.push(l)});["main","audio","subtitle"].forEach(l=>{const p=this[`${l}SegmentLoader_`]; |
|
!p||a!==l&&"all"!==a||c.push(p)});c.forEach(l=>b.forEach(p=>{if("function"===typeof l[p])l[p]()}))}setCurrentTime(a){const b=Pc(this.tech_.buffered(),a);if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.media()||!this.mainPlaylistLoader_.media().segments)return 0;if(b&&b.length)return a;this.mainSegmentLoader_.pause();this.mainSegmentLoader_.resetEverything();this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything());this.mediaTypes_.SUBTITLES.activePlaylistLoader&& |
|
(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything());this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const a=this.mainPlaylistLoader_.media();return a?a.endList?this.mediaSource?this.mediaSource.duration:Rb.Playlist.duration(a):Infinity:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let a;if(this.mainPlaylistLoader_){var b=this.mainPlaylistLoader_.media();if(b){var c=this.syncController_.getExpiredTime(b,this.duration());if(null!==c){var e=this.mainPlaylistLoader_.main, |
|
g=Rb.Playlist.seekable(b,c,Rb.Playlist.liveEdgeDelay(e,b));if(0!==g.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){b=this.mediaTypes_.AUDIO.activePlaylistLoader.media();c=this.syncController_.getExpiredTime(b,this.duration());if(null===c)return;a=Rb.Playlist.seekable(b,c,Rb.Playlist.liveEdgeDelay(e,b));if(0===a.length)return}if(this.seekable_&&this.seekable_.length){var l=this.seekable_.end(0);var p=this.seekable_.start(0)}a?a.start(0)>g.end(0)||g.start(0)>a.end(0)?this.seekable_=g:this.seekable_= |
|
Na([[a.start(0)>g.start(0)?a.start(0):g.start(0),a.end(0)<g.end(0)?a.end(0):g.end(0)]]):this.seekable_=g;this.seekable_&&this.seekable_.length&&this.seekable_.end(0)===l&&this.seekable_.start(0)===p||(this.logger_(`seekable updated [${Ak(this.seekable_)}]`),this.tech_.trigger("seekablechanged"))}}}}}updateDuration(a){this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null);if("open"!==this.mediaSource.readyState)this.updateDuration_= |
|
this.updateDuration.bind(this,a),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);else if(a)a=this.seekable(),a.length&&(isNaN(this.mediaSource.duration)||this.mediaSource.duration<a.end(a.length-1))&&this.sourceUpdater_.setDuration(a.end(a.length-1));else{a=this.tech_.buffered();var b=Rb.Playlist.duration(this.mainPlaylistLoader_.media());0<a.length&&(b=Math.max(b,a.end(a.length-1)));this.mediaSource.duration!==b&&this.sourceUpdater_.setDuration(b)}}dispose(){this.trigger("dispose"); |
|
this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();this.contentSteeringController_.dispose();this.keyStatusMap_.clear();this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);["AUDIO","SUBTITLES"].forEach(a=>{a=this.mediaTypes_[a].groups;for(const b in a)a[b].forEach(c=>{c.playlistLoader&&c.playlistLoader.dispose()})});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose(); |
|
this.stopABRTimer_();this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_);this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){var a=!!this.mediaTypes_.AUDIO.activePlaylistLoader; |
|
const b=!!this.mainSegmentLoader_.getCurrentMediaInfo_();a=a?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return b&&a?!0:!1}getCodecsOrExclude_(){const a={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},b=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();a.video=a.main;var c=Ed(this.main(),b);const e={},g=!!this.mediaTypes_.AUDIO.activePlaylistLoader;a.main.hasVideo&&(e.video=c.video||a.main.videoCodec||"avc1.4d400d"); |
|
a.main.isMuxed&&(e.video+=`,${c.audio||a.main.audioCodec||"mp4a.40.2"}`);if(a.main.hasAudio&&!a.main.isMuxed||a.audio.hasAudio||g)e.audio=c.audio||a.main.audioCodec||a.audio.audioCodec||"mp4a.40.2",a.audio.isFmp4=a.main.hasAudio&&!a.main.isMuxed?a.main.isFmp4:a.audio.isFmp4;if(e.audio||e.video){var l={},p;["video","audio"].forEach(function(t){var x;if(x=e.hasOwnProperty(t))x=e[t],x=!(a[t].isFmp4?be(x):Kf(x));x&&(x=a[t].isFmp4?"browser":"muxer",l[x]=l[x]||[],l[x].push(e[t]),"audio"===t&&(p=x))});if(g&& |
|
p&&b.attributes.AUDIO){const t=b.attributes.AUDIO;this.main().playlists.forEach(x=>{(x.attributes&&x.attributes.AUDIO)===t&&x!==b&&(x.excludeUntil=Infinity)});this.logger_(`excluding audio group ${t} as ${p} does not support codec(s): "${e.audio}"`)}if(Object.keys(l).length)c=Object.keys(l).reduce((t,x)=>{t&&(t+=", ");return t+=`${x} does not support codec(s): "${l[x].join(",")}"`},"")+".",this.excludePlaylist({playlistToExclude:b,error:{internal:!0,message:c},playlistExclusionDuration:Infinity}); |
|
else{if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];["video","audio"].forEach(x=>{const y=(zb(this.sourceUpdater_.codecs[x]||"")[0]||{}).type,A=(zb(e[x]||"")[0]||{}).type;y&&A&&y.toLowerCase()!==A.toLowerCase()&&t.push(`"${this.sourceUpdater_.codecs[x]}" -> "${e[x]}"`)});if(t.length){this.excludePlaylist({playlistToExclude:b,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:!0},playlistExclusionDuration:Infinity});return}}return e}}else this.excludePlaylist({playlistToExclude:b, |
|
error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity})}tryToCreateSourceBuffers_(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var a=this.getCodecsOrExclude_();a&&(this.sourceUpdater_.createSourceBuffers(a),a=[a.video,a.audio].filter(Boolean).join(","),this.excludeIncompatibleVariants_(a))}}excludeUnsupportedVariants_(){const a=this.main().playlists,b=[];Object.keys(a).forEach(c=>{c=a[c]; |
|
if(-1===b.indexOf(c.id)){b.push(c.id);var e=Ed(this.main,c),g=[];!e.audio||Kf(e.audio)||be(e.audio)||g.push(`audio codec ${e.audio}`);!e.video||Kf(e.video)||be(e.video)||g.push(`video codec ${e.video}`);e.text&&"stpp.ttml.im1t"===e.text&&g.push(`text codec ${e.text}`);g.length&&(c.excludeUntil=Infinity,this.logger_(`excluding ${c.id} for unsupported: ${g.join(", ")}`))}})}excludeIncompatibleVariants_(a){const b=[],c=this.main().playlists;a=Qe(zb(a));const e=Kl(a),g=a.video&&zb(a.video)[0]||null,l= |
|
a.audio&&zb(a.audio)[0]||null;Object.keys(c).forEach(p=>{p=c[p];if(-1===b.indexOf(p.id)&&Infinity!==p.excludeUntil){b.push(p.id);var t=[],x=Ed(this.mainPlaylistLoader_.main,p),y=Kl(x);if(x.audio||x.video)y!==e&&t.push(`codec count "${y}" !== "${e}"`),this.sourceUpdater_.canChangeType()||(y=x.video&&zb(x.video)[0]||null,x=x.audio&&zb(x.audio)[0]||null,y&&g&&y.type.toLowerCase()!==g.type.toLowerCase()&&t.push(`video codec "${y.type}" !== "${g.type}"`),x&&l&&x.type.toLowerCase()!==l.type.toLowerCase()&& |
|
t.push(`audio codec "${x.type}" !== "${l.type}"`)),t.length&&(p.excludeUntil=Infinity,this.logger_(`excluding ${p.id}: ${t.join(" \x26\x26 ")}`))}})}updateAdCues_(a){let b=0;const c=this.seekable();c.length&&(b=c.start(0));$q(a,this.cueTagsTrack_,b)}goalBufferLength(){const a=this.tech_.currentTime(),b=Ha.GOAL_BUFFER_LENGTH;return Math.min(b+a*Ha.GOAL_BUFFER_LENGTH_RATE,Math.max(b,Ha.MAX_GOAL_BUFFER_LENGTH))}bufferLowWaterLine(){const a=this.tech_.currentTime(),b=Ha.BUFFER_LOW_WATER_LINE,c=Math.max(b, |
|
Ha.MAX_BUFFER_LOW_WATER_LINE),e=Math.max(b,Ha.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(b+a*Ha.BUFFER_LOW_WATER_LINE_RATE,this.bufferBasedABR?e:c)}bufferHighWaterLine(){return Ha.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(a){Ol(this.inbandTextTracks_,"com.apple.streaming",this.tech_);Qq({inbandTextTracks:this.inbandTextTracks_,dateRanges:a})}addMetadataToTextTrack(a,b,c){const e=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset(); |
|
Ol(this.inbandTextTracks_,a,this.tech_);Nq({inbandTextTracks:this.inbandTextTracks_,metadataArray:b,timestampOffset:e,videoDuration:c})}pathwayAttribute_(a){return a.attributes["PATHWAY-ID"]||a.attributes.serviceLocation}initContentSteeringController_(){const a=this.main();if(a.contentSteering){for(const b of a.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(b));this.contentSteeringController_.assignTagProperties(a.uri,a.contentSteering);if(this.contentSteeringController_.queryBeforeStart)this.contentSteeringController_.requestSteeringManifest(!0); |
|
else this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways();this.contentSteeringController_.dispose();this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this));if("dash"===this.sourceType_)this.mainPlaylistLoader_.on("loadedplaylist",()=>{const a=this.main(),b=()=> |
|
{const c=this.contentSteeringController_.getAvailablePathways(),e=[];for(const g of a.playlists){const l=g.attributes.serviceLocation;if(l&&(e.push(l),!c.has(l)))return!0}return!e.length&&c.size?!0:!1};(this.contentSteeringController_.didDASHTagChange(a.uri,a.contentSteering)||b())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const a=this.contentSteeringController_.getPathway();if(a){this.handlePathwayClones_();var b=this.main().playlists,c=new Set,e=!1;Object.keys(b).forEach(g=> |
|
{g=b[g];var l=this.pathwayAttribute_(g);l=l&&a!==l;Infinity!==g.excludeUntil||"content-steering"!==g.lastExcludeReason_||l||(delete g.excludeUntil,delete g.lastExcludeReason_,e=!0);const p=!g.excludeUntil&&Infinity!==g.excludeUntil;!c.has(g.id)&&l&&p&&(c.add(g.id),g.excludeUntil=Infinity,g.lastExcludeReason_="content-steering",this.logger_(`excluding ${g.id} for ${g.lastExcludeReason_}`))});"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach(g=>{g=this.mediaTypes_[g]; |
|
g.activePlaylistLoader&&(g=g.activePlaylistLoader.media_)&&g.attributes.serviceLocation!==a&&(e=!0)});e&&this.changeSegmentPathway_()}}handlePathwayClones_(){const a=this.main().playlists,b=this.contentSteeringController_.currentPathwayClones,c=this.contentSteeringController_.nextPathwayClones;if(b&&b.size||c&&c.size){for(const [e,g]of b.entries())c.get(e)||(this.mainPlaylistLoader_.updateOrDeleteClone(g),this.contentSteeringController_.excludePathway(e));for(const [e,g]of c.entries()){const l=b.get(e); |
|
l?this.equalPathwayClones_(l,g)||(this.mainPlaylistLoader_.updateOrDeleteClone(g,!0),this.contentSteeringController_.addAvailablePathway(e)):(a.filter(p=>p.attributes["PATHWAY-ID"]===g["BASE-ID"]).forEach(p=>{this.mainPlaylistLoader_.addClonePathway(g,p)}),this.contentSteeringController_.addAvailablePathway(e))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...c])))}}equalPathwayClones_(a,b){if(a["BASE-ID"]!==b["BASE-ID"]||a.ID!==b.ID||a["URI-REPLACEMENT"].HOST!== |
|
b["URI-REPLACEMENT"].HOST)return!1;a=a["URI-REPLACEMENT"].PARAMS;b=b["URI-REPLACEMENT"].PARAMS;for(const c in a)if(a[c]!==b[c])return!1;for(const c in b)if(a[c]!==b[c])return!1;return!0}changeSegmentPathway_(){const a=this.selectPlaylist();this.pauseLoading();"DASH"===this.contentSteeringController_.manifestType_&&this.switchMediaForDASHContentSteering_();this.switchMedia_(a,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.main){var a=0; |
|
this.mainPlaylistLoader_.main.playlists.forEach(b=>{const c=this.mainPlaylistLoader_.getKeyIdSet(b);c&&c.size&&c.forEach(e=>{const g=this.keyStatusMap_.has(e)&&"usable"===this.keyStatusMap_.get(e),l="non-usable"===b.lastExcludeReason_&&Infinity===b.excludeUntil;g?g&&l&&(delete b.excludeUntil,delete b.lastExcludeReason_,this.logger_(`enabling playlist ${b.id} because key ID ${e} is ${"usable"}`)):(Infinity!==b.excludeUntil&&"non-usable"!==b.lastExcludeReason_&&(b.excludeUntil=Infinity,b.lastExcludeReason_= |
|
"non-usable",this.logger_(`excluding playlist ${b.id} because the key ID ${e} doesn't exist in the keyStatusMap or is not ${"usable"}`)),a++)})});a>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(b=>{const c=Infinity===b.excludeUntil&&"non-usable"===b.lastExcludeReason_;b&&b.attributes&&b.attributes.RESOLUTION&&720>b.attributes.RESOLUTION.height&&c&&(delete b.excludeUntil,H.log.warn(`enabling non-HD playlist ${b.id} because all playlists were excluded due to ${"non-usable"} key IDs`))})}}addKeyStatus_(a, |
|
b){a=("string"===typeof a?a:Xq(a)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${b}' with key ID ${a} added to the keyStatusMap`);this.keyStatusMap_.set(a,b)}updatePlaylistByKeyStatus(a,b){this.addKeyStatus_(a,b);this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_();this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this));this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(); |
|
this.fastQualityChange_()}}const tr=(a,b,c)=>e=>{const g=a.main.playlists[b],l=Ig(g),p=Ae(g);if("undefined"===typeof e)return p;e?delete g.disabled:g.disabled=!0;e===p||l||(c(g),e?a.trigger("renditionenabled"):a.trigger("renditiondisabled"));return e};class ur{constructor(a,b,c){const {playlistController_:e}=a,g=e.fastQualityChange_.bind(e);if(b.attributes){const l=b.attributes.RESOLUTION;this.width=l&&l.width;this.height=l&&l.height;this.bandwidth=b.attributes.BANDWIDTH;this.frameRate=b.attributes["FRAME-RATE"]}this.codecs= |
|
Ed(e.main(),b);this.playlist=b;this.id=c;this.enabled=tr(a.playlists,b.id,g)}}const vr=function(a){a.representations=()=>{var b=a.playlistController_.main();return(b=td(b)?a.playlistController_.getAudioTrackPlaylists_():b.playlists)?b.filter(c=>!Ig(c)).map((c,e)=>new ur(a,c,c.id)):[]}},am=["seeking","seeked","pause","playing","error"];class wr{constructor(a){this.playlistController_=a.playlistController;this.tech_=a.tech;this.seekable=a.seekable;this.allowSeeksWithinUnsafeLiveWindow=a.allowSeeksWithinUnsafeLiveWindow; |
|
this.liveRangeSafeTimeDelta=a.liveRangeSafeTimeDelta;this.media=a.media;this.consecutiveUpdates=0;this.checkCurrentTimeTimeout_=this.lastRecordedTime=null;this.logger_=mb("PlaybackWatcher");this.logger_("initialize");const b=()=>this.monitorCurrentTime_(),c=()=>this.monitorCurrentTime_(),e=()=>this.techWaiting_(),g=()=>this.resetTimeUpdate_(),l=this.playlistController_,p=["main","subtitle","audio"],t={};p.forEach(y=>{t[y]={reset:()=>this.resetSegmentDownloads_(y),updateend:()=>this.checkSegmentDownloads_(y)}; |
|
l[`${y}SegmentLoader_`].on("appendsdone",t[y].updateend);l[`${y}SegmentLoader_`].on("playlistupdate",t[y].reset);this.tech_.on(["seeked","seeking"],t[y].reset)});const x=y=>{["main","audio"].forEach(A=>{l[`${A}SegmentLoader_`][y]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),x("off"))};this.clearSeekingAppendCheck_=()=>x("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(); |
|
x("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",e);this.tech_.on(am,g);this.tech_.on("canplay",c);this.tech_.one("play",b);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",e);this.tech_.off(am,g);this.tech_.off("canplay",c);this.tech_.off("play",b);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);p.forEach(y=> |
|
{l[`${y}SegmentLoader_`].off("appendsdone",t[y].updateend);l[`${y}SegmentLoader_`].off("playlistupdate",t[y].reset);this.tech_.off(["seeked","seeking"],t[y].reset)});this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_);this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();this.checkCurrentTimeTimeout_&&D.clearTimeout(this.checkCurrentTimeTimeout_);this.checkCurrentTimeTimeout_=D.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(a){const b= |
|
this.playlistController_[`${a}SegmentLoader_`];0<this[`${a}StalledDownloads_`]&&this.logger_(`resetting possible stalled download count for ${a} loader`);this[`${a}StalledDownloads_`]=0;this[`${a}Buffered_`]=b.buffered_()}checkSegmentDownloads_(a){const b=this.playlistController_,c=b[`${a}SegmentLoader_`],e=c.buffered_(),g=op(this[`${a}Buffered_`],e);this[`${a}Buffered_`]=e;g?this.resetSegmentDownloads_(a):(this[`${a}StalledDownloads_`]++,this.logger_(`found #${this[`${a}StalledDownloads_`]} ${a} appends that did not increase buffer (possible stalled download)`, |
|
{playlistId:c.playlist_&&c.playlist_.id,buffered:lc(e)}),10>this[`${a}StalledDownloads_`]||(this.logger_(`${a} loader stalled download exclusion`),this.resetSegmentDownloads_(a),this.tech_.trigger({type:"usage",name:`vhs-${a}-download-exclusion`}),"subtitle"!==a&&b.excludePlaylist({error:{message:`Excessive ${a} segment downloading detected.`},playlistExclusionDuration:Infinity})))}checkCurrentTime_(){if(!this.tech_.paused()&&!this.tech_.seeking()){var a=this.tech_.currentTime(),b=this.tech_.buffered(); |
|
if(this.lastRecordedTime===a&&(!b.length||a+Eb>=b.end(b.length-1)))return this.techWaiting_();5<=this.consecutiveUpdates&&a===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):a===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=a)}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;var a=this.seekable();const b=this.tech_.currentTime();var c;this.afterSeekableWindow_(a,b,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&& |
|
(c=a.end(a.length-1));this.beforeSeekableWindow_(a,b)&&(c=a.start(0),c+=c===a.end(0)?0:Eb);if("undefined"!==typeof c)return this.logger_(`Trying to seek outside of seekable at time ${b} with `+`seekable range ${Ak(a)}. Seeking to `+`${c}.`),this.tech_.setCurrentTime(c),!0;var e=this.playlistController_.sourceUpdater_;a=this.tech_.buffered();c=e.audioBuffer?e.audioBuffered():null;var g=e.videoBuffer?e.videoBuffered():null;e=this.media();e=e.partTargetDuration?e.partTargetDuration:2*(e.targetDuration- |
|
Db);c=[c,g];for(g=0;g<c.length;g++)if(c[g]&&Fg(c[g],b)<e)return!1;a=ze(a,b);if(0===a.length)return!1;c=a.start(0)+Eb;this.logger_(`Buffered region starts (${a.start(0)}) `+` just beyond seek point (${b}). Seeking to ${c}.`);this.tech_.setCurrentTime(c);return!0}waiting_(){if(!this.techWaiting_()){var a=this.tech_.currentTime(),b=this.tech_.buffered();b=Pc(b,a);b.length&&a+3<=b.end(0)&&(this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.logger_(`Stopped at ${a} while inside a buffered region `+ |
|
`[${b.start(0)} -> ${b.end(0)}]. Attempting to resume `+"playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}))}}techWaiting_(){var a=this.seekable();const b=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(a,b))return a=a.end(a.length-1),this.logger_(`Fell out of live window at time ${b}. Seeking to `+`live point (seekable end) ${a}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(a),this.tech_.trigger({type:"usage", |
|
name:"vhs-live-resync"}),!0;a=this.tech_.vhs.playlistController_.sourceUpdater_;const c=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:a.audioBuffered(),videoBuffered:a.videoBuffered(),currentTime:b}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(b),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;a=ze(c,b);return 0<a.length?(this.logger_(`Stopped at ${b} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(b),!0):!1}afterSeekableWindow_(a, |
|
b,c,e=!1){if(!a.length)return!1;let g=a.end(a.length-1)+Eb;const l="number"===typeof c.partTargetDuration;c.endList||!l&&!e||(g=a.end(a.length-1)+3*c.targetDuration);return b>g?!0:!1}beforeSeekableWindow_(a,b){return a.length&&0<a.start(0)&&b<a.start(0)-this.liveRangeSafeTimeDelta?!0:!1}videoUnderflow_({videoBuffered:a,audioBuffered:b,currentTime:c}){if(a){var e;if(a.length&&b.length){const g=Pc(a,c-3);a=Pc(a,c);b=Pc(b,c);b.length&&!a.length&&g.length&&(e={start:g.end(0),end:b.end(0)})}else ze(a, |
|
c).length||(e=this.gapFromVideoUnderflow_(a,c));return e?(this.logger_(`Encountered a gap in video from ${e.start} to ${e.end}. `+`Seeking to current time ${c}`),!0):!1}}skipTheGap_(a){var b=this.tech_.buffered();const c=this.tech_.currentTime();b=ze(b,c);this.resetTimeUpdate_();0!==b.length&&c===a&&(this.logger_("skipTheGap_:","currentTime:",c,"scheduled currentTime:",a,"nextRange start:",b.start(0)),this.tech_.setCurrentTime(b.start(0)+Db),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"}))}gapFromVideoUnderflow_(a, |
|
b){if(2>a.length)a=Na();else{var c=[];for(var e=1;e<a.length;e++){var g=a.end(e-1);const l=a.start(e);c.push([g,l])}a=Na(c)}for(c=0;c<a.length;c++)if(e=a.start(c),g=a.end(c),4>b-e&&2<b-e)return{start:e,end:g};return null}}const xr={errorInterval:30,getSource(a){const b=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return a(b)}},bm=function(a,b){let c=0,e=0;const g=ia(xr,b);a.ready(()=>{a.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const l=function(){e&& |
|
a.currentTime(e)},p=function(y){null!==y&&void 0!==y&&(e=Infinity!==a.duration()&&a.currentTime()||0,a.one("loadedmetadata",l),a.src(y),a.trigger({type:"usage",name:"vhs-error-reload"}),a.play())},t=function(){if(Date.now()-c<1E3*g.errorInterval)a.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(g.getSource&&"function"===typeof g.getSource)return c=Date.now(),g.getSource.call(a,p);H.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},x=function(){a.off("loadedmetadata", |
|
l);a.off("error",t);a.off("dispose",x)};a.on("error",t);a.on("dispose",x);a.reloadSourceOnError=function(y){x();bm(a,y)}},yr=function(a){bm(this,a)},va={PlaylistLoader:Rc,Playlist:Ya,utils:Bp,STANDARD_PLAYLIST_SELECTOR:Nl,INITIAL_PLAYLIST_SELECTOR:function(){const a=this.playlists.main.playlists.filter(Ya.isEnabled);Tc(a,(b,c)=>jh(b,c));return a.filter(b=>!!Ed(this.playlists.main,b).video)[0]||null},lastBandwidthSelector:Nl,movingAverageBandwidthSelector:function(a){let b=-1,c=-1;if(0>a||1<a)throw Error("Moving average bandwidth decay must be between 0 and 1."); |
|
return function(){let e=this.useDevicePixelRatio?D.devicePixelRatio||1:1;isNaN(this.customPixelRatio)||(e=this.customPixelRatio);0>b&&(c=b=this.systemBandwidth);0<this.systemBandwidth&&this.systemBandwidth!==c&&(b=a*this.systemBandwidth+(1-a)*b,c=this.systemBandwidth);return Ml(this.playlists.main,b,parseInt(Se(this.tech_.el(),"width"),10)*e,parseInt(Se(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}},comparePlaylistBandwidth:jh,comparePlaylistResolution:function(a, |
|
b){let c,e;a.attributes.RESOLUTION&&a.attributes.RESOLUTION.width&&(c=a.attributes.RESOLUTION.width);c=c||D.Number.MAX_VALUE;b.attributes.RESOLUTION&&b.attributes.RESOLUTION.width&&(e=b.attributes.RESOLUTION.width);e=e||D.Number.MAX_VALUE;return c===e&&a.attributes.BANDWIDTH&&b.attributes.BANDWIDTH?a.attributes.BANDWIDTH-b.attributes.BANDWIDTH:c-e},xhr:Sk()};Object.keys(Ha).forEach(a=>{Object.defineProperty(va,a,{get(){H.log.warn(`using Vhs.${a} is UNSAFE be sure you know what you are doing`);return Ha[a]}, |
|
set(b){H.log.warn(`using Vhs.${a} is UNSAFE be sure you know what you are doing`);"number"!==typeof b||0>b?H.log.warn(`value of Vhs.${a} must be greater than or equal to 0`):Ha[a]=b}})});const cm=function(a,b){b=b.media();let c=-1;for(let e=0;e<a.length;e++)if(a[e].id===b.id){c=e;break}a.selectedIndex_=c;a.trigger({selectedIndex:c,type:"change"})},zr=function(a,b){b.representations().forEach(c=>{a.addQualityLevel(c)});cm(a,b.playlists)};va.canPlaySource=function(){return H.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")}; |
|
const Ar=(a,b)=>a.reduce((c,e)=>{if(!e.contentProtection)return c;const g=b.reduce((l,p)=>{const t=e.contentProtection[p];t&&t.pssh&&(l[p]={pssh:t.pssh});return l},{});Object.keys(g).length&&c.push(g);return c},[]),Br=({player:a,sourceKeySystems:b,audioMedia:c,mainPlaylists:e})=>{if(!a.eme.initializeMediaKeys)return Promise.resolve();c=c?e.concat([c]):e;const g=[],l=[];Ar(c,Object.keys(b)).forEach(p=>{l.push(new Promise((t,x)=>{a.tech_.one("keysessioncreated",t)}));g.push(new Promise((t,x)=>{a.eme.initializeMediaKeys({keySystems:p}, |
|
y=>{y?x(y):t()})}))});return Promise.race([Promise.all(g),Promise.race(l)])},Cr=({player:a,sourceKeySystems:b,media:c,audioMedia:e})=>{if(b){var g={};c&&c.attributes&&c.attributes.CODECS&&(g=Qe(zb(c.attributes.CODECS)));e&&e.attributes&&e.attributes.CODECS&&(g.audio=e.attributes.CODECS);e=id(g.video);g=id(g.audio);var l={};for(const p in b)l[p]={},g&&(l[p].audioContentType=g),e&&(l[p].videoContentType=e),c.contentProtection&&c.contentProtection[p]&&c.contentProtection[p].pssh&&(l[p].pssh=c.contentProtection[p].pssh), |
|
"string"===typeof b[p]&&(l[p].url=b[p]);b=ia(b,l)}return b?(a.currentSource().keySystems=b)&&!a.eme?(H.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0:!1},dm=()=>{if(!D.localStorage)return null;const a=D.localStorage.getItem("videojs-vhs");if(!a)return null;try{return JSON.parse(a)}catch(b){return null}},Dr=a=>0===a.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(a.substring(a.indexOf(",")+1)):a;va.supportsNativeHls=function(){if(!P||!P.createElement)return!1; |
|
const a=P.createElement("video");return H.getTech("Html5").isSupported()?"application/vnd.apple.mpegurl audio/mpegurl audio/x-mpegurl application/x-mpegurl video/x-mpegurl video/mpegurl application/mpegurl".split(" ").some(function(b){return/maybe|probably/i.test(a.canPlayType(b))}):!1}();var Er=P&&P.createElement&&H.getTech("Html5").isSupported()?/maybe|probably/i.test(P.createElement("video").canPlayType("application/dash+xml")):!1;va.supportsNativeDash=Er;va.supportsTypeNatively=a=>"hls"===a?va.supportsNativeHls: |
|
"dash"===a?va.supportsNativeDash:!1;va.isSupported=function(){return H.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};va.xhr.onRequest=function(a){var b=va.xhr;b._requestCallbackSet||(b._requestCallbackSet=new Set);b._requestCallbackSet.add(a)};va.xhr.onResponse=function(a){var b=va.xhr;b._responseCallbackSet||(b._responseCallbackSet=new Set);b._responseCallbackSet.add(a)};va.xhr.offRequest=function(a){var b=va.xhr;b._requestCallbackSet&&(b._requestCallbackSet.delete(a), |
|
b._requestCallbackSet.size||delete b._requestCallbackSet)};va.xhr.offResponse=function(a){var b=va.xhr;b._responseCallbackSet&&(b._responseCallbackSet.delete(a),b._responseCallbackSet.size||delete b._responseCallbackSet)};const Fr=H.getComponent("Component");class em extends Fr{constructor(a,b,c){super(b,c.vhs);"number"===typeof c.initialBandwidth&&(this.options_.bandwidth=c.initialBandwidth);this.logger_=mb("VhsHandler");b.options_&&b.options_.playerId&&(this.player_=H.getPlayer(b.options_.playerId)); |
|
this.tech_=b;this.source_=a;this.stats={};this.ignoreNextSeekingEvent_=!1;this.setOptions_();if(this.options_.overrideNative&&b.overrideNativeAudioTracks&&b.overrideNativeVideoTracks)b.overrideNativeAudioTracks(!0),b.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(b.featuresNativeVideoTracks||b.featuresNativeAudioTracks))throw Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(P,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange", |
|
"MSFullscreenChange"],e=>{(e=P.fullscreenElement||P.webkitFullscreenElement||P.mozFullScreenElement||P.msFullscreenElement)&&e.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()});this.on(this.tech_,"seeking",function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())});this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}); |
|
this.on(this.tech_,"play",this.play)}setOptions_(a={}){this.options_=ia(this.options_,a);this.options_.withCredentials=this.options_.withCredentials||!1;this.options_.limitRenditionByPlayerDimensions=!1===this.options_.limitRenditionByPlayerDimensions?!1:!0;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1;this.options_.useBandwidthFromLocalStorage="undefined"!==typeof this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage|| |
|
!1;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1;this.options_.llhls=!1===this.options_.llhls?!1:!0;this.options_.bufferBasedABR= |
|
this.options_.bufferBasedABR||!1;"number"!==typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60);"number"!==typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage&&((a=dm())&&a.bandwidth&&(this.options_.bandwidth=a.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),a&&a.throughput&&(this.options_.throughput=a.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})));"number"!== |
|
typeof this.options_.bandwidth&&(this.options_.bandwidth=Ha.INITIAL_BANDWIDTH);this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Ha.INITIAL_BANDWIDTH;"withCredentials useDevicePixelRatio customPixelRatio limitRenditionByPlayerDimensions bandwidth customTagParsers customTagMappers cacheEncryptionKeys playlistSelector initialPlaylistSelector bufferBasedABR liveRangeSafeTimeDelta llhls useForcedSubtitles useNetworkInformationApi useDtsForTimestampOffset exactManifestTimings leastPixelDiffSelector".split(" ").forEach(b=> |
|
{"undefined"!==typeof this.source_[b]&&(this.options_[b]=this.source_[b])});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio;a=this.options_.customPixelRatio;"number"===typeof a&&0<=a&&(this.customPixelRatio=a)}setOptions(a={}){this.setOptions_(a)}src(a,b){a&&(this.setOptions_(),this.options_.src=Dr(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=va,this.options_.sourceType=Ni(b), |
|
this.options_.seekTo=c=>{this.tech_.setCurrentTime(c)},this.playlistController_=new sr(this.options_),a=ia({liveRangeSafeTimeDelta:Eb},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_}),this.playbackWatcher_=new wr(a),this.playlistController_.on("error",()=>{const c=H.players[this.tech_.options_.playerId];let e=this.playlistController_.error;"object"!==typeof e||e.code?"string"===typeof e&&(e={message:e,code:3}):e.code= |
|
3;c.error(e)}),a=this.options_.bufferBasedABR?va.movingAverageBandwidthSelector(.55):va.STANDARD_PLAYLIST_SELECTOR,this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):a.bind(this),this.playlistController_.selectInitialPlaylist=va.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist}, |
|
set(c){this.playlistController_.selectPlaylist=c.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(c){this.playlistController_.mainSegmentLoader_.throughput.rate=c;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let c=this.playlistController_.mainSegmentLoader_.bandwidth;var e=D.navigator.connection||D.navigator.mozConnection||D.navigator.webkitConnection;this.options_.useNetworkInformationApi&&e&&(e=1E6*e.downlink, |
|
c=1E7<=e&&1E7<=c?Math.max(c,e):e);return c},set(c){this.playlistController_.mainSegmentLoader_.bandwidth=c;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){return Math.floor(1/(1/(this.bandwidth||1)+(0<this.throughput?1/this.throughput:0)))},set(){H.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats, |
|
{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()|| |
|
0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=> |
|
this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>lc(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=> |
|
this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>lc(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){var c={bandwidth:this.bandwidth,throughput:Math.round(this.throughput)};if(D.localStorage){var e= |
|
dm();e=e?ia(e,c):c;try{D.localStorage.setItem("videojs-vhs",JSON.stringify(e))}catch(g){}}}}),this.playlistController_.on("selectedinitialmedia",()=>{vr(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=D.URL.createObjectURL(this.playlistController_.mediaSource), |
|
this.tech_.src(this.mediaSourceUrl_)))}createKeySessions_(){const a=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");Br({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:a&&a.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()}).catch(b=>{this.logger_("error while creating EME key session",b);this.player_.error({message:"Failed to initialize media keys for EME", |
|
code:3,metadata:{errorType:H.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){var a=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;a=Cr({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:a&&a.media()});this.player_.tech_.on("keystatuschange",b=>{this.playlistController_.updatePlaylistByKeyStatus(b.keyId, |
|
b.status)});this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this);this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_);a?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const a=H.players[this.tech_.options_.playerId];a&&a.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=a.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{zr(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{cm(this.qualityLevels_, |
|
this.playlists)}))}static version(){return{"@videojs/http-streaming":"3.12.1","mux.js":"7.0.3","mpd-parser":"1.3.0","m3u8-parser":"7.1.0","aes-decrypter":"4.0.1"}}version(){return this.constructor.version()}canChangeType(){return Ul.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(a){this.playlistController_.setCurrentTime(a)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(); |
|
this.playlistController_&&this.playlistController_.dispose();this.qualityLevels_&&this.qualityLevels_.dispose();this.tech_&&this.tech_.vhs&&delete this.tech_.vhs;this.mediaSourceUrl_&&D.URL.revokeObjectURL&&(D.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null);this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_);super.dispose()}convertToProgramTime(a,b){return Gp({playlist:this.playlistController_.media(),time:a,callback:b})}seekToProgramTime(a,b,c=!0,e=2){return Vk({programTime:a, |
|
playlist:this.playlistController_.media(),retryCount:e,pauseAfterSeek:c,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:b})}setupXhrHooks_(){this.xhr.onRequest=a=>{var b=this.xhr;b._requestCallbackSet||(b._requestCallbackSet=new Set);b._requestCallbackSet.add(a)};this.xhr.onResponse=a=>{var b=this.xhr;b._responseCallbackSet||(b._responseCallbackSet=new Set);b._responseCallbackSet.add(a)};this.xhr.offRequest=a=>{var b=this.xhr;b._requestCallbackSet&&(b._requestCallbackSet.delete(a),b._requestCallbackSet.size|| |
|
delete b._requestCallbackSet)};this.xhr.offResponse=a=>{var b=this.xhr;b._responseCallbackSet&&(b._responseCallbackSet.delete(a),b._responseCallbackSet.size||delete b._responseCallbackSet)};this.player_.trigger("xhr-hooks-ready")}}const Ve={name:"videojs-http-streaming",VERSION:"3.12.1",canHandleSource(a,b={}){b=ia(H.options,b);return Ve.canPlayType(a.type,b)},handleSource(a,b,c={}){c=ia(H.options,c);b.vhs=new em(a,b,c);b.vhs.xhr=Sk();b.vhs.setupXhrHooks_();b.vhs.src(a.src,a.type);return b.vhs},canPlayType(a, |
|
b){a=Ni(a);if(!a)return"";b=Ve.getOverrideNative(b);return!va.supportsTypeNatively(a)||b?"maybe":""},getOverrideNative(a={}){({vhs:a={}}=a);const b=!(H.browser.IS_ANY_SAFARI||H.browser.IS_IOS);({overrideNative:a=b}=a);return a}};be("avc1.4d400d,mp4a.40.2")&&H.getTech("Html5").registerSourceHandler(Ve,0);H.VhsHandler=em;H.VhsSourceHandler=Ve;H.Vhs=va;H.use||H.registerComponent("Vhs",va);H.options.vhs=H.options.vhs||{};H.getPlugin&&H.getPlugin("reloadSourceOnError")||H.registerPlugin("reloadSourceOnError", |
|
yr);let xa=class extends fm{constructor(){super();this._defaultConfigs={autoplay:!1,fluid:!1,fullscreen:!1,loop:!1,muted:!1,preload:"auto",responsive:!1,startTime:0};this._prevPlayingState=!1;this.sensorModel=this.element=this.currentMetadata=null;this.state="not-ready";this.waitingTimestamp=null;this._initController=()=>{!this._controller&&this.playerUrl&&(this.element=document.createElement("video"),H.log.level("error"),this._controller=H(this.element,this._defaultConfigs),this._controller.muted(this.muted), |
|
this._controller.loop(this.loop),this._controller.playbackRate(this.rate),this._controller.ready(this._handleReady),this._controller.on("canplay",this._handleCanPlay),this._controller.on("durationchange",this._handleDurationChange),this._controller.on("ended",this._handleEnded),this._controller.on("error",this._handleError),this._controller.on("loadeddata",this._handleDataLoaded),this._controller.on("loadedmetadata",this._handleLoadedMetadata),this._controller.on("loadstart",this._handleLoadStart), |
|
this._controller.on("play",this._handlePlay),this._controller.on("timeupdate",this._handleTimeUpdate),this._controller.on("waiting",this._handleWaiting),this._controller.on("xhr-hooks-ready",this._handleXHRhooksReady))};this._handleReady=()=>{this.state="ready"};this._handleCanPlay=()=>{this._prevPlayingState="playing"===this.state;this.state="can-play"};this._handleCueChange=()=>{if(this.subtitleTrack?.activeCues?.length){var a=this.subtitleTrack?.activeCues[0];a=a.text?JSON.parse(a.text):null;if(a?.data?.length){a= |
|
a.data[0]?.value??[];var b=new Map;for(const c of a)Array.isArray(c.value)?90064===c.tagId?b.set(c.tagId,c):c.value.forEach(e=>{b.set(e.tagId,e)}):b.set(c.tagId,c);b.set(Hd.videoMetadataEntryId.EsriVideoWidth,{name:"Video Width",tagId:Hd.videoMetadataEntryId.EsriVideoWidth,value:this._controller?.videoWidth()});b.set(Hd.videoMetadataEntryId.EsriVideoHeight,{name:"Video Height",tagId:Hd.videoMetadataEntryId.EsriVideoHeight,value:this._controller?.videoHeight()});this.currentMetadata=new Map(b);this.sensorModel= |
|
new km({videoMetadata:this.currentMetadata})}}};this._handleDataLoaded=()=>{this.state="data-loaded";this._set("videoWidth",this._controller?.videoWidth());this._set("videoHeight",this._controller?.videoHeight())};this._handleDurationChange=()=>this.notifyChange("duration");this._handleEnded=()=>{this.loop?(this.setCurrentTime(0),this.play()):(this._set("ended",!0),this.notifyChange("buffered"),this.notifyChange("currentTime"),this.notifyChange("duration"),this.notifyChange("waiting"),this.state= |
|
"can-play")};this._handleError=()=>{gm.getLogger(this).error("video stream error ::",this._controller?.error())};this._handleLoadStart=()=>{this.state="can-play"};this._handleLoadedMetadata=()=>{this.notifyChange("subtitleTrack");this.notifyChange("buffered")};this._handlePlay=()=>this.notifyChange("ended");this._handleTimeUpdate=()=>{this.notifyChange("currentTime");this.notifyChange("buffered");this.notifyChange("bufferedPercent");this._set("videoWidth",this._controller?.videoWidth());this._set("videoHeight", |
|
this._controller?.videoHeight())};this._handleWaiting=()=>{this.waitingTimestamp=this._controller?.currentTime()};this._handleXHRhooksReady=()=>{const a=b=>{b.xhr=new im.XHRAdapter;return b};this._controller?.tech(!0)?.vhs.xhr.onRequest(a)}}initialize(){this.addHandles([Gd.watch(()=>this.playerUrl,a=>{a&&(this._initController(),this._controller?.src({type:"application/x-mpegURL",src:this.playerUrl}))},Gd.initial),Gd.watch(()=>this.subtitleTrack,()=>{this.subtitleTrack&&(this.subtitleTrack.mode="showing")})]); |
|
this.addHandles(Gd.on(()=>this.subtitleTrack,"cuechange",this._handleCueChange))}destroy(){this._controller?.dispose()}get buffered(){return this._controller?.bufferedEnd()??0}get bufferedPercent(){return this._controller?.bufferedPercent()??0}get currentTime(){return this._controller?.currentTime()??0}get duration(){return this._controller?.duration()??0}get ended(){return this._controller?.ended()??this._get("ended")??!0}set ended(a){this._controller?.ended(a);this._set("ended",a)}get loop(){return this._controller?.loop()?? |
|
this._get("loop")??!1}set loop(a){this._controller?.loop(a);this._set("loop",a)}get muted(){return this._controller?.muted()??this._get("muted")??!1}set muted(a){this._controller?.muted(a);this._set("muted",a)}get playerUrl(){return this._controller?.src()||""}set playerUrl(a){this._set("playerUrl",a)}get playing(){return this.ended?!1:"can-play"===this.state?this._prevPlayingState:"playing"===this.state}get rate(){return this._controller?.playbackRate()??this._get("rate")??1}set rate(a){this._controller?.playbackRate(a); |
|
this._set("rate",a)}get started(){return this._controller?.hasStarted()||!1}get subtitleTrack(){const a=this._controller?.textTracks();return a?.length?Array.from(a).find(b=>"subtitles"===b.kind):null}get waiting(){return this.waitingTimestamp?!1:this.waitingTimestamp!==this.currentTime?(this.waitingTimestamp=null,!1):!0}pause(){this._controller?.pause();this.state="paused"}play(){this._controller?.play();this.state="playing"}reset(){this._controller&&(this.pause(),this.setCurrentTime(0),this._set("ended", |
|
!0))}setCurrentTime(a){a=hm.clamp(a,0,this.duration);this._controller?.currentTime(a);this.notifyChange("currentTime")}};ya.__decorate([Aa.property()],xa.prototype,"buffered",null);ya.__decorate([Aa.property()],xa.prototype,"bufferedPercent",null);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"currentTime",null);ya.__decorate([Aa.property()],xa.prototype,"currentMetadata",void 0);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"duration",null);ya.__decorate([Aa.property()],xa.prototype, |
|
"element",void 0);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"ended",null);ya.__decorate([Aa.property()],xa.prototype,"loop",null);ya.__decorate([Aa.property()],xa.prototype,"muted",null);ya.__decorate([Aa.property()],xa.prototype,"playerUrl",null);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"playing",null);ya.__decorate([Aa.property()],xa.prototype,"rate",null);ya.__decorate([Aa.property()],xa.prototype,"sensorModel",void 0);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype, |
|
"started",null);ya.__decorate([Aa.property()],xa.prototype,"state",void 0);ya.__decorate([Aa.property()],xa.prototype,"subtitleTrack",null);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"videoHeight",void 0);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"videoWidth",void 0);ya.__decorate([Aa.property({readOnly:!0})],xa.prototype,"waiting",null);ya.__decorate([Aa.property()],xa.prototype,"waitingTimestamp",void 0);return xa=ya.__decorate([jm.subclass("esri.layers.video.VideoController")], |
|
xa)}); |