@castlabs/prestoplay 6.19.1 → 6.20.0
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 +25 -0
- package/README.md +8 -6
- 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 +108 -108
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +571 -567
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +77 -77
- package/cjs/cl.externs.js +34 -35
- package/cjs/cl.freewheel.js +21 -20
- package/cjs/cl.hls.js +71 -70
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -28
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +311 -309
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +29 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +459 -455
- package/cl.crypto.js +9 -9
- package/cl.dash.js +72 -72
- package/cl.externs.js +34 -35
- package/cl.freewheel.js +18 -18
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +278 -276
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -9
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/clpp.styles.css +0 -8
- package/package.json +1 -1
- package/typings.d.ts +36 -14
package/cjs/cl.mse.js
CHANGED
|
@@ -1,320 +1,322 @@
|
|
|
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
|
-
b,a.
|
|
30
|
-
|
|
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};
|
|
2
|
+
var f=function(window){var 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,QB,RB,SB,TB,UB,VB,WB,XB,$B,aC,bC,cC,dC,eC,fC,gC,hC,iC,jC,lC,mC,nC,oC,pC,qC,rC,uC,vC,xC,yC,zC,AC,BC,CC,DC,FC,GC,HC,IC,NC,OC,PC,QC,RC,SC,TC,VC,ZC,$C,bD,cD,dD,eD,gD,hD,iD,kD,lD,mD,nD,oD,pD,qD,rD,sD,uD,zD,FD,KD,ND,CD,MD,OD,PD,QD,RD,SD,TD,UD,VD,WD,$D,bE,cE,dE,aE,fE,eE,gE,hE,kE,lE,mE,jE,iE,nE,rE,tE,qE,uE,pE,sE,oE,wE,vE,xE,yE,zE,CE,DE,EE,FE,GE,IE,JE,KE,LE,ME,OE,PE,QE,SE,TE,RE,UE,VE,WE,XE,YE,$E,aF,ZE,iF,hF,jF,kF,
|
|
3
|
+
lF,pF,nF,rF,sF,tF,vF,uF,wF,yF,xF,EF,FF,BF,zF,CF,DF,GF,HF,KF,JF,LF,MF,NF,AF,OF,IF,RF,SF,UF,TF,VF,XF,WF,YF,aG,ZF,$F,cG,bG,dG,eG,fG,iG,kG,jG,mG,lG,oG,pG,qG,tG,sG,rG,uG,wG,vG,xG,yG,zG,AG,BG,CG,FG,EG,DG,HG,GG,JG,NG,PG,QG,VG,YG,$G,bH,KG,dH,gH,hH,iH,kH,lH,nH,oH,qH,cH,sH,TG,uH,tH,RG,aH,xH,vH,pH,rH,zH,yH,wH,GH,HH,BH,JH,CH,EH,MH,LH,FH,KH,NH,SG,mH,DH,jH,UG,WG,MG,AH,XG,IH,eH,fH,OH,RH,SH,TH,UH,VH,YH,ZH,XH,eI,lI,WH,kI,mI,fI,gI,hI,rI,nI,cI,bI,aI,dI,pI,qI,iI,jI,$I,wI,cJ,dJ,eJ,iJ,fJ,eF,cF,fF,dF,gF,bF,pJ,nJ,rJ,aJ,
|
|
4
|
+
CI,hJ,qJ,oJ,tJ,gJ,kJ,tI,jJ,uJ,BI,vJ,wJ,zJ,bJ,zI,yJ,xJ,oI,sJ,mJ,BJ,xI,lJ,AJ,$H,CJ,vI,uI,DJ,EJ,FJ,GJ,HJ,IJ,JJ,KJ,LJ;mB=" and the media start time is ";nB=" between media times and segment times for ";oB=" buffer";pB=" buffer. Range:";qB=" is being or has been set up";rB=" range:";sB=" with element state: ";tB=". Adjusting timestampOffset.";uB=". The segment start time is ";vB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";wB="\x3c/LA_URL\x3e";xB="\x3cLA_URL\x3e";yB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
|
|
5
|
+
zB="Aborting operations for ";AB="Appended audio segment ";BB="Appended video segment ";CB="Appending data to ";DB="Buffer:";EB="Cannot get segment, period ID unknown";FB="Choosing new streams after key status change";GB="Detected a delta of ";HB="Done Aborting operations for ";IB="Done Appending data to ";JB="Done Flushing buffer for ";KB="Done Removing data from ";LB="Done Setting append window for ";MB="Done Setting timestamp offset for ";NB="Failed to abort operations for ";OB="Failed to append data for ";
|
|
6
|
+
PB="Failed to flush buffer for ";QB="Failed to remove data from ";RB="Failed to set append window for ";SB="Failed to set timestamp offset for ";TB="Flushing buffer for ";UB="IterateSegmentReference";VB="Jumping forward";WB="MediaSource threw QuotaExceededError:";XB="No more scheduled operations for ";_.YB="No stream with id";_.ZB="Player is in ERROR state and can not switch to ";$B="PrestoPlay TextTrack";aC="QuotaExceededError";bC="Removing audio from variant - audio not compatible with platform";
|
|
7
|
+
cC="Removing data from ";dC="Reset transmuxers.";eC="Setting append window for ";fC="Setting playback rate to\x3d";gC="Setting timestamp offset for ";hC="Skip buffer flush for ";iC="Starting next operation for ";jC="Update-End received for ";_.kC="Updating manifest...";lC="bufferBehind\x3d";mC="bufferedBehind\x3d";nC="calling onCanSwitch()...";oC="cannot find segment";pC="clpp.mse.Player";qC="currentPeriod.startTime\x3d";rC="failed to get buffered range for ";_.sC="getSegmentNextReference";_.tC="iterateSegmentReference";
|
|
8
|
+
uC="key-restriction";vC="manifest.start";_.wC="onChooseStreams_";xC="presentationTime:";yC="presentationTime\x3d";zC="reference.endTime\x3d";AC="reference.position\x3d";BC="reference.startTime\x3d";CC="sourceopen";DC="startstreaming";_.EC="subtitles";FC="switch: Stream ";GC=function(a,b){return _.Wg[a]=b};HC=function(a,b){for(var c in a.a)b(c,a.a[c])};IC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Vm(a);)if(0===_.Xm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.aa(a)};
|
|
9
|
+
_.KC=function(a){var b=new Uint8Array(JC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Rm(c,!1);_.V(d,c);_.Tm(d,b);_.Tm(d,a.j);_.V(d,a.f.byteLength);_.Tm(d,a.f);return _.xj(d.buffer)};
|
|
10
|
+
_.LC=function(a,b,c,d){var e=_.Kj(b);if(8!==e.byteLength)e="";else{var f=_.bo(e);e=_.Hj(f);b:switch(f=f.byteLength,_.Gh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[yB+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?xB+d+wB:"",vB].join("");break b;case "4.1.0.0":e=[yB+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?xB+d+wB:"",vB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[yB+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?xB+d+wB:"",vB].join("");break b;default:_.Bh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Gh("New payload",e);e=_.xj(_.R.We(e,!0));return new _.Zn(_.co,
|
|
12
|
+
b,d||null,e,a,c)};_.MC=function(a,b){return b===a.version?a:_.LC(b,a.a,a.l||void 0,a.h||void 0)};NC=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};OC=function(a,b){if(_.ol("Edge/"))return!0;b=b.toLowerCase();if(_.mk()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.je);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
13
|
+
PC=function(a,b){var c=a.o.get(b);return!(!c||c!==_.cf&&c!==_.we)};QC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.So(c),!OC(a,c))||d&&d.encrypted&&(d=_.So(d),!OC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};RC=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};SC=function(a){a=RC(a,_.Lv);return null==a?null:a};
|
|
14
|
+
TC=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};_.UC=function(a,b){return a.concat(b)};VC=function(){};_.WC=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Ri(d)});return a.map(function(d){return new _.Ri(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.UC,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.XC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.YC=function(a,b,c,d,e){this.Va=a;this.ya=b;this.ka=c;this.keyInfo=d||null;this.Xc=_.M.R(e)?!1:!!e};ZC=function(a,b){a=_.oj(a);b=_.oj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
$C=function(a){return a.language?_.oj(a.language):a.audio&&a.audio.language?_.oj(a.audio.language):a.video&&a.video.language?_.oj(a.video.language):_.rg};
|
|
17
|
+
_.aD=function(a,b){for(var c=_.oj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.oj(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,ZC(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.oj(g);h=_.oj(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,ZC(c,e))return e;return null};
|
|
18
|
+
bD=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};cD=function(a,b){var c=_.fl(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};dD=function(a){for(var b=[a.mimeType],c=_.w(_.yv),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
|
+
eD=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.fD=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(",")};gD=function(a,b){for(var c=new _.im(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};hD=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
20
|
+
iD=function(a,b){return a.start-b.start};_.jD=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};kD=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}})};lD=function(a){a.player&&(a.player.off(_.Of,a.Sc),a.a&&a.player.off(_.ng,a.Sc));a.player=null};mD=function(a){a.player&&a.player.trigger(new _.L(_.fd))};nD=function(a){a.player&&a.player.trigger(new _.L(_.fd))};
|
|
21
|
+
oD=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(_.ng,a.Sc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.ng,a.Sc),a.a=!1)}};pD=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(_.Gg))};
|
|
22
|
+
qD=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};rD=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};sD=function(a,b){for(var c=0;c<a.length;c++)if(rD(a[c]).has(b))return c;return-1};
|
|
23
|
+
uD=function(a,b){Array.from(rD(a)).forEach(function(c){c.segmentIndex&&_.tD(c.segmentIndex,b)})};_.vD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.wD=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)};_.xD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
24
|
+
_.yD=function(a,b,c,d,e,f,g,h){a=_.Wj(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};zD=function(a){this.a=this.h=0;this.f=a};_.AD=function(a,b,c){a.h=b;a.a=c};
|
|
25
|
+
_.BD=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 zD(d);this.J=null;this.B=this.j.type||null};_.DD=function(a,b){a.L={offsetDateTime:b-CD(a),seekRangeStartDateTime:b}};_.ED=function(a,b){a.l=b;a.C=b;a.a.f=b};FD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.C?a.o:null};
|
|
26
|
+
_.ID=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.GD(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.HD(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)}};_.GD=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.HD=function(a,b){a.o=Math.max(a.o||0,b)};_.JD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
27
|
+
_.LD=function(a){return 2===a.j.version?a.a.Qb():Infinity===a.A?0:Math.max(0,KD(a)-a.A)};KD=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};ND=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(KD(a)-a.A+b,MD(a)))};
|
|
28
|
+
CD=function(a){return 2===a.j.version?a.a.Qb():ND(a,0)};MD=function(a){var b=a.Vd()&&!a.C?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,KD(a)-b)};OD=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}};PD=function(){this.f=function(){};this.h=function(){};this.a=new Set};
|
|
29
|
+
QD=function(a,b,c){a.f=b;a.h=c};RD=function(a,b){for(var c=[],d=!1,e={},f=_.w(b),g=f.next();!g.done;e={Fc:e.Fc},g=f.next())e.Fc=g.value,a.a.has(e.Fc)||(c.push(e.Fc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Fc.id}}(e)),e.Fc.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()};
|
|
30
|
+
SD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return OD(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};TD=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 _.bu("crop",a,d.endTime?d.endTime-a:Infinity,!1))};UD=function(a){var b=a.a.yh(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Rf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
41
31
|
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.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
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
|
-
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
|
-
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===
|
|
32
|
+
$D=function(a,b){var c=a.Uc(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)};_.tD=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)};
|
|
33
|
+
bE=function(a,b){this.h=a;this.l=aE(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};cE=function(a,b){a.f=b};dE=function(a){this.a=a};aE=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};
|
|
34
|
+
fE=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Qh;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,_.Lg,function(){return eE(f)});this.w=(new _.ll(function(){eE(f)})).xb(.25)};
|
|
35
|
+
eE=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 _.im(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=aE(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
36
|
+
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>=MD(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:_.Fh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Fh(VB,g,"seconds because of gap before start time of",f):_.Fh(VB,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
37
|
+
gE=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.ll(function(){0>=b.j?(_.Bh(["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--)})};hE=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.xb(.1)};kE=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Qh;this.h=new gE(a);this.w=!1;0<a.readyState?iE(this,c):jE(this,c)};
|
|
38
|
+
lE=function(a){return a.l?a.a.currentTime:a.A};mE=function(a,b){0<a.a.readyState?hE(a.h,b):jE(a,b)};jE=function(a,b){a.A=b;a.f.off(a.a,_.He);a.f.one(a.a,_.He,function(){iE(a,b)})};iE=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?nE(a):(a.f.one(a.a,_.Vf,function(){nE(a)}),hE(a.h,0===a.a.currentTime?b:a.a.currentTime))};nE=function(a){_.ql()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Vf,function(){return a.j()})};
|
|
39
|
+
rE=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 fE(a,b.presentationTimeline,c,oE(this,a,c),f);this.f=new kE(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.C=!0;l.A=!1;l.j=!1;l=lE(h.f);var n=pE(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;mE(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},qE(this,d,g),function(){h.j.I=!0});this.o=(new _.ll(function(){if(0!==
|
|
40
|
+
h.h.readyState&&!h.h.paused){var l=lE(h.f),m=CD(h.a),n=MD(h.a);3>n-m&&(m=n-3);l<m&&(m=pE(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")};tE=function(a){var b=lE(a.f);return 0<a.h.readyState&&!a.h.paused?sE(a,b):b};qE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?CD(a.a):MD(a.a):0>b&&(b=MD(a.a)+b);return uE(a,sE(a,b))};
|
|
41
|
+
uE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
42
|
+
pE=function(a,b){if("startover"===a.a.B)return b;var c=new _.im(a.h.buffered);c=c.Gb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=CD(a.a),g=MD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=ND(a.a,d),m=ND(a.a,e);d=ND(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),uE(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");
|
|
43
|
+
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};sE=function(a,b){var c=CD(a.a);if(b<c)return c;c=MD(a.a);return b>c?c:b};
|
|
44
|
+
oE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new bE(new dE(b),c.stallThreshold);cE(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.im(b.buffered),l;if(l=_.ol("Edge/")||_.ol("Trident/")||_.mk()||_.ql())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=
|
|
45
|
+
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};wE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.ll(function(){vE(b,!1)})).xb(.25)};vE=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)};
|
|
46
|
+
xE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
47
|
+
yE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Dc:null,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:1,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:3,Cc:2,wc:function(c,d){return b.a(c,d)}},{Dc:2,Cc:1,wc:function(c,d){return b.f(c,d)}},{Dc:2,Cc:3,wc:function(c,d){return b.f(c,d)}},{Dc:1,Cc:3,wc:function(c,d){return b.h(c,d)}},{Dc:3,Cc:1,wc:function(c,d){return b.h(c,d)}}]};zE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
48
|
+
_.AE=function(a){_.hu[a]&&delete _.hu[a]};_.BE=function(a){_.fu[a]&&delete _.fu[a]};CE=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};DE=function(a,b){if(b!==_.Sc){var c=_.Cu[b];if(!c)throw new _.N(_.P,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.C)}};
|
|
49
|
+
EE=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.xj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.xj(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)}})};
|
|
50
|
+
FE=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,[])};
|
|
51
|
+
GE=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 _.Fi(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=
|
|
52
|
+
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))};_.HE=function(a){a=a.toLowerCase();return _.Cu[a]||window.muxjs&&a===_.Sc?!0:!1};
|
|
53
|
+
IE=function(a,b){var c=String(_.Bk++);c=new _.vk(c,a);c.mimeType=_.wk(b.mimeType);if(a===_.S||a===_.xk)c.label=_.wk(b.label),c.language=_.wk(b.language),c.originalLanguage=_.wk(b.originalLanguage);a===_.yk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.xk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.wk(b.audioMimeType)):(c.kind=_.wk(b.kind),c.roles=b.roles);c.accessibility=a===_.yk||a===_.xk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
76
54
|
a}):b.accessibility||[];return c};
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
a
|
|
94
|
-
|
|
95
|
-
b
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
55
|
+
JE=function(a,b,c){var d=new _.Ek(a===_.yk?""+b.videoId:a===_.xk?""+b.audioId:""+b.id,c);switch(a){case _.yk:d.codec=_.wk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;break;case _.xk:d.codec=_.wk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;break;default:d.codec=_.wk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.M.la(e,d,null,["id","track"])}))||
|
|
56
|
+
c.renditions.push(d);return a||d};KE=function(a,b){var c=a.reduce(function(d,e){b===_.yk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.xk&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};LE=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};
|
|
57
|
+
ME=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};_.NE=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};OE=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}};PE=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
58
|
+
QE=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=_.Zg(a[0].periods).concat(),d={},e=1;e<a.length;d={ne:d.ne},e++)d.ne=OE(a[e-1]).end,_.NE(a[e].periods,d.ne),c.push.apply(c,_.Zg(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.ne}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d};d=OE(c).end;_.AD(b.a,0,d);(d=
|
|
59
|
+
a[0].presentationTimeline.uc())&&_.DD(b,d.seekRangeStartDateTime);return c};SE=function(a,b){try{if(1===a.length)return a[0];if(!a.every(RE))throw new _.Mi("Period durations must be finite");return QE(a,b)}catch(c){throw new _.N(_.P,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
60
|
+
TE=function(a,b){var c=b.periods[0].configurationId,d=_.Zg(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.ED(e,b.presentationTimeline.l);return SE([d,b],e)};RE=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
61
|
+
UE=function(a){return{id:a.id,bandwidth:a.bandwidth,trickPlay:a.video?a.video.trickPlay:!1,width:a.video?a.video.width:void 0,height:a.video?a.video.height:void 0}};VE=function(a,b){return b.find(function(c){return c.id===a.id})||null};WE=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};XE=function(a,b){return a.h.filter(function(c){return c.type===b})};YE=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
62
|
+
$E=function(a,b,c){if(!c||YE(a,c.type)!==c||a.m.ra())switch(b){case _.yk:a.cb(c&&c.renditions[0]);break;case _.xk:a.ub(c&&c.renditions[0]);break;case _.S:a.vb(c&&c.renditions[0]);break;default:ZE(a,b,c&&c.renditions[0])}};aF=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)};
|
|
63
|
+
ZE=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.ra())){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===_.S){var f=e.ia().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),aF(a,c),e.trigger(new _.L(_.dm)),bF(e,!0).then(function(){cF(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
64
|
+
n)}))}else if(b===_.xk)a.f.set(b,c),dF(e,parseInt(c.id,10));else if(b===_.yk){var g=a.a.get(_.xk)||null,h=null;if(g){var l=eF(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=
|
|
65
|
+
eF(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),fF(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ha+b),(h=YE(a,b))&&(b===_.S?bF(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.dm))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.xk?a.g.info("Enabling ABR for audio is not supported"):b===_.yk&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):fF(e,null,d))}};
|
|
66
|
+
iF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.xv)),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=IE(_.S,e);var f=b.find(function(h){return function(l){return h.kc.la(l)}}(c));c.kc=f||c.kc;var g=JE(_.S,e,c.kc);e.active&&a.a.set(_.S,g);f||b.push(c.kc)}gF(a.m)||a.a.set(_.S,null);c=eF(a.m);hF(a,b,c,_.yk);hF(a,b,c,_.xk);
|
|
67
|
+
a.h=b}};hF=function(a,b,c,d){var e=KE(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=IE(d,f);var g=b.find(function(l){return function(m){return l.lc.la(m)}}(c));c.lc=g||c.lc;var h=JE(d,f,c.lc);f.active&&a.a.set(d,h);g||b.push(c.lc)}};
|
|
68
|
+
jF=function(a,b,c){if(b){a.h.length||iF(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(XE(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&&(aF(a,f),d===_.xk?a.m.trigger(new _.L(_.cm)):d===_.yk&&a.m.trigger(new _.L(_.Hg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};kF=function(){this.f=new _.vD(2);this.h=new _.vD(5);this.a=0};
|
|
69
|
+
lF=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.mF=function(){};_.oF=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 _.Qh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.P=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.ek;this.A="";this.G={};this.o=nF(this,this.J);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};
|
|
70
|
+
pF=function(a){var b=_.gl(a.mimeType,a.codecs),c=dD(a);return _.HE(b)||_.et(c)||(_.fl(b,a.type)?!0:!1)};nF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,CC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,DC,function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=qF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=qF(c);a.l.one(c,CC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
71
|
+
rF=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ne,a.S.bind(a,d));a.l.on(e,"updateend",a.Vc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.$c)&&b.has(_.r)};sF=function(a,b){try{return new _.im(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error(rC+b,c),null}};tF=function(a,b){if(!a.f[b])return"";var c=sF(a,b);return c?c.toString():""};vF=function(a,b,c,d,e){return[uF(a,b,a.bk.bind(a,b)),uF(a,b,a.Zg.bind(a,b,c)),uF(a,b,a.ck.bind(a,b,d,e))]};
|
|
72
|
+
uF=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.ek};a.h[b].push(c);1===a.h[b].length&&wF(a,b);return c.p};wF=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(iC+b),c.start()}catch(d){d.name===aC?c.p.reject(new _.N(_.P,3,3017,{type:b})):c.p.reject(new _.N(_.P,3,3015,{mediaError:d})),xF(a,b)}else a.g.debug(XB+b)};
|
|
73
|
+
yF=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 _.ek,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:_.mh(p,3);break;case 2:g=_.E(p);for(h in a.f)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.f);_.D(p,5,6);return _.y(p,b(),6);case 6:_.nh(p);for(m in a.f)xF(a,
|
|
74
|
+
m);_.oh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.P,3,3015,{mediaError:n})))}})};xF=function(a,b){a.h[b].shift();wF(a,b)};
|
|
75
|
+
EF=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=zF(e,b,c);e=AF(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(_.Zg(l).concat().filter(function(n){return function(p){return n.cf.has(p)}}(c)));
|
|
76
|
+
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=BF(e);var m=CF(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(DF(n)===m)return!0;_.Gh("Dropping Variant (better codec available)",n);return!1})};
|
|
77
|
+
FF=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=zF(e,b,c);e=AF(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)})};BF=function(a){var b=new _.Nh;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=DF(c);b.push(d,c)}return b};
|
|
78
|
+
zF=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.fD(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.fD(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};
|
|
79
|
+
CF=function(a){var b="",c=Infinity;HC(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Gh(_.Hd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};DF=function(a){var b="";a.video&&(b=_.fD(a.video.codecs));var c="";a.audio&&(c=_.fD(a.audio.codecs));return b+"-"+c};
|
|
80
|
+
GF=function(a,b){function c(d,e,f){return d>=e&&d<=f}return(!a.width||!a.height||c(a.width,b.minWidth,b.maxWidth)&&c(a.height,b.minHeight,b.maxHeight)&&c(a.width*a.height,b.minPixels,b.maxPixels))&&c(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!0:!1};HF=function(a,b){for(var c=!1,d=_.w(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=GF(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
81
|
+
KF=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.$&&!QC(a,n))return _.Gh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!pF(p)){var t=p.codecs;0<=p.codecs.indexOf(_.je)?(_.Gh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.je,"ac-3"),pF(p)?_.Fh("Using AC-3 instead of EC-3 for",IF(p)):(p.codecs=t,_.Fh(bC,IF(p)),n.audio=null,f=!0,p=null)):(_.Fh(bC,IF(p)),n.audio=null,f=!0,p=null)}return q&&!pF(q)?(_.Fh("Dropping variant - video not compatible with platform",
|
|
82
|
+
IF(q)),!1):p&&b&&!JF(p,b,e)?(_.Fh("Dropping variant - not compatible with active audio","active audio",IF(b),"variant.audio",IF(p)),!1):q&&c&&!JF(q,c,e)?(_.Fh("Dropping variant - not compatible with active video","active video",IF(c),"variant.video",IF(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?(_.Fh("Dropping variant - not compatible with video + audio",
|
|
83
|
+
"variant.video",IF(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.HE(_.gl(n.mimeType,n.codecs));p||_.Gh("Dropping text stream. Is not supported by the platform.",n);return p})};JF=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
84
|
+
LF=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",
|
|
85
|
+
bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,audioMimeType:h,codecs:f.join(", "),audioCodec:d,videoCodec:e,primary:a.primary,roles:Array.from(m),audioRoles:Array.from(n),videoId:null,audioId:null,channelsCount:null,spatialAudio:!1,audioBandwidth:null,videoBandwidth:null,originalVideoId:null,originalAudioId:null,originalTextId:null,accessibility:q};c&&(a.videoId=c.id,a.originalVideoId=c.originalId,
|
|
86
|
+
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};
|
|
87
|
+
MF=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,
|
|
88
|
+
accessibility:a.accessibility,keyId:null}};NF=function(a){return a.allowedByApplication&&a.allowedByKeySystem};AF=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))};
|
|
89
|
+
_.PF=function(a,b,c,d){b=_.ti(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=_.aD(_.oj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.oj(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.pe})&&(e=e.filter(function(h){return h.kind===_.pe}));if(c){b=OF(e,c);if(b.length)return b;_.Bh("No exact match for the text role could be found.")}else if(b=
|
|
90
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.UC,[]);return b.length?OF(e,b[0]):e};OF=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
91
|
+
IF=function(a){var b=dD(a);return a.type===_.$c?"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"};
|
|
92
|
+
_.QF=function(){this.g=new _.K("clpp.abr");this.A=null;this.l=!1;this.w=new kF;this.f=[];this.o=1;this.C=this.B=!1;this.j=this.a=this.h=null};RF=function(a,b,c){if(a.j&&a.a.useCmsd){var d=SC(a.j);null!==d&&(a.g.debug("Using CMSD maxSuggestedBitrateKbps:",d),c=c.filter(function(e){return e.bandwidth<=1E3*d}))}a=c.filter(function(e){return!e.trickPlay});b&&(a=a.filter(function(e){return GF(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};SF=function(){this.a=null};
|
|
93
|
+
UF=function(a,b){if(b&&(null==a.a||a.a!==b))throw TF(a);};TF=function(a){return new _.N(_.P,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.")};VF=function(){this.a=new Map};XF=function(a,b){a.a.has(b)||a.a.set(b,new WF);return a.a.get(b)};WF=function(){this.text=this.variant=null};YF=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)};
|
|
94
|
+
aG=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||ZF(d,e))&&$F(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||ZF(a,b))&&$F(a.roles,b.roles)));return d?!1:!0};
|
|
95
|
+
ZF=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=eD(a.codecs).map(function(f){return _.fD(f)}),d=eD(b.codecs).map(function(f){return _.fD(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};$F=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Je);d["delete"](_.Je);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};
|
|
96
|
+
cG=function(a){var b=void 0===b?_.Ff:b;this.f=a;this.a=b;this.h=new bG(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};bG=function(a,b,c,d,e){this.j=_.ti(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Ff:e};dG=function(a,b){var c=null;b.some(function(d){c=_.aD(_.oj(d),a.map(function(e){return $C(e)}));return!!c});return c?a.filter(function(d){return c===$C(d)}):[]};
|
|
97
|
+
eG=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)})};fG=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};iG=function(a,b){this.a=gG;this.f=(new Map).set(gG,b).set(hG,a)};
|
|
98
|
+
kG=function(a){var b=this;this.D=a;this.a=a.getConfiguration().streaming;this.f=new _.Qh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");jG(this)&&(a=this.D.getSurface().getMedia(),this.f.on(a,_.ng,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."),
|
|
99
|
+
b.D.setPlaybackRate(b.a.chasingRate,_.Td)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.D.setPlaybackRate(1))}))};
|
|
100
|
+
jG=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};
|
|
101
|
+
mG=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 _.Qh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.V=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.ek;this.A="";this.H={};this.o=lG(this,this.L);this.P=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
102
|
+
lG=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,CC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,DC,function(){a.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=nG(c);a.j.src=a.A;return c}c=new MediaSource;a.A=nG(c);a.l.one(c,CC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
103
|
+
oG=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.ne,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(_.$c)&&b.has(_.r)};pG=function(a,b){try{return new _.im(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(rC+b,c),null}};qG=function(a,b){if(!a.a[b])return"";var c=pG(a,b);return c?c.toString():""};
|
|
104
|
+
tG=function(a,b,c,d,e,f){return[f?Promise.resolve():rG(a,b,function(){try{a.g.debug(zB+b+oB);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(NB+b+oB,l),l;}a.g.debug(HB+b+oB);a.qc(b)}),rG(a,b,function(){return sG(a,b,c)}),rG(a,b,function(){try{a.g.debug(eC+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(RB+b,d,e,g),g;}a.g.debug(LB+b,d,e);a.qc(b)})]};
|
|
105
|
+
sG=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(gC+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(SB+b,c,d),d;}a.g.debug(MB+b,c);a.qc(b)};rG=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.ek};a.h[b].push(c);1===a.h[b].length&&uG(a,b);return c.p};uG=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(iC+b),c.start()}catch(d){d.name===aC?c.p.reject(new _.N(_.P,3,3017,{type:b})):c.p.reject(new _.N(_.P,3,3015,{mediaError:d})),vG(a,b)}else a.g.debug(XB+b)};
|
|
106
|
+
wG=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 _.ek,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:_.mh(p,3);break;case 2:g=_.E(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.nh(p);for(m in a.a)vG(a,
|
|
107
|
+
m);_.oh(p);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.P,3,3015,{mediaError:n})))}})};vG=function(a,b){a.h[b].shift();uG(a,b)};xG=function(a,b,c){return rG(a,b,function(){b===_.Q?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),hD()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.qc(b))})};
|
|
108
|
+
yG=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.fD(_.il(a.G[b])),f=_.hl(a.G[b]),g=_.gl(c,d),h=_.fD(_.il(g)),l=_.hl(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.$f&&hD()?_.y(m,xG(a,b,g),2):m.F(2)):m["return"](!0)})};zG=function(a){this.h=a;this.a=null;this.f=function(){}};AG=function(a,b){a.f=b};
|
|
109
|
+
BG=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.Fh();this.w=_.Td;this.j=null;this.a=new _.ll(function(){b.A||b.f.Rl(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};CG=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
110
|
+
FG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Td||0===c||1===c)try{DG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),EG(a)}else EG(a)};EG=function(a){a.g.debug(fC,a.h,' using "seek" mode.');DG(a,0);a.o=!0;a.a.xb(.25)};DG=function(a,b){if(a.f.Fh()!==b){a.g.debug(fC,b,' using native playbackRate "decoder" mode.');try{a.f.wn(b)}catch(c){throw c;}}};
|
|
111
|
+
HG=function(a){function b(){d=!0}function c(m){f.push(m);_.dn(m)}a=_.xj(a);var d=!1,e,f=[],g=[];(new _.cn).M(_.Qe,c).M(_.og,c).M(_.Le,c).M(_.Pe,c).M(_.eg,c).Y(_.gg,function(m){e=m;f.push(m);_.en(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,hd:1701733238})}).Y("avc3",function(m){g.push({M:m,hd:1701733238})}).Y("ac-3",function(m){g.push({M:m,hd:1701733217})}).Y(_.je,function(m){g.push({M:m,hd:1701733217})}).Y("mp4a",function(m){g.push({M:m,hd:1701733217})}).parse(a);if(d)return _.Fh("Init segment already indicates encryption."),
|
|
112
|
+
a;if(0===g.length||!e)throw _.Hh("Failed to find boxes needed to fake encryption!"),_.Hh("Failed init segment (hex):",_.Lj(a)),new _.N(_.P,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Fh('Inserting "'+_.hn(l.hd)+'" box into init segment.'),a=GG(a,e,l.M,f,l.hd);return a};
|
|
113
|
+
GG=function(a,b,c,d,e){var f=IG.value(),g=a.subarray(c.start,c.start+c.size),h=_.Ej(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Ej(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);JG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.ol("Xbox One")||_.nl()?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,JG(e,d.start,d.size+l.byteLength);l=_.Ej(e,
|
|
114
|
+
b.start);b=_.jn(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};JG=function(a,b,c){a=_.Ej(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.LG=function(a,b){this.D=b;this.j=a;KG(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};
|
|
115
|
+
NG=function(a){var b=a.a.get(_.r);return b?MG(a,b.Tb):(b=a.a.get(_.$c))?MG(a,b.Tb):null};PG=function(a){return _.OG(a,_.$c)};QG=function(a){return _.OG(a,_.r)};
|
|
116
|
+
VG=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=_.Xp,_.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,RG(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=SG(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
117
|
+
m),q["return"]();p=TG(b,n,0);a.a.set(c.TEXT,p);UG(a,p,0)}_.B(q)}})};YG=function(a){a.I=!0;var b=a.a.get(_.Q);b&&(WG(b),XG(b)["catch"](function(){}),a.a["delete"](_.Q))};$G=function(a,b,c,d){b.video&&_.ZG(a,b.video,c,d);b.audio&&_.ZG(a,b.audio,c,d)};bH=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;KG(a.j);aH(a)};KG=function(a){a.periods.every(function(b){return typeof b.id===_.fg})};
|
|
118
|
+
dH=function(a){function b(l){return a.D.W.Gb(l,c,0)}var c=a.D.Pb(),d=!1,e=SG(a,c);if(_.uj(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)||(cH(a,h),d=!0)}else if(!_.uj(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())cH(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
119
|
+
c)};gH=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=eH(d);if(d.bd||b&&fH(d))a.g.info(e,"Retrying after failure..."),d.bd=!1,UG(a,d,.1)}};hH=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.gb})};
|
|
120
|
+
iH=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};kH=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,WG(e),e.sb&&e.Vb&&(e.sb=!1,b.push(e.Vb.abort())),e.Zb&&b.push(jH(a,e,!0,0));return _.y(f,Promise.all(b),0)})};lH=function(a,b,c){(a=a.a.get(b))&&c&&(WG(a),a.stream=c,a.cc=c,a.oa&&(a.oa=c.getSegmentReference(a.oa.position)),a.oa||(a.cc=null))};
|
|
121
|
+
_.OG=function(a,b){var c=a.a.get(b);return c?c.gc||c.stream:null};
|
|
122
|
+
_.ZG=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Q&&a.h.ignoreTextStreamFailures)VG(a,b);else if(e){var f=mH(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())cH(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"))),
|
|
123
|
+
nH(a,f)&&oH(a,b.id))if(e.stream!==b){var g=a.j.presentationTimeline.getDuration(),h=a.D.Pb();h=pH(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(FC+eH(e)+" already buffered to the end. Not switching."):(b.type===_.Q&&a.D.W.fc(_.gl(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Le=!0,a.g.debug("switch: switching to Stream "+eH(e)),qH(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):(WG(e),jH(a,e,!0,d)["catch"](function(l){if(a.D)a.D.onError(l)}))))}else a.g.debug(FC+
|
|
124
|
+
eH(e)+" already active")}};nH=function(a,b){var c=a.A.get(b);return!(!c||!c.Te)};oH=function(a,b){var c=a.w.get(b);return!(!c||!c.Te)};qH=function(a,b,c){if(!b.Vb)return!1;var d=a.D.Pb(),e=a.D.W.ha(b.type);c=(c=rH(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};
|
|
125
|
+
cH=function(a,b){var c=eH(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&&UG(a,b,0)):(a.g.debug(c,"clear: handling right now"),WG(b),jH(a,b,!1,0)["catch"](function(d){if(a.D)a.D.onError(d)}))};
|
|
126
|
+
sH=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=SG(a,f);if(null==g)return a.g.warn("Cannot initialize streams, period not found at",f),q["return"]();h=_.Xp;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"]();aH(a);return _.y(q,RG(a,m),3)}if(a.f)return q["return"]();l.forEach(function(t,
|
|
127
|
+
v){if(!a.a.has(v)){var z=TG(t,g,e);a.a.set(v,z);UG(a,z,0)}});_.B(q)})};TG=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,kg:!1,bd:!1,Gi:c||0,Vb:null,xe:!1,Zh:0}};uH=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){tH(a,b)["catch"](VC)})};
|
|
128
|
+
tH=function(a,b){var c=a.A.get(b);if(c)return a.g.debug("(all) Period "+b+qB),c;a.g.debug("(all) setting up Period "+b);var d=new _.ek;a.A.set(b,d);var e=new Set;c=MG(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:RG(a,e)}).then(function(){a.f||(d.resolve(),
|
|
110
129
|
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
|
-
|
|
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));_.
|
|
113
|
-
|
|
114
|
-
if(null!=l&&f>=l&&!b.xe)return
|
|
115
|
-
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
e,
|
|
119
|
-
g)a=null;else if(f=
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
v.then(function(){return a.f||a.o?null:
|
|
123
|
-
|
|
124
|
-
_.N&&
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
n=f&&f.initSegment||b.stream.initSegmentReference;p=
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
a.D.rf(e,d,
|
|
132
|
-
"Appending segment with "+(
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
h.variant&&h.variant.audio&&l.set(_
|
|
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))?(_.
|
|
141
|
-
|
|
142
|
-
|
|
130
|
+
RG=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+qB),c.push(g)):(a.g.debug("(all) setting up Stream "+f.id),a.w.set(f.id,new _.ek),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"]();_.mh(z,3);break;case 2:l=_.E(z);if(a.f)return z["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())if(n=
|
|
131
|
+
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));_.B(z)}})};aH=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.D.W.Bf(b):a.D.W.Bf(Math.pow(2,32))};
|
|
132
|
+
xH=function(a,b){function c(n){return n.type===_.Q&&n.stream.mimeType===_.Sc}if(c(b))return a.D.W.Yg(b.stream.originalId||""),null;b.type===_.Q&&a.D.W.Qg();if(!a.D.W.Vh()&&b.type!==_.Q)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=eH(b),e=a.D.Pb(),f=pH(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.D.W.za(b.type,e);a.g.debug(d,"update_:",yC+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=FD(a.j.presentationTimeline);
|
|
133
|
+
if(null!=l&&f>=l&&!b.xe)return vH(a,b),null;b.endOfStream=!1;l=mH(a,b.stream).id;var m=SG(a,f);null!=m&&(b.Tb=m);if(m!==l)return a.g.debug(d,"need Period "+m,yC+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=rH(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."),vH(a,b),
|
|
134
|
+
null);d=Infinity;h=_.w(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=pH(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Gi=0;wH(a,b,e,l,g)["catch"](function(){});return null};vH=function(a,b){a.g.debug(eH(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.Q);c&&c.stream.mimeType===_.Sc&&(c.endOfStream=!0)}};
|
|
135
|
+
pH=function(a,b,c){return b.cc&&b.oa?mH(a,b.cc).startTime+b.oa.endTime:Math.max(c,b.Gi)};
|
|
136
|
+
rH=function(a,b,c,d,e){if(null==e)return a.g.warn(EB),null;if(b.stream.segmentLookupStrategy===_.tC)b.stream.segmentIterator?a=WD(b.stream.segmentIterator):b.oa||d?(c=b.oa?b.oa.endTime:d,a.g.info(UB,"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(UB,oC,"endTime:",c,b.oa)),a=e):(e=MG(a,e),e=Math.max(0,c-e.startTime),a.g.info(UB,"looking up segment","lookupTime:",
|
|
137
|
+
e,xC,c),d=null,d||(b.stream.segmentIterator=$D(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(UB,oC,"lookupTime:",e,xC,c),a=d);else{var f=eH(b);if(b.oa&&b.stream===b.cc)c=b.oa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=yH(a,b,e,c);else{if(b.oa){a.g.debug(f,"next position unknown: another Stream buffered");f=mH(a,b.cc);var g=zH(a,b,f.startTime+b.oa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=zH(a,b,d||c,e);if(null==
|
|
138
|
+
g)a=null;else if(f=yH(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=yH(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};zH=function(a,b,c,d){var e=eH(b);d=MG(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",yC+c,"lookupTime\x3d"+f,qC+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",qC+d.startTime,"lookupTime\x3d"+f);return b};
|
|
139
|
+
yH=function(a,b,c,d){var e=eH(b);if(null==c)return a.g.warn(e,EB),null;c=MG(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",qC+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.LD(g);g=KD(g);return!b.xe&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",qC+c.startTime,BC+f.startTime,zC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
140
|
+
wH=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,C,F;return _.I(function(G){f=_.Xp;g=eH(b);h=MG(a,d);a.g.debug(g,"fetchAndAppend_:",yC+c,qC+h.startTime,AC+e.position,BC+e.startTime,zC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=AH(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;v=BH(a,b,h,q,t,e);b.sb=!0;b.Le=!1;a.g.debug(g,"fetching segment");z=!1;C=function(A,H){if(a.f||a.o)return null;z=!0;return CH(a,b,c,h,l,e,A,H)};F=a.D.W.ha(b.type)||0;
|
|
141
|
+
v.then(function(){return a.f||a.o?null:DH(a,b,e,!1,function(A){return C(A.data,!0)})}).then(function(A){return a.f||a.o?null:z||null===A?(EH(a,b,F,e,l),null):C(A,!1)}).then(function(){if(!a.f&&!a.o){EH(a,b,F,e,l);b.sb=!1;b.kg=!1;b.Zb||a.D.Qe();if(m){var A=m.next().value;A&&a.g.debug("New iterated segment",A)}UG(a,b,0);FH(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(A){return _.I(function(H){if(a.f||a.o)return H["return"]();b.sb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
142
|
+
A.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),H.F(0);if(7001===A.code)return b.sb=!1,b.gb=null,UG(a,b,0),H.F(0);if(3017===A.code)return GH(a,b,A),H.F(0);if(1001===A.code&&A.data&&404===A.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",AC+e.position,BC+e.startTime,zC+e.endTime,"error\x3d"+A),b.sb=!1,b.gb=null,UG(a,b,1),H.F(0);if(b.type===f.TEXT)return A instanceof
|
|
143
|
+
_.N&&A.a(1),WG(b),a.D.onError(new _.N(1,2,2010,A)),H.F(0);if(1001<=A.code&&1003>=A.code)return _.y(H,HH(a,b,h,A),0);a.g.error(g,"failed fetch and append: code\x3d"+A.code);b.bd=!0;A instanceof _.N&&A.a(_.P);return _.y(H,IH(a,A),0)})});_.B(G)})};
|
|
144
|
+
GH=function(a,b,c){var d=eH(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.kg}))a.g.debug(d,WB,"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.bd=!0;a.o=!0;a.D.onError(c);return}a.g.warn(d,WB,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.kg=!0}UG(a,b,4)};
|
|
145
|
+
HH=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.bd=!0;d.a(_.P);return _.y(g,IH(a,d),0)})};
|
|
146
|
+
BH=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.Zh)return t["return"](Promise.resolve());b.Zh=g;l=eH(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.Hi(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");
|
|
147
|
+
n=f&&f.initSegment||b.stream.initSegmentReference;p=DH(a,b,n,!0);q=p.then(function(v){if(a.f)return null;a.g.debug(l,"appending init segment");return JH(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]))})};
|
|
148
|
+
JH=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.nl())return e.F(0);d=HG(b);return _.y(e,a.D.W.te(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
149
|
+
CH=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(F){switch(F.a){case 1:l=eH(b);if(!(e&&e.keyId&&a.D.Fd)){F.F(2);break}m=NC(a.D.Fd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);F.F(2);break}_.D(F,4);return _.y(F,m,6);case 6:_.mh(F,2);break;case 4:n=_.E(F),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.D.Fd&&PC(a.D.Fd,e.keyId))){F.F(7);break}WG(b);p=mH(a,e).id;q=KH(a,p);if(!q){F.F(8);break}return _.y(F,q,8);case 8:return t=
|
|
150
|
+
a.D.rf(e,d,uC),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.")),F["return"](Promise.resolve());case 7:return C=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.cn).Y("emsg",a.Nm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),F["return"](LH(a,b,c).then(function(){if(a.f)return null;var G=f.startTime+d.startTime,A=f.endTime+d.startTime;a.g.debug(l,
|
|
151
|
+
"Appending segment with "+(G.toFixed(3)+" - "+A.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.qf(e.bandwidth)+" Fragment: ")+h);return a.D.W.te(b.type,g,G,A,C,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.cc=e,b.oa=f)}))}})};
|
|
152
|
+
EH=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Q){var f=eH(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=sD(a,e),b=a[d],e=e.getDuration(),uD(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
153
|
+
MH=function(a,b,c){(new _.cn).M(_.Qe,_.dn).M(_.og,_.dn).M(_.Le,_.dn).M(_.Pe,_.dn).M(_.eg,_.dn).Y(_.gg,_.en).M("encv",function(d){d.reader.skip(78);_.dn(d)}).M(_.Zf,_.dn).M("schi",_.dn).M("tenc",function(d){d.reader.skip(6);if(_.Xm(d.reader)){d.reader.skip(1);var e=_.Lj(_.bn(d.reader,16));e!==b.stream.keyId&&(a.g.debug(eH(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)};
|
|
154
|
+
LH=function(a,b,c){if(a.f)return Promise.resolve();var d=eH(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:",yC+c,lC+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",yC+c,mC+g,lC+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",yC+c,mC+g,lC+e,"overflow\x3d"+h);return a.D.W.remove(b.type,
|
|
155
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};FH=function(a,b,c){if(!a.B){b=eH(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=mH(a,c).id,AH(a,c),KH(a,c))}};
|
|
156
|
+
KH=function(a,b){var c=null;a.A.has(b)||(c=tH(a,b).then(function(){a.f||(a.g.debug(nC),a.D.Tf())})["catch"](VC));uH(a);a.D.Hm&&(a.g.debug("calling onStartupComplete()..."),a.D.Hm());return c};
|
|
157
|
+
NH=function(a,b){var c=eH(b),d=mH(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(fH)?(a.g.debug(c,"all need Period "+e),tH(a,e).then(function(){if(!a.f)if(a.D.W.Fi(),f.every(function(n){var p=fH(n),q=mH(a,n.stream).id;return p&&n.Tb===e&&q!==e})){var g=MG(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);
|
|
158
|
+
h.variant&&h.variant.audio&&l.set(_.$c,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(_.P,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)sH(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(_.P,
|
|
159
|
+
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))?(_.ZG(a,m,!1,0),UG(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,nC);a.D.Tf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](VC)):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)}};SG=function(a,b){var c=qD(a.j.periods,b+_.qv);return c?c.id:null};
|
|
160
|
+
mH=function(a,b){var c=a.j.periods,d=sD(c,b);c=c[d];if(!c)throw new _.N(_.P,5,5006,"No period found for stream with ID "+b.id+".");return c};
|
|
161
|
+
DH=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.yD(c.Va(),c.ya,c.ka,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Xc?null:e;f.disableFragmentSupport=c.Xc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){MH(a,b,g.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.On.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
143
162
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
a
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
a.
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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...");
|
|
163
|
+
jH=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=eH(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;UG(a,b,0);_.B(l)})};
|
|
164
|
+
UG=function(a,b,c){a.g.debug(eH(b),"updating in "+c+" seconds");b.gb=(new _.jl(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 _.mh(e,0);d=_.E(e);if(a.D)a.D.onError(d);_.B(e)})})).ea(c)};WG=function(a){null!=a.gb&&(a.gb.stop(),a.gb=null)};MG=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.N(_.P,5,5006,"Period "+b+" not found");return c};
|
|
165
|
+
AH=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};XG=function(a){return _.I(function(b){return a.Vb?_.y(b,a.Vb.abort(),0):b.F(0)})};IH=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.D.Ji){d.F(2);break}_.D(d,3);return _.y(d,a.D.Ji(b),5);case 5:_.mh(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.D.onError(b);_.B(d)}})};eH=function(a){return"("+a.type+":"+a.stream.id+")"};
|
|
166
|
+
fH=function(a){return!a.sb&&null==a.gb&&!a.Zb&&!a.oc};OH=function(){this.a=null};
|
|
167
|
+
RH=function(){_.tm.call(this,pC);var a=this;this.G=PH;this.j=this.ga=null;this.vg=0;this.Mi=2;this.Qc=null;this.mg=!1;this.o=new _.Qh;this.Jc=this.zg=this.He=this.I=this.Ec=this.B=this.L=this.w=null;this.Ld=!1;this.f=this.A=this.a=this.K=this.J=null;this.h=new _.QF;this.Qi=1E9;this.Ie=new Set;this.ca=!0;this.ta=null;this.Pi=!1;this.Oi=0;this.fa=null;this.P=new VF;this.H=null;this.nc=_.yp;this.Lc=new bG(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,this.configuration.preferredAudioChannelCount,
|
|
168
|
+
this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Gd=this.configuration.preferredTextLanguage;this.l=new SF;this.$=this.Mc=null;this.Nc=new Map;this.Fa=null;this.Ge=this.configuration.preferredTextRole;this.Cd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===QH&&gH(a.a)});this.Ke=this.Jd=this.Ne=null;this.ba=_.pa;this.Qd=new OH};
|
|
169
|
+
SH=function(a){return new _.jD(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,_.Zg(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
170
|
+
TH=function(a,b){if(a.nc!==b){var c=_.R.Nk;if(a.nc===_.Jp&&b!==_.yp)c=c(b,_.Hp),a.log.info(_.ZB+c);else{var d=a.vg;d=0===d?0:Date.now()-d;var e=a.nc;a.nc=b;a.vg=Date.now();null!==a.I&&(a.I.A=b===_.Lp);a.H&&_.op(a.H.a,a.nc);b===_.Dp&&(a.Mi=a.jg?1:2);var f=a.Mi,g={currentState:a.nc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.Dp||e===_.Dp?f:void 0},h=c(e,_.Hp),l=c(b,_.Hp);c=b!==_.Dp?"":"["+c(f,_.Gp)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.cg,{detail:g}));(b===_.Fp||b===
|
|
171
|
+
_.Jp)&&a.Jc&&a.Jc.stop();b===_.Dp?a.trigger(new _.L(_.kd,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.Dp&&a.trigger(new _.L(_.jd,{detail:{bufferedTimeMS:d,reason:f}}))}}};UH=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,_.tm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:TH(a,_.yp),_.B(c)}})};
|
|
172
|
+
VH=function(a){var b=new _.cu;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
173
|
+
YH=function(a,b){var c,d;return _.I(function(e){a.ba===_.pa?WH(a,b.cues):a.ba===_.Hb?(a.f=TE(a.f,PE(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,_.ED(a.f.presentationTimeline,!0),a.trigger(new _.L(_.De))),XH(a,a.f)):bH(a.a,b);_.B(e)})};ZH=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.ba===_.Hb?a.trigger(new _.L(_.Sf)):a.trigger(new _.L(_.De));_.B(b)})};
|
|
174
|
+
XH=function(a,b){var c=a.getMediaPosition(),d=a.Jd,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 _.bu(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));TC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
175
|
+
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Tf));UD(a.Ke);RD(a.K,b.cues)};eI=function(a){var b,c;return _.I(function(d){if(1==d.a)return $H(a),_.y(d,aI(a),2);if(3!=d.a){bI(a);b=_.mk(4)||_.mk(5);if(!b)return d.F(3);c=a.getSurface().getMedia();cI(a,c);return _.y(d,dI(a,c),3)}a.configuration=a.mc;_.B(d)})};
|
|
176
|
+
lI=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 _.ek,a.l.a=e,_.D(l,2),$H(a),_.y(l,fI(a),4);case 4:return UF(a.l,e),a.Z=_.Qp(b),a.configuration=_.rm(a.mc,b),a.log.info(_.tb,a.configuration),a.log.info(_.Mb,a.Z),_.y(l,gI(a,e),5);case 5:return UF(a.l,e),_.y(l,hI(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,UF(a.l,e),a.A=f.parser,a.f=f.manifest,WH(a,f.manifest.cues),g=a,_.y(l,iI(a,a.f,a.configuration.drm),7);case 7:g.w=
|
|
177
|
+
l.f;UF(a.l,e);if(!c){l.F(8);break}return _.y(l,jI(a,e),9);case 9:UF(a.l,e),a.o.one(a.j,_.Ge,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.mh(l,0);break;case 2:h=_.E(l),kI(a,h,e),_.B(l)}})};WH=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);RD(a.K,c)}else RD(a.K,b)};kI=function(a,b,c){b=mI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};
|
|
178
|
+
mI=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(_.P,7,7003,"Unexpected error.",b):TF(a.l)};fI=function(a){return a.ga?a.ga["catch"](function(){}):Promise.resolve()};
|
|
179
|
+
gI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.tp,TH(a,_.Kp),c=nI(a,a.configuration),_.y(d,dI(a,c),2);UF(a.l,b);a.K=new PD;QD(a.K,function(e){a.log.info("Timeline cue found",e);oI(a,_.ii,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.L(_.ci))});_.B(d)})};
|
|
180
|
+
hI=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=_.Qp(f),h=g[c],_.y(n,pI(a,h),2);case 2:return l=n.f,UF(a.l,d),_.no(vC),_.y(n,qI(a,l,h,f.id||""),3);case 3:m=n.f;UF(a.l,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:UF(a.l,d);case 4:return _.no("manifest.end"),_.oo("Fetch and parse manifest",vC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
181
|
+
rI=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,hI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,PE(c.manifest)],e=SE(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.P,7,7003,"Failed to append load manifest");}})};nI=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);cI(a,c);return c};
|
|
182
|
+
cI=function(a,b){a.j||(a.o.on(b,_.ne,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(_.P,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};bI=function(a){a.j&&(a.o.off(a.j,_.ne),a.j=null)};
|
|
183
|
+
aI=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==sI&&(a.G=PH);if(b=a.j)a.o.off(b,_.Ge),a.o.off(b,_.tf),a.o.off(b,_.df),a.o.off(b,_.me),a.o.off(b,_.Jf),a.o.off(b,_.Hf);a.K&&(a.K.release(),a.K=null);a.Ec&&(a.Ec.release(),a.Ec=null);a.Jc&&(a.Jc.stop(),a.Jc=null);if(!a.A){c.F(2);break}return _.y(c,a.A.stop(),3);case 3:a.A=null;case 2:if(!a.h){c.F(4);break}return _.y(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.y(c,a.a.destroy(),7);case 7:a.a=null;case 6:a.B&&(a.B.release(),
|
|
184
|
+
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.Qc&&(a.Qc.release(),a.Qc=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.Nc.clear(),a.Ld=!1,tI(a),_.B(c)}})};
|
|
185
|
+
dI=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new lF:new _.mF,d=_.mp(a.configuration,[_.ue,"single-native"]),e=d.create(a),a.V=e,f=SH(a),f.track(a),a.Qc=f,g=null,uI(a)?g=new mG(b,c,e,f,a.configuration):g=new _.oF(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.B(h)})};
|
|
186
|
+
pI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.eu(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
187
|
+
qI=function(a,b,c,d){return(new _.fk(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=vI(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.mh(h,2);break;case 4:f=_.E(h);if(!a.Kc)throw f;return _.y(h,a.Kc(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(_.P,4,4014);wI(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
189
188
|
return b.stop()})).U};
|
|
190
|
-
|
|
191
|
-
if(t.length){t=a.getPeriods();for(var z=0;z<t.length;z++)for(var C=t[z],
|
|
192
|
-
(
|
|
193
|
-
e=_.
|
|
194
|
-
|
|
195
|
-
b),a.h.configure(a.configuration.abr),a.cg&&a.h.setCmsdManager(a.cg),a.h.init(function(t,v,z){!a.ca
|
|
196
|
-
_.
|
|
197
|
-
a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
b.id});f?(a.$=f.video.id,
|
|
206
|
-
|
|
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.
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
b).variant=c};
|
|
211
|
-
|
|
189
|
+
iI=function(a,b,c){var d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:_.no("initDrm.start");d=new _.to({Jb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Xf:function(n){if(a.a){var p=xI(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.");
|
|
190
|
+
if(t.length){t=a.getPeriods();for(var z=0;z<t.length;z++)for(var C=t[z],F=_.w(C.variants),G=F.next();!G.done;G=F.next()){G=G.value;var A=[];G.audio&&A.push(G.audio);G.video&&A.push(G.video);A=_.w(A);for(var H=A.next();!H.done;H=A.next()){H=H.value;var O=G.allowedByKeySystem;if(H.keyId){var T=n[v?"00":H.keyId];T=!!T&&!yI.includes(T);G.allowedByKeySystem=T}O!==G.allowedByKeySystem&&(T=H.type,H.type===_.r&&(T="video "+H.width+"x"+H.height+"@"+_.R.qf(H.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
191
|
+
(H.keyId+"'. Applying restrictions to "+T)));C===p&&O!==G.allowedByKeySystem&&(q=!0)}}}if(n=NG(a.a)){v=PG(a.a);t=QG(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(FB),zI(a),BI(a,n.variants)}q&&n!==p&&(a.log.info(FB),zI(a),BI(a,p.variants))}},Wf:function(n,p){a.trigger(new _.L(_.de,{expirationTime:p}))},onEvent:function(n){return a.yf(n)},getConfiguration:function(){return a.getConfiguration()},$c:function(){return a.$c()}});
|
|
192
|
+
e=_.Nm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.Wt(b.periods);if(!f){m.F(2);break}l=_.vm(_.ef);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,_.yo(d,h,g),6);case 6:return a.w=d,CI(a,b.periods),_.no("initDrm.end"),_.oo("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
193
|
+
jI=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,$I(a,c),aJ(a,a.f.periods),a.Lc=new bG(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Gd=a.configuration.preferredTextLanguage,a.Ge=a.configuration.preferredTextRole,a.Cd=a.configuration.preferForcedSubtitles,_.y(q,_.Lo(a.w,c),2);if(3!=q.a)return UF(a.l,
|
|
194
|
+
b),a.h.configure(a.configuration.abr),a.cg&&a.h.setCmsdManager(a.cg),a.h.init(function(t,v,z){if(!a.ca){var C=xI(a);(t=VE(t,C.variants))?bJ(a,t,v,z):a.log.warn("No matching variant found for track switch")}}),a.B=cJ(a,c,a.configuration.startTime),a.Ec=dJ(a),a.I=new BG({Fh:function(){return c.playbackRate},wn:function(t){c.playbackRate=t},Rl:function(t){c.currentTime+=t}}),CG(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.He=new kG(a)),d=Math.max(1E-4,
|
|
195
|
+
a.configuration.streaming.rebufferingGoal),eJ(a,d),uI(a)?FF(a.f,_.ti(a.configuration.preferredVideoCodec),_.ti(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):EF(a.f,_.ti(a.configuration.preferredVideoCodec),_.ti(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=fJ(a),e.h=a.configuration.streaming,a.a=e,a.G=QH,_.y(q,e.start(),3);UF(a.l,b);a.configuration.streaming.startAtSegmentBoundary&&(f=tE(a.B),g=gJ(a,f),mE(a.B.f,g));h=_.w(a.f.periods);
|
|
196
|
+
for(l=h.next();!l.done;l=h.next())m=l.value,hJ(a,m);zI(a);n=xI(a)||a.f.periods[0];p=n.variants.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");BI(a,n.variants);_.B(q)})};
|
|
197
|
+
$I=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Vf&&a.Td?(a.J.a=hG,tI(a)):d.type===_.Lg&&a.getState()===_.Mp&&.1>a.getBufferInfo().za(a.getMediaPosition())?(a.J.a=hG,tI(a)):a.J&&iJ(a));jJ(a)}a.o.on(b,_.tf,c);a.o.on(b,_.df,c);a.o.on(b,_.me,c);a.o.on(b,_.Vf,c);a.o.on(b,_.Uf,c);a.o.on(b,_.Hf,c);a.o.on(b,_.Lg,c);a.o.on(b,_.Jf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
198
|
+
wI=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)})){_.Gh("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)}};cJ=function(a,b,c){return new rE(b,a.f,a.configuration.streaming,c,function(d){a.Ec&&vE(a.Ec,!0,d);a.a&&dH(a.a)},function(d){return a.dispatchEvent(d)},a.ba===_.Hb)};
|
|
199
|
+
dJ=function(a){var b=new wE(a.j),c=new zG(a.f);AG(c,function(){zI(a)});b.a.add(c);a.K&&(c=new yE(a.K),zE(c,function(d){d.Pe&&d.Pe();oI(a,_.di,d)},function(d){d.Vf&&d.Vf();oI(a,_.ei,d)},function(d,e){e||(d.Pe&&d.Pe(),oI(a,_.di,d),d.Vf&&d.Vf(),oI(a,_.ei,d))}),b.a.add(c));a.ba===_.Hb&&(c=new TD(a.Jd,a.Qd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Ke=c);return b};eJ=function(a,b){a.J=new iG(b,Math.min(.5,b/2));a.J.a=hG;tI(a);a.Jc=(new _.ll(function(){iJ(a)})).xb(.25)};
|
|
200
|
+
iJ=function(a){switch(a.G){case QH:a:if(a.j.ended||a.L.ue())var b=!0;else{if(a.isLive()){b=KD(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?gG:hG;d.a=c;d=e!==c}c=d;d=kJ(a);c||a.getState()===_.Dp&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
201
|
+
d,"buffered to end",b,"state",a.getState()),tI(a)):a.Ld&&jJ(a)};fJ=function(a){var b={configuration:{Il:a.ba===_.Hb},Pb:function(){return tE(a.B)},W:a.L,Jb:a.getNetworkEngine(),Uf:a.ak.bind(a),Tf:a.$j.bind(a),onError:a.onError.bind(a),fi:a.pm.bind(a),onEvent:a.yf.bind(a),ki:a.Nn.bind(a),Qe:a.Cm.bind(a),ze:function(){return a.h},rf:a.lj.bind(a),Ji:a.Dn.bind(a),Fd:a.w};return new _.LG(a.f,b)};
|
|
202
|
+
eF=function(a){if(a.f&&a.B){var b=lJ(a),c=[];a=_.w(mJ(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=LF(d);e.active=d===b;c.push(e)}return c}return[]};cF=function(a,b){if(a.f&&a.a){var c=xI(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(nJ(a,c,d,!1),oJ(a,d),a.Gd=d.language,a.Cd=d.kind===_.pe):a.log.error(_.YB,b.id)}};
|
|
203
|
+
fF=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=xI(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=BI(a,e.variants);null!=a.Fa&&(a.Lc=a.Fa,a.Fa=null);null==c||a.ca||bJ(a,c);return}if(b){a.$=b.id;var f=e.variants.find(function(g){return g.id===
|
|
204
|
+
b.id});f?(a.$=f.video.id,NF(f)?(pJ(a,e,f,!1),qJ(a,f,c,d),null==a.Fa&&(a.Fa=a.Lc),a.Lc=new cG(f),BI(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.Lc=a.Fa,a.Fa=null),c=BI(a,e.variants),null==c||a.ca||bJ(a,c)}};
|
|
205
|
+
dF=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=QG(a.a),d=PG(a.a),e=qD(a.f.periods,tE(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&NF(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();
|
|
206
|
+
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.Mc=d.id;f=f.map(UE);a.h.setTracks(f);f=xI(a);pJ(a,f,g,!1);e||a.ca?qJ(a,g,!0,0):_.ZG(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
207
|
+
gF=function(a){var b=a.mg;return a.f?a.L.getTextDisplayer().isTextVisible():b};bF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.mg;d=b;if(c===d)return g["return"]();a.mg=d;if(a.G!==QH)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return YG(a.a),g.F(0);e=xI(a);f=_.PF(e.textStreams,a.Gd,a.Ge,a.Cd);return 0<f.length?_.y(g,VG(a.a,f[0]),0):g.F(0)})};
|
|
208
|
+
pJ=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){jF(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&&(jF(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})))}XF(a.P,
|
|
209
|
+
b).variant=c};nJ=function(a,b,c,d){XF(a.P,b).text=c;if(b=a.getTrackManager())jF(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}))};rJ=function(a){return a.ba===_.Hb&&"flat"===a.configuration.playlist.timeline};
|
|
210
|
+
aJ=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.Qi++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ca:0,mimeType:_.Sc,codecs:"",kind:_.nd,encrypted:!1,
|
|
212
211
|
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
|
-
|
|
214
|
-
e.value,(g=e.video)&&!
|
|
215
|
-
|
|
216
|
-
_.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
a.h.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=
|
|
229
|
-
z.next())
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
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};
|
|
212
|
+
CI=function(a,b){for(var c=a.a?PG(a.a):null,d=a.a?QG(a.a):null,e=!uI(a),f=_.w(b),g=f.next();!g.done;g=f.next())KF(a.w,c,d,g.value,e);c=bD(b,function(h){return h.variants.some(NF)});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=
|
|
213
|
+
e.value,(g=e.video)&&!cD(g.type,_.gl(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.N(_.P,4,4032);if(c<b.length)throw new _.N(_.P,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,HF(d.variants,a.configuration.restrictions)&&a.a&&xI(a)===d&&zI(a),sJ(a,d.variants)};
|
|
214
|
+
hJ=function(a,b){var c=a.a?PG(a.a):null,d=a.a?QG(a.a):null,e=!uI(a);KF(a.w,c,d,b,e);d=b.variants;if(!d.some(NF))throw new _.N(_.P,4,4011);sJ(a,b.variants);HF(d,a.configuration.restrictions)&&a.a&&xI(a)===b&&zI(a);if(!_.mk(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,_.Oo(a.w,g.keyId,g.initData)||
|
|
215
|
+
_.Fo(a.w,g.initDataType,g.initData,g.keyId)}}};qJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.ca?(a.ta=b,a.Pi=c,a.Oi=d):$G(a.a,b,c,d)};oJ=function(a,b){a.ca?a.fa=b:_.ZG(a.a,b,!0,0)};tJ=function(a){if(a.a&&a.f){var b=NG(a.a),c=xI(a);null!=b&&b===c&&(PG(a.a),QG(a.a),_.OG(a.a,_.Q),XF(a.P,c),XF(a.P,c))}};
|
|
216
|
+
gJ=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=PG(a.a),e=QG(a.a),f=xI(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};kJ=function(a){return a.w&&a.w.C?!0:a.J?a.J.getState()===hG:!1};
|
|
217
|
+
tI=function(a){if(a.H&&a.J&&a.B){var b=uJ(a)===_.Dp,c=a.I;c.l=b;FG(c,c.o?"seek":void 0);a.B.j.o=b;jJ(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(_.Qf))))}};jJ=function(a){TH(a,uJ(a))};uJ=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.Ld&&0<=c&&b<=c?!0:!1}return b?_.Fp:kJ(a)||a.Td?_.Dp:a.j&&a.j.paused?_.Lp:_.Mp};
|
|
218
|
+
BI=function(a,b){try{sJ(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return NF(f)}),d=LE(c,a.Mc);c=a.Lc.create(d);c=Array.from(c.values());var e=c.map(UE);a.h.setTracks(e);if(null!==a.$&&null!==a.Mc&&(e=c.find(function(f){return f.video.id===a.$&&f.audio.id===a.Mc}),a.$=null,e))return e;if(a.configuration.abr.enabled||null===a.$)return d=a.h.chooseTrack(),VE(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.$});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
219
|
+
d=a.h.chooseTrack(),VE(d,c))};vJ=function(a,b){return _.PF(b,a.Gd,a.Ge,a.Cd)[0]||null};wJ=function(a,b,c){c=void 0===c?!0:c;var d=BI(a,b.variants);a.Mc=d&&d.audio&&d.audio.id;d&&(pJ(a,b,d,!0),qJ(a,d,c));(c=vJ(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||gF(a))&&(nJ(a,b,c,!0),oJ(a,c))};
|
|
220
|
+
zJ=function(a,b){a.ca=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=BI(a,b.variants),d=vJ(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&&xJ(a,b,function(){return pJ(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||gF(a))&&xJ(a,b,function(){return nJ(a,b,d,!0)});b===xI(a)&&yJ(a);return a.configuration.streaming.alwaysStreamText||gF(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
221
|
+
bJ=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=AJ(a,b);xJ(a,e,function(){return pJ(a,e,b,!0)});e===xI(a)&&yJ(a);a.a&&$G(a.a,b,c,d)}};zI=function(a){var b=a.getTrackManager();b&&a.G!==sI&&(b.m&&(iF(b),b.m.trigger(new _.L(_.zv))),yJ(a))};yJ=function(a){var b=xI(a);if(b){var c=a.Nc.get(b)||[];for(a.Nc["delete"](b);c.length;)c.shift()()}};xJ=function(a,b,c){a.Nc.has(b)||a.Nc.set(b,[]);a.Nc.get(b).push(c)};
|
|
222
|
+
oI=function(a,b,c){a.trigger(new _.L(b,{detail:OD(c,rJ(a))}))};
|
|
223
|
+
sJ=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?yI.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(_.P,4,4012,{hasAppRestrictions:f,
|
|
224
|
+
missingKeys:g,restrictedKeyStatuses:h});};mJ=function(a){var b=xI(a);if(null==b)return[];tJ(a);return b.variants.filter(function(c){return NF(c)})};BJ=function(a){var b=xI(a);if(null==b)return[];tJ(a);return b.textStreams.filter(function(c){return!a.Ie.has(c)})};xI=function(a){var b=tE(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};lJ=function(a){var b=xI(a);return b&&XF(a.P,b).variant};
|
|
225
|
+
AJ=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};$H=function(a){if(a.G===sI)throw new _.N(_.P,7,7E3,"Player is destroyed.");};
|
|
226
|
+
CJ=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,t,v,z,C,F,G,A,H,O,T;return _.I(function(da){switch(da.a){case 1:return d=_.Xp,_.D(da,2),_.y(da,_.eu(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=da.f;e.configure(a.configuration.manifest);var aa=e;var wa=b.url,Va=vI(a,a.configuration.id||"");aa=aa.start(wa,Va);return _.y(da,aa,5);case 5:f=da.f;wI(f.periods);if(!f.periods.length)throw new _.N(_.P,4,4014);return _.y(da,a.A.stop(),6);case 6:a.A=e;g=c.audio&&
|
|
227
|
+
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=qD(f.periods,tE(a.B))||f.periods[0];uI(a)?FF(a.f,_.ti(a.configuration.preferredVideoCodec),_.ti(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):EF(a.f,_.ti(a.configuration.preferredVideoCodec),_.ti(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=ME(g,h,l.variants);n=vJ(a,l.textStreams);BI(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=
|
|
228
|
+
z.next())F=C.value,F.video&&v.add(F.video),F.audio&&v.add(F.audio);G=a.getNetworkEngine();A=_.w(_.Zg(v).concat(_.Zg(l.textStreams)));for(H=A.next();!H.done;H=A.next())O=H.value,t.push(O.createSegmentIndex(G));return _.y(da,Promise.all(t),7);case 7:lH(a.a,d.AUDIO,q);lH(a.a,d.VIDEO,p);lH(a.a,d.TEXT,n);m&&pJ(a,l,m,!1);a.log.info("Switch CDN successful.");_.mh(da,0);break;case 2:T=_.E(da);if(!e){da.F(8);break}return _.y(da,e.stop(),8);case 8:throw T;}})};
|
|
229
|
+
vI=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return hJ(a,c)},filterAllPeriods:function(c){return CI(a,c)},onEvent:function(c){return a.yf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return YH(a,c)},onTurnedStatic:function(){return ZH(a)}}};
|
|
230
|
+
uI=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.$f&&(_.mk(2)||_.mk(3)||_.mk(4)||_.mk(5)||_.mk(6)||_.nk()&&38===_.pl().major||_.nk()&&53===_.pl().major||_.nk()&&68===_.pl().major?!1:!0)};DJ=function(){};EJ=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}};
|
|
231
|
+
FJ=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};GJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};HJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.fD(b)&&a(b)}};
|
|
232
|
+
IJ=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)}};
|
|
233
|
+
JJ=function(a){_.cv.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=_.Vd;c.label===$B&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.EC,$B));this.a.mode=_.te};KJ=function(a,b){var c=a.mode;a.mode=c===_.Wf?_.Wf:_.te;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};LJ=function(){};_.mj.prototype.f=GC(0,function(){return this.keyInfo});var JC=[112,115,115,104,0,0,0,0];
|
|
234
|
+
_.YC.prototype.Od=function(){return this.ka?this.ka-this.ya+1:null};_.YC.prototype.f=function(){return this.keyInfo};_.u=_.jD.prototype;_.u.track=function(a){null!=this.player&&lD(this);a&&(this.player=a,this.player.on(_.Of,this.Sc,this))};_.u.release=function(){lD(this);this.T=[];this.f=this.h=null};
|
|
244
235
|
_.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(
|
|
246
|
-
_.u.
|
|
247
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
248
|
-
_.u.
|
|
249
|
-
|
|
250
|
-
_.u.
|
|
251
|
-
_.u.
|
|
252
|
-
_.u.
|
|
253
|
-
_.
|
|
254
|
-
|
|
255
|
-
_.u.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
_.u
|
|
259
|
-
_.u.
|
|
260
|
-
_.u.
|
|
261
|
-
_.u.
|
|
262
|
-
|
|
263
|
-
_.u.
|
|
264
|
-
_.u.
|
|
265
|
-
_.u.
|
|
266
|
-
_.
|
|
267
|
-
d
|
|
268
|
-
_.
|
|
269
|
-
|
|
270
|
-
_.u.
|
|
271
|
-
_.u.
|
|
272
|
-
_.u.
|
|
273
|
-
a.
|
|
274
|
-
_.u.
|
|
275
|
-
|
|
276
|
-
_.u.
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
_.
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
_.u.
|
|
284
|
-
_.u.
|
|
285
|
-
_.u.
|
|
286
|
-
|
|
287
|
-
_.u.
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
_.u.
|
|
292
|
-
_.u.
|
|
293
|
-
_.u.
|
|
294
|
-
_.u.
|
|
295
|
-
|
|
296
|
-
_.u.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
_.u.
|
|
300
|
-
_.u.
|
|
301
|
-
_.u.
|
|
302
|
-
_.u.
|
|
303
|
-
_.u.
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
_.
|
|
307
|
-
_.u.
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
_.u.
|
|
311
|
-
_.u.
|
|
312
|
-
_.
|
|
313
|
-
|
|
314
|
-
_.u.
|
|
315
|
-
_.
|
|
316
|
-
|
|
317
|
-
|
|
236
|
+
b<e.end&&(e.start=b);this.T.push(c);this.T.sort(iD)}oD(this);this.Sc();this.player&&this.player.trigger(new _.L(_.Gg))};_.u.clear=function(){this.T=[];oD(this);this.player&&(this.player.trigger(new _.L(_.Gg)),this.player.trigger(new _.L(_.fd)))};
|
|
237
|
+
_.u.Sc=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(_.hd,
|
|
238
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};zD.prototype.Qb=function(){return this.h};zD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.u=_.BD.prototype;_.u.uc=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)};
|
|
239
|
+
_.u.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.u.Vd=function(){return!this.l};PD.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};PD.prototype.cues=function(){return this.a};TD.prototype.release=function(){this.f=this.j=this.h=this.a=null};TD.prototype.l=function(a){TC(this.a,a);UD(this)};
|
|
240
|
+
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}};_.u=_.XD.prototype;_.u.destroy=function(){this.a=[];return Promise.resolve()};
|
|
241
|
+
_.u.Uc=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};
|
|
242
|
+
_.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};
|
|
243
|
+
_.u.qd=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};
|
|
244
|
+
_.u.pa=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 _.mj(f.position,g.startTime,g.endTime,g.Va,g.ya,g.ka,g.Ca,g.keyInfo,g.Xc,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=
|
|
245
|
+
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.mj(d++,f.startTime,f.endTime,f.Va,f.ya,f.ka,f.Ca,f.keyInfo,f.Xc,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 _.mj(e-d--,f.startTime,f.endTime,f.Va,f.ya,f.ka,f.Ca,f.keyInfo,f.Xc,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=
|
|
246
|
+
a};_.u.replace=function(a){this.a=a};bE.prototype.release=function(){this.h=null;this.f=function(){}};fE.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};fE.prototype.Qe=function(){this.A=!0;eE(this)};gE.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
247
|
+
kE.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};rE.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(){}};wE.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()};
|
|
248
|
+
yE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};yE.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,he:d.he},f=e.next()){f=f.value;d.gf=this.o.get(f)||null;d.he=xE(f,a);this.o.set(f,d.he);var g=this.w.find(function(h){return function(l){return l.Dc===h.gf&&l.Cc===h.he}}(d));g&&g.wc(f,b&&0===c)}};_.MJ=0;_.u=CE.prototype;
|
|
249
|
+
_.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};_.u.za=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};_.x(WE,_.U);_.u=WE.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 XE(this,_.yk)};_.u.getAudioTracks=function(){return XE(this,_.xk)};_.u.ia=function(){return XE(this,_.S)};_.u.na=function(){return this.a.get(_.yk)||null};_.u.Sa=function(){return this.a.get(_.xk)||null};_.u.Na=function(){return this.a.get(_.S)||null};
|
|
250
|
+
_.u.lb=function(){return this.f.get(_.yk)||null};_.u.Ab=function(){return this.f.get(_.xk)||null};_.u.Bb=function(){return this.f.get(_.S)||null};_.u.Oa=function(){return YE(this,_.yk)};_.u.ma=function(){return YE(this,_.xk)};_.u.xa=function(){return YE(this,_.S)};_.u.wb=function(a){$E(this,_.yk,a)};_.u.Da=function(a){$E(this,_.xk,a)};_.u.Qa=function(a){$E(this,_.S,a)};_.u.cb=function(a,b){ZE(this,_.yk,a,void 0===b?!1:b)};_.u.ub=function(a,b){ZE(this,_.xk,a,void 0===b?!1:b)};
|
|
251
|
+
_.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!==_.pe){var e=this.ia().find(function(g){return g.kind===_.pe&&g.language===d.track.language});if(!e){var f=this.ma();f&&(e=this.ia().find(function(g){return g.kind===_.pe&&g.language===f.language}))}e&&(c=e.renditions[0])}}ZE(this,_.S,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)})};
|
|
252
|
+
_.u.ra=function(){return!!this.m&&this.m.ra()};WE.prototype.isAbrEnabled=WE.prototype.ra;WE.prototype.addTextTrack=WE.prototype.addTextTrack;WE.prototype.setTextRendition=WE.prototype.vb;WE.prototype.setAudioRendition=WE.prototype.ub;WE.prototype.setVideoRendition=WE.prototype.cb;WE.prototype.setTextTrack=WE.prototype.Qa;WE.prototype.setAudioTrack=WE.prototype.Da;WE.prototype.setVideoTrack=WE.prototype.wb;WE.prototype.getTextTrack=WE.prototype.xa;WE.prototype.getAudioTrack=WE.prototype.ma;
|
|
253
|
+
WE.prototype.getVideoTrack=WE.prototype.Oa;WE.prototype.getLoadingTextRendition=WE.prototype.Bb;WE.prototype.getLoadingAudioRendition=WE.prototype.Ab;WE.prototype.getLoadingVideoRendition=WE.prototype.lb;WE.prototype.getTextRendition=WE.prototype.Na;WE.prototype.getAudioRendition=WE.prototype.Sa;WE.prototype.getVideoRendition=WE.prototype.na;WE.prototype.getTextTracks=WE.prototype.ia;WE.prototype.getAudioTracks=WE.prototype.getAudioTracks;WE.prototype.getVideoTracks=WE.prototype.getVideoTracks;lF.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.xj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};lF.prototype.h=function(a,b){var c=_.xj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};lF.prototype.f=function(){this.a.resetCaptionStream()};_.mF.prototype.init=function(){};_.mF.prototype.h=function(){};_.mF.prototype.f=function(){};_.u=_.oF.prototype;
|
|
254
|
+
_.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"](VC));for(e=1;e<d.length;++e)d[e].p["catch"](VC),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=
|
|
255
|
+
{};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=_.Xp,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.gl(g.mimeType,g.codecs);if(h===e.TEXT)d.fc(l);else{var m=new Map;m.set(h,l);if((!_.et(l)||!b||g.keyInfo)&&_.fl(l,h)){var n=_.fl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}rF(d,m)}});_.B(f)})};_.u.Fi=function(){this.g.debug(dC);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
256
|
+
_.u.Vh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.u.fc=function(a){this.a||(this.a=new CE(this.L,this.C));DE(this.a,a)};_.u.ue=function(){return this.o?this.o.readyState===_.me:!0};_.u.La=function(a){return a===_.Q?this.a.La():(a=sF(this,a))?a.La():null};_.u.ha=function(a){return a===_.Q?this.a.ha():(a=sF(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.a.Gb(b):(a=sF(this,a))?a.Gb(b,!1,c):!1};
|
|
257
|
+
_.u.za=function(a,b){if(a===_.Q)return this.a.za(b);var c=sF(this,a);return c?c.za(b):0};_.u.Jf=function(){var a={};a.total=new _.im(this.j.buffered,"total");a.audio=sF(this,_.$c);a.video=sF(this,_.r);var b=[];this.a&&(b=[{start:this.a.La(),end:this.a.ha()}]);a.text=gD(b,_.Q);return a};
|
|
258
|
+
_.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=EE(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.fc(_.lg),GE(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(uF(this,_.$c,this.Af.bind(this,_.$c,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(uF(this,
|
|
259
|
+
_.r,this.Af.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.fc(_.lg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&GE(h.a,p,c,d,h.f.video.timestampOffset)})),b=uF(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(BB,c,d,DB,tF(h,a));else if(a===_.$c&&null!==c&&null!==d)mD(h.B),null!==c&&null!==d&&h.g.debug(AB,c,d,DB,tF(h,a));else if(a===_.r&&null!==c&&null!==
|
|
260
|
+
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(GB+t+nB+(a+uB)+(c+mB)+(p+tB)),p=uF(h,a,function(){h.Zg(a,t)}),q=uF(h,a,h.Wg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.u.Yg=function(a){var b=this.ha(_.r)||0;FE(this.a,a,b)};
|
|
261
|
+
_.u.Qg=function(){this.a&&FE(this.a,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.a.remove(b,c):uF(this,a,this.Xg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.La(a),f=d.ha(a);null!==e&&null!==f&&pD(d.B,e,f)}else a===_.$c&&nD(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 uF(this,a,this.Xg.bind(this,a,0,this.o.duration))};
|
|
262
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():uF(this,a,this.Wg.bind(this,a))};_.u.Hi=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.Xp;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=vF(e,a,b,c,d);e.K&&(g=g.concat(vF(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.u.endOfStream=function(a){var b=this;return yF(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.u.Bf=function(a){var b=this;yF(this,function(){b.o.duration=a})};
|
|
263
|
+
_.u.getDuration=function(){return this.o.duration};_.u.Af=function(a,b){this.g.debug(CB+a+oB);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(OB+a,c),c;}this.g.debug(IB+a+oB)};_.u.Xg=function(a,b,c){if(c<=b)this.Vc(a);else{this.g.debug(cC+a+rB,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(QB+a+pB,b,c,d),d;}this.g.debug(KB+a+rB,b,c)}};
|
|
264
|
+
_.u.bk=function(a){try{this.g.debug(zB+a+oB);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(NB+a+oB,d),d;}this.g.debug(HB+a+oB);this.Vc(a)};_.u.Wg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(TB+a),this.j.currentTime-=.001):this.g.warn(hC+a+sB+this.j.readyState)}catch(b){throw this.g.warn(PB+a,b),b;}this.g.debug(JB+a);this.Vc(a)};
|
|
265
|
+
_.u.Zg=function(a,b){0>b&&(b+=.001);try{this.g.debug(gC+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(SB+a,b,c),c;}this.g.debug(MB+a,b);this.Vc(a)};_.u.ck=function(a,b,c){try{this.g.debug(eC+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(RB+a,b,c,d),d;}this.g.debug(LB+a,b,c);this.Vc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.P,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
266
|
+
_.u.Vc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(jC+a),xF(this,a))};_.u.getTextDisplayer=function(){return this.C};var qF=window.URL.createObjectURL;_.u=_.QF.prototype;_.u.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.C=!1};_.u.init=function(a){this.A=a};
|
|
267
|
+
_.u.chooseTrack=function(){var a=RF(this,!this.C&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=RF(this,null,this.f),a=[a[0]]);this.h=Date.now();this.C=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
268
|
+
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.u.enable=function(){this.l=!0};_.u.disable=function(){this.l=!1};
|
|
269
|
+
_.u.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);var c=this.w;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.wD(c.f,e,d);_.wD(c.h,e,d)}if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
270
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseTrack();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.u.playbackRateChanged=function(a){this.o=a};
|
|
271
|
+
_.u.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=RC(this.j,_.oe);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(_.xD(a.f),_.xD(a.h))};_.u.setTracks=function(a){this.f=a};_.u.setCmsdManager=function(a){this.j=a};_.u.configure=function(a){this.a=a};_.u.reset=function(){this.B=!1;this.w=new kF;var a=this.chooseTrack();a&&this.A(a)};VF.prototype.clear=function(){this.a.clear()};YF.prototype.add=function(a,b){var c=void 0===b?!0:b;if(aG(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Bh("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};YF.prototype.values=function(){return this.a.values()};cG.prototype.create=function(a){var b=this,c=this.a===_.$f&&hD(),d=a.filter(function(e){return aG(b.f,e,!c)});return d.length?new YF(d[0],d):this.h.create(a)};
|
|
272
|
+
bG.prototype.create=function(a){var b=dG(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=eG(a,this.a);0<c.length?(a=c,b=!0):_.Bh("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=AF(a,this.f),b.length?a=b:_.Bh("No exact match for the channel count could be found."));b=fG(a,this.l);b.length?a=b:_.Bh("No exact match for spatial audio could be found.");b=this.h===_.$f&&hD();c=new YF(a[0]);a=_.w(a);
|
|
273
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};iG.prototype.getState=function(){return this.a};var hG=0,gG=1;kG.prototype.release=function(){this.f.release()};_.u=mG.prototype;
|
|
274
|
+
_.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"](VC));for(e=1;e<d.length;++e)d[e].p["catch"](VC),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=
|
|
275
|
+
{};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=_.Xp,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.gl(g.mimeType,g.codecs);if(h===e.TEXT)d.fc(l);else{var m=new Map;m.set(h,l);if((!_.et(l)||!b||g.keyInfo)&&_.fl(l,h)){var n=_.fl(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}oG(d,m)}d.h[h]=[]});_.B(f)})};_.u.Fi=function(){this.g.debug(dC);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
276
|
+
_.u.Vh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.P};_.u.fc=function(a){this.f||(this.f=new CE(this.J,this.C));DE(this.f,a)};_.u.ue=function(){return this.o?this.o.readyState===_.me:!0};_.u.La=function(a){return a===_.Q?this.f.La():(a=pG(this,a))?a.La():null};_.u.ha=function(a){return a===_.Q?this.f.ha():(a=pG(this,a))?a.ha():null};_.u.Gb=function(a,b,c){return a===_.Q?this.f.Gb(b):(a=pG(this,a))?a.Gb(b,!1,c):!1};
|
|
277
|
+
_.u.za=function(a,b){if(a===_.Q)return this.f.za(b);var c=pG(this,a);return c?c.za(b):0};_.u.Jf=function(){var a={};a.total=new _.im(this.j.buffered,"total");a.audio=pG(this,_.$c);a.video=pG(this,_.r);var b=[];this.f&&(b=[{start:this.f.La(),end:this.f.ha()}]);a.text=gD(b,_.Q);return a};
|
|
278
|
+
_.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=EE(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.fc(_.lg),GE(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(rG(this,_.$c,this.zf.bind(this,_.$c,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(rG(this,
|
|
279
|
+
_.r,this.zf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.fc(_.lg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&GE(h.f,p,c,d,h.a.video.timestampOffset)})),b=rG(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(BB,c,d,DB,qG(h,a));else if(a===_.$c&&null!==c&&null!==d)mD(h.B),null!==c&&null!==d&&h.g.debug(AB,c,d,DB,qG(h,a));else if(a===_.r&&null!==c&&null!==
|
|
280
|
+
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(GB+t+nB+(a+uB)+(c+mB)+(p+tB)),p=rG(h,a,function(){sG(h,a,t)}),q=rG(h,a,h.Ug.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.u.Yg=function(a){var b=this.ha(_.r)||0;FE(this.f,a,b)};
|
|
281
|
+
_.u.Qg=function(){this.f&&FE(this.f,"",0)};_.u.remove=function(a,b,c){var d=this;return a===_.Q?this.f.remove(b,c):rG(this,a,this.Vg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.La(a),f=d.ha(a);null!==e&&null!==f&&pD(d.B,e,f)}else a===_.$c&&nD(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 rG(this,a,this.Vg.bind(this,a,0,this.o.duration))};
|
|
282
|
+
_.u.flush=function(a){return a===_.Q?Promise.resolve():rG(this,a,this.Ug.bind(this,a))};_.u.Hi=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.Xp;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,yG(g,a,e,f),2)}l=n.f;m=tG(g,a,b,c,d,l);g.N&&(m=m.concat(tG(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.u.endOfStream=function(a){var b=this;return wG(this,function(){b.ue()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
283
|
+
_.u.Bf=function(a){var b=this;wG(this,function(){b.o.duration=a})};_.u.getDuration=function(){return this.o.duration};_.u.zf=function(a,b){this.g.debug(CB+a+oB);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(OB+a,c),c;}this.g.debug(IB+a+oB)};_.u.Vg=function(a,b,c){if(c<=b)this.qc(a);else{this.g.debug(cC+a+rB,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(QB+a+pB,b,c,d),d;}this.g.debug(KB+a+rB,b,c)}};
|
|
284
|
+
_.u.Ug=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(TB+a),this.j.currentTime-=.001):this.g.warn(hC+a+sB+this.j.readyState)}catch(b){throw this.g.warn(PB+a,b),b;}this.g.debug(JB+a);this.qc(a)};_.u.S=function(a){this.h[a][0].p.reject(new _.N(_.P,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(jC+a),vG(this,a))};_.u.getTextDisplayer=function(){return this.C};var nG=window.URL.createObjectURL;zG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};zG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=qD(c,a)||c[0];b!==a&&this.f(a);this.a=a};BG.prototype.getConfiguration=function(){return this.j};BG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};BG.prototype.set=function(a,b){this.h=a;FG(this,b)};var IG=new _.vp(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=_.LG.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,WG(e),b.push(XG(e));return _.y(f,Promise.all(b),2)}a.a.clear();a.w.clear();a.D=null;a.j=null;a.G=null;a.A.clear();a.h=null;a.f=!0;_.B(f)})};
|
|
285
|
+
_.u.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.D.Pb();c=qD(a.j.periods,b+_.qv);if(!c)throw new _.N(_.P,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(_.P,5,5005,"No streams chosen.");a.C=!d.variant&&!!d.text;return _.y(e,sH(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.rm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),
|
|
286
|
+
a.D.rm());_.B(e)})};_.u.resume=function(){if(!hH(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,UG(this,b,0)};
|
|
287
|
+
_.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=eH(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,jH(b,a,a.Ye,a.re),3);case 3:return m["return"]();case 2:_.D(m,4);d=xH(b,a);null!=d&&(UG(b,a,d),a.bd=!1);_.mh(m,5);break;case 4:return e=_.E(m),_.y(m,IH(b,e),6);case 6:return m["return"]();case 5:NH(b,a);if(!iH(b)){m.F(0);break}if(b.D.configuration.Il){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
288
|
+
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.fi();_.B(m)}})};
|
|
289
|
+
_.u.Nm=function(a,b,c,d){var e=IC(d.reader),f=IC(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.bn(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.ki();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}}))};
|
|
290
|
+
_.u.On=function(a){var b=this,c=!1,d=0;(new _.cn).M(_.Qe,_.dn).M(_.og,_.dn).M(_.Le,_.dn).M(_.Pe,_.dn).M(_.eg,_.dn).Y(_.gg,_.en).M("encv",function(e){e.reader.skip(78);_.dn(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 _.Rm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.x(RH,_.tm);_.u=RH.prototype;_.u.init=function(a,b){var c=a.getMedia();_.tm.prototype.init.call(this,a,b);cI(this,c)};_.u.namespace=function(){return pC};_.u.setSeekInterceptor=function(a){this.zg=a||null};_.u.mh=function(){return new WE};_.u.getState=function(){return this.nc};_.u.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
291
|
+
_.u.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){bF(a,!1);a.Ld=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===sI?c["return"]():_.y(c,eI(a),2)}a.Z=null;a.vg=0;a.Mc=null;a.$=null;_.B(c)})};_.u.release=function(){var a=this;return _.I(function(b){if(a.ga)return b["return"](a.ga);a.ga=UH(a);a.ga["finally"](function(){a.ga=null});return b["return"](a.ga)})};
|
|
292
|
+
_.u.getBufferInfo=function(a){if(this.L){var b=this.L.Jf(),c=new _.im(void 0,a);switch(a){case _.yk:return b.video?b.video:c;case _.xk:return b.audio?b.audio:c;case _.S:return b.text?b.text:c}return b.total?b.total:c}return this.Qc?(b=kD(this.Qc),gD(b,a)):_.tm.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?tE(this.B):_.tm.prototype.getMediaPosition.call(this)};
|
|
293
|
+
_.u.seek=function(a){if(this.zg&&!this.zg(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 _.tm.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};
|
|
294
|
+
_.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,_.tm.prototype.destroy.call(a),2);if(a.G===sI)return b["return"]();a.log.debug("Destroying player...");a.G=sI;bI(a);a.o&&(a.o.release(),a.o=null);a.Jd=null;a.h=null;_.B(b)})};_.u.getTimeline=function(){return this.Jd};
|
|
295
|
+
_.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 _.ek,b.l.a=c,_.D(z,2),$H(b),b.ba=_.Hb,_.y(z,fI(b),4);case 4:return UF(b.l,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Qp(d),b.configuration=_.rm(b.mc,d),b.log.info("Loading playlist configurations",a),b.Jd=VH(b.configuration),_.y(z,gI(b,c),5);case 5:return UF(b.l,c),e=a.map(function(C){return hI(b,C,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
296
|
+
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(_.P,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.kc)throw new _.N(_.P,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.P,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.BD({version:2},null,0,m);p=f.map(function(C){return PE(C.manifest)});
|
|
297
|
+
q=SE(p,n);b.f=q;t=b;return _.y(z,iI(b,q,b.configuration.drm),7);case 7:return t.w=z.f,UF(b.l,c),_.y(z,jI(b,c),8);case 8:UF(b.l,c);bH(b.a,q);XH(b,q);c.resolve();_.mh(z,0);break;case 2:v=_.E(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:kI(b,v,c),_.B(z)}})};
|
|
298
|
+
_.u.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){$H(b);if(b.ba!==_.Hb)throw new _.N(_.P,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,rI(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;bH(b.a,c.manifest);iH(b.a)&&b.a.resume();XH(b,c.manifest);_.B(d)})};_.u.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
299
|
+
_.u.Tg=function(){var a=this;return _.I(function(b){$H(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,jI(a,null),0)})};_.u.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return $H(b),_.no("preload.start"),b.log.info("Preloading asset",a),_.y(c,lI(b,a,!1),2);b.Ne=a;b.log.info("Preloaded asset",a);_.no("preload.end");_.oo("preload","preload.start","preload.end");_.B(c)})};
|
|
300
|
+
_.u.load=function(a){return lI(this,a)};_.u.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,aI(a),2);a.configuration=a.mc;bI(a);_.B(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.oi=function(){this.log.debug("User seeking finished");this.J&&iJ(this);jJ(this)};
|
|
301
|
+
_.u.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:CD(b),end:MD(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.uc=function(){return this.f?this.f.presentationTimeline.uc():null};_.u.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
302
|
+
_.u.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===QH){if(_.mk()){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",
|
|
303
|
+
d),_.ZG(c,d,!1,0),e.gc=f);else if(f=e.gc)c.g.debug("Restoring non-trick-mode stream",f),e.gc=null,_.ZG(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.u.ia=function(){if(this.f&&this.B){var a=xI(this);if(null==a)a=null;else{if(!XF(this.P,a).text){var b=_.PF(a.textStreams,this.Gd,this.Ge,this.Cd);b.length&&(b=b[0],XF(this.P,a).text=b)}a=XF(this.P,a).text}b=[];for(var c=_.w(BJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=MF(d);e.active=d===a;b.push(e)}return b}return[]};_.u.getPeriods=function(){return this.f.periods};
|
|
304
|
+
_.u.getStats=function(){if(this.G!==QH)return _.up();jJ(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===QH){if(a=lJ(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};
|
|
305
|
+
_.u.getTimelineCues=function(){return this.K?SD(this.K,rJ(this)):[]};_.u.resetAbr=function(){this.h&&this.h.reset()};_.u.ze=function(){return this.h};
|
|
306
|
+
_.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!==QH)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=xI(g);l=_.Xp;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 _.mj(1,0,q,function(){return[a]},0,null,0);v={id:g.Qi++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
307
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(F){return 1===F?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.sC,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,VG(g.a,v),
|
|
308
|
+
2)}if(z=_.OG(g.a,_.Q))XF(g.P,h).text=z;g.Ie["delete"](v);g.log.debug("Choosing new streams after adding a text stream");wJ(g,h);zI(g);return C["return"](MF(v))})};
|
|
309
|
+
_.u.ak=function(a){this.log.debug(_.wC,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=zJ(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}}};
|
|
310
|
+
_.u.$j=function(){this.log.debug("canSwitch_");this.ca=!1;this.configuration.abr.enabled&&this.h.enable();this.ta&&($G(this.a,this.ta,this.Pi,this.Oi),this.ta=null);this.fa&&(_.ZG(this.a,this.fa,!0,0),this.fa=null)};_.u.Nn=function(){this.A&&this.A.update()};_.u.Cm=function(){this.B&&this.B.j.Qe()};
|
|
311
|
+
_.u.lj=function(a,b,c){if((void 0===c?"":c)===uC)return zI(this),this.ra()||(this.configuration.abr.enabled=!0,this.h.enable()),wJ(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===_.$c&&(h=h&&l.language===a.language));return h})&&this.ra()){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)}zI(this);this.ra()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
312
|
+
wJ(this,b)}return c};_.u.pm=function(){this.log.debug("endOfStream called by streaming engine");this.Ld=!0};_.u.onError=function(a){if(this.G!==sI&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.ne,{detail:a});a.severity===_.P&&TH(this,_.Jp);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.u.yf=function(a){a.type===_.ge?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Mg?tI(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.fc,a.type)))};_.u.ra=function(){return this.configuration.abr.enabled};
|
|
313
|
+
_.u.Dn=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Kc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ra();return _.y(n,b.Kc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.M.pa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,kH(b.a),3);case 3:g=lJ(b);case 4:return h=!1,_.D(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,CJ(b,f,g),9);case 9:_.mh(n,6);break;case 7:return l=_.E(n),b.log.info("Switch failed"),
|
|
314
|
+
_.y(n,b.Kc(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(),gH(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.qd,{newManifest:f.url})),_.B(n))}})};var sI=0,PH=1,QH=2,yI=[_.cf,_.we];DJ.prototype.a=function(){return pC};
|
|
315
|
+
DJ.prototype.canPlay=function(a,b){if(_.rl())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 _.fu||_.gu(a.url)in _.hu?!0:!1:!1;if(d&&e){if(_.mk(2))return 1;if(_.sl()&&c===_.Ul){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Bh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
316
|
+
DJ.prototype.f=function(a){return a===_.pa||a===_.Hb};DJ.prototype.create=function(){return new RH};_.Lh(new DJ);_.Or(function(){_.Gh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Fh("Patching Chromecast MSE bugs."),IJ();else if(_.sl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;GJ();10>=a?(_.Fh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Fh("Patching Safari 11 \x26 12 MSE bugs."),EJ(),FJ()):(_.Fh("Patching Safari 13 MSE bugs."),EJ())}else _.mk(2)||_.mk(3)||
|
|
317
|
+
_.mk(4)?HJ():_.Fh("Using native MSE as-is.");else _.Fh("No MSE implementation available.")});_.x(JJ,_.cv);_.u=JJ.prototype;
|
|
318
|
+
_.u.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Bh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.tg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.sd}catch(g){f.align="middle"}e.writingMode===_.Bg?f.vertical="lr":e.writingMode===_.Cg&&(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?
|
|
319
|
+
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;KJ(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.u.isTextVisible=function(){return this.a.mode===_.Wf};_.u.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Wf:_.te)};_.u.destroy=function(){this.a&&KJ(this.a,function(){return!0});this.a=null;return Promise.resolve()};LJ.prototype.a=function(){return!0};LJ.prototype.create=function(a){return new JJ(a)};_.lp("single-native",new LJ);};
|
|
318
320
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
319
321
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
320
322
|
else{_=this.clpp._;(f.call(g,this));}
|