@castlabs/prestoplay 6.18.0 → 6.19.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 +32 -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 +115 -114
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +581 -577
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -75
- package/cjs/cl.externs.js +175 -293
- package/cjs/cl.freewheel.js +23 -24
- package/cjs/cl.hls.js +70 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +28 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +313 -314
- 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 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -27
- 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.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +90 -89
- package/cl.conviva.js +27 -27
- package/cl.core.js +475 -474
- package/cl.crypto.js +9 -9
- package/cl.dash.js +72 -71
- package/cl.externs.js +172 -294
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +277 -274
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- 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 +9 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +14 -0
- package/package.json +1 -1
- package/typings.d.ts +379 -384
package/cjs/cl.mse.js
CHANGED
|
@@ -1,321 +1,320 @@
|
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
b
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
lE=function(a,b){
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
uE=function(a
|
|
51
|
-
|
|
52
|
-
_.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
m);_.
|
|
58
|
-
|
|
59
|
-
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=
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"variant.video",
|
|
67
|
-
|
|
2
|
+
var f=function(window){var eB,fB,gB,hB,iB,jB,kB,lB,mB,nB,oB,pB,qB,rB,sB,tB,uB,vB,wB,xB,yB,zB,AB,BB,CB,DB,EB,FB,GB,HB,IB,JB,KB,LB,MB,NB,OB,PB,SB,TB,UB,VB,WB,XB,YB,ZB,$B,aC,bC,dC,eC,fC,gC,hC,iC,jC,mC,nC,pC,qC,rC,sC,tC,uC,vC,xC,yC,zC,AC,FC,GC,HC,IC,JC,KC,LC,NC,RC,SC,UC,VC,WC,XC,ZC,$C,aD,bD,hD,mD,pD,eD,oD,qD,rD,sD,tD,uD,wD,xD,yD,vD,AD,zD,BD,CD,FD,GD,HD,ED,DD,ID,MD,OD,LD,PD,KD,ND,JD,RD,QD,SD,TD,UD,VD,WD,$D,dE,hE,iE,jE,kE,mE,nE,oE,pE,qE,sE,uE,vE,wE,xE,yE,zE,AE,EE,CE,GE,HE,IE,KE,JE,LE,NE,ME,TE,UE,QE,OE,RE,SE,VE,WE,ZE,YE,$E,aF,
|
|
3
|
+
bF,PE,cF,XE,eF,fF,gF,hF,iF,kF,jF,mF,lF,oF,pF,qF,tF,sF,rF,uF,wF,vF,xF,yF,BF,CF,DF,EF,HF,FF,GF,IF,JF,MF,LF,KF,OF,NF,QF,UF,WF,XF,bG,eG,gG,iG,RF,kG,nG,oG,pG,rG,sG,uG,vG,xG,jG,zG,$F,BG,AG,YF,hG,EG,CG,wG,yG,GG,FG,DG,NG,OG,IG,QG,JG,LG,TG,SG,MG,RG,UG,ZF,tG,KG,qG,aG,cG,TF,HG,dG,PG,lG,mG,VG,XG,WG,ZG,YG,aH,$G,bH,cH,dH,eH,fH,gH,hH,iH,jH,lH,mH,nH,pH,qH,oH,rH,sH,tH,uH,vH,wH,xH,zH,AH,yH,IH,HH,JH,KH,MH,PH,QH,RH,SH,TH,WH,XH,VH,cI,jI,UH,iI,kI,dI,eI,fI,pI,lI,aI,$H,ZH,bI,nI,oI,gI,hI,WI,uI,ZI,$I,aJ,eJ,bJ,EH,CH,FH,DH,
|
|
4
|
+
GH,BH,lJ,jJ,nJ,XI,VI,dJ,mJ,kJ,pJ,cJ,gJ,rI,fJ,qJ,UI,rJ,sJ,vJ,YI,TI,uJ,tJ,mI,oJ,iJ,xJ,wI,hJ,wJ,YH,yJ,tI,sI,zJ;eB=" and the media start time is ";fB=" between media times and segment times for ";gB=" buffer";hB=" buffer. Range:";iB=" is being or has been set up";jB=" range:";kB=" with element state: ";lB=". Adjusting timestampOffset.";mB=". The segment start time is ";nB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";oB="\x3c/LA_URL\x3e";pB="\x3cLA_URL\x3e";qB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
|
|
5
|
+
rB="Aborting operations for ";sB="Appended audio segment ";tB="Appended video segment ";uB="Appending data to ";vB="Buffer:";wB="Cannot get segment, period ID unknown";xB="Choosing new streams after key status change";yB="Detected a delta of ";zB="Done Aborting operations for ";AB="Done Appending data to ";BB="Done Flushing buffer for ";CB="Done Removing data from ";DB="Done Setting append window for ";EB="Done Setting timestamp offset for ";FB="Failed to abort operations for ";GB="Failed to append data for ";
|
|
6
|
+
HB="Failed to flush buffer for ";IB="Failed to remove data from ";JB="Failed to set append window for ";KB="Failed to set timestamp offset for ";LB="Flushing buffer for ";MB="IterateSegmentReference";NB="Jumping forward";OB="MediaSource threw QuotaExceededError:";PB="No more scheduled operations for ";_.QB="No stream with id";_.RB="Player is in ERROR state and can not switch to ";SB="PrestoPlay TextTrack";TB="QuotaExceededError";UB="Removing audio from variant - audio not compatible with platform";
|
|
7
|
+
VB="Removing data from ";WB="Reset transmuxers.";XB="Setting append window for ";YB="Setting playback rate to\x3d";ZB="Setting timestamp offset for ";$B="Skip buffer flush for ";aC="Starting next operation for ";bC="Update-End received for ";_.cC="Updating manifest...";dC="bufferBehind\x3d";eC="bufferedBehind\x3d";fC="calling onCanSwitch()...";gC="cannot find segment";hC="clpp.mse.Player";iC="currentPeriod.startTime\x3d";jC="failed to get buffered range for ";_.kC="getSegmentNextReference";_.lC="iterateSegmentReference";
|
|
8
|
+
mC="key-restriction";nC="manifest.start";_.oC="onChooseStreams_";pC="presentationTime:";qC="presentationTime\x3d";rC="reference.endTime\x3d";sC="reference.position\x3d";tC="reference.startTime\x3d";uC="sourceopen";vC="startstreaming";_.wC="subtitles";xC="switch: Stream ";yC=function(a,b){return _.Zg[a]=b};zC=function(a,b){for(var c in a.a)b(c,a.a[c])};AC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Km(a);)if(0===_.Mm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.S.aa(a)};
|
|
9
|
+
_.CC=function(a){var b=new Uint8Array(BC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Gm(c,!1);_.V(d,c);_.Im(d,b);_.Im(d,a.j);_.V(d,a.f.byteLength);_.Im(d,a.f);return _.Wi(d.buffer)};
|
|
10
|
+
_.DC=function(a,b,c,d){var e=_.ij(b);if(8!==e.byteLength)e="";else{var f=_.Tn(e);e=_.fj(f);b:switch(f=f.byteLength,_.Jh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[qB+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?pB+d+oB:"",nB].join("");break b;case "4.1.0.0":e=[qB+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?pB+d+oB:"",nB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[qB+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?pB+d+oB:"",nB].join("");break b;default:_.Eh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Jh("New payload",e);e=_.Wi(_.S.We(e,!0));return new _.Qn(_.Un,
|
|
12
|
+
b,d||null,e,a,c)};_.EC=function(a,b){return b===a.version?a:_.DC(b,a.a,a.l||void 0,a.h||void 0)};FC=function(a,b){a:{if(b){var c=_.w(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.hb.length;e++)if(d.hb[e]===b){c=d;break a}}}c=null}return c?c.Pa:null};GC=function(a,b){if(_.Yk("Edge/"))return!0;b=b.toLowerCase();if(_.Ij()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ke);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
13
|
+
HC=function(a,b){var c=a.o.get(b);return!(!c||c!==_.df&&c!==_.xe)};IC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Io(c),!GC(a,c))||d&&d.encrypted&&(d=_.Io(d),!GC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};JC=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};KC=function(a){a=JC(a,_.Dv);return null==a?null:a};
|
|
14
|
+
LC=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.Qb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};_.MC=function(a,b){return a.concat(b)};NC=function(){};_.OC=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.pi(d)});return a.map(function(d){return new _.pi(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.MC,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.PC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.QC=function(a,b,c,d,e){this.Va=a;this.ya=b;this.ka=c;this.keyInfo=d||null;this.Zc=_.M.R(e)?!1:!!e};RC=function(a,b){a=_.Ni(a);b=_.Ni(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
SC=function(a){return a.language?_.Ni(a.language):a.audio&&a.audio.language?_.Ni(a.audio.language):a.video&&a.video.language?_.Ni(a.video.language):_.tg};
|
|
17
|
+
_.TC=function(a,b){for(var c=_.Ni(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.Ni(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,RC(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.Ni(g);h=_.Ni(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,RC(c,e))return e;return null};
|
|
18
|
+
UC=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};VC=function(a,b){var c=_.Pk(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};WC=function(a){for(var b=[a.mimeType],c=_.w(_.pv),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
|
+
XC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.YC=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(",")};ZC=function(a,b){for(var c=new _.Tl(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
|
+
$C=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 _.Nq("crop",a,d.endTime?d.endTime-a:Infinity,!1))};aD=function(a){var b=a.a.wh(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Sf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};bD=function(a){this.a=this.h=0;this.f=a};_.cD=function(a,b,c){a.h=b;a.a=c};
|
|
21
|
+
_.dD=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.N=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new bD(d);this.J=null;this.B=this.j.type||null};_.fD=function(a,b){a.L={offsetDateTime:b-eD(a),seekRangeStartDateTime:b}};_.gD=function(a,b){a.l=b;a.C=b;a.a.f=b};hD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
22
|
+
_.kD=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.iD(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.jD(a,d);null!=a.G&&a.N&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.iD=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.jD=function(a,b){a.o=Math.max(a.o||0,b)};_.lD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
23
|
+
_.nD=function(a){return 2===a.j.version?a.a.Qb():Infinity===a.A?0:Math.max(0,mD(a)-a.A)};mD=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};pD=function(a,b){if(2===a.j.version)return a.a.Qb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(mD(a)-a.A+b,oD(a)))};
|
|
24
|
+
eD=function(a){return 2===a.j.version?a.a.Qb():pD(a,0)};oD=function(a){var b=a.Vd()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,mD(a)-b)};qD=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}};rD=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
25
|
+
sD=function(a,b,c){a.f=b;a.h=c};tD=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Hc:e.Hc},g=f.next())e.Hc=g.value,a.a.has(e.Hc)||(c.push(e.Hc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Hc.id}}(e)),e.Hc.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()};
|
|
26
|
+
uD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return qD(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};wD=function(a,b){this.h=a;this.l=vD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};xD=function(a,b){a.f=b};yD=function(a){this.a=a};
|
|
27
|
+
vD=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};AD=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Oh;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,_.Og,function(){return zD(f)});this.w=(new _.Vk(function(){zD(f)})).xb(.25)};
|
|
28
|
+
zD=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 _.Tl(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=vD(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
29
|
+
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>=oD(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:_.Ih("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Ih(NB,g,"seconds because of gap before start time of",f):_.Ih(NB,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
30
|
+
BD=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Vk(function(){0>=b.j?(_.Eh(["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--)})};CD=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.xb(.1)};FD=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Oh;this.h=new BD(a);this.w=!1;0<a.readyState?DD(this,c):ED(this,c)};
|
|
31
|
+
GD=function(a){return a.l?a.a.currentTime:a.A};HD=function(a,b){0<a.a.readyState?CD(a.h,b):ED(a,b)};ED=function(a,b){a.A=b;a.f.off(a.a,_.Ie);a.f.one(a.a,_.Ie,function(){DD(a,b)})};DD=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?ID(a):(a.f.one(a.a,_.Wf,function(){ID(a)}),CD(a.h,0===a.a.currentTime?b:a.a.currentTime))};ID=function(a){_.$k()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Wf,function(){return a.j()})};
|
|
32
|
+
MD=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 AD(a,b.presentationTimeline,c,JD(this,a,c),f);this.f=new FD(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=GD(h.f);var n=KD(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;HD(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},LD(this,d,g),function(){h.j.I=!0});this.o=(new _.Vk(function(){if(0!==
|
|
33
|
+
h.h.readyState&&!h.h.paused){var l=GD(h.f),m=eD(h.a),n=oD(h.a);3>n-m&&(m=n-3);l<m&&(m=KD(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).xb(.25);this.g=new _.K("clpp.mse.Playhead")};OD=function(a){var b=GD(a.f);return 0<a.h.readyState&&!a.h.paused?ND(a,b):b};LD=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?eD(a.a):oD(a.a):0>b&&(b=oD(a.a)+b);return PD(a,ND(a,b))};
|
|
34
|
+
PD=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
35
|
+
KD=function(a,b){if("startover"===a.a.B)return b;var c=new _.Tl(a.h.buffered);c=c.Gb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=eD(a.a),g=oD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=pD(a.a,d),m=pD(a.a,e);d=pD(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),PD(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");
|
|
36
|
+
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};ND=function(a,b){var c=eD(a.a);if(b<c)return c;c=oD(a.a);return b>c?c:b};
|
|
37
|
+
JD=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new wD(new yD(b),c.stallThreshold);xD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.Tl(b.buffered),l;if(l=_.Yk("Edge/")||_.Yk("Trident/")||_.Ij()||_.$k())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=
|
|
38
|
+
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};RD=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Vk(function(){QD(b,!1)})).xb(.25)};QD=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)};
|
|
39
|
+
SD=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
40
|
+
TD=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Fc:null,Ec:2,xc:function(c,d){return b.a(c,d)}},{Fc:1,Ec:2,xc:function(c,d){return b.a(c,d)}},{Fc:3,Ec:2,xc:function(c,d){return b.a(c,d)}},{Fc:2,Ec:1,xc:function(c,d){return b.f(c,d)}},{Fc:2,Ec:3,xc:function(c,d){return b.f(c,d)}},{Fc:1,Ec:3,xc:function(c,d){return b.h(c,d)}},{Fc:3,Ec:1,xc:function(c,d){return b.h(c,d)}}]};UD=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
41
|
+
VD=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};WD=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Va().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};_.XD=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.YD=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.ZD=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};
|
|
42
|
+
$D=function(a,b){var c=a.Wc(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 VD(a,c,e)};_.aE=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)};_.bE=function(a){_.Tq[a]&&delete _.Tq[a]};_.cE=function(a){_.Rq[a]&&delete _.Rq[a]};
|
|
43
|
+
dE=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};_.eE=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.fE=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)};_.gE=function(a){return a.a/(1-Math.pow(a.h,a.f))};hE=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};
|
|
44
|
+
iE=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};jE=function(a,b){for(var c=0;c<a.length;c++)if(iE(a[c]).has(b))return c;return-1};kE=function(a,b){Array.from(iE(a)).forEach(function(c){c.segmentIndex&&_.aE(c.segmentIndex,b)})};
|
|
45
|
+
_.lE=function(a,b,c,d,e,f,g,h){a=_.uj(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};mE=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};
|
|
46
|
+
nE=function(a,b){if(b!==_.Tc){var c=_.du[b];if(!c)throw new _.N(_.O,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};oE=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.Wi(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Wi(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)}})};
|
|
47
|
+
pE=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,[])};
|
|
48
|
+
qE=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 _.Ak(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=
|
|
49
|
+
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))};_.rE=function(a){a=a.toLowerCase();return _.du[a]||window.muxjs&&a===_.Tc?!0:!1};sE=function(a,b){return a.start-b.start};_.tE=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.T=[];this.f=this.player=null;this.a=!1};
|
|
50
|
+
uE=function(a){return a.T.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};vE=function(a){a.player&&(a.player.off(_.Pf,a.Uc),a.a&&a.player.off(_.pg,a.Uc));a.player=null};wE=function(a){a.player&&a.player.trigger(new _.L(_.hd))};xE=function(a){a.player&&a.player.trigger(new _.L(_.hd))};
|
|
51
|
+
yE=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.T.length;d++){var e=a.T[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(_.pg,a.Uc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.pg,a.Uc),a.a=!1)}};zE=function(a,b,c){a.T=a.T.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(_.Jg))};
|
|
52
|
+
AE=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.BE=function(){};_.DE=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 _.Oh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.Cj;this.A="";this.G={};this.o=CE(this,this.J);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
|
|
53
|
+
EE=function(a){var b=_.Qk(a.mimeType,a.codecs),c=WC(a);return _.rE(b)||_.Ot(c)||(_.Pk(b,a.type)?!0:!1)};CE=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,uC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,vC,function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=FE(c);a.j.src=a.A;return c}c=new MediaSource;a.A=FE(c);a.l.one(c,uC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
54
|
+
GE=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.oe,a.S.bind(a,d));a.l.on(e,"updateend",a.Xc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.ad)&&b.has(_.r)};HE=function(a,b){try{return new _.Tl(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error(jC+b,c),null}};IE=function(a,b){if(!a.f[b])return"";var c=HE(a,b);return c?c.toString():""};KE=function(a,b,c,d,e){return[JE(a,b,a.$j.bind(a,b)),JE(a,b,a.Yg.bind(a,b,c)),JE(a,b,a.ak.bind(a,b,d,e))]};
|
|
55
|
+
JE=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Cj};a.h[b].push(c);1===a.h[b].length&&LE(a,b);return c.p};LE=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(aC+b),c.start()}catch(d){d.name===TB?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),ME(a,b)}else a.g.debug(PB+b)};
|
|
56
|
+
NE=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 _.Cj,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();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.ph(p,3);break;case 2:g=_.F(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);_.D(p,5,6);return _.y(p,b(),6);case 6:_.qh(p);for(m in a.f)ME(a,
|
|
57
|
+
m);_.rh(p);break;case 5:return n=_.F(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};ME=function(a,b){a.h[b].shift();LE(a,b)};
|
|
58
|
+
TE=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=OE(e,b,c);e=PE(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={cf:c.cf},d++)c.cf=b[d],l=new Set(_.bh(l).concat().filter(function(n){return function(p){return n.cf.has(p)}}(c)));
|
|
59
|
+
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=QE(e);var m=RE(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(SE(n)===m)return!0;_.Jh("Dropping Variant (better codec available)",n);return!1})};
|
|
60
|
+
UE=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=OE(e,b,c);e=PE(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)})};QE=function(a){var b=new _.Lh;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=SE(c);b.push(d,c)}return b};
|
|
61
|
+
OE=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.YC(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.YC(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};
|
|
62
|
+
RE=function(a){var b="",c=Infinity;zC(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Jh(_.Jd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};SE=function(a){var b="";a.video&&(b=_.YC(a.video.codecs));var c="";a.audio&&(c=_.YC(a.audio.codecs));return b+"-"+c};
|
|
63
|
+
VE=function(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&!(d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))&&d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))&&d(e.width*e.height,b.minPixels,b.maxPixels))||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};WE=function(a,b,c){var d=!1;a=_.w(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=VE(e,b,c);f!==e.allowedByApplication&&(d=!0)}return d};
|
|
64
|
+
ZE=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.$&&!IC(a,n))return _.Jh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!EE(p)){var t=p.codecs;0<=p.codecs.indexOf(_.ke)?(_.Jh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ke,"ac-3"),EE(p)?_.Ih("Using AC-3 instead of EC-3 for",XE(p)):(p.codecs=t,_.Ih(UB,XE(p)),n.audio=null,f=!0,p=null)):(_.Ih(UB,XE(p)),n.audio=null,f=!0,p=null)}return q&&!EE(q)?(_.Ih("Dropping variant - video not compatible with platform",
|
|
65
|
+
XE(q)),!1):p&&b&&!YE(p,b,e)?(_.Ih("Dropping variant - not compatible with active audio","active audio",XE(b),"variant.audio",XE(p)),!1):q&&c&&!YE(q,c,e)?(_.Ih("Dropping variant - not compatible with active video","active video",XE(c),"variant.video",XE(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&&!n.audio?(_.Ih("Dropping variant - not compatible with video + audio",
|
|
66
|
+
"variant.video",XE(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.rE(_.Qk(n.mimeType,n.codecs));p||_.Jh("Dropping text stream. Is not supported by the platform.",n);return p})};YE=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
67
|
+
$E=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(t){return t?t.accessibility||[]:[]}).reduce(function(t,v){return t.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
68
68
|
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,keyId:c?c.keyId:b?b.keyId:null};c&&(a.videoId=c.id,
|
|
69
69
|
a.originalVideoId=c.originalId,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};
|
|
70
|
-
|
|
71
|
-
accessibility:a.accessibility,keyId:null}};
|
|
72
|
-
_
|
|
73
|
-
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
aF=function(a){return{id:a.id,active:!1,type:_.Q,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,
|
|
71
|
+
accessibility:a.accessibility,keyId:null}};bF=function(a){return a.allowedByApplication&&a.allowedByKeySystem};PE=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))};
|
|
72
|
+
_.dF=function(a,b,c,d){b=_.di(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=_.TC(_.Ni(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Ni(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.qe})&&(e=e.filter(function(h){return h.kind===_.qe}));if(c){b=cF(e,c);if(b.length)return b;_.Eh("No exact match for the text role could be found.")}else if(b=
|
|
73
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.MC,[]);return b.length?cF(e,b[0]):e};cF=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
74
|
+
XE=function(a){var b=WC(a);return a.type===_.ad?"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"};
|
|
75
|
+
eF=function(a,b){var c=String(_.Xj++);c=new _.Rj(c,a);c.mimeType=_.Sj(b.mimeType);if(a===_.T||a===_.Tj)c.label=_.Sj(b.label),c.language=_.Sj(b.language),c.originalLanguage=_.Sj(b.originalLanguage);a===_.Uj?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.Tj?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.Sj(b.audioMimeType)):(c.kind=_.Sj(b.kind),c.roles=b.roles);c.accessibility=a===_.Uj||a===_.Tj?(b.accessibility||[]).filter(function(d){return d.type===
|
|
76
76
|
a}):b.accessibility||[];return c};
|
|
77
|
-
|
|
78
|
-
d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
yF=function(a){
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
b.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
jG=function(a,b
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
a
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
_.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
var g
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
a
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
a.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
a.
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
a.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
c);c=a.
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
_.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
a
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return b.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
hI=function(a,b){
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
if(
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
cJ=function(a,b){
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
c
|
|
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
|
-
_.
|
|
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
|
-
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;nJ(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.t.isTextVisible=function(){return this.a.mode===_.cg};_.t.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.cg:_.ye)};_.t.destroy=function(){this.a&&nJ(this.a,function(){return!0});this.a=null;return Promise.resolve()};oJ.prototype.isSupported=function(){return!0};oJ.prototype.create=function(a){return new mJ(a)};_.ap("single-native",new oJ);};
|
|
77
|
+
fF=function(a,b,c){var d=new _.ak(a===_.Uj?""+b.videoId:a===_.Tj?""+b.audioId:""+b.id,c);switch(a){case _.Uj:d.codec=_.Sj(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.Tj:d.codec=_.Sj(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.Sj(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.M.la(e,
|
|
78
|
+
d,null,["id","track"])}))||c.renditions.push(d);return a||d};gF=function(a,b){var c=a.reduce(function(d,e){b===_.Uj?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.Tj&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};hF=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};iF=function(){this.a=null};
|
|
79
|
+
kF=function(a,b){if(b&&(null==a.a||a.a!==b))throw jF(a);};jF=function(a){return new _.N(_.O,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.")};
|
|
80
|
+
mF=function(a,b,c,d,e){this.j=a;this.C=c;this.a={};this.G={};this.N=!1;this.f=null;this.h={};this.l=new _.Oh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.V=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.Cj;this.A="";this.H={};this.o=lF(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
81
|
+
lF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,uC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,vC,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=nF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=nF(c);a.l.one(c,uC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
82
|
+
oF=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.oe,a.S.bind(a,d));a.l.on(e,"updateend",a.qc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.N=b.has(_.ad)&&b.has(_.r)};pF=function(a,b){try{return new _.Tl(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(jC+b,c),null}};qF=function(a,b){if(!a.a[b])return"";var c=pF(a,b);return c?c.toString():""};
|
|
83
|
+
tF=function(a,b,c,d,e,f){return[f?Promise.resolve():rF(a,b,function(){try{a.g.debug(rB+b+gB);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(FB+b+gB,l),l;}a.g.debug(zB+b+gB);a.qc(b)}),rF(a,b,function(){return sF(a,b,c)}),rF(a,b,function(){try{a.g.debug(XB+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(JB+b,d,e,g),g;}a.g.debug(DB+b,d,e);a.qc(b)})]};
|
|
84
|
+
sF=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(ZB+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(KB+b,c,d),d;}a.g.debug(EB+b,c);a.qc(b)};rF=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.Cj};a.h[b].push(c);1===a.h[b].length&&uF(a,b);return c.p};uF=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(aC+b),c.start()}catch(d){d.name===TB?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),vF(a,b)}else a.g.debug(PB+b)};
|
|
85
|
+
wF=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 _.Cj,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();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.ph(p,3);break;case 2:g=_.F(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);_.D(p,5,6);return _.y(p,b(),6);case 6:_.qh(p);for(m in a.a)vF(a,
|
|
86
|
+
m);_.rh(p);break;case 5:return n=_.F(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};vF=function(a,b){a.h[b].shift();uF(a,b)};xF=function(a,b,c){return rF(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),dE()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.qc(b))})};
|
|
87
|
+
yF=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.YC(_.Sk(a.G[b])),f=_.Rk(a.G[b]),g=_.Qk(c,d),h=_.YC(_.Sk(g)),l=_.Rk(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.ag&&dE()?_.y(m,xF(a,b,g),2):m.F(2)):m["return"](!0)})};BF=function(a,b){this.a=zF;this.f=(new Map).set(zF,b).set(AF,a)};CF=function(a){this.h=a;this.a=null;this.f=function(){}};DF=function(a,b){a.f=b};
|
|
88
|
+
EF=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)};HF=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||FF(d,e))&&GF(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||FF(a,b))&&GF(a.roles,b.roles)));return d?!1:!0};
|
|
89
|
+
FF=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=XC(a.codecs).map(function(f){return _.YC(f)}),d=XC(b.codecs).map(function(f){return _.YC(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};GF=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Ke);d["delete"](_.Ke);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};
|
|
90
|
+
IF=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.Dh();this.w=_.Ud;this.j=null;this.a=new _.Vk(function(){b.A||b.f.Pl(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};JF=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
91
|
+
MF=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Ud||0===c||1===c)try{KF(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),LF(a)}else LF(a)};LF=function(a){a.g.debug(YB,a.h,' using "seek" mode.');KF(a,0);a.o=!0;a.a.xb(.25)};KF=function(a,b){if(a.f.Dh()!==b){a.g.debug(YB,b,' using native playbackRate "decoder" mode.');try{a.f.sn(b)}catch(c){throw c;}}};
|
|
92
|
+
OF=function(a){function b(){d=!0}function c(m){f.push(m);_.Tm(m)}a=_.Wi(a);var d=!1,e,f=[],g=[];(new _.Sm).M(_.Re,c).M(_.qg,c).M(_.Me,c).M(_.Qe,c).M(_.fg,c).Y(_.hg,function(m){e=m;f.push(m);_.Um(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,kd:1701733238})}).Y("avc3",function(m){g.push({M:m,kd:1701733238})}).Y("ac-3",function(m){g.push({M:m,kd:1701733217})}).Y(_.ke,function(m){g.push({M:m,kd:1701733217})}).Y("mp4a",function(m){g.push({M:m,kd:1701733217})}).parse(a);if(d)return _.Ih("Init segment already indicates encryption."),
|
|
93
|
+
a;if(0===g.length||!e)throw _.Kh("Failed to find boxes needed to fake encryption!"),_.Kh("Failed init segment (hex):",_.jj(a)),new _.N(_.O,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Ih('Inserting "'+_.Xm(l.kd)+'" box into init segment.'),a=NF(a,e,l.M,f,l.kd);return a};
|
|
94
|
+
NF=function(a,b,c,d,e){var f=PF.value(),g=a.subarray(c.start,c.start+c.size),h=_.cj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.cj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);QF(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Yk("Xbox One")||_.Xk()?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,QF(e,d.start,d.size+l.byteLength);l=_.cj(e,
|
|
95
|
+
b.start);b=_.Ym(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};QF=function(a,b,c){a=_.cj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.SF=function(a,b){this.D=b;this.j=a;RF(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};
|
|
96
|
+
UF=function(a){var b=a.a.get(_.r);return b?TF(a,b.Tb):(b=a.a.get(_.ad))?TF(a,b.Tb):null};WF=function(a){return _.VF(a,_.ad)};XF=function(a){return _.VF(a,_.r)};
|
|
97
|
+
bG=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=_.Np,_.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,YF(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.Pb();n=ZF(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
98
|
+
m),q["return"]();p=$F(b,n,0);a.a.set(c.TEXT,p);aG(a,p,0)}_.A(q)}})};eG=function(a){a.I=!0;var b=a.a.get(_.Q);b&&(cG(b),dG(b)["catch"](function(){}),a.a["delete"](_.Q))};gG=function(a,b,c,d){b.video&&_.fG(a,b.video,c,d);b.audio&&_.fG(a,b.audio,c,d)};iG=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;RF(a.j);hG(a)};RF=function(a){a.periods.every(function(b){return typeof b.id===_.gg})};
|
|
99
|
+
kG=function(a){function b(l){return a.D.W.Gb(l,c,0)}var c=a.D.Pb(),d=!1,e=ZF(a,c);if(_.Ti(a.a.values(),function(l){return l.Tb===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)||(jG(a,h),d=!0)}else if(!_.Ti(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())jG(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
100
|
+
c)};nG=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=lG(d);if(d.dd||b&&mG(d))a.g.info(e,"Retrying after failure..."),d.dd=!1,aG(a,d,.1)}};oG=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.gb})};
|
|
101
|
+
pG=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};rG=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,cG(e),e.sb&&e.Vb&&(e.sb=!1,b.push(e.Vb.abort())),e.Zb&&b.push(qG(a,e,!0,0));return _.y(f,Promise.all(b),0)})};sG=function(a,b,c){(a=a.a.get(b))&&c&&(cG(a),a.stream=c,a.cc=c,a.oa&&(a.oa=c.getSegmentReference(a.oa.position)),a.oa||(a.cc=null))};
|
|
102
|
+
_.VF=function(a,b){var c=a.a.get(b);return c?c.gc||c.stream:null};
|
|
103
|
+
_.fG=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)bG(a,b);else if(e){var f=tG(a,b).id;if(c&&f!==e.Tb)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())jG(a,c.value);else if(e.gc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.gc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.gc=null,a.g.debug("switch found no special trick play stream"))),
|
|
104
|
+
uG(a,f)&&vG(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Pb();h=wG(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(xC+lG(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.W.fc(_.Qk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Le=!0,a.g.debug("switch: switching to Stream "+lG(e)),xG(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Vb.abort()),c&&(e.oc?e.Ye=!0:e.sb?(e.Zb=!0,e.re=d,e.Ye=!0):(cG(e),qG(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(xC+
|
|
105
|
+
lG(e)+" already active")}};uG=function(a,b){var c=a.A.get(b);return!(!c||!c.Te)};vG=function(a,b){var c=a.w.get(b);return!(!c||!c.Te)};xG=function(a,b,c){if(!b.Vb)return!1;var d=a.D.Pb(),e=a.D.W.ha(b.type);c=(c=yG(a,b,d,e,c))?c.Od():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Od()||0);f=a.D.ze().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Vb;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
106
|
+
jG=function(a,b){var c=lG(b);b.oc?a.g.debug(c,"clear: already clearing the buffer"):b.Zb?a.g.debug(c,"clear: already waiting"):b.sb?(a.g.debug(c,"clear: currently updating"),b.Zb=!0,b.re=0):null==a.D.W.La(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.gb&&aG(a,b,0)):(a.g.debug(c,"clear: handling right now"),cG(b),qG(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
|
|
107
|
+
zG=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.Pb();g=ZF(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.Np;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"]();hG(a);return _.y(q,YF(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,
|
|
108
|
+
v){if(!a.a.has(v)){var z=$F(t,g,e);a.a.set(v,z);aG(a,z,0)}});_.A(q)})};$F=function(a,b,c){return{stream:a,type:a.type,cc:null,segmentIterator:null,oa:null,gc:null,Le:!0,Tb:b,endOfStream:!1,sb:!1,gb:null,Zb:!1,re:0,Ye:!1,oc:!1,jg:!1,dd:!1,Ei:c||0,Vb:null,xe:!1,Xh:0}};BG=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){AG(a,b)["catch"](NC)})};
|
|
109
|
+
AG=function(a,b){var c=a.A.get(b);if(c)return a.g.debug("(all) Period "+b+iB),c;a.g.debug("(all) setting up Period "+b);var d=new _.Cj;a.A.set(b,d);var e=new Set;c=TF(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:YF(a,e)}).then(function(){a.f||(d.resolve(),
|
|
110
|
+
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};
|
|
111
|
+
YF=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,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+iB),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.Cj),h=a.D.Jb,c.push(f.createSegmentIndex(h)));_.D(z,2);return _.y(z,Promise.all(c),4);case 4:if(a.f)return z["return"]();_.ph(z,3);break;case 2:l=_.F(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
112
|
+
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())t=e.value,(v=a.w.get(t.id))&&!v.done&&(v.resolve(),a.g.debug("(all) setup Stream "+t.id));_.A(z)}})};hG=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.W.Bf(b):a.D.W.Bf(Math.pow(2,32))};
|
|
113
|
+
EG=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Tc}if(c(b))return a.D.W.Xg(b.stream.originalId||""),null;b.type===_.Q&&a.D.W.Pg();if(!a.D.W.Sh()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=lG(b),e=a.D.Pb(),f=wG(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.W.za(b.type,e);a.g.debug(d,"update_:",qC+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=hD(a.j.presentationTimeline);
|
|
114
|
+
if(null!=l&&f>=l&&!b.xe)return CG(a,b),null;b.endOfStream=!1;l=tG(a,b.stream).id;var m=ZF(a,f);null!=m&&(b.Tb=m);if(m!==l)return a.g.debug(d,"need Period "+m,qC+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.ha(b.type);g=yG(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.Q?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),CG(a,b),
|
|
115
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=wG(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Ei=0;DG(a,b,e,l,g)["catch"](function(){});return null};CG=function(a,b){a.g.debug(lG(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Tc&&(c.endOfStream=!0)}};
|
|
116
|
+
wG=function(a,b,c){return b.cc&&b.oa?tG(a,b.cc).startTime+b.oa.endTime:Math.max(c,b.Ei)};
|
|
117
|
+
yG=function(a,b,c,d,e){if(null==e)return a.g.warn(wB),null;if(b.stream.segmentLookupStrategy===_.lC)b.stream.segmentIterator?a=WD(b.stream.segmentIterator):b.oa||d?(c=b.oa?b.oa.endTime:d,a.g.info(MB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=$D(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(MB,gC,"endTime:",c,b.oa)),a=e):(e=TF(a,e),e=Math.max(0,c-e.startTime),a.g.info(MB,"looking up segment","lookupTime:",
|
|
118
|
+
e,pC,c),d=null,d||(b.stream.segmentIterator=$D(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(MB,gC,"lookupTime:",e,pC,c),a=d);else{var f=lG(b);if(b.oa&&b.stream===b.cc)c=b.oa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=FG(a,b,e,c);else{if(b.oa){a.g.debug(f,"next position unknown: another Stream buffered");f=tG(a,b.cc);var g=GG(a,b,f.startTime+b.oa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=GG(a,b,d||c,e);if(null==
|
|
119
|
+
g)a=null;else if(f=FG(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ca+d.startTime+2>c&&(a=FG(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};GG=function(a,b,c,d){var e=lG(b);d=TF(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",qC+c,"lookupTime\x3d"+f,iC+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",iC+d.startTime,"lookupTime\x3d"+f);return b};
|
|
120
|
+
FG=function(a,b,c,d){var e=lG(b);if(null==c)return a.g.warn(e,wB),null;c=TF(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",iC+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.nD(g);g=mD(g);return!b.xe&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",iC+c.startTime,tC+f.startTime,rC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
121
|
+
DG=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,C,H;return _.I(function(E){f=_.Np;g=lG(b);h=TF(a,d);a.g.debug(g,"fetchAndAppend_:",qC+c,iC+h.startTime,sC+e.position,tC+e.startTime,rC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=HG(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=IG(a,b,h,q,t,e);b.sb=!0;b.Le=!1;a.g.debug(g,"fetching segment");z=!1;C=function(B,G){if(a.f||a.o)return null;z=!0;return JG(a,b,c,h,l,e,B,G)};H=a.D.W.ha(b.type)||0;
|
|
122
|
+
v.then(function(){return a.f||a.o?null:KG(a,b,e,!1,function(B){return C(B.data,!0)})}).then(function(B){return a.f||a.o?null:z||null===B?(LG(a,b,H,e,l),null):C(B,!1)}).then(function(){if(!a.f&&!a.o){LG(a,b,H,e,l);b.sb=!1;b.jg=!1;b.Zb||a.D.Qe();if(m){var B=m.next().value;B&&a.g.debug("New iterated segment",B)}aG(a,b,0);MG(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(B){return _.I(function(G){if(a.f||a.o)return G["return"]();b.sb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
123
|
+
B.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),G.F(0);if(7001===B.code)return b.sb=!1,b.gb=null,aG(a,b,0),G.F(0);if(3017===B.code)return NG(a,b,B),G.F(0);if(1001===B.code&&B.data&&404===B.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",sC+e.position,tC+e.startTime,rC+e.endTime,"error\x3d"+B),b.sb=!1,b.gb=null,aG(a,b,1),G.F(0);if(b.type===f.TEXT)return B instanceof
|
|
124
|
+
_.N&&B.a(1),cG(b),a.D.onError(new _.N(1,2,2010,B)),G.F(0);if(1001<=B.code&&1003>=B.code)return _.y(G,OG(a,b,h,B),0);a.g.error(g,"failed fetch and append: code\x3d"+B.code);b.dd=!0;B instanceof _.N&&B.a(_.O);return _.y(G,PG(a,B),0)})});_.A(E)})};
|
|
125
|
+
NG=function(a,b,c){var d=lG(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.jg}))a.g.debug(d,OB,"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.dd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,OB,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.jg=!0}aG(a,b,4)};
|
|
126
|
+
OG=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.rf(b.stream,c));if(!f)return g.F(0);b.dd=!0;d.a(_.O);return _.y(g,PG(a,d),0)})};
|
|
127
|
+
IG=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.I(function(t){g=c.startTime-f.Ca;h=b.Le||f.initSegment!==(b.oa&&b.oa.initSegment);if(!h&&g===b.Xh)return t["return"](Promise.resolve());b.Xh=g;l=lG(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.Fi(b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return t["return"](m);a.g.debug(l,"fetching init segment");
|
|
128
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=KG(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return QG(a,v,b).then(function(){return a.D.W.te(b.type,v,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(v){b.Le=!0;return Promise.reject(v)});return t["return"](Promise.all([m,q]))})};
|
|
129
|
+
QG=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Xk())return e.F(0);d=OF(b);return _.y(e,a.D.W.te(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
130
|
+
JG=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,v,z,C;return _.I(function(H){switch(H.a){case 1:l=lG(b);if(!(e&&e.keyId&&a.D.Gd)){H.F(2);break}m=FC(a.D.Gd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);H.F(2);break}_.D(H,4);return _.y(H,m,6);case 6:_.ph(H,2);break;case 4:n=_.F(H),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.D.Gd&&HC(a.D.Gd,e.keyId))){H.F(7);break}cG(b);p=tG(a,e).id;q=RG(a,p);if(!q){H.F(8);break}return _.y(H,q,8);case 8:return t=
|
|
131
|
+
a.D.rf(e,d,mC),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+t+". Stream with Key ID "+(e.keyId+" has restrictions.")),H["return"](Promise.resolve());case 7:return C=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Sm).Y("emsg",a.Km.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),H["return"](SG(a,b,c).then(function(){if(a.f)return null;var E=f.startTime+d.startTime,B=f.endTime+d.startTime;a.g.debug(l,
|
|
132
|
+
"Appending segment with "+(E.toFixed(3)+" - "+B.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.qf(e.bandwidth)+" Fragment: ")+h);return a.D.W.te(b.type,g,E,B,C,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.cc=e,b.oa=f)}))}})};
|
|
133
|
+
LG=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=lG(b),g=(a.D.W.ha(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.xe=!0,a=a.j.periods,e.adjustSegmentDurations(d.position,c),d=jE(a,e),b=a[d],e=e.getDuration(),kE(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
134
|
+
TG=function(a,b,c){(new _.Sm).M(_.Re,_.Tm).M(_.qg,_.Tm).M(_.Me,_.Tm).M(_.Qe,_.Tm).M(_.fg,_.Tm).Y(_.hg,_.Um).M("encv",function(d){d.reader.skip(78);_.Tm(d)}).M(_.$f,_.Tm).M("schi",_.Tm).M("tenc",function(d){d.reader.skip(6);if(_.Mm(d.reader)){d.reader.skip(1);var e=_.jj(_.Rm(d.reader,16));e!==b.stream.keyId&&(a.g.debug(lG(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)};
|
|
135
|
+
SG=function(a,b,c){if(a.f)return Promise.resolve();var d=lG(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.D.W.La(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",qC+c,dC+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",qC+c,eC+g,dC+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",qC+c,eC+g,dC+e,"overflow\x3d"+h);return a.D.W.remove(b.type,
|
|
136
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};MG=function(a,b,c){if(!a.B){b=lG(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Q?a.B=d.every(function(e){return e.type===_.Q||a.C?!0:!e.Zb&&!e.oc&&e.oa}):a.C&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=tG(a,c).id,HG(a,c),RG(a,c))}};
|
|
137
|
+
RG=function(a,b){var c=null;a.A.has(b)||(c=AG(a,b).then(function(){a.f||(a.g.debug(fC),a.D.Tf())})["catch"](NC));BG(a);a.D.Em&&(a.g.debug("calling onStartupComplete()..."),a.D.Em());return c};
|
|
138
|
+
UG=function(a,b){var c=lG(b),d=tG(a,b.stream).id;if(b.Tb!==d){var e=b.Tb,f=Array.from(a.a.values());f.every(function(g){return g.Tb===e})?f.every(mG)?(a.g.debug(c,"all need Period "+e),AG(a,e).then(function(){if(!a.f)if(a.D.W.Di(),f.every(function(n){var p=mG(n),q=tG(a,n.stream).id;return p&&n.Tb===e&&q!==e})){var g=TF(a,e);a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.D.Uf(g);a.C=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,h.variant.video);
|
|
139
|
+
h.variant&&h.variant.audio&&l.set(_.ad,h.variant.audio);h.text&&l.set(_.Q,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!==_.Q){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.D.onError(new _.N(_.O,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===_.Q)zG(a,null,null,l.get(_.Q),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");a.D.onError(new _.N(_.O,
|
|
140
|
+
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))?(_.fG(a,m,!1,0),aG(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,fC);a.D.Tf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](NC)):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)}};ZF=function(a,b){var c=hE(a.j.periods,b+_.fv);return c?c.id:null};
|
|
141
|
+
tG=function(a,b){var c=a.j.periods,d=jE(c,b);c=c[d];if(!c)throw new _.N(_.O,5,5006,"No period found for stream with ID "+b.id+".");return c};
|
|
142
|
+
KG=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.lE(c.Va(),c.ya,c.ka,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Zc?null:e;f.disableFragmentSupport=c.Zc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){TG(a,b,g.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Kn.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
143
|
+
c);c=a.D.Jb.fetch(f);b.Vb=c;return c.U.then(function(g){var h=a.D.ze(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Vb=null;return g.data})};
|
|
144
|
+
qG=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=lG(b),b.Zb=!1,b.Ye=!1,b.re=0,b.oc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.D.Pb(),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.cc=null;b.oa=null;b.oc=!1;b.endOfStream=!1;b.xe=!1;aG(a,b,0);_.A(l)})};
|
|
145
|
+
aG=function(a,b,c){a.g.debug(lG(b),"updating in "+c+" seconds");b.gb=(new _.Tk(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.Ub(b),4);if(2!=e.a)return _.ph(e,0);d=_.F(e);if(a.D)a.D.onError(d);_.A(e)})})).ea(c)};cG=function(a){null!=a.gb&&(a.gb.stop(),a.gb=null)};TF=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.N(_.O,5,5006,"Period "+b+" not found");return c};
|
|
146
|
+
HG=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};dG=function(a){return _.I(function(b){return a.Vb?_.y(b,a.Vb.abort(),0):b.F(0)})};PG=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.Hi){d.F(2);break}_.D(d,3);return _.y(d,a.D.Hi(b),5);case 5:_.ph(d,2);break;case 3:c=_.F(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.A(d)}})};lG=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
147
|
+
mG=function(a){return!a.sb&&null==a.gb&&!a.Zb&&!a.oc};VG=function(){this.a=new Map};XG=function(a,b){a.a.has(b)||a.a.set(b,new WG);return a.a.get(b)};WG=function(){this.text=this.variant=null};
|
|
148
|
+
ZG=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Oh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");YG(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.pg,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."),
|
|
149
|
+
b.D.setPlaybackRate(b.a.chasingRate,_.Ud)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
150
|
+
YG=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};
|
|
151
|
+
aH=function(a){var b=void 0===b?_.Gf:b;this.f=a;this.a=b;this.h=new $G(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};$G=function(a,b,c,d,e){this.j=_.di(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Gf:e};bH=function(a,b){var c=null;b.some(function(d){c=_.TC(_.Ni(d),a.map(function(e){return SC(e)}));return!!c});return c?a.filter(function(d){return c===SC(d)}):[]};
|
|
152
|
+
cH=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)})};dH=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};eH=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}};
|
|
153
|
+
fH=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};gH=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};hH=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.YC(b)&&a(b)}};
|
|
154
|
+
iH=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)}};
|
|
155
|
+
jH=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};_.kH=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};lH=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}};mH=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
156
|
+
nH=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=_.bh(a[0].periods).concat(),d={},e=1;e<a.length;d={me:d.me},e++)d.me=lH(a[e-1]).end,_.kH(a[e].periods,d.me),c.push.apply(c,_.bh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.me}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=lH(c).end;_.cD(b.a,0,d);(d=
|
|
157
|
+
a[0].presentationTimeline.vc())&&_.fD(b,d.seekRangeStartDateTime);return c};pH=function(a,b){try{if(1===a.length)return a[0];if(!a.every(oH))throw new _.ki("Period durations must be finite");return nH(a,b)}catch(c){throw new _.N(_.O,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
158
|
+
qH=function(a,b){var c=b.periods[0].configurationId,d=_.bh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.gD(e,b.presentationTimeline.l);return pH([d,b],e)};oH=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};rH=function(){this.a=null};
|
|
159
|
+
sH=function(a){_.cu.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=_.Wd;c.label===SB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.wC,SB));this.a.mode=_.ue};tH=function(a,b){var c=a.mode;a.mode=c===_.Xf?_.Xf:_.ue;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};uH=function(){};vH=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};
|
|
160
|
+
wH=function(a,b){return a.h.filter(function(c){return c.type===b})};xH=function(a,b){var c=a.a.get(b)||null;return c&&c.track};zH=function(a,b,c){if(!c||xH(a,c.type)!==c||a.m.qa())switch(b){case _.Uj:a.cb(c&&c.renditions[0]);break;case _.Tj:a.ub(c&&c.renditions[0]);break;case _.T:a.vb(c&&c.renditions[0]);break;default:yH(a,b,c&&c.renditions[0])}};AH=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)};
|
|
161
|
+
yH=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.qa())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.T){var f=e.ia().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),AH(a,c),e.trigger(new _.L(_.Ol)),BH(e,!0).then(function(){CH(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
162
|
+
n)}))}else if(b===_.Tj)a.f.set(b,c),DH(e,parseInt(c.id,10));else if(b===_.Uj){var g=a.a.get(_.Tj)||null,h=null;if(g){var l=EH(e).filter(function(n){return n.videoId===parseInt(c.id,10)});h=l.find(function(n){return n.audioId===parseInt(g.id,10)})||null;if(!h){a.g.debug("Unable to find exact variant. Searching for equivalent");var m=g.track.renditions.map(function(n){return n.id}).filter(function(n){return n!==g.id});h=l.find(function(n){return m.find(function(p){return p===n.audioId})})||null}}else h=
|
|
163
|
+
EH(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),FH(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ja+b),(h=xH(a,b))&&(b===_.T?BH(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.Ol))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.Tj?a.g.info("Enabling ABR for audio is not supported"):b===_.Uj&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):FH(e,null,d))}};
|
|
164
|
+
IH=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.mv)),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.ia());for(var e=d.next();!e.done;c={kc:c.kc},e=d.next()){e=e.value;c.kc=eF(_.T,e);var f=b.find(function(h){return function(l){return h.kc.la(l)}}(c));c.kc=f||c.kc;var g=fF(_.T,e,c.kc);e.active&&a.a.set(_.T,g);f||b.push(c.kc)}GH(a.m)||a.a.set(_.T,null);c=EH(a.m);HH(a,b,c,_.Uj);HH(a,b,c,_.Tj);
|
|
165
|
+
a.h=b}};HH=function(a,b,c,d){var e=gF(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={lc:c.lc},f=e.next()){f=f.value;c.lc=eF(d,f);var g=b.find(function(l){return function(m){return l.lc.la(m)}}(c));c.lc=g||c.lc;var h=fF(d,f,c.lc);f.active&&a.a.set(d,h);g||b.push(c.lc)}};
|
|
166
|
+
JH=function(a,b,c){if(b){a.h.length||IH(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(wH(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&&(AH(a,f),d===_.Tj?a.m.trigger(new _.L(_.Nl)):d===_.Uj&&a.m.trigger(new _.L(_.Kg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};KH=function(){this.f=new _.eE(2);this.h=new _.eE(5);this.a=0};
|
|
167
|
+
_.LH=function(){this.g=new _.K("clpp.abr");this.A=null;this.j=!1;this.w=new KH;this.o=[];this.l=1;this.C=this.B=!1;this.h=this.a=this.f=null};MH=function(a,b,c){if(a.h&&a.a.useCmsd){var d=KC(a.h);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.video&&e.video.trickPlay)});b&&(a=a.filter(function(e){return VE(e,b,{width:Infinity,height:Infinity})}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};
|
|
168
|
+
PH=function(){_.im.call(this,hC);var a=this;this.G=NH;this.j=this.ga=null;this.ug=0;this.Ki=2;this.Sc=null;this.lg=!1;this.o=new _.Oh;this.Lc=this.yg=this.He=this.I=this.Gc=this.B=this.L=this.w=null;this.Md=!1;this.f=this.A=this.a=this.K=this.J=null;this.h=new _.LH;this.Pi=1E9;this.Ie=new Set;this.ca=!0;this.ta=null;this.Ni=!1;this.Mi=0;this.fa=null;this.P=new VG;this.Oi={width:Infinity,height:Infinity};this.H=null;this.nc=_.op;this.Nc=new $G(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
169
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Hd=this.configuration.preferredTextLanguage;this.l=new iF;this.$=this.Oc=null;this.Pc=new Map;this.Fa=null;this.Ge=this.configuration.preferredTextRole;this.Dd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===OH&&nG(a.a)});this.Ke=this.Kd=this.Ne=null;this.ba=_.qa;this.Qd=new rH};
|
|
170
|
+
QH=function(a){return new _.tE(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,_.bh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
171
|
+
RH=function(a,b){if(a.nc!==b){var c=_.S.Lk;if(a.nc===_.zp&&b!==_.op)c=c(b,_.xp),a.log.info(_.RB+c);else{var d=a.ug;d=0===d?0:Date.now()-d;var e=a.nc;a.nc=b;a.ug=Date.now();null!==a.I&&(a.I.A=b===_.Bp);a.H&&_.ep(a.H.a,a.nc);b===_.tp&&(a.Ki=a.ig?1:2);var f=a.Ki,g={currentState:a.nc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.tp||e===_.tp?f:void 0},h=c(e,_.xp),l=c(b,_.xp);c=b!==_.tp?"":"["+c(f,_.wp)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.dg,{detail:g}));(b===_.vp||b===
|
|
172
|
+
_.zp)&&a.Lc&&a.Lc.stop();b===_.tp?a.trigger(new _.L(_.md,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.tp&&a.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:d,reason:f}}))}}};SH=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.l.a;a.l.a=null;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:RH(a,_.op),_.A(c)}})};
|
|
173
|
+
TH=function(a){var b=new _.Oq;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
174
|
+
WH=function(a,b){var c,d;return _.I(function(e){a.ba===_.qa?UH(a,b.cues):a.ba===_.Ib?(a.f=qH(a.f,mH(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,_.gD(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ee))),VH(a,a.f)):iG(a.a,b);_.A(e)})};XH=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.ba===_.Ib?a.trigger(new _.L(_.Tf)):a.trigger(new _.L(_.Ee));_.A(b)})};
|
|
175
|
+
VH=function(a,b){var c=a.getMediaPosition(),d=a.Kd,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 _.Nq(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));LC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
176
|
+
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Uf));aD(a.Ke);tD(a.K,b.cues)};cI=function(a){var b,c;return _.I(function(d){if(1==d.a)return YH(a),_.y(d,ZH(a),2);if(3!=d.a){$H(a);b=_.Ij(4)||_.Ij(5);if(!b)return d.F(3);c=a.getSurface().getMedia();aI(a,c);return _.y(d,bI(a,c),3)}a.configuration=a.mc;_.A(d)})};
|
|
177
|
+
jI=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 _.Cj,a.l.a=e,_.D(l,2),YH(a),_.y(l,dI(a),4);case 4:return kF(a.l,e),a.Z=_.Gp(b),a.configuration=_.gm(a.mc,b),a.log.info(_.vb,a.configuration),a.log.info(_.Mb,a.Z),_.y(l,eI(a,e),5);case 5:return kF(a.l,e),_.y(l,fI(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,kF(a.l,e),a.A=f.parser,a.f=f.manifest,UH(a,f.manifest.cues),g=a,_.y(l,gI(a,a.f,a.configuration.drm),7);case 7:g.w=
|
|
178
|
+
l.f;kF(a.l,e);if(!c){l.F(8);break}return _.y(l,hI(a,e),9);case 9:kF(a.l,e),a.o.one(a.j,_.He,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.ph(l,0);break;case 2:h=_.F(l),iI(a,h,e),_.A(l)}})};UH=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);tD(a.K,c)}else tD(a.K,b)};iI=function(a,b,c){b=kI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};
|
|
179
|
+
kI=function(a,b,c){var d=a.l;return null!=d.a&&d.a===c||b instanceof _.N&&7E3===b.code?b instanceof _.N?b:new _.N(_.O,7,7003,"Unexpected error.",b):jF(a.l)};dI=function(a){return a.ga?a.ga["catch"](function(){}):Promise.resolve()};
|
|
180
|
+
eI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.jp,RH(a,_.Ap),c=lI(a,a.configuration),_.y(d,bI(a,c),2);kF(a.l,b);a.K=new rD;sD(a.K,function(e){a.log.info("Timeline cue found",e);mI(a,_.$h,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.og))});_.A(d)})};
|
|
181
|
+
fI=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=_.Gp(f),h=g[c],_.y(n,nI(a,h),2);case 2:return l=n.f,kF(a.l,d),_.Xn(nC),_.y(n,oI(a,l,h,f.id||""),3);case 3:m=n.f;kF(a.l,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:kF(a.l,d);case 4:return _.Xn("manifest.end"),_.Yn("Fetch and parse manifest",nC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
182
|
+
pI=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,fI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,mH(c.manifest)],e=pH(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.O,7,7003,"Failed to append load manifest");}})};lI=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.M.R(b.volume)||a.setVolume(b.volume);_.M.R(b.muted)||a.setMuted(b.muted);aI(a,c);return c};
|
|
183
|
+
aI=function(a,b){a.j||(a.o.on(b,_.oe,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 _.N(_.O,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};$H=function(a){a.j&&(a.o.off(a.j,_.oe),a.j=null)};
|
|
184
|
+
ZH=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==qI&&(a.G=NH);if(b=a.j)a.o.off(b,_.He),a.o.off(b,_.uf),a.o.off(b,_.ef),a.o.off(b,_.ne),a.o.off(b,_.Kf),a.o.off(b,_.If);a.K&&(a.K.release(),a.K=null);a.Gc&&(a.Gc.release(),a.Gc=null);a.Lc&&(a.Lc.stop(),a.Lc=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:a.B&&(a.B.release(),
|
|
185
|
+
a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.F(8);break}return _.y(c,a.L.destroy(),9);case 9:a.L=null;case 8:a.Sc&&(a.Sc.release(),a.Sc=null);a.He&&(a.He.release(),a.He=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(10);break}return _.y(c,a.w.destroy(),11);case 11:a.w=null;case 10:a.P.clear(),a.J=null,a.Ie.clear(),a.f=null,a.H=null,a.ca=!0,a.Pc.clear(),a.Md=!1,rI(a),_.A(c)}})};
|
|
186
|
+
bI=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new AE:new _.BE,d=_.cp(a.configuration,[_.ve,"single-native"]),e=d.create(a),a.V=e,f=QH(a),f.track(a),a.Sc=f,g=null,sI(a)?g=new mF(b,c,e,f,a.configuration):g=new _.DE(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.A(h)})};
|
|
187
|
+
nI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.Qq(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
188
|
+
oI=function(a,b,c,d){return(new _.Dj(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}_.D(h,4);var l=c.url;var m=tI(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.ph(h,2);break;case 4:f=_.F(h);if(!a.Mc)throw f;return _.y(h,a.Mc(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 _.N(_.O,4,4014);uI(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
189
|
+
return b.stop()})).U};
|
|
190
|
+
gI=function(a,b,c){var d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:_.Xn("initDrm.start");d=new _.co({Jb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Xf:function(n){if(a.a){var p=wI(a),q=!1,t=Object.keys(n);0===t.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 v=1===t.length&&"00"===t[0];v&&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.");
|
|
191
|
+
if(t.length){t=a.getPeriods();for(var z=0;z<t.length;z++)for(var C=t[z],H=_.w(C.variants),E=H.next();!E.done;E=H.next()){E=E.value;var B=[];E.audio&&B.push(E.audio);E.video&&B.push(E.video);B=_.w(B);for(var G=B.next();!G.done;G=B.next()){G=G.value;var P=E.allowedByKeySystem;if(G.keyId){var R=n[v?"00":G.keyId];R=!!R&&!xI.includes(R);E.allowedByKeySystem=R}P!==E.allowedByKeySystem&&(R=G.type,G.type===_.r&&(R="video "+G.width+"x"+G.height+"@"+_.S.qf(G.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
192
|
+
(G.keyId+"'. Applying restrictions to "+R)));C===p&&P!==E.allowedByKeySystem&&(q=!0)}}}if(n=UF(a.a)){v=WF(a.a);t=XF(a.a);a:{z=n.variants;for(C=0;C<z.length;C++)if(z[C].audio===v&&z[C].video===t){v=z[C];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(xB),TI(a),UI(a,n.variants)}q&&n!==p&&(a.log.info(xB),TI(a),UI(a,p.variants))}},Wf:function(n,p){a.trigger(new _.L(_.ee,{expirationTime:p}))},onEvent:function(n){return a.yf(n)},getConfiguration:function(){return a.getConfiguration()},cd:function(){return a.cd()}});
|
|
193
|
+
e=_.Cm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.Ut(b.periods);if(!f){m.F(2);break}l=_.km(_.ff);if(!l){m.F(2);break}return _.y(m,l.l(a,h),4);case 4:return _.y(m,l.j(f),5);case 5:g=m.f;case 2:return _.y(m,_.io(d,h,g),6);case 6:return a.w=d,VI(a,b.periods),_.Xn("initDrm.end"),_.Yn("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
194
|
+
hI=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,WI(a,c),XI(a,a.f.periods),a.Nc=new $G(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Hd=a.configuration.preferredTextLanguage,a.Ge=a.configuration.preferredTextRole,a.Dd=a.configuration.preferForcedSubtitles,_.y(q,_.Bo(a.w,c),2);if(3!=q.a)return kF(a.l,
|
|
195
|
+
b),a.h.configure(a.configuration.abr),a.cg&&a.h.setCmsdManager(a.cg),a.h.init(function(t,v,z){!a.ca&&YI(a,t,v,z)}),a.B=ZI(a,c,a.configuration.startTime),a.Gc=$I(a),a.I=new IF({Dh:function(){return c.playbackRate},sn:function(t){c.playbackRate=t},Pl:function(t){c.currentTime+=t}}),JF(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.He=new ZG(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),aJ(a,d),sI(a)?UE(a.f,_.di(a.configuration.preferredVideoCodec),
|
|
196
|
+
_.di(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):TE(a.f,_.di(a.configuration.preferredVideoCodec),_.di(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=bJ(a),e.h=a.configuration.streaming,a.a=e,a.G=OH,_.y(q,e.start(),3);kF(a.l,b);a.configuration.streaming.startAtSegmentBoundary&&(f=OD(a.B),g=cJ(a,f),HD(a.B.f,g));h=_.w(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,dJ(a,m);TI(a);n=wI(a)||a.f.periods[0];p=n.variants.some(function(t){return t.primary});
|
|
197
|
+
a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");UI(a,n.variants);_.A(q)})};
|
|
198
|
+
WI=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Wf&&a.Td?(a.J.a=AF,rI(a)):d.type===_.Og&&a.getState()===_.Cp&&.1>a.getBufferInfo().za(a.getMediaPosition())?(a.J.a=AF,rI(a)):a.J&&eJ(a));fJ(a)}a.o.on(b,_.uf,c);a.o.on(b,_.ef,c);a.o.on(b,_.ne,c);a.o.on(b,_.Wf,c);a.o.on(b,_.Vf,c);a.o.on(b,_.If,c);a.o.on(b,_.Og,c);a.o.on(b,_.Kf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
199
|
+
uI=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)})){_.Jh("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)}};ZI=function(a,b,c){return new MD(b,a.f,a.configuration.streaming,c,function(d){a.Gc&&QD(a.Gc,!0,d);a.a&&kG(a.a)},function(d){return a.dispatchEvent(d)},a.ba===_.Ib)};
|
|
200
|
+
$I=function(a){var b=new RD(a.j),c=new CF(a.f);DF(c,function(){TI(a)});b.a.add(c);a.K&&(c=new TD(a.K),UD(c,function(d){d.Pe&&d.Pe();mI(a,_.bi,d)},function(d){d.Vf&&d.Vf();mI(a,_.ci,d)},function(d,e){e||(d.Pe&&d.Pe(),mI(a,_.bi,d),d.Vf&&d.Vf(),mI(a,_.ci,d))}),b.a.add(c));a.ba===_.Ib&&(c=new $C(a.Kd,a.Qd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Ke=c);return b};aJ=function(a,b){a.J=new BF(b,Math.min(.5,b/2));a.J.a=AF;rI(a);a.Lc=(new _.Vk(function(){eJ(a)})).xb(.25)};
|
|
201
|
+
eJ=function(a){switch(a.G){case OH:a:if(a.j.ended||a.L.ue())var b=!0;else{if(a.isLive()){b=mD(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.ha(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=a.L.Jf();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.za(e),d=d.za(e),c=Math.min(c,d)):c=c?c.za(e):d?d.za(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?zF:AF;d.a=c;d=e!==c}c=d;d=gJ(a);c||a.getState()===_.tp&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
202
|
+
d,"buffered to end",b,"state",a.getState()),rI(a)):a.Md&&fJ(a)};bJ=function(a){var b={configuration:{Gl:a.ba===_.Ib},Pb:function(){return OD(a.B)},W:a.L,Jb:a.getNetworkEngine(),Uf:a.Zj.bind(a),Tf:a.Yj.bind(a),onError:a.onError.bind(a),di:a.nm.bind(a),onEvent:a.yf.bind(a),ii:a.Jn.bind(a),Qe:a.zm.bind(a),ze:function(){return a.h},rf:a.jj.bind(a),Hi:a.zn.bind(a),Gd:a.w};return new _.SF(a.f,b)};
|
|
203
|
+
EH=function(a){if(a.f&&a.B){var b=hJ(a),c=[];a=_.w(iJ(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=$E(d);e.active=d===b;c.push(e)}return c}return[]};CH=function(a,b){if(a.f&&a.a){var c=wI(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(jJ(a,c,d,!1),kJ(a,d),a.Hd=d.language,a.Dd=d.kind===_.qe):a.log.error(_.QB,b.id)}};
|
|
204
|
+
FH=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=wI(a);if(a.configuration.abr.enabled&&b)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();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.h.enable();a.$=null;c=UI(a,e.variants);null!=a.Fa&&(a.Nc=a.Fa,a.Fa=null);null==c||a.ca||YI(a,c);return}if(b){a.$=b.id;var f=e.variants.find(function(g){return g.id===
|
|
205
|
+
b.id});f?(a.$=f.video.id,bF(f)?(lJ(a,e,f,!1),mJ(a,f,c,d),null==a.Fa&&(a.Fa=a.Nc),a.Nc=new aH(f),UI(a,e.variants)):a.log.error("Unable to switch to restricted track",b.id)):a.log.error("No variant with id",b.id)}else a.$=null,null!=a.Fa&&(a.Nc=a.Fa,a.Fa=null),c=UI(a,e.variants),null==c||a.ca||YI(a,c)}};
|
|
206
|
+
DH=function(a,b){if(a.configuration.streaming.disableAudioTracks)Promise.reject(Error("Audio tracks are disabled by config."));else{if(a.a&&(a.f||a.B)){var c=XF(a.a),d=WF(a.a),e=hE(a.f.periods,OD(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&bF(m)});e=!1;var g=void 0;if(c){if(g=f.find(function(m){return m.video.id===c.id}),!g){a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId");e=!0;var h=a.getTrackManager().Oa();
|
|
207
|
+
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Oc=d.id;a.h.setVariants(f);f=wI(a);lJ(a,f,g,!1);e||a.ca?mJ(a,g,!0,0):_.fG(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
208
|
+
GH=function(a){var b=a.lg;return a.f?a.L.getTextDisplayer().isTextVisible():b};BH=function(a,b){var c,d,e,f;return _.I(function(g){c=a.lg;d=b;if(c===d)return g["return"]();a.lg=d;if(a.G!==OH)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return eG(a.a),g.F(0);e=wI(a);f=_.dF(e.textStreams,a.Hd,a.Ge,a.Dd);return 0<f.length?_.y(g,bG(a.a,f[0]),0):g.F(0)})};
|
|
209
|
+
lJ=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){JH(e,c.video,d);var g=e.na();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&&(JH(e,c.audio,d),e=e.Sa(),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})))}XG(a.P,
|
|
210
|
+
b).variant=c};jJ=function(a,b,c,d){XG(a.P,b).text=c;if(b=a.getTrackManager())JH(b,c,d),c=b.Na(),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}))};nJ=function(a){return a.ba===_.Ib&&"flat"===a.configuration.playlist.timeline};
|
|
211
|
+
XI=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.Pi++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ca:0,mimeType:_.Tc,codecs:"",kind:_.pd,encrypted:!1,
|
|
212
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Q,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)}};
|
|
213
|
+
VI=function(a,b){for(var c=a.a?WF(a.a):null,d=a.a?XF(a.a):null,e=!sI(a),f=_.w(b),g=f.next();!g.done;g=f.next())ZE(a.w,c,d,g.value,e);c=UC(b,function(h){return h.variants.some(bF)});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=
|
|
214
|
+
e.value,(g=e.video)&&!VC(g.type,_.Qk(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.N(_.O,4,4032);if(c<b.length)throw new _.N(_.O,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,WE(d.variants,a.configuration.restrictions,a.Oi)&&a.a&&wI(a)===d&&TI(a),oJ(a,d.variants)};
|
|
215
|
+
dJ=function(a,b){var c=a.a?WF(a.a):null,d=a.a?XF(a.a):null,e=!sI(a);ZE(a.w,c,d,b,e);d=b.variants;if(!d.some(bF))throw new _.N(_.O,4,4011);oJ(a,b.variants);WE(d,a.configuration.restrictions,a.Oi)&&a.a&&wI(a)===b&&TI(a);if(!_.Ij(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,_.Eo(a.w,g.keyId,g.initData)||
|
|
216
|
+
_.vo(a.w,g.initDataType,g.initData,g.keyId)}}};mJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ca?(a.ta=b,a.Ni=c,a.Mi=d):gG(a.a,b,c,d)};kJ=function(a,b){a.ca?a.fa=b:_.fG(a.a,b,!0,0)};pJ=function(a){if(a.a&&a.f){var b=UF(a.a),c=wI(a);null!=b&&b===c&&(WF(a.a),XF(a.a),_.VF(a.a,_.Q),XG(a.P,c),XG(a.P,c))}};
|
|
217
|
+
cJ=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=WF(a.a),e=XF(a.a),f=wI(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};gJ=function(a){return a.w&&a.w.C?!0:a.J?a.J.getState()===AF:!1};
|
|
218
|
+
rI=function(a){if(a.H&&a.J&&a.B){var b=qJ(a)===_.tp,c=a.I;c.l=b;MF(c,c.o?"seek":void 0);a.B.j.o=b;fJ(a);a.Ke&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Ke,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Rf))))}};fJ=function(a){RH(a,qJ(a))};qJ=function(a){if(a.Td)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Md&&0<=c&&b<=c?!0:!1}return b?_.vp:gJ(a)||a.Td?_.tp:a.j&&a.j.paused?_.Bp:_.Cp};
|
|
219
|
+
UI=function(a,b){try{oJ(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return bF(e)});c=hF(c,a.Oc);var d=a.Nc.create(c);d=Array.from(d.values());a.h.setVariants(d);if(null!==a.$&&null!==a.Oc&&(d=d.find(function(e){return e.video.id===a.$&&e.audio.id===a.Oc}),a.$=null,d))return d;if(a.configuration.abr.enabled||null===a.$)return a.h.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.$});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
220
|
+
a.h.chooseVariant())};rJ=function(a,b){return _.dF(b,a.Hd,a.Ge,a.Dd)[0]||null};sJ=function(a,b,c){c=void 0===c?!0:c;var d=UI(a,b.variants);a.Oc=d&&d.audio&&d.audio.id;d&&(lJ(a,b,d,!0),mJ(a,d,c));(c=rJ(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||GH(a))&&(jJ(a,b,c,!0),kJ(a,c))};
|
|
221
|
+
vJ=function(a,b){a.ca=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=UI(a,b.variants),d=rJ(a,b.textStreams);a.ta&&(b.variants.includes(a.ta)&&(c=a.ta),a.ta=null);a.fa&&(b.textStreams.includes(a.fa)&&(d=a.fa),a.fa=null);c&&tJ(a,b,function(){return lJ(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||GH(a))&&tJ(a,b,function(){return jJ(a,b,d,!0)});b===wI(a)&&uJ(a);return a.configuration.streaming.alwaysStreamText||GH(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
222
|
+
YI=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=wJ(a,b);tJ(a,e,function(){return lJ(a,e,b,!0)});e===wI(a)&&uJ(a);a.a&&gG(a.a,b,c,d)}};TI=function(a){var b=a.getTrackManager();b&&a.G!==qI&&(b.m&&(IH(b),b.m.trigger(new _.L(_.qv))),uJ(a))};uJ=function(a){var b=wI(a);if(b){var c=a.Pc.get(b)||[];for(a.Pc["delete"](b);c.length;)c.shift()()}};tJ=function(a,b,c){a.Pc.has(b)||a.Pc.set(b,[]);a.Pc.get(b).push(c)};
|
|
223
|
+
mI=function(a,b,c){a.trigger(new _.L(b,{detail:qD(c,nJ(a))}))};
|
|
224
|
+
oJ=function(a,b){var c=a.w?_.M.Eg(a.w.fa):{},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?xI.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 _.N(_.O,4,4012,{hasAppRestrictions:f,
|
|
225
|
+
missingKeys:g,restrictedKeyStatuses:h});};iJ=function(a){var b=wI(a);if(null==b)return[];pJ(a);return b.variants.filter(function(c){return bF(c)})};xJ=function(a){var b=wI(a);if(null==b)return[];pJ(a);return b.textStreams.filter(function(c){return!a.Ie.has(c)})};wI=function(a){var b=OD(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};hJ=function(a){var b=wI(a);return b&&XG(a.P,b).variant};
|
|
226
|
+
wJ=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};YH=function(a){if(a.G===qI)throw new _.N(_.O,7,7E3,"Player is destroyed.");};
|
|
227
|
+
yJ=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,C,H,E,B,G,P,R;return _.I(function(da){switch(da.a){case 1:return d=_.Np,_.D(da,2),_.y(da,_.Qq(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=da.f;e.configure(a.configuration.manifest);var ea=e;var Ca=b.url,bb=tI(a,a.configuration.id||"");ea=ea.start(Ca,bb);return _.y(da,ea,5);case 5:f=da.f;uI(f.periods);if(!f.periods.length)throw new _.N(_.O,4,4014);return _.y(da,a.A.stop(),6);case 6:a.A=e;g=c.audio&&
|
|
228
|
+
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=hE(f.periods,OD(a.B))||f.periods[0];sI(a)?UE(a.f,_.di(a.configuration.preferredVideoCodec),_.di(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):TE(a.f,_.di(a.configuration.preferredVideoCodec),_.di(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=jH(g,h,l.variants);n=rJ(a,l.textStreams);UI(a,l.variants);p=m&&m.video;q=m&&m.audio;t=[];v=new Set;z=_.w(l.variants);for(C=z.next();!C.done;C=
|
|
229
|
+
z.next())H=C.value,H.video&&v.add(H.video),H.audio&&v.add(H.audio);E=a.getNetworkEngine();B=_.w(_.bh(v).concat(_.bh(l.textStreams)));for(G=B.next();!G.done;G=B.next())P=G.value,t.push(P.createSegmentIndex(E));return _.y(da,Promise.all(t),7);case 7:sG(a.a,d.AUDIO,q);sG(a.a,d.VIDEO,p);sG(a.a,d.TEXT,n);m&&lJ(a,l,m,!1);a.log.info("Switch CDN successful.");_.ph(da,0);break;case 2:R=_.F(da);if(!e){da.F(8);break}return _.y(da,e.stop(),8);case 8:throw R;}})};
|
|
230
|
+
tI=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return dJ(a,c)},filterAllPeriods:function(c){return VI(a,c)},onEvent:function(c){return a.yf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return WH(a,c)},onTurnedStatic:function(){return XH(a)}}};
|
|
231
|
+
sI=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.ag&&(_.Ij(2)||_.Ij(3)||_.Ij(4)||_.Ij(5)||_.Ij(6)||_.Jj()&&38===_.Zk().major||_.Jj()&&53===_.Zk().major||_.Jj()&&68===_.Zk().major?!1:!0)};zJ=function(){};_.Li.prototype.f=yC(0,function(){return this.keyInfo});var BC=[112,115,115,104,0,0,0,0];_.QC.prototype.Od=function(){return this.ka?this.ka-this.ya+1:null};_.QC.prototype.f=function(){return this.keyInfo};$C.prototype.release=function(){this.f=this.j=this.h=this.a=null};
|
|
232
|
+
$C.prototype.l=function(a){LC(this.a,a);aD(this)};bD.prototype.Qb=function(){return this.h};bD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.u=_.dD.prototype;_.u.vc=function(){return this.L};_.u.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.u.getPresentationStartTime=function(){return this.G};_.u.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
233
|
+
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.Vd=function(){return!this.l};rD.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};rD.prototype.cues=function(){return this.a};wD.prototype.release=function(){this.h=null;this.f=function(){}};
|
|
234
|
+
AD.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};AD.prototype.Qe=function(){this.A=!0;zD(this)};BD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};FD.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};
|
|
235
|
+
MD.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(){}};RD.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()};TD.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};
|
|
236
|
+
TD.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={gf:d.gf,ge:d.ge},f=e.next()){f=f.value;d.gf=this.o.get(f)||null;d.ge=SD(f,a);this.o.set(f,d.ge);var g=this.w.find(function(h){return function(l){return l.Fc===h.gf&&l.Ec===h.ge}}(d));g&&g.xc(f,b&&0===c)}};VD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Va().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=WD(this);return{value:a,done:!a}};
|
|
237
|
+
_.u=_.XD.prototype;_.u.destroy=function(){this.a=[];return Promise.resolve()};_.u.Wc=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};
|
|
238
|
+
_.u.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]};_.u.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.Ca-=a};
|
|
239
|
+
_.u.sd=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};_.u.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
240
|
+
_.u.sa=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 _.Li(f.position,g.startTime,g.endTime,g.Va,g.ya,g.ka,g.Ca,g.keyInfo,g.Zc,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);if(b.length)for(d=
|
|
241
|
+
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Li(d++,f.startTime,f.endTime,f.Va,f.ya,f.ka,f.Ca,f.keyInfo,f.Zc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),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 _.Li(e-d--,f.startTime,f.endTime,f.Va,f.ya,f.ka,f.Ca,f.keyInfo,f.Zc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
|
|
242
|
+
a};_.u.replace=function(a){this.a=a};_.AJ=0;_.u=mE.prototype;_.u.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.u.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))})};_.u.La=function(){return this.a};_.u.ha=function(){return this.f};_.u.Gb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};
|
|
243
|
+
_.u.za=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.u=_.tE.prototype;_.u.track=function(a){null!=this.player&&vE(this);a&&(this.player=a,this.player.on(_.Pf,this.Uc,this))};_.u.release=function(){vE(this);this.T=[];this.f=this.h=null};
|
|
244
|
+
_.u.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.T.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.T);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
245
|
+
b<e.end&&(e.start=b);this.T.push(c);this.T.sort(sE)}yE(this);this.Uc();this.player&&this.player.trigger(new _.L(_.Jg))};_.u.clear=function(){this.T=[];yE(this);this.player&&(this.player.trigger(new _.L(_.Jg)),this.player.trigger(new _.L(_.hd)))};
|
|
246
|
+
_.u.Uc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.T.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.T[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.T[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.T[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(_.jd,
|
|
247
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};AE.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Wi(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};AE.prototype.h=function(a,b){var c=_.Wi(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};AE.prototype.f=function(){this.a.resetCaptionStream()};_.BE.prototype.init=function(){};_.BE.prototype.h=function(){};_.BE.prototype.f=function(){};_.u=_.DE.prototype;
|
|
248
|
+
_.u.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"](NC));for(e=1;e<d.length;++e)d[e].p["catch"](NC),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=
|
|
249
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.J};_.u.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=_.Np,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Qk(g.mimeType,g.codecs);if(h===e.TEXT)d.fc(l);else{var m=new Map;m.set(h,l);if((!_.Ot(l)||!b||g.keyInfo)&&_.Pk(l,h)){var n=_.Pk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}GE(d,m)}});_.A(f)})};_.u.Di=function(){this.g.debug(WB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
250
|
+
_.u.Sh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.u.fc=function(a){this.a||(this.a=new mE(this.L,this.C));nE(this.a,a)};_.u.ue=function(){return this.o?this.o.readyState===_.ne:!0};_.u.La=function(a){return a===_.Q?this.a.La():(a=HE(this,a))?a.La():null};_.u.ha=function(a){return a===_.Q?this.a.ha():(a=HE(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.a.Gb(b):(a=HE(this,a))?a.Gb(b,!1,c):!1};
|
|
251
|
+
_.u.za=function(a,b){if(a===_.Q)return this.a.za(b);var c=HE(this,a);return c?c.za(b):0};_.u.Jf=function(){var a={};a.total=new _.Tl(this.j.buffered,"total");a.audio=HE(this,_.ad);a.video=HE(this,_.r);var b=[];this.a&&(b=[{start:this.a.La(),end:this.a.ha()}]);a.text=ZC(b,_.Q);return a};
|
|
252
|
+
_.u.te=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===_.Q?b=oE(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.fc(_.mg),qE(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(JE(this,_.ad,this.Af.bind(this,_.ad,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(JE(this,
|
|
253
|
+
_.r,this.Af.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.fc(_.mg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&qE(h.a,p,c,d,h.f.video.timestampOffset)})),b=JE(this,a,this.Af.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(tB,c,d,vB,IE(h,a));else if(a===_.ad&&null!==c&&null!==d)wE(h.B),null!==c&&null!==d&&h.g.debug(sB,c,d,vB,IE(h,a));else if(a===_.r&&null!==c&&null!==
|
|
254
|
+
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 t=c-p;if(Math.abs(t)>h.P&&0===l.timestampOffset)return h.g.warn(yB+t+fB+(a+mB)+(c+eB)+(p+lB)),p=JE(h,a,function(){h.Yg(a,t)}),q=JE(h,a,h.Vg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.u.Xg=function(a){var b=this.ha(_.r)||0;pE(this.a,a,b)};
|
|
255
|
+
_.u.Pg=function(){this.a&&pE(this.a,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.a.remove(b,c):JE(this,a,this.Wg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.La(a),f=d.ha(a);null!==e&&null!==f&&zE(d.B,e,f)}else a===_.ad&&xE(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return JE(this,a,this.Wg.bind(this,a,0,this.o.duration))};
|
|
256
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():JE(this,a,this.Vg.bind(this,a))};_.u.Fi=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.Np;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=KE(e,a,b,c,d);e.K&&(g=g.concat(KE(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return NE(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.Bf=function(a){var b=this;NE(this,function(){b.o.duration=a})};
|
|
257
|
+
_.u.getDuration=function(){return this.o.duration};_.u.Af=function(a,b){this.g.debug(uB+a+gB);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(GB+a,c),c;}this.g.debug(AB+a+gB)};_.u.Wg=function(a,b,c){if(c<=b)this.Xc(a);else{this.g.debug(VB+a+jB,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(IB+a+hB,b,c,d),d;}this.g.debug(CB+a+jB,b,c)}};
|
|
258
|
+
_.u.$j=function(a){try{this.g.debug(rB+a+gB);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(FB+a+gB,d),d;}this.g.debug(zB+a+gB);this.Xc(a)};_.u.Vg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(LB+a),this.j.currentTime-=.001):this.g.warn($B+a+kB+this.j.readyState)}catch(b){throw this.g.warn(HB+a,b),b;}this.g.debug(BB+a);this.Xc(a)};
|
|
259
|
+
_.u.Yg=function(a,b){0>b&&(b+=.001);try{this.g.debug(ZB+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(KB+a,b,c),c;}this.g.debug(EB+a,b);this.Xc(a)};_.u.ak=function(a,b,c){try{this.g.debug(XB+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(JB+a,b,c,d),d;}this.g.debug(DB+a,b,c);this.Xc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
260
|
+
_.u.Xc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(bC+a),ME(this,a))};_.u.getTextDisplayer=function(){return this.C};var FE=window.URL.createObjectURL;_.u=mF.prototype;
|
|
261
|
+
_.u.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"](NC));for(e=1;e<d.length;++e)d[e].p["catch"](NC),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=
|
|
262
|
+
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.u.open=function(){return this.L};_.u.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=_.Np,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Qk(g.mimeType,g.codecs);if(h===e.TEXT)d.fc(l);else{var m=new Map;m.set(h,l);if((!_.Ot(l)||!b||g.keyInfo)&&_.Pk(l,h)){var n=_.Pk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}oF(d,m)}d.h[h]=[]});_.A(f)})};_.u.Di=function(){this.g.debug(WB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
263
|
+
_.u.Sh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.fc=function(a){this.f||(this.f=new mE(this.J,this.C));nE(this.f,a)};_.u.ue=function(){return this.o?this.o.readyState===_.ne:!0};_.u.La=function(a){return a===_.Q?this.f.La():(a=pF(this,a))?a.La():null};_.u.ha=function(a){return a===_.Q?this.f.ha():(a=pF(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.f.Gb(b):(a=pF(this,a))?a.Gb(b,!1,c):!1};
|
|
264
|
+
_.u.za=function(a,b){if(a===_.Q)return this.f.za(b);var c=pF(this,a);return c?c.za(b):0};_.u.Jf=function(){var a={};a.total=new _.Tl(this.j.buffered,"total");a.audio=pF(this,_.ad);a.video=pF(this,_.r);var b=[];this.f&&(b=[{start:this.f.La(),end:this.f.ha()}]);a.text=ZC(b,_.Q);return a};
|
|
265
|
+
_.u.te=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===_.Q?b=oE(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.fc(_.mg),qE(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(rF(this,_.ad,this.zf.bind(this,_.ad,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(rF(this,
|
|
266
|
+
_.r,this.zf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.fc(_.mg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&qE(h.f,p,c,d,h.a.video.timestampOffset)})),b=rF(this,a,this.zf.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(tB,c,d,vB,qF(h,a));else if(a===_.ad&&null!==c&&null!==d)wE(h.B),null!==c&&null!==d&&h.g.debug(sB,c,d,vB,qF(h,a));else if(a===_.r&&null!==c&&null!==
|
|
267
|
+
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 t=c-p;if(Math.abs(t)>h.V&&0===l.timestampOffset)return h.g.warn(yB+t+fB+(a+mB)+(c+eB)+(p+lB)),p=rF(h,a,function(){sF(h,a,t)}),q=rF(h,a,h.Tg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.Xg=function(a){var b=this.ha(_.r)||0;pE(this.f,a,b)};
|
|
268
|
+
_.u.Pg=function(){this.f&&pE(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):rF(this,a,this.Ug.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.La(a),f=d.ha(a);null!==e&&null!==f&&zE(d.B,e,f)}else a===_.ad&&xE(d.B)})};_.u.clear=function(a){if(a===_.Q){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return rF(this,a,this.Ug.bind(this,a,0,this.o.duration))};
|
|
269
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():rF(this,a,this.Tg.bind(this,a))};_.u.Fi=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.Np;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,yF(g,a,e,f),2)}l=n.f;m=tF(g,a,b,c,d,l);g.N&&(m=m.concat(tF(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return wF(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
270
|
+
_.u.Bf=function(a){var b=this;wF(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.zf=function(a,b){this.g.debug(uB+a+gB);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(GB+a,c),c;}this.g.debug(AB+a+gB)};_.u.Ug=function(a,b,c){if(c<=b)this.qc(a);else{this.g.debug(VB+a+jB,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(IB+a+hB,b,c,d),d;}this.g.debug(CB+a+jB,b,c)}};
|
|
271
|
+
_.u.Tg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(LB+a),this.j.currentTime-=.001):this.g.warn($B+a+kB+this.j.readyState)}catch(b){throw this.g.warn(HB+a,b),b;}this.g.debug(BB+a);this.qc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.u.qc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(bC+a),vF(this,a))};_.u.getTextDisplayer=function(){return this.C};var nF=window.URL.createObjectURL;BF.prototype.getState=function(){return this.a};var AF=0,zF=1;CF.prototype.release=function(){this.a=this.h=null;this.f=function(){}};CF.prototype.l=function(a){var b=this.a,c=this.h.periods;a=hE(c,a)||c[0];b!==a&&this.f(a);this.a=a};EF.prototype.add=function(a,b){var c=void 0===b?!0:b;if(HF(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Eh("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};EF.prototype.values=function(){return this.a.values()};IF.prototype.getConfiguration=function(){return this.j};IF.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};IF.prototype.set=function(a,b){this.h=a;MF(this,b)};var PF=new _.lp(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])});_.u=_.SF.prototype;_.u.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,cG(e),b.push(dG(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;_.A(f)})};
|
|
272
|
+
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Pb();c=hE(a.j.periods,b+_.fv);if(!c)throw new _.N(_.O,5,5006,"No period found.");d=a.D.Uf(c);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.N(_.O,5,5005,"No streams chosen.");a.C=!d.variant&&!!d.text;return _.y(e,zG(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.pm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
273
|
+
a.D.pm());_.A(e)})};_.u.resume=function(){if(!oG(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,aG(this,b,0)};
|
|
274
|
+
_.u.Ub=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=lG(a);if(a.sb||null==a.gb||a.oc)return m["return"]();a.gb=null;if(!a.Zb){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,qG(b,a,a.Ye,a.re),3);case 3:return m["return"]();case 2:_.D(m,4);d=EG(b,a);null!=d&&(aG(b,a,d),a.dd=!1);_.ph(m,5);break;case 4:return e=_.F(m),_.y(m,PG(b,e),6);case 6:return m["return"]();case 5:UG(b,a);if(!pG(b)){m.F(0);break}if(b.D.configuration.Gl){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
275
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.gb=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.di();_.A(m)}})};
|
|
276
|
+
_.u.Km=function(a,b,c,d){var e=AC(d.reader),f=AC(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.Rm(d.reader,d.reader.Ma()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.D.ii();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}}))};
|
|
277
|
+
_.u.Kn=function(a){var b=this,c=!1,d=0;(new _.Sm).M(_.Re,_.Tm).M(_.qg,_.Tm).M(_.Me,_.Tm).M(_.Qe,_.Tm).M(_.fg,_.Tm).Y(_.hg,_.Um).M("encv",function(e){e.reader.skip(78);_.Tm(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.W(e.reader),g=_.W(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 _.Gm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};VG.prototype.clear=function(){this.a.clear()};ZG.prototype.release=function(){this.f.release()};aH.prototype.create=function(a){var b=this,c=this.a===_.ag&&dE(),d=a.filter(function(e){return HF(b.f,e,!c)});return d.length?new EF(d[0],d):this.h.create(a)};
|
|
278
|
+
$G.prototype.create=function(a){var b=bH(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=cH(a,this.a);0<c.length?(a=c,b=!0):_.Eh("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=PE(a,this.f),b.length?a=b:_.Eh("No exact match for the channel count could be found."));b=dH(a,this.l);b.length?a=b:_.Eh("No exact match for spatial audio could be found.");b=this.h===_.ag&&dE();c=new EF(a[0]);a=_.w(a);
|
|
279
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};_.Xq(function(){_.Jh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Ih("Patching Chromecast MSE bugs."),iH();else if(_.bl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;gH();10>=a?(_.Ih("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Ih("Patching Safari 11 \x26 12 MSE bugs."),eH(),fH()):(_.Ih("Patching Safari 13 MSE bugs."),eH())}else _.Ij(2)||_.Ij(3)||
|
|
280
|
+
_.Ij(4)?hH():_.Ih("Using native MSE as-is.");else _.Ih("No MSE implementation available.")});_.x(sH,_.cu);_.u=sH.prototype;
|
|
281
|
+
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Eh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.sg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.ud}catch(g){f.align="middle"}e.writingMode===_.Fg?f.vertical="lr":e.writingMode===_.Gg&&(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?
|
|
282
|
+
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)};_.u.remove=function(a,b){if(!this.a)return!1;tH(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.u.isTextVisible=function(){return this.a.mode===_.Xf};_.u.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Xf:_.ue)};_.u.destroy=function(){this.a&&tH(this.a,function(){return!0});this.a=null;return Promise.resolve()};uH.prototype.a=function(){return!0};uH.prototype.create=function(a){return new sH(a)};_.bp("single-native",new uH);_.x(vH,_.U);_.u=vH.prototype;_.u.initialize=function(a){this.m=a};_.u.release=function(){this.h=[];this.a.clear();this.f.clear()};_.u.load=function(){};_.u.destroy=function(){this.release();this.m=null};_.u.getVideoTracks=function(){return wH(this,_.Uj)};_.u.getAudioTracks=function(){return wH(this,_.Tj)};_.u.ia=function(){return wH(this,_.T)};_.u.na=function(){return this.a.get(_.Uj)||null};_.u.Sa=function(){return this.a.get(_.Tj)||null};_.u.Na=function(){return this.a.get(_.T)||null};
|
|
283
|
+
_.u.lb=function(){return this.f.get(_.Uj)||null};_.u.Ab=function(){return this.f.get(_.Tj)||null};_.u.Bb=function(){return this.f.get(_.T)||null};_.u.Oa=function(){return xH(this,_.Uj)};_.u.ma=function(){return xH(this,_.Tj)};_.u.xa=function(){return xH(this,_.T)};_.u.wb=function(a){zH(this,_.Uj,a)};_.u.Da=function(a){zH(this,_.Tj,a)};_.u.Qa=function(a){zH(this,_.T,a)};_.u.cb=function(a,b){yH(this,_.Uj,a,void 0===b?!1:b)};_.u.ub=function(a,b){yH(this,_.Tj,a,void 0===b?!1:b)};
|
|
284
|
+
_.u.vb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Na();if(d&&d.track.kind!==_.qe){var e=this.ia().find(function(g){return g.kind===_.qe&&g.language===d.track.language});if(!e){var f=this.ma();f&&(e=this.ia().find(function(g){return g.kind===_.qe&&g.language===f.language}))}e&&(c=e.renditions[0])}}yH(this,_.T,c,b)};_.u.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.F(0)})};
|
|
285
|
+
_.u.qa=function(){return!!this.m&&this.m.qa()};vH.prototype.isAbrEnabled=vH.prototype.qa;vH.prototype.addTextTrack=vH.prototype.addTextTrack;vH.prototype.setTextRendition=vH.prototype.vb;vH.prototype.setAudioRendition=vH.prototype.ub;vH.prototype.setVideoRendition=vH.prototype.cb;vH.prototype.setTextTrack=vH.prototype.Qa;vH.prototype.setAudioTrack=vH.prototype.Da;vH.prototype.setVideoTrack=vH.prototype.wb;vH.prototype.getTextTrack=vH.prototype.xa;vH.prototype.getAudioTrack=vH.prototype.ma;
|
|
286
|
+
vH.prototype.getVideoTrack=vH.prototype.Oa;vH.prototype.getLoadingTextRendition=vH.prototype.Bb;vH.prototype.getLoadingAudioRendition=vH.prototype.Ab;vH.prototype.getLoadingVideoRendition=vH.prototype.lb;vH.prototype.getTextRendition=vH.prototype.Na;vH.prototype.getAudioRendition=vH.prototype.Sa;vH.prototype.getVideoRendition=vH.prototype.na;vH.prototype.getTextTracks=vH.prototype.ia;vH.prototype.getAudioTracks=vH.prototype.getAudioTracks;vH.prototype.getVideoTracks=vH.prototype.getVideoTracks;_.u=_.LH.prototype;_.u.stop=function(){this.A=null;this.j=!1;this.o=[];this.l=1;this.f=null;this.C=!1};_.u.init=function(a){this.A=a};
|
|
287
|
+
_.u.chooseVariant=function(){var a=MH(this,!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.o),b=this.getBandwidthEstimate();this.o.length&&!a.length&&(this.g.warn("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=MH(this,null,this.o),a=[a[0]]);this.f=Date.now();this.C=!0;for(var c=a[0]||null,d=0;d<a.length;d++){var e=a[d],f=a[d+1],g=isNaN(this.l)||0===this.l?1:Math.abs(this.l),h=g*e.bandwidth,l=h/this.a.bandwidthDowngradeTarget;
|
|
288
|
+
f=g*(f?f.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(h/1E6).toFixed(3),(l/1E6).toFixed(3),(f/1E6).toFixed(3));b>=l&&b<=f&&(c=e)}return c};_.u.enable=function(){this.j=!0};_.u.disable=function(){this.j=!1};
|
|
289
|
+
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.f,"enabled\x3d"+this.j);var c=this.w;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.fE(c.f,e,d);_.fE(c.h,e,d)}if(null!=this.f&&this.j)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.f<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
290
|
+
break a}}else if(Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.u.playbackRateChanged=function(a){this.l=a};
|
|
291
|
+
_.u.getBandwidthEstimate=function(){if(this.h&&this.a.useCmsd){var a=JC(this.h,_.pe);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}a=this.w;return 128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.gE(a.f),_.gE(a.h))};_.u.setVariants=function(a){this.o=a};_.u.setCmsdManager=function(a){this.h=a};_.u.configure=function(a){this.a=a};_.u.reset=function(){this.B=!1;this.w=new KH;var a=this.chooseVariant();a&&this.A(a)};_.x(PH,_.im);_.u=PH.prototype;_.u.init=function(a,b){var c=a.getMedia();_.im.prototype.init.call(this,a,b);aI(this,c)};_.u.namespace=function(){return hC};_.u.setSeekInterceptor=function(a){this.yg=a||null};_.u.lh=function(){return new vH};_.u.getState=function(){return this.nc};_.u.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
292
|
+
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){BH(a,!1);a.Md=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===qI?c["return"]():_.y(c,cI(a),2)}a.Z=null;a.ug=0;a.Oc=null;a.$=null;_.A(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ga)return b["return"](a.ga);a.ga=SH(a);a.ga["finally"](function(){a.ga=null});return b["return"](a.ga)})};
|
|
293
|
+
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Jf(),c=new _.Tl(void 0,a);switch(a){case _.Uj:return b.video?b.video:c;case _.Tj:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Sc?(b=uE(this.Sc),ZC(b,a)):_.im.prototype.getBufferInfo.call(this,a)};_.u.getPosition=function(){var a=this.Qd,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.u.getMediaPosition=function(){return this.B?OD(this.B):_.im.prototype.getMediaPosition.call(this)};
|
|
294
|
+
_.u.seek=function(a){if(this.yg&&!this.yg(a))return Promise.resolve();var b=this.Qd;b=b.a?a+b.a.Qb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.im.prototype.seek.call(this,b)};_.u.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.u.getDuration=function(){var a=this.Qd,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
295
|
+
_.u.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.u.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===qI)return b["return"]();a.log.debug("Destroying player...");a.G=qI;$H(a);a.o&&(a.o.release(),a.o=null);a.Kd=null;a.h=null;_.A(b)})};_.u.getTimeline=function(){return this.Kd};
|
|
296
|
+
_.u.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){switch(z.a){case 1:return c=new _.Cj,b.l.a=c,_.D(z,2),YH(b),b.ba=_.Ib,_.y(z,dI(b),4);case 4:return kF(b.l,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Gp(d),b.configuration=_.gm(b.mc,d),b.log.info("Loading playlist configurations",a),b.Kd=TH(b.configuration),_.y(z,eI(b,c),5);case 5:return kF(b.l,c),e=a.map(function(C){return fI(b,C,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
297
|
+
case 6:f=z.f;g=f.filter(function(C){return C.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.N(_.O,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.kc)throw new _.N(_.O,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.O,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.dD({version:2},null,0,m);p=f.map(function(C){return mH(C.manifest)});
|
|
298
|
+
q=pH(p,n);b.f=q;t=b;return _.y(z,gI(b,q,b.configuration.drm),7);case 7:return t.w=z.f,kF(b.l,c),_.y(z,hI(b,c),8);case 8:kF(b.l,c);iG(b.a,q);VH(b,q);c.resolve();_.ph(z,0);break;case 2:v=_.F(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:iI(b,v,c),_.A(z)}})};
|
|
299
|
+
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){YH(b);if(b.ba!==_.Ib)throw new _.N(_.O,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,pI(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;iG(b.a,c.manifest);pG(b.a)&&b.a.resume();VH(b,c.manifest);_.A(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
300
|
+
_.u.Sg=function(){var a=this;return _.I(function(b){YH(a);if(!a.Ne)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Ne);a.Ne=null;return _.y(b,hI(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return YH(b),_.Xn("preload.start"),b.log.info("Preloading asset",a),_.y(c,jI(b,a,!1),2);b.Ne=a;b.log.info("Preloaded asset",a);_.Xn("preload.end");_.Yn("preload","preload.start","preload.end");_.A(c)})};
|
|
301
|
+
_.u.load=function(a){return jI(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,ZH(a),2);a.configuration=a.mc;$H(a);_.A(b)})};_.u.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};_.u.mi=function(){this.log.debug("User seeking finished");this.J&&eJ(this);fJ(this)};
|
|
302
|
+
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:eD(b),end:oD(b)}}b=this.Qd;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.u.vc=function(){return this.f?this.f.presentationTimeline.vc():null};_.u.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
303
|
+
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===OH){if(_.Ij()){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.gc&&(c.g.debug("Engaging trick mode stream",
|
|
304
|
+
d),_.fG(c,d,!1,0),e.gc=f);else if(f=e.gc)c.g.debug("Restoring non-trick-mode stream",f),e.gc=null,_.fG(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ia=function(){if(this.f&&this.B){var a=wI(this);if(null==a)a=null;else{if(!XG(this.P,a).text){var b=_.dF(a.textStreams,this.Hd,this.Ge,this.Dd);b.length&&(b=b[0],XG(this.P,a).text=b)}a=XG(this.P,a).text}b=[];for(var c=_.w(xJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=aF(d);e.active=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
|
|
305
|
+
_.u.getStats=function(){if(this.G!==OH)return _.kp();fJ(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===OH){if(a=hJ(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()};_.u.getCueTimeline=function(){return this.K};
|
|
306
|
+
_.u.getTimelineCues=function(){return this.K?uD(this.K,nJ(this)):[]};_.u.resetAbr=function(){this.h&&this.h.reset()};_.u.ze=function(){return this.h};
|
|
307
|
+
_.u.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,v,z;return _.I(function(C){if(1==C.a){if(g.G!==OH)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=wI(g);l=_.Np;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 _.N(1,4,4040);t=new _.Li(1,0,q,function(){return[a]},0,null,0);v={id:g.Pi++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
308
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(H){return 1===H?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.kC,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.Ie.add(v);h.textStreams.push(v);return _.y(C,bG(g.a,v),
|
|
309
|
+
2)}if(z=_.VF(g.a,_.Q))XG(g.P,h).text=z;g.Ie["delete"](v);g.log.debug("Choosing new streams after adding a text stream");sJ(g,h);TI(g);return C["return"](aF(v))})};
|
|
310
|
+
_.u.Zj=function(a){this.log.debug(_.oC,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=vJ(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}}};
|
|
311
|
+
_.u.Yj=function(){this.log.debug("canSwitch_");this.ca=!1;this.configuration.abr.enabled&&this.h.enable();this.ta&&(gG(this.a,this.ta,this.Ni,this.Mi),this.ta=null);this.fa&&(_.fG(this.a,this.fa,!0,0),this.fa=null)};_.u.Jn=function(){this.A&&this.A.update()};_.u.zm=function(){this.B&&this.B.j.Qe()};
|
|
312
|
+
_.u.jj=function(a,b,c){if((void 0===c?"":c)===mC)return TI(this),this.qa()||(this.configuration.abr.enabled=!0,this.h.enable()),sJ(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===_.ad&&(h=h&&l.language===a.language));return h})&&this.qa()){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)}TI(this);this.qa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
313
|
+
sJ(this,b)}return c};_.u.nm=function(){this.log.debug("endOfStream called by streaming engine");this.Md=!0};_.u.onError=function(a){if(this.G!==qI&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.oe,{detail:a});a.severity===_.O&&RH(this,_.zp);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.yf=function(a){a.type===_.he?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Pg?rI(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.fc,a.type)))};_.u.qa=function(){return this.configuration.abr.enabled};
|
|
314
|
+
_.u.zn=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Mc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.qa();return _.y(n,b.Mc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.M.sa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,rG(b.a),3);case 3:g=hJ(b);case 4:return h=!1,_.D(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,yJ(b,f,g),9);case 9:_.ph(n,6);break;case 7:return l=_.F(n),b.log.info("Switch failed"),
|
|
315
|
+
_.y(n,b.Mc(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(),nG(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.sd,{newManifest:f.url})),_.A(n))}})};var qI=0,NH=1,OH=2,xI=[_.df,_.xe];zJ.prototype.a=function(){return hC};
|
|
316
|
+
zJ.prototype.canPlay=function(a,b){if(_.al())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 _.Rq||_.Sq(a.url)in _.Tq?!0:!1:!1;if(d&&e){if(_.Ij(2))return 1;if(_.bl()&&c===_.El){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Eh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
317
|
+
zJ.prototype.f=function(a){return a===_.qa||a===_.Ib};zJ.prototype.create=function(){return new PH};_.Yl(new zJ);};
|
|
319
318
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
320
319
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
321
320
|
else{_=this.clpp._;(f.call(g,this));}
|