@castlabs/prestoplay 6.17.1 → 6.18.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 +30 -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 +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +566 -558
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +75 -74
- package/cjs/cl.externs.js +46 -46
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +71 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +311 -311
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +15 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +69 -69
- 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 +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +456 -450
- package/cl.crypto.js +8 -8
- package/cl.dash.js +70 -69
- package/cl.externs.js +46 -46
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +274 -273
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +2 -2
- package/typings.d.ts +37 -3
package/cjs/cl.mse.js
CHANGED
|
@@ -1,321 +1,321 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
_.
|
|
10
|
-
_.
|
|
11
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
12
|
-
b,d||null,e,a,c)};_.
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.
|
|
16
|
-
|
|
17
|
-
_.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
_.
|
|
26
|
-
_.
|
|
27
|
-
_.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
b
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
b;a.g.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
e=
|
|
61
|
-
KE=function(a,b,c
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
QE=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
2
|
+
var f=function(window){var cB,dB,eB,fB,gB,hB,iB,jB,kB,lB,mB,nB,oB,pB,qB,rB,sB,tB,uB,vB,wB,xB,yB,zB,AB,BB,CB,DB,EB,FB,GB,HB,IB,JB,KB,LB,MB,PB,QB,RB,SB,TB,UB,VB,WB,XB,YB,ZB,aC,bC,cC,dC,eC,fC,gC,jC,kC,mC,nC,oC,pC,qC,rC,sC,uC,vC,wC,BC,CC,DC,EC,FC,GC,HC,JC,NC,OC,QC,RC,SC,TC,VC,WC,XC,ZC,$C,aD,bD,cD,dD,eD,fD,gD,iD,nD,tD,yD,BD,qD,AD,CD,DD,ED,FD,GD,HD,ID,JD,KD,OD,QD,RD,SD,PD,UD,TD,VD,WD,ZD,$D,aE,YD,XD,bE,fE,hE,eE,iE,dE,gE,cE,kE,jE,lE,mE,nE,qE,rE,sE,tE,uE,wE,AE,yE,CE,DE,EE,GE,FE,HE,JE,IE,PE,QE,ME,KE,NE,OE,RE,SE,VE,UE,WE,XE,YE,LE,
|
|
3
|
+
ZE,TE,aF,bF,cF,dF,eF,gF,hF,jF,kF,iF,lF,mF,nF,pF,qF,oF,yF,xF,zF,AF,CF,DF,FF,EF,GF,IF,HF,JF,MF,KF,LF,OF,NF,PF,QF,RF,UF,WF,VF,YF,XF,$F,aG,bG,eG,dG,cG,fG,hG,gG,iG,jG,kG,lG,mG,nG,qG,pG,oG,sG,rG,uG,xG,zG,AG,FG,IG,KG,MG,OG,RG,SG,TG,VG,WG,YG,NG,$G,DG,aH,BG,LG,dH,bH,XG,ZG,fH,eH,cH,lH,mH,gH,oH,hH,jH,rH,qH,kH,pH,sH,CG,iH,UG,EG,GG,wG,HG,nH,PG,QG,tH,wH,xH,yH,zH,AH,CH,DH,BH,EH,KH,RH,QH,SH,LH,MH,NH,XH,TH,IH,HH,GH,JH,VH,WH,OH,PH,hI,bI,kI,lI,mI,qI,nI,uF,sF,vF,tF,wF,rF,yI,vI,VI,iI,gI,pI,zI,wI,XI,oI,sI,ZH,rI,YI,fI,
|
|
4
|
+
ZI,$I,cJ,jI,eI,bJ,aJ,UH,WI,uI,eJ,cI,tI,dJ,FH,fJ,aI,$H,gJ,hJ,iJ,jJ,kJ,lJ,mJ,nJ,oJ;cB=" and the media start time is ";dB=" between media times and segment times for ";eB=" buffer";fB=" buffer. Range:";gB=" is being or has been set up";hB=" range:";iB=" with element state: ";jB=". Adjusting timestampOffset.";kB=". The segment start time is ";lB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";mB="\x3c/LA_URL\x3e";nB="\x3cLA_URL\x3e";oB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';
|
|
5
|
+
pB="Aborting operations for ";qB="Appended audio segment ";rB="Appended video segment ";sB="Appending data to ";tB="Buffer:";uB="Choosing new streams after key status change";vB="Detected a delta of ";wB="Done Aborting operations for ";xB="Done Appending data to ";yB="Done Flushing buffer for ";zB="Done Removing data from ";AB="Done Setting append window for ";BB="Done Setting timestamp offset for ";CB="Failed to abort operations for ";DB="Failed to append data for ";EB="Failed to flush buffer for ";
|
|
6
|
+
FB="Failed to remove data from ";GB="Failed to set append window for ";HB="Failed to set timestamp offset for ";IB="Flushing buffer for ";JB="IterateSegmentReference";KB="Jumping forward";LB="MediaSource threw QuotaExceededError:";MB="No more scheduled operations for ";_.NB="No stream with id";_.OB="Player is in ERROR state and can not switch to ";PB="PrestoPlay TextTrack";QB="QuotaExceededError";RB="Removing audio from variant - audio not compatible with platform";SB="Removing data from ";TB="Reset transmuxers.";
|
|
7
|
+
UB="Setting append window for ";VB="Setting playback rate to\x3d";WB="Setting timestamp offset for ";XB="Skip buffer flush for ";YB="Starting next operation for ";ZB="Update-End received for ";_.$B="Updating manifest...";aC="bufferBehind\x3d";bC="bufferedBehind\x3d";cC="calling onCanSwitch()...";dC="cannot find segment";eC="clpp.mse.Player";fC="currentPeriod.startTime\x3d";gC="failed to get buffered range for ";_.hC="getSegmentNextReference";_.iC="iterateSegmentReference";jC="key-restriction";
|
|
8
|
+
kC="manifest.start";_.lC="onChooseStreams_";mC="presentationTime:";nC="presentationTime\x3d";oC="reference.endTime\x3d";pC="reference.position\x3d";qC="reference.startTime\x3d";rC="sourceopen";sC="startstreaming";_.tC="subtitles";uC="switch: Stream ";vC=function(a,b){return _.ch[a]=b};wC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Jm(a);)if(0===_.Lm(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.S.ba(a)};
|
|
9
|
+
_.yC=function(a){var b=new Uint8Array(xC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.Fm(c,!1);_.V(d,c);_.Hm(d,b);_.Hm(d,a.j);_.V(d,a.f.byteLength);_.Hm(d,a.f);return _.oj(d.buffer)};
|
|
10
|
+
_.zC=function(a,b,c,d){var e=_.Bj(b);if(8!==e.byteLength)e="";else{var f=_.Sn(e);e=_.yj(f);b:switch(f=f.byteLength,_.Nh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[oB+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?nB+d+mB:"",lB].join("");break b;case "4.1.0.0":e=[oB+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
11
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?nB+d+mB:"",lB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[oB+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?nB+d+mB:"",lB].join("");break b;default:_.Ih("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Nh("New payload",e);e=_.oj(_.S.Se(e,!0));return new _.Pn(_.Tn,
|
|
12
|
+
b,d||null,e,a,c)};_.AC=function(a,b){return b===a.version?a:_.zC(b,a.a,a.l||void 0,a.h||void 0)};BC=function(a,b){a:{if(b){var c=_.w(a.f.keys());for(var d=c.next();!d.done;d=c.next()){d=a.f.get(d.value);for(var e=0;e<d.cb.length;e++)if(d.cb[e]===b){c=d;break a}}}c=null}return c?c.La:null};CC=function(a,b){if(_.bl("Edge/"))return!0;b=b.toLowerCase();if(_.Yj()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.pe);return a.J.has(b)||a.J.has(c)}return a.J.has(b)};
|
|
13
|
+
DC=function(a,b){var c=a.o.get(b);return!(!c||c!==_.jf&&c!==_.Ce)};EC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.Ho(c),!CC(a,c))||d&&d.encrypted&&(d=_.Ho(d),!CC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};FC=function(a,b){return a.a.find(function(c){return c.getId()===b})||null};
|
|
14
|
+
GC=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.rb()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};HC=function(a,b){a.a=b.enabled};_.IC=function(a,b){return a.concat(b)};JC=function(){};_.KC=function(a,b){if(0===b.length)return a;var c=b.map(function(d){return new _.Ji(d)});return a.map(function(d){return new _.Ji(d)}).map(function(d){return c.map(d.resolve.bind(d))}).reduce(_.IC,[]).map(function(d){return d.toString()})};
|
|
15
|
+
_.LC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.MC=function(a,b,c,d,e){this.Sa=a;this.xa=b;this.ka=c;this.keyInfo=d||null;this.Vc=_.M.S(e)?!1:!!e};NC=function(a,b){a=_.gj(a);b=_.gj(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
16
|
+
OC=function(a){return a.language?_.gj(a.language):a.audio&&a.audio.language?_.gj(a.audio.language):a.video&&a.video.language?_.gj(a.video.language):_.yg};
|
|
17
|
+
_.PC=function(a,b){for(var c=_.gj(a),d=new Set,e=_.w(b),f=e.next();!f.done;f=e.next())d.add(_.gj(f.value));e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.w(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,NC(f,c))return f;e=_.w(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.gj(g);h=_.gj(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.w(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,NC(c,e))return e;return null};
|
|
18
|
+
QC=function(a,b){for(var c=0,d=_.w(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};RC=function(a,b){var c=_.Tk(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};SC=function(a){for(var b=[a.mimeType],c=_.w(_.ov),d=c.next();!d.done;d=c.next()){var e=_.w(d.value);d=e.next().value;e=e.next().value;d=a[d];null!=d&&b.push(e.trim()+'\x3d"'+String(d).trim()+'"')}return b.join(";").replace(/\s/g,"")};
|
|
19
|
+
TC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.UC=function(a){var b=[];a=_.w(a.split(/\s*,\s*/));for(var c=a.next();!c.done;c=a.next()){c=c.value.split(".");var d=c[0];c.shift();b.push(d)}return b.sort().join(",")};VC=function(a,b){for(var c=new _.Xl(void 0,void 0===b?"total":b),d=_.w(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};WC=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};
|
|
20
|
+
XC=function(a,b){return a.start-b.start};_.YC=function(a){this.h=void 0===a?null:a;this.log=new _.K("clpp.renditions");this.U=[];this.f=this.player=null;this.a=!1};ZC=function(a){return a.U.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};$C=function(a){a.player&&(a.player.off(_.Vf,a.Rc),a.a&&a.player.off(_.ug,a.Rc));a.player=null};aD=function(a){a.player&&a.player.trigger(new _.L(_.jd))};bD=function(a){a.player&&a.player.trigger(new _.L(_.jd))};
|
|
21
|
+
cD=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.U.length;d++){var e=a.U[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(_.ug,a.Rc,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.ug,a.Rc),a.a=!1)}};dD=function(a,b,c){a.U=a.U.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(_.Ng))};
|
|
22
|
+
eD=function(a,b){for(var c=null,d=_.w(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};fD=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};gD=function(a,b){for(var c=0;c<a.length;c++)if(fD(a[c]).has(b))return c;return-1};
|
|
23
|
+
iD=function(a,b){Array.from(fD(a)).forEach(function(c){c.segmentIndex&&_.hD(c.segmentIndex,b)})};_.jD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.kD=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)};_.lD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
24
|
+
_.mD=function(a,b,c,d,e,f,g,h){a=_.Mj(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};nD=function(a){this.a=this.h=0;this.f=a};_.oD=function(a,b,c){a.h=b;a.a=c};
|
|
25
|
+
_.pD=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.o=this.w=null;this.I=0;this.D=this.l=d;this.N=void 0===e?!0:e;this.g=new _.K("clpp.media.PresentationTimeline");this.R=f;this.L=null;this.a=new nD(d);this.J=null;this.B=this.j.type||null};_.rD=function(a,b){a.L={offsetDateTime:b-qD(a),seekRangeStartDateTime:b}};_.sD=function(a,b){a.l=b;a.D=b;a.a.f=b};tD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.l?a.f:a.D?a.o:null};
|
|
26
|
+
_.wD=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.uD(a,b[0].startTime+c);a.h=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.vD(a,d);null!=a.G&&a.N&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.h);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.h)}};_.uD=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.vD=function(a,b){a.o=Math.max(a.o||0,b)};_.xD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};
|
|
27
|
+
_.zD=function(a){return 2===a.j.version?a.a.rb():Infinity===a.A?0:Math.max(0,yD(a)-a.A)};yD=function(a){if(2===a.j.version)a=a.a.a;else if(a.l)a=a.f;else if(a.D)a=a.o||0;else{if("startover"===a.B)var b=a.J||0;else b=(Date.now()+a.I)/1E3,b=a.R?Math.max(0,b-(a.h-a.H)-a.G):Math.max(0,b-a.h-a.G);a=Math.min(b,a.f)}return a};BD=function(a,b){if(2===a.j.version)return a.a.rb();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(yD(a)-a.A+b,AD(a)))};
|
|
28
|
+
qD=function(a){return 2===a.j.version?a.a.rb():BD(a,0)};AD=function(a){var b=a.Pd()&&!a.D?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,yD(a)-b)};CD=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,va:a.va}};DD=function(){this.h=function(){};this.a=new Set};ED=function(a,b){a.h=b};
|
|
29
|
+
FD=function(a,b){for(var c=_.w(b),d=c.next();!d.done;d=c.next())a.f(d.value)};GD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return CD(c,b)})};HD=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 _.Mt("crop",a,d.endTime?d.endTime-a:Infinity,!1))};
|
|
30
|
+
ID=function(a){var b=a.a.ph(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.L(_.Yf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};JD=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.K("clpp.media.SegmentIterator")};KD=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Sa().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};_.LD=function(a){this.a=a;this.g=new _.K("clpp.media.SegmentIndex")};
|
|
31
|
+
_.MD=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.ND=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};OD=function(a,b){var c=a.find(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 JD(a,c,e)};
|
|
32
|
+
_.hD=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)};QD=function(a,b){this.h=a;this.l=PD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};RD=function(a,b){a.f=b};SD=function(a){this.a=a};
|
|
33
|
+
PD=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};UD=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.l=c;this.G=e;this.h=new _.Xh;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,_.Sg,function(){return TD(f)});this.w=(new _.Zk(function(){TD(f)})).mb(.25)};
|
|
34
|
+
TD=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 _.Xl(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=PD(d);d=d.a.currentTime;b=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=
|
|
35
|
+
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>=AD(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:_.Mh("Ignoring large gap at",c,"size",g)}if(b||h)0===e?_.Mh(KB,g,"seconds because of gap before start time of",f):_.Mh(KB,g,"seconds because of gap starting at",d.end(e-1),"and ending at",f),a.B=!0,a.a.currentTime=f}}}}};
|
|
36
|
+
VD=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.Zk(function(){0>=b.j?(_.Ih(["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--)})};WD=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.mb(.1)};ZD=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.Xh;this.h=new VD(a);this.w=!1;0<a.readyState?XD(this,c):YD(this,c)};
|
|
37
|
+
$D=function(a){return a.l?a.a.currentTime:a.A};aE=function(a,b){0<a.a.readyState?WD(a.h,b):YD(a,b)};YD=function(a,b){a.A=b;a.f.off(a.a,_.Ne);a.f.one(a.a,_.Ne,function(){XD(a,b)})};XD=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?bE(a):(a.f.one(a.a,_.bg,function(){bE(a)}),WD(a.h,0===a.a.currentTime?b:a.a.currentTime))};bE=function(a){_.el()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.bg,function(){return a.j()})};
|
|
38
|
+
fE=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 UD(a,b.presentationTimeline,c,cE(this,a,c),f);this.f=new ZD(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.j=!1;l=$D(h.f);var n=dE(h,l);if(.001<Math.abs(n-l)){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;aE(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},eE(this,d,g),function(){h.j.I=!0});this.o=(new _.Zk(function(){if(0!==
|
|
39
|
+
h.h.readyState&&!h.h.paused){var l=$D(h.f),m=qD(h.a),n=AD(h.a);3>n-m&&(m=n-3);l<m&&(m=dE(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).mb(.25);this.g=new _.K("clpp.mse.Playhead")};hE=function(a){var b=$D(a.f);return 0<a.h.readyState&&!a.h.paused?gE(a,b):b};eE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?qD(a.a):AD(a.a):0>b&&(b=AD(a.a)+b);return iE(a,gE(a,b))};
|
|
40
|
+
iE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
41
|
+
dE=function(a,b){if("startover"===a.a.B)return b;var c=new _.Xl(a.h.buffered);c=c.tb.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=qD(a.a),g=AD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=BD(a.a,d),m=BD(a.a,e);d=BD(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),iE(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");
|
|
42
|
+
return d}if(b>=l||c(b))return a.g.debug("Playhead in safe region or in buffered region."),b;a.g.debug("Playhead outside safe region \x26 in unbuffered region.");return d};gE=function(a,b){var c=qD(a.a);if(b<c)return c;c=AD(a.a);return b>c?c:b};
|
|
43
|
+
cE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new QD(new SD(b),c.stallThreshold);RD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.Xl(b.buffered),l;if(l=_.bl("Edge/")||_.bl("Trident/")||_.Yj()||_.el())a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){l=h.start(l+1)-h.end(l)>=d;break a}l=!1}if(l){a:{if(h.length&&!(1>=h.length))for(l=0;l<h.length-1;l++)if(f>h.start(l)&&f<h.end(l)){h=
|
|
44
|
+
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};kE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.Zk(function(){jE(b,!1)})).mb(.25)};jE=function(a,b,c){c=void 0===c?0:c;for(var d=_.w(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
45
|
+
lE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
46
|
+
mE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Ec:null,Dc:2,tc:function(c,d){return b.a(c,d)}},{Ec:1,Dc:2,tc:function(c,d){return b.a(c,d)}},{Ec:3,Dc:2,tc:function(c,d){return b.a(c,d)}},{Ec:2,Dc:1,tc:function(c,d){return b.f(c,d)}},{Ec:2,Dc:3,tc:function(c,d){return b.f(c,d)}},{Ec:1,Dc:3,tc:function(c,d){return b.h(c,d)}},{Ec:3,Dc:1,tc:function(c,d){return b.h(c,d)}}]};nE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
47
|
+
_.oE=function(a){_.St[a]&&delete _.St[a]};_.pE=function(a){_.Qt[a]&&delete _.Qt[a]};qE=function(a,b){this.w=null;this.D=a;this.j=b;this.h=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};rE=function(a,b){if(b!==_.Vc){var c=_.su[b];if(!c)throw new _.N(_.O,2,2012,"Text parser is unavailable for "+b);a.w=new c(a.D)}};
|
|
48
|
+
sE=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.j)if(null==c||null==d)a.w.parseInit(_.oj(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.oj(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.h&&g.startTime<a.l});a.j.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.h));a.f=Math.min(d,a.l)}})};
|
|
49
|
+
tE=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.w(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.j.append(e,[])};
|
|
50
|
+
uE=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.w(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.h&&l.startTime<a.l&&(l=new _.xi(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.j.append([l],[]))}e=_.w(g.keys());for(f=e.next();!f.done;f=e.next())for(f=f.value,a.o.has(f)||a.o.set(f,new Map),b=_.w(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
51
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.h):Math.min(a.a,Math.max(c,a.h));a.f=Math.max(a.f,Math.min(d,a.l))};_.vE=function(a){a=a.toLowerCase();return _.su[a]||window.muxjs&&a===_.Vc?!0:!1};wE=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.xE=function(){};
|
|
52
|
+
_.zE=function(a,b,c,d,e){this.j=a;this.D=c;this.f={};this.K=!1;this.a=null;this.h={};this.l=new _.Xh;this.I=!1;this.w={};this.H=b;this.B=d;this.L=e;this.R=this.L.streaming.maxSegmentToMediaOffset||1;this.J=new _.Rj;this.A="";this.G={};this.o=yE(this,this.J);this.N=!0;this.g=new _.K("clpp.mse.MediaSourceEngine")};AE=function(a){var b=_.Uk(a.mimeType,a.codecs),c=SC(a);return _.vE(b)||_.Cr(c)||(_.Tk(b,a.type)?!0:!1)};
|
|
53
|
+
yE=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,rC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,sC,function(){a.N=!0});a.l.on(c,"endstreaming",function(){a.N=!1});a.A=BE(c);a.j.src=a.A;return c}c=new MediaSource;a.A=BE(c);a.l.one(c,rC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
54
|
+
CE=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.te,a.T.bind(a,d));a.l.on(e,"updateend",a.Sc.bind(a,d));a.f[d]=e;a.h[d]=[];a.G[d]=!1});a.K=b.has(_.cd)&&b.has(_.r)};DE=function(a,b){try{return new _.Xl(a.f[b].buffered,b)}catch(c){return b in a.f&&a.g.error(gC+b,c),null}};EE=function(a,b){if(!a.f[b])return"";var c=DE(a,b);return c?c.toString():""};GE=function(a,b,c,d,e){return[FE(a,b,a.Oj.bind(a,b)),FE(a,b,a.Qg.bind(a,b,c)),FE(a,b,a.Pj.bind(a,b,d,e))]};
|
|
55
|
+
FE=function(a,b,c){if(a.I)return Promise.reject();c={start:c,p:new _.Rj};a.h[b].push(c);1===a.h[b].length&&HE(a,b);return c.p};HE=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(YB+b),c.start()}catch(d){d.name===QB?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),IE(a,b)}else a.g.debug(MB+b)};
|
|
56
|
+
JE=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.I)return p["return"](Promise.reject());c=[];for(d in a.f)e=new _.Rj,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.th(p,3);break;case 2:g=_.E(p);for(h in a.f)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.f);_.D(p,5,6);return _.y(p,b(),6);case 6:_.uh(p);for(m in a.f)IE(a,
|
|
57
|
+
m);_.vh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};IE=function(a,b){a.h[b].shift();HE(a,b)};
|
|
58
|
+
PE=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants});if(b.length||c.length)e=KE(e,b,c);e=LE(e,d);if(1<a.periods.length){var f=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.w(a.periods);for(var g=c.next();!g.done;g=c.next()){d=new Set;g=_.w(g.value.variants);for(var h=g.next();!h.done;h=g.next())h=h.value,null!==h.audio&&d.add(f(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<b.length;c={Ze:c.Ze},d++)c.Ze=b[d],l=new Set(_.fh(l).concat().filter(function(n){return function(p){return n.Ze.has(p)}}(c)));
|
|
59
|
+
e=e.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(f(n.audio.codecs))})}e=ME(e);var m=NE(e);a=_.w(a.periods);for(e=a.next();!e.done;e=a.next())e=e.value,e.variants=e.variants.filter(function(n){if(OE(n)===m)return!0;_.Nh("Dropping Variant (better codec available)",n);return!1})};
|
|
60
|
+
QE=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=KE(e,b,c);e=LE(e,d);a=_.w(a.periods);for(b=a.next();!b.done;b=a.next())b=b.value,b.variants=b.variants.filter(function(f){return e.includes(f)})};ME=function(a){var b=new _.Uh;a=_.w(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=OE(c);b.push(d,c)}return b};
|
|
61
|
+
KE=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.UC(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.UC(g.codecs),b.includes(g))?!0:!1}),f=a.filter(function(g){return d.length&&!e.length?d.includes(g):!d.length&&e.length?e.includes(g):d.includes(g)&&e.includes(g)});return f.length?f:a};
|
|
62
|
+
NE=function(a){var b="",c=Infinity;a.forEach(function(d,e){var f=e.reduce(function(g,h){return g+h.bandwidth||0},0)/e.length;_.Nh(_.Od,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};OE=function(a){var b="";a.video&&(b=_.UC(a.video.codecs));var c="";a.audio&&(c=_.UC(a.audio.codecs));return b+"-"+c};
|
|
63
|
+
RE=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};SE=function(a,b,c){var d=!1;a=_.w(a);for(var e=a.next();!e.done;e=a.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=RE(e,b,c);f!==e.allowedByApplication&&(d=!0)}return d};
|
|
64
|
+
VE=function(a,b,c,d,e){e=void 0===e?!0:e;var f=!1;d.variants=d.variants.filter(function(n){if(a&&a.$&&!EC(a,n))return _.Nh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!AE(p)){var u=p.codecs;0<=p.codecs.indexOf(_.pe)?(_.Nh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.pe,"ac-3"),AE(p)?_.Mh("Using AC-3 instead of EC-3 for",TE(p)):(p.codecs=u,_.Mh(RB,TE(p)),n.audio=null,f=!0,p=null)):(_.Mh(RB,TE(p)),n.audio=null,f=!0,p=null)}return q&&!AE(q)?(_.Mh("Dropping variant - video not compatible with platform",
|
|
65
|
+
TE(q)),!1):p&&b&&!UE(p,b,e)?(_.Mh("Dropping variant - not compatible with active audio","active audio",TE(b),"variant.audio",TE(p)),!1):q&&c&&!UE(q,c,e)?(_.Mh("Dropping variant - not compatible with active video","active video",TE(c),"variant.video",TE(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.w(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),h||m.audio||!m.video||(h=!0);g&&h&&(d.variants=d.variants.filter(function(n){return n.video&&!n.audio?(_.Mh("Dropping variant - not compatible with video + audio",
|
|
66
|
+
"variant.video",TE(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.vE(_.Uk(n.mimeType,n.codecs));p||_.Nh("Dropping text stream. Is not supported by the platform.",n);return p})};UE=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
67
|
+
WE=function(a){var b=a.audio,c=a.video,d=b?b.codecs:null,e=c?c.codecs:null,f=[];e&&f.push(e);d&&f.push(d);var g=c&&c.mimeType||null,h=b&&b.mimeType||null,l=[];b&&l.push(b.kind);c&&l.push(c.kind);l=l[0]||null;var m=new Set,n=new Set;if(b)for(var p=_.w(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.w(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(u){return u?u.accessibility||[]:[]}).reduce(function(u,v){return u.concat(v)},[]);a={id:a.id,active:!1,type:"variant",
|
|
69
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,
|
|
70
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};
|
|
71
|
-
|
|
72
|
-
accessibility:a.accessibility,keyId:null}};
|
|
73
|
-
_
|
|
74
|
-
h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
75
|
-
|
|
76
|
-
|
|
70
|
+
XE=function(a){return{id:a.id,active:!1,type:_.P,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}};YE=function(a){return a.allowedByApplication&&a.allowedByKeySystem};LE=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.w(c);for(var e=c.next();!e.done;e=c.next()){e=e.value;var f=e.audio.channelsCount;d.has(f)||d.set(f,[]);d.get(f).push(e)}c=Array.from(d.keys());if(0===c.length)return a;e=c.filter(function(g){return g<=b});return e.length?d.get(Math.max.apply(null,e)):d.get(Math.min.apply(null,c))};
|
|
72
|
+
_.$E=function(a,b,c,d){b=_.mi(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=_.PC(_.gj(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.gj(m.language)===l}),!0):!1});e=e.filter(function(h){return d?h.kind===_.ue:h.kind!==_.ue});if(c){b=ZE(e,c);if(b.length)return b;_.Ih("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(_.IC,[]);return b.length?ZE(e,b[0]):e};ZE=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
74
|
+
TE=function(a){var b=SC(a);return a.type===_.cd?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.r?"type\x3dvideo mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" frameRate\x3d"+a.frameRate+" width\x3d"+a.width+" height\x3d"+a.height:"unexpected stream type"};
|
|
75
|
+
aF=function(a,b){var c=String(_.nk++);c=new _.hk(c,a);c.mimeType=_.ik(b.mimeType);if(a===_.T||a===_.jk)c.label=_.ik(b.label),c.language=_.ik(b.language),c.originalLanguage=_.ik(b.originalLanguage);a===_.kk?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.jk?(c.channelsCount=b.channelsCount,c.roles=b.audioRoles||[],c.mimeType=_.ik(b.audioMimeType)):(c.kind=_.ik(b.kind),c.roles=b.roles);c.accessibility=a===_.kk||a===_.jk?(b.accessibility||[]).filter(function(d){return d.type===
|
|
77
76
|
a}):b.accessibility||[];return c};
|
|
78
|
-
|
|
79
|
-
d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
c=d}return c}catch(l){throw new _.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
n)}))}else if(b===_.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
a.h=b}};
|
|
90
|
-
|
|
91
|
-
_.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
b.C.setPlaybackRate(b.a.chasingRate,_.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
m);_.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
a;if(0===g.length||!e)throw _.
|
|
112
|
-
|
|
113
|
-
b.start);b=_.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
_.
|
|
117
|
-
|
|
118
|
-
c)};
|
|
119
|
-
|
|
120
|
-
_.
|
|
121
|
-
_.
|
|
122
|
-
var g=a.l[f];if(g&&g.
|
|
123
|
-
(
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
a.l[b].
|
|
129
|
-
|
|
130
|
-
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=_.w(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.
|
|
131
|
-
|
|
132
|
-
a.w,n=
|
|
133
|
-
d=Infinity;l=_.w(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
0;v.then(function(){return a.f||a.A?null:
|
|
141
|
-
|
|
142
|
-
_.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
a.C.
|
|
150
|
-
"Appending segment with "+(F.toFixed(3)+" - "+
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
h.variant.video);h.variant&&h.variant.audio&&l.set(_.
|
|
158
|
-
a.C.onError(new _.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
c);c=a.C.
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
_.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
a
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
77
|
+
bF=function(a,b,c){var d=new _.sk(a===_.kk?""+b.videoId:a===_.jk?""+b.audioId:""+b.id,c);switch(a){case _.kk:d.codec=_.ik(b.videoCodec);d.bandwidth=b.videoBandwidth||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.originalVideoId;d.drm={keyId:b.keyId||void 0};break;case _.jk:d.codec=_.ik(b.audioCodec);d.bandwidth=b.audioBandwidth||b.bandwidth;d.originalId=b.originalAudioId;d.drm={keyId:b.keyId||void 0};break;default:d.codec=_.ik(b.codecs),d.originalId=b.originalTextId}(a=c.renditions.find(function(e){return _.M.la(e,
|
|
78
|
+
d,null,["id","track"])}))||c.renditions.push(d);return a||d};cF=function(a,b){var c=a.reduce(function(d,e){b===_.kk?null===e.videoId||d[e.videoId]&&!e.active||(d[e.videoId]=e):b===_.jk&&(null===e.audioId||d[e.audioId]&&!e.active||(d[e.audioId]=e));return d},{});return Object.values(c)};dF=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
|
+
eF=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};_.fF=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};gF=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}};hF=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
80
|
+
jF=function(a,b){try{if(1===a.length)return a[0];if(!a.every(iF))throw new _.Ei("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=_.fh(a[0].periods).concat(),e=1;e<a.length;e++){var f=gF(a[e-1]).end;_.fF(a[e].periods,f);d.push.apply(d,_.fh(a[e].periods))}d={adaptedPeriods:d,periods:d,presentationTimeline:b,minBufferTime:0};var g=gF(d).end;_.oD(b.a,0,g);var h=a[0].presentationTimeline.sc();h&&_.rD(b,h.seekRangeStartDateTime);
|
|
81
|
+
c=d}return c}catch(l){throw new _.N(_.O,7,7003,"Failed to join manifests into a continuous playlist!",l);}};kF=function(a,b){var c=b.periods[0].configurationId,d=_.fh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={adaptedPeriods:d,periods:d,presentationTimeline:e,minBufferTime:0};_.sD(e,b.presentationTimeline.l);return jF([d,b],e)};iF=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
82
|
+
lF=function(){this.g=new _.K("cl.api.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};mF=function(a,b){return a.h.filter(function(c){return c.type===b})};nF=function(a,b){var c=a.a.get(b)||null;return c&&c.track};pF=function(a,b,c){if(!c||nF(a,c.type)!==c||a.m.ra())switch(b){case _.kk:a.$a(c&&c.renditions[0]);break;case _.jk:a.jb(c&&c.renditions[0]);break;case _.T:a.kb(c&&c.renditions[0]);break;default:oF(a,b,c&&c.renditions[0])}};
|
|
83
|
+
qF=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
|
+
oF=function(a,b,c,d){d=void 0===d?!1:d;if(a.m&&((a.a.get(b)||null)!==c||a.m.ra())){var e=a.m;if(c){if(0>a.h.indexOf(c.track))throw Error("Unknown rendition with ID "+c.id);if(b!==c.track.type)throw Error("Types mismatch");a.g.debug("Activate rendition type\n "+b+" with ID: "+c.id);if(b===_.T){var f=e.ia().find(function(n){return n.id===parseInt(c.id,10)});f&&(a.f.set(b,c),qF(a,c),e.trigger(new _.L(_.Sl)),rF(e,!0).then(function(){sF(e,f)})["catch"](function(n){a.g.warn("Error while activating track",
|
|
85
|
+
n)}))}else if(b===_.jk)a.f.set(b,c),tF(e,parseInt(c.id,10));else if(b===_.kk){var g=a.a.get(_.jk)||null,h=null;if(g){var l=uF(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
|
+
uF(e).find(function(n){return n.videoId===parseInt(c.id,10)})||null;h?(a.f.set(b,c),vF(e,h,d)):a.g.warn("Cannot find matching variant")}}else a.g.debug(_.Ja+b),(h=nF(a,b))&&(b===_.T?rF(e,!1).then(function(){a.a.set(b,null);e.trigger(new _.L(_.Sl))})["catch"](function(n){a.g.warn("Error while de-activating text tracks",n)}):b===_.jk?a.g.info("Enabling ABR for audio is not supported"):b===_.kk&&h.trickPlay?a.g.info("Enabling ABR for trick play tracks is not supported"):vF(e,null,d))}};
|
|
87
|
+
yF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.w(Object.values(_.nv)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.w(a.m.ia());for(var e=d.next();!e.done;c={ic:c.ic},e=d.next()){e=e.value;c.ic=aF(_.T,e);var f=b.find(function(h){return function(l){return h.ic.la(l)}}(c));c.ic=f||c.ic;var g=bF(_.T,e,c.ic);e.active&&a.a.set(_.T,g);f||b.push(c.ic)}wF(a.m)||a.a.set(_.T,null);c=uF(a.m);xF(a,b,c,_.kk);xF(a,b,c,_.jk);
|
|
88
|
+
a.h=b}};xF=function(a,b,c,d){var e=cF(c,d);c={};e=_.w(e);for(var f=e.next();!f.done;c={jc:c.jc},f=e.next()){f=f.value;c.jc=aF(d,f);var g=b.find(function(l){return function(m){return l.jc.la(m)}}(c));c.jc=g||c.jc;var h=bF(d,f,c.jc);f.active&&a.a.set(d,h);g||b.push(c.jc)}};
|
|
89
|
+
zF=function(a,b,c){if(b){a.h.length||yF(a);for(var d=b.type,e=a.a.get(d)||null,f,g=_.w(mF(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&&(qF(a,f),d===_.jk?a.m.trigger(new _.L(_.Rl)):d===_.kk&&a.m.trigger(new _.L(_.Og,{details:{width:f.width||0,height:f.height||0,bandwidth:f.bandwidth,track:f.track,abrSelection:c}})))}};AF=function(){this.f=new _.jD(2);this.h=new _.jD(5);this.a=0};
|
|
90
|
+
_.BF=function(){this.g=new _.K("clpp.abr");this.w=null;this.h=!1;this.o=new AF;this.l=[];this.j=1;this.D=this.B=!1;this.A=this.a=this.f=null};CF=function(a,b){b=b.filter(function(c){return!(c.video&&c.video.trickPlay)});a&&(b=b.filter(function(c){return RE(c,a,{width:Infinity,height:Infinity})}));return b.sort(function(c,d){return c.bandwidth-d.bandwidth})};DF=function(){this.a=null};FF=function(a,b){if(b&&(null==a.a||a.a!==b))throw EF(a);};
|
|
91
|
+
EF=function(a){return new _.N(_.O,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};GF=function(){this.a=new Map};IF=function(a,b){a.a.has(b)||a.a.set(b,new HF);return a.a.get(b)};HF=function(){this.text=this.variant=null};JF=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.w(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
92
|
+
MF=function(a,b,c){c=void 0===c?!0:c;var d;if(!(d=!!a.audio!==!!b.audio||!!a.video!==!!b.video||a.language!==b.language)&&(d=a.audio&&b.audio)){d=a.audio;var e=b.audio;d=!(d.channelsCount===e.channelsCount&&(!c||KF(d,e))&&LF(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||KF(a,b))&&LF(a.roles,b.roles)));return d?!1:!0};
|
|
93
|
+
KF=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=TC(a.codecs).map(function(f){return _.UC(f)}),d=TC(b.codecs).map(function(f){return _.UC(f)});if(c.length!==d.length)return!1;c.sort();d.sort();for(var e=0;e<c.length;e++)if(c[e]!==d[e])return!1;return!0};LF=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Pe);d["delete"](_.Pe);if(c.size!==d.size)return!1;c=_.w(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
94
|
+
OF=function(a){var b=void 0===b?_.Lf:b;this.f=a;this.a=b;this.h=new NF(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};NF=function(a,b,c,d,e){this.j=_.mi(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Lf:e};PF=function(a,b){var c=null;b.some(function(d){c=_.PC(_.gj(d),a.map(function(e){return OC(e)}));return!!c});return c?a.filter(function(d){return c===OC(d)}):[]};
|
|
95
|
+
QF=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)})};RF=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};UF=function(a,b){this.a=SF;this.f=(new Map).set(SF,b).set(TF,a)};
|
|
96
|
+
WF=function(a){var b=this;this.C=a;this.a=a.getConfiguration().streaming;this.f=new _.Xh;this.g=new _.K("clpp.mse.media.LiveEdgeObserver");VF(this)&&(a=this.C.getSurface().getMedia(),this.f.on(a,_.ug,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,_.Zd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.C.setPlaybackRate(1))}))};
|
|
98
|
+
VF=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};
|
|
99
|
+
YF=function(a,b,c,d,e){this.j=a;this.D=c;this.a={};this.G={};this.N=!1;this.f=null;this.h={};this.l=new _.Xh;this.K=!1;this.w={};this.I=b;this.B=d;this.J=e;this.V=this.J.streaming.maxSegmentToMediaOffset||1;this.L=new _.Rj;this.A="";this.H={};this.o=XF(this,this.L);this.R=!0;this.g=new _.K("clpp.mse.MediaSourceEngineSmooth")};
|
|
100
|
+
XF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,rC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,sC,function(){a.R=!0});a.l.on(c,"endstreaming",function(){a.R=!1});a.A=ZF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=ZF(c);a.l.one(c,rC,function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};
|
|
101
|
+
$F=function(a,b){b.forEach(function(c,d){var e=a.o.addSourceBuffer(c);a.l.on(e,_.te,a.T.bind(a,d));a.l.on(e,"updateend",a.nc.bind(a,d));a.a[d]=e;a.G[d]=c;a.h[d]=[];a.H[d]=!1});a.N=b.has(_.cd)&&b.has(_.r)};aG=function(a,b){try{return new _.Xl(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error(gC+b,c),null}};bG=function(a,b){if(!a.a[b])return"";var c=aG(a,b);return c?c.toString():""};
|
|
102
|
+
eG=function(a,b,c,d,e,f){return[f?Promise.resolve():cG(a,b,function(){try{a.g.debug(pB+b+eB);var g=a.a[b].appendWindowStart,h=a.a[b].appendWindowEnd;a.a[b].abort();a.a[b].appendWindowStart=g;a.a[b].appendWindowEnd=h}catch(l){throw a.g.warn(CB+b+eB,l),l;}a.g.debug(wB+b+eB);a.nc(b)}),cG(a,b,function(){return dG(a,b,c)}),cG(a,b,function(){try{a.g.debug(UB+b,d,e),a.a[b].appendWindowStart=0,a.a[b].appendWindowEnd=e,a.a[b].appendWindowStart=d}catch(g){throw a.g.warn(GB+b,d,e,g),g;}a.g.debug(AB+b,d,e);a.nc(b)})]};
|
|
103
|
+
dG=function(a,b,c){0>c&&(c+=.001);try{a.g.debug(WB+b,c),a.a[b].timestampOffset=c}catch(d){throw a.g.warn(HB+b,c,d),d;}a.g.debug(BB+b,c);a.nc(b)};cG=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.Rj};a.h[b].push(c);1===a.h[b].length&&fG(a,b);return c.p};fG=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug(YB+b),c.start()}catch(d){d.name===QB?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),gG(a,b)}else a.g.debug(MB+b)};
|
|
104
|
+
hG=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(a.K)return p["return"](Promise.reject());c=[];for(d in a.a)e=new _.Rj,f={start:function(q){q.resolve()}.bind(null,e),p:e},a.h[d].push(f),c.push(e),1===a.h[d].length&&f.start();_.D(p,2);return _.y(p,Promise.all(c),4);case 4:_.th(p,3);break;case 2:g=_.E(p);for(h in a.a)a.h[h].length&&a.h[h].shift();return p["return"](Promise.reject(g));case 3:for(l in a.a);_.D(p,5,6);return _.y(p,b(),6);case 6:_.uh(p);for(m in a.a)gG(a,
|
|
105
|
+
m);_.vh(p,0);break;case 5:return n=_.E(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};gG=function(a,b){a.h[b].shift();fG(a,b)};iG=function(a,b,c){return cG(a,b,function(){b===_.P?a.g.debug("Change not supported for "+b):(a.g.debug("Change Type: "+a.G[b]+" -\x3e "+c),WC()?(a.a[b].changeType(c),a.G[b]=c):a.g.debug("Change Type not supported"),a.nc(b))})};
|
|
106
|
+
jG=function(a,b,c,d){var e,f,g,h,l;return _.I(function(m){return 1==m.a?(e=_.UC(_.Wk(a.G[b])),f=_.Vk(a.G[b]),g=_.Uk(c,d),h=_.UC(_.Wk(g)),l=_.Vk(g),e===h&&f===l?m["return"](!1):a.J.mediaSource.codecSwitchingStrategy===_.gg&&WC()?_.y(m,iG(a,b,g),2):m.F(2)):m["return"](!0)})};kG=function(a){this.h=a;this.a=null;this.f=function(){}};lG=function(a,b){a.f=b};
|
|
107
|
+
mG=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.vh();this.w=_.Zd;this.j=null;this.a=new _.Zk(function(){b.A||b.f.Jl(.25*b.h)});this.g=new _.K("clpp.mse.media.PlayRateController")};nG=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
108
|
+
qG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Zd||0===c||1===c)try{oG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),pG(a)}else pG(a)};pG=function(a){a.g.debug(VB,a.h,' using "seek" mode.');oG(a,0);a.o=!0;a.a.mb(.25)};oG=function(a,b){if(a.f.vh()!==b){a.g.debug(VB,b,' using native playbackRate "decoder" mode.');try{a.f.hn(b)}catch(c){throw c;}}};
|
|
109
|
+
sG=function(a){function b(){d=!0}function c(m){f.push(m);_.Sm(m)}a=_.oj(a);var d=!1,e,f=[],g=[];(new _.Rm).M(_.We,c).M(_.vg,c).M(_.Re,c).M(_.Ve,c).M(_.lg,c).Y(_.ng,function(m){e=m;f.push(m);_.Tm(m)}).Y("encv",b).Y("enca",b).Y("avc1",function(m){g.push({M:m,fd:1701733238})}).Y("avc3",function(m){g.push({M:m,fd:1701733238})}).Y("ac-3",function(m){g.push({M:m,fd:1701733217})}).Y(_.pe,function(m){g.push({M:m,fd:1701733217})}).Y("mp4a",function(m){g.push({M:m,fd:1701733217})}).parse(a);if(d)return _.Mh("Init segment already indicates encryption."),
|
|
110
|
+
a;if(0===g.length||!e)throw _.Oh("Failed to find boxes needed to fake encryption!"),_.Oh("Failed init segment (hex):",_.Cj(a)),new _.N(_.O,3,14E3);g.reverse();for(var h=_.w(g),l=h.next();!l.done;l=h.next())l=l.value,_.Mh('Inserting "'+_.Wm(l.fd)+'" box into init segment.'),a=rG(a,e,l.M,f,l.fd);return a};
|
|
111
|
+
rG=function(a,b,c,d,e){var f=tG.value(),g=a.subarray(c.start,c.start+c.size),h=_.vj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.vj(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);uG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.bl("Xbox One")||_.al()?c.start:c.start+c.size;f=a.subarray(c);e.set(a.subarray(0,c));e.set(l,c);e.set(f,c+l.byteLength);a=_.w(d);for(d=a.next();!d.done;d=a.next())d=d.value,uG(e,d.start,d.size+l.byteLength);l=_.vj(e,
|
|
112
|
+
b.start);b=_.Xm(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};uG=function(a,b,c){a=_.vj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.vG=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};xG=function(a){var b=a.a.get(_.r);return b?wG(a)[b.Lb]:(b=a.a.get(_.cd))?wG(a)[b.Lb]:null};
|
|
113
|
+
zG=function(a){return _.yG(a,_.cd)};AG=function(a){return _.yG(a,_.r)};
|
|
114
|
+
FG=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){switch(q.a){case 1:return c=_.Mp,_.y(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),_.y(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.y(q,BG(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.Hb(),n=CG(a,m),p=DG(b,n,0),a.a.set(c.TEXT,p),EG(a,p,0));
|
|
115
|
+
_.B(q)}})};IG=function(a){a.I=!0;var b=a.a.get(_.P);b&&(GG(b),HG(b)["catch"](function(){}),a.a["delete"](_.P))};KG=function(a,b,c,d){b.video&&_.JG(a,b.video,c,d);b.audio&&_.JG(a,b.audio,c,d)};MG=function(a,b){a.j.adaptedPeriods=b.adaptedPeriods;a.j.periods=b.periods;LG(a)};
|
|
116
|
+
OG=function(a){function b(l){return a.C.W.tb(l,c,0)}var c=a.C.Hb(),d=!1,e=CG(a,c);if(_.lj(a.a.values(),function(l){return l.Lb===e}))for(var f=_.w(a.a.keys()),g=f.next();!g.done;g=f.next()){g=g.value;var h=a.a.get(g);h.stream.segmentIterator=null;b(g)||(NG(a,h),d=!0)}else if(!_.lj(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.w(a.a.values());for(f=d.next();!f.done;f=d.next())NG(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
117
|
+
c)};RG=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=_.w(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=PG(d);if(d.Zc||b&&QG(d))a.g.info(e,"Retrying after failure..."),d.Zc=!1,EG(a,d,.1)}};SG=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.bb})};
|
|
118
|
+
TG=function(a){var b=Array.from(a.a.values());return a.B&&b.every(function(c){return c.endOfStream})};VG=function(a){var b,c,d,e;return _.I(function(f){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,GG(e),e.hb&&e.Nb&&(e.hb=!1,b.push(e.Nb.abort())),e.Rb&&b.push(UG(a,e,!0,0));return _.y(f,Promise.all(b),0)})};WG=function(a,b,c){(a=a.a.get(b))&&c&&(GG(a),a.stream=c,a.$b=c,a.oa&&(a.oa=c.getSegmentReference(a.oa.position)),a.oa||(a.$b=null))};
|
|
119
|
+
_.yG=function(a,b){var c=a.a.get(b);return c?c.dc||c.stream:null};
|
|
120
|
+
_.JG=function(a,b,c,d){var e=a.a.get(b.type);if(!e&&b.type===_.P&&a.h.ignoreTextStreamFailures)FG(a,b);else if(e){var f=gD(wG(a),b);if(c&&f!==e.Lb)for(a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods"),b=_.w(a.a.values()),c=b.next();!c.done;c=b.next())NG(a,c.value);else{e.dc&&(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(e.dc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(e.dc=null,a.g.debug("switch found no special trick play stream")));
|
|
121
|
+
var g=a.l[f];if(g&&g.Ob&&(g=a.o.get(b.id))&&g.Ob)if(e.stream!==b){g=a.j.presentationTimeline.getDuration();var h=a.C.Hb();h=XG(a,e,h);!c&&(e.endOfStream||h>=g)?a.g.debug(uC+PG(e)+" already buffered to the end. Not switching."):(b.type===_.P&&a.C.W.cc(_.Uk(b.mimeType,b.codecs)),e.stream=b,e.stream.segmentIterator=null,e.Ge=!0,a.g.debug("switch: switching to Stream "+PG(e)),YG(a,e,f)&&(a.g.info("Aborting current segment request to switch."),e.Nb.abort()),c&&(e.mc?e.Ue=!0:e.hb?(e.Rb=!0,e.oe=d,e.Ue=!0):
|
|
122
|
+
(GG(e),UG(a,e,!0,d)["catch"](function(l){if(a.C)a.C.onError(l)}))))}else a.g.debug(uC+PG(e)+" already active")}}};YG=function(a,b,c){if(!b.Nb)return!1;var d=a.C.Hb(),e=a.C.W.ha(b.type);c=(c=ZG(a,b,d,e,c))?c.Hd():null;if(null==c)return!1;var f=b.stream.initSegmentReference;f&&(c+=f.Hd()||0);f=a.C.we().getBandwidthEstimate();if(8*c/f<(null===e?0:e-d)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal))return!0;a=b.Nb;a=a.j?a.j.bytesRemaining:-1;return 0>a||a>c?!0:!1};
|
|
123
|
+
NG=function(a,b){var c=PG(b);b.mc?a.g.debug(c,"clear: already clearing the buffer"):b.Rb?a.g.debug(c,"clear: already waiting"):b.hb?(a.g.debug(c,"clear: currently updating"),b.Rb=!0,b.oe=0):null==a.C.W.Ha(b.type)?(a.g.debug(c,"clear: nothing buffered"),null==b.bb&&EG(a,b,0)):(a.g.debug(c,"clear: handling right now"),GG(b),UG(a,b,!1,0)["catch"](function(d){if(a.C)a.C.onError(d)}))};
|
|
124
|
+
$G=function(a,b,c,d,e){var f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a)return f=a.C.Hb(),g=CG(a,f),h=_.Mp,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,_.y(q,n.init(l,p,a.h.disableAudioTracks),2);if(3!=q.a){if(a.f)return q["return"]();LG(a);return _.y(q,BG(a,m),3)}if(a.f)return q["return"]();l.forEach(function(u,v){if(!a.a.has(v)){var z=DG(u,g,e);a.a.set(v,z);EG(a,z,0)}});_.B(q)})};
|
|
125
|
+
DG=function(a,b,c){return{stream:a,type:a.type,$b:null,segmentIterator:null,oa:null,dc:null,Ge:!0,Lb:b,endOfStream:!1,hb:!1,bb:null,Rb:!1,oe:0,Ue:!1,mc:!1,bg:!1,Zc:!1,ri:c||0,Nb:null,ue:!1,Nh:0}};
|
|
126
|
+
aH=function(a,b){var c=a.l[b];if(c)return a.g.debug("(all) Period "+b+gB),c.P;a.g.debug("(all) setting up Period "+b);c={P:new _.Rj,Ob:!1};a.l[b]=c;for(var d=new Set,e=_.w(wG(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=_.w(wG(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:BG(a,d)}).then(function(){a.f||(a.l[b].P.resolve(),
|
|
127
|
+
a.l[b].Ob=!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};
|
|
128
|
+
BG=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u;return _.I(function(v){switch(v.a){case 1:c=[];d=_.w(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+gB),c.push(g.P)):(a.g.debug("(all) setting up Stream "+f.id),a.o.set(f.id,{P:new _.Rj,Ob:!1}),h=a.C.wb,c.push(f.createSegmentIndex(h)));_.D(v,2);return _.y(v,Promise.all(c),4);case 4:if(a.f)return v["return"]();_.th(v,3);break;case 2:l=_.E(v);if(a.f)return v["return"]();m=_.w(b);for(e=m.next();!e.done;e=m.next())n=
|
|
129
|
+
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=_.w(b);for(e=p.next();!e.done;e=p.next())q=e.value,u=a.o.get(q.id),u.Ob||(u.P.resolve(),u.Ob=!0,a.g.debug("(all) setup Stream "+q.id));_.B(v)}})};LG=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?a.C.W.wf(b):a.C.W.wf(Math.pow(2,32))};
|
|
130
|
+
dH=function(a,b){function c(p){return p.type===_.P&&p.stream.mimeType===_.Vc}if(c(b))return a.C.W.Pg(b.stream.originalId||""),null;b.type===_.P&&a.C.W.Hg();if(!a.C.W.Kh()&&b.type!==_.P)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=PG(b),e=a.C.Hb(),f=XG(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=gD(wG(a),b.stream),h=CG(a,f),l=a.C.W.ya(b.type,e);a.g.debug(d,"update_:",nC+e,"bufferedAhead\x3d"+l);var m=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*
|
|
131
|
+
a.w,n=tD(a.j.presentationTimeline);if(null!=n&&f>=n&&!b.ue)return bH(a,b),null;b.endOfStream=!1;b.Lb=h;if(h!==g)return a.g.debug(d,"need Period "+h,nC+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.ha(b.type);h=ZG(a,b,e,h,g);if(!h)return a.j.presentationTimeline.isLive()||b.type===_.P?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),bH(a,b),null);
|
|
132
|
+
d=Infinity;l=_.w(a.a.values());for(m=l.next();!m.done;m=l.next())m=m.value,c(m)||(m=XG(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.ri=0;cH(a,b,e,g,h)["catch"](function(){});return null};bH=function(a,b){a.g.debug(PG(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.r){var c=a.a.get(_.P);c&&c.stream.mimeType===_.Vc&&(c.endOfStream=!0)}};
|
|
133
|
+
XG=function(a,b,c){if(!b.$b||!b.oa)return Math.max(c,b.ri);c=gD(wG(a),b.$b);return wG(a)[c].startTime+b.oa.endTime};
|
|
134
|
+
ZG=function(a,b,c,d,e){if(b.stream.segmentLookupStrategy===_.iC)b.stream.segmentIterator?a=KD(b.stream.segmentIterator):b.oa||d?(c=b.oa?b.oa.endTime:d,a.g.info(JB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=OD(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(JB,dC,"endTime:",c,b.oa)),a=e):(e=Math.max(0,c-wG(a)[e].startTime),a.g.info(JB,"looking up segment","lookupTime:",e,mC,c),d=null,d||(b.stream.segmentIterator=
|
|
135
|
+
OD(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(JB,dC,"lookupTime:",e,mC,c),a=d);else{var f=PG(b);if(b.oa&&b.stream===b.$b)c=b.oa.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=eH(a,b,e,c);else{if(b.oa){a.g.debug(f,"next position unknown: another Stream buffered");f=gD(wG(a),b.$b);var g=fH(a,b,wG(a)[f].startTime+b.oa.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=fH(a,b,d||c,e);if(null==g)a=null;else if(f=eH(a,b,
|
|
136
|
+
e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Aa+d.startTime+2>c&&(a=eH(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};fH=function(a,b,c,d){var e=PG(b);d=wG(a)[d];var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",nC+c,"lookupTime\x3d"+f,fC+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",fC+d.startTime,"lookupTime\x3d"+f);return b};
|
|
137
|
+
eH=function(a,b,c,d){var e=PG(b);c=wG(a)[c];var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",fC+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.zD(g);g=yD(g);return!b.ue&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",fC+c.startTime,qC+f.startTime,oC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
138
|
+
cH=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,G;return _.I(function(F){f=_.Mp;g=PG(b);h=wG(a)[d];a.g.debug(g,"fetchAndAppend_:",nC+c,fC+h.startTime,pC+e.position,qC+e.startTime,oC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=wG(a)[d+1];q=Math.max(0,h.startTime-.1);u=p?p.startTime+.01:n;v=gH(a,b,d,q,u,e);b.hb=!0;b.Ge=!1;a.g.debug(g,"fetching segment");z=!1;A=function(C,H){if(a.f||a.A)return null;z=!0;return hH(a,b,c,h,l,e,C,H)};G=a.C.W.ha(b.type)||
|
|
139
|
+
0;v.then(function(){return a.f||a.A?null:iH(a,b,e,!1,function(C){return A(C.data,!0)})}).then(function(C){return a.f||a.A?null:z||null===C?(jH(a,b,G,e,l),null):A(C,!1)}).then(function(){if(!a.f&&!a.A){jH(a,b,G,e,l);b.hb=!1;b.bg=!1;b.Rb||a.C.Le();if(m){var C=m.next().value;C&&a.g.debug("New iterated segment",C)}EG(a,b,0);kH(a,b,l);a.g.debug(g,"finished fetch and append")}})["catch"](function(C){return _.I(function(H){if(a.f||a.A)return H["return"]();b.hb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===
|
|
140
|
+
C.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),H.F(0);if(7001===C.code)return b.hb=!1,b.bb=null,EG(a,b,0),H.F(0);if(3017===C.code)return lH(a,b,C),H.F(0);if(1001===C.code&&C.data&&404===C.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",pC+e.position,qC+e.startTime,oC+e.endTime,"error\x3d"+C),b.hb=!1,b.bb=null,EG(a,b,1),H.F(0);if(b.type===f.TEXT)return C instanceof
|
|
141
|
+
_.N&&C.a(1),GG(b),a.C.onError(new _.N(1,2,2010,C)),H.F(0);if(1001<=C.code&&1003>=C.code)return _.y(H,mH(a,b,h,C),0);a.g.error(g,"failed fetch and append: code\x3d"+C.code);b.Zc=!0;C instanceof _.N&&C.a(_.O);return _.y(H,nH(a,C),0)})});_.B(F)})};
|
|
142
|
+
lH=function(a,b,c){var d=PG(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.bg}))a.g.debug(d,LB,"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.Zc=!0;a.A=!0;a.C.onError(c);return}a.g.warn(d,LB,"reducing buffering goals by "+(100-Math.round(100*a.w))+"%");b.bg=!0}EG(a,b,4)};
|
|
143
|
+
mH=function(a,b,c,d){var e,f;return _.I(function(g){e=1001===d.code&&500<=d.data.status;f=!0;e||(f=!a.C.mf(b.stream,c));if(!f)return g.F(0);b.Zc=!0;d.a(_.O);return _.y(g,nH(a,d),0)})};
|
|
144
|
+
gH=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,u;return _.I(function(v){g=wG(a)[c];h=g.startTime-f.Aa;l=b.Ge||f.initSegment!==(b.oa&&b.oa.initSegment);if(!l&&h===b.Nh)return v["return"](Promise.resolve());b.Nh=h;m=PG(b);a.g.debug(m,"setting timestamp offset to "+h);a.g.debug(m,"setting append window start to "+d);a.g.debug(m,"setting append window end to "+e);n=a.C.W.si(b.type,h,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!l)return v["return"](n);a.g.debug(m,"fetching init segment");
|
|
145
|
+
p=f&&f.initSegment||b.stream.initSegmentReference;q=iH(a,b,p,!0);u=q.then(function(z){if(a.f)return null;a.g.debug(m,"appending init segment");return oH(a,z,b).then(function(){return a.C.W.qe(b.type,z,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size)})})["catch"](function(z){b.Ge=!0;return Promise.reject(z)});return v["return"](Promise.all([n,u]))})};
|
|
146
|
+
oH=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.al())return e.F(0);d=sG(b);return _.y(e,a.C.W.qe(c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
147
|
+
hH=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,u,v,z,A;return _.I(function(G){switch(G.a){case 1:l=PG(b);if(!(e&&e.keyId&&a.C.yd)){G.F(2);break}m=BC(a.C.yd,e.keyId);if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);G.F(2);break}_.D(G,4);return _.y(G,m,6);case 6:_.th(G,2);break;case 4:n=_.E(G),a.g.warn("DRM session load failed!",n);case 2:if(!(e.encrypted&&e.keyId&&a.C.yd&&DC(a.C.yd,e.keyId))){G.F(7);break}GG(b);p=gD(wG(a),e);q=pH(a,p);if(!q){G.F(8);break}return _.y(G,q,8);case 8:return u=
|
|
148
|
+
a.C.mf(e,d,jC),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.")),G["return"](Promise.resolve());case 7:return A=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.Rm).Y("emsg",a.Fm.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),G["return"](qH(a,b,c).then(function(){if(a.f)return null;var F=f.startTime+d.startTime,C=f.endTime+d.startTime;a.g.debug(l,
|
|
149
|
+
"Appending segment with "+(F.toFixed(3)+" - "+C.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.lf(e.bandwidth)+" Fragment: ")+h);return a.C.W.qe(b.type,g,F,C,A,e.id,h)}).then(function(){a.f||(a.g.debug(l,"appended media segment"),b.$b=e,b.oa=f)}))}})};
|
|
150
|
+
jH=function(a,b,c,d,e){if(!a.j.presentationTimeline.isLive()&&b.type!==_.P){var f=PG(b),g=(a.C.W.ha(b.type)||0)-c,h=d.endTime-d.startTime;c=g-h;if(Math.abs(c)>=Math.min(.01,h)&&Math.abs(c)<=Math.min(1,h))for(a.g.debug(f,"Adjusted segment",d.position,"with real duration",g,"and accounted for",c,"delta between segment duration and real duration"),b.ue=!0,a=wG(a),e.adjustSegmentDurations(d.position,c),d=gD(a,e),b=a[d],e=e.getDuration(),iD(b,e),e=d+1;e<a.length;e++)a[e].startTime+=c}};
|
|
151
|
+
rH=function(a,b,c){(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).M(_.Ve,_.Sm).M(_.lg,_.Sm).Y(_.ng,_.Tm).M("encv",function(d){d.reader.skip(78);_.Sm(d)}).M(_.fg,_.Sm).M("schi",_.Sm).M("tenc",function(d){d.reader.skip(6);if(_.Lm(d.reader)){d.reader.skip(1);var e=_.Cj(_.Qm(d.reader,16));e!==b.stream.keyId&&(a.g.debug(PG(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)};
|
|
152
|
+
qH=function(a,b,c){if(a.f)return Promise.resolve();var d=PG(b);a.g.debug(d,"checking buffer length");var e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h),f=a.C.W.Ha(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",nC+c,aC+e),Promise.resolve();var g=c-f,h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",nC+c,bC+g,aC+e,"underflow\x3d"+Math.abs(h)),Promise.resolve();a.g.debug(d,"buffer behind too large:",nC+c,bC+g,aC+e,"overflow\x3d"+h);return a.C.W.remove(b.type,
|
|
153
|
+
f,f+h).then(function(){a.f||a.g.debug(d,"evicted "+h+" seconds")})};kH=function(a,b,c){if(!a.B){b=PG(b);var d=Array.from(a.a.values());1!==d.length||d[0].type!==_.P?a.B=d.every(function(e){return e.type===_.P||a.D?!0:!e.Rb&&!e.mc&&e.oa}):a.D&&(a.B=!0);a.B&&(a.g.debug(b,"startup complete"),c=gD(wG(a),c),pH(a,c))}};
|
|
154
|
+
pH=function(a,b){var c=null;a.l[b]||(c=aH(a,b).then(function(){a.f||(a.g.debug(cC),a.C.Pf())})["catch"](JC));for(var d=0;d<wG(a).length;++d)aH(a,d)["catch"](JC);a.C.zm&&(a.g.debug("calling onStartupComplete()..."),a.C.zm());return c};
|
|
155
|
+
sH=function(a,b){var c=PG(b),d=gD(wG(a),b.stream);if(b.Lb!==d){var e=b.Lb,f=Array.from(a.a.values());f.every(function(g){return g.Lb===e})?f.every(QG)?(a.g.debug(c,"all need Period "+e),aH(a,e).then(function(){if(!a.f)if(a.C.W.pi(),f.every(function(n){var p=QG(n),q=gD(wG(a),n.stream);return p&&n.Lb===e&&q!==e})){var g=wG(a)[e];a.g.debug(c,"Streaming period",e,g);a.g.debug(c,"calling onChooseStreams()...");var h=a.C.Qf(g);a.D=!h.variant&&!!h.text;var l=new Map;h.variant&&h.variant.video&&l.set(_.r,
|
|
156
|
+
h.variant.video);h.variant&&h.variant.audio&&l.set(_.cd,h.variant.audio);h.text&&l.set(_.P,h.text);var m=_.w(a.a.keys());for(h=m.next();!h.done;h=m.next())if(h=h.value,!l.has(h)&&h!==_.P){a.g.error(c,"invalid Streams chosen: missing "+h+" Stream");a.C.onError(new _.N(_.O,5,5005));return}m=_.w(Array.from(l.keys()));for(h=m.next();!h.done;h=m.next())if(h=h.value,!a.a.has(h))if(h===_.P)$G(a,null,null,l.get(_.P),g.startTime),l["delete"](h);else{a.g.error(c,"invalid Streams chosen: unusable "+h+" Stream");
|
|
157
|
+
a.C.onError(new _.N(_.O,5,5005));return}g=_.w(Array.from(a.a.keys()));for(h=g.next();!h.done;h=g.next())h=h.value,(m=l.get(h))?(_.JG(a,m,!1,0),EG(a,a.a.get(h),0)):a.a["delete"](h);a.g.debug(c,cC);a.C.Pf()}else a.g.debug(c,"ignoring transition to Period",e,"since another is happening")})["catch"](JC)):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)}};
|
|
158
|
+
CG=function(a,b){var c=eD(wG(a),b+_.$u);return c?wG(a).indexOf(c):0};
|
|
159
|
+
iH=function(a,b,c,d,e){d=void 0===d?!1:d;e=void 0===e?null:e;var f=_.mD(c.Sa(),c.xa,c.ka,a.h.attemptParameters,c.startTime,c.endTime,b.type,c.timescale);f.type=2;f.onFragment=c.Vc?null:e;f.disableFragmentSupport=c.Vc||a.h.disableFragmentSupport;f.disableMergedFragments=a.h.disableMergedFragments;if(e=c.f())f.keyInfo=e,f.onFragment=null;d&&(f.responseModifiers.push(function(g){rH(a,b,g.data)}),b.type===_.r&&a.h.overridePasp&&f.responseModifiers.push(a.Bn.bind(a)));a.g.debug("fetching: reference\x3d",
|
|
160
|
+
c);c=a.C.wb.fetch(f);b.Nb=c;return c.P.then(function(g){var h=a.C.we(),l=g.timeMs,m=g.data.byteLength;l&&m&&!d&&h.segmentDownloaded(l,m);b.Nb=null;return g.data})};
|
|
161
|
+
UG=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=PG(b),b.Rb=!1,b.Ue=!1,b.oe=0,b.mc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.C.Hb(),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}),_.y(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.$b=null;b.oa=null;b.mc=!1;b.endOfStream=!1;b.ue=!1;EG(a,b,0);_.B(l)})};
|
|
162
|
+
EG=function(a,b,c){a.g.debug(PG(b),"updating in "+c+" seconds");b.bb=(new _.Xk(function(){var d;return _.I(function(e){if(1==e.a)return _.D(e,2),_.y(e,a.Mb(b),4);if(2!=e.a)return _.th(e,0);d=_.E(e);if(a.C)a.C.onError(d);_.B(e)})})).da(c)};GG=function(a){null!=a.bb&&(a.bb.stop(),a.bb=null)};wG=function(a){return a.j.adaptedPeriods||a.j.periods};HG=function(a){return _.I(function(b){return a.Nb?_.y(b,a.Nb.abort(),0):b.F(0)})};
|
|
163
|
+
nH=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.C.wi){d.F(2);break}_.D(d,3);return _.y(d,a.C.wi(b),5);case 5:_.th(d,2);break;case 3:c=_.E(d),c.cause=b,b=c;case 2:if(!b.f)a.C.onError(b);_.B(d)}})};PG=function(a){return"("+a.type+":"+a.stream.id+")"};QG=function(a){return!a.hb&&null==a.bb&&!a.Rb&&!a.mc};tH=function(){this.a=null};
|
|
164
|
+
wH=function(){_.hm.call(this,eC);var a=this;this.G=uH;this.j=this.Ga=null;this.qg=0;this.zi=2;this.Uc=null;this.mg=!1;this.o=new _.Xh;this.Jc=this.Fe=this.J=this.Oc=this.B=this.L=this.w=null;this.Nd=!1;this.f=this.A=this.a=this.I=this.K=null;this.h=new _.BF;this.$=null;this.Ei=1E9;this.Ie=new Set;this.fa=!0;this.Na=null;this.Ci=!1;this.Bi=0;this.ja=null;this.R=new GF;this.Di={width:Infinity,height:Infinity};this.H=null;this.lc=_.np;this.Fc=new NF(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
165
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.Ed=this.configuration.preferredTextLanguage;this.l=new DF;this.aa=this.Mc=null;this.Pc=new Map;this.Tb=null;this.De=this.configuration.preferredTextRole;this.Cd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.G===vH&&RG(a.a)});this.Me=this.Lc=this.Pe=null;this.ea=_.qa;this.Qd=new tH;this.Kd=[]};
|
|
166
|
+
xH=function(a){return new _.YC(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.w(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.fh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
167
|
+
yH=function(a,b){if(a.lc!==b){var c=_.S.Bk;if(a.lc===_.yp&&b!==_.np)c=c(b,_.wp),a.log.info(_.OB+c);else{var d=a.qg;d=0===d?0:Date.now()-d;var e=a.lc;a.lc=b;a.qg=Date.now();null!==a.J&&(a.J.A=b===_.Ap);a.H&&_.dp(a.H.a,a.lc);b===_.sp&&(a.zi=a.dg?1:2);var f=a.zi,g={currentState:a.lc,previousState:e,timeSinceLastStateChangeMS:d,reason:b===_.sp||e===_.sp?f:void 0},h=c(e,_.wp),l=c(b,_.wp);c=b!==_.sp?"":"["+c(f,_.vp)+"]";a.log.info(_.Qb+h+" -\x3e "+(l+c));a.trigger(new _.L(_.jg,{detail:g}));(b===_.up||b===
|
|
168
|
+
_.yp)&&a.Jc&&a.Jc.stop();b===_.sp?a.trigger(new _.L(_.od,{detail:{bufferedTimeMS:-1,reason:f}})):e===_.sp&&a.trigger(new _.L(_.nd,{detail:{bufferedTimeMS:d,reason:f}}))}}};zH=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.l.a;a.l.a=null;if(!b){c.F(2);break}return _.y(c,b["catch"](function(){}),2);case 2:return _.y(c,_.hm.prototype.release.call(a),4);case 4:return _.y(c,a.unload(),5);case 5:yH(a,_.np),_.B(c)}})};
|
|
169
|
+
AH=function(a){var b=new _.Nt;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};CH=function(a,b){var c,d;return _.I(function(e){a.ea===_.Lb&&(a.f=kF(a.f,hF(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,_.sD(a.f.presentationTimeline,!0),a.trigger(new _.L(_.Ke))),BH(a,a.f));_.B(e)})};
|
|
170
|
+
DH=function(a){return _.I(function(b){a.A.requestStop();a.A=null;a.ea===_.Lb?a.trigger(new _.L(_.Zf)):a.trigger(new _.L(_.Ke));_.B(b)})};
|
|
171
|
+
BH=function(a,b){var c=a.getMediaPosition(),d=a.Lc,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.w(e);for(var l=e.next();!l.done;l=e.next()){l=l.value;var m=l.endTime-l.startTime;l.configurationId===g?h.a+=m:(g=l.configurationId||"",h=new _.Mt(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));GC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
172
|
+
0;d<f.length;d++)if(!f[d].la(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.L(_.$f));ID(a.Me);EH(a)};EH=function(a){if(a.I&&0<a.Kd.length){a.Kd.forEach(function(c){var d=FC(a.Lc,c.configurationId);c.offset=d?d.rb():0});var b=a.Kd.sort(function(c,d){return(c.offset||0)-(d.offset||0)});FD(a.I,b);a.Kd=[]}};
|
|
173
|
+
KH=function(a){var b,c;return _.I(function(d){if(1==d.a)return FH(a),_.y(d,GH(a),2);if(3!=d.a){HH(a);b=_.Yj(4)||_.Yj(5);if(!b)return d.F(3);c=a.getSurface().getMedia();IH(a,c);return _.y(d,JH(a,c),3)}a.configuration=a.kc;_.B(d)})};
|
|
174
|
+
RH=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,h;return _.I(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.Rj,a.l.a=e,_.D(l,2),FH(a),_.y(l,LH(a),4);case 4:return FF(a.l,e),a.Z=_.Fp(b),a.configuration=_.fm(a.kc,b),a.log.info(_.yb,a.configuration),a.log.info(_.Pb,a.Z),_.y(l,MH(a,e),5);case 5:return FF(a.l,e),_.y(l,NH(a,b,a.getSourceIndex(),e,!1),6);case 6:return f=l.f,FF(a.l,e),a.A=f.parser,a.f=f.manifest,g=a,_.y(l,OH(a,a.f,a.configuration.drm),7);case 7:g.w=l.f;FF(a.l,e);if(!c){l.F(8);
|
|
175
|
+
break}return _.y(l,PH(a,e),9);case 9:FF(a.l,e),a.o.one(a.j,_.Le,function(){var m=Date.now()/1E3-d;a.H&&(a.H.A=m)});case 8:e.resolve();_.th(l,0);break;case 2:h=_.E(l),QH(a,h,e),_.B(l)}})};QH=function(a,b,c){b=SH(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};SH=function(a,b,c){var d=a.l;return null!=d.a&&d.a===c||b instanceof _.N&&7E3===b.code?b instanceof _.N?b:new _.N(_.O,7,7003,"Unexpected error.",b):EF(a.l)};LH=function(a){return a.Ga?a.Ga["catch"](function(){}):Promise.resolve()};
|
|
176
|
+
MH=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.H=new _.ip,yH(a,_.zp),a.$=new _.ju(a.getNetworkEngine()),HC(a.$,{enabled:a.configuration.abr.useCmsd}),c=TH(a,a.configuration),_.y(d,JH(a,c),2);FF(a.l,b);a.I=new DD;ED(a.I,function(e){a.log.info("Timeline cue found",e);UH(a,_.ii,e)});_.B(d)})};
|
|
177
|
+
NH=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return f=b,g=_.Fp(f),h=g[c],_.y(n,VH(a,h),2);case 2:return l=n.f,FF(a.l,d),_.Wn(kC),_.y(n,WH(a,l,h,f.id||""),3);case 3:m=n.f;FF(a.l,d);if(!e||!m.presentationTimeline.l){n.F(4);break}return _.y(n,l.stop(),5);case 5:FF(a.l,d);case 4:return _.Wn("manifest.end"),_.Xn("Fetch and parse manifest",kC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
178
|
+
XH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.y(f,NH(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,hF(c.manifest)],e=jF(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.O,7,7003,"Failed to append load manifest");}})};TH=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.M.S(b.volume)||a.setVolume(b.volume);_.M.S(b.muted)||a.setMuted(b.muted);IH(a,c);return c};
|
|
179
|
+
IH=function(a,b){a.j||(a.o.on(b,_.te,function(){if(a.j.error){var c=a.j.error.code;if(1===c)c=null;else{var d=a.j.error.msExtendedCode;d&&(0>d&&(d+=Math.pow(2,32)),d=d.toString(16));c=new _.N(_.O,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};HH=function(a){a.j&&(a.o.off(a.j,_.te),a.j=null)};
|
|
180
|
+
GH=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.G!==YH&&(a.G=uH);if(b=a.j)a.o.off(b,_.Le),a.o.off(b,_.zf),a.o.off(b,_.kf),a.o.off(b,_.se),a.o.off(b,_.Qf),a.o.off(b,_.Of);a.I&&(a.I.release(),a.I=null);a.Oc&&(a.Oc.release(),a.Oc=null);a.Jc&&(a.Jc.stop(),a.Jc=null);if(!a.A){c.F(2);break}return _.y(c,a.A.stop(),3);case 3:a.A=null;case 2:if(!a.h){c.F(4);break}return _.y(c,a.h.stop(),4);case 4:if(!a.a){c.F(6);break}return _.y(c,a.a.destroy(),7);case 7:a.a=null;case 6:a.B&&(a.B.release(),
|
|
181
|
+
a.B=null);a.J&&(a.J.release(),a.J=null);if(!a.L){c.F(8);break}return _.y(c,a.L.destroy(),9);case 9:a.L=null;case 8:a.Uc&&(a.Uc.release(),a.Uc=null);a.Fe&&(a.Fe.release(),a.Fe=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.w){c.F(10);break}return _.y(c,a.w.destroy(),11);case 11:a.w=null;case 10:a.$&&(a.$.release(),a.$=null),a.R.clear(),a.K=null,a.Ie.clear(),a.f=null,a.H=null,a.fa=!0,a.Pc.clear(),a.Nd=!1,ZH(a),_.B(c)}})};
|
|
182
|
+
JH=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new wE:new _.xE,d=_.bp(a.configuration,[_.ze,"single-native"]),e=d.create(a),a.V=e,f=xH(a),f.track(a),a.Uc=f,g=null,$H(a)?g=new YF(b,c,e,f,a.configuration):g=new _.zE(b,c,e,f,a.configuration),_.y(h,g.open(),2);a.L=g;_.B(h)})};
|
|
183
|
+
VH=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.y(e,_.Pt(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
184
|
+
WH=function(a,b,c,d){return(new _.Sj(Promise.resolve().then(function(){var e,f,g;return _.I(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.F(3);break}_.D(h,4);var l=c.url;var m=aI(a,d);l=b.start(l,m);return _.y(h,l,6);case 6:e=h.f;_.th(h,2);break;case 4:f=_.E(h);if(!a.Kc)throw f;return _.y(h,a.Kc(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.F(2);break;case 3:if(0===e.periods.length)throw new _.N(_.O,4,4014);bI(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
185
185
|
return b.stop()})).P};
|
|
186
|
-
|
|
187
|
-
if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var
|
|
188
|
-
(
|
|
189
|
-
e=_.
|
|
190
|
-
|
|
191
|
-
b),a.h.configure(a.configuration.abr),a.$&&a.h.setCmsdManager(a.$),a.h.init(function(u,v,z){!a.fa&&
|
|
192
|
-
_.
|
|
193
|
-
a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially")
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
b.id});f?(a.aa=f.video.id,
|
|
202
|
-
|
|
203
|
-
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;a.h.setVariants(f);f=
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
b).variant=c};
|
|
207
|
-
|
|
208
|
-
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.
|
|
209
|
-
|
|
210
|
-
e.value,(g=e.video)&&!
|
|
211
|
-
|
|
212
|
-
_.
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
a.h.chooseVariant())};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
h=c.video&&c.video.id;a.f.periods=f.periods;l=
|
|
225
|
-
z.next())
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
_.
|
|
232
|
-
_.t.track=function(a){null!=this.player
|
|
233
|
-
_.t.append=function(a,b,c){var d=this.h?this.h(c):null;d||this.log.debug("Unable to resolve rendition for
|
|
234
|
-
this.U.sort(
|
|
235
|
-
_.t.Rc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.U.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.U[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.U[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.U[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(_.
|
|
236
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};
|
|
237
|
-
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.
|
|
238
|
-
DD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.
|
|
186
|
+
OH=function(a,b,c){var d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:_.Wn("initDrm.start");d=new _.bo({wb:a.getNetworkEngine(),onError:function(n){return a.onError(n)},Tf:function(n){if(a.a){var p=cI(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.");
|
|
187
|
+
if(u.length){u=a.getPeriods();for(var z=0;z<u.length;z++)for(var A=u[z],G=_.w(A.variants),F=G.next();!F.done;F=G.next()){F=F.value;var C=[];F.audio&&C.push(F.audio);F.video&&C.push(F.video);C=_.w(C);for(var H=C.next();!H.done;H=C.next()){H=H.value;var Q=F.allowedByKeySystem;if(H.keyId){var R=n[v?"00":H.keyId];R=!!R&&!dI.includes(R);F.allowedByKeySystem=R}Q!==F.allowedByKeySystem&&(R=H.type,H.type===_.r&&(R="video "+H.width+"x"+H.height+"@"+_.S.lf(H.bandwidth)),a.log.warn("DRM Key not available for KID: '"+
|
|
188
|
+
(H.keyId+"'. Applying restrictions to "+R)));A===p&&Q!==F.allowedByKeySystem&&(q=!0)}}}if(n=xG(a.a)){v=zG(a.a);u=AG(a.a);a:{z=n.variants;for(A=0;A<z.length;A++)if(z[A].audio===v&&z[A].video===u){v=z[A];break a}v=null}if(!v||v.allowedByKeySystem)a.log.info(uB),eI(a),fI(a,n.variants)}q&&n!==p&&(a.log.info(uB),eI(a),fI(a,p.variants))}},Sf:function(n,p){a.trigger(new _.L(_.je,{expirationTime:p}))},onEvent:function(n){return a.tf(n)},getConfiguration:function(){return a.getConfiguration()},Yc:function(){return a.Yc()}});
|
|
189
|
+
e=_.Bm(c);d.h=e;f=c?c.offlineId||"":"";g=[];h=_.Gt(b.periods);if(!f){m.F(2);break}l=_.jm(_.lf);if(!l){m.F(2);break}return _.y(m,l.l(a,h),4);case 4:return _.y(m,l.j(f),5);case 5:g=m.f;case 2:return _.y(m,_.ho(d,h,g),6);case 6:return a.w=d,gI(a,b.periods),_.Wn("initDrm.end"),_.Xn("Init DRM","initDrm.start","initDrm.end"),m["return"](d)}})};
|
|
190
|
+
PH=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.j,hI(a,c),iI(a,a.f.periods),a.Fc=new NF(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.Ed=a.configuration.preferredTextLanguage,a.De=a.configuration.preferredTextRole,a.Cd=a.configuration.preferForcedSubtitles,_.y(q,_.Ao(a.w,c),2);if(3!=q.a)return FF(a.l,
|
|
191
|
+
b),a.h.configure(a.configuration.abr),a.$&&a.h.setCmsdManager(a.$),a.h.init(function(u,v,z){!a.fa&&jI(a,u,v,z)}),a.B=kI(a,c,a.configuration.startTime),a.Oc=lI(a),a.J=new mG({vh:function(){return c.playbackRate},hn:function(u){c.playbackRate=u},Jl:function(u){c.currentTime+=u}}),nG(a.J,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Fe=new WF(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),mI(a,d),$H(a)?QE(a.f,_.mi(a.configuration.preferredVideoCodec),
|
|
192
|
+
_.mi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):PE(a.f,_.mi(a.configuration.preferredVideoCodec),_.mi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=nI(a),e.h=a.configuration.streaming,a.a=e,a.G=vH,_.y(q,e.start(),3);FF(a.l,b);a.configuration.streaming.startAtSegmentBoundary&&(f=hE(a.B),g=oI(a,f),aE(a.B.f,g));h=_.w(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,pI(a,m);eI(a);n=cI(a)||a.f.periods[0];p=n.variants.some(function(u){return u.primary});
|
|
193
|
+
a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");fI(a,n.variants);_.B(q)})};
|
|
194
|
+
hI=function(a,b){function c(d){a.j&&a.K&&(d.type===_.bg&&a.Rd?(a.K.a=TF,ZH(a)):d.type===_.Sg&&a.getState()===_.Bp&&.1>a.getBufferInfo().ya(a.getMediaPosition())?(a.K.a=TF,ZH(a)):a.K&&qI(a));rI(a)}a.o.on(b,_.zf,c);a.o.on(b,_.kf,c);a.o.on(b,_.se,c);a.o.on(b,_.bg,c);a.o.on(b,_.ag,c);a.o.on(b,_.Of,c);a.o.on(b,_.Sg,c);a.o.on(b,_.Qf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.J.set(d)}})};
|
|
195
|
+
bI=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)})){_.Nh("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.w(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};kI=function(a,b,c){return new fE(b,a.f,a.configuration.streaming,c,function(d){a.Oc&&jE(a.Oc,!0,d);a.a&&OG(a.a)},function(d){return a.dispatchEvent(d)},a.ea===_.Lb)};
|
|
196
|
+
lI=function(a){var b=new kE(a.j),c=new kG(a.f);lG(c,function(){eI(a)});b.a.add(c);a.I&&(c=new mE(a.I),nE(c,function(d){d.Ke&&d.Ke();UH(a,_.ki,d)},function(d){d.Rf&&d.Rf();UH(a,_.li,d)},function(d,e){e||(d.Ke&&d.Ke(),UH(a,_.ki,d),d.Rf&&d.Rf(),UH(a,_.li,d))}),b.a.add(c));a.ea===_.Lb&&(c=new HD(a.Lc,a.Qd,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Me=c);return b};mI=function(a,b){a.K=new UF(b,Math.min(.5,b/2));a.K.a=TF;ZH(a);a.Jc=(new _.Zk(function(){qI(a)})).mb(.25)};
|
|
197
|
+
qI=function(a){switch(a.G){case vH:a:if(a.j.ended||a.L.re())var b=!0;else{if(a.isLive()){b=yD(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.ha(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=a.L.Ef();c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.ya(e),d=d.ya(e),c=Math.min(c,d)):c=c?c.ya(e):d?d.ya(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?SF:TF;d.a=c;d=e!==c}c=d;d=sI(a);c||a.getState()===_.sp&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
198
|
+
d,"buffered to end",b,"state",a.getState()),ZH(a)):a.Nd&&rI(a)};nI=function(a){var b={configuration:{yl:a.ea===_.Lb},Hb:function(){return hE(a.B)},W:a.L,wb:a.getNetworkEngine(),Qf:a.Nj.bind(a),Pf:a.Mj.bind(a),onError:a.onError.bind(a),Vh:a.hm.bind(a),onEvent:a.tf.bind(a),Zh:a.An.bind(a),Le:a.um.bind(a),we:function(){return a.h},mf:a.Yi.bind(a),wi:a.qn.bind(a),yd:a.w};return new _.vG(a.f,b)};
|
|
199
|
+
uF=function(a){if(a.f&&a.B){var b=tI(a),c=[];a=_.w(uI(a));for(var d=a.next();!d.done;d=a.next()){d=d.value;var e=WE(d);e.active=d===b;c.push(e)}return c}return[]};sF=function(a,b){if(a.f&&a.a){var c=cI(a),d=c.textStreams.find(function(e){return e.id===b.id});d?(vI(a,c,d,!1),wI(a,d),a.Ed=d.language,a.Cd=d.kind===_.ue):a.log.error(_.NB,b.id)}};
|
|
200
|
+
vF=function(a,b,c){var d=void 0===d?0:d;if(a.f&&a.a){var e=cI(a);if(a.configuration.abr.enabled&&b)a.log.info("Disable ABR and enable manual track selection to select "+(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable();else if(!a.configuration.abr.enabled&&!b){a.log.info("Enable ABR Selection");a.configuration.abr.enabled=!0;a.h.enable();a.aa=null;c=fI(a,e.variants);null!=a.Tb&&(a.Fc=a.Tb,a.Tb=null);null==c||a.fa||jI(a,c);return}if(b){a.aa=b.id;var f=e.variants.find(function(g){return g.id===
|
|
201
|
+
b.id});f?(a.aa=f.video.id,YE(f)?(yI(a,e,f,!1),zI(a,f,c,d),null==a.Tb&&(a.Tb=a.Fc),a.Fc=new OF(f),fI(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.aa=null,null!=a.Tb&&(a.Fc=a.Tb,a.Tb=null),c=fI(a,e.variants),null==c||a.fa||jI(a,c)}};
|
|
202
|
+
tF=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=AG(a.a),d=zG(a.a),e=eD(a.f.periods,hE(a.B)),f=a.f.periods[e?a.f.periods.indexOf(e):0].variants.filter(function(m){return m.audio.id===b&&YE(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().Ka();
|
|
203
|
+
if(h){var l=h.renditions.map(function(m){return m.id});g=f.find(function(m){return l.find(function(n){return n===String(m.video.id)})})}}}else g=f[0];if(g){if(d.codecs.split(".")[0]===g.audio.codecs.split(".")[0]){d=g.audio;a.Mc=d.id;a.h.setVariants(f);f=cI(a);yI(a,f,g,!1);e||a.fa?zI(a,g,!0,0):_.JG(a.a,d,!0,0);Promise.resolve();return}a.log.warn("Target audio codecs not compatible with active audio codecs.")}}Promise.reject()}};
|
|
204
|
+
wF=function(a){var b=a.mg;return a.f?a.L.getTextDisplayer().isTextVisible():b};rF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.mg;d=b;if(c===d)return g["return"]();a.mg=d;if(a.G!==vH)return g.F(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.F(0);if(!b)return IG(a.a),g.F(0);e=cI(a);f=_.$E(e.textStreams,a.Ed,a.De,a.Cd);return 0<f.length?_.y(g,FG(a.a,f[0]),0):g.F(0)})};
|
|
205
|
+
yI=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){zF(e,c.video,d);var g=e.na();f.j!==g&&(f.j=g,f.a.push({timestamp:Date.now()/1E3,id:g.id,trackId:g.track.id,type:g.track.type,fromAdaptation:d,width:g.width,height:g.height,bandwidth:g.bandwidth}))}c.audio&&(zF(e,c.audio,d),e=e.Qa(),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})))}IF(a.R,
|
|
206
|
+
b).variant=c};vI=function(a,b,c,d){IF(a.R,b).text=c;if(b=a.getTrackManager())zF(b,c,d),c=b.Ja(),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}))};VI=function(a){return a.ea===_.Lb&&"flat"===a.configuration.playlist.timeline};
|
|
207
|
+
iI=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.w(d.variants),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.w(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.Ei++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Aa:0,mimeType:_.Vc,codecs:"",kind:_.rd,encrypted:!1,
|
|
208
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.P,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.w(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
209
|
+
gI=function(a,b){for(var c=a.a?zG(a.a):null,d=a.a?AG(a.a):null,e=!$H(a),f=_.w(b),g=f.next();!g.done;g=f.next())VE(a.w,c,d,g.value,e);c=QC(b,function(h){return h.variants.some(YE)});if(a.configuration.streaming.disableAudioTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.w(b),e=d.next();!e.done;e=d.next())for(f=_.w(e.value.variants),e=f.next();!e.done;e=f.next())e=
|
|
210
|
+
e.value,(g=e.video)&&!RC(g.type,_.Uk(g.mimeType,g.codecs))&&delete e.video;if(0===c)throw new _.N(_.O,4,4032);if(c<b.length)throw new _.N(_.O,4,4011);c=_.w(b);for(e=c.next();!e.done;e=c.next())d=e.value,SE(d.variants,a.configuration.restrictions,a.Di)&&a.a&&cI(a)===d&&eI(a),WI(a,d.variants)};
|
|
211
|
+
pI=function(a,b){var c=a.a?zG(a.a):null,d=a.a?AG(a.a):null,e=!$H(a);VE(a.w,c,d,b,e);d=b.variants;if(!d.some(YE))throw new _.N(_.O,4,4011);WI(a,b.variants);SE(d,a.configuration.restrictions,a.Di)&&a.a&&cI(a)===b&&eI(a);if(!_.Yj(2)&&(c=a.w?a.w.getDrmInfo():null))for(d=_.w(d),e=d.next();!e.done;e=d.next()){e=_.w(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===c.keySystem){f=_.w(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Do(a.w,g.keyId,g.initData)||
|
|
212
|
+
_.oo(a.w,g.initDataType,g.initData,g.keyId)}}};zI=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;a.fa?(a.Na=b,a.Ci=c,a.Bi=d):KG(a.a,b,c,d)};wI=function(a,b){a.fa?a.ja=b:_.JG(a.a,b,!0,0)};XI=function(a){if(a.a&&a.f){var b=xG(a.a),c=cI(a);null!=b&&b===c&&(zG(a.a),AG(a.a),_.yG(a.a,_.P),IF(a.R,c),IF(a.R,c))}};
|
|
213
|
+
oI=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=zG(a.a),e=AG(a.a),f=cI(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};sI=function(a){return a.w&&a.w.D?!0:a.K?a.K.getState()===TF:!1};
|
|
214
|
+
ZH=function(a){if(a.H&&a.K&&a.B){var b=YI(a)===_.sp,c=a.J;c.l=b;qG(c,c.o?"seek":void 0);a.B.j.o=b;rI(a);a.Me&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Me,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.L(_.Xf))))}};rI=function(a){yH(a,YI(a))};YI=function(a){if(a.Rd)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.Nd&&0<=c&&b<=c?!0:!1}return b?_.up:sI(a)||a.Rd?_.sp:a.j&&a.j.paused?_.Ap:_.Bp};
|
|
215
|
+
fI=function(a,b){try{WI(a,b)}catch(e){return a.onError(e),null}var c=b.filter(function(e){return YE(e)});c=dF(c,a.Mc);var d=a.Fc.create(c);d=Array.from(d.values());a.h.setVariants(d);if(null!==a.aa&&null!==a.Mc&&(d=d.find(function(e){return e.video.id===a.aa&&e.audio.id===a.Mc}),a.aa=null,d))return d;if(a.configuration.abr.enabled||null===a.aa)return a.h.chooseVariant();c=c.find(function(e){return null!==e.video&&e.video.id===a.aa});return c?c:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
216
|
+
a.h.chooseVariant())};ZI=function(a,b){return _.$E(b,a.Ed,a.De,a.Cd)[0]||null};$I=function(a,b,c){c=void 0===c?!0:c;var d=fI(a,b.variants);a.Mc=d&&d.audio&&d.audio.id;d&&(yI(a,b,d,!0),zI(a,d,c));(c=ZI(a,b.textStreams))&&(a.configuration.streaming.alwaysStreamText||wF(a))&&(vI(a,b,c,!0),wI(a,c))};
|
|
217
|
+
cJ=function(a,b){a.fa=!0;a.h.disable();a.log.debug("Choosing new streams after period changed");var c=fI(a,b.variants),d=ZI(a,b.textStreams);a.Na&&(b.variants.includes(a.Na)&&(c=a.Na),a.Na=null);a.ja&&(b.textStreams.includes(a.ja)&&(d=a.ja),a.ja=null);c&&aJ(a,b,function(){return yI(a,b,c,!0)});d&&(a.configuration.streaming.alwaysStreamText||wF(a))&&aJ(a,b,function(){return vI(a,b,d,!0)});b===cI(a)&&bJ(a);return a.configuration.streaming.alwaysStreamText||wF(a)?{variant:c,text:d}:{variant:c,text:null}};
|
|
218
|
+
jI=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=dJ(a,b);aJ(a,e,function(){return yI(a,e,b,!0)});e===cI(a)&&bJ(a);a.a&&KG(a.a,b,c,d)}};eI=function(a){var b=a.getTrackManager();b&&a.G!==YH&&(b.m&&(yF(b),b.m.trigger(new _.L(_.pv))),bJ(a))};bJ=function(a){var b=cI(a);if(b){var c=a.Pc.get(b)||[];for(a.Pc["delete"](b);c.length;)c.shift()()}};aJ=function(a,b,c){a.Pc.has(b)||a.Pc.set(b,[]);a.Pc.get(b).push(c)};
|
|
219
|
+
UH=function(a,b,c){a.trigger(new _.L(b,{detail:CD(c,VI(a))}))};
|
|
220
|
+
WI=function(a,b){var c=a.w?_.M.wg(a.w.fa):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.w(b),m=l.next();!m.done;m=l.next()){m=m.value;var n=[];m.audio&&n.push(m.audio);m.video&&n.push(m.video);n=_.w(n);for(var p=n.next();!p.done;p=n.next())if(p=p.value,p.keyId){var q=c[d?"00":p.keyId];q?dI.includes(q)&&(h.includes(q)||h.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.N(_.O,4,4012,{hasAppRestrictions:f,
|
|
221
|
+
missingKeys:g,restrictedKeyStatuses:h});};uI=function(a){var b=cI(a);if(null==b)return[];XI(a);return b.variants.filter(function(c){return YE(c)})};eJ=function(a){var b=cI(a);if(null==b)return[];XI(a);return b.textStreams.filter(function(c){return!a.Ie.has(c)})};cI=function(a){var b=hE(a.B),c=null;a=_.w(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};tI=function(a){var b=cI(a);return b&&IF(a.R,b).variant};
|
|
222
|
+
dJ=function(a,b){for(var c=_.w(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.includes(b))return d;return null};FH=function(a){if(a.G===YH)throw new _.N(_.O,7,7E3,"Player is destroyed.");};
|
|
223
|
+
fJ=function(a,b,c){var d,e,f,g,h,l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R;return _.I(function(na){switch(na.a){case 1:return d=_.Mp,_.D(na,2),_.y(na,_.Pt(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:e=na.f;e.configure(a.configuration.manifest);var da=e;var Ba=b.url,ab=aI(a,a.configuration.id||"");da=da.start(Ba,ab);return _.y(na,da,5);case 5:f=na.f;bI(f.periods);if(!f.periods.length)throw new _.N(_.O,4,4014);return _.y(na,a.A.stop(),6);case 6:a.A=e;g=c.audio&&
|
|
224
|
+
c.audio.id;h=c.video&&c.video.id;a.f.periods=f.periods;l=eD(f.periods,hE(a.B))||f.periods[0];$H(a)?QE(a.f,_.mi(a.configuration.preferredVideoCodec),_.mi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):PE(a.f,_.mi(a.configuration.preferredVideoCodec),_.mi(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);m=eF(g,h,l.variants);n=ZI(a,l.textStreams);fI(a,l.variants);p=m&&m.video;q=m&&m.audio;u=[];v=new Set;z=_.w(l.variants);for(A=z.next();!A.done;A=
|
|
225
|
+
z.next())G=A.value,G.video&&v.add(G.video),G.audio&&v.add(G.audio);F=a.getNetworkEngine();C=_.w(_.fh(v).concat(_.fh(l.textStreams)));for(H=C.next();!H.done;H=C.next())Q=H.value,u.push(Q.createSegmentIndex(F));return _.y(na,Promise.all(u),7);case 7:WG(a.a,d.AUDIO,q);WG(a.a,d.VIDEO,p);WG(a.a,d.TEXT,n);m&&yI(a,l,m,!1);a.log.info("Switch CDN successful.");_.th(na,0);break;case 2:R=_.E(na);if(!e){na.F(8);break}return _.y(na,e.stop(),8);case 8:throw R;}})};
|
|
226
|
+
aI=function(a,b){return{networkingEngine:a.getNetworkEngine(),configurationId:b,filterNewPeriod:function(c){return pI(a,c)},filterAllPeriods:function(c){return gI(a,c)},onTimelineCueAdded:function(c){a.I&&(a.ea===_.Lb?a.Kd.push(c):a.I.f(c))},onEvent:function(c){return a.tf(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return CH(a,c)},onTurnedStatic:function(){return DH(a)}}};
|
|
227
|
+
$H=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.gg&&(_.Yj(2)||_.Yj(3)||_.Yj(4)||_.Yj(5)||_.Yj(6)||_.Zj()&&38===_.dl().major||_.Zj()&&53===_.dl().major||_.Zj()&&68===_.dl().major?!1:!0)};gJ=function(){};hJ=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}};
|
|
228
|
+
iJ=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};jJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};kJ=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.UC(b)&&a(b)}};
|
|
229
|
+
lJ=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.w(d);for(var g=d.next();!g.done;g=d.next())g=g.value.split("\x3d"),f[g[0]]=g[1].replace(/"(.*)"/,"$1");d=f.codecs;if(!d)return a(c);var h=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(h=!0);return!0});l&&(h=!1);f.codecs=c.join(",");h&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
|
|
230
|
+
mJ=function(a){_.Eu.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=_.ae;c.label===PB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.tC,PB));this.a.mode=_.ye};nJ=function(a,b){var c=a.mode;a.mode=c===_.cg?_.cg:_.ye;for(var d=a.cues,e=d.length-1;0<=e;e--){var f=d[e];f&&b(f)&&a.removeCue(f)}a.mode=c};oJ=function(){};_.ej.prototype.f=vC(0,function(){return this.keyInfo});var xC=[112,115,115,104,0,0,0,0];
|
|
231
|
+
_.MC.prototype.Hd=function(){return this.ka?this.ka-this.xa+1:null};_.MC.prototype.f=function(){return this.keyInfo};_.qJ=function pJ(a){var c,d,e,f,g,h;return _.Bh(pJ,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{Ah:c,Tm:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{Ah:c,item:e,Tm:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.t=_.YC.prototype;
|
|
232
|
+
_.t.track=function(a){null!=this.player&&$C(this);a&&(this.player=a,this.player.on(_.Vf,this.Rc,this))};_.t.release=function(){$C(this);this.U=[];this.f=this.h=null};
|
|
233
|
+
_.t.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.U.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.w(this.U);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
234
|
+
b<e.end&&(e.start=b);this.U.push(c);this.U.sort(XC)}cD(this);this.Rc();this.player&&this.player.trigger(new _.L(_.Ng))};_.t.clear=function(){this.U=[];cD(this);this.player&&(this.player.trigger(new _.L(_.Ng)),this.player.trigger(new _.L(_.jd)))};
|
|
235
|
+
_.t.Rc=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.U.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.U[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.U[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.U[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(_.ld,
|
|
236
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};nD.prototype.rb=function(){return this.h};nD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.t=_.pD.prototype;_.t.sc=function(){return this.L};_.t.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.t.getPresentationStartTime=function(){return this.G};_.t.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};
|
|
237
|
+
_.t.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.l};_.t.Pd=function(){return!this.l};DD.prototype.release=function(){this.h=function(){};this.a.clear()};DD.prototype.clear=function(){this.a.clear()};DD.prototype.f=function(a){a:{var b=_.w(this.a);for(var c=b.next();!c.done;c=b.next())if(c=c.value,c.schemeIdUri===a.schemeIdUri&&c.startTime===a.startTime&&c.endTime===a.endTime&&c.configurationId===a.configurationId){b=c;break a}b=null}null==b&&(this.a.add(a),this.h(a))};
|
|
238
|
+
DD.prototype.cues=function(){return this.a};HD.prototype.release=function(){this.f=this.j=this.h=this.a=null};HD.prototype.l=function(a){GC(this.a,a);ID(this)};JD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Sa().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=KD(this);return{value:a,done:!a}};_.t=_.LD.prototype;_.t.destroy=function(){this.a=[];return Promise.resolve()};
|
|
239
239
|
_.t.find=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};
|
|
240
|
-
_.t.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.t.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.
|
|
241
|
-
_.t.
|
|
242
|
-
_.t.
|
|
243
|
-
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
244
|
-
a};_.t.replace=function(a){this.a=a};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
_.t.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.t.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.t.
|
|
248
|
-
|
|
249
|
-
_.t.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](
|
|
250
|
-
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.
|
|
251
|
-
_.t.
|
|
252
|
-
_.t.
|
|
253
|
-
_.t.qe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.f[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.
|
|
254
|
-
_.r,this.
|
|
255
|
-
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.G[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.
|
|
256
|
-
_.t.
|
|
257
|
-
_.t.flush=function(a){return a===_.
|
|
258
|
-
_.t.getDuration=function(){return this.o.duration};_.t.
|
|
259
|
-
_.t.
|
|
260
|
-
_.t.
|
|
261
|
-
_.t.Sc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(
|
|
262
|
-
_.t.
|
|
263
|
-
_.t.
|
|
264
|
-
_.t.
|
|
265
|
-
|
|
266
|
-
_.t.chooseVariant=function(){var a=
|
|
240
|
+
_.t.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.t.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.w(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Aa-=a};
|
|
241
|
+
_.t.od=function(a,b){var c=a-this.a[0].position;if(0<=c&&c<this.a.length)for(this.g.warn("Accounting for segment duration drift",b,"at",c),this.a[c].endTime+=b,c+=1;c<this.a.length;++c)this.a[c].startTime+=b,this.a[c].endTime+=b};_.t.getDuration=function(){return this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
242
|
+
_.t.pa=function(a){for(var b=[],c=[],d=0,e=0;d<this.a.length&&e<a.length;){var f=this.a[d],g=a[e];f.startTime<g.startTime?(b.push(f),d++):(f.startTime>g.startTime?0===d?c.push(g):this.g.info("Refusing to rewrite original references on update!"):(.1<Math.abs(f.endTime-g.endTime)?(f=new _.ej(f.position,g.startTime,g.endTime,g.Sa,g.xa,g.ka,g.Aa,g.keyInfo,g.Vc,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=
|
|
243
|
+
b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.ej(d++,f.startTime,f.endTime,f.Sa,f.xa,f.ka,f.Aa,f.keyInfo,f.Vc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.w(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.ej(e-d--,f.startTime,f.endTime,f.Sa,f.xa,f.ka,f.Aa,f.keyInfo,f.Vc,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile));b=_.w(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=
|
|
244
|
+
a};_.t.replace=function(a){this.a=a};QD.prototype.release=function(){this.h=null;this.f=function(){}};UD.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};UD.prototype.Le=function(){this.A=!0;TD(this)};VD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
245
|
+
ZD.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};fE.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(){}};kE.prototype.release=function(){this.h.stop();for(var a=_.w(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};
|
|
246
|
+
mE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};mE.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.w(this.j.cues()),f=e.next();!f.done;d={cf:d.cf,de:d.de},f=e.next()){f=f.value;d.cf=this.o.get(f)||null;d.de=lE(f,a);this.o.set(f,d.de);var g=this.w.find(function(h){return function(l){return l.Ec===h.cf&&l.Dc===h.de}}(d));g&&g.tc(f,b&&0===c)}};_.rJ=0;_.t=qE.prototype;
|
|
247
|
+
_.t.destroy=function(){this.j=this.w=null;this.o.clear();return Promise.resolve()};_.t.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.j||!c.j.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.t.Ha=function(){return this.a};_.t.ha=function(){return this.f};_.t.tb=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.t.ya=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};
|
|
248
|
+
wE.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.oj(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};wE.prototype.h=function(a,b){var c=_.oj(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};wE.prototype.f=function(){this.a.resetCaptionStream()};_.xE.prototype.init=function(){};_.xE.prototype.h=function(){};_.xE.prototype.f=function(){};_.t=_.zE.prototype;
|
|
249
|
+
_.t.destroy=function(){var a=this;this.I=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](JC));for(e=1;e<d.length;++e)d[e].p["catch"](JC),d[e].p.reject()}this.a&&b.push(this.a.destroy());this.D&&b.push(this.D.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.D=null;a.f={};a.w={};a.G=
|
|
250
|
+
{};a.H=null;a.K=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.J};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.Mp,_.y(f,d.J,2);a.forEach(function(g,h){var l=_.Uk(g.mimeType,g.codecs);if(h===e.TEXT)d.cc(l);else{var m=new Map;m.set(h,l);if((!_.Cr(l)||!b||g.keyInfo)&&_.Tk(l,h)){var n=_.Tk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}CE(d,m)}});_.B(f)})};_.t.pi=function(){this.g.debug(TB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
251
|
+
_.t.Kh=function(){return this.L.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.N};_.t.cc=function(a){this.a||(this.a=new qE(this.L,this.D));rE(this.a,a)};_.t.re=function(){return this.o?this.o.readyState===_.se:!0};_.t.Ha=function(a){return a===_.P?this.a.Ha():(a=DE(this,a))?a.Ha():null};_.t.ha=function(a){return a===_.P?this.a.ha():(a=DE(this,a))?a.ha():null};_.t.tb=function(a,b,c){return a===_.P?this.a.tb(b):(a=DE(this,a))?a.tb(b,!1,c):!1};
|
|
252
|
+
_.t.ya=function(a,b){if(a===_.P)return this.a.ya(b);var c=DE(this,a);return c?c.ya(b):0};_.t.Ef=function(){var a={};a.total=new _.Xl(this.j.buffered,"total");a.audio=DE(this,_.cd);a.video=DE(this,_.r);var b=[];this.a&&(b=[{start:this.a.Ha(),end:this.a.ha()}]);a.text=VC(b,_.P);return a};
|
|
253
|
+
_.t.qe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.f[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.P?b=sE(this.a,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.a||this.cc(_.sg),uE(this.a,b.captions,c,d,this.f.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.f.audio&&e.push(FE(this,_.cd,this.vf.bind(this,_.cd,b.audio.buffer))),0<b.video.byteLength&&this.f.video&&e.push(FE(this,
|
|
254
|
+
_.r,this.vf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.a||this.cc(_.sg),null==c&&null==d?this.H.init(b):this.H.h(b,function(p){p.length&&uE(h.a,p,c,d,h.f.video.timestampOffset)})),b=FE(this,a,this.vf.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(rB,c,d,tB,EE(h,a));else if(a===_.cd&&null!==c&&null!==d)aD(h.B),null!==c&&null!==d&&h.g.debug(qB,c,d,tB,EE(h,a));else if(a===_.r&&null!==c&&null!==
|
|
255
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.G[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.R&&0===l.timestampOffset)return h.g.warn(vB+u+dB+(a+kB)+(c+cB)+(p+jB)),p=FE(h,a,function(){h.Qg(a,u)}),q=FE(h,a,h.Ng.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.G[a]=!0)})["catch"](function(p){throw p;})};_.t.Pg=function(a){var b=this.ha(_.r)||0;tE(this.a,a,b)};
|
|
256
|
+
_.t.Hg=function(){this.a&&tE(this.a,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.P?this.a.remove(b,c):FE(this,a,this.Og.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ha(a),f=d.ha(a);null!==e&&null!==f&&dD(d.B,e,f)}else a===_.cd&&bD(d.B)})};_.t.clear=function(a){if(a===_.P){if(!this.a)return Promise.resolve();this.H.f();return this.a.remove(0,Infinity)}return FE(this,a,this.Og.bind(this,a,0,this.o.duration))};
|
|
257
|
+
_.t.flush=function(a){return a===_.P?Promise.resolve():FE(this,a,this.Ng.bind(this,a))};_.t.si=function(a,b,c,d){var e=this,f,g;return _.I(function(h){f=_.Mp;if(a===f.TEXT){e.a.A=b;var l=e.a;l.h=c;l.l=d;return h["return"]()}g=GE(e,a,b,c,d);e.K&&(g=g.concat(GE(e,f.AUDIO,b,c,d)));return _.y(h,Promise.all(g),0)})};_.t.endOfStream=function(a){var b=this;return JE(this,function(){b.re()||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.t.wf=function(a){var b=this;JE(this,function(){b.o.duration=a})};
|
|
258
|
+
_.t.getDuration=function(){return this.o.duration};_.t.vf=function(a,b){this.g.debug(sB+a+eB);try{this.f[a].appendBuffer(b)}catch(c){throw this.g.warn(DB+a,c),c;}this.g.debug(xB+a+eB)};_.t.Og=function(a,b,c){if(c<=b)this.Sc(a);else{this.g.debug(SB+a+hB,b,c);try{this.f[a].remove(b,c)}catch(d){throw this.g.warn(FB+a+fB,b,c,d),d;}this.g.debug(zB+a+hB,b,c)}};
|
|
259
|
+
_.t.Oj=function(a){try{this.g.debug(pB+a+eB);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(CB+a+eB,d),d;}this.g.debug(wB+a+eB);this.Sc(a)};_.t.Ng=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(IB+a),this.j.currentTime-=.001):this.g.warn(XB+a+iB+this.j.readyState)}catch(b){throw this.g.warn(EB+a,b),b;}this.g.debug(yB+a);this.Sc(a)};
|
|
260
|
+
_.t.Qg=function(a,b){0>b&&(b+=.001);try{this.g.debug(WB+a,b),this.f[a].timestampOffset=b}catch(c){throw this.g.warn(HB+a,b,c),c;}this.g.debug(BB+a,b);this.Sc(a)};_.t.Pj=function(a,b,c){try{this.g.debug(UB+a,b,c),this.f[a].appendWindowStart=0,this.f[a].appendWindowEnd=c,this.f[a].appendWindowStart=b}catch(d){throw this.g.warn(GB+a,b,c,d),d;}this.g.debug(AB+a,b,c);this.Sc(a)};_.t.T=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
261
|
+
_.t.Sc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(ZB+a),IE(this,a))};_.t.getTextDisplayer=function(){return this.D};var BE=window.URL.createObjectURL;_.x(lF,_.U);_.t=lF.prototype;_.t.initialize=function(a){this.m=a};_.t.release=function(){this.h=[];this.a.clear();this.f.clear()};_.t.load=function(){};_.t.destroy=function(){this.release();this.m=null};_.t.getVideoTracks=function(){return mF(this,_.kk)};_.t.getAudioTracks=function(){return mF(this,_.jk)};_.t.ia=function(){return mF(this,_.T)};_.t.na=function(){return this.a.get(_.kk)||null};_.t.Qa=function(){return this.a.get(_.jk)||null};_.t.Ja=function(){return this.a.get(_.T)||null};
|
|
262
|
+
_.t.fb=function(){return this.f.get(_.kk)||null};_.t.ob=function(){return this.f.get(_.jk)||null};_.t.pb=function(){return this.f.get(_.T)||null};_.t.Ka=function(){return nF(this,_.kk)};_.t.ma=function(){return nF(this,_.jk)};_.t.wa=function(){return nF(this,_.T)};_.t.lb=function(a){pF(this,_.kk,a)};_.t.Ba=function(a){pF(this,_.jk,a)};_.t.Ma=function(a){pF(this,_.T,a)};_.t.$a=function(a,b){oF(this,_.kk,a,void 0===b?!1:b)};_.t.jb=function(a,b){oF(this,_.jk,a,void 0===b?!1:b)};
|
|
263
|
+
_.t.kb=function(a,b){b=void 0===b?!1:b;var c=a;if(!a){var d=this.Ja();if(d&&d.track.kind!==_.ue){var e=this.ia().find(function(g){return g.kind===_.ue&&g.language===d.track.language});if(!e){var f=this.ma();f&&(e=this.ia().find(function(g){return g.kind===_.ue&&g.language===f.language}))}e&&(c=e.renditions[0])}}oF(this,_.T,c,b)};_.t.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.y(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c.F(0)})};
|
|
264
|
+
_.t.ra=function(){return!!this.m&&this.m.ra()};lF.prototype.isAbrEnabled=lF.prototype.ra;lF.prototype.addTextTrack=lF.prototype.addTextTrack;lF.prototype.setTextRendition=lF.prototype.kb;lF.prototype.setAudioRendition=lF.prototype.jb;lF.prototype.setVideoRendition=lF.prototype.$a;lF.prototype.setTextTrack=lF.prototype.Ma;lF.prototype.setAudioTrack=lF.prototype.Ba;lF.prototype.setVideoTrack=lF.prototype.lb;lF.prototype.getTextTrack=lF.prototype.wa;lF.prototype.getAudioTrack=lF.prototype.ma;
|
|
265
|
+
lF.prototype.getVideoTrack=lF.prototype.Ka;lF.prototype.getLoadingTextRendition=lF.prototype.pb;lF.prototype.getLoadingAudioRendition=lF.prototype.ob;lF.prototype.getLoadingVideoRendition=lF.prototype.fb;lF.prototype.getTextRendition=lF.prototype.Ja;lF.prototype.getAudioRendition=lF.prototype.Qa;lF.prototype.getVideoRendition=lF.prototype.na;lF.prototype.getTextTracks=lF.prototype.ia;lF.prototype.getAudioTracks=lF.prototype.getAudioTracks;lF.prototype.getVideoTracks=lF.prototype.getVideoTracks;_.t=_.BF.prototype;_.t.stop=function(){this.w=null;this.h=!1;this.l=[];this.j=1;this.f=null;this.D=!1};_.t.init=function(a){this.w=a};
|
|
266
|
+
_.t.chooseVariant=function(){var a=CF(!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=CF(null,this.l),a=[a[0]]);var c=a[0]||null;a=_.w(_.qJ(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;
|
|
267
267
|
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.f=Date.now();this.D=!0;return c};_.t.enable=function(){this.h=!0};_.t.disable=function(){this.h=!1};
|
|
268
|
-
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.f,"enabled\x3d"+this.h);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.
|
|
269
|
-
break a}}else if(Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.t.playbackRateChanged=function(a){this.j=a};_.t.getBandwidthEstimate=function(){var a=this.A&&this.A.
|
|
270
|
-
_.t.setVariants=function(a){this.l=a};_.t.setCmsdManager=function(a){this.A=a};_.t.configure=function(a){this.a=a};_.t.reset=function(){this.B=!1;this.o=new
|
|
271
|
-
|
|
272
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
273
|
-
_.t.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](
|
|
274
|
-
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.
|
|
275
|
-
_.t.
|
|
276
|
-
_.t.
|
|
277
|
-
_.t.qe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.a[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.
|
|
278
|
-
_.r,this.
|
|
279
|
-
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.V&&0===l.timestampOffset)return h.g.warn(
|
|
280
|
-
_.t.
|
|
281
|
-
_.t.flush=function(a){return a===_.
|
|
282
|
-
_.t.
|
|
283
|
-
_.t.
|
|
284
|
-
_.t.start=function(){var a=this,b,c,d;return _.
|
|
285
|
-
_.t.resume=function(){if(!
|
|
286
|
-
_.t.
|
|
287
|
-
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.
|
|
288
|
-
_.t.
|
|
289
|
-
_.t.
|
|
290
|
-
_.t.unload=function(){var a=this,b;return _.
|
|
291
|
-
_.t.getBufferInfo=function(a){if(this.L){var b=this.L.
|
|
292
|
-
_.t.seek=function(a){var b=this.
|
|
293
|
-
_.t.destroy=function(){var a=this;return _.
|
|
294
|
-
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.
|
|
295
|
-
case 6:f=z.f;g=f.filter(function(
|
|
296
|
-
q=
|
|
297
|
-
_.t.appendLoad=function(a){var b=this,c;return _.
|
|
298
|
-
_.t.
|
|
299
|
-
_.t.load=function(a){return
|
|
300
|
-
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
301
|
-
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===
|
|
302
|
-
d),_.
|
|
303
|
-
_.t.getStats=function(){if(this.G!==
|
|
304
|
-
_.t.getTimelineCues=function(){return this.I?
|
|
305
|
-
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.
|
|
306
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(
|
|
307
|
-
2)}if(z=_.
|
|
308
|
-
_.t.
|
|
309
|
-
_.t.
|
|
310
|
-
_.t.
|
|
311
|
-
|
|
312
|
-
_.t.
|
|
313
|
-
_.y(n,b.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
_.
|
|
317
|
-
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.
|
|
318
|
-
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.t.remove=function(a,b){if(!this.a)return!1;
|
|
268
|
+
_.t.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.f,"enabled\x3d"+this.h);var c=this.o;if(!(16E3>b)){var d=8E3*b/a,e=a/1E3;c.a+=b;_.kD(c.f,e,d);_.kD(c.h,e,d)}if(null!=this.f&&this.h)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.f<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
269
|
+
break a}}else if(Date.now()-this.f<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}c=this.chooseVariant();d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.w(c)}};_.t.playbackRateChanged=function(a){this.j=a};_.t.getBandwidthEstimate=function(){var a=this.A&&this.A.rh();a||(a=this.o,a=128E3>a.a?this.a.defaultBandwidthEstimate:Math.min(_.lD(a.f),_.lD(a.h)));return a};
|
|
270
|
+
_.t.setVariants=function(a){this.l=a};_.t.setCmsdManager=function(a){this.A=a};_.t.configure=function(a){this.a=a};_.t.reset=function(){this.B=!1;this.o=new AF;var a=this.chooseVariant();a&&this.w(a)};GF.prototype.clear=function(){this.a.clear()};JF.prototype.add=function(a,b){var c=void 0===b?!0:b;if(MF(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Ih("Dropping variant due to incompatible codecs for the current adaptation set. This may be because CodecSwitchingStrategy is set to PREVENT or SourceBuffer.changeType() is not available on this platform. Variant dropped:",a,"because it is not compatible with",this.f);return!1};JF.prototype.values=function(){return this.a.values()};OF.prototype.create=function(a){var b=this,c=this.a===_.gg&&WC(),d=a.filter(function(e){return MF(b.f,e,!c)});return d.length?new JF(d[0],d):this.h.create(a)};
|
|
271
|
+
NF.prototype.create=function(a){var b=PF(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=QF(a,this.a);0<c.length?(a=c,b=!0):_.Ih("No exact match for preferred variant role could be found. Role: "+this.a)}b||(b=a.filter(function(e){return e.primary}),0<b.length&&(a=b));this.f&&(b=LE(a,this.f),b.length?a=b:_.Ih("No exact match for the channel count could be found."));b=RF(a,this.l);b.length?a=b:_.Ih("No exact match for spatial audio could be found.");b=this.h===_.gg&&WC();c=new JF(a[0]);a=_.w(a);
|
|
272
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};UF.prototype.getState=function(){return this.a};var TF=0,SF=1;WF.prototype.release=function(){this.f.release()};_.t=YF.prototype;
|
|
273
|
+
_.t.destroy=function(){var a=this;this.K=!0;var b=[],c;for(c in this.h){var d=this.h[c],e=d[0];this.h[c]=d.slice(0,1);e&&b.push(e.p["catch"](JC));for(e=1;e<d.length;++e)d[e].p["catch"](JC),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.D&&b.push(this.D.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),a.j=null);a.A="";a.o=null;a.f=null;a.D=null;a.a={};a.w={};a.H=
|
|
274
|
+
{};a.I=null;a.N=!1;for(var g in a.h);a.h={}})};_.t.open=function(){return this.L};_.t.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e;return _.I(function(f){if(1==f.a)return e=_.Mp,_.y(f,d.L,2);a.forEach(function(g,h){var l=_.Uk(g.mimeType,g.codecs);if(h===e.TEXT)d.cc(l);else{var m=new Map;m.set(h,l);if((!_.Cr(l)||!b||g.keyInfo)&&_.Tk(l,h)){var n=_.Tk(l);n&&(m=n(),d.w[h]=m,m=m.demuxMimeTypes(h,l),c&&m["delete"](e.AUDIO))}$F(d,m)}d.h[h]=[]});_.B(f)})};_.t.pi=function(){this.g.debug(TB);Object.values(this.w).forEach(function(a){return a.reset()})};
|
|
275
|
+
_.t.Kh=function(){return this.J.streaming.ignoreManagedMediaSourceStreamingHints?!0:this.R};_.t.cc=function(a){this.f||(this.f=new qE(this.J,this.D));rE(this.f,a)};_.t.re=function(){return this.o?this.o.readyState===_.se:!0};_.t.Ha=function(a){return a===_.P?this.f.Ha():(a=aG(this,a))?a.Ha():null};_.t.ha=function(a){return a===_.P?this.f.ha():(a=aG(this,a))?a.ha():null};_.t.tb=function(a,b,c){return a===_.P?this.f.tb(b):(a=aG(this,a))?a.tb(b,!1,c):!1};
|
|
276
|
+
_.t.ya=function(a,b){if(a===_.P)return this.f.ya(b);var c=aG(this,a);return c?c.ya(b):0};_.t.Ef=function(){var a={};a.total=new _.Xl(this.j.buffered,"total");a.audio=aG(this,_.cd);a.video=aG(this,_.r);var b=[];this.f&&(b=[{start:this.f.Ha(),end:this.f.ha()}]);a.text=VC(b,_.P);return a};
|
|
277
|
+
_.t.qe=function(a,b,c,d,e,f,g){var h=this;g=void 0===g?!1:g;var l=this.a[a],m=-1,n=0;l&&l.buffered&&(n=l.buffered.length);a===_.r&&null!==c&&null!==d&&g&&(m=0<n?l.buffered.end(n-1):-1);a===_.P?b=sE(this.f,b,c,d):this.w[a]?(b=this.w[a].transmux(b),b.captions&&0<b.captions.length&&(this.f||this.cc(_.sg),uE(this.f,b.captions,c,d,this.a.video.timestampOffset)),e=[],0<b.audio.byteLength&&this.a.audio&&e.push(cG(this,_.cd,this.uf.bind(this,_.cd,b.audio.buffer))),0<b.video.byteLength&&this.a.video&&e.push(cG(this,
|
|
278
|
+
_.r,this.uf.bind(this,_.r,b.video.buffer))),b=Promise.all(e)):(e&&window.muxjs&&(this.f||this.cc(_.sg),null==c&&null==d?this.I.init(b):this.I.h(b,function(p){p.length&&uE(h.f,p,c,d,h.a.video.timestampOffset)})),b=cG(this,a,this.uf.bind(this,a,b)));return b.then(function(){if(a===_.r&&null!==c&&null!==d&&!g)h.B.append(c,d,f),null!==c&&null!==d&&h.g.debug(rB,c,d,tB,bG(h,a));else if(a===_.cd&&null!==c&&null!==d)aD(h.B),null!==c&&null!==d&&h.g.debug(qB,c,d,tB,bG(h,a));else if(a===_.r&&null!==c&&null!==
|
|
279
|
+
d&&g){var p=l.buffered.length,q=0<p?l.buffered.end(p-1):-1;0>m&&0<p&&(m=l.buffered.start(0));0<=m&&0<q&&h.B.append(m,q,f)}if(!h.H[a]&&l&&1===l.buffered.length){p=l.buffered.start(0);var u=c-p;if(Math.abs(u)>h.V&&0===l.timestampOffset)return h.g.warn(vB+u+dB+(a+kB)+(c+cB)+(p+jB)),p=cG(h,a,function(){dG(h,a,u)}),q=cG(h,a,h.Lg.bind(h,a,!1)),Promise.all([p,q])}null!==c&&null!==d&&(h.H[a]=!0)})["catch"](function(p){throw p;})};_.t.Pg=function(a){var b=this.ha(_.r)||0;tE(this.f,a,b)};
|
|
280
|
+
_.t.Hg=function(){this.f&&tE(this.f,"",0)};_.t.remove=function(a,b,c){var d=this;return a===_.P?this.f.remove(b,c):cG(this,a,this.Mg.bind(this,a,b,c)).then(function(){if(a===_.r){var e=d.Ha(a),f=d.ha(a);null!==e&&null!==f&&dD(d.B,e,f)}else a===_.cd&&bD(d.B)})};_.t.clear=function(a){if(a===_.P){if(!this.f)return Promise.resolve();this.I.f();return this.f.remove(0,Infinity)}return cG(this,a,this.Mg.bind(this,a,0,this.o.duration))};
|
|
281
|
+
_.t.flush=function(a){return a===_.P?Promise.resolve():cG(this,a,this.Lg.bind(this,a))};_.t.si=function(a,b,c,d,e,f){var g=this,h,l,m;return _.I(function(n){if(1==n.a){h=_.Mp;if(a===h.TEXT){g.f.A=b;var p=g.f;p.h=c;p.l=d;return n["return"]()}return _.y(n,jG(g,a,e,f),2)}l=n.f;m=eG(g,a,b,c,d,l);g.N&&(m=m.concat(eG(g,h.AUDIO,b,c,d,l)));return _.y(n,Promise.all(m),0)})};_.t.endOfStream=function(a){var b=this;return hG(this,function(){b.re()||(a?b.o.endOfStream(a):b.o.endOfStream())})};
|
|
282
|
+
_.t.wf=function(a){var b=this;hG(this,function(){b.o.duration=a})};_.t.getDuration=function(){return this.o.duration};_.t.uf=function(a,b){this.g.debug(sB+a+eB);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn(DB+a,c),c;}this.g.debug(xB+a+eB)};_.t.Mg=function(a,b,c){if(c<=b)this.nc(a);else{this.g.debug(SB+a+hB,b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn(FB+a+fB,b,c,d),d;}this.g.debug(zB+a+hB,b,c)}};
|
|
283
|
+
_.t.Lg=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug(IB+a),this.j.currentTime-=.001):this.g.warn(XB+a+iB+this.j.readyState)}catch(b){throw this.g.warn(EB+a,b),b;}this.g.debug(yB+a);this.nc(a)};_.t.T=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};_.t.nc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug(ZB+a),gG(this,a))};_.t.getTextDisplayer=function(){return this.D};var ZF=window.URL.createObjectURL;kG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};kG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=eD(c,a)||c[0];b!==a&&this.f(a);this.a=a};mG.prototype.getConfiguration=function(){return this.j};mG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};mG.prototype.set=function(a,b){this.h=a;qG(this,b)};var tG=new _.kp(function(){return new Uint8Array([0,0,0,80,115,105,110,102,0,0,0,12,102,114,109,97,0,0,0,0,0,0,0,20,115,99,104,109,0,0,0,0,99,101,110,99,0,1,0,0,0,0,0,40,115,99,104,105,0,0,0,32,116,101,110,99,0,0,0,0,0,0,1,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])});_.t=_.vG.prototype;_.t.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.w(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,GG(e),b.push(HG(e));return _.y(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;_.B(f)})};
|
|
284
|
+
_.t.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.C.Hb();c=CG(a,b);d=a.C.Qf(wG(a)[c]);if(!d.variant&&!d.text)throw a.g.error("start(): No streams chosen"),new _.N(_.O,5,5005,"No streams chosen.");a.D=!d.variant&&!!d.text;return _.y(e,$G(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.jm&&(a.g.debug("init: calling onInitialStreamsSetup()..."),a.C.jm());_.B(e)})};
|
|
285
|
+
_.t.resume=function(){if(!SG(this))for(var a=_.w(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,EG(this,b,0)};
|
|
286
|
+
_.t.Mb=function(a){var b=this,c,d,e,f,g,h,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=PG(a);if(a.hb||null==a.bb||a.mc)return m["return"]();a.bb=null;if(!a.Rb){m.F(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.y(m,UG(b,a,a.Ue,a.oe),3);case 3:return m["return"]();case 2:_.D(m,4);d=dH(b,a);null!=d&&(EG(b,a,d),a.Zc=!1);_.th(m,5);break;case 4:return e=_.E(m),_.y(m,nH(b,e),6);case 6:return m["return"]();case 5:sH(b,a);if(!TG(b)){m.F(0);break}if(b.C.configuration.yl){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
287
|
+
f=_.w(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.bb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.y(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.Vh();_.B(m)}})};
|
|
288
|
+
_.t.Fm=function(a,b,c,d){var e=wC(d.reader),f=wC(d.reader),g=_.W(d.reader),h=_.W(d.reader),l=_.W(d.reader),m=_.W(d.reader);d=_.Qm(d.reader,d.reader.Ia()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.C.Zh();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}}))};
|
|
289
|
+
_.t.Bn=function(a){var b=this,c=!1,d=0;(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).M(_.Ve,_.Sm).M(_.lg,_.Sm).Y(_.ng,_.Tm).M("encv",function(e){e.reader.skip(78);_.Sm(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 _.Fm(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.x(wH,_.hm);_.t=wH.prototype;_.t.init=function(a,b){var c=a.getMedia();_.hm.prototype.init.call(this,a,b);IH(this,c)};_.t.namespace=function(){return eC};_.t.dh=function(){return new lF};_.t.getState=function(){return this.lc};_.t.getDrmInfo=function(){return this.w?this.w.getDrmInfo():null};
|
|
290
|
+
_.t.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){rF(a,!1);a.Nd=!1;if(!a.Z)return c["return"]();a.log.debug("Unload player with source",a.Z);(b=a.getTrackManager())&&b.release();return a.G===YH?c["return"]():_.y(c,KH(a),2)}a.Z=null;a.qg=0;a.Mc=null;a.aa=null;_.B(c)})};_.t.release=function(){var a=this;return _.I(function(b){if(a.Ga)return b["return"](a.Ga);a.Ga=zH(a);a.Ga["finally"](function(){a.Ga=null});return b["return"](a.Ga)})};
|
|
291
|
+
_.t.getBufferInfo=function(a){if(this.L){var b=this.L.Ef(),c=new _.Xl(void 0,a);switch(a){case _.kk:return b.video?b.video:c;case _.jk:return b.audio?b.audio:c;case _.T:return b.text?b.text:c}return b.total?b.total:c}return this.Uc?(b=ZC(this.Uc),VC(b,a)):_.hm.prototype.getBufferInfo.call(this,a)};_.t.getPosition=function(){var a=this.Qd,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.t.getMediaPosition=function(){return this.B?hE(this.B):_.hm.prototype.getMediaPosition.call(this)};
|
|
292
|
+
_.t.seek=function(a){var b=this.Qd;b=b.a?a+b.a.rb():a;b!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(b+" s."));return _.hm.prototype.seek.call(this,b)};_.t.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.t.getDuration=function(){var a=this.Qd,b=this.getMediaDuration();return a.a?a.a.getDuration():b};_.t.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};
|
|
293
|
+
_.t.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,_.hm.prototype.destroy.call(a),2);if(a.G===YH)return b["return"]();a.log.debug("Destroying player...");a.G=YH;HH(a);a.o&&(a.o.release(),a.o=null);a.$&&(a.$.release(),a.$=null);a.Lc=null;a.h=null;_.B(b)})};_.t.getTimeline=function(){return this.Lc};
|
|
294
|
+
_.t.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=new _.Rj,b.l.a=c,_.D(z,2),FH(b),b.ea=_.Lb,_.y(z,LH(b),4);case 4:return FF(b.l,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.Z=_.Fp(d),b.configuration=_.fm(b.kc,d),b.log.info("Loading playlist configurations",a),b.Lc=AH(b.configuration),_.y(z,MH(b,c),5);case 5:return FF(b.l,c),e=a.map(function(A){return NH(b,A,0,null,!0)}),_.y(z,Promise.all(e),6);
|
|
295
|
+
case 6:f=z.f;g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});if(h=g[0])b.A=h.parser;if(1<g.length)throw new _.N(_.O,7,7003,"Playlist of multiple live streams is not supported.");if(h){l=b.configuration.playlist.content;if(l===_.oc)throw new _.N(_.O,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&h!==f[f.length-1])throw new _.N(_.O,7,7003,"Wrong order of playlist assets.");}m=null==h;n=new _.pD({version:2},null,0,m);p=f.map(function(A){return hF(A.manifest)});
|
|
296
|
+
q=jF(p,n);b.f=q;u=b;return _.y(z,OH(b,q,b.configuration.drm),7);case 7:return u.w=z.f,FF(b.l,c),_.y(z,PH(b,c),8);case 8:FF(b.l,c);MG(b.a,q);BH(b,q);c.resolve();_.th(z,0);break;case 2:v=_.E(z);if(!b.A){z.F(9);break}return _.y(z,b.A.stop(),10);case 10:b.A=null;case 9:QH(b,v,c),_.B(z)}})};
|
|
297
|
+
_.t.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){FH(b);if(b.ea!==_.Lb)throw new _.N(_.O,7,7003,"Cannot append-load to non-playlist player.");return _.y(d,XH(b,a),2)}c=d.f;b.f=c.manifest;b.A=c.parser;MG(b.a,c.manifest);TG(b.a)&&b.a.resume();BH(b,c.manifest);_.B(d)})};_.t.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
298
|
+
_.t.Kg=function(){var a=this;return _.I(function(b){FH(a);if(!a.Pe)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Pe);a.Pe=null;return _.y(b,PH(a,null),0)})};_.t.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return FH(b),_.Wn("preload.start"),b.log.info("Preloading asset",a),_.y(c,RH(b,a,!1),2);b.Pe=a;b.log.info("Preloaded asset",a);_.Wn("preload.end");_.Xn("preload","preload.start","preload.end");_.B(c)})};
|
|
299
|
+
_.t.load=function(a){return RH(this,a)};_.t.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.y(b,GH(a),2);a.configuration=a.kc;HH(a);_.B(b)})};_.t.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.l):a=!1;return a};_.t.di=function(){this.log.debug("User seeking finished");this.K&&qI(this);rI(this)};
|
|
300
|
+
_.t.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:qD(b),end:AD(b)}}b=this.Qd;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.t.sc=function(){return this.f?this.f.presentationTimeline.sc():null};_.t.getPlaybackRate=function(){if(this.J){var a=this.J;a=a.l?0:a.h}else a=0;return a};
|
|
301
|
+
_.t.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.G===vH){if(_.Yj()){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(_.r);if(e){var f=e.stream;if(f)if(c.g.debug("setTrickPlay",d),d)(d=f.trickModeVideo)&&!e.dc&&(c.g.debug("Engaging trick mode stream",
|
|
302
|
+
d),_.JG(c,d,!1,0),e.dc=f);else if(f=e.dc)c.g.debug("Restoring non-trick-mode stream",f),e.dc=null,_.JG(c,f,!0,0)}}this.h.playbackRateChanged(a)}};_.t.ia=function(){if(this.f&&this.B){var a=cI(this);if(null==a)a=null;else{if(!IF(this.R,a).text){var b=_.$E(a.textStreams,this.Ed,this.De,this.Cd);b.length&&(b=b[0],IF(this.R,a).text=b)}a=IF(this.R,a).text}b=[];for(var c=_.w(eJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=XE(d);e.active=d===a;b.push(e)}return b}return[]};_.t.getPeriods=function(){return this.f.periods};
|
|
303
|
+
_.t.getStats=function(){if(this.G!==vH)return _.jp();rI(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.H,c=Number(a.totalVideoFrames);b.l=Number(a.droppedVideoFrames);b.j=c}if(this.G===vH){if(a=tI(this))this.H.o=a.bandwidth;a&&a.video&&(b=this.H,c=a.video.height||NaN,b.w=a.video.width||NaN,b.h=c);a=this.h.getBandwidthEstimate();this.H.f=a}return this.H.getStats()};_.t.xe=function(){return this.I};
|
|
304
|
+
_.t.getTimelineCues=function(){return this.I?GD(this.I,VI(this)):[]};_.t.resetAbr=function(){this.h&&this.h.reset()};_.t.we=function(){return this.h};
|
|
305
|
+
_.t.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){if(g.G!==vH)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=cI(g);l=_.Mp;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.N(1,4,4040);u=new _.ej(1,0,q,function(){return[a]},0,null,0);v={id:g.Ei++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
306
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(G){return 1===G?u:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.hC,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.Ie.add(v);h.textStreams.push(v);return _.y(A,FG(g.a,v),
|
|
307
|
+
2)}if(z=_.yG(g.a,_.P))IF(g.R,h).text=z;g.Ie["delete"](v);g.log.debug("Choosing new streams after adding a text stream");$I(g,h);eI(g);return A["return"](XE(v))})};
|
|
308
|
+
_.t.Nj=function(a){this.log.debug(_.lC,a);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=cJ(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}}};
|
|
309
|
+
_.t.Mj=function(){this.log.debug("canSwitch_");this.fa=!1;this.configuration.abr.enabled&&this.h.enable();this.Na&&(KG(this.a,this.Na,this.Ci,this.Bi),this.Na=null);this.ja&&(_.JG(this.a,this.ja,!0,0),this.ja=null)};_.t.An=function(){this.A&&this.A.update()};_.t.um=function(){this.B&&this.B.j.Le()};
|
|
310
|
+
_.t.Yi=function(a,b,c){if((void 0===c?"":c)===jC)return eI(this),this.ra()||(this.configuration.abr.enabled=!0,this.h.enable()),$I(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===_.cd&&(h=h&&l.language===a.language));return h})&&this.ra()){for(var d=_.w(b.variants),e=d.next();!e.done;e=d.next()){e=e.value;var f=e[a.type];f&&f.id===a.id&&(e.allowedByApplication=!1)}eI(this);this.ra()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
311
|
+
$I(this,b)}return c};_.t.hm=function(){this.log.debug("endOfStream called by streaming engine");this.Nd=!0};_.t.onError=function(a){if(this.G!==YH&&7001!==a.code&&7E3!==a.code){var b=new _.L(_.te,{detail:a});a.severity===_.O&&yH(this,_.yp);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.t.tf=function(a){a.type===_.me?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Tg?ZH(this):"emsg"!==a.type&&(a instanceof _.L?this.dispatchEvent(a):this.log.debug(_.jc,a.type)))};_.t.ra=function(){return this.configuration.abr.enabled};
|
|
312
|
+
_.t.qn=function(a){var b=this,c,d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:if(!b.Kc)return n["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ra();return _.y(n,b.Kc(c.url,a),2);case 2:e=n.f;if(!e)return n["return"]();f=_.M.pa(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.y(n,VG(b.a),3);case 3:g=tI(b);case 4:return h=!1,_.D(n,7),b.log.info("Switching CDN to "+f.url+"."),_.y(n,fJ(b,f,g),9);case 9:_.th(n,6);break;case 7:return l=_.E(n),b.log.info("Switch failed"),
|
|
313
|
+
_.y(n,b.Kc(f.url,a),10);case 10:if(m=n.f)f.url=m,h=!0;else throw l;case 6:h?n.F(4):(d&&b.h.enable(),RG(b.a,!0),b.Z[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.L(_.ud,{newManifest:f.url})),_.B(n))}})};var YH=0,uH=1,vH=2,dI=[_.jf,_.Ce];gJ.prototype.a=function(){return eC};
|
|
314
|
+
gJ.prototype.canPlay=function(a,b){if(_.fl())return 0;var c=a.type||"",d=(window.ManagedMediaSource?!0:!1)||(window.MediaSource&&MediaSource.isTypeSupported?!0:!1),e=window.ManagedMediaSource||window.MediaSource&&MediaSource.isTypeSupported?c in _.Qt||_.Rt(a.url)in _.St?!0:!1:!1;if(d&&e){if(_.Yj(2))return 1;if(_.gl()&&c===_.Il){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Ih("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
315
|
+
gJ.prototype.f=function(a){return a===_.qa||a===_.Lb};gJ.prototype.create=function(){return new wH};_.Sh(new gJ);_.rq(function(){_.Nh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Mh("Patching Chromecast MSE bugs."),lJ();else if(_.gl()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;jJ();10>=a?(_.Mh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Mh("Patching Safari 11 \x26 12 MSE bugs."),hJ(),iJ()):(_.Mh("Patching Safari 13 MSE bugs."),hJ())}else _.Yj(2)||_.Yj(3)||
|
|
316
|
+
_.Yj(4)?kJ():_.Mh("Using native MSE as-is.");else _.Mh("No MSE implementation available.")});_.x(mJ,_.Eu);_.t=mJ.prototype;
|
|
317
|
+
_.t.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Ih("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.kg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.wd}catch(g){f.align="middle"}e.writingMode===_.Jg?f.vertical="lr":e.writingMode===_.Kg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.w(a);for(a=d.next();!a.done;a=d.next())b(a.value);a=c.slice().sort(function(e,f){return e.startTime!==f.startTime?
|
|
318
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.w(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.t.remove=function(a,b){if(!this.a)return!1;nJ(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.t.isTextVisible=function(){return this.a.mode===_.cg};_.t.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.cg:_.ye)};_.t.destroy=function(){this.a&&nJ(this.a,function(){return!0});this.a=null;return Promise.resolve()};oJ.prototype.isSupported=function(){return!0};oJ.prototype.create=function(a){return new mJ(a)};_.ap("single-native",new oJ);};
|
|
319
319
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
320
320
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
321
321
|
else{_=this.clpp._;(f.call(g,this));}
|