@castlabs/prestoplay 6.22.0 → 6.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +116 -116
- package/cjs/cl.conviva.js +32 -33
- package/cjs/cl.core.js +592 -590
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +86 -80
- package/cjs/cl.externs.js +43 -36
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +71 -70
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +342 -328
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +86 -86
- package/cl.conviva.js +27 -27
- package/cl.core.js +474 -472
- package/cl.crypto.js +9 -9
- package/cl.dash.js +80 -75
- package/cl.externs.js +43 -36
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +16 -16
- package/cl.mse.js +303 -290
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +27 -26
- package/package.json +1 -1
- package/typings.d.ts +53 -6
package/cjs/cl.mse.js
CHANGED
|
@@ -1,336 +1,350 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
_.
|
|
11
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
12
|
-
b,d||null,e,a,c)};_.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.
|
|
16
|
-
|
|
17
|
-
_.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
_.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
ME=function(a,b){
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
b,a.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
2
|
+
var f=function(window){var uC,vC,wC,xC,yC,zC,AC,BC,CC,DC,EC,FC,GC,HC,IC,JC,KC,LC,MC,NC,OC,PC,QC,RC,SC,TC,UC,VC,WC,XC,YC,ZC,$C,aD,bD,cD,dD,eD,fD,hD,jD,kD,lD,mD,nD,oD,pD,qD,rD,sD,tD,uD,wD,xD,yD,zD,AD,BD,CD,ED,HD,ID,KD,LD,MD,ND,OD,PD,QD,SD,UD,VD,$D,aE,bE,cE,dE,eE,fE,hE,lE,mE,oE,pE,qE,rE,tE,vE,wE,yE,zE,AE,CE,DE,EE,FE,GE,HE,IE,JE,KE,ME,RE,XE,bF,eF,UE,dF,fF,gF,hF,iF,jF,kF,lF,mF,nF,rF,tF,uF,vF,sF,xF,wF,yF,zF,CF,DF,EF,BF,AF,FF,JF,LF,IF,MF,HF,KF,GF,OF,NF,PF,QF,RF,UF,VF,WF,XF,ZF,$F,bG,dG,cG,aG,eG,hG,fG,gG,iG,jG,kG,lG,mG,oG,pG,qG,
|
|
3
|
+
rG,sG,uG,vG,wG,yG,zG,xG,AG,BG,CG,DG,EG,FG,GG,HG,IG,LG,OG,PG,SG,RG,TG,UG,YG,WG,$G,aH,bH,dH,cH,eH,gH,fH,mH,nH,jH,hH,kH,lH,oH,pH,sH,rH,tH,uH,vH,iH,wH,qH,zH,AH,CH,BH,DH,FH,EH,GH,JH,HH,IH,LH,KH,MH,NH,OH,RH,TH,SH,VH,UH,XH,YH,ZH,bI,aI,$H,cI,eI,dI,fI,gI,hI,iI,jI,kI,nI,mI,lI,pI,oI,rI,vI,xI,yI,DI,GI,II,KI,sI,MI,PI,QI,RI,TI,UI,WI,XI,ZI,LI,aJ,BI,cJ,bJ,zI,JI,fJ,dJ,YI,$I,hJ,gJ,eJ,oJ,pJ,jJ,rJ,kJ,mJ,uJ,tJ,nJ,sJ,vJ,AI,VI,wJ,xJ,lJ,SI,CI,EI,uI,iJ,FI,qJ,NI,OI,yJ,BJ,CJ,DJ,EJ,FJ,IJ,JJ,HJ,lK,mK,tK,GJ,sK,uK,nK,oK,pK,zK,
|
|
4
|
+
vK,jK,iK,hK,kK,xK,yK,qK,rK,KK,EK,NK,OK,PK,TK,QK,JG,NG,KG,bL,QG,MG,$K,YK,cL,LK,JK,SK,aL,ZK,eL,RK,VK,BK,UK,fL,IK,gL,hL,kL,MK,HK,jL,iL,wK,dL,XK,mL,FK,WK,lL,gK,nL,DK,CK,oL,pL,qL,rL,sL,tL,uL,vL,wL;uC=" and the media start time is ";vC=" between media times and segment times for ";wC=" buffer";xC=" buffer. Range:";yC=" is being or has been set up";zC=" range:";AC=" seconds";BC=" with element state: ";CC=". Adjusting timestampOffset.";DC=". The segment start time is ";EC="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";
|
|
5
|
+
FC="\x3c/LA_URL\x3e";GC="\x3cLA_URL\x3e";HC='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';IC="Aborting operations for ";JC="Appended audio segment ";KC="Appended video segment ";LC="Appending data to ";MC="Buffer:";NC="Cannot get segment, period ID unknown";OC="Choosing new streams after key status change";PC="Detected a delta of ";QC="Done Aborting operations for ";RC="Done Appending data to ";SC="Done Flushing buffer for ";TC="Done Removing data from ";
|
|
6
|
+
UC="Done Setting append window for ";VC="Done Setting timestamp offset for ";WC="Failed to abort operations for ";XC="Failed to append data for ";YC="Failed to flush buffer for ";ZC="Failed to remove data from ";$C="Failed to set append window for ";aD="Failed to set timestamp offset for ";bD="Flushing buffer for ";cD="IterateSegmentReference";dD="Jumping forward";eD="MediaSource threw QuotaExceededError:";fD="No more scheduled operations for ";_.gD="No stream with id";hD="Period not found.";
|
|
7
|
+
_.iD="Player is in ERROR state and can not switch to ";jD="PrestoPlay TextTrack";kD="QuotaExceededError";lD="Removing audio from variant - audio not compatible with platform";mD="Removing data from ";nD="Reset transmuxers.";oD="Setting append window for ";pD="Setting playback rate to\x3d";qD="Setting timestamp offset for ";rD="Skip buffer flush for ";sD="Starting next operation for ";tD="URI-REPLACEMENT";uD="Update-End received for ";_.vD="Updating manifest...";wD="X-Playback-Session-Id";xD="bufferBehind\x3d";
|
|
8
|
+
yD="bufferedBehind\x3d";zD="calling onCanSwitch()...";AD="cannot find segment";BD="clpp.mse.Player";CD="currentPeriod.startTime\x3d";_.DD="dashif:Laurl";ED="failed to get buffered range for ";_.FD="getSegmentNextReference";_.GD="iterateSegmentReference";HD="key-restriction";ID="manifest.start";_.JD="onChooseStreams_";KD="presentationTime:";LD="presentationTime\x3d";MD="reference.endTime\x3d";ND="reference.position\x3d";OD="reference.startTime\x3d";PD="sourceopen";QD="startstreaming";_.RD="subtitles";
|
|
9
|
+
SD="switch: Stream ";_.TD=function(a,b){return _.dh[a]=b};UD=function(a,b){for(var c in a.a)b(c,a.a[c])};VD=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.jn(a);)if(0===_.ln(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.T.ba(a)};_.XD=function(a){var b=new Uint8Array(WD),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.en(c,!1);_.W(d,c);_.gn(d,b);_.gn(d,a.j);_.W(d,a.f.byteLength);_.gn(d,a.f);return _.Hj(d.buffer)};
|
|
10
|
+
_.YD=function(a,b,c,d){var e=_.Uj(b);if(8!==e.byteLength)e="";else{var f=_.Yo(e);e=_.Rj(f);b:switch(f=f.byteLength,_.Oh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[HC+a+'"\x3e',"\x3cDATA\x3e\x3cPROTECTINFO\x3e","\x3cKEYLEN\x3e"+f+"\x3c/KEYLEN\x3e","\x3cALGID\x3eAESCTR\x3c/ALGID\x3e\x3c/PROTECTINFO\x3e","\x3cKID\x3e"+e+"\x3c/KID\x3e",c?"\x3cCHECKSUM\x3e"+c+"\x3c/CHECKSUM\x3e":"",d?GC+d+FC:"",EC].join("");break b;case "4.1.0.0":e=[HC+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
11
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?GC+d+FC:"",EC].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[HC+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKIDS\x3e\x3cKID ALGID\x3d"AESCTR" ',c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/KIDS\x3e\x3c/PROTECTINFO\x3e",d?GC+d+FC:"",EC].join("");break b;default:_.Jh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Oh("New payload",e);e=_.Hj(_.T.zf(e,!0));return new _.Uo(_.Zo,
|
|
12
|
+
b,d||null,e,a,c)};_.ZD=function(a,b){return b===a.version?a:_.YD(b,a.a,a.l||void 0,a.h||void 0)};$D=function(a,b){a:{if(b){var c=_.w(a.h.keys());for(var d=c.next();!d.done;d=c.next()){d=a.h.get(d.value);for(var e=0;e<d.qb.length;e++)if(d.qb[e]===b){c=d;break a}}}c=null}return c?c.lb:null};aE=function(a,b){if(_.Cl("Edge/"))return!0;b=b.toLowerCase();if(_.wk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.oe);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
13
|
+
bE=function(a,b){var c=a.o.get(b);return!(!c||c!==_.jf&&c!==_.Be)};cE=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Lp(c),!aE(a,c))||d&&d.encrypted&&(d=_.Lp(d),!aE(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};dE=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};eE=function(a){a=dE(a,_.uw);return null==a?null:a};
|
|
14
|
+
fE=function(a,b){if(a.a.length)if(0>b)a.f=0;else{for(var c=0,d=a.a[c]||null;d&&b>d.Yb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.gE=function(a,b){return a.concat(b)};hE=function(){};_.iE=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Zi(d)});return a.map(function(d){return new _.Zi(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.gE,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.jE=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.kE=function(a,b,c,d,e,f,g){f=void 0===f?"":f;this.$a=a;this.Ca=b;this.oa=c;this.keyInfo=d||null;this.jd=_.N.R(e)?!1:!!e;this.te=f;this.Qa=g};lE=function(a,b){a=_.yj(a);b=_.yj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
mE=function(a){return a.language?_.yj(a.language):a.audio&&a.audio.language?_.yj(a.audio.language):a.video&&a.video.language?_.yj(a.video.language):_.xg};
|
|
17
|
+
_.nE=function(a,b){for(var c=_.yj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.yj(f.value));e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,lE(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.yj(g);h=_.yj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.w(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,lE(c,e))return e;return null};
|
|
18
|
+
oE=function(a,b){for(var c=0,d=_.w(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};pE=function(a,b){var c=_.sl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};qE=function(a){for(var b=[a.mimeType],c=_.w(_.dw),d=c.next();!d.done;d=c.next()){var e=_.w(d.value);d=e.next().value;e=e.next().value;d=a[d];null!=d&&b.push(e.trim()+'\x3d"'+String(d).trim()+'"')}return b.join(";").replace(/\s/g,"")};
|
|
19
|
+
rE=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.sE=function(a){var b=[];a=_.w(a.split(/\s*,\s*/));for(var c=a.next();!c.done;c=a.next()){c=c.value.split(".");var d=c[0];c.shift();b.push(d)}return b.sort().join(",")};tE=function(a,b){for(var c=new _.wm(void 0,void 0===b?"total":b),d=_.w(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};
|
|
20
|
+
_.uE=function(a,b,c,d,e,f){this.tagName=a;this.textContent=b;this.attributes=c;this.childNodes=d;this.localName=e;this.a=f};
|
|
21
|
+
vE=function(a){return-1===a.indexOf("\x26")?a:a.replace(/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,function(b){switch(b){case "\x26amp;":return"\x26";case "\x26lt;":return"\x3c";case "\x26gt;":return"\x3e";case "\x26quot;":return'"';case "\x26apos;":return"'";case "\x26nbsp;":return"\u00a0";case "\x26lrm;":return"\u200e";case "\x26rlm;":return"\u200f";default:return"#"===b[1]?(b="x"===b[2]||"X"===b[2]?parseInt(b.slice(3),16):parseInt(b.slice(2),10),String.fromCodePoint(b)):b}})};
|
|
22
|
+
wE=function(a){function b(h,l){return new _.uE(void 0===l?_.da:l,h,{},[],null,g)}function c(h){h=void 0===h?"":h;for(var l=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){var m=e+2;e=a.indexOf("\x3e",e);if(!a.startsWith(h,m))throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(63===a.charCodeAt(e+1)){e=a.indexOf("\x3e",e);e++;continue}else if(33===a.charCodeAt(e+1)){if(45==
|
|
23
|
+
a.charCodeAt(e+2)){for(;-1!==e&&(62!==a.charCodeAt(e)||45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf("\x3e",e+1);-1===e&&(e=f)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&a.startsWith("CDATA",e+3)){m=a.indexOf("]]\x3e",e);-1==m?(l.push(b(a.substr(e+9),"#cdata")),e=f):(l.push(b(a.substring(e+9,m),"#cdata")),e=m+3);continue}else{m=e+1;e+=2;for(var n=!1;(62!==a.charCodeAt(e)||!0===n)&&a[e];)91===a.charCodeAt(e)?n=!0:!0===n&&93===a.charCodeAt(e)&&(n=!1),e++;l.push(b(a.substring(m,
|
|
24
|
+
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var u="",v=a.charCodeAt(e);39!==v&&34!==v;)e++,v=a.charCodeAt(e);if(39===v||34===v){if(u=e+1,e=a.indexOf(a[e],u),u=a.slice(u,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=u;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(u,q[1])}e++}q=[];u=a.charCodeAt(e-1);e++;47!==u&&(q=c(m));l.push(new _.uE(m,
|
|
25
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=vE(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var h=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(h,e)}var e=0,f=a.length,g=new Map;return new _.uE("#document",null,{},c(""),null,g)};_.xE=function(){};
|
|
26
|
+
yE=function(a){switch(a){case _.Dm:_.tw.info("Select DOM parser for XML");_.Vo=new _.Oo;break;case "txml":_.tw.info("Select TXML parser for XML");_.Vo=new _.xE;break;default:_.tw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.Vo=new _.Oo}};zE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};AE=function(a,b){return a.start-b.start};
|
|
27
|
+
_.BE=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};CE=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};DE=function(a){a.player&&(a.player.off(_.Uf,a.bd),a.a&&a.player.off(_.tg,a.bd));a.player=null};EE=function(a){a.player&&a.player.trigger(new _.L(_.ed))};FE=function(a){a.player&&a.player.trigger(new _.L(_.ed))};
|
|
28
|
+
GE=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.tg,a.bd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.tg,a.bd),a.a=!1)}};HE=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.Mg))};
|
|
29
|
+
IE=function(a,b){for(var c=null,d=_.w(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};JE=function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&(b.add(c.video),c.video.trickModeVideo&&b.add(c.video.trickModeVideo))});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return b};KE=function(a,b){for(var c=0;c<a.length;c++)if(JE(a[c]).has(b))return c;return-1};
|
|
30
|
+
ME=function(a,b){Array.from(JE(a)).forEach(function(c){c.segmentIndex&&_.LE(c.segmentIndex,b)})};_.NE=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.OE=function(a,b,c){var d=Math.pow(a.h,b);c=c*(1-d)+d*a.a;isNaN(c)||(a.a=c,a.f+=b)};_.PE=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
31
|
+
_.QE=function(a,b,c,d,e,f,g,h){a=_.gk(a);a.timeout=d.timeout;a.maxAttempts=d.maxAttempts;a.baseDelay=d.baseDelay;a.fuzzFactor=d.fuzzFactor;a.backoffFactor=d.backoffFactor;if(0!==b||null!=c)a.headers.Range=c?"bytes\x3d"+b+"-"+c:"bytes\x3d"+b+"-";e&&(a.startTime=e);f&&(a.endTime=f);g&&(a.contentType=g);h&&(a.timescale=h);return a};RE=function(a){this.a=this.h=0;this.f=a};_.SE=function(a,b,c){a.h=b;a.a=c};
|
|
32
|
+
_.TE=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.o=this.w=null;this.I=0;this.C=this.l=d;this.M=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new RE(d);this.J=null;this.B=this.j.type||null};_.VE=function(a,b){a.L={offsetDateTime:b-UE(a),seekRangeStartDateTime:b}};_.WE=function(a,b){a.l=b;a.C=b;a.a.f=b};XE=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
33
|
+
_.$E=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.YE(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.ZE(a,d);null!=a.G&&a.M&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.YE=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.ZE=function(a,b){a.o=Math.max(a.o||0,b)};_.aF=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
34
|
+
_.cF=function(a){return 2===a.j.version?a.a.Yb():Infinity===a.A?0:Math.max(0,bF(a)-a.A)};bF=function(a){if(2===a.j.version)a=a.a.a;else if(a.l)a=a.f;else if(a.C)a=a.o||0;else{if("startover"===a.B)var b=a.J||0;else b=(Date.now()+a.I)/1E3,b=a.P?Math.max(0,b-(a.h-a.H)-a.G):Math.max(0,b-a.h-a.G);a=Math.min(b,a.f)}return a};eF=function(a,b){if(2===a.j.version)return a.a.Yb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(bF(a)-a.A+b,dF(a)))};
|
|
35
|
+
UE=function(a){return 2===a.j.version?a.a.Yb():eF(a,0)};dF=function(a){var b=a.le()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,bF(a)-b)};fF=function(a,b){var c=(void 0===b?0:b)?a.offset:0;return{schemeIdUri:a.schemeIdUri,configurationId:a.configurationId,value:a.value,startTime:a.startTime+c,endTime:a.endTime+c,id:a.id,eventElement:a.eventElement,type:a.type,customAttributes:a.customAttributes}};gF=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
36
|
+
hF=function(a,b,c){a.f=b;a.h=c};iF=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Qc:e.Qc},g=f.next())e.Qc=g.value,a.a.has(e.Qc)||(c.push(e.Qc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Qc.id}}(e)),e.Qc.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(h){return a.a.add(h)});f=a.a.size;c.forEach(function(h){return a.f(h)});(d||0<c.length||e!==f)&&a.h()};
|
|
37
|
+
jF=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return fF(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};kF=function(a,b,c,d){this.a=a;this.h=null;this.j=b;this.f=c;this.o=d;"flat"===d.timeline&&d.cropTimeline&&(a=d.startTime||0,this.j.a=new _.Hu("crop",a,d.endTime?d.endTime-a:Infinity,!1))};lF=function(a){var b=a.a.ci(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Xf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
38
|
+
mF=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};nF=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.$a().length&&a.f>=b.a.length&&(a.a+=1,a.f=0,b=a.h.get(a.a));return b&&0<b.a.length?b.a[a.f]||null:b};_.oF=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.pF=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.qF=function(a,b){for(var c=0;c<a.a.length;++c)if(a.a[c].endTime>b)return a.a.splice(0,c);c=a.a;a.a=[];return c};
|
|
39
|
+
rF=function(a,b){var c=a.dd(b);c=null===c?-1:c-1;var d=a.get(c+1),e=-1;if(d&&0<d.a.length)for(var f=d.a.length-1;0<=f;--f){var g=d.a[f];if(b>=g.startTime&&b<g.endTime){for(;f&&!g.h;)--f,g=d.a[f];if(!g.h)break;c+=1;e=f-1;break}}return new mF(a,c,e)};_.LE=function(a,b){for(;a.a.length;)if(0>=a.a[0].endTime)a.a.shift();else break;0===a.a.length||a.a[a.a.length-1].startTime>=b||(a.a[a.a.length-1].endTime=b)};
|
|
40
|
+
tF=function(a,b){this.h=a;this.l=sF(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};uF=function(a,b){a.f=b};vF=function(a){this.a=a};sF=function(a){if(a.a.paused||0===a.a.playbackRate||0===a.a.buffered.length)var b=!1;else a:{b=a.a.buffered;a=a.a.currentTime;for(var c=0;c<b.length;c++){var d=b.start(c),e=b.end(c);if(!(a<d-.1||a>e-(c+1===b.length?.5:.1))){b=!0;break a}}b=!1}return b};
|
|
41
|
+
xF=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Yh;this.C=!1;this.J=a.readyState;this.j=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.h.on(a,_.Rg,function(){return wF(f)});this.w=(new _.yl(function(){wF(f)})).Eb(.25)};
|
|
42
|
+
wF=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.C)return}else a.C=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.j=!1,a.J=a.a.readyState);var b=a.l.smallGapLimit,c=a.a.currentTime,d=a.a.buffered;a:{var e=new _.wm(d);var f=a.l.gapDetectionThreshold;if(e.length&&!(1===e.length&&1E-6>e.end(0)-e.start(0)))for(var g=0;g<e.length;g++)if(e.start(g)>c&&(0===g||e.end(g-1)-c<=f)){e=g;break a}e=null}if(null==e){if(a.f){a=a.f;d=a.h;c=sF(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
43
|
+
b,a.a=d,a.l=c;d=b-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==e||a.A)&&a.I&&(f=d.start(e),!(f>=dF(a.H)))){g=f-c;b=g<=b;var h=!1;if(!(.001>g)){if(!b&&!a.j){a.j=!0;var l=new _.L("largegap",{detail:{currentTime:c,gapSize:g}});l.cancelable=!0;a.G(l);a.l.jumpLargeGaps&&!l.defaultPrevented?h=!0:_.Nh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Nh(dD,g,"seconds because of gap before start time of",f):_.Nh(dD,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
44
|
+
yF=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.yl(function(){0>=b.j?(_.Jh(["Failed to move playhead from",b.h,"to",b.l].join(" ")),b.a.stop()):b.f.currentTime!==b.h?b.a.stop():(b.f.currentTime=b.l,b.j--)})};zF=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Eb(.1)};CF=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Yh;this.h=new yF(a);this.w=!1;0<a.readyState?AF(this,c):BF(this,c)};
|
|
45
|
+
DF=function(a){return a.l?a.a.currentTime:a.A};EF=function(a,b){0<a.a.readyState?zF(a.h,b):BF(a,b)};BF=function(a,b){a.A=b;a.f.off(a.a,_.Me);a.f.one(a.a,_.Me,function(){AF(a,b)})};AF=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?FF(a):(a.f.one(a.a,_.ag,function(){FF(a)}),zF(a.h,0===a.a.currentTime?b:a.a.currentTime))};FF=function(a){_.El()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.ag,function(){return a.j()})};
|
|
46
|
+
JF=function(a,b,c,d,e,f,g){var h=this;this.h=a;this.a=b.presentationTimeline;this.B=b.minBufferTime||0;this.l=c;this.A=e;this.w=null;this.j=new xF(a,b.presentationTimeline,c,GF(this,a,c),f);this.f=new CF(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=DF(h.f);var n=HF(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;EF(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},IF(this,d,g),function(){h.j.I=!0});this.o=(new _.yl(function(){if(0!==
|
|
47
|
+
h.h.readyState&&!h.h.paused){var l=DF(h.f),m=UE(h.a),n=dF(h.a);3>n-m&&(m=n-3);l<m&&(m=HF(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).Eb(.25);this.g=new _.K("clpp.mse.Playhead")};LF=function(a){var b=DF(a.f);return 0<a.h.readyState&&!a.h.paused?KF(a,b):b};IF=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?UE(a.a):dF(a.a):0>b&&(b=dF(a.a)+b);return MF(a,KF(a,b))};
|
|
48
|
+
MF=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
49
|
+
HF=function(a,b){if("startover"===a.a.B)return b;var c=new _.wm(a.h.buffered);c=c.Nb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=UE(a.a),g=dF(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=eF(a.a,d),m=eF(a.a,e);d=eF(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),MF(a,b);if(b>g)return a.g.debug("Playhead past end."),g;if(b<f){if(c(m))return a.g.debug("Playhead before start \x26 start is buffered"),m;a.g.debug("Playhead before start \x26 start is unbuffered");
|
|
50
|
+
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};KF=function(a,b){var c=UE(a.a);if(b<c)return c;c=dF(a.a);return b>c?c:b};
|
|
51
|
+
GF=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new tF(new vF(b),c.stallThreshold);uF(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.wm(b.buffered),l;if(l=_.Cl("Edge/")||_.Cl("Trident/")||_.wk()||_.El())a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){l=h.start(l+1)-h.end(l)>=d;break a}l=!1}if(l){a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){h=
|
|
52
|
+
h.start(l+1)-f;break a}h=null}h&&(e=Math.min(h+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};OF=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.yl(function(){NF(b,!1)})).Eb(.25)};NF=function(a,b,c){c=void 0===c?0:c;for(var d=_.w(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
53
|
+
PF=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
54
|
+
QF=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Oc:null,Nc:2,Gc:function(c,d){return b.a(c,d)}},{Oc:1,Nc:2,Gc:function(c,d){return b.a(c,d)}},{Oc:3,Nc:2,Gc:function(c,d){return b.a(c,d)}},{Oc:2,Nc:1,Gc:function(c,d){return b.f(c,d)}},{Oc:2,Nc:3,Gc:function(c,d){return b.f(c,d)}},{Oc:1,Nc:3,Gc:function(c,d){return b.h(c,d)}},{Oc:3,Nc:1,Gc:function(c,d){return b.h(c,d)}}]};RF=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
55
|
+
_.SF=function(a){_.Nu[a]&&delete _.Nu[a]};_.TF=function(a){_.Lu[a]&&delete _.Lu[a]};UF=function(){this.f=new _.NE(2);this.h=new _.NE(5);this.a=0};VF=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.OE(a.f,b,d);_.OE(a.h,b,d)}};WF=function(a,b){return 128E3>a.a?b:Math.min(_.PE(a.f),_.PE(a.h))};
|
|
56
|
+
XF=function(a,b){if(typeof a!==typeof b||a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c].serviceLocationId!==b[c].serviceLocationId||a[c].uri!==b[c].uri||a[c].params!==b[c].params)return!1;return!0};_.YF=function(a,b){this.id=a;this.ua=b};ZF=function(a,b){return a.ua.map(function(c){var d=new URL(c.uri+b);if(c.params){c=_.w(Object.entries(c.params));for(var e=c.next();!e.done;e=c.next()){var f=_.w(e.value);e=f.next().value;f=f.next().value;d.searchParams.set(e,f)}}return d.toString()})};
|
|
57
|
+
$F=function(a,b){_.xm.call(this);this.A=a;this.h=null;this.B=b;this.C=new _.tk;this.f=300;this.o=new Map;this.l=new Map;this.w=new Map;this.j=new Map;this.a=null;this.g=new _.K("clpp.net.ContentSteeringManager")};
|
|
58
|
+
bG=function(a,b){return _.I(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,Rh:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Rh.length)for(var f=
|
|
59
|
+
{},g=_.w(a.h.Rh),h=g.next();!h.done;f={He:f.He},h=g.next())f.He=h.value,(h=d.ua.find(function(l){return function(m){return m.serviceLocationId===l.He}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.He+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.ua);a.o.set(d.id,d.ua)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](aG(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);aG(a)}_.B(c)})};
|
|
60
|
+
dG=function(a,b){var c=a.l.get(b);if(!c)return a.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+b+"."),null;var d=Date.now();a.j.forEach(function(f,g){f.Jd&&d>f.Jd&&(f.Jd=0,a.trigger(new _.L(_.Td,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===cG(a,f.serviceLocationId).Jd});e.length||(e=c);e.length&&(c=a.w.get(b),XF(e,c)||(c={baseUriCollectionId:b,from:c||[],to:e},a.g.info("Steering server update baseUriCollectionId: "+c.baseUriCollectionId+
|
|
61
|
+
" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),a.trigger(new _.L(_.Sd,{detail:c})),a.w.set(b,e)));return new _.YF(b,e)};cG=function(a,b){var c=a.j.get(b);c||(c={Jd:0,nh:new UF,vf:!1},a.j.set(b,c));return c};
|
|
62
|
+
aG=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=eG(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.gk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.uk(a.C,e),_.y(m,e.T,2);f=m.f;if(410===f.status)a.g.info(" Content steering server not available(HTTP response 410), stopping updates."),null!=a.a&&(a.a.stop(),a.a=null);else if(429===f.status){a.g.info("Content steering server overloaded (HTTP response 429).");
|
|
63
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;fG(a,a.f)}else try{h=_.T.ba(f.data),l=JSON.parse(h),1===l.VERSION?gG(a,l,f.uri):a.g.warn("Received unsupported steering manifest version: "+l.VERSION+", ignoring it and stop requesting.")}catch(n){a.g.error("requestInfo_: error parsing received steering manifest:",n);if(n&&7001===n.code)return m["return"]();null!=a.a&&(a.a.stop(),a.a=null);a.a=new _.yl(function(){aG(a)});fG(a,a.f)}_.B(m)})};
|
|
64
|
+
eG=function(a,b){var c=new _.Zi(b),d=[],e=[];a.j.forEach(function(g,h){g.vf&&(d.push(h),e.push(parseInt(WF(g.nh,1E4),10)));g.vf=!1});if(d.length){var f=c.a;a.h.manifestType===_.Sc?(f.add("_DASH_pathway",'"'+d.toString()+'"'),f.add("_DASH_throughput",e.toString())):a.h.manifestType===_.hm&&(f.add("_HLS_pathway",'"'+d.toString()+'"'),f.add("_HLS_throughput",e.toString()));_.kj(f);f.h&&_.cj(c,f)}else a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
65
|
+
hG=function(a,b,c,d){var e=[],f=a.o.get(b)||[];if(!c.length)return a.l.get(b);a={};c=_.w(c);for(b=c.next();!b.done;a={Ed:a.Ed,Sb:a.Sb,yd:a.yd},b=c.next())if(a.Ed=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.Ed}}(a)))e.push(b);else if(a.Sb=d.find(function(g){return function(h){return h.ID===g.Ed}}(a)),a.Sb&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Sb["BASE-ID"]}}(a))))a.yd={serviceLocationId:a.Ed,uri:b.uri,params:{}},a.Sb[tD]&&(a.Sb[tD].HOST&&
|
|
66
|
+
(b=new _.Zi(b.uri),_.aj(b,a.Sb[tD].HOST),a.yd.uri=b.toString()),a.Sb[tD].PARAMS&&Object.entries(a.Sb[tD].PARAMS).forEach(function(g){return function(h){var l=_.w(h);h=l.next().value;l=l.next().value;g.yd.params[h]=l}}(a))),e.push(a.yd);return e};fG=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ea(b)};
|
|
67
|
+
gG=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.yl(function(){aG(a,d)});if(c=b.TTL)a.f=c;fG(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,h){e.includes(h)||a.j["delete"](h)});a.o.forEach(function(g,h){var l=hG(a,h,e,f);a.l.set(h,l)})};iG=function(a,b){this.w=null;this.C=a;this.j=b;this.h=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
68
|
+
jG=function(a,b){if(b!==_.Rc){var c=_.hv[b];if(!c)throw new _.P(_.Q,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};kG=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.Hj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Hj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.h&&g.startTime<a.l});a.j.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.h));a.f=Math.min(d,a.l)}})};
|
|
69
|
+
lG=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.w(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.j.append(e,[])};
|
|
70
|
+
mG=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.w(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.h&&l.startTime<a.l&&(l=new _.Ni(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.j.append([l],[]))}e=_.w(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.w(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
71
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.h):Math.min(a.a,Math.max(c,a.h));a.f=Math.max(a.f,Math.min(d,a.l))};_.nG=function(a){a=a.toLowerCase();return _.hv[a]||window.muxjs&&a===_.Rc?!0:!1};
|
|
72
|
+
oG=function(a,b){var c=String(_.Nk++);c=new _.Hk(c,a);c.mimeType=_.Ik(b.mimeType);if(a===_.U||a===_.Jk)c.label=_.Ik(b.label),c.language=_.Ik(b.language),c.originalLanguage=_.Ik(b.originalLanguage);a===_.Kk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.Jk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Ik(b.audioMimeType)):(c.kind=_.Ik(b.kind),c.roles=b.roles);c.accessibility=a===_.Kk||a===_.Jk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
66
73
|
a}):b.accessibility||[];return c};
|
|
67
|
-
|
|
68
|
-
c.renditions.push(d);return a||d};
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
a[0].presentationTimeline.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
74
|
+
pG=function(a,b,c){var d=new _.Qk(a===_.Kk?""+b.videoId:a===_.Jk?""+b.audioId:""+b.id,c);switch(a){case _.Kk:d.codec=_.Ik(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.Jk:d.codec=_.Ik(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.Ik(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.N.pa(e,d,null,["id","track"])}))||
|
|
75
|
+
c.renditions.push(d);return a||d};qG=function(a,b){var c=a.reduce(function(d,e){b===_.Kk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.Jk&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};rG=function(a,b){if(void 0!==b&&null!==b){var c=a.filter(function(d){return d.audio&&d.audio.id===b});if(0<c.length)return c}return a};
|
|
76
|
+
sG=function(a,b,c){function d(f,g){return null==f?null==g:g.id===f}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null};_.tG=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};uG=function(a){var b=a.periods[0].startTime;a=a.periods[a.periods.length-1].endTime;if(null==a)throw Error("Period end time must be known");return{start:b,end:a}};vG=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
77
|
+
wG=function(a,b){if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)return a[0];a[0].cues.forEach(function(f){f.offset=0});for(var c=_.gh(a[0].periods).concat(),d={},e=1;e<a.length;d={Ie:d.Ie},e++)d.Ie=uG(a[e-1]).end,_.tG(a[e].periods,d.Ie),c.push.apply(c,_.gh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.Ie}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=uG(c).end;_.SE(b.a,0,d);(d=
|
|
78
|
+
a[0].presentationTimeline.Ec())&&_.VE(b,d.seekRangeStartDateTime);return c};yG=function(a,b){try{if(1===a.length)return a[0];if(!a.every(xG))throw new _.Ui("Period durations must be finite");return wG(a,b)}catch(c){throw new _.P(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
79
|
+
zG=function(a,b){var c=b.periods[0].configurationId,d=_.gh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.WE(e,b.presentationTimeline.l);return yG([d,b],e)};xG=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
80
|
+
AG=function(a){return{id:a.id,bandwidth:a.bandwidth,trickPlay:a.video?a.video.trickPlay:!1,width:a.video?a.video.width:void 0,height:a.video?a.video.height:void 0}};BG=function(a,b){return b.find(function(c){return c.id===a.id})||null};CG=function(){this.g=new _.K("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};DG=function(a,b){return a.h.filter(function(c){return c.type===b})};EG=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
81
|
+
FG=function(a,b,c){if(!c||EG(a,c.type)!==c||a.m.wa())switch(c=c?c.renditions[0]||null:null,b){case _.Kk:a.ob(c);break;case _.Jk:a.Bb(c);break;case _.U:a.Cb(c);break;default:throw Error("Unknown track type "+b);}};GG=function(a,b){a.a.set(b.track.type,b);b===(a.f.get(b.track.type)||null)&&a.f.set(b.track.type,null)};HG=function(a,b,c){return a.m.wa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
82
|
+
IG=function(a,b,c){if(0>a.h.indexOf(b.track))throw Error("Unknown rendition with ID "+b.id);if(c!==b.track.type)throw Error("Types mismatch");};
|
|
83
|
+
LG=function(a,b,c){IG(a,b,_.Kk);if(HG(a,b,_.Kk)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.Jk)||null,f=null;if(e){var g=JG(d).filter(function(l){return l.videoId===parseInt(b.id,10)});f=g.find(function(l){return l.audioId===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var h=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return h.find(function(m){return m===
|
|
84
|
+
l.audioId})})||null}}else f=JG(d).find(function(l){return l.videoId===parseInt(b.id,10)})||null;f?(a.f.set(_.Kk,b),KG(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
85
|
+
OG=function(a,b){var c,d,e;_.I(function(f){if(1==f.a){c=_.U;IG(a,b,c);if(!HG(a,b,c))return f["return"]();d=a.m.la().find(function(g){return g.id===parseInt(b.id,10)});if(!d)return a.g.warn("Text rendition with ID: "+b.id+" not found."),f["return"]();a.g.info("Set text rendition with ID: "+b.id);a.f.set(c,b);_.C(f,2);GG(a,b);return _.y(f,MG(a.m,!0),4)}if(2!=f.a)return NG(a.m,d),a.m.trigger(new _.L(_.rm)),_.uh(f,0);e=_.E(f);a.g.warn("Failed to set text rendition",e);_.B(f)})};
|
|
86
|
+
PG=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.U;c=EG(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.C(e,2);return _.y(e,MG(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.L(_.rm)),_.uh(e,0);d=_.E(e);a.g.warn("Failed to unset text rendition",d);_.B(e)})};
|
|
87
|
+
SG=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.cw)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.w(a.m.la());for(var e=d.next();!e.done;c={vc:c.vc},e=d.next()){e=e.value;c.vc=oG(_.U,e);var f=b.find(function(h){return function(l){return h.vc.pa(l)}}(c));c.vc=f||c.vc;var g=pG(_.U,e,c.vc);e.active&&a.a.set(_.U,g);f||b.push(c.vc)}QG(a.m)||a.a.set(_.U,null);c=JG(a.m);RG(a,b,c,_.Kk);RG(a,b,c,_.Jk);
|
|
88
|
+
a.h=b}};RG=function(a,b,c,d){var e=qG(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={wc:c.wc},f=e.next()){f=f.value;c.wc=oG(d,f);var g=b.find(function(l){return function(m){return l.wc.pa(m)}}(c));c.wc=g||c.wc;var h=pG(d,f,c.wc);f.active&&a.a.set(d,h);g||b.push(c.wc)}};
|
|
89
|
+
TG=function(a,b,c){if(b){a.h.length||SG(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(DG(a,d)),h=g.next();!h.done&&!(f=h.value.renditions.find(function(l){return parseInt(l.id,10)===b.id}));h=g.next());f&&e!==f&&(GG(a,f),d===_.Jk?a.m.trigger(new _.L(_.qm)):d===_.Kk&&a.m.trigger(new _.L(_.Ng,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};UG=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.VG=function(){};
|
|
90
|
+
_.XG=function(a,b,c,d,e){this.j=a;this.C=c;this.f={};this.K=!1;this.a=null;this.h={};this.l=new _.Yh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.ok;this.A="";this.G={};this.o=WG(this,this.J);this.M=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};YG=function(a){var b=_.tl(a.mimeType,a.codecs),c=qE(a);return _.nG(b)||_.gu(c)||(_.sl(b,a.type)?!0:!1)};
|
|
91
|
+
WG=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,PD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,QD,function(){a.M=!0});a.l.on(c,"endstreaming",function(){a.M=!1});a.A=ZG(c);a.j.src=a.A;return c}c=new MediaSource;a.A=ZG(c);a.l.one(c,PD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
92
|
+
$G=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.se,a.Ok.bind(a,d));a.l.on(e,"updateend",a.ed.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.Zc)&&b.has(_.r)};aH=function(a,b){try{return new _.wm(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error(ED+b,c),null}};bH=function(a,b){if(!a.f[b])return"";var c=aH(a,b);return c?c.toString():""};dH=function(a,b,c,d,e){return[cH(a,b,a.Nk.bind(a,b)),cH(a,b,a.Ch.bind(a,b,c)),cH(a,b,a.Pk.bind(a,b,d,e))]};
|
|
93
|
+
cH=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.ok};a.h[b].push(c);1===a.h[b].length&&eH(a,b);return c.p};eH=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(sD+b),c.start()}catch(d){d.name===kD?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),fH(a,b)}else a.g.debug(fD+b)};
|
|
94
|
+
gH=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.I)return p["return"](Promise.reject());c=[];for(d in a.f)e=new _.ok,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.C(p,2);return _.y(p,Promise.all(c),4);case 4:_.uh(p,3);break;case 2:g=_.E(p);for(h in a.f)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.f);_.C(p,5,6);return _.y(p,b(),6);case 6:_.vh(p);for(m in a.f)fH(a,
|
|
95
|
+
m);_.wh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};fH=function(a,b){a.h[b].shift();eH(a,b)};
|
|
96
|
+
mH=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=hH(e,b,c);e=iH(e,d);if(1<a.periods.length){var f=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.w(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.w(g.value.variants);for(var h=g.next();!h.done;h=g.next())h=h.value,null!==h.audio&&d.add(f(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<b.length;c={Ff:c.Ff},d++)c.Ff=b[d],l=new Set(_.gh(l).concat().filter(function(n){return function(p){return n.Ff.has(p)}}(c)));
|
|
97
|
+
e=e.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(f(n.audio.codecs))})}e=jH(e);var m=kH(e);a=_.w(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(lH(n)===m)return!0;_.Oh("Dropping Variant (better codec available)",n);return!1})};
|
|
98
|
+
nH=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=hH(e,b,c);e=iH(e,d);a=_.w(a.periods);for(b=a.next();!b.done;b=a.next())b=b.value,b.variants=b.variants.filter(function(f){return e.includes(f)})};jH=function(a){var b=new _.Vh;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=lH(c);b.push(d,c)}return b};
|
|
99
|
+
hH=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.sE(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.sE(g.codecs),b.includes(g))?!0:!1}),f=a.filter(function(g){return d.length&&!e.length?d.includes(g):!d.length&&e.length?e.includes(g):d.includes(g)&&e.includes(g)});return f.length?f:a};
|
|
100
|
+
kH=function(a){var b="",c=Infinity;UD(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Oh(_.Gd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};lH=function(a){var b="";a.video&&(b=_.sE(a.video.codecs));var c="";a.audio&&(c=_.sE(a.audio.codecs));return b+"-"+c};
|
|
101
|
+
oH=function(a,b){function c(d,e,f){return d>=e&&d<=f}return(!a.width||!a.height||c(a.width,b.minWidth,b.maxWidth)&&c(a.height,b.minHeight,b.maxHeight)&&c(a.width*a.height,b.minPixels,b.maxPixels))&&c(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!0:!1};pH=function(a,b){for(var c=!1,d=_.w(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=oH(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
102
|
+
sH=function(a,b,c,d,e){e=void 0===e?!0:e;var f=!1;d.variants=d.variants.filter(function(n){if(a&&a.ca&&!cE(a,n))return _.Oh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!YG(p)){var u=p.codecs;0<=p.codecs.indexOf(_.oe)?(_.Oh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.oe,"ac-3"),YG(p)?_.Nh("Using AC-3 instead of EC-3 for",qH(p)):(p.codecs=u,_.Nh(lD,qH(p)),n.audio=null,f=!0,p=null)):(_.Nh(lD,qH(p)),n.audio=null,f=!0,p=null)}return q&&!YG(q)?
|
|
103
|
+
(_.Nh("Dropping variant - video not compatible with platform",qH(q)),!1):p&&b&&!rH(p,b,e)?(_.Nh("Dropping variant - not compatible with active audio","active audio",qH(b),"variant.audio",qH(p)),!1):q&&c&&!rH(q,c,e)?(_.Nh("Dropping variant - not compatible with active video","active video",qH(c),"variant.video",qH(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.w(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),h||m.audio||!m.video||(h=!0);g&&h&&(d.variants=d.variants.filter(function(n){return n.video&&
|
|
104
|
+
!n.audio?(_.Nh("Dropping variant - not compatible with video + audio","variant.video",qH(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.nG(_.tl(n.mimeType,n.codecs));p||_.Oh("Dropping text stream. Is not supported by the platform.",n);return p})};rH=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
105
|
+
tH=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
97
106
|
bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,audioMimeType:h,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(m),audioRoles:Array.from(n),videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,accessibility:q};c&&(a.videoId=c.id,a.originalVideoId=c.originalId,
|
|
98
107
|
a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,a.videoBandwidth=c.bandwidth||null);b&&(a.audioId=b.id,a.originalAudioId=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.audioBandwidth=b.bandwidth||null,a.label=b.label,a.audioRoles=b.roles);return a};
|
|
99
|
-
|
|
100
|
-
accessibility:a.accessibility,keyId:null}};
|
|
101
|
-
_.
|
|
102
|
-
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
103
|
-
|
|
104
|
-
_.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
b.D.setPlaybackRate(b.a.chasingRate,_.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
m);_.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
a;if(0===g.length||!e)throw _.
|
|
125
|
-
|
|
126
|
-
b.start);b=_.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
m),q["return"]();p=
|
|
130
|
-
|
|
131
|
-
c)};
|
|
132
|
-
|
|
133
|
-
_.
|
|
134
|
-
_.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
v){if(!a.a.has(v)){var z=
|
|
140
|
-
|
|
108
|
+
uH=function(a){return{id:a.id,active:!1,type:_.R,bandwidth:0,language:a.language,originalLanguage:a.originalLanguage,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:a.mimeType,audioMimeType:null,codecs:a.codecs||null,audioCodec:null,videoCodec:null,primary:a.primary,roles:a.roles,audioRoles:null,videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:a.originalId,
|
|
109
|
+
accessibility:a.accessibility,keyId:null}};vH=function(a){return a.allowedByApplication&&a.allowedByKeySystem};iH=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.w(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0===c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(null,e)):d.get(Math.min.apply(null,c))};
|
|
110
|
+
_.xH=function(a,b,c,d){b=_.Bi(b);var e=a,f=a.filter(function(h){return h.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(h){return h.language===g});b.some(function(h){var l=_.nE(_.yj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.yj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.ue})&&(e=e.filter(function(h){return h.kind===_.ue}));if(c){b=wH(e,c);if(b.length)return b;_.Jh("No exact match for the text role could be found.")}else if(b=
|
|
111
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.gE,[]);return b.length?wH(e,b[0]):e};wH=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
112
|
+
qH=function(a){var b=qE(a);return a.type===_.Zc?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.r?"type\x3dvideo mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" frameRate\x3d"+a.frameRate+" width\x3d"+a.width+" height\x3d"+a.height:"unexpected stream type"};
|
|
113
|
+
_.yH=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new UF;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};zH=function(a,b,c){if(a.j&&a.a.useCmsd){var d=eE(a.j);null!==d&&(a.g.debug("Using CMSD maxSuggestedBitrateKbps:",d),c=c.filter(function(e){return e.bandwidth<=1E3*d}))}a=c.filter(function(e){return!e.trickPlay});b&&(a=a.filter(function(e){return oH(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};AH=function(){this.a=null};
|
|
114
|
+
CH=function(a,b){if(b&&(null==a.a||a.a!==b))throw BH(a);};BH=function(a){return new _.P(_.Q,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};DH=function(){this.a=new Map};FH=function(a,b){a.a.has(b)||a.a.set(b,new EH);return a.a.get(b)};EH=function(){this.text=this.variant=null};GH=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
115
|
+
JH=function(a,b,c){c=void 0===c?!0:c;var d;if(!(d=!!a.audio!==!!b.audio||!!a.video!==!!b.video||a.language!==b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(d.channelsCount===e.channelsCount&&(!c||HH(d,e))&&IH(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||HH(a,b))&&IH(a.roles,b.roles)));return d?!1:!0};
|
|
116
|
+
HH=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=rE(a.codecs).map(function(f){return _.sE(f)}),d=rE(b.codecs).map(function(f){return _.sE(f)});if(c.length!==d.length)return!1;c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!==d[e])return!1;return!0};IH=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Oe);d["delete"](_.Oe);if(c.size!==d.size)return!1;c=_.w(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
117
|
+
LH=function(a){var b=void 0===b?_.Lf:b;this.f=a;this.a=b;this.h=new KH(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};KH=function(a,b,c,d,e){this.j=_.Bi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Lf:e};MH=function(a,b){var c=null;b.some(function(d){c=_.nE(_.yj(d),a.map(function(e){return mE(e)}));return!!c});return c?a.filter(function(d){return c===mE(d)}):[]};
|
|
118
|
+
NH=function(a,b){return a.filter(function(c){var d=c.audio;c=c.video;return d&&0<=d.roles.indexOf(b)||c&&0<=c.roles.indexOf(b)})};OH=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};RH=function(a,b){this.a=PH;this.f=(new Map).set(PH,b).set(QH,a)};
|
|
119
|
+
TH=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Yh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");SH(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.tg,function(){var c=b.D.getPosition(),d=b.D.getSeekRange().end;c=d-c;var e=b.D.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.D.setPlaybackRate(1),b.D.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
120
|
+
b.D.setPlaybackRate(b.a.chasingRate,_.Wd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
121
|
+
SH=function(a){return 1>=a.a.chasingRate?(a.g.warn("chasingRate must be greater than 1."),!1):a.a.chaseJumpDistance<=a.a.startChasingAt?(a.g.warn("chaseJumpDistance must be greater than startChasingAt."),!1):a.a.startChasingAt<=a.a.stopChasingAt?(a.g.warn("startChasingAt must be greater than stopChasingAt."),!1):0>a.a.stopChasingAt?(a.g.warn("stopChasingAt must be greater than or equal to 0."),!1):!0};
|
|
122
|
+
VH=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.M=!1;this.f=null;this.h={};this.l=new _.Yh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.U=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.ok;this.A="";this.H={};this.o=UH(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
123
|
+
UH=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,PD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,QD,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=WH(c);a.j.src=a.A;return c}c=new MediaSource;a.A=WH(c);a.l.one(c,PD,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
124
|
+
XH=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.se,a.Mk.bind(a,d));a.l.on(e,"updateend",a.zc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.M=b.has(_.Zc)&&b.has(_.r)};YH=function(a,b){try{return new _.wm(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(ED+b,c),null}};ZH=function(a,b){if(!a.a[b])return"";var c=YH(a,b);return c?c.toString():""};
|
|
125
|
+
bI=function(a,b,c,d,e,f){return[f?Promise.resolve():$H(a,b,function(){try{a.g.debug(IC+b+wC);var g=a.a[b].appendWindowStart,h=a.a[b].appendWindowEnd;a.a[b].abort();a.a[b].appendWindowStart=g;a.a[b].appendWindowEnd=h}catch(l){throw a.g.warn(WC+b+wC,l),l;}a.g.debug(QC+b+wC);a.zc(b)}),$H(a,b,function(){return aI(a,b,c)}),$H(a,b,function(){try{a.g.debug(oD+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn($C+b,d,e,g),g;}a.g.debug(UC+b,d,e);a.zc(b)})]};
|
|
126
|
+
aI=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(qD+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(aD+b,c,d),d;}a.g.debug(VC+b,c);a.zc(b)};$H=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.ok};a.h[b].push(c);1===a.h[b].length&&cI(a,b);return c.p};cI=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(sD+b),c.start()}catch(d){d.name===kD?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),dI(a,b)}else a.g.debug(fD+b)};
|
|
127
|
+
eI=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.ok,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.C(p,2);return _.y(p,Promise.all(c),4);case 4:_.uh(p,3);break;case 2:g=_.E(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.C(p,5,6);return _.y(p,b(),6);case 6:_.vh(p);for(m in a.a)dI(a,
|
|
128
|
+
m);_.wh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.P(_.Q,3,3015,{mediaError:n})))}})};dI=function(a,b){a.h[b].shift();cI(a,b)};fI=function(a,b,c){return $H(a,b,function(){b===_.R?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),zE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.zc(b))})};
|
|
129
|
+
gI=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.sE(_.vl(a.G[b])),f=_.ul(a.G[b]),g=_.tl(c,d),h=_.sE(_.vl(g)),l=_.ul(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.fg&&zE()?_.y(m,fI(a,b,g),2):m.F(2)):m["return"](!0)})};hI=function(a){this.h=a;this.a=null;this.f=function(){}};iI=function(a,b){a.f=b};
|
|
130
|
+
jI=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.ji();this.w=_.Wd;this.j=null;this.a=new _.yl(function(){b.A||b.f.Cm(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};kI=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
131
|
+
nI=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Wd||0===c||1===c)try{lI(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),mI(a)}else mI(a)};mI=function(a){a.g.debug(pD,a.h,' using "seek" mode.');lI(a,0);a.o=!0;a.a.Eb(.25)};lI=function(a,b){if(a.f.ji()!==b){a.g.debug(pD,b,' using native playbackRate "decoder" mode.');try{a.f.fo(b)}catch(c){throw c;}}};
|
|
132
|
+
pI=function(a){function b(){d=!0}function c(m){f.push(m);_.tn(m)}a=_.Hj(a);var d=!1,e,f=[],g=[];(new _.sn).N(_.Ve,c).N(_.ug,c).N(_.Qe,c).N(_.Ue,c).N(_.kg,c).Z(_.mg,function(m){e=m;f.push(m);_.un(m)}).Z("encv",b).Z("enca",b).Z("avc1",function(m){g.push({N:m,ud:1701733238})}).Z("avc3",function(m){g.push({N:m,ud:1701733238})}).Z("ac-3",function(m){g.push({N:m,ud:1701733217})}).Z(_.oe,function(m){g.push({N:m,ud:1701733217})}).Z("mp4a",function(m){g.push({N:m,ud:1701733217})}).parse(a);if(d)return _.Nh("Init segment already indicates encryption."),
|
|
133
|
+
a;if(0===g.length||!e)throw _.Ph("Failed to find boxes needed to fake encryption!"),_.Ph("Failed init segment (hex):",_.Vj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Nh('Inserting "'+_.xn(l.ud)+'" box into init segment.'),a=oI(a,e,l.N,f,l.ud);return a};
|
|
134
|
+
oI=function(a,b,c,d,e){var f=qI.value(),g=a.subarray(c.start,c.start+c.size),h=_.Oj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Oj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);rI(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Cl("Xbox One")||_.Bl()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.w(d);for(d=a.next();!d.done;d=a.next())d=d.value,rI(e,d.start,d.size+l.byteLength);l=_.Oj(e,
|
|
135
|
+
b.start);b=_.yn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};rI=function(a,b,c){a=_.Oj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.tI=function(a,b){this.D=b;this.j=a;sI(a);this.h=null;this.l=1;this.G=Promise.resolve();this.A=new Map;this.w=new Map;this.a=new Map;this.I=this.f=this.o=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.C=!1};
|
|
136
|
+
vI=function(a){var b=a.a.get(_.r);return b?uI(a,b.bc):(b=a.a.get(_.Zc))?uI(a,b.bc):null};xI=function(a){return _.wI(a,_.Zc)};yI=function(a){return _.wI(a,_.r)};
|
|
137
|
+
DI=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:return c=_.Uq,_.y(q,a.D.W.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.D.W,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.y(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.y(q,zI(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.H===d&&!a.a.has(c.TEXT)&&!a.I&&l){m=a.D.Wb();n=AI(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
138
|
+
m),q["return"]();p=BI(b,n,0);a.a.set(c.TEXT,p);CI(a,p,0)}_.B(q)}})};GI=function(a){a.I=!0;var b=a.a.get(_.R);b&&(EI(b),FI(b)["catch"](function(){}),a.a["delete"](_.R))};II=function(a,b,c,d){b.video&&_.HI(a,b.video,c,d);b.audio&&_.HI(a,b.audio,c,d)};KI=function(a,b){var c=a.j.periods.map(function(d){return d.id});a.g.debug("Manifest updated, periods ("+c.length+"): "+c.join(", "));a.j.periods=b.periods;sI(a.j);JI(a)};sI=function(a){a.periods.every(function(b){return typeof b.id===_.lg})};
|
|
139
|
+
MI=function(a){function b(l){return a.D.W.Nb(l,c,0)}var c=a.D.Wb(),d=!1,e=AI(a,c);if(_.Ej(a.a.values(),function(l){return l.bc===e}))for(var f=_.w(a.a.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=a.a.get(g);h.stream.segmentIterator=null;b(g)||(LI(a,h),d=!0)}else if(!_.Ej(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.w(a.a.values());for(f=d.next();!f.done;f=d.next())LI(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
140
|
+
c)};PI=function(a,b){b=void 0===b?!1:b;if(a.f)a.g.error("Unable to retry after StreamingEngine is destroyed!");else if(a.o)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.w(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=NI(d);if(d.nd||b&&OI(d))a.g.info(e,"Retrying after failure..."),d.nd=!1,CI(a,d,.1)}};QI=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.pb})};
|
|
141
|
+
RI=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};TI=function(a){var b,c,d,e;return _.I(function(f){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,EI(e),e.zb&&e.dc&&(e.zb=!1,b.push(e.dc.abort())),e.hc&&b.push(SI(a,e,!0,0));return _.y(f,Promise.all(b),0)})};UI=function(a,b,c){(a=a.a.get(b))&&c&&(EI(a),a.stream=c,a.mc=c,a.sa&&(a.sa=c.getSegmentReference(a.sa.position)),a.sa||(a.mc=null))};
|
|
142
|
+
_.wI=function(a,b){var c=a.a.get(b);return c?c.qc||c.stream:null};
|
|
143
|
+
_.HI=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.R&&a.h.ignoreTextStreamFailures)DI(a,b);else if(e){var f=VI(a,b).id;if(c&&f!==e.bc)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.w(a.a.values()),c=b.next();!c.done;c=b.next())LI(a,c.value);else if(e.qc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.qc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.qc=null,a.g.debug("switch found no special trick play stream"))),
|
|
144
|
+
WI(a,f)&&XI(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Wb();h=YI(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(SD+NI(e)+" already buffered to the end. Not switching."):(b.type===_.R&&a.D.W.pc(_.tl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.hf=!0,a.g.debug("switch: switching to Stream "+NI(e)),ZI(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.dc.abort()),c&&(e.xc?e.Bf=!0:e.zb?(e.hc=!0,e.Me=d,e.Bf=!0):(EI(e),SI(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(SD+
|
|
145
|
+
NI(e)+" already active")}};WI=function(a,b){var c=a.A.get(b);return!(!c||!c.wf)};XI=function(a,b){var c=a.w.get(b);return!(!c||!c.wf)};ZI=function(a,b,c){if(!b.dc)return!1;var d=a.D.Wb(),e=a.D.W.ja(b.type);c=(c=$I(a,b,d,e,c))?c.de():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.de()||0);f=a.D.ae().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.dc;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
146
|
+
LI=function(a,b){var c=NI(b);b.xc?a.g.debug(c,"clear: already clearing the buffer"):b.hc?a.g.debug(c,"clear: already waiting"):b.zb?(a.g.debug(c,"clear: currently updating"),b.hc=!0,b.Me=0):null==a.D.W.Ra(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.pb&&CI(a,b,0)):(a.g.debug(c,"clear: handling right now"),EI(b),SI(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
|
|
147
|
+
aJ=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a){f=a.D.Wb();g=AI(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.Uq;l=new Map;m=new Set;b&&(l.set(h.AUDIO,b),m.add(b));c&&(l.set(h.VIDEO,c),m.add(c));d&&(l.set(h.TEXT,d),m.add(d));n=a.D.W;p=a.h.forceNativeTS;return _.y(q,n.init(l,p,a.h.disableAudioTracks),2)}if(3!=q.a){if(a.f)return q["return"]();JI(a);return _.y(q,zI(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,
|
|
148
|
+
v){if(!a.a.has(v)){var z=BI(u,g,e);a.a.set(v,z);CI(a,z,0)}});_.B(q)})};BI=function(a,b,c){return{stream:a,type:a.type,mc:null,segmentIterator:null,sa:null,qc:null,hf:!0,bc:b,endOfStream:!1,zb:!1,pb:null,hc:!1,Me:0,Bf:!1,xc:!1,Ig:!1,nd:!1,mj:c||0,dc:null,Se:!1,Gi:0}};cJ=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){bJ(a,b)["catch"](hE)})};
|
|
149
|
+
bJ=function(a,b){var c=a.A.get(b);if(c)return a.g.debug("(all) Period "+b+yC),c;a.g.debug("(all) setting up Period "+b);var d=new _.ok;a.A.set(b,d);var e=new Set;c=uI(a,b);for(var f=_.w(c.variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);c=_.w(c.textStreams);for(f=c.next();!f.done;f=c.next())e.add(f.value);a.G=a.G.then(function(){return a.f?null:zI(a,e)}).then(function(){a.f||(d.resolve(),
|
|
141
150
|
a.g.debug("(all) setup Period "+b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.A["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.D.onError(h))});return d};
|
|
142
|
-
|
|
143
|
-
e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())
|
|
144
|
-
|
|
145
|
-
if(null!=l&&f>=l&&!b.
|
|
146
|
-
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
e,
|
|
150
|
-
g)a=null;else if(f=
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
v.then(function(){return a.f||a.o?null:
|
|
154
|
-
|
|
155
|
-
_.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
n=f&&f.initSegment||b.stream.initSegmentReference;p=
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
a.D.
|
|
163
|
-
"Appending segment with "+(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+
|
|
168
|
-
|
|
169
|
-
h.variant&&h.variant.audio&&l.set(_
|
|
170
|
-
5,5005));return}g=_.w(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
a.g.debug("fetching: reference\x3d",c);c=a.D.
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
_.
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
0;d<f.length;d++)if(!f[d].
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
a.f=f.manifest,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
a.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
return b.stop()})).
|
|
202
|
-
|
|
203
|
-
if(
|
|
204
|
-
(
|
|
205
|
-
e=_.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
a.
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
b
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
_.
|
|
249
|
-
|
|
250
|
-
_.
|
|
251
|
-
{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
_.
|
|
256
|
-
|
|
257
|
-
_.
|
|
258
|
-
if(
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
_.
|
|
267
|
-
|
|
268
|
-
_.
|
|
269
|
-
|
|
270
|
-
_.
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
_.
|
|
274
|
-
|
|
275
|
-
_.
|
|
276
|
-
_.
|
|
277
|
-
_.
|
|
278
|
-
_.
|
|
279
|
-
|
|
280
|
-
_.
|
|
281
|
-
_.
|
|
282
|
-
|
|
283
|
-
_.
|
|
284
|
-
|
|
285
|
-
_.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
_.
|
|
289
|
-
|
|
290
|
-
_.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
_.
|
|
294
|
-
|
|
295
|
-
_.
|
|
296
|
-
_.
|
|
297
|
-
_.
|
|
298
|
-
_.
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
_.
|
|
302
|
-
|
|
303
|
-
_.
|
|
304
|
-
_.
|
|
305
|
-
|
|
306
|
-
_.
|
|
307
|
-
_.
|
|
308
|
-
_.
|
|
309
|
-
_.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
_.
|
|
313
|
-
_.
|
|
314
|
-
_.
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
_.
|
|
319
|
-
_.
|
|
320
|
-
_.
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
_.
|
|
324
|
-
_.
|
|
325
|
-
_.
|
|
326
|
-
|
|
327
|
-
_.
|
|
328
|
-
_.
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
_.
|
|
332
|
-
_.
|
|
333
|
-
|
|
151
|
+
zI=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:c=[];d=_.w(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.w.get(f.id))?(a.g.debug("(all) Stream "+f.id+yC),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.ok),h=a.D.xb,c.push(f.createSegmentIndex(h)));_.C(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.uh(z,3);break;case 2:l=_.E(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
152
|
+
e.value,p=a.w.get(n.id))p["catch"](function(){}),p.reject(),a.w["delete"](n.id);throw l;case 3:q=_.w(b);for(e=q.next();!e.done;e=q.next())u=e.value,(v=a.w.get(u.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+u.id));_.B(z)}})};JI=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.W.Zf(b):a.D.W.Zf(Math.pow(2,32))};
|
|
153
|
+
fJ=function(a,b){function c(n){return n.type===_.R&&n.stream.mimeType===_.Rc}if(c(b))return a.D.W.Bh(b.stream.originalId||""),null;b.type===_.R&&a.D.W.th();if(!a.D.W.Ci()&&b.type!==_.R)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=NI(b),e=a.D.Wb(),f=YI(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.W.Ea(b.type,e);a.g.debug(d,"update_:",LD+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=XE(a.j.presentationTimeline);
|
|
154
|
+
if(null!=l&&f>=l&&!b.Se)return dJ(a,b),null;b.endOfStream=!1;l=VI(a,b.stream).id;var m=AI(a,f);null!=m&&(b.bc=m);if(m!==l)return a.g.debug(d,"need Period "+m,LD+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=h)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.D.W.ja(b.type);g=$I(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.R?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),dJ(a,b),
|
|
155
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=YI(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.mj=0;eJ(a,b,e,l,g)["catch"](function(){});return null};dJ=function(a,b){a.g.debug(NI(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.R);c&&c.stream.mimeType===_.Rc&&(c.endOfStream=!0)}};
|
|
156
|
+
YI=function(a,b,c){return b.mc&&b.sa?VI(a,b.mc).startTime+b.sa.endTime:Math.max(c,b.mj)};
|
|
157
|
+
$I=function(a,b,c,d,e){if(null==e)return a.g.warn(NC),null;if(b.stream.segmentLookupStrategy===_.GD)b.stream.segmentIterator?a=nF(b.stream.segmentIterator):b.sa||d?(c=b.sa?b.sa.endTime:d,a.g.info(cD,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=rF(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(cD,AD,"endTime:",c,b.sa)),a=e):(e=uI(a,e),e=Math.max(0,c-e.startTime),a.g.info(cD,"looking up segment","lookupTime:",
|
|
158
|
+
e,KD,c),d=null,d||(b.stream.segmentIterator=rF(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(cD,AD,"lookupTime:",e,KD,c),a=d);else{var f=NI(b);if(b.sa&&b.stream===b.mc)c=b.sa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=gJ(a,b,e,c);else{if(b.sa){a.g.debug(f,"next position unknown: another Stream buffered");f=VI(a,b.mc);var g=hJ(a,b,f.startTime+b.sa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=hJ(a,b,d||c,e);if(null==
|
|
159
|
+
g)a=null;else if(f=gJ(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ga+d.startTime+2>c&&(a=gJ(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};hJ=function(a,b,c,d){var e=NI(b);d=uI(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",LD+c,"lookupTime\x3d"+f,CD+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",CD+d.startTime,"lookupTime\x3d"+f);return b};
|
|
160
|
+
gJ=function(a,b,c,d){var e=NI(b);if(null==c)return a.g.warn(e,NC),null;c=uI(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",CD+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.cF(g);g=bF(g);return!b.Se&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",CD+c.startTime,OD+f.startTime,MD+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
161
|
+
eJ=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,H;return _.I(function(G){f=_.Uq;g=NI(b);h=uI(a,d);a.g.debug(g,"fetchAndAppend_:",LD+c,CD+h.startTime,ND+e.position,OD+e.startTime,MD+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=iJ(a,d);q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=jJ(a,b,h,q,u,e);b.zb=!0;b.hf=!1;a.g.debug(g,"fetching segment");z=!1;A=function(D,F){if(a.f||a.o)return null;z=!0;return kJ(a,b,c,h,l,e,D,F)};H=a.D.W.ja(b.type)||0;
|
|
162
|
+
v.then(function(){return a.f||a.o?null:lJ(a,b,e,!1,function(D){return A(D.data,!0)})}).then(function(D){return a.f||a.o?null:z||null===D?(mJ(a,b,H,e,l),null):A(D,!1)}).then(function(){if(!a.f&&!a.o){mJ(a,b,H,e,l);b.zb=!1;b.Ig=!1;b.hc||a.D.nf();if(m){var D=m.next().value;D&&a.g.debug("New iterated segment",D)}CI(a,b,0);nJ(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.I(function(F){if(a.f||a.o)return F["return"]();b.zb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
163
|
+
D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),F.F(0);if(7001===D.code)return b.zb=!1,b.pb=null,CI(a,b,0),F.F(0);if(3017===D.code)return oJ(a,b,D),F.F(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",ND+e.position,OD+e.startTime,MD+e.endTime,"error\x3d"+D),b.zb=!1,b.pb=null,CI(a,b,1),F.F(0);if(b.type===f.TEXT)return D instanceof
|
|
164
|
+
_.P&&D.a(1),EI(b),a.D.onError(new _.P(1,2,2010,D)),F.F(0);if(1001<=D.code&&1003>=D.code)return _.y(F,pJ(a,b,h,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.nd=!0;D instanceof _.P&&D.a(_.Q);return _.y(F,qJ(a,D),0)})});_.B(G)})};
|
|
165
|
+
oJ=function(a,b,c){var d=NI(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Ig}))a.g.debug(d,eD,"waiting for another stream to recover...");else{var e=Math.round(100*a.l);if(20<e)a.l-=.2;else if(4<e)a.l-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.nd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,eD,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Ig=!0}CI(a,b,4)};
|
|
166
|
+
pJ=function(a,b,c,d){var e,f;return _.I(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.D.Qf(b.stream,c));if(!f)return g.F(0);b.nd=!0;d.a(_.Q);return _.y(g,qJ(a,d),0)})};
|
|
167
|
+
jJ=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(u){g=c.startTime-f.Ga;h=b.hf||f.initSegment!==(b.sa&&b.sa.initSegment);if(!h&&g===b.Gi)return u["return"](Promise.resolve());b.Gi=g;l=NI(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=a.D.W.nj(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return u["return"](m);a.g.debug(l,"fetching init segment");
|
|
168
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=lJ(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return rJ(a,v,b).then(function(){return a.D.W.Oe(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.hf=!0;return Promise.reject(v)});return u["return"](Promise.all([m,q]))})};
|
|
169
|
+
rJ=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Bl())return e.F(0);d=pI(b);return _.y(e,a.D.W.Oe(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
170
|
+
kJ=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z;return _.I(function(A){switch(A.a){case 1:l=NI(b);if(!(e&&e.keyId&&a.D.Vd)){A.F(2);break}m=$D(a.D.Vd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);A.F(2);break}_.C(A,4);return _.y(A,m,6);case 6:_.uh(A,2);break;case 4:_.E(A),a.g.warn("DRM session load failed, cannot append segment!");case 2:if(!(e.encrypted&&e.keyId&&a.D.Vd&&bE(a.D.Vd,e.keyId))){A.F(7);break}EI(b);n=VI(a,e).id;p=sJ(a,n);if(!p){A.F(8);break}return _.y(A,
|
|
171
|
+
p,8);case 8:return q=a.D.Qf(e,d,HD),u=f.startTime+d.startTime,v=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+u+" - "+v+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),A["return"](Promise.resolve());case 7:return z=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.sn).Z("emsg",a.yn.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),A["return"](tJ(a,b,c).then(function(){if(a.f)return null;var H=f.startTime+d.startTime,G=f.endTime+
|
|
172
|
+
d.startTime;a.g.debug(l,"Appending segment with "+(H.toFixed(3)+" - "+G.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.T.Pf(e.bandwidth)+" Fragment: ")+h);return a.D.W.Oe(b.type,g,H,G,z,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.mc=e,b.sa=f)}))}})};
|
|
173
|
+
mJ=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.R){var f=NI(b),g=(a.D.W.ja(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.Se=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=KE(a,e),b=a[d],e=e.getDuration(),ME(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
174
|
+
uJ=function(a,b,c){(new _.sn).N(_.Ve,_.tn).N(_.ug,_.tn).N(_.Qe,_.tn).N(_.Ue,_.tn).N(_.kg,_.tn).Z(_.mg,_.un).N("encv",function(d){d.reader.skip(78);_.tn(d)}).N(_.eg,_.tn).N("schi",_.tn).N("tenc",function(d){d.reader.skip(6);if(_.ln(d.reader)){d.reader.skip(1);var e=_.Vj(_.rn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(NI(b),"Key id from tenc mismatches with key id from manifest. Switching from "+(b.stream.keyId+" to "+e+".")),b.stream.keyId=e)}d.parser.stop()}).parse(c)};
|
|
175
|
+
tJ=function(a,b,c){if(a.f)return Promise.resolve();var d=NI(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.W.Ra(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",LD+c,xD+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",LD+c,yD+g,xD+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",LD+c,yD+g,xD+e,"overflow\x3d"+h);return a.D.W.remove(b.type,
|
|
176
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+AC)})};nJ=function(a,b,c){if(!a.B){b=NI(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.R?a.B=d.every(function(e){return e.type===_.R||a.C?!0:!e.hc&&!e.xc&&e.sa}):a.C&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=VI(a,c).id,iJ(a,c),sJ(a,c))}};sJ=function(a,b){var c=null;a.A.has(b)||(c=bJ(a,b).then(function(){a.f||(a.g.debug(zD),a.D.rg())})["catch"](hE));cJ(a);a.D.sn&&(a.g.debug("calling onStartupComplete()..."),a.D.sn());return c};
|
|
177
|
+
vJ=function(a,b){var c=NI(b),d=VI(a,b.stream).id;if(b.bc!==d){var e=b.bc,f=Array.from(a.a.values());f.every(function(g){return g.bc===e})?f.every(OI)?(a.g.debug(c,"all need Period "+e),bJ(a,e).then(function(){if(!a.f)if(a.D.W.lj(),f.every(function(n){var p=OI(n),q=VI(a,n.stream).id;return p&&n.bc===e&&q!==e})){var g=uI(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.sg(g);a.C=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,h.variant.video);
|
|
178
|
+
h.variant&&h.variant.audio&&l.set(_.Zc,h.variant.audio);h.text&&l.set(_.R,h.text);var m=_.w(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.R){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.D.onError(new _.P(_.Q,5,5005));return}m=_.w(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.R)aJ(a,null,null,l.get(_.R),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.P(_.Q,
|
|
179
|
+
5,5005));return}g=_.w(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.HI(a,m,!1,0),CI(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,zD);a.D.rg()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](hE)):a.g.debug(c,"all MediaStates need Period "+e+", but not all MediaStates are idle"):a.g.debug(c,"not all MediaStates need Period "+e)}};AI=function(a,b){var c=IE(a.j.periods,b+_.Xv);return c?c.id:null};
|
|
180
|
+
VI=function(a,b){var c=a.j.periods,d=KE(c,b);c=c[d];if(!c)throw new _.P(_.Q,5,5006,"No period found for stream with ID "+b.id+".");return c};wJ=function(a,b){if(a.D.gd){var c=b.Qa;if(c)return dG(a.D.gd,c.id)}return null};
|
|
181
|
+
xJ=function(a,b,c){if(a.D.gd&&b){if(!c||0!==c.request.uriIndex){var d=a.D.gd,e=b.ua[0].serviceLocationId,f=cG(d,e);f.Jd=Date.now()+1E3*d.f;f.vf=!1;d.g.info("service location "+e+" banned during "+d.f+AC);d.trigger(new _.L(_.Td,{detail:{serviceLocationId:e,banned:!0,bannedSeconds:d.f}}))}e=c.request;d=c.timeMs;c=c.data.byteLength;d&&c&&(a=cG(a.D.gd,b.ua[e.uriIndex].serviceLocationId),VF(a.nh,d,c),a.vf=!0)}};
|
|
182
|
+
lJ=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=[],g=wJ(a,c);g&&(f=ZF(g,c.te));f.length||(f=c.$a());f=_.QE(f,c.Ca,c.oa,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.jd?null:e;f.disableFragmentSupport=c.jd||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(h){uJ(a,b,h.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.zo.bind(a)));
|
|
183
|
+
a.g.debug("fetching: reference\x3d",c);c=a.D.xb.fetch(f);b.dc=c;return c.T.then(function(h){var l=a.D.ae(),m=h.timeMs,n=h.data.byteLength;m&&n&&!d&&l.segmentDownloaded(m,n);xJ(a,g,h);b.dc=null;return h.data})["catch"](function(h){xJ(a,g);throw h;})};
|
|
184
|
+
SI=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=NI(b),b.hc=!1,b.Bf=!1,b.Me=0,b.xc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Wb(),h=a.D.W.getDuration(),f=a.D.W.remove(b.type,g+d,h)):f=a.D.W.clear(b.type).then(function(){return!a.f&&c?a.D.W.flush(b.type):null}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.mc=null;b.sa=null;b.xc=!1;b.endOfStream=!1;b.Se=!1;CI(a,b,0);_.B(l)})};
|
|
185
|
+
CI=function(a,b,c){a.g.debug(NI(b),"updating in "+c+AC);b.pb=(new _.wl(function(){var d;return _.I(function(e){if(1==e.a)return _.C(e,2),_.y(e,a.cc(b),4);if(2!=e.a)return _.uh(e,0);d=_.E(e);if(a.D)a.D.onError(d);_.B(e)})})).ea(c)};EI=function(a){null!=a.pb&&(a.pb.stop(),a.pb=null)};uI=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.P(_.Q,5,5006,"Period "+b+" not found");return c};
|
|
186
|
+
iJ=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};FI=function(a){return _.I(function(b){return a.dc?_.y(b,a.dc.abort(),0):b.F(0)})};qJ=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.qj){d.F(2);break}_.C(d,3);return _.y(d,a.D.qj(b),5);case 5:_.uh(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.B(d)}})};NI=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
187
|
+
OI=function(a){return!a.zb&&null==a.pb&&!a.hc&&!a.xc};yJ=function(){this.a=null};
|
|
188
|
+
BJ=function(){_.Im.call(this,BD);var a=this;this.G=zJ;this.j=this.da=null;this.$g=0;this.uj=2;this.Xc=null;this.Tg=!1;this.l=new _.Yh;this.jc=this.bh=this.cf=this.I=this.Wc=this.B=this.L=this.w=null;this.fe=!1;this.f=this.A=this.a=this.K=this.J=null;this.h=new _.yH;this.Fb=null;this.dh=1E9;this.gf=new Set;this.ya=!0;this.ia=null;this.wj=!1;this.vj=0;this.ca=null;this.P=new DH;this.H=null;this.fb=_.uq;this.Yd=new KH(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
189
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Sd=this.configuration.preferredTextLanguage;this.o=new AH;this.ha=this.Vc=null;this.Pc=new Map;this.$d=null;this.bf=this.configuration.preferredTextRole;this.Kd=this.configuration.preferForcedSubtitles;this.l.on(window,"online",function(){a.G===AJ&&PI(a.a)});this.kf=this.Wd=this.qf=null;this.$=_.oa;this.je=new yJ;this.Xg=null};
|
|
190
|
+
CJ=function(a){return new _.BE(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.w(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.gh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
191
|
+
DJ=function(a,b){if(a.fb!==b){var c=_.T.Al;if(a.fb===_.Fq&&b!==_.uq)c=c(b,_.Dq),a.log.info(_.iD+c);else{var d=a.$g;d=0===d?0:Date.now()-d;var e=a.fb;a.fb=b;a.$g=Date.now();null!==a.I&&(a.I.A=b===_.Hq);a.H&&_.nq(a.H.a,a.fb);b===_.zq&&(a.uj=a.Kg?1:2);var f=a.uj,g={currentState:a.fb,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.zq||e===_.zq?f:void 0},h=c(e,_.Dq),l=c(b,_.Dq);c=b!==_.zq?"":"["+c(f,_.Cq)+"]";a.log.info(_.Kb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.ig,{detail:g}));(b===_.Bq||b===
|
|
192
|
+
_.Fq)&&a.jc&&a.jc.stop();b===_.zq?a.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.zq&&a.trigger(new _.L(_.id,{detail:{bufferedTimeMS:d,reason:f}}))}}};EJ=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.o.a;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.Im.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:DJ(a,_.uq),_.B(c)}})};
|
|
193
|
+
FJ=function(a){var b=new _.Iu;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};IJ=function(a,b){var c,d;return _.I(function(e){a.$===_.oa?GJ(a,b.cues):a.$===_.Fb?(a.f=zG(a.f,vG(b)),c=a.configuration.playlist.endTime,d=a.f.presentationTimeline.a.a,c&&d>c&&(a.log.info("Reached end of playlist. Turning timeline static."),a.A.requestStop(),a.A=null,_.WE(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ie))),HJ(a,a.f)):KI(a.a,b);_.B(e)})};
|
|
194
|
+
JJ=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.$===_.Fb?a.trigger(new _.L(_.Yf)):a.trigger(new _.L(_.Ie));_.B(b)})};
|
|
195
|
+
HJ=function(a,b){var c=a.getMediaPosition(),d=a.Wd,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.w(e);for(var l=e.next();!l.done;l=e.next()){l=l.value;var m=l.endTime-l.startTime;l.configurationId===g?h.a+=m:(g=l.configurationId||"",h=new _.Hu(g||"",l.startTime,m,!1),d.a.push(h))}d.h&&(h=d.h,g=h.start,h=h.end,e=d.a[0],null!=g&&e&&g>=e.f&&g<=e.f+e.a&&(l=g-e.f,l<e.a&&(e.f=g,e.a-=l)),g=d.a[d.a.length-1],null!=h&&g&&h>=g.f&&h<=g.f+g.a&&(g.a=h-g.f));fE(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
196
|
+
0;d<f.length;d++)if(!f[d].pa(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Zf));lF(a.kf);iF(a.K,b.cues)};lK=function(a){var b,c;return _.I(function(d){if(1==d.a)return gK(a),_.y(d,hK(a),2);if(3!=d.a){iK(a);b=_.wk(4)||_.wk(5);if(!b)return d.F(3);c=a.getSurface().getMedia();jK(a,c);return _.y(d,kK(a,c),3)}a.configuration=a.Ja;_.B(d)})};
|
|
197
|
+
mK=function(a){return _.I(function(b){if(!a.configuration.contentSteering.enabled||!a.f.contentSteering)return b.F(0);a.Fb=new $F(a.configuration.contentSteering,a.getNetworkEngine());a.Fb.on(_.Sd,function(c){a.trigger(c)});return _.y(b,bG(a.Fb,a.f.contentSteering),0)})};
|
|
198
|
+
tK=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.ok,a.o.a=e,_.C(l,2),gK(a),_.y(l,nK(a),4);case 4:return CH(a.o,e),a.aa=_.Mq(b),a.configuration=_.Gm(a.Ja,b),yE(a.configuration.xmlParser),a.Xg&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(wD,a.Xg),a.log.info(_.rb,a.configuration),a.log.info(_.Jb,a.aa),_.y(l,oK(a,e),5);case 5:return CH(a.o,e),_.y(l,pK(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=
|
|
199
|
+
l.f,CH(a.o,e),a.A=f.parser,a.f=f.manifest,GJ(a,f.manifest.cues),_.y(l,mK(a),7);case 7:return g=a,_.y(l,qK(a,a.f,a.configuration),8);case 8:g.w=l.f;CH(a.o,e);if(!c){l.F(9);break}return _.y(l,rK(a,e),10);case 10:CH(a.o,e),a.l.one(a.j,_.Ke,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 9:e.resolve();_.uh(l,0);break;case 2:h=_.E(l),sK(a,h,e),_.B(l)}})};GJ=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);iF(a.K,c)}else iF(a.K,b)};
|
|
200
|
+
sK=function(a,b,c){b=uK(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};uK=function(a,b,c){var d=a.o;return null!=d.a&&d.a===c||b instanceof _.P&&7E3===b.code?b instanceof _.P?b:new _.P(_.Q,7,7003,"Unexpected error.",b):BH(a.o)};nK=function(a){return a.da?a.da["catch"](function(){}):Promise.resolve()};
|
|
201
|
+
oK=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.sq,DJ(a,_.Gq),c=vK(a,a.configuration),_.y(d,kK(a,c),2);CH(a.o,b);a.K=new gF;hF(a.K,function(e){a.log.info("Timeline cue found",e);wK(a,_.qi,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.ki))});_.B(d)})};
|
|
202
|
+
pK=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return f=b,g=_.Mq(f),h=g[c],_.y(n,xK(a,h),2);case 2:return l=n.f,CH(a.o,d),_.bp(ID),_.y(n,yK(a,l,h,f.id||""),3);case 3:m=n.f;CH(a.o,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:CH(a.o,d);case 4:return _.bp("manifest.end"),_.cp("Fetch and parse manifest",ID,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
203
|
+
zK=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,pK(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,vG(c.manifest)],e=yG(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.P(_.Q,7,7003,"Failed to append load manifest");}})};vK=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.N.R(b.volume)||a.setVolume(b.volume);_.N.R(b.muted)||a.setMuted(b.muted);jK(a,c);return c};
|
|
204
|
+
jK=function(a,b){a.j||(a.l.on(b,_.se,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.P(_.Q,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};iK=function(a){a.j&&(a.l.off(a.j,_.se),a.j=null)};
|
|
205
|
+
hK=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==AK&&(a.G=zJ);if(b=a.j)a.l.off(b,_.Ke),a.l.off(b,_.zf),a.l.off(b,_.kf),a.l.off(b,_.re),a.l.off(b,_.Pf),a.l.off(b,_.Nf);a.K&&(a.K.release(),a.K=null);a.Wc&&(a.Wc.release(),a.Wc=null);a.jc&&(a.jc.stop(),a.jc=null);if(!a.A){c.F(2);break}return _.y(c,a.A.stop(),3);case 3:a.A=null;case 2:if(!a.h){c.F(4);break}return _.y(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.y(c,a.a.destroy(),7);case 7:a.a=null;case 6:if(!a.Fb){c.F(8);break}return _.y(c,
|
|
206
|
+
a.Fb.destroy(),9);case 9:a.Fb=null;case 8:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.F(10);break}return _.y(c,a.L.destroy(),11);case 11:a.L=null;case 10:a.Xc&&(a.Xc.release(),a.Xc=null);a.cf&&(a.cf.release(),a.cf=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(12);break}return _.y(c,a.w.destroy(),13);case 13:a.w=null;case 12:a.P.clear(),a.J=null,a.gf.clear(),a.f=null,a.H=null,a.ya=!0,a.Pc.clear(),a.fe=!1,BK(a),_.B(c)}})};
|
|
207
|
+
kK=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new UG:new _.VG,d=_.lq(a.configuration,[_.ze,"single-native"]),e=d.create(a),a.U=e,f=CJ(a),f.track(a),a.Xc=f,g=null,CK(a)?g=new VH(b,c,e,f,a.configuration):g=new _.XG(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.B(h)})};
|
|
208
|
+
xK=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.Ku(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
209
|
+
yK=function(a,b,c,d){return(new _.pk(Promise.resolve().then(function(){var e,f,g;return _.I(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.C(h,4);var l=c.url;var m=DK(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.uh(h,2);break;case 4:f=_.E(h);if(!a.Uc)throw f;return _.y(h,a.Uc(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.P(_.Q,4,4014);EK(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
210
|
+
return b.stop()})).T};
|
|
211
|
+
qK=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:_.bp("initDrm.start");d=new _.hp({xb:a.getNetworkEngine(),onError:function(q){return a.onError(q)},vg:function(q){if(a.a){var u=FK(a),v=!1,z=Object.keys(q);0===z.length&&a.log.warn("Got a key status event without any key statuses, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");var A=1===z.length&&"00"===z[0];A&&a.log.warn("Got a synthetic key status event, so we don't know the real key statuses. If we don't have all the keys, you'll need to set restrictions so we don't select those tracks.");
|
|
212
|
+
if(z.length){z=a.getPeriods();for(var H=0;H<z.length;H++)for(var G=z[H],D=_.w(G.variants),F=D.next();!F.done;F=D.next()){F=F.value;var M=[];F.audio&&M.push(F.audio);F.video&&M.push(F.video);M=_.w(M);for(var O=M.next();!O.done;O=M.next()){O=O.value;var S=F.allowedByKeySystem;if(O.keyId){var V=q[A?"00":O.keyId];V=!!V&&!GK.includes(V);F.allowedByKeySystem=V}S!==F.allowedByKeySystem&&(V=O.type,O.type===_.r&&(V="video "+O.width+"x"+O.height+"@"+_.T.Pf(O.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
213
|
+
(O.keyId+"'. Applying restrictions to "+V)));G===u&&S!==F.allowedByKeySystem&&(v=!0)}}}if(q=vI(a.a)){A=xI(a.a);z=yI(a.a);a:{H=q.variants;for(G=0;G<H.length;G++)if(H[G].audio===A&&H[G].video===z){A=H[G];break a}A=null}if(!A||A.allowedByKeySystem)a.log.info(OC),HK(a),IK(a,q.variants)}v&&q!==u&&(a.log.info(OC),HK(a),IK(a,u.variants))}},ug:function(q,u){a.trigger(new _.L(_.fe,{expirationTime:u}))},onEvent:function(q){return a.Wf(q)},getConfiguration:function(){return a.getConfiguration()},md:function(){return a.md()}});
|
|
214
|
+
e=b.periods.every(function(q){return q.variants.some(function(u){return u.drmInfos.some(function(v){return v.licenseServerUriOrigin===_.DD})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.an(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Bu(b.periods);if(!h){p.F(2);break}n=_.Km(_.lf);if(!n){p.F(2);break}return _.y(p,n.l(a,m),4);case 4:return _.y(p,n.j(h),5);case 5:l=p.f;case 2:return _.y(p,_.mp(d,m,l),6);case 6:return a.w=d,JK(a,b.periods),_.bp("initDrm.end"),_.cp("Init DRM","initDrm.start",
|
|
215
|
+
"initDrm.end"),p["return"](d)}})};
|
|
216
|
+
rK=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.j,KK(a,c),LK(a,a.f.periods),a.Yd=new KH(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Sd=a.configuration.preferredTextLanguage,a.bf=a.configuration.preferredTextRole,a.Kd=a.configuration.preferForcedSubtitles,_.y(q,_.Ep(a.w,c),2);if(3!=q.a)return CH(a.o,
|
|
217
|
+
b),a.h.configure(a.configuration.abr),a.Gg&&a.h.setCmsdManager(a.Gg),a.h.init(function(u,v,z){if(!a.ya){var A=FK(a);(u=BG(u,A.variants))?MK(a,u,v,z):a.log.warn("No matching variant found for track switch")}}),a.B=NK(a,c,a.configuration.startTime),a.Wc=OK(a),a.I=new jI({ji:function(){return c.playbackRate},fo:function(u){c.playbackRate=u},Cm:function(u){c.currentTime+=u}}),kI(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.cf=new TH(a)),d=Math.max(1E-4,
|
|
218
|
+
a.configuration.streaming.rebufferingGoal),PK(a,d),CK(a)?nH(a.f,_.Bi(a.configuration.preferredVideoCodec),_.Bi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):mH(a.f,_.Bi(a.configuration.preferredVideoCodec),_.Bi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=QK(a),e.h=a.configuration.streaming,a.a=e,a.G=AJ,_.y(q,e.start(),3);CH(a.o,b);a.configuration.streaming.startAtSegmentBoundary&&(f=LF(a.B),g=RK(a,f),EF(a.B.f,g));h=_.w(a.f.periods);
|
|
219
|
+
for(l=h.next();!l.done;l=h.next())m=l.value,SK(a,m);HK(a);n=FK(a)||a.f.periods[0];p=n.variants.some(function(u){return u.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");IK(a,n.variants);_.B(q)})};
|
|
220
|
+
KK=function(a,b){function c(d){a.j&&a.J&&(d.type===_.ag&&a.me?(a.J.a=QH,BK(a)):d.type===_.Rg&&a.getState()===_.Iq&&.1>a.getBufferInfo().Ea(a.getMediaPosition())?(a.J.a=QH,BK(a)):a.J&&TK(a));UK(a)}a.l.on(b,_.zf,c);a.l.on(b,_.kf,c);a.l.on(b,_.re,c);a.l.on(b,_.ag,c);a.l.on(b,_.$f,c);a.l.on(b,_.Nf,c);a.l.on(b,_.Rg,c);a.l.on(b,_.Pf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
221
|
+
EK=function(a){function b(d){return d.video&&d.audio||d.video&&d.video.codecs.includes(",")}if(a.some(function(d){return d.variants.some(b)})){_.Oh("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.w(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};NK=function(a,b,c){return new JF(b,a.f,a.configuration.streaming,c,function(d){a.Wc&&NF(a.Wc,!0,d);a.a&&MI(a.a)},function(d){return a.dispatchEvent(d)},a.$===_.Fb)};
|
|
222
|
+
OK=function(a){var b=new OF(a.j),c=new hI(a.f);iI(c,function(){HK(a)});b.a.add(c);a.K&&(c=new QF(a.K),RF(c,function(d){d.mf&&d.mf();wK(a,_.li,d)},function(d){d.tg&&d.tg();wK(a,_.mi,d)},function(d,e){e||(d.mf&&d.mf(),wK(a,_.li,d),d.tg&&d.tg(),wK(a,_.mi,d))}),b.a.add(c));a.$===_.Fb&&(c=new kF(a.Wd,a.je,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.kf=c);return b};PK=function(a,b){a.J=new RH(b,Math.min(.5,b/2));a.J.a=QH;BK(a);a.jc=(new _.yl(function(){TK(a)})).Eb(.25)};
|
|
223
|
+
TK=function(a){switch(a.G){case AJ:a:if(a.j.ended||a.L.Pe())var b=!0;else{if(a.isLive()){b=bF(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.ja(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=a.L.gg();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Ea(e),d=d.Ea(e),c=Math.min(c,d)):c=c?c.Ea(e):d?d.Ea(e):0}else c=0;if(d=a.J){d=a.J;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?PH:QH;d.a=c;d=e!==c}c=d;d=VK(a);c||a.getState()===_.zq&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
224
|
+
d,"buffered to end",b,"state",a.getState()),BK(a)):a.fe&&UK(a)};QK=function(a){var b={configuration:{um:a.$===_.Fb},Wb:function(){return LF(a.B)},W:a.L,xb:a.getNetworkEngine(),gd:a.Fb,sg:a.Lk.bind(a),rg:a.Kk.bind(a),onError:a.onError.bind(a),Oi:a.Zm.bind(a),onEvent:a.Wf.bind(a),Ti:a.yo.bind(a),nf:a.mn.bind(a),ae:function(){return a.h},Qf:a.Sj.bind(a),qj:a.no.bind(a),Vd:a.w};return new _.tI(a.f,b)};
|
|
225
|
+
JG=function(a){if(a.f&&a.B){var b=WK(a),c=[];a=_.w(XK(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=tH(d);e.active=d===b;c.push(e)}return c}return[]};NG=function(a,b){if(a.f&&a.a){var c=FK(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(YK(a,c,d,!1),ZK(a,d),a.Sd=d.language,a.Kd=d.kind===_.ue):a.log.error(_.gD,b.id)}};
|
|
226
|
+
KG=function(a,b,c){var d=void 0===d?0:d;if(!a.f||!a.a)throw Error("Player not ready to select tracks.");var e=FK(a);if(!e)throw Error(hD);if(b){a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());var f=e.variants.find(function(g){return g.id===b.id});if(!f)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!vH(f))throw a.log.error("Unable to switch to restricted track",
|
|
227
|
+
b.id),Error("Unable to switch to restricted track.");a.ha=f.video.id;$K(a,e,f,!1);aL(a,f,c,d);null==a.$d&&(a.$d=a.Yd);a.Yd=new LH(f);IK(a,e.variants)}else a.ha=null,null!=a.$d&&(a.Yd=a.$d,a.$d=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),c=IK(a,e.variants),null==c||a.ya||MK(a,c)};
|
|
228
|
+
bL=function(a,b){if(a.configuration.streaming.disableAudioTracks)throw Error("Audio tracks are disabled by config.");if(!a.a||!a.f||!a.B)throw Error("Not ready to select audio track.");var c=yI(a.a),d=xI(a.a),e=FK(a);if(!e)throw Error(hD);var f=e.variants.filter(function(n){return n.audio.id===b&&vH(n)}),g=!1,h=void 0;if(c){if(h=f.find(function(n){return n.video.id===c.id}),!h){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");g=!0;var l=a.getTrackManager().La();
|
|
229
|
+
if(l){var m=l.renditions.map(function(n){return n.id});h=f.find(function(n){return m.find(function(p){return p===String(n.video.id)})})}}}else h=f[0];if(!h)throw Error("Variant with target audio track not found.");if(d.codecs.split(".")[0]!==h.audio.codecs.split(".")[0])throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),Error("Audio codecs not compatible with active audio.");d=h.audio;a.Vc=d.id;f=f.map(AG);a.h.setTracks(f);$K(a,e,h,!1);g||a.ya?aL(a,h,!0,0):
|
|
230
|
+
_.HI(a.a,d,!0,0)};QG=function(a){var b=a.Tg;return a.f?a.L.getTextDisplayer().isTextVisible():b};MG=function(a,b){var c,d,e,f;return _.I(function(g){c=a.Tg;d=b;if(c===d)return g["return"]();a.Tg=d;if(a.G!==AJ)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return GI(a.a),g.F(0);e=FK(a);f=_.xH(e.textStreams,a.Sd,a.bf,a.Kd);return 0<f.length?_.y(g,DI(a.a,f[0]),0):g.F(0)})};
|
|
231
|
+
$K=function(a,b,c,d){var e=a.getTrackManager();a.A&&a.A.setCurrentVariant(c);if(e){var f=a.H.B;if(c.video){TG(e,c.video,d);var g=e.ma();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(TG(e,c.audio,d),e=e.Ya(),f.f!==e&&(f.f=e,f.a.push({timestamp:Date.now()/1E3,id:e.id,trackId:e.track.id,type:e.track.type,fromAdaptation:d,width:null,height:null,bandwidth:e.bandwidth})))}FH(a.P,
|
|
232
|
+
b).variant=c};YK=function(a,b,c,d){FH(a.P,b).text=c;if(b=a.getTrackManager())TG(b,c,d),c=b.Va(),a=a.H.B,a.h!==c&&(a.h=c,a.a.push({timestamp:Date.now()/1E3,id:c.id,trackId:c.track.id,type:c.track.type,fromAdaptation:d,width:null,height:null,bandwidth:null}))};cL=function(a){return a.$===_.Fb&&"flat"===a.configuration.playlist.timeline};
|
|
233
|
+
LK=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.w(d.variants),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.w(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.dh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ga:0,mimeType:_.Rc,codecs:"",kind:_.md,encrypted:!1,
|
|
234
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.R,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.w(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
235
|
+
JK=function(a,b){for(var c=a.a?xI(a.a):null,d=a.a?yI(a.a):null,e=!CK(a),f=_.w(b),g=f.next();!g.done;g=f.next())sH(a.w,c,d,g.value,e);c=oE(b,function(h){return h.variants.some(vH)});if(a.configuration.streaming.disableAudioTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())e=
|
|
236
|
+
e.value,(g=e.video)&&!pE(g.type,_.tl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.P(_.Q,4,4032);if(c<b.length)throw new _.P(_.Q,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,pH(d.variants,a.configuration.restrictions)&&a.a&&FK(a)===d&&HK(a),dL(a,d.variants)};
|
|
237
|
+
SK=function(a,b){var c=a.a?xI(a.a):null,d=a.a?yI(a.a):null,e=!CK(a);sH(a.w,c,d,b,e);d=b.variants;if(!d.some(vH))throw new _.P(_.Q,4,4011);dL(a,b.variants);pH(d,a.configuration.restrictions)&&a.a&&FK(a)===b&&HK(a);if(!_.wk(2)&&(c=a.w?a.w.getDrmInfo():null))for(d=_.w(d),e=d.next();!e.done;e=d.next()){e=_.w(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Hp(a.w,g.keyId,g.initData)||
|
|
238
|
+
_.xp(a.w,g.initDataType,g.initData,g.keyId)}}};aL=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ya?(a.ia=b,a.wj=c,a.vj=d):II(a.a,b,c,d)};ZK=function(a,b){a.ya?a.ca=b:_.HI(a.a,b,!0,0)};eL=function(a){if(a.a&&a.f){var b=vI(a.a),c=FK(a);null!=b&&b===c&&(xI(a.a),yI(a.a),_.wI(a.a,_.R),FH(a.P,c),FH(a.P,c))}};
|
|
239
|
+
RK=function(a,b){function c(g,h){if(!g)return null;var l=g.findSegmentPosition(h-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=xI(a.a),e=yI(a.a),f=FK(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};VK=function(a){return a.w&&a.w.G?!0:a.J?a.J.getState()===QH:!1};
|
|
240
|
+
BK=function(a){if(a.H&&a.J&&a.B){var b=fL(a)===_.zq,c=a.I;c.l=b;nI(c,c.o?"seek":void 0);a.B.j.o=b;UK(a);a.kf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.kf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Wf))))}};UK=function(a){DJ(a,fL(a))};fL=function(a){if(a.me)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.fe&&0<=c&&b<=c?!0:!1}return b?_.Bq:VK(a)||a.me?_.zq:a.j&&a.j.paused?_.Hq:_.Iq};
|
|
241
|
+
IK=function(a,b){try{dL(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return vH(f)}),d=rG(c,a.Vc);c=a.Yd.create(d);c=Array.from(c.values());var e=c.map(AG);a.h.setTracks(e);if(null!==a.ha&&null!==a.Vc&&(e=c.find(function(f){return f.video.id===a.ha&&f.audio.id===a.Vc}),a.ha=null,e))return e;if(a.configuration.abr.enabled||null===a.ha)return d=a.h.chooseTrack(),BG(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.ha});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
242
|
+
d=a.h.chooseTrack(),BG(d,c))};gL=function(a,b){return _.xH(b,a.Sd,a.bf,a.Kd)[0]||null};hL=function(a,b,c){c=void 0===c?!0:c;var d=IK(a,b.variants);a.Vc=d&&d.audio&&d.audio.id;d&&($K(a,b,d,!0),aL(a,d,c));(c=gL(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||QG(a))&&(YK(a,b,c,!0),ZK(a,c))};
|
|
243
|
+
kL=function(a,b){a.ya=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=IK(a,b.variants),d=gL(a,b.textStreams);a.ia&&(b.variants.includes(a.ia)&&(c=a.ia),a.ia=null);a.ca&&(b.textStreams.includes(a.ca)&&(d=a.ca),a.ca=null);c&&iL(a,b,function(){return $K(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||QG(a))&&iL(a,b,function(){return YK(a,b,d,!0)});b===FK(a)&&jL(a);return a.configuration.streaming.alwaysStreamText||QG(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
244
|
+
MK=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;if(a.configuration.abr.enabled){a.log.debug("switch_");var e=lL(a,b);iL(a,e,function(){return $K(a,e,b,!0)});e===FK(a)&&jL(a);a.a&&II(a.a,b,c,d)}};HK=function(a){var b=a.getTrackManager();b&&a.G!==AK&&(b.m&&(SG(b),b.m.trigger(new _.L(_.ew))),jL(a))};jL=function(a){var b=FK(a);if(b){var c=a.Pc.get(b)||[];for(a.Pc["delete"](b);c.length;)c.shift()()}};iL=function(a,b,c){a.Pc.has(b)||a.Pc.set(b,[]);a.Pc.get(b).push(c)};
|
|
245
|
+
wK=function(a,b,c){a.trigger(new _.L(b,{detail:fF(c,cL(a))}))};
|
|
246
|
+
dL=function(a,b){var c=a.w?_.N.gh(a.w.ia):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.w(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.w(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?GK.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.P(_.Q,4,4012,{hasAppRestrictions:f,
|
|
247
|
+
missingKeys:g,restrictedKeyStatuses:h});};XK=function(a){var b=FK(a);if(null==b)return[];eL(a);return b.variants.filter(function(c){return vH(c)})};mL=function(a){var b=FK(a);if(null==b)return[];eL(a);return b.textStreams.filter(function(c){return!a.gf.has(c)})};FK=function(a){var b=LF(a.B),c=null;a=_.w(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};WK=function(a){var b=FK(a);return b&&FH(a.P,b).variant};
|
|
248
|
+
lL=function(a,b){for(var c=_.w(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};gK=function(a){if(a.G===AK)throw new _.P(_.Q,7,7E3,"Player is destroyed.");};
|
|
249
|
+
nL=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,u,v,z,A,H,G,D,F,M,O;return _.I(function(S){switch(S.a){case 1:return d=_.Uq,_.C(S,2),_.y(S,_.Ku(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=S.f;e.configure(a.configuration.manifest);var V=e;var ra=b.url,Da=DK(a,a.configuration.id||"");V=V.start(ra,Da);return _.y(S,V,5);case 5:f=S.f;EK(f.periods);if(!f.periods.length)throw new _.P(_.Q,4,4014);return _.y(S,a.A.stop(),6);case 6:a.A=e;g=c.audio&&c.audio.id;
|
|
250
|
+
h=c.video&&c.video.id;a.f.periods=f.periods;l=IE(f.periods,LF(a.B))||f.periods[0];CK(a)?nH(a.f,_.Bi(a.configuration.preferredVideoCodec),_.Bi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):mH(a.f,_.Bi(a.configuration.preferredVideoCodec),_.Bi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=sG(g,h,l.variants);n=gL(a,l.textStreams);IK(a,l.variants);p=m&&m.video;q=m&&m.audio;u=[];v=new Set;z=_.w(l.variants);for(A=z.next();!A.done;A=
|
|
251
|
+
z.next())H=A.value,H.video&&v.add(H.video),H.audio&&v.add(H.audio);G=a.getNetworkEngine();D=_.w(_.gh(v).concat(_.gh(l.textStreams)));for(F=D.next();!F.done;F=D.next())M=F.value,u.push(M.createSegmentIndex(G));return _.y(S,Promise.all(u),7);case 7:UI(a.a,d.AUDIO,q);UI(a.a,d.VIDEO,p);UI(a.a,d.TEXT,n);m&&$K(a,l,m,!1);a.log.info("Switch CDN successful.");_.uh(S,0);break;case 2:O=_.E(S);if(!e){S.F(8);break}return _.y(S,e.stop(),8);case 8:throw O;}})};
|
|
252
|
+
DK=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return SK(a,c)},filterAllPeriods:function(c){return JK(a,c)},onEvent:function(c){return a.Wf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return IJ(a,c)},onTurnedStatic:function(){return JJ(a)},ae:function(){return a.h}}};
|
|
253
|
+
CK=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.fg&&(_.wk(2)||_.wk(3)||_.wk(4)||_.wk(5)||_.wk(6)||_.xk()&&38===_.Dl().major||_.xk()&&53===_.Dl().major||_.xk()&&68===_.Dl().major?!1:!0)};oL=function(){};pL=function(){var a=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(b){for(var c=[],d=0;d<arguments.length;++d)c[d]=arguments[d];c=a.apply(this,c);c.abort=function(){};return c}};
|
|
254
|
+
qL=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};rL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};sL=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.sE(b)&&a(b)}};
|
|
255
|
+
tL=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.w(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
|
|
256
|
+
uL=function(a){_.Jv.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.Yd;c.label===jD&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.RD,jD));this.a.mode=_.ye};vL=function(a,b){var c=a.mode;a.mode=c===_.bg?_.bg:_.ye;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};wL=function(){};_.wj.prototype.f=_.TD(0,function(){return this.keyInfo});var WD=[112,115,115,104,0,0,0,0];
|
|
257
|
+
_.kE.prototype.de=function(){return this.oa?this.oa-this.Ca+1:null};_.kE.prototype.f=function(){return this.keyInfo};_.uE.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.t=_.xE.prototype;_.t.se=function(a,b){var c=wE(a).childNodes[0];return b&&c.tagName!==b?null:c};_.t.Ka=function(a,b){var c=this.X(a,b);return 1!==c.length?null:c[0]};_.t.X=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.t.Vb=_.eh(1);_.t.Bc=_.eh(3);
|
|
258
|
+
_.t.ra=function(a){return a.childNodes.every(function(b){return b.tagName===_.da||"#cdata"===b.tagName})?a.childNodes.map(function(b){return b.textContent}).join(""):null};_.t.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.t.V=_.eh(5);_.t.Ue=_.eh(7);_.t.tf=_.eh(11);_.t.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.t.ff=_.eh(13);_.t.ef=_.eh(15);_.t.fd=_.eh(9);_.t.uf=_.eh(17);_.t.ye=_.eh(19);_.xL=0;_.t=_.BE.prototype;
|
|
259
|
+
_.t.track=function(a){null!=this.player&&DE(this);a&&(this.player=a,this.player.on(_.Uf,this.bd,this))};_.t.release=function(){DE(this);this.S=[];this.f=this.h=null};
|
|
260
|
+
_.t.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.w(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
261
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(AE)}GE(this);this.bd();this.player&&this.player.trigger(new _.L(_.Mg))};_.t.clear=function(){this.S=[];GE(this);this.player&&(this.player.trigger(new _.L(_.Mg)),this.player.trigger(new _.L(_.ed)))};
|
|
262
|
+
_.t.bd=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.gd,
|
|
263
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};RE.prototype.Yb=function(){return this.h};RE.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.t=_.TE.prototype;_.t.Ec=function(){return this.L};_.t.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.t.getPresentationStartTime=function(){return this.G};_.t.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
264
|
+
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.t.le=function(){return!this.l};gF.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};gF.prototype.cues=function(){return this.a};kF.prototype.release=function(){this.f=this.j=this.h=this.a=null};kF.prototype.l=function(a){fE(this.a,a);lF(this)};
|
|
265
|
+
mF.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.$a().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=nF(this);return{value:a,done:!a}};_.t=_.oF.prototype;_.t.destroy=function(){this.a=[];return Promise.resolve()};
|
|
266
|
+
_.t.dd=function(a){for(var b=this.a.length-1;0<=b;--b){var c=this.a[b];if(a>=c.startTime&&a<c.endTime)return c.position}if(this.a.length&&a<this.a[0].startTime)return this.a[0].position;this.g.warn("No Segment found for "+a+". We have "+this.a.length+" references");for(a=0;a<this.a.length;a++)b=this.a[a],this.g.debug("SegmentIndex Ref "+a+" start: "+b.startTime+" end: "+b.endTime+" pos: "+b.position);return null};
|
|
267
|
+
_.t.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.t.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Ga-=a};
|
|
268
|
+
_.t.Fd=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.t.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
269
|
+
_.t.ta=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.wj(f.position,g.startTime,g.endTime,g.$a,g.Ca,g.oa,g.Ga,g.keyInfo,g.jd,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.te,g.Qa),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
270
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.wj(d++,f.startTime,f.endTime,f.$a,f.Ca,f.oa,f.Ga,f.keyInfo,f.jd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.te,f.Qa),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.w(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.wj(e-d--,f.startTime,f.endTime,f.$a,f.Ca,f.oa,f.Ga,f.keyInfo,f.jd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
271
|
+
f.te,f.Qa));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.t.replace=function(a){this.a=a};tF.prototype.release=function(){this.h=null;this.f=function(){}};xF.prototype.release=function(){this.h&&(this.h.release(),this.h=null);null!=this.w&&(this.w.stop(),this.w=null);this.f&&(this.f.release(),this.f=null);this.a=this.H=this.G=null;this.o=!1};xF.prototype.nf=function(){this.A=!0;wF(this)};yF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
272
|
+
CF.prototype.release=function(){this.f&&(this.f.release(),this.f=null);null!=this.h&&(this.h.release(),this.h=null);this.j=function(){};this.a=null;this.o=function(){};this.w=!1};JF.prototype.release=function(){this.f&&(this.f.release(),this.f=null);this.j&&(this.j.release(),this.j=null);this.o&&(this.o.stop(),this.o=null);this.h=this.f=this.a=this.l=null;this.A=function(){}};OF.prototype.release=function(){this.h.stop();for(var a=_.w(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
|
|
273
|
+
QF.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};QF.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={Jf:d.Jf,Ce:d.Ce},f=e.next()){f=f.value;d.Jf=this.o.get(f)||null;d.Ce=PF(f,a);this.o.set(f,d.Ce);var g=this.w.find(function(h){return function(l){return l.Oc===h.Jf&&l.Nc===h.Ce}}(d));g&&g.Gc(f,b&&0===c)}};_.x($F,_.xm);
|
|
274
|
+
$F.prototype.destroy=function(){this.B=this.h=this.A=null;this.o.clear();this.l.clear();this.j.clear();this.w.clear();null!=this.a&&(this.a.stop(),this.a=null);return this.C.destroy()};_.t=iG.prototype;_.t.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.t.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.t.Ra=function(){return this.a};
|
|
275
|
+
_.t.ja=function(){return this.f};_.t.Nb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.t.Ea=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x(CG,_.ll);_.t=CG.prototype;_.t.initialize=function(a){this.m=a};_.t.release=function(){this.h=[];this.a.clear();this.f.clear()};_.t.load=function(){};_.t.destroy=function(){this.release();this.m=null};_.t.getVideoTracks=function(){return DG(this,_.Kk)};_.t.getAudioTracks=function(){return DG(this,_.Jk)};_.t.la=function(){return DG(this,_.U)};_.t.ma=function(){return this.a.get(_.Kk)||null};_.t.Ya=function(){return this.a.get(_.Jk)||null};_.t.Va=function(){return this.a.get(_.U)||null};
|
|
276
|
+
_.t.vb=function(){return this.f.get(_.Kk)||null};_.t.Hb=function(){return this.f.get(_.Jk)||null};_.t.Ib=function(){return this.f.get(_.U)||null};_.t.La=function(){return EG(this,_.Kk)};_.t.qa=function(){return EG(this,_.Jk)};_.t.Ba=function(){return EG(this,_.U)};_.t.Db=function(a){this.m&&FG(this,_.Kk,a)};_.t.Ha=function(a){this.m&&FG(this,_.Jk,a)};_.t.Wa=function(a){this.m&&FG(this,_.U,a)};
|
|
277
|
+
_.t.ob=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)LG(this,a,b);else{var c=b,d=EG(this,_.Kk);d&&(this.g.info("Unset video rendition."),d.trickPlay?this.g.info("Enabling ABR for trick play tracks is not supported"):(this.g.info("Enable ABR."),KG(this.m,null,c)))}};_.t.Bb=function(a){this.m&&(a?(IG(this,a,_.Jk),HG(this,a,_.Jk)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.Jk,a),bL(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
278
|
+
_.t.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c["return"]()})};_.t.wa=function(){return!!this.m&&this.m.wa()};
|
|
279
|
+
_.t.Cb=function(a){if(this.m){var b=a;if(!a){var c=this.Va();if(c&&c.track.kind!==_.ue){a=this.la().find(function(e){return e.kind===_.ue&&e.language===c.track.language});if(!a){var d=this.qa();d&&(a=this.la().find(function(e){return e.kind===_.ue&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?OG(this,b):PG(this)}};CG.prototype.setTextRendition=CG.prototype.Cb;CG.prototype.isAbrEnabled=CG.prototype.wa;CG.prototype.addTextTrack=CG.prototype.addTextTrack;CG.prototype.setAudioRendition=CG.prototype.Bb;
|
|
280
|
+
CG.prototype.setVideoRendition=CG.prototype.ob;CG.prototype.setTextTrack=CG.prototype.Wa;CG.prototype.setAudioTrack=CG.prototype.Ha;CG.prototype.setVideoTrack=CG.prototype.Db;CG.prototype.getTextTrack=CG.prototype.Ba;CG.prototype.getAudioTrack=CG.prototype.qa;CG.prototype.getVideoTrack=CG.prototype.La;CG.prototype.getLoadingTextRendition=CG.prototype.Ib;CG.prototype.getLoadingAudioRendition=CG.prototype.Hb;CG.prototype.getLoadingVideoRendition=CG.prototype.vb;CG.prototype.getTextRendition=CG.prototype.Va;
|
|
281
|
+
CG.prototype.getAudioRendition=CG.prototype.Ya;CG.prototype.getVideoRendition=CG.prototype.ma;CG.prototype.getTextTracks=CG.prototype.la;CG.prototype.getAudioTracks=CG.prototype.getAudioTracks;CG.prototype.getVideoTracks=CG.prototype.getVideoTracks;UG.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Hj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};UG.prototype.h=function(a,b){var c=_.Hj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};UG.prototype.f=function(){this.a.resetCaptionStream()};_.VG.prototype.init=function(){};_.VG.prototype.h=function(){};_.VG.prototype.f=function(){};_.t=_.XG.prototype;
|
|
282
|
+
_.t.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](hE));for(e=1;e<d.length;++e)d[e].p["catch"](hE),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.a=null;a.C=null;a.f={};a.w={};a.G=
|
|
283
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.Uq,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.tl(g.mimeType,g.codecs);if(h===e.TEXT)d.pc(l);else{var m=new Map;m.set(h,l);if((!_.gu(l)||!b||g.aesEncrypted)&&_.sl(l,h)){var n=_.sl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}$G(d,m)}});_.B(f)})};_.t.lj=function(){this.g.debug(nD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
284
|
+
_.t.Ci=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.M};_.t.pc=function(a){this.a||(this.a=new iG(this.L,this.C));jG(this.a,a)};_.t.Pe=function(){return this.o?this.o.readyState===_.re:!0};_.t.Ra=function(a){return a===_.R?this.a.Ra():(a=aH(this,a))?a.Ra():null};_.t.ja=function(a){return a===_.R?this.a.ja():(a=aH(this,a))?a.ja():null};_.t.Nb=function(a,b,c){return a===_.R?this.a.Nb(b):(a=aH(this,a))?a.Nb(b,!1,c):!1};
|
|
285
|
+
_.t.Ea=function(a,b){if(a===_.R)return this.a.Ea(b);var c=aH(this,a);return c?c.Ea(b):0};_.t.gg=function(){var a={};a.total=new _.wm(this.j.buffered,"total");a.audio=aH(this,_.Zc);a.video=aH(this,_.r);var b=[];this.a&&(b=[{start:this.a.Ra(),end:this.a.ja()}]);a.text=tE(b,_.R);return a};
|
|
286
|
+
_.t.Oe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.f[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.R?b=kG(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.pc(_.rg),mG(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(cH(this,_.Zc,this.Yf.bind(this,_.Zc,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(cH(this,
|
|
287
|
+
_.r,this.Yf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.pc(_.rg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&mG(h.a,p,c,d,h.f.video.timestampOffset)})),b=cH(this,a,this.Yf.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(KC,c,d,MC,bH(h,a));else if(a===_.Zc&&null!==c&&null!==d)EE(h.B),null!==c&&null!==d&&h.g.debug(JC,c,d,MC,bH(h,a));else if(a===_.r&&null!==c&&null!==
|
|
288
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.G[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.P&&0===l.timestampOffset)return h.g.warn(PC+u+vC+(a+DC)+(c+uC)+(p+CC)),p=cH(h,a,function(){h.Ch(a,u)}),q=cH(h,a,h.zh.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.t.Bh=function(a){var b=this.ja(_.r)||0;lG(this.a,a,b)};
|
|
289
|
+
_.t.th=function(){this.a&&lG(this.a,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.R?this.a.remove(b,c):cH(this,a,this.Ah.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ra(a),f=d.ja(a);null!==e&&null!==f&&HE(d.B,e,f)}else a===_.Zc&&FE(d.B)})};_.t.clear=function(a){if(a===_.R){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return cH(this,a,this.Ah.bind(this,a,0,this.o.duration))};
|
|
290
|
+
_.t.flush=function(a){return a===_.R?Promise.resolve():cH(this,a,this.zh.bind(this,a))};_.t.nj=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.Uq;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=dH(e,a,b,c,d);e.K&&(g=g.concat(dH(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.t.endOfStream=function(a){var b=this;return gH(this,function(){b.Pe()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.t.Zf=function(a){var b=this;gH(this,function(){b.o.duration=a})};
|
|
291
|
+
_.t.getDuration=function(){return this.o.duration};_.t.Yf=function(a,b){this.g.debug(LC+a+wC);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(XC+a,c),c;}this.g.debug(RC+a+wC)};_.t.Ah=function(a,b,c){if(c<=b)this.ed(a);else{this.g.debug(mD+a+zC,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(ZC+a+xC,b,c,d),d;}this.g.debug(TC+a+zC,b,c)}};
|
|
292
|
+
_.t.Nk=function(a){try{this.g.debug(IC+a+wC);var b=this.f[a].appendWindowStart,c=this.f[a].appendWindowEnd;this.f[a].abort();this.f[a].appendWindowStart=b;this.f[a].appendWindowEnd=c}catch(d){throw this.g.warn(WC+a+wC,d),d;}this.g.debug(QC+a+wC);this.ed(a)};_.t.zh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(bD+a),this.j.currentTime-=.001):this.g.warn(rD+a+BC+this.j.readyState)}catch(b){throw this.g.warn(YC+a,b),b;}this.g.debug(SC+a);this.ed(a)};
|
|
293
|
+
_.t.Ch=function(a,b){0>b&&(b+=.001);try{this.g.debug(qD+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(aD+a,b,c),c;}this.g.debug(VC+a,b);this.ed(a)};_.t.Pk=function(a,b,c){try{this.g.debug(oD+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn($C+a,b,c,d),d;}this.g.debug(UC+a,b,c);this.ed(a)};_.t.Ok=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
294
|
+
_.t.ed=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(uD+a),fH(this,a))};_.t.getTextDisplayer=function(){return this.C};var ZG=window.URL.createObjectURL;_.t=_.yH.prototype;_.t.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.t.init=function(a){this.A=a};
|
|
295
|
+
_.t.chooseTrack=function(){var a=zH(this,!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=zH(this,null,this.f),a=[a[0]]);this.h=Date.now();this.C=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
296
|
+
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.t.enable=function(){this.l=!0};_.t.disable=function(){this.l=!1};
|
|
297
|
+
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);VF(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
298
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.t.playbackRateChanged=function(a){this.o=a};
|
|
299
|
+
_.t.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=dE(this.j,_.te);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}return WF(this.w,this.a.defaultBandwidthEstimate)};_.t.setTracks=function(a){this.f=a};_.t.setCmsdManager=function(a){this.j=a};_.t.configure=function(a){this.a=a};_.t.reset=function(){this.B=!1;this.w=new UF;var a=this.chooseTrack();a&&this.A(a)};DH.prototype.clear=function(){this.a.clear()};GH.prototype.add=function(a,b){var c=void 0===b?!0:b;if(JH(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Jh("Dropping variant due to incompatible codecs for the current adaptation set. This may be because CodecSwitchingStrategy is set to PREVENT or SourceBuffer.changeType() is not available on this platform. Variant dropped:",a,"because it is not compatible with",this.f);return!1};GH.prototype.values=function(){return this.a.values()};LH.prototype.create=function(a){var b=this,c=this.a===_.fg&&zE(),d=a.filter(function(e){return JH(b.f,e,!c)});return d.length?new GH(d[0],d):this.h.create(a)};
|
|
300
|
+
KH.prototype.create=function(a){var b=MH(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=NH(a,this.a);0<c.length?(a=c,b=!0):_.Jh("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(e){return e.primary}),0<b.length&&(a=b));this.f&&(b=iH(a,this.f),b.length?a=b:_.Jh("No exact match for the channel count could be found."));b=OH(a,this.l);b.length?a=b:_.Jh("No exact match for spatial audio could be found.");b=this.h===_.fg&&zE();c=new GH(a[0]);a=_.w(a);
|
|
301
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};RH.prototype.getState=function(){return this.a};var QH=0,PH=1;TH.prototype.release=function(){this.f.release()};_.t=VH.prototype;
|
|
302
|
+
_.t.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](hE));for(e=1;e<d.length;++e)d[e].p["catch"](hE),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.C&&b.push(this.C.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.f=null;a.C=null;a.a={};a.w={};a.H=
|
|
303
|
+
{};a.I=null;a.M=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.Uq,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.tl(g.mimeType,g.codecs);if(h===e.TEXT)d.pc(l);else{var m=new Map;m.set(h,l);if((!_.gu(l)||!b||g.aesEncrypted)&&_.sl(l,h)){var n=_.sl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}XH(d,m)}d.h[h]=[]});_.B(f)})};_.t.lj=function(){this.g.debug(nD);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
304
|
+
_.t.Ci=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.t.pc=function(a){this.f||(this.f=new iG(this.J,this.C));jG(this.f,a)};_.t.Pe=function(){return this.o?this.o.readyState===_.re:!0};_.t.Ra=function(a){return a===_.R?this.f.Ra():(a=YH(this,a))?a.Ra():null};_.t.ja=function(a){return a===_.R?this.f.ja():(a=YH(this,a))?a.ja():null};_.t.Nb=function(a,b,c){return a===_.R?this.f.Nb(b):(a=YH(this,a))?a.Nb(b,!1,c):!1};
|
|
305
|
+
_.t.Ea=function(a,b){if(a===_.R)return this.f.Ea(b);var c=YH(this,a);return c?c.Ea(b):0};_.t.gg=function(){var a={};a.total=new _.wm(this.j.buffered,"total");a.audio=YH(this,_.Zc);a.video=YH(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ra(),end:this.f.ja()}]);a.text=tE(b,_.R);return a};
|
|
306
|
+
_.t.Oe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.a[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.R?b=kG(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.pc(_.rg),mG(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push($H(this,_.Zc,this.Xf.bind(this,_.Zc,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push($H(this,
|
|
307
|
+
_.r,this.Xf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.pc(_.rg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&mG(h.f,p,c,d,h.a.video.timestampOffset)})),b=$H(this,a,this.Xf.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(KC,c,d,MC,ZH(h,a));else if(a===_.Zc&&null!==c&&null!==d)EE(h.B),null!==c&&null!==d&&h.g.debug(JC,c,d,MC,ZH(h,a));else if(a===_.r&&null!==c&&null!==
|
|
308
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.U&&0===l.timestampOffset)return h.g.warn(PC+u+vC+(a+DC)+(c+uC)+(p+CC)),p=$H(h,a,function(){aI(h,a,u)}),q=$H(h,a,h.xh.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.t.Bh=function(a){var b=this.ja(_.r)||0;lG(this.f,a,b)};
|
|
309
|
+
_.t.th=function(){this.f&&lG(this.f,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.R?this.f.remove(b,c):$H(this,a,this.yh.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ra(a),f=d.ja(a);null!==e&&null!==f&&HE(d.B,e,f)}else a===_.Zc&&FE(d.B)})};_.t.clear=function(a){if(a===_.R){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return $H(this,a,this.yh.bind(this,a,0,this.o.duration))};
|
|
310
|
+
_.t.flush=function(a){return a===_.R?Promise.resolve():$H(this,a,this.xh.bind(this,a))};_.t.nj=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.Uq;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,gI(g,a,e,f),2)}l=n.f;m=bI(g,a,b,c,d,l);g.M&&(m=m.concat(bI(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.t.endOfStream=function(a){var b=this;return eI(this,function(){b.Pe()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
311
|
+
_.t.Zf=function(a){var b=this;eI(this,function(){b.o.duration=a})};_.t.getDuration=function(){return this.o.duration};_.t.Xf=function(a,b){this.g.debug(LC+a+wC);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(XC+a,c),c;}this.g.debug(RC+a+wC)};_.t.yh=function(a,b,c){if(c<=b)this.zc(a);else{this.g.debug(mD+a+zC,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(ZC+a+xC,b,c,d),d;}this.g.debug(TC+a+zC,b,c)}};
|
|
312
|
+
_.t.xh=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(bD+a),this.j.currentTime-=.001):this.g.warn(rD+a+BC+this.j.readyState)}catch(b){throw this.g.warn(YC+a,b),b;}this.g.debug(SC+a);this.zc(a)};_.t.Mk=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.t.zc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(uD+a),dI(this,a))};_.t.getTextDisplayer=function(){return this.C};var WH=window.URL.createObjectURL;hI.prototype.release=function(){this.a=this.h=null;this.f=function(){}};hI.prototype.l=function(a){var b=this.a,c=this.h.periods;a=IE(c,a)||c[0];b!==a&&this.f(a);this.a=a};jI.prototype.getConfiguration=function(){return this.j};jI.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};jI.prototype.set=function(a,b){this.h=a;nI(this,b)};var qI=new _.co(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.t=_.tI.prototype;_.t.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,EI(e),b.push(FI(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.G=null;a.A.clear();a.h=null;a.f=!0;_.B(f)})};
|
|
313
|
+
_.t.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Wb();c=IE(a.j.periods,b+_.Xv);if(!c)throw new _.P(_.Q,5,5006,"No period found.");d=a.D.sg(c);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.P(_.Q,5,5005,"No streams chosen.");a.C=!d.variant&&!!d.text;return _.y(e,aJ(a,d.variant?d.variant.audio:null,d.variant?d.variant.video:null,d.text,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.D&&a.D.an&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
314
|
+
a.D.an());_.B(e)})};_.t.resume=function(){if(!QI(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,CI(this,b,0)};
|
|
315
|
+
_.t.cc=function(a){var b=this,c,d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=NI(a);if(a.zb||null==a.pb||a.xc)return m["return"]();a.pb=null;if(!a.hc){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,SI(b,a,a.Bf,a.Me),3);case 3:return m["return"]();case 2:_.C(m,4);d=fJ(b,a);null!=d&&(CI(b,a,d),a.nd=!1);_.uh(m,5);break;case 4:return e=_.E(m),_.y(m,qJ(b,e),6);case 6:return m["return"]();case 5:vJ(b,a);if(!RI(b)){m.F(0);break}if(b.D.configuration.um){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
316
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.pb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(m,b.D.W.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.D.W.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.D.Oi();_.B(m)}})};
|
|
317
|
+
_.t.yn=function(a,b,c,d){var e=VD(d.reader),f=VD(d.reader),g=_.nn(d.reader),h=_.nn(d.reader),l=_.nn(d.reader),m=_.nn(d.reader);d=_.rn(d.reader,d.reader.Sa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.Ti();else this.D.onEvent(new _.L("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
|
|
318
|
+
_.t.zo=function(a){var b=this,c=!1,d=0;(new _.sn).N(_.Ve,_.tn).N(_.ug,_.tn).N(_.Qe,_.tn).N(_.Ue,_.tn).N(_.kg,_.tn).Z(_.mg,_.un).N("encv",function(e){e.reader.skip(78);_.tn(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.nn(e.reader),g=_.nn(e.reader);c=f!==g;b.g.debug("hSpacing\x3d"+f+", vSpacing\x3d"+g+", updatePASP\x3d"+c);e.parser.stop()}).parse(a.data);c&&(a=new _.en(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.x(BJ,_.Im);_.t=BJ.prototype;_.t.init=function(a,b){var c=a.getMedia();_.Im.prototype.init.call(this,a,b);jK(this,c)};_.t.namespace=function(){return BD};_.t.setSeekInterceptor=function(a){this.bh=a||null};_.t.setPlaybackSessionId=function(a){this.Xg=a};_.t.Qh=function(){return new CG};_.t.getState=function(){return this.fb};_.t.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
319
|
+
_.t.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){MG(a,!1);a.fe=!1;if(!a.aa)return c["return"]();a.log.debug("Unload player with source",a.aa);(b=a.getTrackManager())&&b.release();return a.G===AK?c["return"]():_.y(c,lK(a),2)}a.aa=null;a.$g=0;a.Vc=null;a.ha=null;a.getNetworkEngine().headers["delete"](wD);_.B(c)})};_.t.release=function(){var a=this;return _.I(function(b){if(a.da)return b["return"](a.da);a.da=EJ(a);a.da["finally"](function(){a.da=null});return b["return"](a.da)})};
|
|
320
|
+
_.t.getBufferInfo=function(a){if(this.L){var b=this.L.gg(),c=new _.wm(void 0,a);switch(a){case _.Kk:return b.video?b.video:c;case _.Jk:return b.audio?b.audio:c;case _.U:return b.text?b.text:c}return b.total?b.total:c}return this.Xc?(b=CE(this.Xc),tE(b,a)):_.Im.prototype.getBufferInfo.call(this,a)};_.t.getPosition=function(){var a=this.je,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.t.getMediaPosition=function(){return this.B?LF(this.B):_.Im.prototype.getMediaPosition.call(this)};
|
|
321
|
+
_.t.seek=function(a){if(this.bh&&!this.bh(a))return Promise.resolve();var b=this.je;b=b.a?a+b.a.Yb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.Im.prototype.seek.call(this,b)};_.t.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.t.getDuration=function(){var a=this.je,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
322
|
+
_.t.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.Im.prototype.destroy.call(a),2);if(a.G===AK)return b["return"]();a.log.debug("Destroying player...");a.G=AK;iK(a);a.l&&(a.l.release(),a.l=null);a.Wd=null;a.h=null;_.B(b)})};_.t.getTimeline=function(){return this.Wd};
|
|
323
|
+
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=new _.ok,b.o.a=c,_.C(z,2),gK(b),b.$=_.Fb,_.y(z,nK(b),4);case 4:return CH(b.o,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.aa=_.Mq(d),b.configuration=_.Gm(b.Ja,d),b.log.info("Loading playlist configurations",a),b.Wd=FJ(b.configuration),_.y(z,oK(b,c),5);case 5:return CH(b.o,c),e=a.map(function(A){return pK(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
324
|
+
case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.P(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.gc)throw new _.P(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.P(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.TE({version:2},null,0,m);p=f.map(function(A){return vG(A.manifest)});
|
|
325
|
+
q=yG(p,n);b.f=q;u=b;return _.y(z,qK(b,q,b.configuration),7);case 7:return u.w=z.f,CH(b.o,c),_.y(z,rK(b,c),8);case 8:CH(b.o,c);KI(b.a,q);HJ(b,q);c.resolve();_.uh(z,0);break;case 2:v=_.E(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:sK(b,v,c),_.B(z)}})};
|
|
326
|
+
_.t.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){gK(b);if(b.$!==_.Fb)throw new _.P(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,zK(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;KI(b.a,c.manifest);RI(b.a)&&b.a.resume();HJ(b,c.manifest);_.B(d)})};_.t.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
327
|
+
_.t.wh=function(){var a=this;return _.I(function(b){gK(a);if(!a.qf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.qf);a.qf=null;return _.y(b,rK(a,null),0)})};_.t.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return gK(b),_.bp("preload.start"),b.log.info("Preloading asset",a),_.y(c,tK(b,a,!1),2);b.qf=a;b.log.info("Preloaded asset",a);_.bp("preload.end");_.cp("preload","preload.start","preload.end");_.B(c)})};
|
|
328
|
+
_.t.load=function(a){return tK(this,a)};_.t.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,hK(a),2);a.configuration=a.Ja;iK(a);_.B(b)})};_.t.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.t.Xi=function(){this.log.debug("User seeking finished");this.J&&TK(this);UK(this)};
|
|
329
|
+
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:UE(b),end:dF(b)}}b=this.je;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.t.Ec=function(){return this.f?this.f.presentationTimeline.Ec():null};_.t.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
330
|
+
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===AJ){if(_.wk()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.I.set(a,b);c.play()}else this.I.set(a,b);if((c=this.I.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.r);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.qc&&(c.g.debug("Engaging trick mode stream",
|
|
331
|
+
d),_.HI(c,d,!1,0),e.qc=f);else if(f=e.qc)c.g.debug("Restoring non-trick-mode stream",f),e.qc=null,_.HI(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.t.la=function(){if(this.f&&this.B){var a=FK(this);if(null==a)a=null;else{if(!FH(this.P,a).text){var b=_.xH(a.textStreams,this.Sd,this.bf,this.Kd);b.length&&(b=b[0],FH(this.P,a).text=b)}a=FH(this.P,a).text}b=[];for(var c=_.w(mL(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=uH(d);e.active=d===a;b.push(e)}return b}return[]};_.t.getPeriods=function(){return this.f.periods};
|
|
332
|
+
_.t.getStats=function(){if(this.G!==AJ)return _.tq();UK(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.H,c=Number(a.totalVideoFrames);b.l=Number(a.droppedVideoFrames);b.j=c}if(this.G===AJ){if(a=WK(this))this.H.o=a.bandwidth;a&&a.video&&(b=this.H,c=a.video.height||NaN,b.w=a.video.width||NaN,b.h=c);a=this.h.getBandwidthEstimate();this.H.f=a}return this.H.getStats()};_.t.getCueTimeline=function(){return this.K};
|
|
333
|
+
_.t.getTimelineCues=function(){return this.K?jF(this.K,cL(this)):[]};_.t.resetAbr=function(){this.h&&this.h.reset()};_.t.ae=function(){return this.h};
|
|
334
|
+
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){if(g.G!==AJ)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=FK(g);l=_.Uq;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.P(1,4,4040);u=new _.wj(1,0,q,function(){return[a]},0,null,0);v={id:g.dh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
335
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(H){return 1===H?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.FD,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.gf.add(v);h.textStreams.push(v);return _.y(A,DI(g.a,v),
|
|
336
|
+
2)}if(z=_.wI(g.a,_.R))FH(g.P,h).text=z;g.gf["delete"](v);g.log.debug("Choosing new streams after adding a text stream");hL(g,h);HK(g);return A["return"](uH(v))})};
|
|
337
|
+
_.t.Lk=function(a){this.log.debug(_.JD,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=kL(this,a);this.log.debug("onChooseStreams_, chose variant ",b.variant);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{variant:null,text:null}}};
|
|
338
|
+
_.t.Kk=function(){this.log.debug("canSwitch_");this.ya=!1;this.configuration.abr.enabled&&this.h.enable();this.ia&&(II(this.a,this.ia,this.wj,this.vj),this.ia=null);this.ca&&(_.HI(this.a,this.ca,!0,0),this.ca=null)};_.t.yo=function(){this.A&&this.A.update()};_.t.mn=function(){this.B&&this.B.j.nf()};
|
|
339
|
+
_.t.Sj=function(a,b,c){if((void 0===c?"":c)===HD)return HK(this),this.wa()||(this.configuration.abr.enabled=!0,this.h.enable()),hL(this,b,!1),!0;if(c=b.variants.some(function(g){var h=!1,l=g[a.type];l&&(h=g.allowedByApplication&&l.id!==a.id,a.type===_.Zc&&(h=h&&l.language===a.language));return h})&&this.wa()){for(var d=_.w(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}HK(this);this.wa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
340
|
+
hL(this,b)}return c};_.t.Zm=function(){this.log.debug("endOfStream called by streaming engine");this.fe=!0};_.t.onError=function(a){if(this.G!==AK&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.se,{detail:a});a.severity===_.Q&&DJ(this,_.Fq);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.t.Wf=function(a){a.type===_.ke?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Sg?BK(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.bc,a.type)))};_.t.wa=function(){return this.configuration.abr.enabled};
|
|
341
|
+
_.t.no=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Uc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.wa();return _.y(n,b.Uc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.N.ta(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,TI(b.a),3);case 3:g=WK(b);case 4:return h=!1,_.C(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,nL(b,f,g),9);case 9:_.uh(n,6);break;case 7:return l=_.E(n),b.log.info("Switch failed"),
|
|
342
|
+
_.y(n,b.Uc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.h.enable(),PI(b.a,!0),b.aa[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.pd,{newManifest:f.url})),_.B(n))}})};var AK=0,zJ=1,AJ=2,GK=[_.jf,_.Be];oL.prototype.a=function(){return BD};
|
|
343
|
+
oL.prototype.canPlay=function(a,b){if(_.Fl())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.Lu||_.Mu(a.url)in _.Nu?!0:!1:!1;if(d&&e){if(_.wk(2))return 1;if(_.Gl()&&c===_.hm){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Jh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
344
|
+
oL.prototype.f=function(a){return a===_.oa||a===_.Fb};oL.prototype.create=function(){return new BJ};_.Th(new oL);_.Os(function(){_.Oh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Nh("Patching Chromecast MSE bugs."),tL();else if(_.Gl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;rL();10>=a?(_.Nh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Nh("Patching Safari 11 \x26 12 MSE bugs."),pL(),qL()):(_.Nh("Patching Safari 13 MSE bugs."),pL())}else _.wk(2)||_.wk(3)||
|
|
345
|
+
_.wk(4)?sL():_.Nh("Using native MSE as-is.");else _.Nh("No MSE implementation available.")});_.x(uL,_.Jv);_.t=uL.prototype;
|
|
346
|
+
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Jh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.T.Rg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.rd}catch(g){f.align="middle"}e.writingMode===_.Hg?f.vertical="lr":e.writingMode===_.Jg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.w(a);for(a=d.next();!a.done;a=d.next())b(a.value);a=c.slice().sort(function(e,f){return e.startTime!==f.startTime?
|
|
347
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.t.remove=function(a,b){if(!this.a)return!1;vL(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.t.isTextVisible=function(){return this.a.mode===_.bg};_.t.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.bg:_.ye)};_.t.destroy=function(){this.a&&vL(this.a,function(){return!0});this.a=null;return Promise.resolve()};wL.prototype.a=function(){return!0};wL.prototype.create=function(a){return new uL(a)};_.kq("single-native",new wL);};
|
|
334
348
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
335
349
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
336
350
|
else{_=this.clpp._;(f.call(g,this));}
|