@castlabs/prestoplay 6.14.0 → 6.15.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/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 +113 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +550 -529
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +191 -64
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -68
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +290 -275
- 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.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +70 -70
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +457 -438
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +187 -64
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +255 -240
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/clpp.styles.css +2 -0
- package/package.json +1 -1
- package/typings.d.ts +387 -90
package/cjs/cl.mse.js
CHANGED
|
@@ -1,281 +1,296 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
_.
|
|
7
|
-
_.
|
|
8
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
9
|
-
b,d||null,e,a,c)};_.
|
|
10
|
-
|
|
11
|
-
_.
|
|
12
|
-
|
|
13
|
-
_.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
_.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
2
|
+
var f=function(window){var Hz,Iz,Jz,Kz,Lz,Mz,Nz,Oz,Pz,Qz,Tz,Uz,Vz,Xz,Yz,Zz,$z,aA,bA,dA,eA,gA,hA,iA,jA,kA,mA,nA,oA,pA,uA,vA,wA,xA,yA,zA,AA,BA,EA,FA,HA,IA,JA,LA,MA,OA,PA,QA,RA,SA,TA,UA,VA,XA,bB,hB,mB,pB,eB,oB,qB,rB,sB,tB,uB,vB,wB,xB,yB,zB,DB,FB,GB,HB,EB,JB,IB,KB,LB,OB,PB,QB,NB,MB,RB,VB,XB,UB,YB,TB,WB,SB,$B,ZB,aC,bC,cC,fC,gC,hC,iC,kC,oC,mC,qC,rC,sC,tC,uC,wC,vC,xC,zC,AC,BC,DC,CC,FC,yC,GC,EC,HC,NC,KC,IC,LC,MC,OC,PC,SC,RC,TC,UC,VC,JC,WC,QC,YC,ZC,$C,aD,bD,dD,eD,gD,hD,fD,iD,jD,kD,mD,nD,lD,vD,uD,wD,xD,zD,AD,CD,BD,DD,FD,ED,GD,JD,
|
|
3
|
+
HD,ID,LD,KD,MD,ND,OD,RD,TD,SD,UD,VD,WD,XD,$D,ZD,YD,bE,aE,dE,gE,iE,jE,oE,rE,tE,vE,xE,AE,BE,CE,EE,FE,HE,wE,JE,mE,KE,kE,uE,NE,LE,GE,IE,QE,PE,ME,WE,XE,RE,ZE,SE,UE,bF,aF,VE,$E,cF,lE,TE,DE,nE,pE,fE,qE,YE,yE,zE,dF,gF,hF,iF,jF,kF,mF,nF,lF,oF,uF,BF,AF,CF,vF,wF,xF,HF,DF,sF,rF,qF,tF,FF,GF,yF,zF,RF,LF,UF,VF,WF,$F,XF,rD,pD,sD,qD,tD,oD,gG,eG,iG,SF,QF,ZF,hG,fG,kG,YF,bG,JF,aG,lG,PF,mG,oG,LG,TF,OF,KG,pG,EF,jG,dG,NG,MF,cG,MG,pF,OG,KF,PG,QG,RG,SG,TG,UG,VG,WG,XG;Hz=" buffer";Iz=" is being or has been set up";Jz="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";
|
|
4
|
+
Kz="\x3c/LA_URL\x3e";Lz="\x3cLA_URL\x3e";Mz='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';Nz="Choosing new streams after key status change";Oz="IterateSegmentReference";Pz="Jumping forward";Qz="MediaSource threw QuotaExceededError:";_.Rz="No stream with id";_.Sz="Player is in ERROR state and can not switch to ";Tz="PrestoPlay TextTrack";Uz="Removing audio from variant - audio not compatible with platform";Vz="Setting playback rate to\x3d";_.Wz="Updating manifest...";
|
|
5
|
+
Xz="bufferBehind\x3d";Yz="bufferedBehind\x3d";Zz="calling onCanSwitch()...";$z="cannot find segment";aA="clpp.mse.Player";bA="currentPeriod.startTime\x3d";_.cA="getSegmentNextReference";dA="key-restriction";eA="manifest.start";_.fA="onChooseStreams_";gA="presentationTime:";hA="presentationTime\x3d";iA="reference.endTime\x3d";jA="reference.position\x3d";kA="reference.startTime\x3d";_.lA="subtitles";mA="switch: Stream ";nA=function(a,b){return _.Yg[a]=b};oA=function(a,b){for(var c in a.a)b(c,a.a[c])};
|
|
6
|
+
pA=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Fm(a);)if(0===_.Hm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.aa(a)};_.rA=function(a){var b=new Uint8Array(qA),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Bm(c,!1);_.V(d,c);_.Dm(d,b);_.Dm(d,a.j);_.V(d,a.f.byteLength);_.Dm(d,a.f);return _.lj(d.buffer)};
|
|
7
|
+
_.sA=function(a,b,c,d){var e=_.yj(b);if(8!==e.byteLength)e="";else{var f=_.Un(e);e=_.vj(f);b:switch(f=f.byteLength,_.Hh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[Mz+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?Lz+d+Kz:"",Jz].join("");break b;case "4.1.0.0":e=[Mz+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
8
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?Lz+d+Kz:"",Jz].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[Mz+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?Lz+d+Kz:"",Jz].join("");break b;default:_.J("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Hh("New payload",e);e=_.lj(_.R.Le(e,!0));return new _.Rn(_.Vn,
|
|
9
|
+
b,d||null,e,a,c)};_.tA=function(a,b){return b===a.version?a:_.sA(b,a.a,a.l||void 0,a.h||void 0)};uA=function(a,b){a:{if(b){var c=_.t(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.ab.length;e++)if(d.ab[e]===b){c=d;break a}}}c=null}return c?c.Ia:null};vA=function(a,b){if(_.Yk("Edge/"))return!0;b=b.toLowerCase();if(_.Vj()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ne);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
10
|
+
wA=function(a,b){var c=a.l.get(b);return!(!c||c!==_.ff&&c!==_.ze)};xA=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Do(c),!vA(a,c))||d&&d.encrypted&&(d=_.Do(d),!vA(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};yA=function(a,b){return a.a.find(function(c){return c.getId()===b})||null};
|
|
11
|
+
zA=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.pb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};AA=function(a,b){a.a=b.enabled};BA=function(){};_.CA=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
|
|
12
|
+
_.DA=function(a,b,c,d,e){this.Qa=a;this.va=b;this.ja=c;this.keyInfo=d||null;this.Sc=_.O.R(e)?!1:!!e};EA=function(a,b){a=_.dj(a);b=_.dj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};FA=function(a){return a.language?_.dj(a.language):a.audio&&a.audio.language?_.dj(a.audio.language):a.video&&a.video.language?_.dj(a.video.language):_.vg};
|
|
13
|
+
_.GA=function(a,b){for(var c=_.dj(a),d=new Set,e=_.t(b),f=e.next();!f.done;f=e.next())d.add(_.dj(f.value));e=_.t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.t(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,EA(f,c))return f;e=_.t(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.dj(g);h=_.dj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.t(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,EA(c,e))return e;return null};
|
|
14
|
+
HA=function(a,b){for(var c=0,d=_.t(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};IA=function(a,b){var c=_.Qk(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};JA=function(a){var b=[a.mimeType];_.Yu.forEach(function(c,d){var e=a[d];e&&b.push(c+'\x3d"'+e+'"')});return b.join(";")};_.KA=function(a){a=a.split(".");var b=a[0];a.pop();return[b,a.join(".")]};
|
|
15
|
+
LA=function(a,b){for(var c=new _.Tl(void 0,void 0===b?"total":b),d=_.t(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};MA=function(a,b){return a.start-b.start};_.NA=function(a){this.h=a;this.log=new _.K("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};OA=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};
|
|
16
|
+
PA=function(a){a.player&&(a.player.off(_.Rf,a.Oc),a.a&&a.player.off(_.rg,a.Oc));a.player=null};QA=function(a){a.player&&a.player.trigger(new _.L(_.hd))};RA=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.rg,a.Oc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.rg,a.Oc),a.a=!1)}};
|
|
17
|
+
SA=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.L(_.Ig))};TA=function(a,b){for(var c=null,d=_.t(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};
|
|
18
|
+
UA=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};VA=function(a,b){for(var c=0;c<a.length;c++)if(UA(a[c]).has(b))return c;return-1};XA=function(a,b){Array.from(UA(a)).forEach(function(c){c.segmentIndex&&_.WA(c.segmentIndex,b)})};
|
|
19
|
+
_.YA=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.ZA=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)};_.$A=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
20
|
+
_.aB=function(a,b,c,d,e,f,g,h){a=_.Jj(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};bB=function(a){this.a=this.h=0;this.f=a};_.cB=function(a,b,c){a.h=b;a.a=c};
|
|
21
|
+
_.dB=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.D=b;this.I=c;this.A=this.f=Infinity;this.h=1;this.G=0;this.l=this.w=null;this.H=0;this.B=this.o=d;this.K=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.L=f;this.J=null;this.a=new bB(d)};_.fB=function(a,b){a.J={offsetDateTime:b-eB(a),seekRangeStartDateTime:b}};_.gB=function(a,b){a.o=b;a.B=b;a.a.f=b};hB=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.o?a.f:a.B?a.l:null};
|
|
22
|
+
_.kB=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.iB(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.jB(a,d);null!=a.D&&a.K&&(a.D=(Date.now()+a.H)/1E3-(a.l||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.iB=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.jB=function(a,b){a.l=Math.max(a.l||0,b)};_.lB=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
23
|
+
_.nB=function(a){return 2===a.j.version?a.a.pb():Infinity===a.A?0:Math.max(0,mB(a)-a.A)};mB=function(a){if(2===a.j.version)a=a.a.a;else if(a.o)a=a.f;else if(a.B)a=a.l||0;else{var b=(Date.now()+a.H)/1E3;a=Math.min(a.L?Math.max(0,b-(a.h-a.G)-a.D):Math.max(0,b-a.h-a.D),a.f)}return a};pB=function(a,b){if(2===a.j.version)return a.a.pb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(mB(a)-a.A+b,oB(a)))};eB=function(a){return 2===a.j.version?a.a.pb():pB(a,0)};
|
|
24
|
+
oB=function(a){var b=a.Md()&&!a.B?a.I:0;return 2===a.j.version?a.a.a-b:Math.max(0,mB(a)-b)};qB=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,Wa:a.Wa}};rB=function(){this.f=function(){};this.a=new Set};sB=function(a,b){a.f=b};
|
|
25
|
+
tB=function(a,b){a:{var c=_.t(a.a);for(var d=c.next();!d.done;d=c.next())if(d=d.value,d.schemeIdUri===b.schemeIdUri&&d.startTime===b.startTime&&d.endTime===b.endTime&&d.configurationId===b.configurationId){c=d;break a}c=null}null==c&&(a.a.add(b),a.f(b))};uB=function(a,b){for(var c=_.t(b),d=c.next();!d.done;d=c.next())tB(a,d.value)};vB=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return qB(c,b)})};
|
|
26
|
+
wB=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 _.wt("crop",a,d.endTime?d.endTime-a:Infinity,!1))};xB=function(a){var b=a.a.$g(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Uf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};yB=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};
|
|
27
|
+
zB=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Qa().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};_.AB=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};_.BB=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.CB=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};
|
|
28
|
+
DB=function(a,b){var c=a.Pc(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 yB(a,c,e)};_.WA=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)};
|
|
29
|
+
FB=function(a,b){this.h=a;this.l=EB(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};GB=function(a,b){a.f=b};HB=function(a){this.a=a};EB=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};
|
|
30
|
+
JB=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Sh;this.D=!1;this.J=a.readyState;this.j=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.h.on(a,_.Ng,function(){return IB(f)});this.w=(new _.Vk(function(){IB(f)})).kb(.25)};
|
|
31
|
+
IB=function(a){if(0!==a.a.readyState){if(a.a.seeking){if(!a.D)return}else a.D=!1;if(!a.a.paused&&!a.o){a.a.readyState!==a.J&&(a.j=!1,a.J=a.a.readyState);var b=a.l.smallGapLimit,c=a.a.currentTime,d=a.a.buffered;a:{var e=new _.Tl(d);var f=a.l.gapDetectionThreshold;if(e.length&&!(1===e.length&&1E-6>e.end(0)-e.start(0)))for(var g=0;g<e.length;g++)if(e.start(g)>c&&(0===g||e.end(g-1)-c<=f)){e=g;break a}e=null}if(null==e){if(a.f){a=a.f;d=a.h;c=EB(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
32
|
+
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>=oB(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:_.Gh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Gh(Pz,g,"seconds because of gap before start time of",f):_.Gh(Pz,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
33
|
+
KB=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Vk(function(){0>=b.j?(_.J(["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--)})};LB=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.kb(.1)};OB=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Sh;this.h=new KB(a);this.w=!1;0<a.readyState?MB(this,c):NB(this,c)};
|
|
34
|
+
PB=function(a){return a.l?a.a.currentTime:a.A};QB=function(a,b){0<a.a.readyState?LB(a.h,b):NB(a,b)};NB=function(a,b){a.A=b;a.f.off(a.a,_.Ke);a.f.one(a.a,_.Ke,function(){MB(a,b)})};MB=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?RB(a):(a.f.one(a.a,_.Yf,function(){RB(a)}),LB(a.h,0===a.a.currentTime?b:a.a.currentTime))};RB=function(a){_.$k()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Yf,function(){return a.j()})};
|
|
35
|
+
VB=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 JB(a,b.presentationTimeline,c,SB(this,a,c),f);this.f=new OB(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.j=!1;l=PB(h.f);var n=TB(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;QB(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},UB(this,d,g),function(){h.j.I=!0});this.o=(new _.Vk(function(){if(0!==
|
|
36
|
+
h.h.readyState&&!h.h.paused){var l=PB(h.f),m=eB(h.a),n=oB(h.a);3>n-m&&(m=n-3);l<m&&(m=TB(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).kb(.25);this.g=new _.K("clpp.mse.Playhead")};XB=function(a){var b=PB(a.f);return 0<a.h.readyState&&!a.h.paused?WB(a,b):b};UB=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?eB(a.a):oB(a.a):0>b&&(b=oB(a.a)+b);return YB(a,WB(a,b))};
|
|
37
|
+
YB=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
38
|
+
TB=function(a,b){var c=new _.Tl(a.h.buffered);c=c.qc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=eB(a.a),g=oB(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=pB(a.a,d),m=pB(a.a,e);d=pB(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),YB(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");return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),
|
|
39
|
+
b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};WB=function(a,b){var c=eB(a.a);if(b<c)return c;c=oB(a.a);return b>c?c:b};
|
|
40
|
+
SB=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new FB(new HB(b),c.stallThreshold);GB(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/")||_.Vj()||_.$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=
|
|
41
|
+
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};$B=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Vk(function(){ZB(b,!1)})).kb(.25)};ZB=function(a,b,c){c=void 0===c?0:c;for(var d=_.t(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
42
|
+
aC=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
43
|
+
bC=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Bc:null,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:1,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:3,Ac:2,oc:function(c,d){return b.a(c,d)}},{Bc:2,Ac:1,oc:function(c,d){return b.f(c,d)}},{Bc:2,Ac:3,oc:function(c,d){return b.f(c,d)}},{Bc:1,Ac:3,oc:function(c,d){return b.h(c,d)}},{Bc:3,Ac:1,oc:function(c,d){return b.h(c,d)}}]};cC=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
44
|
+
_.dC=function(a){_.Ct[a]&&delete _.Ct[a]};_.eC=function(a){_.At[a]&&delete _.At[a]};fC=function(a,b){this.w=null;this.D=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
45
|
+
gC=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.lj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.lj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.j&&g.startTime<a.l});a.h.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.j));a.f=Math.min(d,a.l)}})};
|
|
46
|
+
hC=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.t(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.h.append(e,[])};
|
|
47
|
+
iC=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.t(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.j&&l.startTime<a.l&&(l=new _.ri(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.h.append([l],[]))}e=_.t(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=_.t(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
48
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.jC=function(a){a=a.toLowerCase();return _.qu[a]||window.muxjs&&a===_.Tc?!0:!1};kC=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.lC=function(){};
|
|
49
|
+
_.nC=function(a,b,c,d,e){this.j=a;this.B=c;this.f={};this.L=!1;this.a=null;this.h={};this.l=new _.Sh;this.I=!1;this.w={};this.H=b;this.D=d;this.J=e;this.T=this.J.streaming.maxSegmentToMediaOffset||1;this.K=new _.Oj;this.A="";this.G={};this.o=mC(this,this.K);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};oC=function(a){var b=_.Rk(a.mimeType,a.codecs),c=JA(a);return _.jC(b)||_.vr(c)||(_.Qk(b,a.type)?!0:!1)};
|
|
50
|
+
mC=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,"startstreaming",function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=pC(c);a.j.src=a.A;return c}c=new MediaSource;a.A=pC(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};qC=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
|
|
51
|
+
rC=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.re,a.U.bind(a,d));a.l.on(e,"updateend",a.cd.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.L=b.has(_.bd)&&b.has(_.Fg)};sC=function(a){return a.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.N};tC=function(a,b){a.a||(a.a=new fC(a.J,a.B));var c=a.a;if(b!==_.Tc){var d=_.qu[b];if(!d)throw new _.P(_.Q,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.D)}};uC=function(a){return a.o?a.o.readyState===_.qe:!0};
|
|
52
|
+
wC=function(a){var b={};b.total=new _.Tl(a.j.buffered,"total");b.audio=vC(a,_.bd);b.video=vC(a,_.Fg);var c=[];a.a&&(c=[{start:a.a.xb(),end:a.a.Ea()}]);b.text=LA(c,_.Ri);return b};vC=function(a,b){try{return new _.Tl(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error("failed to get buffered range for "+b,c),null}};xC=function(a,b){if(!a.f[b])return"";var c=vC(a,b);return c?c.toString():""};
|
|
53
|
+
zC=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l=a.f[b],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);b===_.Fg&&null!==d&&null!==e&&h&&(m=0<n?l.buffered.end(n-1):-1);b===_.Ri?c=gC(a.a,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.a||tC(a,_.ng),iC(a.a,c.captions,d,e,a.f.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.f.audio&&f.push(yC(a,_.bd,a.mf.bind(a,_.bd,c.audio.buffer))),0<c.video.byteLength&&a.f.video&&f.push(yC(a,_.Fg,a.mf.bind(a,_.Fg,c.video.buffer))),c=
|
|
54
|
+
Promise.all(f)):(f&&window.muxjs&&(a.a||tC(a,_.ng),null==d&&null==e?a.H.init(c):a.H.h(c,function(p){p.length&&iC(a.a,p,d,e,a.f.video.timestampOffset)})),c=yC(a,b,a.mf.bind(a,b,c)));return c.then(function(){if(b===_.Fg&&null!==d&&null!==e&&!h)a.D.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",xC(a,b));else if(b===_.bd&&null!==d&&null!==e)QA(a.D),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",xC(a,b));else if(b===_.Fg&&null!==d&&null!==e&&
|
|
55
|
+
h){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&&a.D.append(m,q,g)}if(!a.G[b]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=d-p;if(Math.abs(u)>a.T&&0===l.timestampOffset)return a.g.warn("Detected a delta of "+u+" between media times and segment times for "+(b+". The segment start time is ")+(d+" and the media start time is ")+(p+". Adjusting timestampOffset.")),p=yC(a,b,function(){a.ci(b,u)}),q=yC(a,b,a.Xg.bind(a,b,!1)),Promise.all([p,q])}null!==
|
|
56
|
+
d&&null!==e&&(a.G[b]=!0)})["catch"](function(p){throw p;})};AC=function(a,b){var c=a.Ea(_.Fg)||0;hC(a.a,b,c)};BC=function(a){a.a&&hC(a.a,"",0)};DC=function(a,b,c,d,e){if(b===_.Ri)return a.a.A=c,a=a.a,a.j=d,a.l=e,Promise.resolve();b=CC(a,b,c,d,e);a.L&&(b=b.concat(CC(a,_.bd,c,d,e)));return Promise.all(b)};CC=function(a,b,c,d,e){return[yC(a,b,a.zi.bind(a,b)),yC(a,b,a.ci.bind(a,b,c)),yC(a,b,a.Dm.bind(a,b,d,e))]};FC=function(a,b){EC(a,function(){a.o.duration=b})};
|
|
57
|
+
yC=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Oj};a.h[b].push(c);1===a.h[b].length&&GC(a,b);return c.p};GC=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug("Starting next operation for "+b),c.start()}catch(d){"QuotaExceededError"===d.name?c.p.reject(new _.P(_.Q,3,3017,{type:b})):c.p.reject(new _.P(_.Q,3,3015,{mediaError:d})),HC(a,b)}else a.g.debug("No more scheduled operations for "+b)};
|
|
58
|
+
EC=function(a,b){if(a.I)return Promise.reject();var c=[],d;for(d in a.f){var e=new _.Oj,f={start:function(g){g.resolve()}.bind(null,e),p:e};a.h[d].push(f);c.push(e);1===a.h[d].length&&f.start()}return Promise.all(c).then(function(){for(var g in a.f);try{b()}catch(m){var h=Promise.reject(new _.P(_.Q,3,3015,{mediaError:m}))}for(var l in a.f)HC(a,l);return h},function(){for(var g in a.f)a.h[g].length&&a.h[g].shift();return Promise.reject()})};HC=function(a,b){a.h[b].shift();GC(a,b)};
|
|
59
|
+
NC=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=IC(e,b,c);e=JC(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=_.t(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.t(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={Te:c.Te},d++)c.Te=b[d],l=new Set(_.ah(l).concat().filter(function(n){return function(p){return n.Te.has(p)}}(c)));
|
|
60
|
+
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=KC(e);var m=LC(e);a=_.t(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(MC(n)===m)return!0;_.Hh("Dropping Variant (better codec available)",n);return!1})};KC=function(a){var b=new _.Ph;a=_.t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=MC(c);b.push(d,c)}return b};
|
|
61
|
+
IC=function(a,b,c){var d={};b=_.t(b);for(var e=b.next();!e.done;d={$e:d.$e},e=b.next())if(d.$e=e.value,e=a.filter(function(f){return function(g){return g.video&&g.video.codecs.startsWith(f.$e)}}(d)),e.length){a=e;break}d={};c=_.t(c);for(b=c.next();!b.done;d={Pe:d.Pe},b=c.next())if(d.Pe=b.value,b=a.filter(function(f){return function(g){return g.audio&&g.audio.codecs.startsWith(f.Pe)}}(d)),b.length){a=b;break}return a};
|
|
62
|
+
LC=function(a){var b="",c=Infinity;oA(a,function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Hh(_.Md,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};MC=function(a){var b="";a.video&&(b=_.KA(a.video.codecs)[0]);var c="";a.audio&&(c=_.KA(a.audio.codecs)[0]);return b+"-"+c};
|
|
63
|
+
OC=function(a,b,c){function d(f,g,h){return f>=g&&f<=h}var e=a.video;return e&&e.width&&e.height&&!(d(e.width,b.minWidth,Math.min(b.maxWidth,c.width))&&d(e.height,b.minHeight,Math.min(b.maxHeight,c.height))&&d(e.width*e.height,b.minPixels,b.maxPixels))||!d(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!1:!0};PC=function(a,b,c){var d=!1;a=_.t(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=OC(e,b,c);f!==e.allowedByApplication&&(d=!0)}return d};
|
|
64
|
+
SC=function(a,b,c,d){var e=!1;d.variants=d.variants.filter(function(m){if(a&&a.$&&!xA(a,m))return _.Hh("Dropping variant - not compatible with key system",m),!1;var n=m.audio,p=m.video;if(n&&!oC(n)){var q=n.codecs;0<=n.codecs.indexOf(_.ne)?(_.Hh("Trying to use AC-3 for EC-3"),n.codecs=n.codecs.replace(_.ne,"ac-3"),oC(n)?_.Gh("Using AC-3 instead of EC-3 for",QC(n)):(n.codecs=q,_.Gh(Uz,QC(n)),m.audio=null,e=!0,n=null)):(_.Gh(Uz,QC(n)),m.audio=null,e=!0,n=null)}return p&&!oC(p)?(_.Gh("Dropping variant - video not compatible with platform",
|
|
65
|
+
QC(p)),!1):n&&b&&!RC(n,b)?(_.Gh("Dropping variant - not compatible with active audio","active audio",QC(b),"variant.audio",QC(n)),!1):p&&c&&!RC(p,c)?(_.Gh("Dropping variant - not compatible with active video","active video",QC(c),"variant.video",QC(p)),!1):!0});if(e){for(var f=!1,g=!1,h=_.t(d.variants),l=h.next();!l.done;l=h.next())l=l.value,!f&&l.video&&l.audio&&(f=!0),g||l.audio||!l.video||(g=!0);f&&g&&(d.variants=d.variants.filter(function(m){return m.video&&!m.audio?(_.Gh("Dropping variant - not compatible with video + audio",
|
|
66
|
+
"variant.video",QC(m.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(m){var n=_.jC(_.Rk(m.mimeType,m.codecs));n||_.Hh("Dropping text stream. Is not supported by the platform.",m);return n})};RC=function(a,b){return a.mimeType!==b.mimeType||a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
67
|
+
TC=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=_.t(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.t(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
56
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,
|
|
57
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};
|
|
58
|
-
|
|
59
|
-
accessibility:a.accessibility,keyId:null}};
|
|
60
|
-
_.
|
|
61
|
-
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
b.accessibility||[];return c};
|
|
65
|
-
|
|
66
|
-
d,null,["id","track"])}))||c.renditions.push(d);return a||d}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
b.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
b
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
b;
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
a
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var g=
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
a.
|
|
115
|
-
|
|
116
|
-
a.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
a
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
_.
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
a
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return a.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
a
|
|
179
|
-
|
|
180
|
-
b.
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
_.
|
|
214
|
-
|
|
215
|
-
_.
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
_.r.
|
|
219
|
-
|
|
220
|
-
_.r.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
_.r.
|
|
226
|
-
|
|
227
|
-
_.r.
|
|
228
|
-
|
|
229
|
-
_.r.
|
|
230
|
-
_.r.
|
|
231
|
-
_.r.
|
|
232
|
-
_.r.
|
|
233
|
-
_.r.
|
|
234
|
-
_.r.
|
|
235
|
-
_.r.
|
|
236
|
-
_.r.
|
|
237
|
-
_.r
|
|
238
|
-
_.r.
|
|
239
|
-
|
|
240
|
-
_.r.
|
|
241
|
-
|
|
242
|
-
_.r.
|
|
243
|
-
|
|
244
|
-
_.r.
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
_.r.
|
|
250
|
-
_.
|
|
251
|
-
|
|
252
|
-
_.r
|
|
253
|
-
_.r.
|
|
254
|
-
_.r.
|
|
255
|
-
_.r.
|
|
256
|
-
_.r.
|
|
257
|
-
_.r.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
_.r.
|
|
261
|
-
_.r.
|
|
262
|
-
|
|
263
|
-
_.r.
|
|
264
|
-
_.r.
|
|
265
|
-
_.
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
_.r.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
_.r.
|
|
273
|
-
_.
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
_.
|
|
277
|
-
|
|
278
|
-
|
|
70
|
+
UC=function(a){return{id:a.id,active:!1,type:_.Ri,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}};VC=function(a){return a.allowedByApplication&&a.allowedByKeySystem};JC=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.t(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
|
+
_.XC=function(a,b,c,d){b=_.gi(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=_.GA(_.dj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.dj(m.language)===l}),!0):!1});e=e.filter(function(h){return d?h.kind===_.se:h.kind!==_.se});if(c){b=WC(e,c);if(b.length)return b;_.J("No exact match for the text role could be found.")}else if(b=e.filter(function(h){return 0===
|
|
73
|
+
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.Ai,[]);return b.length?WC(e,b[0]):e};WC=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
74
|
+
QC=function(a){var b=JA(a);return a.type===_.bd?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Fg?"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
|
+
YC=function(a,b){var c=String(_.mk++);c=new _.gk(c,a);c.mimeType=_.hk(b.mimeType);if(a===_.T||a===_.ik)c.label=_.hk(b.label),c.language=_.hk(b.language),c.originalLanguage=_.hk(b.originalLanguage);a===_.jk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.ik?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.hk(b.audioMimeType)):(c.kind=_.hk(b.kind),c.roles=b.roles);c.accessibility=a===_.jk||a===_.ik?(b.accessibility||[]).filter(function(d){return d.type===
|
|
76
|
+
a}):b.accessibility||[];return c};
|
|
77
|
+
ZC=function(a,b,c){var d=new _.pk(a===_.jk?""+b.videoId:a===_.ik?""+b.audioId:""+b.id,c);switch(a){case _.jk:d.codec=_.hk(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.ik:d.codec=_.hk(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.hk(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.O.ka(e,
|
|
78
|
+
d,null,["id","track"])}))||c.renditions.push(d);return a||d};$C=function(a,b){var c=a.reduce(function(d,e){b===_.jk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.ik&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};aD=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};
|
|
79
|
+
bD=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};_.cD=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};dD=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}};eD=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
80
|
+
gD=function(a,b){try{if(1===a.length)return a[0];if(!a.every(fD))throw new _.yi("Period durations must be finite");if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)var c=a[0];else{for(var d=_.ah(a[0].periods).concat(),e=1;e<a.length;e++){var f=dD(a[e-1]).end;_.cD(a[e].periods,f);d.push.apply(d,_.ah(a[e].periods))}d={adaptedPeriods:d,periods:d,presentationTimeline:b,minBufferTime:0};var g=dD(d).end;_.cB(b.a,0,g);var h=a[0].presentationTimeline.nc();h&&_.fB(b,h.seekRangeStartDateTime);
|
|
81
|
+
c=d}return c}catch(l){throw new _.P(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",l);}};hD=function(a,b){var c=b.periods[0].configurationId,d=_.ah(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={adaptedPeriods:d,periods:d,presentationTimeline:e,minBufferTime:0};_.gB(e,b.presentationTimeline.o);return gD([d,b],e)};fD=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
82
|
+
iD=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};jD=function(a,b){return a.h.filter(function(c){return c.type===b})};kD=function(a,b){var c=a.a.get(b)||null;return c&&c.track};mD=function(a,b,c){if(!c||kD(a,c.type)!==c||a.m.pa())switch(b){case _.jk:a.Ya(c&&c.renditions[0]);break;case _.ik:a.hb(c&&c.renditions[0]);break;case _.T:a.ib(c&&c.renditions[0]);break;default:lD(a,b,c&&c.renditions[0])}};
|
|
83
|
+
nD=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)};
|
|
84
|
+
lD=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.pa())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.T){var f=e.ha().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),nD(a,c),e.trigger(new _.L(_.Ol)),oD(e,!0).then(function(){pD(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
85
|
+
n)}))}else if(b===_.ik)a.f.set(b,c),qD(e,parseInt(c.id,10));else if(b===_.jk){var g=a.a.get(_.ik)||null,h=null;if(g){var l=rD(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=
|
|
86
|
+
rD(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),sD(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ha+b),(h=kD(a,b))&&(b===_.T?oD(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.Ol))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.ik?a.g.info("Enabling ABR for audio is not supported"):b===_.jk&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):sD(e,null,d))}};
|
|
87
|
+
vD=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.t(Object.values(_.Xu)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.t(a.m.ha());for(var e=d.next();!e.done;c={ec:c.ec},e=d.next()){e=e.value;c.ec=YC(_.T,e);var f=b.find(function(h){return function(l){return h.ec.ka(l)}}(c));c.ec=f||c.ec;var g=ZC(_.T,e,c.ec);e.active&&a.a.set(_.T,g);f||b.push(c.ec)}tD(a.m)||a.a.set(_.T,null);c=rD(a.m);uD(a,b,c,_.jk);uD(a,b,c,_.ik);
|
|
88
|
+
a.h=b}};uD=function(a,b,c,d){var e=$C(c,d);c={};e=_.t(e);for(var f=e.next();!f.done;c={fc:c.fc},f=e.next()){f=f.value;c.fc=YC(d,f);var g=b.find(function(l){return function(m){return l.fc.ka(m)}}(c));c.fc=g||c.fc;var h=ZC(d,f,c.fc);f.active&&a.a.set(d,h);g||b.push(c.fc)}};
|
|
89
|
+
wD=function(a,b,c){if(b){a.h.length||vD(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.t(jD(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&&(nD(a,f),d===_.ik?a.m.trigger(new _.L(_.Nl)):d===_.jk&&a.m.trigger(new _.L(_.Jg,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};xD=function(){this.f=new _.YA(2);this.h=new _.YA(5);this.a=0};
|
|
90
|
+
_.yD=function(){this.g=new _.K("clpp.abr");this.w=null;this.f=!1;this.o=new xD;this.l=[];this.j=1;this.D=this.B=!1;this.A=this.a=this.h=null};zD=function(a,b){a&&(b=b.filter(function(c){return c.video&&c.video.trickPlay?!1:OC(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})};AD=function(){this.a=null};CD=function(a,b){if(b&&(null==a.a||a.a!==b))throw BD(a);};
|
|
91
|
+
BD=function(a){return new _.P(_.Q,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};DD=function(){this.a=new Map};FD=function(a,b){a.a.has(b)||a.a.set(b,new ED);return a.a.get(b)};ED=function(){this.text=this.variant=null};GD=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.t(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
92
|
+
JD=function(a,b){var c;if(!(c=!!a.audio!==!!b.audio||!!a.video!==!!b.video||a.language!==b.language)&&(c=a.audio&&b.audio)){c=a.audio;var d=b.audio;c=!(c.channelsCount===d.channelsCount&&HD(c,d)&&ID(c.roles,d.roles))}!c&&(c=a.video&&b.video)&&(c=a.video,d=b.video,c=!(HD(c,d)&&ID(c.roles,d.roles)));return c?!1:!0};
|
|
93
|
+
HD=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=a.codecs.split(",").map(function(f){return _.KA(f)[0]}),d=b.codecs.split(",").map(function(f){return _.KA(f)[0]});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};ID=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Me);d["delete"](_.Me);if(c.size!==d.size)return!1;c=_.t(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
94
|
+
LD=function(a){this.a=a;this.f=new KD(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1)};KD=function(a,b,c,d){this.h=_.gi(a);this.a=b;this.f=c;this.j=void 0===d?!1:d};MD=function(a,b){var c=null;b.some(function(d){c=_.GA(_.dj(d),a.map(function(e){return FA(e)}));return!!c});return c?a.filter(function(d){return c===FA(d)}):[]};ND=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)})};
|
|
95
|
+
OD=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};RD=function(a,b){this.a=PD;this.f=(new Map).set(PD,b).set(QD,a)};
|
|
96
|
+
TD=function(a){var b=this;this.C=a;this.a=a.getConfiguration().streaming;this.f=new _.Sh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");SD(this)&&(a=this.C.getSurface().getMedia(),this.f.on(a,_.rg,function(){var c=b.C.getPosition(),d=b.C.getSeekRange().end;c=d-c;var e=b.C.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.C.setPlaybackRate(1),b.C.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
97
|
+
b.C.setPlaybackRate(b.a.chasingRate,_.Yd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.C.setPlaybackRate(1))}))};
|
|
98
|
+
SD=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};UD=function(a){this.h=a;this.a=null;this.f=function(){}};VD=function(a,b){a.f=b};
|
|
99
|
+
WD=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.gh();this.w=_.Yd;this.j=null;this.a=new _.Vk(function(){b.A||b.f.ml(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};XD=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
100
|
+
$D=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Yd||0===c||1===c)try{YD(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),ZD(a)}else ZD(a)};ZD=function(a){a.g.debug(Vz,a.h,' using "seek" mode.');YD(a,0);a.o=!0;a.a.kb(.25)};YD=function(a,b){if(a.f.gh()!==b){a.g.debug(Vz,b,' using native playbackRate "decoder" mode.');try{a.f.Jm(b)}catch(c){throw c;}}};
|
|
101
|
+
bE=function(a){function b(){d=!0}function c(m){f.push(m);_.Qm(m)}a=_.lj(a);var d=!1,e,f=[],g=[];(new _.Pm).M(_.Te,c).M(_.sg,c).M(_.Oe,c).M(_.Se,c).M(_.gg,c).Y(_.ig,function(m){e=m;f.push(m);_.Rm(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,bd:1701733238})}).Y("avc3",function(m){g.push({M:m,bd:1701733238})}).Y("ac-3",function(m){g.push({M:m,bd:1701733217})}).Y(_.ne,function(m){g.push({M:m,bd:1701733217})}).Y("mp4a",function(m){g.push({M:m,bd:1701733217})}).parse(a);if(d)return _.Gh("Init segment already indicates encryption."),
|
|
102
|
+
a;if(0===g.length||!e)throw _.Ih("Failed to find boxes needed to fake encryption!"),_.Ih("Failed init segment (hex):",_.zj(a)),new _.P(_.Q,3,14E3);g.reverse();for(var h=_.t(g),l=h.next();!l.done;l=h.next())l=l.value,_.Gh('Inserting "'+_.Um(l.bd)+'" box into init segment.'),a=aE(a,e,l.M,f,l.bd);return a};
|
|
103
|
+
aE=function(a,b,c,d,e){var f=cE.value(),g=a.subarray(c.start,c.start+c.size),h=_.sj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.sj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);dE(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.Yk("Xbox One")||_.Xk()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.t(d);for(d=a.next();!d.done;d=a.next())d=d.value,dE(e,d.start,d.size+l.byteLength);l=_.sj(e,
|
|
104
|
+
b.start);b=_.Vm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};dE=function(a,b,c){a=_.sj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.eE=function(a,b){this.C=b;this.j=a;this.h=null;this.w=1;this.G=Promise.resolve();this.l=[];this.o=new Map;this.a=new Map;this.I=this.f=this.A=this.B=!1;this.H=0;this.g=new _.K("clpp.mse.Streaming");this.D=!1};gE=function(a){var b=a.a.get(_.Fg);return b?fE(a)[b.Gb]:(b=a.a.get(_.bd))?fE(a)[b.Gb]:null};
|
|
105
|
+
iE=function(a){return _.hE(a,_.bd)};jE=function(a){return _.hE(a,_.Fg)};
|
|
106
|
+
oE=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.E(function(q){switch(q.a){case 1:return c=_.Ip,_.x(q,a.C.W.clear(c.TEXT),2);case 2:return a.H++,a.I=!1,d=a.H,e=a.C.W,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.x(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.x(q,kE(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;a.H!==d||a.a.has(c.TEXT)||a.I||!l||(m=a.C.Db(),n=lE(a,m),p=mE(b,n,0),a.a.set(c.TEXT,p),nE(a,p,0));
|
|
107
|
+
_.y(q)}})};rE=function(a){a.I=!0;var b=a.a.get(_.Ri);b&&(pE(b),qE(b)["catch"](function(){}),a.a["delete"](_.Ri))};tE=function(a,b,c,d){b.video&&_.sE(a,b.video,c,d);b.audio&&_.sE(a,b.audio,c,d)};vE=function(a,b){a.j.adaptedPeriods=b.adaptedPeriods;a.j.periods=b.periods;uE(a)};
|
|
108
|
+
xE=function(a){function b(l){return a.C.W.qc(l,c,0)}var c=a.C.Db(),d=!1,e=lE(a,c);if(_.ij(a.a.values(),function(l){return l.Gb===e}))for(var f=_.t(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)||(wE(a,h),d=!0)}else if(!_.ij(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.t(a.a.values());for(f=d.next();!f.done;f=d.next())wE(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
109
|
+
c)};AE=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.A)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.t(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=yE(d);if(d.Wc||b&&zE(d))a.g.info(e,"Retrying after failure..."),d.Wc=!1,nE(a,d,.1)}};BE=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.$a})};
|
|
110
|
+
CE=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};EE=function(a){var b,c,d,e;return _.E(function(f){b=[];c=_.t(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,pE(e),e.fb&&e.Ib&&(e.fb=!1,b.push(e.Ib.abort())),e.Mb&&b.push(DE(a,e,!0,0));return _.x(f,Promise.all(b),0)})};FE=function(a,b,c){(a=a.a.get(b))&&c&&(pE(a),a.stream=c,a.Yb=c,a.ua&&(a.ua=c.getSegmentReference(a.ua.position)),a.ua||(a.Yb=null))};
|
|
111
|
+
_.hE=function(a,b){var c=a.a.get(b);return c?c.ac||c.stream:null};
|
|
112
|
+
_.sE=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.Ri&&a.h.ignoreTextStreamFailures)oE(a,b);else if(e){var f=VA(fE(a),b);if(c&&f!==e.Gb)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.t(a.a.values()),c=b.next();!c.done;c=b.next())wE(a,c.value);else{e.ac&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.ac=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.ac=null,a.g.debug("switch found no special trick play stream")));
|
|
113
|
+
var g=a.l[f];if(g&&g.ed&&(g=a.o.get(b.id))&&g.ed)if(e.stream!==b){g=a.j.presentationTimeline.getDuration();var h=a.C.Db();h=GE(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(mA+yE(e)+" already buffered to the end. Not switching."):(b.type===_.Ri&&tC(a.C.W,_.Rk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Ud=!0,a.g.debug("switch: switching to Stream "+yE(e)),HE(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Ib.abort()),c&&(e.hc?e.Ne=!0:e.fb?(e.Mb=!0,e.me=d,e.Ne=
|
|
114
|
+
!0):(pE(e),DE(a,e,!0,d)["catch"](function(l){if(a.C)a.C.onError(l)}))))}else a.g.debug(mA+yE(e)+" already active")}}};HE=function(a,b,c){if(!b.Ib)return!1;var d=a.C.Db(),e=a.C.W.Ea(b.type);c=(c=IE(a,b,d,e,c))?c.Ed():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Ed()||0);f=a.C.uf().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Ib;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
115
|
+
wE=function(a,b){var c=yE(b);b.hc?a.g.debug(c,"clear: already clearing the buffer"):b.Mb?a.g.debug(c,"clear: already waiting"):b.fb?(a.g.debug(c,"clear: currently updating"),b.Mb=!0,b.me=0):null==a.C.W.xb(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.$a&&nE(a,b,0)):(a.g.debug(c,"clear: handling right now"),pE(b),DE(a,b,!1,0)["catch"](function(d){if(a.C)a.C.onError(d)}))};
|
|
116
|
+
JE=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.E(function(q){if(1==q.a)return f=a.C.Db(),g=lE(a,f),h=_.Ip,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.C.W,p=a.h.forceNativeTS,_.x(q,n.init(l,p,a.h.disableAudioTracks),2);if(3!=q.a){if(a.f)return q["return"]();uE(a);return _.x(q,kE(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,v){if(!a.a.has(v)){var z=mE(u,g,e);a.a.set(v,z);nE(a,z,0)}});_.y(q)})};
|
|
117
|
+
mE=function(a,b,c){return{stream:a,type:a.type,Yb:null,segmentIterator:null,ua:null,ac:null,Ud:!0,Gb:b,endOfStream:!1,fb:!1,$a:null,Mb:!1,me:0,Ne:!1,hc:!1,Tf:!1,Wc:!1,bi:c||0,Ib:null,pe:!1,xh:0}};
|
|
118
|
+
KE=function(a,b){var c=a.l[b];if(c)return a.g.debug("(all) Period "+b+Iz),c.P;a.g.debug("(all) setting up Period "+b);c={P:new _.Oj,ed:!1};a.l[b]=c;for(var d=new Set,e=_.t(fE(a)[b].variants),f=e.next();!f.done;f=e.next())f=f.value,f.video&&d.add(f.video),f.video&&f.video.trickModeVideo&&d.add(f.video.trickModeVideo),f.audio&&d.add(f.audio);e=_.t(fE(a)[b].textStreams);for(f=e.next();!f.done;f=e.next())d.add(f.value);a.G=a.G.then(function(){return a.f?null:kE(a,d)}).then(function(){a.f||(a.l[b].P.resolve(),
|
|
119
|
+
a.l[b].ed=!0,a.g.debug("(all) setup Period "+b))})["catch"](function(g){a.f||(a.l[b].P["catch"](function(){}),a.l[b].P.reject(),delete a.l[b],a.g.warn("(all) failed to setup Period "+b),a.C.onError(g))});return c.P};
|
|
120
|
+
kE=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u;return _.E(function(v){switch(v.a){case 1:c=[];d=_.t(b);for(e=d.next();!e.done;e=d.next())f=e.value,(g=a.o.get(f.id))?(a.g.debug("(all) Stream "+f.id+Iz),c.push(g.P)):(a.g.debug("(all) setting up Stream "+f.id),a.o.set(f.id,{P:new _.Oj,ed:!1}),h=a.C.tb,c.push(f.createSegmentIndex(h)));_.A(v,2);return _.x(v,Promise.all(c),4);case 4:if(a.f)return v["return"]();_.oh(v,3);break;case 2:l=_.C(v);if(a.f)return v["return"]();m=_.t(b);for(e=m.next();!e.done;e=m.next())n=
|
|
121
|
+
e.value,a.o.get(n.id).P["catch"](function(){}),a.o.get(n.id).P.reject(),a.o["delete"](n.id);throw l;case 3:p=_.t(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.ed||(u.P.resolve(),u.ed=!0,a.g.debug("(all) setup Stream "+q.id));_.y(v)}})};uE=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?FC(a.C.W,b):FC(a.C.W,Math.pow(2,32))};
|
|
122
|
+
NE=function(a,b){function c(p){return p.type===_.Ri&&p.stream.mimeType===_.Tc}if(c(b))return AC(a.C.W,b.stream.originalId||""),null;b.type===_.Ri&&BC(a.C.W);if(!sC(a.C.W)&&b.type!==_.Ri)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=yE(b),e=a.C.Db(),f=GE(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=VA(fE(a),b.stream),h=lE(a,f),l=a.C.W.La(b.type,e);a.g.debug(d,"update_:",hA+e,"bufferedAhead\x3d"+l);var m=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*
|
|
123
|
+
a.w,n=hB(a.j.presentationTimeline);if(null!=n&&f>=n&&!b.pe)return LE(a,b),null;b.endOfStream=!1;b.Gb=h;if(h!==g)return a.g.debug(d,"need Period "+h,hA+e,"timeNeeded\x3d"+f,"currentPeriodIndex\x3d"+g),null;if(l>=m)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;h=a.C.W.Ea(b.type);h=IE(a,b,e,h,g);if(!h)return a.j.presentationTimeline.isLive()||b.type===_.Ri?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),LE(a,b),null);
|
|
124
|
+
d=Infinity;l=_.t(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=GE(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.bi=0;ME(a,b,e,g,h)["catch"](function(){});return null};LE=function(a,b){a.g.debug(yE(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Fg){var c=a.a.get(_.Ri);c&&c.stream.mimeType===_.Tc&&(c.endOfStream=!0)}};
|
|
125
|
+
GE=function(a,b,c){if(!b.Yb||!b.ua)return Math.max(c,b.bi);c=VA(fE(a),b.Yb);return fE(a)[c].startTime+b.ua.endTime};
|
|
126
|
+
IE=function(a,b,c,d,e){if(b.stream.segmentLookupStrategy===OE)b.stream.segmentIterator?a=zB(b.stream.segmentIterator):b.ua||d?(c=b.ua?b.ua.endTime:d,a.g.info(Oz,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=DB(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(Oz,$z,"endTime:",c,b.ua)),a=e):(e=Math.max(c,0),a.g.info(Oz,"looking up segment","lookupTime:",e,gA,c),d=null,d||(b.stream.segmentIterator=DB(b.stream.segmentIndex,
|
|
127
|
+
c),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(Oz,$z,"lookupTime:",e,gA,c),a=d);else{var f=yE(b);if(b.ua&&b.stream===b.Yb)c=b.ua.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=PE(a,b,e,c);else{if(b.ua){a.g.debug(f,"next position unknown: another Stream buffered");f=VA(fE(a),b.Yb);var g=QE(a,b,fE(a)[f].startTime+b.ua.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=QE(a,b,d||c,e);if(null==g)a=null;else if(f=PE(a,b,e,g),null==f)a=null;else{var h=
|
|
128
|
+
null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.wa+d.startTime+2>c&&(a=PE(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};QE=function(a,b,c,d){var e=yE(b);d=fE(a)[d];var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",hA+c,"lookupTime\x3d"+f,bA+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",bA+d.startTime,"lookupTime\x3d"+f);return b};
|
|
129
|
+
PE=function(a,b,c,d){var e=yE(b);c=fE(a)[c];var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",bA+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.nB(g);g=mB(g);return!b.pe&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",bA+c.startTime,kA+f.startTime,iA+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
130
|
+
ME=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,B,I;return _.E(function(F){f=_.Ip;g=yE(b);h=fE(a)[d];a.g.debug(g,"fetchAndAppend_:",hA+c,bA+h.startTime,jA+e.position,kA+e.startTime,iA+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=fE(a)[d+1];q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=RE(a,b,d,q,u,e);b.fb=!0;b.Ud=!1;a.g.debug(g,"fetching segment");z=!1;B=function(D,G){if(a.f||a.A)return null;z=!0;return SE(a,b,c,h,l,e,D,G)};I=a.C.W.Ea(b.type)||
|
|
131
|
+
0;v.then(function(){return a.f||a.A?null:TE(a,b,e,!1,function(D){return B(D.data,!0)})}).then(function(D){return a.f||a.A?null:z||null===D?(UE(a,b,I,e,l),null):B(D,!1)}).then(function(){if(!a.f&&!a.A){UE(a,b,I,e,l);b.fb=!1;b.Tf=!1;b.Mb||a.C.Ee();if(m){var D=m.next().value;D&&a.g.debug("New iterated segment",D)}nE(a,b,0);VE(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.E(function(G){if(a.f||a.A)return G["return"]();b.fb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
132
|
+
D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),G.F(0);if(7001===D.code)return b.fb=!1,b.$a=null,nE(a,b,0),G.F(0);if(3017===D.code)return WE(a,b,D),G.F(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",jA+e.position,kA+e.startTime,iA+e.endTime,"error\x3d"+D),b.fb=!1,b.$a=null,nE(a,b,1),G.F(0);if(b.type===f.TEXT)return D instanceof
|
|
133
|
+
_.P&&D.a(1),pE(b),a.C.onError(new _.P(1,2,2010,D)),G.F(0);if(1001<=D.code&&1003>=D.code)return _.x(G,XE(a,b,h,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.Wc=!0;D instanceof _.P&&D.a(_.Q);return _.x(G,YE(a,D),0)})});_.y(F)})};
|
|
134
|
+
WE=function(a,b,c){var d=yE(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Tf}))a.g.debug(d,Qz,"waiting for another stream to recover...");else{var e=Math.round(100*a.w);if(20<e)a.w-=.2;else if(4<e)a.w-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.Wc=!0;a.A=!0;a.C.onError(c);return}a.g.warn(d,Qz,"reducing buffering goals by "+(100-Math.round(100*a.w))+"%");b.Tf=!0}nE(a,b,4)};
|
|
135
|
+
XE=function(a,b,c,d){var e,f;return _.E(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.C.ef(b.stream,c));if(!f)return g.F(0);b.Wc=!0;d.a(_.Q);return _.x(g,YE(a,d),0)})};
|
|
136
|
+
RE=function(a,b,c,d,e,f){c=fE(a)[c].startTime-f.wa;if(!b.Ud&&c===b.xh)return Promise.resolve();b.xh=c;var g=yE(b);a.g.debug(g,"setting timestamp offset to "+c);a.g.debug(g,"setting append window start to "+d);a.g.debug(g,"setting append window end to "+e);d=DC(a.C.W,b.type,c,d,e);if(!b.stream.initSegmentReference||!b.Ud)return d;a.g.debug(g,"fetching init segment");e=TE(a,b,b.stream.initSegmentReference,!0).then(function(h){if(a.f)return null;a.g.debug(g,"appending init segment");return ZE(a,h,b).then(function(){return zC(a.C.W,
|
|
137
|
+
b.type,h,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(h){b.Ud=!0;return Promise.reject(h)});return Promise.all([d,e])};ZE=function(a,b,c){var d;return _.E(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.Xk())return e.F(0);d=bE(b);return _.x(e,zC(a.C.W,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
138
|
+
SE=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z,B;return _.E(function(I){switch(I.a){case 1:l=yE(b);if(!(e&&e.keyId&&a.C.vd)){I.F(2);break}m=uA(a.C.vd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);I.F(2);break}_.A(I,4);return _.x(I,m,6);case 6:_.oh(I,2);break;case 4:n=_.C(I),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.C.vd&&wA(a.C.vd,e.keyId))){I.F(7);break}pE(b);p=VA(fE(a),e);q=$E(a,p);if(!q){I.F(8);break}return _.x(I,q,8);case 8:return u=
|
|
139
|
+
a.C.ef(e,d,dA),v=f.startTime+d.startTime,z=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+v+" - "+z+": "+u+". Stream with Key ID "+(e.keyId+" has restrictions.")),I["return"](Promise.resolve());case 7:return B=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Pm).Y("emsg",a.gm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),I["return"](aF(a,b,c).then(function(){if(a.f)return null;var F=f.startTime+d.startTime,D=f.endTime+d.startTime;a.g.debug(l,
|
|
140
|
+
"Appending segment with "+(F.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.df(e.bandwidth)+" Fragment: ")+h);return zC(a.C.W,b.type,g,F,D,B,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.Yb=e,b.ua=f)}))}})};
|
|
141
|
+
UE=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Ri){var f=yE(b),g=(a.C.W.Ea(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.pe=!0,a=fE(a),e.adjustSegmentDurations(d.position,c),d=VA(a,e),b=a[d],e=e.getDuration(),XA(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
142
|
+
bF=function(a,b,c){(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.gg,_.Qm).Y(_.ig,_.Rm).M("encv",function(d){d.reader.skip(78);_.Qm(d)}).M(_.bg,_.Qm).M("schi",_.Qm).M("tenc",function(d){d.reader.skip(6);if(_.Hm(d.reader)){d.reader.skip(1);var e=_.zj(_.Mm(d.reader,16));e!==b.stream.keyId&&(a.g.debug(yE(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)};
|
|
143
|
+
aF=function(a,b,c){if(a.f)return Promise.resolve();var d=yE(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.C.W.xb(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",hA+c,Xz+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",hA+c,Yz+g,Xz+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",hA+c,Yz+g,Xz+e,"overflow\x3d"+h);return a.C.W.remove(b.type,
|
|
144
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};VE=function(a,b,c){if(!a.B){b=yE(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.Ri?a.B=d.every(function(e){return e.type===_.Ri||a.D?!0:!e.Mb&&!e.hc&&e.ua}):a.D&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=VA(fE(a),c),$E(a,c))}};
|
|
145
|
+
$E=function(a,b){var c=null;a.l[b]||(c=KE(a,b).then(function(){a.f||(a.g.debug(Zz),a.C.Gf())})["catch"](BA));for(var d=0;d<fE(a).length;++d)KE(a,d)["catch"](BA);a.C.am&&(a.g.debug("calling onStartupComplete()..."),a.C.am());return c};
|
|
146
|
+
cF=function(a,b){var c=yE(b),d=VA(fE(a),b.stream);if(b.Gb!==d){var e=b.Gb,f=Array.from(a.a.values());f.every(function(g){return g.Gb===e})?f.every(zE)?(a.g.debug(c,"all need Period "+e),KE(a,e).then(function(){if(!a.f)if(qC(a.C.W),f.every(function(n){var p=zE(n),q=VA(fE(a),n.stream);return p&&n.Gb===e&&q!==e})){var g=fE(a)[e];a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.C.Hf(g);a.D=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.Fg,
|
|
147
|
+
h.variant.video);h.variant&&h.variant.audio&&l.set(_.bd,h.variant.audio);h.text&&l.set(_.Ri,h.text);var m=_.t(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.Ri){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.C.onError(new _.P(_.Q,5,5005));return}m=_.t(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.Ri)JE(a,null,null,l.get(_.Ri),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");
|
|
148
|
+
a.C.onError(new _.P(_.Q,5,5005));return}g=_.t(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.sE(a,m,!1,0),nE(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,Zz);a.C.Gf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](BA)):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)}};
|
|
149
|
+
lE=function(a,b){var c=TA(fE(a),b+_.Qu);return c?fE(a).indexOf(c):0};
|
|
150
|
+
TE=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.aB(c.Qa(),c.va,c.ja,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Sc?null:e;f.disableFragmentSupport=c.Sc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){bF(a,b,g.data)}),b.type===_.Fg&&a.h.overridePasp&&f.responseModifiers.push(a.$m.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
151
|
+
c);c=a.C.tb.fetch(f);b.Ib=c;return c.P.then(function(g){var h=a.C.uf(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Ib=null;return g.data})};
|
|
152
|
+
DE=function(a,b,c,d){var e,f,g,h;return _.E(function(l){if(1==l.a)return e=yE(b),b.Mb=!1,b.Ne=!1,b.me=0,b.hc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.C.Db(),h=a.C.W.getDuration(),f=a.C.W.remove(b.type,g+d,h)):f=a.C.W.clear(b.type).then(function(){return!a.f&&c?a.C.W.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.Yb=null;b.ua=null;b.hc=!1;b.endOfStream=!1;b.pe=!1;nE(a,b,0);_.y(l)})};
|
|
153
|
+
nE=function(a,b,c){a.g.debug(yE(b),"updating in "+c+" seconds");b.$a=(new _.Tk(function(){var d;return _.E(function(e){if(1==e.a)return _.A(e,2),_.x(e,a.Hb(b),4);if(2!=e.a)return _.oh(e,0);d=_.C(e);if(a.C)a.C.onError(d);_.y(e)})})).da(c)};pE=function(a){null!=a.$a&&(a.$a.stop(),a.$a=null)};fE=function(a){return a.j.adaptedPeriods||a.j.periods};qE=function(a){return _.E(function(b){return a.Ib?_.x(b,a.Ib.abort(),0):b.F(0)})};
|
|
154
|
+
YE=function(a,b){var c;return _.E(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.C.ei){d.F(2);break}_.A(d,3);return _.x(d,a.C.ei(b),5);case 5:_.oh(d,2);break;case 3:c=_.C(d),c.cause=b,b=c;case 2:if(!b.f)a.C.onError(b);_.y(d)}})};yE=function(a){return"("+a.type+":"+a.stream.id+")"};zE=function(a){return!a.fb&&null==a.$a&&!a.Mb&&!a.hc};dF=function(){this.a=null};
|
|
155
|
+
gF=function(){_.dm.call(this,aA);var a=this;this.G=eF;this.h=this.Ca=null;this.gg=0;this.ii=2;this.Rc=null;this.cg=!1;this.o=new _.Sh;this.Gc=this.ze=this.J=this.Lc=this.B=this.L=this.w=null;this.Kd=!1;this.V=this.l=this.f=this.A=this.a=this.I=this.K=null;this.mi=1E9;this.Be=new Set;this.fa=!0;this.Ka=null;this.ki=!1;this.ji=0;this.ia=null;this.T=new DD;this.li={width:Infinity,height:Infinity};this.H=null;this.gc=_.jp;this.Cc=new KD(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
156
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio);this.Bd=this.configuration.preferredTextLanguage;this.j=new AD;this.$=this.Kc=null;this.Mc=new Map;this.Ob=null;this.xe=this.configuration.preferredTextRole;this.yd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===fF&&AE(a.a)});this.Fe=this.Jc=this.He=null;this.ea=_.pa;this.Nd=new dF;this.Gd=[]};
|
|
157
|
+
hF=function(a){return new _.NA(function(b){if(void 0===b||null===b)return null;var c=a.getTrackManager(),d=[];if(c){c=_.t(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.ah(e.value.renditions))}return d.find(function(f){return f.id===b})||null})};
|
|
158
|
+
iF=function(a,b){if(a.gc!==b){var c=_.R.fk;if(a.gc===_.up&&b!==_.jp)c=c(b,_.sp),a.log.info(_.Sz+c);else{var d=a.gg;d=0===d?0:Date.now()-d;var e=a.gc;a.gc=b;a.gg=Date.now();null!==a.J&&(a.J.A=b===_.wp);a.H&&_.$o(a.H.a,a.gc);b===_.op&&(a.ii=a.Uf?1:2);var f=a.ii,g={currentState:a.gc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.op||e===_.op?f:void 0},h=c(e,_.sp),l=c(b,_.sp);c=b!==_.op?"":"["+c(f,_.rp)+"]";a.log.info(_.Nb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.eg,{detail:g}));(b===_.qp||b===
|
|
159
|
+
_.up)&&a.Gc&&a.Gc.stop();b===_.op?a.trigger(new _.L(_.md,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.op&&a.trigger(new _.L(_.ld,{detail:{bufferedTimeMS:d,reason:f}}))}}};jF=function(a){var b;return _.E(function(c){switch(c.a){case 1:b=a.j.a;a.j.a=null;if(!b){c.F(2);break}return _.x(c,b["catch"](function(){}),2);case 2:return _.x(c,_.dm.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:iF(a,_.jp),_.y(c)}})};
|
|
160
|
+
kF=function(a){var b=new _.xt;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};mF=function(a,b){var c,d;return _.E(function(e){a.ea===_.Jb&&(a.f=hD(a.f,eD(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,_.gB(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ie))),lF(a,a.f));_.y(e)})};
|
|
161
|
+
nF=function(a){return _.E(function(b){a.A.requestStop();a.A=null;a.ea===_.Jb?a.trigger(new _.L(_.Vf)):a.trigger(new _.L(_.Ie));_.y(b)})};
|
|
162
|
+
lF=function(a,b){var c=a.getMediaPosition(),d=a.Jc,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.t(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 _.wt(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));zA(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
163
|
+
0;d<f.length;d++)if(!f[d].ka(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.Wf));xB(a.Fe);oF(a)};oF=function(a){if(a.I&&0<a.Gd.length){a.Gd.forEach(function(c){var d=yA(a.Jc,c.configurationId);c.offset=d?d.pb():0});var b=a.Gd.sort(function(c,d){return(c.offset||0)-(d.offset||0)});uB(a.I,b);a.Gd=[]}};uF=function(a){var b,c;return _.E(function(d){if(1==d.a)return pF(a),_.x(d,qF(a),2);rF(a);b=_.Vj(4)||_.Vj(5);if(!b)return d.F(0);c=a.getSurface().getMedia();sF(a,c);return _.x(d,tF(a,c),0)})};
|
|
164
|
+
BF=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.E(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.Oj,a.j.a=e,_.A(l,2),pF(a),_.x(l,vF(a),4);case 4:return CD(a.j,e),a.Z=_.Bp(b),a.configuration=_.bm(a.Ic,b),a.log.info(_.wb,a.configuration),a.log.info(_.Mb,a.Z),_.x(l,wF(a,e),5);case 5:return CD(a.j,e),_.x(l,xF(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,CD(a.j,e),a.A=f.parser,a.f=f.manifest,g=a,_.x(l,yF(a,a.f,a.configuration.drm),7);case 7:g.w=l.f;CD(a.j,e);if(!c){l.F(8);
|
|
165
|
+
break}return _.x(l,zF(a,e),9);case 9:CD(a.j,e),a.o.one(a.h,_.Je,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.oh(l,0);break;case 2:h=_.C(l),AF(a,h,e),_.y(l)}})};AF=function(a,b,c){b=CF(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};CF=function(a,b,c){var d=a.j;return null!=d.a&&d.a===c||b instanceof _.P&&7E3===b.code?b instanceof _.P?b:new _.P(_.Q,7,7003,"Unexpected error.",b):BD(a.j)};vF=function(a){return a.Ca?a.Ca["catch"](function(){}):Promise.resolve()};
|
|
166
|
+
wF=function(a,b){var c;return _.E(function(d){if(1==d.a)return a.H=new _.ep,iF(a,_.vp),a.V=new _.au(a.getNetworkEngine()),AA(a.V,{enabled:a.configuration.abr.useCmsd}),c=DF(a,a.configuration),_.x(d,tF(a,c),2);CD(a.j,b);a.I=new rB;sB(a.I,function(e){EF(a,_.ci,e)});_.y(d)})};
|
|
167
|
+
xF=function(a,b,c,d,e){var f,g,h,l,m;return _.E(function(n){switch(n.a){case 1:return f=b,g=_.Bp(f),h=g[c],_.x(n,FF(a,h),2);case 2:return l=n.f,CD(a.j,d),_.Yn(eA),_.x(n,GF(a,l,h,f.id||""),3);case 3:m=n.f;CD(a.j,d);if(!e||!m.presentationTimeline.o){n.F(4);break}return _.x(n,l.stop(),5);case 5:CD(a.j,d);case 4:return _.Yn("manifest.end"),_.Zn("Fetch and parse manifest",eA,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
168
|
+
HF=function(a,b){var c,d,e;return _.E(function(f){if(1==f.a)return _.x(f,xF(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,eD(c.manifest)],e=gD(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.P(_.Q,7,7003,"Failed to append load manifest");}})};DF=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.O.R(b.volume)||a.setVolume(b.volume);_.O.R(b.muted)||a.setMuted(b.muted);sF(a,c);return c};
|
|
169
|
+
sF=function(a,b){a.h||(a.o.on(b,_.re,function(){if(a.h.error){var c=a.h.error.code;if(1===c)c=null;else{var d=a.h.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.P(_.Q,3,3016,{code:c,extendedError:d,message:a.h.error.message})}}else c=null;if(c)a.onError(c)}),a.h=b)};rF=function(a){a.h&&(a.o.off(a.h,_.re),a.h=null)};
|
|
170
|
+
qF=function(a){var b;return _.E(function(c){switch(c.a){case 1:a.G!==IF&&(a.G=eF);if(b=a.h)a.o.off(b,_.Je),a.o.off(b,_.zf),a.o.off(b,_.gf),a.o.off(b,_.qe),a.o.off(b,_.Mf),a.o.off(b,_.Kf);a.I&&(a.I.release(),a.I=null);a.Lc&&(a.Lc.release(),a.Lc=null);a.Gc&&(a.Gc.stop(),a.Gc=null);if(!a.A){c.F(2);break}return _.x(c,a.A.stop(),3);case 3:a.A=null;case 2:a.l&&(a.l.stop(),a.l=null);if(!a.a){c.F(4);break}return _.x(c,a.a.destroy(),5);case 5:a.a=null;case 4:a.B&&(a.B.release(),a.B=null);a.J&&(a.J.release(),
|
|
171
|
+
a.J=null);if(!a.L){c.F(6);break}return _.x(c,a.L.destroy(),7);case 7:a.L=null;case 6:a.Rc&&(a.Rc.release(),a.Rc=null);a.ze&&(a.ze.release(),a.ze=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(8);break}return _.x(c,a.w.destroy(),9);case 9:a.w=null;case 8:a.V&&(a.V.release(),a.V=null),a.T.clear(),a.K=null,a.Be.clear(),a.f=null,a.H=null,a.fa=!0,a.Mc.clear(),a.Kd=!1,a.configuration=a.Ic,JF(a),_.y(c)}})};
|
|
172
|
+
tF=function(a,b){var c,d,e,f,g;return _.E(function(h){if(1==h.a)return c=window.muxjs?new kC:new _.lC,d=_.Yo(a.configuration,[_.xe,"single-native"]),e=d.create(a),f=hF(a),f.track(a),a.Rc=f,g=new _.nC(b,c,e,f,a.configuration),_.x(h,g.open(),2);a.L=g;_.y(h)})};FF=function(a,b){var c,d;return _.E(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.zt(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
173
|
+
GF=function(a,b,c,d){return(new _.Pj(Promise.resolve().then(function(){var e,f,g;return _.E(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.A(h,4);var l=c.url;var m=KF(a,d);l=b.start(l,m);return _.x(h,l,6);case 6:e=h.f;_.oh(h,2);break;case 4:f=_.C(h);if(!a.Hc)throw f;return _.x(h,a.Hc(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.P(_.Q,4,4014);LF(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
174
|
+
return b.stop()})).P};
|
|
175
|
+
yF=function(a,b,c){var d,e,f,g,h,l;return _.E(function(m){switch(m.a){case 1:_.Yn("initDrm.start");d=new _.eo({tb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Kf:function(n){if(a.a){var p=MF(a),q=!1,u=Object.keys(n);0===u.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===u.length&&"00"===u[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.");
|
|
176
|
+
if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var B=u[z],I=_.t(B.variants),F=I.next();!F.done;F=I.next()){F=F.value;var D=[];F.audio&&D.push(F.audio);F.video&&D.push(F.video);D=_.t(D);for(var G=D.next();!G.done;G=D.next()){G=G.value;var M=F.allowedByKeySystem;if(G.keyId){var N=n[v?"00":G.keyId];N=!!N&&!NF.includes(N);F.allowedByKeySystem=N}M!==F.allowedByKeySystem&&(N=G.type,G.type===_.Fg&&(N="video "+G.width+"x"+G.height+"@"+_.R.df(G.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
177
|
+
(G.keyId+"'. Applying restrictions to "+N)));B===p&&M!==F.allowedByKeySystem&&(q=!0)}}}if(n=gE(a.a)){v=iE(a.a);u=jE(a.a);a:{z=n.variants;for(B=0;B<z.length;B++)if(z[B].audio===v&&z[B].video===u){v=z[B];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(Nz),OF(a),PF(a,n.variants)}q&&n!==p&&(a.log.info(Nz),OF(a),PF(a,p.variants))}},Jf:function(n,p){a.trigger(new _.L(_.he,{expirationTime:p}))},onEvent:function(n){return a.lf(n)},getConfiguration:function(){return a.getConfiguration()},Vc:function(){return a.Vc()}});
|
|
178
|
+
e=_.xm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.qt(b.periods);if(!f){m.F(2);break}l=_.fm(_.hf);if(!l){m.F(2);break}return _.x(m,l.l(a,h),4);case 4:return _.x(m,l.j(f),5);case 5:g=m.f;case 2:return _.x(m,_.jo(d,h,g),6);case 6:return a.w=d,QF(a,b.periods),_.Yn("initDrm.end"),_.Zn("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
179
|
+
zF=function(a,b){var c,d,e,f,g,h,l,m,n,p,q;return _.E(function(u){if(1==u.a)return c=a.h,RF(a,c),SF(a,a.f.periods),a.Cc=new KD(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio),a.Bd=a.configuration.preferredTextLanguage,a.xe=a.configuration.preferredTextRole,a.yd=a.configuration.preferForcedSubtitles,_.x(u,_.wo(a.w,c),2);if(3!=u.a)return CD(a.j,b),d=new _.yD,d.configure(a.configuration.abr),
|
|
180
|
+
a.l=d,null!==a.V&&d.setCmsdManager(a.V),d.init(function(v,z,B){!a.fa&&TF(a,v,z,B)}),a.B=UF(a,c,a.configuration.startTime),a.Lc=VF(a),a.J=new WD({gh:function(){return c.playbackRate},Jm:function(v){c.playbackRate=v},ml:function(v){c.currentTime+=v}}),XD(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.ze=new TD(a)),e=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),WF(a,e),NC(a.f,_.gi(a.configuration.preferredVideoCodec),_.gi(a.configuration.preferredAudioCodec),
|
|
181
|
+
a.configuration.preferredAudioChannelCount),f=XF(a),f.h=a.configuration.streaming,a.a=f,a.G=fF,_.x(u,f.start(),3);CD(a.j,b);a.configuration.streaming.startAtSegmentBoundary&&(g=XB(a.B),h=YF(a,g),QB(a.B.f,h));l=_.t(a.f.periods);for(m=l.next();!m.done;m=l.next())n=m.value,ZF(a,n);OF(a);p=MF(a)||a.f.periods[0];q=p.variants.some(function(v){return v.primary});a.configuration.preferredAudioLanguage||q||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");PF(a,
|
|
182
|
+
p.variants);_.y(u)})};RF=function(a,b){function c(d){a.h&&a.K&&(d.type===_.Yf&&a.Od?(a.K.a=QD,JF(a)):d.type===_.Ng&&a.getState()===_.xp&&.1>a.getBufferInfo().La(a.getMediaPosition())?(a.K.a=QD,JF(a)):a.K&&$F(a));aG(a)}a.o.on(b,_.zf,c);a.o.on(b,_.gf,c);a.o.on(b,_.qe,c);a.o.on(b,_.Yf,c);a.o.on(b,_.Xf,c);a.o.on(b,_.Kf,c);a.o.on(b,_.Ng,c);a.o.on(b,_.Mf,function(){if(a.h){var d=a.h.playbackRate;0!==d&&a.J.set(d)}})};
|
|
183
|
+
LF=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)})){_.Hh("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.t(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};UF=function(a,b,c){return new VB(b,a.f,a.configuration.streaming,c,function(d){a.Lc&&ZB(a.Lc,!0,d);a.a&&xE(a.a)},function(d){return a.dispatchEvent(d)},a.ea===_.Jb)};
|
|
184
|
+
VF=function(a){var b=new $B(a.h),c=new UD(a.f);VD(c,function(){OF(a)});b.a.add(c);a.I&&(c=new bC(a.I),cC(c,function(d){d.De&&d.De();EF(a,_.ei,d)},function(d){d.If&&d.If();EF(a,_.fi,d)},function(d,e){e||(d.De&&d.De(),EF(a,_.ei,d),d.If&&d.If(),EF(a,_.fi,d))}),b.a.add(c));a.ea===_.Jb&&(c=new wB(a.Jc,a.Nd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Fe=c);return b};WF=function(a,b){a.K=new RD(b,Math.min(.5,b/2));a.K.a=QD;JF(a);a.Gc=(new _.Vk(function(){$F(a)})).kb(.25)};
|
|
185
|
+
$F=function(a){switch(a.G){case fF:a:if(a.h.ended||uC(a.L))var b=!0;else{if(a.isLive()){b=mB(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Ea(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=wC(a.L);c=d.video;d=d.audio;var e=a.h.currentTime;c&&d?(c=c.La(e),d=d.La(e),c=Math.min(c,d)):c=c?c.La(e):d?d.La(e):0}else c=0;if(d=a.K){d=a.K;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?PD:QD;d.a=c;d=e!==c}c=d;d=bG(a);c||a.getState()===_.op&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
186
|
+
d,"buffered to end",b,"state",a.getState()),JF(a)):a.Kd&&aG(a)};XF=function(a){var b={configuration:{bl:a.ea===_.Jb},Db:function(){return XB(a.B)},W:a.L,tb:a.getNetworkEngine(),Hf:a.xj.bind(a),Gf:a.wj.bind(a),onError:a.onError.bind(a),Fh:a.Jl.bind(a),onEvent:a.lf.bind(a),Jh:a.Zm.bind(a),Ee:a.Wl.bind(a),uf:function(){return a.l},ef:a.Ii.bind(a),ei:a.Qm.bind(a),vd:a.w};return new _.eE(a.f,b)};
|
|
187
|
+
rD=function(a){if(a.f&&a.B){var b=cG(a),c=[];a=_.t(dG(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=TC(d);e.active=d===b;c.push(e)}return c}return[]};pD=function(a,b){if(a.f&&a.a){var c=MF(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(eG(a,c,d,!1),fG(a,d),a.Bd=d.language,a.yd=d.kind===_.se):a.log.error(_.Rz,b.id)}};
|
|
188
|
+
sD=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=MF(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.l.disable();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.l.enable();a.$=null;c=PF(a,e.variants);null!=a.Ob&&(a.Cc=a.Ob,a.Ob=null);null==c||a.fa||TF(a,c);return}if(b){a.$=b.id;var f=e.variants.find(function(g){return g.id===
|
|
189
|
+
b.id});f?(a.$=f.video.id,VC(f)?(gG(a,e,f,!1),hG(a,f,c,d),null==a.Ob&&(a.Ob=a.Cc),a.Cc=new LD(f),PF(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.Ob&&(a.Cc=a.Ob,a.Ob=null),c=PF(a,e.variants),null==c||a.fa||TF(a,c)}};
|
|
190
|
+
qD=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=jE(a.a),d=iE(a.a),e=TA(a.f.periods,XB(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&VC(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().Ha();
|
|
191
|
+
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.Kc=d.id;a.l.setVariants(f);f=MF(a);gG(a,f,g,!1);e||a.fa?hG(a,g,!0,0):_.sE(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
192
|
+
tD=function(a){var b=a.cg;return a.f?a.L.getTextDisplayer().isTextVisible():b};oD=function(a,b){var c,d,e,f;return _.E(function(g){c=a.cg;d=b;if(c===d)return g["return"]();a.cg=d;if(a.G!==fF)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return rE(a.a),g.F(0);e=MF(a);f=_.XC(e.textStreams,a.Bd,a.xe,a.yd);return 0<f.length?_.x(g,oE(a.a,f[0]),0):g.F(0)})};
|
|
193
|
+
gG=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){wD(e,c.video,d);var g=e.ma();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(wD(e,c.audio,d),e=e.Oa(),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})))}FD(a.T,
|
|
194
|
+
b).variant=c};eG=function(a,b,c,d){FD(a.T,b).text=c;if(b=a.getTrackManager())wD(b,c,d),c=b.Ga(),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}))};iG=function(a){return a.ea===_.Jb&&"flat"===a.configuration.playlist.timeline};
|
|
195
|
+
SF=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.t(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=_.t(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.mi++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,wa:0,mimeType:_.Tc,codecs:"",kind:_.pd,encrypted:!1,
|
|
196
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Ri,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.t(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
197
|
+
QF=function(a,b){for(var c=a.a?iE(a.a):null,d=a.a?jE(a.a):null,e=_.t(b),f=e.next();!f.done;f=e.next())SC(a.w,c,d,f.value);c=HA(b,function(h){return h.variants.some(VC)});if(a.configuration.streaming.disableAudioTracks)for(d=_.t(b),e=d.next();!e.done;e=d.next())for(f=_.t(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.t(b),e=d.next();!e.done;e=d.next())for(f=_.t(e.value.variants),e=f.next();!e.done;e=f.next()){e=e.value;var g=
|
|
198
|
+
e.video;g&&!IA(g.type,_.Rk(g.mimeType,g.codecs))&&delete e.video}if(0===c)throw new _.P(_.Q,4,4032);if(c<b.length)throw new _.P(_.Q,4,4011);c=_.t(b);for(e=c.next();!e.done;e=c.next())d=e.value,PC(d.variants,a.configuration.restrictions,a.li)&&a.a&&MF(a)===d&&OF(a),jG(a,d.variants)};
|
|
199
|
+
ZF=function(a,b){var c=a.a?iE(a.a):null,d=a.a?jE(a.a):null;SC(a.w,c,d,b);d=b.variants;if(!d.some(VC))throw new _.P(_.Q,4,4011);jG(a,b.variants);PC(d,a.configuration.restrictions,a.li)&&a.a&&MF(a)===b&&OF(a);if(!_.Vj(2)&&(c=a.w?a.w.getDrmInfo():null)){d=_.t(d);for(var e=d.next();!e.done;e=d.next()){e=_.t(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===c.keySystem){f=_.t(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.zo(a.w,g.keyId,g.initData)||
|
|
200
|
+
_.qo(a.w,g.initDataType,g.initData,g.keyId)}}}};hG=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.fa?(a.Ka=b,a.ki=c,a.ji=d):tE(a.a,b,c,d)};fG=function(a,b){a.fa?a.ia=b:_.sE(a.a,b,!0,0)};kG=function(a){if(a.a&&a.f){var b=gE(a.a),c=MF(a);null!=b&&b===c&&(iE(a.a),jE(a.a),_.hE(a.a,_.Ri),FD(a.T,c),FD(a.T,c))}};
|
|
201
|
+
YF=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=iE(a.a),e=jE(a.a),f=MF(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};bG=function(a){return a.w&&a.w.D?!0:a.K?a.K.getState()===QD:!1};
|
|
202
|
+
JF=function(a){if(a.H&&a.K&&a.B){var b=lG(a)===_.op,c=a.J;c.l=b;$D(c,c.o?"seek":void 0);a.B.j.o=b;aG(a);a.Fe&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Fe,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Tf))))}};aG=function(a){iF(a,lG(a))};lG=function(a){if(a.Od)var b=!1;else if(a.h&&a.h.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Kd&&0<=c&&b<=c?!0:!1}return b?_.qp:bG(a)||a.Od?_.op:a.h&&a.h.paused?_.wp:_.xp};
|
|
203
|
+
PF=function(a,b){try{jG(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return VC(e)});c=aD(c,a.Kc);var d=a.Cc.create(c);d=Array.from(d.values());a.l.setVariants(d);if(null!==a.$&&null!==a.Kc&&(d=d.find(function(e){return e.video.id===a.$&&e.audio.id===a.Kc}),a.$=null,d))return d;if(a.configuration.abr.enabled||null===a.$)return a.l.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.$});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
204
|
+
a.l.chooseVariant())};mG=function(a,b){return _.XC(b,a.Bd,a.xe,a.yd)[0]||null};oG=function(a,b,c){c=void 0===c?!0:c;var d=PF(a,b.variants);a.Kc=d&&d.audio&&d.audio.id;d&&(gG(a,b,d,!0),hG(a,d,c));(c=mG(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||tD(a))&&(eG(a,b,c,!0),fG(a,c))};
|
|
205
|
+
LG=function(a,b){a.fa=!0;a.l.disable();a.log.debug("Choosing new streams after period changed");var c=PF(a,b.variants),d=mG(a,b.textStreams);a.Ka&&(b.variants.includes(a.Ka)&&(c=a.Ka),a.Ka=null);a.ia&&(b.textStreams.includes(a.ia)&&(d=a.ia),a.ia=null);c&&pG(a,b,function(){return gG(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||tD(a))&&pG(a,b,function(){return eG(a,b,d,!0)});b===MF(a)&&KG(a);return a.configuration.streaming.alwaysStreamText||tD(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
206
|
+
TF=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=MG(a,b);pG(a,e,function(){return gG(a,e,b,!0)});e===MF(a)&&KG(a);a.a&&tE(a.a,b,c,d)}};OF=function(a){var b=a.getTrackManager();b&&a.G!==IF&&(b.m&&(vD(b),b.m.trigger(new _.L(_.Zu))),KG(a))};KG=function(a){var b=MF(a);if(b){var c=a.Mc.get(b)||[];for(a.Mc["delete"](b);c.length;)c.shift()()}};pG=function(a,b,c){a.Mc.has(b)||a.Mc.set(b,[]);a.Mc.get(b).push(c)};
|
|
207
|
+
EF=function(a,b,c){a.trigger(new _.L(b,{detail:qB(c,iG(a))}))};
|
|
208
|
+
jG=function(a,b){var c=a.w?_.O.ng(a.w.fa):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.t(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=_.t(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?NF.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.P(_.Q,4,4012,{hasAppRestrictions:f,
|
|
209
|
+
missingKeys:g,restrictedKeyStatuses:h});};dG=function(a){var b=MF(a);if(null==b)return[];kG(a);return b.variants.filter(function(c){return VC(c)})};NG=function(a){var b=MF(a);if(null==b)return[];kG(a);return b.textStreams.filter(function(c){return!a.Be.has(c)})};MF=function(a){var b=XB(a.B),c=null;a=_.t(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};cG=function(a){var b=MF(a);return b&&FD(a.T,b).variant};
|
|
210
|
+
MG=function(a,b){for(var c=_.t(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};pF=function(a){if(a.G===IF)throw new _.P(_.Q,7,7E3,"Player is destroyed.");};
|
|
211
|
+
OG=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,u,v,z,B,I,F,D,G,M,N;return _.E(function(S){switch(S.a){case 1:return d=_.Ip,_.A(S,2),_.x(S,_.zt(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=S.f;e.configure(a.configuration.manifest);var oa=e;var Ba=b.url,$a=KF(a,a.configuration.id||"");oa=oa.start(Ba,$a);return _.x(S,oa,5);case 5:f=S.f;LF(f.periods);if(!f.periods.length)throw new _.P(_.Q,4,4014);return _.x(S,a.A.stop(),6);case 6:a.A=e;g=c.audio&&c.audio.id;
|
|
212
|
+
h=c.video&&c.video.id;a.f.periods=f.periods;l=TA(f.periods,XB(a.B))||f.periods[0];NC(a.f,_.gi(a.configuration.preferredVideoCodec),_.gi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=bD(g,h,l.variants);n=mG(a,l.textStreams);PF(a,l.variants);p=m&&m.video;q=m&&m.audio;u=[];v=new Set;z=_.t(l.variants);for(B=z.next();!B.done;B=z.next())I=B.value,I.video&&v.add(I.video),I.audio&&v.add(I.audio);F=a.getNetworkEngine();D=_.t(_.ah(v).concat(_.ah(l.textStreams)));for(G=D.next();!G.done;G=
|
|
213
|
+
D.next())M=G.value,u.push(M.createSegmentIndex(F));return _.x(S,Promise.all(u),7);case 7:FE(a.a,d.AUDIO,q);FE(a.a,d.VIDEO,p);FE(a.a,d.TEXT,n);m&&gG(a,l,m,!1);a.log.info("Switch CDN successful.");_.oh(S,0);break;case 2:N=_.C(S);if(!e){S.F(8);break}return _.x(S,e.stop(),8);case 8:throw N;}})};
|
|
214
|
+
KF=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return ZF(a,c)},filterAllPeriods:function(c){return QF(a,c)},onTimelineCueAdded:function(c){a.I&&(a.ea===_.Jb?a.Gd.push(c):tB(a.I,c))},onEvent:function(c){return a.lf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return mF(a,c)},onTurnedStatic:function(){return nF(a)}}};PG=function(){};
|
|
215
|
+
QG=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}};RG=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};SG=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
216
|
+
TG=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.KA(b)[0]&&a(b)}};
|
|
217
|
+
UG=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.t(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)}};
|
|
218
|
+
VG=function(a){_.Cu.call(this,a);a=a.getSurface().getMedia();this.a=null;for(var b=0;b<a.textTracks.length;++b){var c=a.textTracks[b];c.mode=_.$d;c.label===Tz&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.lA,Tz));this.a.mode=_.we};WG=function(a,b){var c=a.mode;a.mode=c===_.Zf?_.Zf:_.we;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};XG=function(){};_.bj.prototype.f=nA(0,function(){return this.keyInfo});var qA=[112,115,115,104,0,0,0,0];
|
|
219
|
+
_.DA.prototype.Ed=function(){return this.ja?this.ja-this.va+1:null};_.DA.prototype.f=function(){return this.keyInfo};_.ZG=function YG(a){var c,d,e,f,g,h;return _.wh(YG,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.t(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.x(l,{lh:c,um:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.x(l,{lh:c,item:e,um:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.r=_.NA.prototype;
|
|
220
|
+
_.r.track=function(a){null!=this.player&&PA(this);a&&(this.player=a,this.player.on(_.Rf,this.Oc,this))};_.r.release=function(){PA(this);this.S=[];this.f=this.h=null};
|
|
221
|
+
_.r.append=function(a,b,c){var d=this.h?this.h(c):null;d||this.log.debug("Unable to resolve rendition for id",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.t(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&b<e.end&&(e.start=b);this.S.push(c);
|
|
222
|
+
this.S.sort(MA)}RA(this);this.Oc();this.player&&this.player.trigger(new _.L(_.Ig))};_.r.clear=function(){this.S=[];RA(this);this.player&&(this.player.trigger(new _.L(_.Ig)),this.player.trigger(new _.L(_.hd)))};
|
|
223
|
+
_.r.Oc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.L(_.jd,
|
|
224
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};bB.prototype.pb=function(){return this.h};bB.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.dB.prototype;_.r.nc=function(){return this.J};_.r.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.D};_.r.offset=function(a){null!=this.w&&(this.w+=a);null!=this.l&&(this.l+=a)};
|
|
225
|
+
_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Md=function(){return!this.o};rB.prototype.release=function(){this.f=function(){};this.a.clear()};rB.prototype.cues=function(){return this.a};wB.prototype.release=function(){this.f=this.j=this.h=this.a=null};wB.prototype.l=function(a){zA(this.a,a);xB(this)};
|
|
226
|
+
yB.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Qa().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=zB(this);return{value:a,done:!a}};_.r=_.AB.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
|
|
227
|
+
_.r.Pc=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};
|
|
228
|
+
_.r.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]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.t(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.wa-=a};
|
|
229
|
+
_.r.md=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};_.r.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
230
|
+
_.r.na=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 _.bj(f.position,g.startTime,g.endTime,g.Qa,g.va,g.ja,g.wa,g.keyInfo,g.Sc,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=
|
|
231
|
+
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.bj(d++,f.startTime,f.endTime,f.Qa,f.va,f.ja,f.wa,f.keyInfo,f.Sc,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=_.t(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.bj(e-d--,f.startTime,f.endTime,f.Qa,f.va,f.ja,f.wa,f.keyInfo,f.Sc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.t(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
|
|
232
|
+
a};_.r.replace=function(a){this.a=a};FB.prototype.release=function(){this.h=null;this.f=function(){}};JB.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};JB.prototype.Ee=function(){this.A=!0;IB(this)};KB.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
233
|
+
OB.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};VB.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(){}};$B.prototype.release=function(){this.h.stop();for(var a=_.t(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
|
|
234
|
+
bC.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};bC.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.t(this.j.cues()),f=e.next();!f.done;d={We:d.We,ae:d.ae},f=e.next()){f=f.value;d.We=this.o.get(f)||null;d.ae=aC(f,a);this.o.set(f,d.ae);var g=this.w.find(function(h){return function(l){return l.Bc===h.We&&l.Ac===h.ae}}(d));g&&g.oc(f,b&&0===c)}};_.$G=0;_.r=fC.prototype;
|
|
235
|
+
_.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};_.r.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.h||!c.h.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))})};_.r.xb=function(){return this.a};_.r.Ea=function(){return this.f};_.r.qc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.La=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};
|
|
236
|
+
kC.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.lj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a);this.a.init()};kC.prototype.h=function(a,b){var c=_.lj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};kC.prototype.f=function(){this.a.resetCaptionStream()};_.lC.prototype.init=function(){};_.lC.prototype.h=function(){};_.lC.prototype.f=function(){};_.r=_.nC.prototype;
|
|
237
|
+
_.r.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"](BA));for(e=1;e<d.length;++e)d[e].p["catch"](BA),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.B&&b.push(this.B.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.B=null;a.f={};a.w={};a.G=
|
|
238
|
+
{};a.H=null;a.L=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.K};_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.E(function(f){if(1==f.a)return e=_.Ip,_.x(f,d.K,2);a.forEach(function(g,h){var l=_.Rk(g.mimeType,g.codecs);if(h===e.TEXT)tC(d,l);else{var m=new Map;m.set(h,l);if((!_.vr(l)||!b||g.keyInfo)&&_.Qk(l,h)){var n=_.Qk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}rC(d,m)}});_.y(f)})};
|
|
239
|
+
_.r.xb=function(a){return a===_.Ri?this.a.xb():(a=vC(this,a))?a.xb():null};_.r.Ea=function(a){return a===_.Ri?this.a.Ea():(a=vC(this,a))?a.Ea():null};_.r.qc=function(a,b,c){return a===_.Ri?this.a.qc(b):(a=vC(this,a))?a.qc(b,!1,c):!1};_.r.La=function(a,b){if(a===_.Ri)return this.a.La(b);var c=vC(this,a);return c?c.La(b):0};
|
|
240
|
+
_.r.remove=function(a,b,c){var d=this;return a===_.Ri?this.a.remove(b,c):yC(this,a,this.Zh.bind(this,a,b,c)).then(function(){if(a===_.Fg){var e=d.xb(a),f=d.Ea(a);null!==e&&null!==f&&SA(d.D,e,f)}else a===_.bd&&(e=d.D,e.player&&e.player.trigger(new _.L(_.hd)))})};_.r.clear=function(a){if(a===_.Ri){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return yC(this,a,this.Zh.bind(this,a,0,this.o.duration))};
|
|
241
|
+
_.r.flush=function(a){return a===_.Ri?Promise.resolve():yC(this,a,this.Xg.bind(this,a))};_.r.endOfStream=function(a){var b=this;return EC(this,function(){uC(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.mf=function(a,b){this.g.debug("Appending data to "+a+Hz);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn("Failed to append data for "+a,c),c;}this.g.debug("Done Appending data to "+a+Hz)};
|
|
242
|
+
_.r.Zh=function(a,b,c){if(c<=b)this.cd(a);else{this.g.debug("Removing data from "+a+" range:",b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn("Failed to remove data from "+a+" buffer. Range:",b,c,d),d;}this.g.debug("Done Removing data from "+a+" range:",b,c)}};
|
|
243
|
+
_.r.zi=function(a){try{this.g.debug("Aborting operations for "+a+Hz);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("Failed to abort operations for "+a+Hz,d),d;}this.g.debug("Done Aborting operations for "+a+Hz);this.cd(a)};
|
|
244
|
+
_.r.Xg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug("Flushing buffer for "+a),this.j.currentTime-=.001):this.g.warn("Skip buffer flush for "+a+" with element state: "+this.j.readyState)}catch(b){throw this.g.warn("Failed to flush buffer for "+a,b),b;}this.g.debug("Done Flushing buffer for "+a);this.cd(a)};
|
|
245
|
+
_.r.ci=function(a,b){0>b&&(b+=.001);try{this.g.debug("Setting timestamp offset for "+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn("Failed to set timestamp offset for "+a,b,c),c;}this.g.debug("Done Setting timestamp offset for "+a,b);this.cd(a)};
|
|
246
|
+
_.r.Dm=function(a,b,c){try{this.g.debug("Setting append window for "+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn("Failed to set append window for "+a,b,c,d),d;}this.g.debug("Done Setting append window for "+a,b,c);this.cd(a)};_.r.U=function(a){this.h[a][0].p.reject(new _.P(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
247
|
+
_.r.cd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),HC(this,a))};_.r.getTextDisplayer=function(){return this.B};var pC=window.URL.createObjectURL;_.w(iD,_.U);_.r=iD.prototype;_.r.initialize=function(a){this.m=a};_.r.release=function(){this.h=[];this.a.clear();this.f.clear()};_.r.load=function(){};_.r.destroy=function(){this.release();this.m=null};_.r.getVideoTracks=function(){return jD(this,_.jk)};_.r.getAudioTracks=function(){return jD(this,_.ik)};_.r.ha=function(){return jD(this,_.T)};_.r.ma=function(){return this.a.get(_.jk)||null};_.r.Oa=function(){return this.a.get(_.ik)||null};_.r.Ga=function(){return this.a.get(_.T)||null};
|
|
248
|
+
_.r.cb=function(){return this.f.get(_.jk)||null};_.r.mb=function(){return this.f.get(_.ik)||null};_.r.nb=function(){return this.f.get(_.T)||null};_.r.Ha=function(){return kD(this,_.jk)};_.r.la=function(){return kD(this,_.ik)};_.r.ta=function(){return kD(this,_.T)};_.r.jb=function(a){mD(this,_.jk,a)};_.r.xa=function(a){mD(this,_.ik,a)};_.r.Ja=function(a){mD(this,_.T,a)};_.r.Ya=function(a,b){lD(this,_.jk,a,void 0===b?!1:b)};_.r.hb=function(a,b){lD(this,_.ik,a,void 0===b?!1:b)};
|
|
249
|
+
_.r.ib=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ga();if(d&&d.track.kind!==_.se){var e=this.ha().find(function(g){return g.kind===_.se&&g.language===d.track.language});if(!e){var f=this.la();f&&(e=this.ha().find(function(g){return g.kind===_.se&&g.language===f.language}))}e&&(c=e.renditions[0])}}lD(this,_.T,c,b)};_.r.addTextTrack=function(a){var b=this;return _.E(function(c){return b.m?_.x(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
|
|
250
|
+
_.r.pa=function(){return!!this.m&&this.m.pa()};iD.prototype.isAbrEnabled=iD.prototype.pa;iD.prototype.addTextTrack=iD.prototype.addTextTrack;iD.prototype.setTextRendition=iD.prototype.ib;iD.prototype.setAudioRendition=iD.prototype.hb;iD.prototype.setVideoRendition=iD.prototype.Ya;iD.prototype.setTextTrack=iD.prototype.Ja;iD.prototype.setAudioTrack=iD.prototype.xa;iD.prototype.setVideoTrack=iD.prototype.jb;iD.prototype.getTextTrack=iD.prototype.ta;iD.prototype.getAudioTrack=iD.prototype.la;
|
|
251
|
+
iD.prototype.getVideoTrack=iD.prototype.Ha;iD.prototype.getLoadingTextRendition=iD.prototype.nb;iD.prototype.getLoadingAudioRendition=iD.prototype.mb;iD.prototype.getLoadingVideoRendition=iD.prototype.cb;iD.prototype.getTextRendition=iD.prototype.Ga;iD.prototype.getAudioRendition=iD.prototype.Oa;iD.prototype.getVideoRendition=iD.prototype.ma;iD.prototype.getTextTracks=iD.prototype.ha;iD.prototype.getAudioTracks=iD.prototype.getAudioTracks;iD.prototype.getVideoTracks=iD.prototype.getVideoTracks;_.r=_.yD.prototype;_.r.stop=function(){this.w=null;this.f=!1;this.l=[];this.j=1;this.h=null;this.D=!1};_.r.init=function(a){this.w=a};
|
|
252
|
+
_.r.chooseVariant=function(){var a=zD(!this.D&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.l),b=this.getBandwidthEstimate();this.l.length&&!a.length&&(this.g.warn("No variants met the ABR restrictions. Choosing a variant by lowest bandwidth."),a=zD(null,this.l),a=[a[0]]);var c=a[0]||null;a=_.t(_.ZG(a));for(var d=a.next();!d.done;d=a.next()){var e=d.value;d=e.item;var f=isNaN(this.j)||0===this.j?1:Math.abs(this.j),g=f*d.bandwidth,h=g/this.a.bandwidthDowngradeTarget;
|
|
253
|
+
e=f*(e.next||{bandwidth:Infinity}).bandwidth/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(g/1E6).toFixed(3),(h/1E6).toFixed(3),(e/1E6).toFixed(3));b>=h&&b<=e&&(c=d)}this.h=Date.now();this.D=!0;return c};_.r.enable=function(){this.f=!0};_.r.disable=function(){this.f=!1};
|
|
254
|
+
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.f);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.ZA(c.f,e,d);_.ZA(c.h,e,d)}if(null!=this.h&&this.f)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.o.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...");
|
|
255
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.r.playbackRateChanged=function(a){this.j=a};_.r.getBandwidthEstimate=function(){var a=this.A&&this.A.bh();a||(a=this.o,a=128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.$A(a.f),_.$A(a.h)));return a};
|
|
256
|
+
_.r.setVariants=function(a){this.l=a};_.r.setCmsdManager=function(a){this.A=a};_.r.configure=function(a){this.a=a;this.f=a.enabled};_.r.reset=function(){this.B=!1;this.o=new xD;var a=this.chooseVariant();a&&this.w(a)};DD.prototype.clear=function(){this.a.clear()};GD.prototype.add=function(a){if(JD(this.f,a))return this.a.add(a),!0;_.J("Rejecting variant - not compatible with root.");return!1};GD.prototype.values=function(){return this.a.values()};LD.prototype.create=function(a){var b=this,c=a.filter(function(d){return JD(b.a,d)});return c.length?new GD(c[0],c):this.f.create(a)};
|
|
257
|
+
KD.prototype.create=function(a){var b=MD(a,this.h);0<b.length&&(a=b);b=!1;if(this.a){var c=ND(a,this.a);0<c.length?(a=c,b=!0):_.J("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(d){return d.primary}),0<b.length&&(a=b));this.f&&(b=JC(a,this.f),b.length?a=b:_.J("No exact match for the channel count could be found."));b=OD(a,this.j);b.length?a=b:_.J("No exact match for spatial audio could be found.");b=new GD(a[0]);a=_.t(a);for(c=a.next();!c.done;c=
|
|
258
|
+
a.next())c=c.value,JD(b.f,c)&&b.add(c);return b};RD.prototype.getState=function(){return this.a};var QD=0,PD=1;TD.prototype.release=function(){this.f.release()};UD.prototype.release=function(){this.a=this.h=null;this.f=function(){}};UD.prototype.l=function(a){var b=this.a,c=this.h.periods;a=TA(c,a)||c[0];b!==a&&this.f(a);this.a=a};WD.prototype.getConfiguration=function(){return this.j};WD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};WD.prototype.set=function(a,b){this.h=a;$D(this,b)};var cE=new _.gp(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])});var OE;_.r=_.eE.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.E(function(f){if(1==f.a){b=[];c=_.t(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,pE(e),b.push(qE(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.C=null;a.j=null;a.G=null;a.l=null;a.h=null;a.f=!0;_.y(f)})};
|
|
259
|
+
_.r.start=function(){var a=this,b,c,d;return _.E(function(e){if(1==e.a){b=a.C.Db();c=lE(a,b);d=a.C.Hf(fE(a)[c]);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.P(_.Q,5,5005,"No streams chosen.");a.D=!d.variant&&!!d.text;return _.x(e,JE(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.C&&a.C.Ll&&(a.g.debug("init: calling onInitialStreamsSetup()..."),a.C.Ll());_.y(e)})};
|
|
260
|
+
_.r.resume=function(){if(!BE(this))for(var a=_.t(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,nE(this,b,0)};
|
|
261
|
+
_.r.Hb=function(a){var b=this,c,d,e,f,g,h,l;return _.E(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=yE(a);if(a.fb||null==a.$a||a.hc)return m["return"]();a.$a=null;if(!a.Mb){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,DE(b,a,a.Ne,a.me),3);case 3:return m["return"]();case 2:_.A(m,4);d=NE(b,a);null!=d&&(nE(b,a,d),a.Wc=!1);_.oh(m,5);break;case 4:return e=_.C(m),_.x(m,YE(b,e),6);case 6:return m["return"]();case 5:cF(b,a);if(!CE(b)){m.F(0);break}if(b.C.configuration.bl){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
262
|
+
f=_.t(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.$a=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.C.W.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.C.W.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.C.Fh();_.y(m)}})};
|
|
263
|
+
_.r.gm=function(a,b,c,d){var e=pA(d.reader),f=pA(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.Mm(d.reader,d.reader.Fa()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.C.Jh();else this.C.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}}))};
|
|
264
|
+
_.r.$m=function(a){var b=this,c=!1,d=0;(new _.Pm).M(_.Te,_.Qm).M(_.sg,_.Qm).M(_.Oe,_.Qm).M(_.Se,_.Qm).M(_.gg,_.Qm).Y(_.ig,_.Rm).M("encv",function(e){e.reader.skip(78);_.Qm(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 _.Bm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};OE="iterateSegmentReference";_.aH={ITERATOR:OE,LOOKUP:_.cA};_.w(gF,_.dm);_.r=gF.prototype;_.r.init=function(a,b){var c=a.getMedia();_.dm.prototype.init.call(this,a,b);sF(this,c)};_.r.namespace=function(){return aA};_.r.Ng=function(){return new iD};_.r.getState=function(){return this.gc};_.r.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
265
|
+
_.r.unload=function(){var a=this,b;return _.E(function(c){if(1==c.a){oD(a,!1);a.Kd=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===IF?c["return"]():_.x(c,uF(a),2)}a.Z=null;a.gg=0;a.Kc=null;a.$=null;_.y(c)})};_.r.release=function(){var a=this;return _.E(function(b){if(a.Ca)return b["return"](a.Ca);a.Ca=jF(a);a.Ca["finally"](function(){a.Ca=null});return b["return"](a.Ca)})};
|
|
266
|
+
_.r.getBufferInfo=function(a){if(this.L){var b=wC(this.L),c=new _.Tl(void 0,a);switch(a){case _.jk:return b.video?b.video:c;case _.ik:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Rc?(b=OA(this.Rc),LA(b,a)):_.dm.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.Nd,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.r.getMediaPosition=function(){return this.B?XB(this.B):_.dm.prototype.getMediaPosition.call(this)};
|
|
267
|
+
_.r.seek=function(a){var b=this.Nd;b=b.a?a+b.a.pb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.dm.prototype.seek.call(this,b)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.Nd,b=this.getMediaDuration();return a.a?a.a.getDuration():b};_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};
|
|
268
|
+
_.r.destroy=function(){var a=this;return _.E(function(b){if(1==b.a)return _.x(b,_.dm.prototype.destroy.call(a),2);if(a.G===IF)return b["return"]();a.log.debug("Destroying player...");a.G=IF;rF(a);a.o&&(a.o.release(),a.o=null);a.V&&(a.V.release(),a.V=null);a.Jc=null;_.y(b)})};_.r.getTimeline=function(){return this.Jc};
|
|
269
|
+
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.E(function(z){switch(z.a){case 1:return c=new _.Oj,b.j.a=c,_.A(z,2),pF(b),b.ea=_.Jb,_.x(z,vF(b),4);case 4:return CD(b.j,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Bp(d),b.configuration=_.bm(b.Ic,d),b.log.info("Loading playlist configurations",a),b.Jc=kF(b.configuration),_.x(z,wF(b,c),5);case 5:return CD(b.j,c),e=a.map(function(B){return xF(b,B,0,null,!0)}),_.x(z,Promise.all(e),6);
|
|
270
|
+
case 6:f=z.f;g=f.filter(function(B){return B.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.P(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.oc)throw new _.P(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.P(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.dB({version:2},null,0,m);p=f.map(function(B){return eD(B.manifest)});
|
|
271
|
+
q=gD(p,n);b.f=q;u=b;return _.x(z,yF(b,q,b.configuration.drm),7);case 7:return u.w=z.f,CD(b.j,c),_.x(z,zF(b,c),8);case 8:CD(b.j,c);vE(b.a,q);lF(b,q);c.resolve();_.oh(z,0);break;case 2:v=_.C(z);if(!b.A){z.F(9);break}return _.x(z,b.A.stop(),10);case 10:b.A=null;case 9:AF(b,v,c),_.y(z)}})};
|
|
272
|
+
_.r.appendLoad=function(a){var b=this,c;return _.E(function(d){if(1==d.a){pF(b);if(b.ea!==_.Jb)throw new _.P(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,HF(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;vE(b.a,c.manifest);CE(b.a)&&b.a.resume();lF(b,c.manifest);_.y(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
273
|
+
_.r.Ag=function(){var a=this;return _.E(function(b){pF(a);if(!a.He)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.He);a.He=null;return _.x(b,zF(a,null),0)})};_.r.preload=function(a){var b=this;return _.E(function(c){if(1==c.a)return pF(b),_.Yn("preload.start"),b.log.info("Preloading asset",a),_.x(c,BF(b,a,!1),2);b.He=a;b.log.info("Preloaded asset",a);_.Yn("preload.end");_.Zn("preload","preload.start","preload.end");_.y(c)})};
|
|
274
|
+
_.r.load=function(a){return BF(this,a)};_.r.detach=function(){var a=this;return _.E(function(b){if(1==b.a)return _.x(b,qF(a),2);rF(a);_.y(b)})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.o):a=!1;return a};_.r.Oh=function(){this.log.debug("User seeking finished");this.K&&$F(this);aG(this)};
|
|
275
|
+
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:eB(b),end:oB(b)}}b=this.Nd;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.nc=function(){return this.f?this.f.presentationTimeline.nc():null};_.r.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
|
|
276
|
+
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===fF){if(_.Vj()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.J.set(a,b);c.play()}else this.J.set(a,b);if((c=this.J.getConfiguration())&&c.preferTrickPlayTracks){c=this.a;var d=1<Math.abs(a),e=c.a.get(_.Fg);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.ac&&(c.g.debug("Engaging trick mode stream",
|
|
277
|
+
d),_.sE(c,d,!1,0),e.ac=f);else if(f=e.ac)c.g.debug("Restoring non-trick-mode stream",f),e.ac=null,_.sE(c,f,!0,0)}}this.l.playbackRateChanged(a)}};_.r.ha=function(){if(this.f&&this.B){var a=MF(this);if(null==a)a=null;else{if(!FD(this.T,a).text){var b=_.XC(a.textStreams,this.Bd,this.xe,this.yd);b.length&&(b=b[0],FD(this.T,a).text=b)}a=FD(this.T,a).text}b=[];for(var c=_.t(NG(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=UC(d);e.active=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
|
|
278
|
+
_.r.getStats=function(){if(this.G!==fF)return _.fp();aG(this);var a=this.h;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===fF){if(a=cG(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.l.getBandwidthEstimate();this.H.f=a}return this.H.getStats()};_.r.re=function(){return this.I};
|
|
279
|
+
_.r.getTimelineCues=function(){return this.I?vB(this.I,iG(this)):[]};_.r.resetAbr=function(){this.l&&this.l.reset()};
|
|
280
|
+
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.E(function(B){if(1==B.a){if(g.G!==fF)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=MF(g);l=_.Ip;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.P(1,4,4040);u=new _.bj(1,0,q,function(){return[a]},0,null,0);v={id:g.mi++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
281
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(I){return 1===I?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.cA,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.Be.add(v);h.textStreams.push(v);return _.x(B,oE(g.a,v),
|
|
282
|
+
2)}if(z=_.hE(g.a,_.Ri))FD(g.T,h).text=z;g.Be["delete"](v);g.log.debug("Choosing new streams after adding a text stream");oG(g,h);OF(g);return B["return"](UC(v))})};
|
|
283
|
+
_.r.xj=function(a){this.log.debug(_.fA,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=LG(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}}};
|
|
284
|
+
_.r.wj=function(){this.log.debug("canSwitch_");this.fa=!1;this.configuration.abr.enabled&&this.l.enable();this.Ka&&(tE(this.a,this.Ka,this.ki,this.ji),this.Ka=null);this.ia&&(_.sE(this.a,this.ia,!0,0),this.ia=null)};_.r.Zm=function(){this.A&&this.A.update()};_.r.Wl=function(){this.B&&this.B.j.Ee()};
|
|
285
|
+
_.r.Ii=function(a,b,c){if((void 0===c?"":c)===dA)return OF(this),this.pa()||(this.configuration.abr.enabled=!0,this.l.enable()),oG(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===_.bd&&(h=h&&l.language===a.language));return h})&&this.pa()){for(var d=_.t(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)}OF(this);this.pa()||(this.configuration.abr.enabled=!0,this.l.enable());
|
|
286
|
+
oG(this,b)}return c};_.r.Jl=function(){this.log.debug("endOfStream called by streaming engine");this.Kd=!0};_.r.onError=function(a){if(this.G!==IF&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.re,{detail:a});a.severity===_.Q&&iF(this,_.up);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.lf=function(a){a.type===_.ke?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Og?JF(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.hc,a.type)))};_.r.pa=function(){return this.configuration.abr.enabled};
|
|
287
|
+
_.r.Qm=function(a){var b=this,c,d,e,f,g,h,l,m;return _.E(function(n){switch(n.a){case 1:if(!b.Hc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.pa();return _.x(n,b.Hc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.O.na(b.getLoadedSource(),{url:e});d&&b.l.disable();return _.x(n,EE(b.a),3);case 3:g=cG(b);case 4:return h=!1,_.A(n,7),b.log.info("Switching CDN to "+f.url+"."),_.x(n,OG(b,f,g),9);case 9:_.oh(n,6);break;case 7:return l=_.C(n),b.log.info("Switch failed"),
|
|
288
|
+
_.x(n,b.Hc(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.l.enable(),AE(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.sd,{newManifest:f.url})),_.y(n))}})};var IF=0,eF=1,fF=2,NF=[_.ff,_.ze];PG.prototype.a=function(){return aA};
|
|
289
|
+
PG.prototype.canPlay=function(a,b){if(_.al())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.At||_.Bt(a.url)in _.Ct?!0:!1:!1;if(d&&e){if(_.Vj(2))return 1;if(_.bl()&&c===_.El){if(b.streaming.preferNativeHlsOnSafari)return 1;_.J("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
290
|
+
PG.prototype.f=function(a){return a===_.pa||a===_.Jb};PG.prototype.create=function(){return new gF};_.Nh(new PG);_.nq(function(){_.Hh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Gh("Patching Chromecast MSE bugs."),UG();else if(_.bl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;SG();10>=a?(_.Gh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Gh("Patching Safari 11 \x26 12 MSE bugs."),QG(),RG()):(_.Gh("Patching Safari 13 MSE bugs."),QG())}else _.Vj(2)||_.Vj(3)||
|
|
291
|
+
_.Vj(4)?TG():_.Gh("Using native MSE as-is.");else _.Gh("No MSE implementation available.")});_.w(VG,_.Cu);_.r=VG.prototype;
|
|
292
|
+
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.J("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.ag(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.ud}catch(g){f.align="middle"}e.writingMode===_.Dg?f.vertical="lr":e.writingMode===_.Eg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.t(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?
|
|
293
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.t(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;WG(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode===_.Zf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Zf:_.we)};_.r.destroy=function(){this.a&&WG(this.a,function(){return!0});this.a=null;return Promise.resolve()};XG.prototype.isSupported=function(){return!0};XG.prototype.create=function(a){return new VG(a)};_.Xo("single-native",new XG);};
|
|
279
294
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
280
295
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
281
296
|
else{_=this.clpp._;(f.call(g,this));}
|