@castlabs/prestoplay 6.28.0 → 6.29.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 +15 -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 +123 -113
- package/cjs/cl.conviva.js +28 -28
- package/cjs/cl.core.js +616 -609
- package/cjs/cl.crypto.js +7 -7
- package/cjs/cl.dash.js +89 -89
- package/cjs/cl.externs.js +127 -34
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +79 -78
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +24 -24
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -350
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +70 -70
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -6
- package/cl.cast.js +98 -91
- package/cl.conviva.js +27 -27
- package/cl.core.js +492 -488
- package/cl.crypto.js +8 -8
- package/cl.dash.js +82 -82
- package/cl.externs.js +123 -34
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +16 -15
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +303 -304
- 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.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +187 -87
package/cjs/cl.mse.js
CHANGED
|
@@ -1,360 +1,360 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
_
|
|
7
|
-
|
|
8
|
-
_.
|
|
9
|
-
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?
|
|
10
|
-
b,d||null,e,a,c)};_.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
_.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
for(var q=p.next();!q.done;q=p.next()){q=q.value;var t=a[q];if(void 0!==t&&null!==t){var u=d[q];u&&(t=u(t));u=q+"\x3d"+t;g.includes(q)&&0===t&&(u="");f.includes(q)?u=q+"\x3d"+t:e.includes(q)?u=q+'\x3d"'+t+'"':typeof t===_.
|
|
18
|
-
|
|
19
|
-
C=t.
|
|
20
|
-
a.a.contentId)&&64<A.length&&(a.g.warn("CMCD contentId: "+A+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),A=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},h&&{bl:h},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:2===m},A&&{cid:A},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:B},C&&{rtp:C});if("query"===a.a.deliveryMode){if(d=
|
|
21
|
-
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
_.
|
|
26
|
-
|
|
27
|
-
|
|
2
|
+
var f=function(window){var AB,BB,CB,DB,EB,FB,GB,HB,IB,KB,LB,MB,NB,PB,QB,RB,SB,UB,VB,WB,XB,YB,ZB,aC,dC,eC,gC,hC,iC,jC,kC,mC,oC,pC,qC,rC,wC,xC,yC,zC,AC,BC,CC,EC,HC,IC,KC,LC,NC,MC,PC,OC,QC,RC,VC,WC,YC,ZC,$C,bD,cD,dD,eD,fD,gD,hD,iD,kD,pD,qD,rD,sD,uD,AD,FD,ID,xD,HD,JD,KD,LD,MD,ND,OD,PD,QD,RD,SD,WD,YD,ZD,$D,XD,bE,aE,cE,dE,gE,hE,fE,eE,iE,mE,lE,nE,kE,jE,pE,oE,qE,rE,sE,vE,wE,zE,AE,CE,DE,BE,EE,HE,FE,GE,IE,JE,KE,LE,ME,OE,PE,QE,SE,TE,RE,UE,VE,WE,XE,YE,ZE,$E,aF,bF,dF,gF,hF,lF,jF,kF,pF,oF,qF,uF,sF,wF,yF,xF,AF,BF,CF,EF,DF,FF,GF,HF,IF,
|
|
3
|
+
LF,KF,NF,zF,OF,MF,PF,JF,VF,WF,SF,QF,TF,UF,XF,YF,aG,$F,bG,cG,dG,RF,eG,ZF,hG,iG,kG,jG,lG,nF,mG,nG,qG,oG,pG,sG,rG,tG,uG,vG,yG,AG,zG,BG,CG,DG,EG,HG,GG,FG,JG,IG,LG,PG,RG,SG,XG,$G,aH,cH,dH,fH,gH,iH,lH,MG,mH,pH,qH,rH,tH,uH,bH,yH,eH,hH,VG,BH,AH,TG,kH,EH,CH,wH,xH,GH,FH,DH,NH,OH,IH,QH,SH,KH,UH,TH,LH,MH,VH,UG,vH,WH,XH,JH,RH,$H,ZH,YH,sH,WG,YG,OG,HH,ZG,zH,PH,nH,oH,aI,dI,eI,fI,gI,hI,iI,jI,mI,nI,lI,tI,uI,CI,vI,kI,BI,DI,wI,xI,yI,II,EI,rI,qI,pI,sI,GI,HI,zI,AI,TI,RI,MI,WI,XI,YI,cJ,$I,fF,cF,HJ,GJ,iF,eF,EJ,JJ,DJ,IJ,
|
|
4
|
+
BJ,KJ,SI,QI,bJ,FJ,CJ,MJ,aJ,zJ,KI,yJ,NJ,PI,PJ,OJ,QJ,RJ,UJ,VI,OI,TJ,SJ,FI,LJ,WJ,XJ,mF,YJ,ZJ,VJ,oI,$J,LI,ZI,UI,aK,bK,cK,dK,eK,fK,gK,hK,iK,sC;AB=" buffer";BB=" is being or has been set up";CB=" seconds";DB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";EB="\x3c/LA_URL\x3e";FB="\x3cLA_URL\x3e";GB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';HB="Cannot get segment, period ID unknown";IB="Choosing new streams after key status change";_.JB="Could not load text stream with id: ";
|
|
5
|
+
KB="IterateSegmentReference";LB="Jumping forward";MB="MediaSource threw QuotaExceededError:";NB="Period not found.";_.OB="Player is in ERROR state and can not switch to ";PB="PrestoPlay TextTrack";QB="Removing audio from variant - audio not compatible with platform";RB="Setting playback rate to\x3d";SB="URI-REPLACEMENT";_.TB="Updating manifest...";UB="X-Playback-Session-Id";VB="bufferBehind\x3d";WB="bufferedBehind\x3d";XB="cannot find segment";YB="clpp.mse.Player";ZB="currentPeriod.startTime\x3d";
|
|
6
|
+
_.$B="dashif:Laurl";aC="fetching init segment";_.bC="getSegmentNextReference";_.cC="iterateSegmentReference";dC="key-restriction";eC="manifest.start";_.fC="onChooseStreams_ period";gC="presentationTime:";hC="presentationTime\x3d";iC="reference.endTime\x3d";jC="reference.position\x3d";kC="reference.startTime\x3d";_.lC="subtitles";mC="switch: Stream ";_.nC=function(a,b){return _.hh[a]=b};oC=function(a,b){a.f=a.f.filter(function(c){return c!==b})};
|
|
7
|
+
pC=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};qC=function(a){a=pC(a,_.pw);return null==a?null:a};rC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.hq(a);)if(0===_.jq(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.R.ea(a)};_.tC=function(a){var b=new Uint8Array(sC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.dq(c,!1);_.W(d,c);_.fq(d,b);_.fq(d,a.j);_.W(d,a.f.byteLength);_.fq(d,a.f);return _.Ni(d.buffer)};
|
|
8
|
+
_.uC=function(a,b,c,d){var e=_.Om(b);if(8!==e.byteLength)e="";else{var f=_.Qr(e);e=_.Lm(f);b:switch(f=f.byteLength,_.Rh("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[GB+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?FB+d+EB:"",DB].join("");break b;case "4.1.0.0":e=[GB+a+'"\x3e','\x3cDATA\x3e\x3cPROTECTINFO\x3e\x3cKID ALGID\x3d"AESCTR" ',
|
|
9
|
+
c?'CHECKSUM\x3d"'+c+'" ':"",'VALUE\x3d"'+e+'"',"\x3e\x3c/KID\x3e\x3c/PROTECTINFO\x3e",d?FB+d+EB:"",DB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[GB+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?FB+d+EB:"",DB].join("");break b;default:_.Mh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Rh("New payload",e);e=_.Ni(_.R.Qf(e,!0));return new _.Mr(_.Rr,
|
|
10
|
+
b,d||null,e,a,c)};_.vC=function(a,b){return b===a.version?a:_.uC(b,a.a,a.l||void 0,a.h||void 0)};wC=function(a,b){if(_.ij("Edge/"))return!0;b=b.toLowerCase();if(_.jj()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ee);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
11
|
+
xC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.As(c),!wC(a,c))||d&&d.encrypted&&(d=_.As(d),!wC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};yC=function(a,b,c){a.f!==b&&(a.f=b,a.a.push({timestamp:Date.now()/1E3,id:b.id,trackId:b.track.id,type:b.track.type,fromAdaptation:c,width:null,height:null,bandwidth:b.bandwidth}))};
|
|
12
|
+
zC=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.ac()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};AC=function(a,b){for(var c=new _.ci(void 0,void 0===b?"total":b),d=_.v(a),e=d.next();!e.done;e=d.next())c.a.push(e.value);c.length=a.length;return c};BC=function(a,b){for(var c=0,d=_.v(a),e=d.next();!e.done;e=d.next())c+=b(e.value)?1:0;return c};CC=function(a,b){var c=_.sn(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};
|
|
13
|
+
_.DC=function(a,b){return a.concat(b)};EC=function(){};_.FC=function(a,b){return 0===b.length?a:a.map(function(c){return b.map(function(d){return _.Cn(d,c)})}).reduce(_.DC,[])};_.GC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};
|
|
14
|
+
HC=function(a){for(var b=[a.mimeType],c=_.v(_.ow),d=c.next();!d.done;d=c.next()){var e=_.v(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,"")};IC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};_.JC=function(a){var b=[];a=_.v(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(",")};
|
|
15
|
+
KC=function(a,b){var c=_.JC(_.Jn(a)),d=_.In(a),e=_.JC(_.Jn(b));return d===_.In(b)&&c===e};
|
|
16
|
+
LC=function(a){function b(y){return 100*c(y/100)}function c(y){return Math.round(y)}for(var d={br:c,d:c,bl:b,dl:b,mtp:b,nor:function(y){return encodeURIComponent(y)},rtp:b,tb:c,Rp:c,Sp:c},e=["nor","nrr","sid","cid"],f=["ot","sf","st"],g=["mtp"],h={},l=_.v(Object.entries({Object:["br","d","ot","tb"],Request:"bl dl mtp nor nrr su".split(" "),Session:"cid pr sf sid st v".split(" "),Status:["bs","rtp"]})),m=l.next();!m.done;m=l.next()){var n=_.v(m.value);m=n.next().value;var p=n.next().value;n=[];p=_.v(p);
|
|
17
|
+
for(var q=p.next();!q.done;q=p.next()){q=q.value;var t=a[q];if(void 0!==t&&null!==t){var u=d[q];u&&(t=u(t));u=q+"\x3d"+t;g.includes(q)&&0===t&&(u="");f.includes(q)?u=q+"\x3d"+t:e.includes(q)?u=q+'\x3d"'+t+'"':typeof t===_.Yc&&(u=t?""+q:"");u&&n.push(u)}}0<n.length&&(h[m]=n.join(","))}return h};NC=function(a,b,c){this.h=a;this.a=b;this.g=new _.L("clpp.net.CmcdManager");this.j=MC(this);this.h.f.push(this.j);this.l=c;this.f=!1};
|
|
18
|
+
MC=function(a){return function(b,c){if(!a.a||!a.a.enabled||!c)return Promise.resolve(b);var d=a.l;var e=d.getBandwidthEstimate,f=d.getBufferInfo,g=d.getLoadedSource,h=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.ud;d=c.stream;var p=c.segment,q=c.objectType,t=c.nextSegment,u=c.streamType;l=l();m=m();var y=l||1;e=e();g=(g=g())?OC(g):void 0;f=1E3*f().Sa(h());h=["a","v","av"].includes(q)?f:void 0;var B=!1;!a.f||"v"!==q&&"av"!==q||(B=!0,a.f=!1);n=PC(n,q);if(p&&t&&p!==t){var A=p.La()[0],
|
|
19
|
+
C=t.La()[0];var E=new URL(C);A=new URL(A);if(E.origin!==A.origin)E=C;else{C=E.pathname.split("/").slice(1);for(A=A.pathname.split("/").slice(1,-1);C[0]===A[0];)C.shift(),A.shift();for(;A.length;)A.shift(),C.unshift("..");E=C.join("/")+E.search+E.hash}}else E=void 0;p&&t&&(t.la||t.ga)&&(p.la!==t.la||p.ga!==t.ga)?(C=t.la+"-",t.ga&&(C+=t.ga),t=C):t=void 0;a:{if(p&&d&&(C=d.bandwidth)){C=C*(p.endTime-p.startTime)/1E3/((f/1E3||500)/(y||1)/1E3);C=a.a.rtpMultiplier?C*a.a.rtpMultiplier:C;break a}C=void 0}(A=
|
|
20
|
+
a.a.contentId)&&64<A.length&&(a.g.warn("CMCD contentId: "+A+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),A=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},h&&{bl:h},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:2===m},A&&{cid:A},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:B},C&&{rtp:C});if("query"===a.a.deliveryMode){if(d=LC(d),
|
|
21
|
+
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.nm(b.uris[p]),q.a.searchParams.set("CMCD",d),b.uris[p]=q.toString()}else{p=LC(d);d={};p=_.v(Object.entries(p));for(q=p.next();!q.done;q=p.next())u=_.v(q.value),q=u.next().value,u=u.next().value,d["CMCD-"+q]=u;b.headers=Object.assign({},b.headers||{},d)}return Promise.resolve(b)}};
|
|
22
|
+
PC=function(a,b){var c=a();if(0!==c.length)switch(c=c.reduce(function(d,e){return d&&d.bandwidth>e.bandwidth?d:e}),b){case "a":return c.bf||void 0;case "v":return c.Rf||void 0;default:return c.bandwidth}};OC=function(a){switch(a.type){case _.Hc:return"d";case _.Vl:return"h";case _.Mc:return"s";default:return"o"}};QC=function(a,b){a=_.uo(a);b=_.uo(b);var c=a.split("-"),d=b.split("-");return c[0]===d[0]&&1===c.length&&2===d.length};
|
|
23
|
+
RC=function(a){return a.language?_.uo(a.language):a.audio&&a.audio.language?_.uo(a.audio.language):a.video&&a.video.language?_.uo(a.video.language):_.Cg};
|
|
24
|
+
_.SC=function(a,b){for(var c=_.uo(a),d=new Set,e=_.v(b),f=e.next();!f.done;f=e.next())d.add(_.uo(f.value));e=_.v(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,f===c)return f;e=_.v(d);for(f=e.next();!f.done;f=e.next())if(f=f.value,QC(f,c))return f;e=_.v(d);for(f=e.next();!f.done;f=e.next()){var g=f=f.value,h=c;g=_.uo(g);h=_.uo(h);g=g.split("-");h=h.split("-");if(2===g.length&&2===h.length&&g[0]===h[0])return f}d=_.v(d);for(f=d.next();!f.done;f=d.next())if(e=f.value,QC(c,e))return e;return null};
|
|
25
|
+
_.TC=function(a,b,c,d,e,f,g){f=void 0===f?function(){return""}:f;this.La=a;this.la=b;this.ga=c;this.keyInfo=d||null;this.ae=_.M.P(e)?!1:!!e;this.le=f?f:function(){return""};this.Qa=g};_.UC=function(a,b,c,d,e,f){this.tagName=a;this.textContent=b;this.attributes=c;this.childNodes=d;this.localName=e;this.a=f};
|
|
26
|
+
VC=function(a){return-1===a.indexOf("\x26")?a:a.replace(/&(?:amp|lt|gt|quot|apos|nbsp|lrm|rlm|#[xX]?[0-9a-fA-F]+);/g,function(b){switch(b){case "\x26amp;":return"\x26";case "\x26lt;":return"\x3c";case "\x26gt;":return"\x3e";case "\x26quot;":return'"';case "\x26apos;":return"'";case "\x26nbsp;":return"\u00a0";case "\x26lrm;":return"\u200e";case "\x26rlm;":return"\u200f";default:return"#"===b[1]?(b="x"===b[2]||"X"===b[2]?parseInt(b.slice(3),16):parseInt(b.slice(2),10),String.fromCodePoint(b)):b}})};
|
|
27
|
+
WC=function(a){function b(h,l){return new _.UC(void 0===l?_.da:l,h,{},[],null,g)}function c(h){h=void 0===h?"":h;for(var l=[];a[e];)if(60==a.charCodeAt(e)){if(47===a.charCodeAt(e+1)){var m=e+2;e=a.indexOf("\x3e",e);if(!a.startsWith(h,m))throw h=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(h.length-1)+"\nColumn: "+(h[h.length-1].length+1)+"\nChar: "+a[e]);e+1&&(e+=1);break}else if(63===a.charCodeAt(e+1)){e=a.indexOf("\x3e",e);e++;continue}else if(33===a.charCodeAt(e+1)){if(45==
|
|
28
28
|
a.charCodeAt(e+2)){for(;-1!==e&&(62!==a.charCodeAt(e)||45!=a.charCodeAt(e-1)||45!=a.charCodeAt(e-2)||-1==e);)e=a.indexOf("\x3e",e+1);-1===e&&(e=f)}else if(91===a.charCodeAt(e+2)&&91===a.charCodeAt(e+8)&&a.startsWith("CDATA",e+3)){m=a.indexOf("]]\x3e",e);-1==m?(l.push(b(a.substr(e+9),"#cdata")),e=f):(l.push(b(a.substring(e+9,m),"#cdata")),e=m+3);continue}else{m=e+1;e+=2;for(var n=!1;(62!==a.charCodeAt(e)||!0===n)&&a[e];)91===a.charCodeAt(e)?n=!0:!0===n&&93===a.charCodeAt(e)&&(n=!1),e++;l.push(b(a.substring(m,
|
|
29
|
-
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var t="",u=a.charCodeAt(e);39!==u&&34!==u;)e++,u=a.charCodeAt(e);if(39===u||34===u){if(t=e+1,e=a.indexOf(a[e],t),t=a.slice(t,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=t;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(t,q[1])}e++}q=[];t=a.charCodeAt(e-1);e++;47!==t&&(q=c(m));l.push(new _.
|
|
30
|
-
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=
|
|
31
|
-
|
|
32
|
-
_.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
_.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.
|
|
41
|
-
_.
|
|
42
|
-
_.
|
|
43
|
-
_.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
e=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=e,a.a=d,a.l=c;d=e-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==f||a.A)&&a.I&&(g=d.start(f),!(g>=
|
|
53
|
-
g),a.B=!0,a.a.currentTime=g)}}}};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(new _.
|
|
57
|
-
|
|
58
|
-
$D=function(a,b){if("startover"===a.a.B)return b;var c=new _.bi(a.h.buffered);c=c.Lc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=lD(a.a),g=vD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=wD(a.a,d),m=wD(a.a,e);d=wD(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),dE(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");
|
|
29
|
+
e),"#doctype"))}e++;continue}e++;n=m=d();var p=m.indexOf(":");-1!==p&&(m.slice(0,p),n=m.slice(p+1));for(p={};62!==a.charCodeAt(e)&&a[e];){var q=a.charCodeAt(e);if(64<q&&91>q||96<q&&123>q){q=d();for(var t="",u=a.charCodeAt(e);39!==u&&34!==u;)e++,u=a.charCodeAt(e);if(39===u||34===u){if(t=e+1,e=a.indexOf(a[e],t),t=a.slice(t,e),-1===e)throw Error("Missing closing quote");}else e--;p[q]=t;q=q.split(":");"xmlns"===q[0]&&q[1]&&g.set(t,q[1])}e++}q=[];t=a.charCodeAt(e-1);e++;47!==t&&(q=c(m));l.push(new _.UC(m,
|
|
30
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=VC(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var h=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(h,e)}var e=0,f=a.length,g=new Map;return new _.UC("#document",null,{},c(""),null,g)};_.XC=function(){};
|
|
31
|
+
YC=function(a){switch(a){case _.Nn:_.Fw.info("Select DOM parser for XML");_.Nr=new _.Gr;break;case "txml":_.Fw.info("Select TXML parser for XML");_.Nr=new _.XC;break;default:_.Fw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.Nr=new _.Gr}};ZC=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};$C=function(a,b){return a.start-b.start};
|
|
32
|
+
_.aD=function(a){this.h=void 0===a?null:a;this.log=new _.L("clpp.renditions");this.S=[];this.f=this.player=null;this.a=!1};bD=function(a){return a.S.map(function(b){return{start:b.start,end:b.end,width:b.width,height:b.height,bandwidth:b.bandwidth,rendition:b.rendition}})};cD=function(a){a.player&&(a.player.off(_.Pf,a.kd),a.a&&a.player.off(_.vg,a.kd));a.player=null};dD=function(a){a.player&&a.player.trigger(new _.Q(_.Uc))};
|
|
33
|
+
eD=function(a){if(a.player){for(var b=!1,c={},d=0;d<a.S.length;d++){var e=a.S[d],f=e.width+"x"+e.height,g=c[f];if(g&&g!==e.bandwidth){b=!0;break}c[f]=e.bandwidth}b&&!a.a?(a.log.debug("Tracking timeupdates"),a.player.on(_.vg,a.kd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.vg,a.kd),a.a=!1)}};fD=function(a,b,c){a.S=a.S.filter(function(d){if(d.end<=b||d.start>=c)return!1;d.start=Math.max(d.start,b);d.end=Math.min(d.end,c);return!0});a.player&&a.player.trigger(new _.Q(_.Qg))};
|
|
34
|
+
gD=function(a,b){for(var c=null,d=_.v(a),e=d.next();!e.done;e=d.next())e=e.value,b>=e.startTime&&(c=e);return c};hD=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};iD=function(a,b){for(var c=0;c<a.length;c++)if(hD(a[c]).has(b))return c;return-1};
|
|
35
|
+
kD=function(a,b){Array.from(hD(a)).forEach(function(c){c.segmentIndex&&_.jD(c.segmentIndex,b)})};_.lD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.mD=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)};_.nD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
36
|
+
_.oD=function(a,b,c,d,e,f,g,h){a=_.Xk(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};pD=function(a,b){this.w=null;this.D=a;this.h=b;this.j=this.A=0;this.l=Infinity;this.f=this.a=null;this.B="";this.o=new Map};
|
|
37
|
+
qD=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.Ni(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Ni(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.j&&g.startTime<a.l});a.h.append(f,e.styles);null==a.a&&(a.a=Math.max(c,a.j));a.f=Math.min(d,a.l)}})};
|
|
38
|
+
rD=function(a,b,c){a.B=b;if(b=a.o.get(b))for(var d=_.v(b.keys()),e=d.next();!e.done;e=d.next())if(e=b.get(e.value))e=e.filter(function(f){return f.endTime<=c}),a.h.append(e,[])};
|
|
39
|
+
sD=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.v(b);for(var h=b.next();!h.done;h=b.next()){var l=h.value;h=l.stream;g.has(h)||g.set(h,new Map);g.get(h).has(f)||g.get(h).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.j&&l.startTime<a.l&&(l=new _.Hp(l.startTime,l.endTime,l.text),g.get(h).get(f).push(l),h===a.B&&a.h.append([l],[]))}e=_.v(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=_.v(g.get(f).keys()),h=b.next();!h.done;h=b.next())h=h.value,l=
|
|
40
|
+
g.get(f).get(h),a.o.get(f).set(h,l);a.a=null==a.a?Math.max(c,a.j):Math.min(a.a,Math.max(c,a.j));a.f=Math.max(a.f,Math.min(d,a.l))};_.tD=function(a){a=a.toLowerCase();return _.Kv[a]||window.muxjs&&a===_.Gc?!0:!1};uD=function(a){this.a=this.h=0;this.f=a};_.vD=function(a,b,c){a.h=b;a.a=c};
|
|
41
|
+
_.wD=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.h=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.j=1;this.H=0;this.o=this.w=null;this.I=0;this.D=this.l=d;this.O=void 0===e?!0:e;this.g=new _.L("clpp.media.PresentationTimeline");this.R=f;this.L=null;this.a=new uD(d);this.J=null;this.B=this.h.type||null};_.yD=function(a,b){a.L={offsetDateTime:b-xD(a),seekRangeStartDateTime:b}};_.zD=function(a,b){a.l=b;a.D=b;a.a.f=b};AD=function(a){return 2===a.h.version?a.a.f?a.a.a:null:a.l?a.f:a.D?a.o:null};
|
|
42
|
+
_.DD=function(a,b,c){if(0!==b.length){var d=b[b.length-1].endTime+c;_.BD(a,b[0].startTime+c);a.j=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.j);_.CD(a,d);null!=a.G&&a.O&&(a.G=(Date.now()+a.I)/1E3-(a.o||0)-a.j);a.g.debug("notifySegments: maxSegmentDuration\x3d"+a.j)}};_.BD=function(a,b){a.w=null==a.w?b:Math.min(a.w,b)};_.CD=function(a,b){a.o=Math.max(a.o||0,b)};_.ED=function(a,b){a.j=Math.max(a.j,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.j)};
|
|
43
|
+
_.GD=function(a){return 2===a.h.version?a.a.ac():Infinity===a.A?0:Math.max(0,FD(a)-a.A)};FD=function(a){if(2===a.h.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.j-a.H)-a.G):Math.max(0,b-a.j-a.G);a=Math.min(b,a.f)}return a};ID=function(a,b){if(2===a.h.version)return a.a.ac();var c=Math.max(a.w,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(FD(a)-a.A+b,HD(a)))};
|
|
44
|
+
xD=function(a){return 2===a.h.version?a.a.ac():ID(a,0)};HD=function(a){var b=a.ue()&&!a.D?a.K:0;return 2===a.h.version?a.a.a-b:Math.max(0,FD(a)-b)};JD=function(a,b){var c=xD(a);if(b<c)return c;c=HD(a);2===a.h.version&&(c=a.a.a);return b>c?c:b};KD=function(a,b){var c=(void 0===b?0:b)?a.offset:0;return{schemeIdUri:a.schemeIdUri,configurationId:a.configurationId,value:a.value,startTime:a.startTime+c,endTime:a.endTime+c,id:a.id,eventElement:a.eventElement,type:a.type,customAttributes:a.customAttributes}};
|
|
45
|
+
LD=function(){this.f=function(){};this.h=function(){};this.a=new Set};MD=function(a,b,c){a.f=b;a.h=c};ND=function(a,b){for(var c=[],d=!1,e={},f=_.v(b),g=f.next();!g.done;e={Yc:e.Yc},g=f.next())e.Yc=g.value,a.a.has(e.Yc)||(c.push(e.Yc),g=Array.from(a.a.values()).some(function(h){return function(l){return l.id===h.Yc.id}}(e)),e.Yc.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(h){return a.a.add(h)});f=a.a.size;c.forEach(function(h){return a.f(h)});(d||0<c.length||e!==f)&&a.h()};
|
|
46
|
+
OD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return KD(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};PD=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 _.Yv("crop",a,d.endTime?d.endTime-a:Infinity,!1))};QD=function(a){var b=a.a.ii(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.Q(_.Sf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
47
|
+
RD=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.L("clpp.media.SegmentIterator")};SD=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.La().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};_.TD=function(a){this.a=a;this.g=new _.L("clpp.media.SegmentIndex")};_.UD=function(a){return a.a.length?a.a[a.a.length-1].endTime:0};_.VD=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};
|
|
48
|
+
WD=function(a,b){var c=a.md(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 RD(a,c,e)};_.jD=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)};
|
|
49
|
+
YD=function(a,b){this.h=a;this.l=XD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};ZD=function(a,b){a.f=b};$D=function(a){this.a=a};XD=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};
|
|
50
|
+
bE=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.h=c;this.G=e;this.j=new _.si;this.D=!1;this.J=a.readyState;this.l=!1;this.f=d;this.B=this.o=this.I=this.A=!1;this.j.on(a,_.Vg,function(){return aE(f)});this.w=(new _.ej(function(){aE(f)})).Hb(.25)};
|
|
51
|
+
aE=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.l=!1,a.J=a.a.readyState);var b=a.h.smallGapLimit,c=a.a.currentTime,d=a.a.buffered,e=a.h.gapTolerance;a:{var f=new _.ci(d);var g=a.h.gapDetectionThreshold;g=void 0===g?0:g;if(f.length&&!(1===f.length&&1E-6>f.end(0)-f.start(0)))for(var h=0;h<f.length;h++)if(f.start(h)>c&&(0===h||f.end(h-1)-c<=g)){f=h;break a}f=null}if(null==f){if(a.f){a=a.f;d=a.h;c=XD(d);d=d.a.currentTime;
|
|
52
|
+
e=Date.now()/1E3;if(a.a!==d||a.l!==c)a.j=e,a.a=d,a.l=c;d=e-a.j;d>=a.o&&c&&a.f(a.a,d)}}else if((0!==f||a.A)&&a.I&&(g=d.start(f),!(g>=HD(a.H)))){h=g-c;b=h<=b;var l=!1;h<e||(b||a.l||(a.l=!0,e=new _.Q("largegap",{detail:{currentTime:c,gapSize:h}}),e.cancelable=!0,a.G(e),a.h.jumpLargeGaps&&!e.defaultPrevented?l=!0:_.Qh("Ignoring large gap at",c,"size",h)),!b&&!l)||(0===f?_.Qh(LB,h,"seconds because of gap before start time of",g):_.Qh(LB,h,"seconds because of gap starting at",d.end(f-1),"and ending at",
|
|
53
|
+
g),a.B=!0,a.a.currentTime=g)}}}};cE=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.ej(function(){0>=b.j?(_.Mh(["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--)})};dE=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Hb(.1)};gE=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.si;this.h=new cE(a);this.w=!1;0<a.readyState?eE(this,c):fE(this,c)};
|
|
54
|
+
hE=function(a,b){0<a.a.readyState?dE(a.h,b):fE(a,b)};fE=function(a,b){a.A=b;a.f.off(a.a,_.Fe);a.f.one(a.a,_.Fe,function(){eE(a,b)})};eE=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?iE(a):(a.f.one(a.a,_.Xf,function(){iE(a)}),dE(a.h,0===a.a.currentTime?b:a.a.currentTime))};iE=function(a){_.mj()&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Xf,function(){return a.j()})};
|
|
55
|
+
mE=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 bE(a,b.presentationTimeline,c,jE(this,a,c),f);this.f=new gE(a,function(){a:{var l=h.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.l=!1;l=h.f.getTime();var n=kE(h,l);if(Math.abs(n-l)>h.l.gapTolerance){var p=(new Date).getTime()/1E3;if(!h.w||h.w<p-1){h.w=p;hE(h.f,n);m=void 0;break a}}h.g.debug("Seek to "+l);h.A(m?1:0);m=void 0}return m},lE(this,d,g),function(){h.j.I=!0});
|
|
56
|
+
this.o=(new _.ej(function(){if(0!==h.h.readyState&&!h.h.paused){var l=h.f.getTime(),m=xD(h.a),n=HD(h.a);3>n-m&&(m=n-3);l<m&&(m=kE(h,l),h.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),h.h.currentTime=m)}})).Hb(.25);this.g=new _.L("clpp.mse.Playhead")};lE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?xD(a.a):HD(a.a):0>b&&(b=HD(a.a)+b);return nE(a,JD(a.a,b))};nE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
57
|
+
kE=function(a,b){if("startover"===a.a.B)return b;var c=new _.ci(a.h.buffered);c=c.Oc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=xD(a.a),g=HD(a.a),h=a.a.getDuration();3>g-f&&(f=g-3);var l=ID(a.a,d),m=ID(a.a,e);d=ID(a.a,d+e);if(b>=h)return a.g.debug("Playhead past duration."),nE(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");
|
|
59
58
|
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};
|
|
60
|
-
|
|
61
|
-
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};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_.
|
|
65
|
-
_.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
{},g=_.v(a.h.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
(b=new URL(b.uri),b.hostname=a.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
[];return c};
|
|
78
|
-
|
|
79
|
-
_.
|
|
80
|
-
|
|
81
|
-
d=
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
l.
|
|
88
|
-
|
|
89
|
-
_.z(f)}})};
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
b.push(e),c.active&&a.a.set(_.X,e.renditions[0])};
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||
|
|
102
|
-
null!==d&&null!==e&&h){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&a.
|
|
103
|
-
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
m);_.
|
|
108
|
-
|
|
109
|
-
b.length;c={
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(_.
|
|
116
|
-
!n.audio?(_.
|
|
117
|
-
|
|
118
|
-
type:"variant",bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,hb:h,codecs:f.join(", "),
|
|
119
|
-
c.bandwidth||null);b&&(a.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
_.
|
|
123
|
-
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.
|
|
124
|
-
|
|
125
|
-
_.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
b.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
a;if(0===g.length||!e)throw _.
|
|
138
|
-
|
|
139
|
-
b.start);b=_.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
m),q["return"]();p=
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
c)};
|
|
148
|
-
|
|
149
|
-
_.
|
|
150
|
-
|
|
151
|
-
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.
|
|
152
|
-
u>=q))return y=
|
|
153
|
-
D=!0:(J=g.
|
|
154
|
-
|
|
155
|
-
f.a)return _.G(f,0);e=_.H(f);if(a.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.
|
|
160
|
-
|
|
161
|
-
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw h;case 3:p=_.v(b);for(e=p.next();!e.done;e=p.next())q=e.value,(t=a.o.get(q.id))&&!t.done&&(t.resolve(),a.g.debug("(all) finished setting up stream "+q.id));_.z(u)}})};
|
|
162
|
-
|
|
163
|
-
if(null!=l&&f>=l&&!b
|
|
164
|
-
null);d=Infinity;h=_.v(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
e,
|
|
168
|
-
g)a=null;else if(f=
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
D}}b.Db=!1;b.
|
|
173
|
-
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),C.C(0);if(7001===A.code)return b.Db=!1,b.rb=null,
|
|
174
|
-
if(1001<=A.code&&1003>=A.code)return _.x(C,
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
p=
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
case 2:if(D=e.encrypted&&e.keyId&&a.
|
|
182
|
-
a.
|
|
183
|
-
b.
|
|
184
|
-
|
|
185
|
-
h);return _.x(l,a.
|
|
186
|
-
|
|
187
|
-
case 4:if(a.f)return D["return"]();
|
|
188
|
-
y+" Stream"),a.
|
|
189
|
-
0);_.z(U)})});return _.x(D,Promise.all(E),5);case 5:if(a.f)return D["return"]();
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
2===b?a.trigger(new _.Q(_
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
0;d<f.length;d++)if(!f[d].
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
6);case 6:return f=l.f,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.C(9);break}return _.x(c,a.L.destroy(),10);case 10:a.L=null;case 9:a.
|
|
219
|
-
|
|
220
|
-
|
|
59
|
+
jE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new YD(new $D(b),c.stallThreshold);ZD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var h=new _.ci(b.buffered),l;if(l=_.ij("Edge/")||_.ij("Trident/")||_.jj()||_.mj())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=
|
|
60
|
+
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};pE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.ej(function(){oE(b,!1)})).Hb(.25)};oE=function(a,b,c){c=void 0===c?0:c;for(var d=_.v(a.a),e=d.next();!e.done;e=d.next())e.value.l(a.f.currentTime,b,c)};
|
|
61
|
+
qE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
62
|
+
rE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{Wc:null,Vc:2,Mc:function(c,d){return b.a(c,d)}},{Wc:1,Vc:2,Mc:function(c,d){return b.a(c,d)}},{Wc:3,Vc:2,Mc:function(c,d){return b.a(c,d)}},{Wc:2,Vc:1,Mc:function(c,d){return b.f(c,d)}},{Wc:2,Vc:3,Mc:function(c,d){return b.f(c,d)}},{Wc:1,Vc:3,Mc:function(c,d){return b.h(c,d)}},{Wc:3,Vc:1,Mc:function(c,d){return b.h(c,d)}}]};sE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
63
|
+
_.tE=function(a){_.cw[a]&&delete _.cw[a]};_.uE=function(a){_.bw[a]&&delete _.bw[a]};vE=function(){this.f=new _.lD(2);this.h=new _.lD(5);this.a=0};wE=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.mD(a.f,b,d);_.mD(a.h,b,d)}};_.xE=function(a,b){this.id=a;this.na=b};
|
|
64
|
+
_.yE=function(a,b){return a.na.map(function(c){var d=new URL(c.uri+b);if(c.params){c=_.v(Object.entries(c.params));for(var e=c.next();!e.done;e=c.next()){var f=_.v(e.value);e=f.next().value;f=f.next().value;d.searchParams.set(e,f)}}return d.toString()})};zE=function(a,b){if(typeof a!==typeof b||a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c].serviceLocationId!==b[c].serviceLocationId||a[c].uri!==b[c].uri||a[c].params!==b[c].params)return!1;return!0};
|
|
65
|
+
AE=function(a,b){_.zi.call(this);this.A=a;this.h=null;this.B=b;this.D=new _.im;this.f=300;this.o=new Map;this.l=new Map;this.w=new Map;this.j=new Map;this.a=null;this.g=new _.L("clpp.net.ContentSteeringManager")};
|
|
66
|
+
CE=function(a,b){return _.I(function(c){null!=a.a&&(a.a.stop(),a.a=null);a.o.clear();a.l.clear();a.j.clear();a.w.clear();a.g.debug("contentSteeringServerUri: "+b.contentSteeringServerUri);a.g.info("queryBeforeStart: "+b.queryBeforeStart);a.h={manifestType:b.manifestType,contentSteeringServerUri:b.contentSteeringServerUri,queryBeforeStart:b.queryBeforeStart,Vh:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.Vh.length)for(var f=
|
|
67
|
+
{},g=_.v(a.h.Vh),h=g.next();!h.done;f={Ve:f.Ve},h=g.next())f.Ve=h.value,(h=d.na.find(function(l){return function(m){return m.serviceLocationId===l.Ve}}(f)))?e.push(h):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.Ve+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.na);a.o.set(d.id,d.na)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](BE(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);BE(a)}_.z(c)})};
|
|
68
|
+
DE=function(a,b){var c=a.j.get(b);c||(c={Rd:0,xh:new vE,Nf:!1},a.j.set(b,c));return c};
|
|
69
|
+
BE=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=EE(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.Xk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.km(a.D,e),_.x(m,e.T,2);f=m.f;if(410===f.status)a.g.info(" Content steering server not available(HTTP response 410), stopping updates."),null!=a.a&&(a.a.stop(),a.a=null);else if(429===f.status){a.g.info("Content steering server overloaded (HTTP response 429).");
|
|
70
|
+
if(g=parseInt(f.headers["retry-after"],10))a.g.info("Will retry after "+g+" s based on Retry-After header."),a.f=g;FE(a,a.f)}else try{h=_.R.ea(f.data),l=JSON.parse(h),1===l.VERSION?GE(a,l,f.uri):a.g.warn("Received unsupported steering manifest version: "+l.VERSION+", ignoring it and stop requesting.")}catch(n){a.g.error("requestInfo_: error parsing received steering manifest:",n);if(n&&7001===n.code)return m["return"]();null!=a.a&&(a.a.stop(),a.a=null);a.a=new _.ej(function(){BE(a)});FE(a,a.f)}_.z(m)})};
|
|
71
|
+
EE=function(a,b){var c=new URL(b),d=[],e=[];a.j.forEach(function(f,g){f.Nf&&(d.push(g),e.push(parseInt(f.xh.getBandwidthEstimate(1E4),10)));f.Nf=!1});d.length?a.h.manifestType===_.Hc?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.Vl&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
72
|
+
HE=function(a,b,c,d){var e=[],f=a.o.get(b)||[];if(!c.length)return a.l.get(b);a={};c=_.v(c);for(b=c.next();!b.done;a={Md:a.Md,Wb:a.Wb,Gd:a.Gd},b=c.next())if(a.Md=b.value,b=f.find(function(g){return function(h){return h.serviceLocationId===g.Md}}(a)))e.push(b);else if(a.Wb=d.find(function(g){return function(h){return h.ID===g.Md}}(a)),a.Wb&&(b=f.find(function(g){return function(h){return h.serviceLocationId===g.Wb["BASE-ID"]}}(a))))a.Gd={serviceLocationId:a.Md,uri:b.uri,params:{}},a.Wb[SB]&&(a.Wb[SB].HOST&&
|
|
73
|
+
(b=new URL(b.uri),b.hostname=a.Wb[SB].HOST,a.Gd.uri=b.toString()),a.Wb[SB].PARAMS&&Object.entries(a.Wb[SB].PARAMS).forEach(function(g){return function(h){var l=_.v(h);h=l.next().value;l=l.next().value;g.Gd.params[h]=l}}(a))),e.push(a.Gd);return e};FE=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ha(b)};
|
|
74
|
+
GE=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.ej(function(){BE(a,d)});if(c=b.TTL)a.f=c;FE(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,h){e.includes(h)||a.j["delete"](h)});a.o.forEach(function(g,h){var l=HE(a,h,e,f);a.l.set(h,l)})};
|
|
75
|
+
IE=function(a,b){var c=String(_.gt++);c=new _.at(c,a);c.mimeType=_.bt(b.mimeType);if(a===_.ct||a===_.X)c.label=_.bt(b.label),c.language=_.bt(b.language),c.originalLanguage=_.bt(b.originalLanguage);a===_.dt?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.X?(c.channelsCount=b.channelsCount,c.roles=b.cg||[],c.mimeType=_.bt(b.hb)):(c.kind=_.bt(b.kind),c.roles=b.roles);c.accessibility=a===_.dt||a===_.X?(b.accessibility||[]).filter(function(d){return d.type===a}):b.accessibility||
|
|
76
|
+
[];return c};JE=function(a,b,c){var d=new _.jt(a===_.dt?""+b.kc:a===_.X?""+b.qc:""+b.id,c);switch(a){case _.dt:d.codec=_.bt(b.Jj);d.bandwidth=b.Rf||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.Ig;break;case _.X:d.codec=_.bt(b.audioCodec);d.bandwidth=b.bf||b.bandwidth;d.originalId=b.Hg;break;default:d.codec=_.bt(b.codecs),d.originalId=b.ej}(a=c.renditions.find(function(e){return _.M.ta(e,d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
77
|
+
KE=function(a,b){var c=a.reduce(function(d,e){b===_.dt?null===e.kc||d[e.kc]&&!e.af||(d[e.kc]=e):b===_.X&&(null===e.qc||d[e.qc]&&!e.$e||(d[e.qc]=e));return d},{});return Object.values(c)};LE=function(a,b){if(void 0!==b&&null!==b){var c=a.filter(function(d){return d.audio&&d.audio.id===b});if(0<c.length)return c}return a};ME=function(a,b,c){function d(f,g){return null==f?null==g:g.id===f}for(var e=0;e<c.length;e++)if(d(a,c[e].audio)&&d(b,c[e].video))return c[e];return null};
|
|
78
|
+
_.NE=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};OE=function(a){var b=a.periods[0].startTime;a=a.periods[a.periods.length-1].endTime;if(null==a)throw Error("Period end time must be known");return{start:b,end:a}};PE=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
79
|
+
QE=function(a,b){if(0===a.length)throw Error("Cannot concatenate 0 manifests");if(1===a.length)return a[0];a[0].cues.forEach(function(f){f.offset=0});for(var c=_.kh(a[0].periods).concat(),d={},e=1;e<a.length;d={Ye:d.Ye},e++)d.Ye=OE(a[e-1]).end,_.NE(a[e].periods,d.Ye),c.push.apply(c,_.kh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.Ye}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d,alternativeVariants:a[0].alternativeVariants};
|
|
80
|
+
d=OE(c).end;_.vD(b.a,0,d);(d=a[0].presentationTimeline.Kc())&&_.yD(b,d.seekRangeStartDateTime);return c};SE=function(a,b){try{if(1===a.length)return a[0];if(!a.every(RE))throw new _.qi("Period durations must be finite");return QE(a,b)}catch(c){throw new _.N(_.O,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
81
|
+
TE=function(a,b){var c=b.periods[0].configurationId,d=_.kh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.zD(e,b.presentationTimeline.l);return SE([d,b],e)};RE=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
82
|
+
UE=function(a){return{id:a.id,bandwidth:a.bandwidth,trickPlay:a.video?a.video.trickPlay:!1,width:a.video?a.video.width:void 0,height:a.video?a.video.height:void 0}};VE=function(a,b){return b.find(function(c){return c.id===a.id})||null};WE=function(){this.g=new _.L("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};XE=function(a,b){return a.h.filter(function(c){return c.type===b})};YE=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
83
|
+
ZE=function(a,b,c){if(!c||YE(a,c.type)!==c||a.m.xa())switch(c=c?c.renditions[0]||null:null,b){case _.dt:a.qb(c);break;case _.X:a.Eb(c);break;case _.ct:a.Fb(c);break;default:throw Error("Unknown track type "+b);}};$E=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)};aF=function(a,b,c){return a.m.xa()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
84
|
+
bF=function(a,b,c){if(0>a.h.indexOf(b.track))throw Error("Unknown rendition with ID "+b.id);if(c!==b.track.type)throw Error("Types mismatch");};
|
|
85
|
+
dF=function(a,b,c){bF(a,b,_.dt);if(aF(a,b,_.dt)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.X)||null,f=null;if(e&&!e.a){var g=d.ud().filter(function(l){return l.kc===parseInt(b.id,10)});f=g.find(function(l){return l.qc===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var h=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return h.find(function(m){return m===
|
|
86
|
+
l.qc})})||null}}else f=d.ud().find(function(l){return l.kc===parseInt(b.id,10)})||null;f?(a.f.set(_.dt,b),cF(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
87
|
+
gF=function(a,b){var c,d,e;_.I(function(f){switch(f.a){case 1:c=_.ct;bF(a,b,c);if(!aF(a,b,c))return f["return"]();d=a.m.pa().find(function(g){return g.id===parseInt(b.id,10)});if(!d)return a.g.warn("Text rendition with ID: "+b.id+" not found."),f["return"]();a.g.info("Set text rendition with ID: "+b.id);a.f.set(c,b);_.F(f,2);$E(a,b);return _.x(f,eF(a.m,!0),4);case 4:return _.x(f,fF(a.m,d),5);case 5:a.m.trigger(new _.Q(_.qg));_.G(f,0);break;case 2:e=_.H(f),a.g.warn("Failed to set text rendition",e),
|
|
88
|
+
_.z(f)}})};hF=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.ct;c=YE(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.F(e,2);return _.x(e,eF(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.Q(_.qg)),_.G(e,0);d=_.H(e);a.g.warn("Failed to unset text rendition",d);_.z(e)})};
|
|
89
|
+
lF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.v(Object.values(_.Gw)),d=c.next();!d.done;d=c.next())d=d.value,a.a.set(d,null),a.f.set(d,null);c={};d=_.v(a.m.pa());for(var e=d.next();!e.done;c={Cc:c.Cc},e=d.next()){e=e.value;c.Cc=IE(_.ct,e);var f=b.find(function(h){return function(l){return h.Cc.ta(l)}}(c));c.Cc=f||c.Cc;var g=JE(_.ct,e,c.Cc);e.bg&&a.a.set(_.ct,g);f||b.push(c.Cc)}iF(a.m)||a.a.set(_.ct,null);c=a.m.ud();jF(a,b,c,_.dt);jF(a,b,c,_.X);
|
|
90
|
+
kF(a,b);a.h=b}};jF=function(a,b,c,d){var e=KE(c,d);c={};e=_.v(e);for(var f=e.next();!f.done;c={Dc:c.Dc},f=e.next()){f=f.value;c.Dc=IE(d,f);var g=b.find(function(l){return function(m){return l.Dc.ta(m)}}(c));c.Dc=g||c.Dc;var h=JE(d,f,c.Dc);(d===_.dt&&f.af||d===_.X&&f.$e)&&a.a.set(d,h);g||b.push(c.Dc)}};
|
|
91
|
+
kF=function(a,b){var c=a.m;if(c.f){var d=(d=mF(c))?nF(c.l,d).ab:null;c=c.f.muxedAudioTracks||[];if(d)for(var e=_.v(c),f=e.next();!f.done;f=e.next())f=f.value,f.active=d.id===f.id;d=c}else d=[];d=_.v(d);for(c=d.next();!c.done;c=d.next())c=c.value,e=String(_.gt++),e=new _.at(e,_.X),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.jt(""+c.id,e),f.codec="",f.bandwidth=0,f.originalId=c.label,f.a=!0,e.renditions.push(f),
|
|
92
|
+
b.push(e),c.active&&a.a.set(_.X,e.renditions[0])};pF=function(a,b,c,d){a.h.length||lF(a);var e=a.a.get(c)||null;(b=oF(a,b,c))&&e!==b&&($E(a,b),c===_.X?a.m.trigger(new _.Q(_.Vc)):c===_.dt&&a.m.trigger(new _.Q(_.Rg,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};oF=function(a,b,c){return XE(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
93
|
+
qF=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.rF=function(){};_.tF=function(a,b,c,d,e){this.j=a;this.B=c;this.a={};this.J={};this.O=!1;this.f=null;this.h={};this.l=new _.si;this.K=!1;this.w={};this.H=b;this.D=d;this.I=e;this.U=this.I.streaming.maxSegmentToMediaOffset||1;this.L=new _.lm;this.A="";this.G={};this.o=sF(this,this.L);this.R=!0;this.g=new _.L("clpp.mse.MediaSourceEngine")};
|
|
94
|
+
uF=function(a){var b=_.Hn(a.mimeType,a.codecs),c=HC(a);return _.tD(b)||_.av(c)||(_.sn(b,a.type)?!0:!1)};
|
|
95
|
+
sF=function(a,b){if(window.ManagedMediaSource){a.j.disableRemotePlayback=!0;var c=new ManagedMediaSource;a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.l.on(c,"startstreaming",function(){a.R=!0});a.l.on(c,"endstreaming",function(){a.R=!1});a.A=vF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=vF(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};wF=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
|
|
96
|
+
yF=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){1==p.a&&(c=_.v(b),d=c.next());if(5!=p.a){if(d.done)return p.C(0);e=d.value;f=_.v(e);g=f.next().value;h=f.next().value;l=g;m=a.a[l];return m?_.x(p,xF(a,l,m),5):(n=a.o.addSourceBuffer(h),a.l.on(n,_.ke,a.gl.bind(a,l)),a.l.on(n,"updateend",a.Sc.bind(a,l)),a.a[l]=n,p.C(5))}a.J[l]=h;a.h[l]=[];a.G[l]=!1;d=c.next();return p.C(2)})};xF=function(a,b,c){return _.I(function(d){return _.x(d,zF(a,b,function(){c.remove(0,Infinity)}),0)})};
|
|
97
|
+
AF=function(a){return a.I.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.R};BF=function(a,b){a.f||(a.f=new pD(a.I,a.B));var c=a.f;if(b!==_.Gc){var d=_.Kv[b];if(!d)throw new _.N(_.O,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.D)}};CF=function(a){return a.o?a.o.readyState===_.je:!0};EF=function(a){var b={};b.total=new _.ci(a.j.buffered,"total");b.audio=DF(a,_.Oc);b.video=DF(a,_.Ng);var c=[];a.f&&(c=[{start:a.f.Xb(),end:a.f.Ra()}]);b.text=AC(c,_.Fn);return b};
|
|
98
|
+
DF=function(a,b){try{return new _.ci(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error("failed to get buffered range for "+b,c),null}};FF=function(a,b){if(!a.a[b])return"";var c=DF(a,b);return c?c.toString():""};
|
|
99
|
+
GF=function(a,b,c,d,e,f,g,h,l){h=void 0===h?!1:h;l=void 0===l?!1:l;var m=a.a[b],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);b===_.Ng&&null!==d&&null!==e&&h&&(n=0<p?m.buffered.end(p-1):-1);b===_.Fn?l=qD(a.f,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.f||BF(a,_.og),sD(a.f,c.captions,d,e,a.a.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.a.audio&&!l&&f.push(zF(a,_.Oc,a.lg.bind(a,_.Oc,c.audio.buffer))),0<c.video.byteLength&&a.a.video&&f.push(zF(a,_.Ng,a.lg.bind(a,_.Ng,
|
|
100
|
+
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||BF(a,_.og),null==d&&null==e?a.H.init(c):a.H.h(c,function(q){q.length&&sD(a.f,q,d,e,a.a.video.timestampOffset)})),l=zF(a,b,a.lg.bind(a,b,c)));return l.then(function(){if(b===_.Ng&&null!==d&&null!==e&&!h)a.D.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",FF(a,b));else if(b===_.Oc&&null!==d&&null!==e)dD(a.D),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",FF(a,b));else if(b===_.Ng&&
|
|
101
|
+
null!==d&&null!==e&&h){var q=m.buffered.length,t=0<q?m.buffered.end(q-1):-1;0>n&&0<q&&(n=m.buffered.start(0));0<=n&&0<t&&a.D.append(n,t,g)}if(!a.G[b]&&m&&1===m.buffered.length){q=m.buffered.start(0);var u=d-q;if(Math.abs(u)>a.U&&0===m.timestampOffset)return a.g.warn("Detected a delta of "+u+" between media times and segment times for "+(b+". The segment start time is ")+(d+" and the media start time is ")+(q+". Adjusting timestampOffset.")),q=zF(a,b,function(){a.Cj(b,u)}),t=zF(a,b,a.di.bind(a,b,!1)),
|
|
102
|
+
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};HF=function(a,b){var c=a.Ra(_.Ng)||0;rD(a.f,b,c)};IF=function(a){a.f&&rD(a.f,"",0)};LF=function(a,b,c,d,e,f,g){var h,l;return _.I(function(m){if(1==m.a){h=_.uu;if(b===h.TEXT){a.f.A=c;var n=a.f;n.j=d;n.l=e;return m["return"]()}return _.x(m,JF(a,b,f,g),2)}l=KF(a,b,c,d,e);a.O&&(l=l.concat(KF(a,h.AUDIO,c,d,e)));return _.x(m,Promise.all(l),0)})};
|
|
103
|
+
KF=function(a,b,c,d,e){return[zF(a,b,a.Xj.bind(a,b)),zF(a,b,a.Cj.bind(a,b,c)),zF(a,b,a.zo.bind(a,b,d,e))]};NF=function(a,b){MF(a,function(){a.o.duration=b})};zF=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.lm};a.h[b].push(c);1===a.h[b].length&&OF(a,b);return c.p};
|
|
104
|
+
OF=function(a,b){var c=a.h[b][0];if(c)try{a.g.debug("Starting next operation for "+b),c.start()}catch(d){"QuotaExceededError"===d.name?c.p.reject(new _.N(_.O,3,3017,{type:b})):c.p.reject(new _.N(_.O,3,3015,{mediaError:d})),PF(a,b)}else a.g.debug("No more scheduled operations for "+b)};
|
|
105
|
+
MF=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 _.lm,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();_.F(p,2);return _.x(p,Promise.all(c),4);case 4:_.G(p,3);break;case 2:g=_.H(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);_.F(p,5,6);return _.x(p,b(),6);case 6:_.yh(p);for(m in a.a)PF(a,
|
|
106
|
+
m);_.zh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.N(_.O,3,3015,{mediaError:n})))}})};PF=function(a,b){a.h[b].shift();OF(a,b)};JF=function(a,b,c,d){var e,f,g;return _.I(function(h){e=_.uu;if(b===e.TEXT||!ZC()||a.I.mediaSource.codecSwitchingStrategy!==_.bg)return h["return"]();f=a.J[b];g=_.Hn(c,d);return KC(f,g)?h["return"]():_.x(h,zF(a,b,function(){a.g.info("Change MIME type of "+b+" to "+g);a.a[b].changeType(g);a.J[b]=g;a.Sc(b)}),0)})};
|
|
107
|
+
VF=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=QF(f,b,c);f=RF(f,d);if(1<a.periods.length&&e.some(function(n){return null!=n.audio})){var g=function(n){n=n.split(".");var p=n[0];1<n.length&&(p+="."+n[1]);return p.toLowerCase()};b=[];c=_.v(a.periods);for(e=c.next();!e.done;e=c.next()){d=new Set;e=_.v(e.value.variants);for(var h=e.next();!h.done;h=e.next())h=h.value,null!==h.audio&&d.add(g(h.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
|
|
108
|
+
b.length;c={Vf:c.Vf},d++)c.Vf=b[d],l=new Set(_.kh(l).concat().filter(function(n){return function(p){return n.Vf.has(p)}}(c)));f=f.filter(function(n){return 0===l.size&&null===n.audio?!0:0<l.size&&null===n.audio?!1:l.has(g(n.audio.codecs))})}f=SF(f);var m=TF(f);a=_.v(a.periods);for(f=a.next();!f.done;f=a.next())f=f.value,f.variants=f.variants.filter(function(n){if(UF(n)===m)return!0;_.Rh("Dropping Variant (better codec available)",n);return!1})};
|
|
109
|
+
WF=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=QF(e,b,c);e=RF(e,d);a=_.v(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)})};SF=function(a){var b=new _.ri;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=UF(c);b.push(d,c)}return b};
|
|
110
|
+
QF=function(a,b,c){if(!b.length&&!c.length)return a;var d=a.filter(function(g){return(g=g.audio)&&c.length&&(g=_.JC(g.codecs),c.includes(g))?!0:!1}),e=a.filter(function(g){return(g=g.video)&&b.length&&(g=_.JC(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};
|
|
111
|
+
TF=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;_.Rh(_.zd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};UF=function(a){var b="";a.video&&(b=_.JC(a.video.codecs));var c="";a.audio&&(c=_.JC(a.audio.codecs));return b+"-"+c};
|
|
112
|
+
XF=function(a,b){function c(d,e,f){return d>=e&&d<=f}return(!a.width||!a.height||c(a.width,b.minWidth,b.maxWidth)&&c(a.height,b.minHeight,b.maxHeight)&&c(a.width*a.height,b.minPixels,b.maxPixels))&&c(a.bandwidth,b.minBandwidth,b.maxBandwidth)?!0:!1};YF=function(a,b){for(var c=!1,d=_.v(a),e=d.next();!e.done;e=d.next()){e=e.value;var f=e.allowedByApplication;e.allowedByApplication=XF(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
113
|
+
aG=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.da&&!xC(a,n))return _.Rh("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!uF(p)){var t=p.codecs;0<=p.codecs.indexOf(_.ee)?(_.Rh("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ee,"ac-3"),uF(p)?_.Qh("Using AC-3 instead of EC-3 for",ZF(p)):(p.codecs=t,_.Qh(QB,ZF(p)),n.audio=null,f=!0,p=null)):(_.Qh(QB,ZF(p)),n.audio=null,f=!0,p=null)}return q&&!uF(q)?
|
|
114
|
+
(_.Qh("Dropping variant - video not compatible with platform",ZF(q)),!1):p&&b&&!$F(p,b,e)?(_.Qh("Dropping variant - not compatible with active audio","active audio",ZF(b),"variant.audio",ZF(p)),!1):q&&c&&!$F(q,c,e)?(_.Qh("Dropping variant - not compatible with active video","active video",ZF(c),"variant.video",ZF(q)),!1):!0});if(f){for(var g=!1,h=!1,l=_.v(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&&
|
|
115
|
+
!n.audio?(_.Qh("Dropping variant - not compatible with video + audio","variant.video",ZF(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.tD(_.Hn(n.mimeType,n.codecs));p||_.Rh("Dropping text stream. Is not supported by the platform.",n);return p})};$F=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
116
|
+
bG=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=_.v(b.roles),q=p.next();!q.done;q=p.next())n.add(q.value);if(c)for(p=_.v(c.roles),q=p.next();!q.done;q=p.next())m.add(q.value);q=[c,b].map(function(t){return t?t.accessibility||[]:[]}).reduce(function(t,u){return t.concat(u)},[]);a={id:a.id,af:!1,$e:!1,bg:!1,
|
|
117
|
+
type:"variant",bandwidth:a.bandwidth,language:a.language,originalLanguage:a.language,label:null,kind:l,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:g,hb:h,codecs:f.join(", "),audioCodec:d,Jj:e,primary:a.primary,roles:Array.from(m),cg:Array.from(n),kc:null,qc:null,channelsCount:null,spatialAudio:!1,bf:null,Rf:null,Ig:null,Hg:null,ej:null,accessibility:q};c&&(a.kc=c.id,a.Ig=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=!!c.trickPlay,
|
|
118
|
+
a.Rf=c.bandwidth||null);b&&(a.qc=b.id,a.Hg=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.bf=b.bandwidth||null,a.label=b.label,a.cg=b.roles);return a};
|
|
119
|
+
cG=function(a){return{id:a.id,af:!1,$e:!1,bg:!1,type:_.Fn,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,hb:null,codecs:a.codecs||null,audioCodec:null,Jj:null,primary:a.primary,roles:a.roles,cg:null,kc:null,qc:null,channelsCount:null,spatialAudio:!1,bf:null,Rf:null,Ig:null,Hg:null,ej:a.originalId,accessibility:a.accessibility,keyId:null}};
|
|
120
|
+
dG=function(a){return a.allowedByApplication&&a.allowedByKeySystem};RF=function(a,b){var c=a.filter(function(g){return g.audio&&g.audio.channelsCount}),d=new Map;c=_.v(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))};
|
|
121
|
+
_.fG=function(a,b,c,d){b=_.Ei(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=_.SC(_.uo(h),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.uo(m.language)===l}),!0):!1});d&&e.some(function(h){return h.kind===_.me})&&(e=e.filter(function(h){return h.kind===_.me}));if(c){b=eG(e,c);if(b.length)return b;_.Mh("No exact match for the text role could be found.")}else if(b=
|
|
122
|
+
e.filter(function(h){return 0===h.roles.length}),b.length)return b;b=e.map(function(h){return h.roles}).reduce(_.DC,[]);return b.length?eG(e,b[0]):e};eG=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
123
|
+
ZF=function(a){var b=HC(a);return a.type===_.Oc?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Ng?"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"};
|
|
124
|
+
_.gG=function(){this.g=new _.L("clpp.abr");this.A=null;this.l=!1;this.w=new vE;this.f=[];this.o=1;this.D=this.B=!1;this.j=this.a=this.h=null};hG=function(a,b,c){if(a.j&&a.a.useCmsd){var d=qC(a.j);null!==d&&(a.g.debug("Using CMSD maxSuggestedBitrateKbps:",d),c=c.filter(function(e){return e.bandwidth<=1E3*d}))}a=c.filter(function(e){return!e.trickPlay});b&&(a=a.filter(function(e){return XF(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};iG=function(){this.a=null};
|
|
125
|
+
kG=function(a,b){if(b&&(null==a.a||a.a!==b))throw jG(a);};jG=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.")};lG=function(){this.a=new Map};nF=function(a,b){a.a.has(b)||a.a.set(b,new mG);return a.a.get(b)};mG=function(){this.text=this.video=this.ab=this.audio=null};nG=function(a,b){this.f=a;this.a=new Set([a]);b=b||[];for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.add(d.value)};
|
|
126
|
+
qG=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||oG(d,e))&&pG(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||oG(a,b))&&pG(a.roles,b.roles)));return d?!1:!0};
|
|
127
|
+
oG=function(a,b){if(a.mimeType!==b.mimeType)return!1;var c=IC(a.codecs).map(function(f){return _.JC(f)}),d=IC(b.codecs).map(function(f){return _.JC(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};pG=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.Ie);d["delete"](_.Ie);if(c.size!==d.size)return!1;c=_.v(c);for(var e=c.next();!e.done;e=c.next())if(!d.has(e.value))return!1;return!0};
|
|
128
|
+
sG=function(a){var b=void 0===b?_.Gf:b;this.f=a;this.a=b;this.h=new rG(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};rG=function(a,b,c,d,e){this.j=_.Ei(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Gf:e};tG=function(a,b){var c=null;b.some(function(d){c=_.SC(_.uo(d),a.map(function(e){return RC(e)}));return!!c});return c?a.filter(function(d){return c===RC(d)}):[]};
|
|
129
|
+
uG=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)})};vG=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};yG=function(a,b){this.a=wG;this.f=(new Map).set(wG,b).set(xG,a)};
|
|
130
|
+
AG=function(a){var b=this;this.F=a;this.a=a.getConfiguration().streaming;this.f=new _.si;this.g=new _.L("clpp.mse.media.LiveEdgeObserver");zG(this)&&(a=this.F.getSurface().getMedia(),this.f.on(a,_.vg,function(){var c=b.F.getPosition(),d=b.F.getSeekRange().end;c=d-c;var e=b.F.getPlaybackRate(),f=b.a.stopChasingAt;1<=e&&c>=b.a.chaseJumpDistance?(b.g.debug("Too far from edge, jump to beginning."),b.F.setPlaybackRate(1),b.F.seek(d)):1===e&&c>=b.a.startChasingAt?(b.g.debug("Not on live edge, increase playback rate."),
|
|
131
|
+
b.F.setPlaybackRate(b.a.chasingRate,_.Nd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.F.setPlaybackRate(1))}))};
|
|
132
|
+
zG=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};BG=function(a){this.h=a;this.a=null;this.f=function(){}};CG=function(a,b){a.f=b};
|
|
133
|
+
DG=function(a){var b=this;this.f=a;this.o=this.A=this.l=!1;this.h=this.f.pi();this.w=_.Nd;this.j=null;this.a=new _.ej(function(){b.A||b.f.Zm(.25*b.h)});this.g=new _.L("clpp.mse.media.PlayRateController")};EG=function(a,b){a.j=b;a.j.speedUpMode&&(a.w=a.j.speedUpMode)};
|
|
134
|
+
HG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.w)===_.Nd||0===c||1===c)try{FG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),GG(a)}else GG(a)};GG=function(a){a.g.debug(RB,a.h,' using "seek" mode.');FG(a,0);a.o=!0;a.a.Hb(.25)};FG=function(a,b){if(a.f.pi()!==b){a.g.debug(RB,b,' using native playbackRate "decoder" mode.');try{a.f.Go(b)}catch(c){throw c;}}};
|
|
135
|
+
JG=function(a){function b(){d=!0}function c(m){f.push(m);_.rq(m)}a=_.Ni(a);var d=!1,e,f=[],g=[];(new _.qq).M(_.Pe,c).M(_.yg,c).M(_.Ke,c).M(_.Oe,c).M(_.gg,c).ba(_.ig,function(m){e=m;f.push(m);_.sq(m)}).ba("encv",b).ba("enca",b).ba("avc1",function(m){g.push({M:m,Bd:1701733238})}).ba("avc3",function(m){g.push({M:m,Bd:1701733238})}).ba("ac-3",function(m){g.push({M:m,Bd:1701733217})}).ba(_.ee,function(m){g.push({M:m,Bd:1701733217})}).ba("mp4a",function(m){g.push({M:m,Bd:1701733217})}).parse(a);if(d)return _.Qh("Init segment already indicates encryption."),
|
|
136
|
+
a;if(0===g.length||!e)throw _.Sh("Failed to find boxes needed to fake encryption!"),_.Sh("Failed init segment (hex):",_.Pm(a)),new _.N(_.O,3,14E3);g.reverse();for(var h=_.v(g),l=h.next();!l.done;l=h.next())l=l.value,_.Qh('Inserting "'+_.vq(l.Bd)+'" box into init segment.'),a=IG(a,e,l.M,f,l.Bd);return a};
|
|
137
|
+
IG=function(a,b,c,d,e){var f=KG.value(),g=a.subarray(c.start,c.start+c.size),h=_.Ui(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.Ui(l);g.setUint32(4,e);l.set(f,c.size);e=h.getUint32(4);g.setUint32(c.size+16,e);LG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.ij("Xbox One")||_.hj()?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=_.v(d);for(d=a.next();!d.done;d=a.next())d=d.value,LG(e,d.start,d.size+l.byteLength);l=_.Ui(e,
|
|
138
|
+
b.start);b=_.wq(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};LG=function(a,b,c){a=_.Ui(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.NG=function(a,b){this.F=b;this.j=a;MG(a);this.h=null;this.l=1;this.H=Promise.resolve();this.B=new Map;this.o=new Map;this.a=new Map;this.K=this.f=this.w=this.D=!1;this.J=0;this.g=new _.L("clpp.mse.Streaming");this.G=this.A=this.I=!1};
|
|
139
|
+
PG=function(a){var b=a.a.get(_.Ng);return b?OG(a,b.fc):(b=a.a.get(_.Oc))?OG(a,b.fc):null};RG=function(a){return _.QG(a,_.Oc)};SG=function(a){return _.QG(a,_.Ng)};
|
|
140
|
+
XG=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=_.uu,_.x(q,a.F.X.clear(c.TEXT),2);case 2:return a.J++,a.K=!1,d=a.J,e=a.F.X,f=new Map,g=new Set,f.set(c.TEXT,b),g.add(b),_.x(q,e.init(f,!1,a.h.disableAudioTracks),3);case 3:return a.f?q["return"]():_.x(q,TG(a,g),4);case 4:if(a.f)return q["return"]();l=(h=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.J===d&&!a.a.has(c.TEXT)&&!a.K&&l){m=a.F.Ab();n=UG(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
141
|
+
m),q["return"]();p=VG(b,n,0);a.a.set(c.TEXT,p);WG(a,p,0)}_.z(q)}})};$G=function(a){a.K=!0;var b=a.a.get(_.Fn);b&&(a.g.info("Unload text stream"),YG(b),ZG(b)["catch"](function(){}),a.a["delete"](_.Fn))};aH=function(a){var b,c;return _.I(function(d){if(1==d.a){b=_.uu;c=a.a.get(b.AUDIO);if(!c)return d.C(0);a.g.info("Unload audio stream");YG(c);return _.x(d,ZG(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.z(d)})};
|
|
142
|
+
cH=function(a,b){var c,d,e,f,g,h;_.I(function(l){if(1==l.a){c=_.uu;d=a.a.get(c.VIDEO);if(!d)return l["return"]();e=d.stream;if(!e)return l["return"]();if(b){g=e.trickModeVideo;if(!g||(h=d.wc))return l["return"]();a.g.debug("Switching to trick mode",g);return _.x(l,bH(a,g,!1,0),5)}f=d.wc;if(!f)return l["return"]();a.g.debug("Switching back from trick mode",f);d.wc=null;return _.x(l,bH(a,f,!0,0),0)}d.wc=e;_.z(l)})};
|
|
143
|
+
dH=function(a,b,c,d){return _.I(function(e){return 1==e.a?b.video?_.x(e,bH(a,b.video,c,d),2):e.C(2):b.audio?_.x(e,bH(a,b.audio,c,d),0):e.C(0)})};fH=function(a){var b,c;return _.I(function(d){if(1==d.a){if(a.A)return d["return"]();a.A=!0;return _.x(d,aH(a),2)}b=_.uu;c=a.a.get(b.VIDEO);return _.x(d,eH(a,c),0)})};gH=function(a,b,c,d){return _.I(function(e){return _.x(e,bH(a,b,c,d),0)})};
|
|
144
|
+
iH=function(a,b){var c;return _.I(function(d){if(1==d.a){if(!a.A)return d.C(2);a.A=!1;c=a.F.Ab();return _.x(d,hH(a,{audio:b},c),2)}return _.x(d,bH(a,b,!0,0),0)})};_.jH=function(a,b){return _.I(function(c){return _.x(c,bH(a,b,!0,0),0)})};lH=function(a,b){var c=a.j.periods.map(function(d){return d.id});a.g.debug("Manifest updated, periods ("+c.length+"): "+c.join(", "));a.j.periods=b.periods;MG(a.j);kH(a)};MG=function(a){a.periods.every(function(b){return typeof b.id===_.hg})};
|
|
145
|
+
mH=function(a){function b(l){return a.F.X.Oc(l,c,0)}var c=a.F.Ab(),d=!1,e=UG(a,c);if(_.Ki(a.a.values(),function(l){return l.fc===e}))for(var f=_.v(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)||(eH(a,h),d=!0)}else if(!_.Ki(a.a.keys(),b)){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");d=_.v(a.a.values());for(f=d.next();!f.done;f=d.next())eH(a,f.value);d=!0}d||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
146
|
+
c)};pH=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.w)a.g.error("Unable to retry after StreamingEngine encountered a fatal error!");else for(var c=_.v(a.a.values()),d=c.next();!d.done;d=c.next()){d=d.value;var e=nH(d);if(d.wd||b&&oH(d))a.g.info(e,"Retrying after failure..."),d.wd=!1,WG(a,d,.1)}};qH=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.rb})};
|
|
147
|
+
rH=function(a){var b=Array.from(a.a.values());return a.D&&b.every(function(c){return c.endOfStream})};tH=function(a){var b,c,d,e;return _.I(function(f){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,YG(e),e.Db&&e.hc&&(e.Db=!1,b.push(e.hc.abort())),e.mc&&b.push(sH(a,e,!0,0));return _.x(f,Promise.all(b),0)})};uH=function(a,b,c){(a=a.a.get(b))&&c&&(YG(a),a.stream=c,a.sc=c,a.va&&(a.va=c.getSegmentReference(a.va.position)),a.va||(a.sc=null))};
|
|
148
|
+
_.QG=function(a,b){var c=a.a.get(b);return c?c.wc||c.stream:null};
|
|
149
|
+
bH=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,u,y,B,A,C;return _.I(function(E){switch(E.a){case 1:e=_.uu;f=b.type;if((g=a.a.get(f))||b.type!==e.TEXT||!a.h.ignoreTextStreamFailures){E.C(2);break}return _.x(E,XG(a,b),3);case 3:return E["return"]();case 2:if(!g)return E["return"]();h=vH(a,b).id;if(c&&h!==g.fc){a.g.debug("switch: switching to stream in another Period; clearing buffer and changing Periods");l=_.v(a.a.values());for(m=l.next();!m.done;m=l.next())n=m.value,eH(a,n);return E["return"]()}g.wc&&
|
|
150
|
+
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.wc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(g.wc=null,a.g.debug("switch found no special trick play stream")));var D=a.B.get(h);if(!D||!D.Og)return E["return"]();if((D=a.o.get(b.id))&&D.Og){E.C(4);break}return _.x(E,TG(a,new Set([b])),4);case 4:if(g.stream===b)return p=nH(g),a.g.debug(mC+p+" already active"),E["return"]();q=a.j.presentationTimeline.getDuration();t=a.F.Ab();u=wH(a,g,t);if(!c&&(g.endOfStream||
|
|
151
|
+
u>=q))return y=nH(g),a.g.debug(mC+y+" already buffered to the end. Not switching."),E["return"]();b.type===e.TEXT&&(B=_.Hn(b.mimeType,b.codecs),BF(a.F.X,B));g.stream=b;g.stream.segmentIterator=null;g.yf=!0;A=nH(g);a.g.debug("switch: switching to Stream "+A);if(g.hc){var J=a.F.Ab(),P=a.F.X.Ra(g.type);D=(D=xH(a,g,J,P,h))?D.me():null;if(null==D)D=!1;else{var U=g.stream.initSegmentReference;U&&(D+=U.me()||0);U=a.F.he().getBandwidthEstimate();8*D/U<(null===P?0:P-J)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal)?
|
|
152
|
+
D=!0:(J=g.hc,J=J.j?J.j.bytesRemaining:-1,D=0>J||J>D?!0:!1)}}else D=!1;D&&(a.g.info("Aborting current segment request to switch."),g.hc.abort());if(!c){E.C(0);break}if(g.Fc){g.Sf=!0;E.C(0);break}if(g.Db){g.mc=!0;g.ef=d;g.Sf=!0;E.C(0);break}YG(g);_.F(E,9);return _.x(E,sH(a,g,!0,d),11);case 11:_.G(E,0);break;case 9:C=_.H(E);if(a.F)a.F.onError(C);_.z(E)}})};yH=function(a){a.G=!0;a.g.debug("calling onCanSwitch()...");a.F.Ui()};
|
|
153
|
+
eH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=nH(b);if(b.Fc)return a.g.debug(c,"clear: already clearing the buffer"),f["return"]();if(b.mc)return a.g.debug(c,"clear: already waiting"),f["return"]();if(b.Db)return a.g.debug(c,"clear: currently updating"),b.mc=!0,b.ef=0,f["return"]();d=b.type;if(null==a.F.X.Xb(d))return a.g.debug(c,"clear: nothing buffered"),null==b.rb&&WG(a,b,0),f["return"]();a.g.debug(c,"clear: handling right now");YG(b);_.F(f,2);return _.x(f,sH(a,b,!1,0),4)}if(2!=
|
|
154
|
+
f.a)return _.G(f,0);e=_.H(f);if(a.F)a.F.onError(e);_.z(f)})};
|
|
155
|
+
hH=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a){d=a.F.Ab();e=UG(a,d);if(null==e)return a.g.warn("Cannot initialize streams, period not found at",d),l["return"]();f=zH(b);g=a.F.X;h=a.h.forceNativeTS;return _.x(l,g.init(f,h,a.h.disableAudioTracks),2)}if(3!=l.a){if(a.f)return l["return"]();kH(a);return _.x(l,TG(a,new Set(f.values())),3)}if(a.f)return l["return"]();f.forEach(function(m,n){if(!a.a.has(n)){var p=VG(m,e,c);a.a.set(n,p);WG(a,p,0)}});_.z(l)})};
|
|
156
|
+
VG=function(a,b,c){return{stream:a,type:a.type,sc:null,segmentIterator:null,va:null,wc:null,yf:!0,fc:b,endOfStream:!1,Db:!1,rb:null,mc:!1,ef:0,Sf:!1,Fc:!1,Mg:!1,wd:!1,zj:c||0,hc:null,jf:!1,Mi:0}};BH=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){AH(a,b)["catch"](EC)})};
|
|
157
|
+
AH=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+BB),c;a.g.debug("(all) setting up period "+b);var d=new _.lm;a.B.set(b,d);c=OG(a,b);for(var e=new Set,f=_.v(c.variants),g=f.next();!g.done;g=f.next())g=g.value,g.video&&e.add(g.video),g.video&&g.video.trickModeVideo&&e.add(g.video.trickModeVideo),g.audio&&e.add(g.audio);c=_.v(c.textStreams);for(f=c.next();!f.done;f=c.next())e.add(f.value);a.H=a.H.then(function(){if(!a.f)return TG(a,e)}).then(function(){a.f||(d.resolve(),a.g.debug("(all) setup Period "+
|
|
158
|
+
b))})["catch"](function(h){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.F.onError(h))});return d};
|
|
159
|
+
TG=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t;return _.I(function(u){switch(u.a){case 1:c=[];d=_.v(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+BB),c.push(g)):(a.g.debug("(all) setting up stream "+f.id),a.o.set(f.id,new _.lm),c.push(f.createSegmentIndex(a.F.Cb,a.h.attemptParameters)));_.F(u,2);return _.x(u,Promise.all(c),4);case 4:if(a.f)return u["return"]();_.G(u,3);break;case 2:h=_.H(u);if(a.f)return u["return"]();l=_.v(b);for(e=l.next();!e.done;e=
|
|
160
|
+
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw h;case 3:p=_.v(b);for(e=p.next();!e.done;e=p.next())q=e.value,(t=a.o.get(q.id))&&!t.done&&(t.resolve(),a.g.debug("(all) finished setting up stream "+q.id));_.z(u)}})};kH=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?NF(a.F.X,b):NF(a.F.X,Math.pow(2,32))};
|
|
161
|
+
EH=function(a,b){function c(n){return n.type===_.Fn&&n.stream.mimeType===_.Gc}if(c(b))return HF(a.F.X,b.stream.originalId||""),null;b.type===_.Fn&&IF(a.F.X);if(!AF(a.F.X)&&b.type!==_.Fn)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=nH(b),e=a.F.Ab(),f=wH(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.F.X.Sa(b.type,e);a.g.debug(d,"update_:",hC+e,"bufferedAhead\x3d"+g);var h=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=AD(a.j.presentationTimeline);
|
|
162
|
+
if(null!=l&&f>=l&&!b.jf)return CH(a,b),null;b.endOfStream=!1;l=vH(a,b.stream).id;var m=UG(a,f);null!=m&&(b.fc=m);if(m!==l)return a.g.debug(d,"need Period "+m,hC+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=h)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.F.X.Ra(b.type);g=xH(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.Fn?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),CH(a,b),
|
|
163
|
+
null);d=Infinity;h=_.v(a.a.values());for(m=h.next();!m.done;m=h.next())m=m.value,c(m)||(m=wH(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.j)return a.h.bufferLimitUpdateInterval||1;b.zj=0;DH(a,b,e,l,g)["catch"](function(){});return null};CH=function(a,b){a.g.debug(nH(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Ng){var c=a.a.get(_.Fn);c&&c.stream.mimeType===_.Gc&&(c.endOfStream=!0)}};
|
|
164
|
+
wH=function(a,b,c){return b.sc&&b.va?vH(a,b.sc).startTime+b.va.endTime:Math.max(c,b.zj)};
|
|
165
|
+
xH=function(a,b,c,d,e){if(null==e)return a.g.warn(HB),null;if(b.stream.segmentLookupStrategy===_.cC)b.stream.segmentIterator?a=SD(b.stream.segmentIterator):b.va||d?(c=b.va?b.va.endTime:d,a.g.info(KB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=WD(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(KB,XB,"endTime:",c,b.va)),a=e):(e=OG(a,e),e=Math.max(0,c-e.startTime),a.g.info(KB,"looking up segment","lookupTime:",
|
|
166
|
+
e,gC,c),d=null,d||(b.stream.segmentIterator=WD(b.stream.segmentIndex,e),d=b.stream.segmentIterator.next().value),null===d&&a.g.warn(KB,XB,"lookupTime:",e,gC,c),a=d);else{var f=nH(b);if(b.va&&b.stream===b.sc)c=b.va.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=FH(a,b,e,c);else{if(b.va){a.g.debug(f,"next position unknown: another Stream buffered");f=vH(a,b.sc);var g=GH(a,b,f.startTime+b.va.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=GH(a,b,d||c,e);if(null==
|
|
167
|
+
g)a=null;else if(f=FH(a,b,e,g),null==f)a=null;else{var h=null==a.h?!1:a.h.ignoreDrift;null!=d||h||(d=f,d.Ga+d.startTime+2>c&&(a=FH(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};GH=function(a,b,c,d){var e=nH(b);d=OG(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",hC+c,"lookupTime\x3d"+f,ZB+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",ZB+d.startTime,"lookupTime\x3d"+f);return b};
|
|
168
|
+
FH=function(a,b,c,d){var e=nH(b);if(null==c)return a.g.warn(e,HB),null;c=OG(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",ZB+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.GD(g);g=FD(g);return!b.jf&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",ZB+c.startTime,kC+f.startTime,iC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
169
|
+
DH=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,u,y;return _.I(function(B){f=_.uu;g=nH(b);h=OG(a,d);a.g.debug(g,"fetchAndAppend_:",hC+c,ZB+h.startTime,jC+e.position,kC+e.startTime,iC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=HH(a,d);q=Math.max(0,h.startTime-.1);t=p?p.startTime+.01:n;u=IH(a,b,h,q,t,e);b.Db=!0;b.yf=!1;a.g.debug(g,"fetching segment");y=a.F.X.Ra(b.type)||0;u.then(function(){return a.f||a.w?null:JH(a,b,e,function(A,C){return a.f||a.w?null:
|
|
170
|
+
KH(a,b,c,h,l,e,A,C)})}).then(function(){if(!a.f&&!a.w){if(!a.j.presentationTimeline.isLive()&&b.type!==_.Fn){var A=nH(b),C=(a.F.X.Ra(b.type)||0)-y,E=e.endTime-e.startTime,D=C-E;if(Math.abs(D)>=Math.min(.01,E)&&Math.abs(D)<=Math.min(1,E)){a.g.debug(A,"Adjusted segment",e.position,"with real duration",C,"and accounted for",D,"delta between segment duration and real duration");b.jf=!0;A=a.j.periods;l.adjustSegmentDurations(e.position,D);C=iD(A,l);E=A[C];var J=l.getDuration();kD(E,J);for(C+=1;C<A.length;C++)A[C].startTime+=
|
|
171
|
+
D}}b.Db=!1;b.Mg=!1;b.mc||a.F.Ef();m&&(D=m.next().value)&&a.g.debug("New iterated segment",D);WG(a,b,0);a.D?D=!1:(a.D=LH(a),D=a.D);D&&(a.g.debug("startup complete"),D=vH(a,l).id,MH(a,D),a.F.Rn&&(a.g.debug("calling onStartupComplete()..."),a.F.Rn()));a.g.debug(g,"finished fetch and append")}})["catch"](function(A){return _.I(function(C){if(a.f||a.w)return C["return"]();b.Db=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===A.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):
|
|
172
|
+
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),C.C(0);if(7001===A.code)return b.Db=!1,b.rb=null,WG(a,b,0),C.C(0);if(3017===A.code)return NH(a,b,A),C.C(0);if(1001===A.code&&A.data&&404===A.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",jC+e.position,kC+e.startTime,iC+e.endTime,"error\x3d"+A),b.Db=!1,b.rb=null,WG(a,b,1),C.C(0);if(b.type===f.TEXT)return A instanceof _.N&&A.a(1),YG(b),a.F.onError(new _.N(1,2,2010,A)),C.C(0);
|
|
173
|
+
if(1001<=A.code&&1003>=A.code)return _.x(C,OH(a,b,h,A),0);a.g.error(g,"failed fetch and append: code\x3d"+A.code);b.wd=!0;A instanceof _.N&&A.a(_.O);return _.x(C,PH(a,A),0)})});_.z(B)})};
|
|
174
|
+
NH=function(a,b,c){var d=nH(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.Mg}))a.g.debug(d,MB,"waiting for another stream to recover...");else{var e=Math.round(100*a.l);if(20<e)a.l-=.2;else if(4<e)a.l-=.04;else{a.g.error(d,"MediaSource threw QuotaExceededError too many times");b.wd=!0;a.w=!0;a.F.onError(c);return}a.g.warn(d,MB,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.Mg=!0}WG(a,b,4)};
|
|
175
|
+
OH=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.F.fg(b.stream,c));if(!f)return g.C(0);b.wd=!0;d.a(_.O);return _.x(g,PH(a,d),0)})};
|
|
176
|
+
IH=function(a,b,c,d,e,f){var g,h,l,m,n,p;return _.I(function(q){g=c.startTime-f.Ga;h=b.yf||f.initSegment!==(b.va&&b.va.initSegment);if(!h&&g===b.Mi)return q["return"]();b.Mi=g;l=nH(b);a.g.debug(l,"setting timestamp offset to "+g);a.g.debug(l,"setting append window start to "+d);a.g.debug(l,"setting append window end to "+e);m=LF(a.F.X,b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!h)return q["return"](m);a.g.debug(l,aC);n=f&&f.initSegment||b.stream.initSegmentReference;
|
|
177
|
+
p=QH(a,b,n,l);return q["return"](Promise.all([m,p]))})};QH=function(a,b,c,d){var e,f;return _.I(function(g){switch(g.a){case 1:return _.F(g,2),_.x(g,RH(a,b,c),4);case 4:e=g.f;if(a.f)return g["return"]();a.g.debug(d,"appending init segment");return _.x(g,SH(a,e,b),5);case 5:return _.x(g,GF(a.F.X,b.type,e,null,null,!!b.stream.closedCaptions&&0<b.stream.closedCaptions.size),6);case 6:_.G(g,0);break;case 2:throw f=_.H(g),b.yf=!0,f;}})};
|
|
178
|
+
SH=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.hj())return e.C(0);d=JG(b);return _.x(e,GF(a.F.X,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
179
|
+
KH=function(a,b,c,d,e,f,g,h){h=void 0===h?!1:h;var l,m,n,p,q,t,u,y,B,A,C;return _.I(function(E){switch(E.a){case 1:l=nH(b);if(!(e&&e.keyId&&a.F.be)){E.C(2);break}a:{var D=a.F.be;var J=e.keyId;if(J)for(var P=_.v(D.h.keys()),U=P.next();!U.done;U=P.next()){U=D.h.get(U.value);for(var V=0;V<U.sb.length;V++)if(U.sb[V]===J){D=U;break a}}D=null}m=D?D.ob:null;if(!m){a.g.warn("Unable to find DRM session for "+e.keyId);E.C(2);break}_.F(E,4);return _.x(E,m,6);case 6:_.G(E,2);break;case 4:_.H(E),a.g.warn("DRM session load failed, cannot append segment!");
|
|
180
|
+
case 2:if(D=e.encrypted&&e.keyId&&a.F.be)D=a.F.be.o.get(e.keyId),D=!(!D||D!==_.cf&&D!==_.ve);if(!D){E.C(7);break}YG(b);n=vH(a,e).id;p=MH(a,n);if(!p){E.C(8);break}return _.x(E,p,8);case 8:return q=a.F.fg(e,d,dC),t=f.startTime+d.startTime,u=f.endTime+d.startTime,a.g.warn(l,"Blocked append for "+t+" - "+u+": "+q+". Stream with Key ID "+(e.keyId+" has restrictions.")),E["return"]();case 7:return y=e.closedCaptions&&0<e.closedCaptions.size,null!=e.emsgSchemeIdUris&&0<e.emsgSchemeIdUris.length&&(new _.qq).ba("emsg",
|
|
181
|
+
a.Xn.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),_.x(E,TH(a,b,c),10);case 10:if(a.f)return E["return"]();B=f.startTime+d.startTime;A=f.endTime+d.startTime;a.g.debug(l,"Appending segment with "+(B.toFixed(3)+" - "+A.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.R.eg(e.bandwidth)+" Fragment: ")+h);C=e.type===_.Ng&&null!=e.muxedAudioId&&!a.A;return _.x(E,GF(a.F.X,b.type,g,B,A,y,e.id,h,C),11);case 11:if(a.f)return E["return"]();a.g.debug(l,"appended media segment");
|
|
182
|
+
b.sc=e;b.va=f;_.z(E)}})};UH=function(a,b,c){(new _.qq).M(_.Pe,_.rq).M(_.yg,_.rq).M(_.Ke,_.rq).M(_.Oe,_.rq).M(_.gg,_.rq).ba(_.ig,_.sq).M("encv",function(d){d.reader.skip(78);_.rq(d)}).M(_.ag,_.rq).M("schi",_.rq).M("tenc",function(d){d.reader.skip(6);if(_.jq(d.reader)){d.reader.skip(1);var e=_.Pm(_.pq(d.reader,16));e!==b.stream.keyId&&(a.g.debug(nH(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)};
|
|
183
|
+
TH=function(a,b,c){var d,e,f,g,h;return _.I(function(l){if(1==l.a){if(a.f)return l["return"]();d=nH(b);a.g.debug(d,"checking buffer length");e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.j);f=a.F.X.Xb(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",hC+c,VB+e),l["return"]();g=c-f;h=g-e;if(.01>=h)return a.g.debug(d,"buffer behind okay:",hC+c,WB+g,VB+e,"underflow\x3d"+Math.abs(h)),l["return"]();a.g.debug(d,"buffer behind too large:",hC+c,WB+g,VB+e,"overflow\x3d"+
|
|
184
|
+
h);return _.x(l,a.F.X.remove(b.type,f,f+h),2)}if(a.f)return l["return"]();a.g.debug(d,"evicted "+h+CB);_.z(l)})};LH=function(a){return a.I?!0:Array.from(a.a.values()).filter(function(b){return b.type!==_.Fn}).every(function(b){return!b.mc&&!b.Fc&&b.va})};MH=function(a,b){var c=null;a.B.has(b)||(c=AH(a,b).then(function(){a.f||yH(a)})["catch"](EC));BH(a);return c};
|
|
185
|
+
VH=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C,E;_.I(function(D){switch(D.a){case 1:c=nH(b);d=_.uu;e=vH(a,b.stream).id;if(b.fc===e)return D["return"]();f=b.fc;g=Array.from(a.a.values());h=g.every(function(J){return J.fc===f});if(!h)return a.g.debug(c,"not all MediaStates need Period "+f),D["return"]();l=g.every(oH);if(!l)return a.g.debug(c,"all MediaStates need Period "+f+", but not all MediaStates are idle"),D["return"]();a.g.debug(c,"all need Period "+f);_.F(D,2);return _.x(D,AH(a,f),4);
|
|
186
|
+
case 4:if(a.f)return D["return"]();wF(a.F.X);m=g.every(function(J){var P=oH(J),U=vH(a,J.stream).id;return P&&J.fc===f&&U!==f});if(!m)return a.g.debug(c,"ignoring transition to Period",f,"since another is happening"),D["return"]();n=OG(a,f);a.g.debug(c,"Streaming period",f,n);a.G=!1;a.g.debug(c,"calling onChooseStreams()...");p=a.F.zg(n);a.I=!p.audio&&!p.video&&!!p.text;q=zH(p);t=_.v(a.a.keys());for(u=t.next();!u.done;u=t.next())if(y=u.value,!q.has(y)&&y!==d.TEXT)return a.g.error(c,"invalid Streams chosen: missing "+
|
|
187
|
+
y+" Stream"),a.F.onError(new _.N(_.O,5,5005)),D["return"]();B=_.v(Array.from(q.keys()));for(u=B.next();!u.done;u=B.next())if(A=u.value,!a.a.has(A))if(A===d.TEXT)hH(a,{text:q.get(d.TEXT)},n.startTime),q["delete"](A);else return a.g.error(c,"invalid Streams chosen: unusable "+A+" Stream"),a.F.onError(new _.N(_.O,5,5005)),D["return"]();C=Array.from(a.a.keys());E=C.map(function(J){var P;return _.I(function(U){if(1==U.a)return P=q.get(J),P?_.x(U,bH(a,P,!1,0),3):(a.a["delete"](J),U.C(0));WG(a,a.a.get(J),
|
|
188
|
+
0);_.z(U)})});return _.x(D,Promise.all(E),5);case 5:if(a.f)return D["return"]();yH(a);_.G(D,0);break;case 2:_.H(D),_.z(D)}})};UG=function(a,b){var c=gD(a.j.periods,b+_.nw);return c?c.id:null};vH=function(a,b){var c=a.j.periods,d=iD(c,b);c=c[d];if(!c)throw new _.N(_.O,5,5006,"No period found for stream with ID "+b.id+".");return c};WH=function(a,b){if(a.F.od){var c=b.Qa;if(c)return a.F.od.getBaseUriCollectionById(c.id)}return null};
|
|
189
|
+
XH=function(a,b,c){if(a.F.od&&b){c&&0===c.request.uriIndex||a.F.od.banLocation(b.na[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&a.F.od.notifyThroughput(b.na[d.uriIndex].serviceLocationId,e,c)}};
|
|
190
|
+
JH=function(a,b,c,d){var e,f,g,h,l,m,n,p,q;return _.I(function(t){if(1==t.a)return e=YH(a,c,b.type),f=c.f(),g=c.ae||a.h.disableFragmentSupport||!!f,h=!1,e.onFragment=g?null:function(u){h=!0;return d(u.data,!0)},e.disableMergedFragments=a.h.disableMergedFragments,a.g.debug("fetching media segment",c),l=ZH(a,b,c,!1),_.x(t,$H(a,e,b,c,l),2);m=t.f;n=a.F.he();p=m.timeMs;q=m.data.byteLength;p&&q&&n.segmentDownloaded(p,q);return h?t["return"]():_.x(t,d(m.data,!1),0)})};
|
|
191
|
+
RH=function(a,b,c){var d,e,f,g;return _.I(function(h){if(1==h.a)return d=_.uu,e=YH(a,c,b.type),e.responseModifiers.push(function(l){UH(a,b,l.data)}),b.type===d.VIDEO&&a.h.overridePasp&&e.responseModifiers.push(a.Zo.bind(a)),a.g.debug(aC,c),f=ZH(a,b,c,!0),_.x(h,$H(a,e,b,c,f),2);g=h.f;return h["return"](g.data)})};$H=function(a,b,c,d,e){var f=WH(a,d);b=_.dn(a.F.Cb,b,e);c.hc=b;return b.T.then(function(g){XH(a,f,g);c.hc=null;return g})["catch"](function(g){XH(a,f);throw g;})};
|
|
192
|
+
ZH=function(a,b,c,d){var e=xH(a,b,a.F.Ab(),c.endTime,vH(a,b.stream).id);if(d)var f="i";else a:{if(f=b.stream){var g=f.type;if(g===_.Ng){f=CC(f.type,_.Hn(f.mimeType,f.codecs))?"av":"v";break a}if(g===_.Oc){f="a";break a}if(g===_.ng){f=f.mimeType===_.Ic?"tt":"c";break a}}f=void 0}return{stream:b.stream,segment:d?void 0:c,nextSegment:e?e:void 0,streamType:a.j.presentationTimeline.isLive()?"l":"v",objectType:f}};
|
|
193
|
+
YH=function(a,b,c){var d=[],e=WH(a,b);e&&(d=b.le(),d=_.yE(e,d));d.length||(d=b.La());a=_.oD(d,b.la,b.ga,a.h.attemptParameters,b.startTime,b.endTime,c,b.timescale);a.type=2;if(b=b.f())a.keyInfo=b;return a};
|
|
194
|
+
sH=function(a,b,c,d){var e,f,g,h;return _.I(function(l){if(1==l.a)return e=nH(b),b.mc=!1,b.Sf=!1,b.ef=0,b.Fc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.F.Ab(),h=a.F.X.getDuration(),f=a.F.X.remove(b.type,g+d,h)):f=a.F.X.clear(b.type).then(function(){return!a.f&&c?a.F.X.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.sc=null;b.va=null;b.Fc=!1;b.endOfStream=!1;b.jf=!1;WG(a,b,0);_.z(l)})};
|
|
195
|
+
WG=function(a,b,c){a.g.debug(nH(b),"updating in "+c+CB);b.rb=(new _.cj(function(){var d;return _.I(function(e){if(1==e.a)return _.F(e,2),_.x(e,a.gc(b),4);if(2!=e.a)return _.G(e,0);d=_.H(e);if(a.F)a.F.onError(d);_.z(e)})})).ha(c)};YG=function(a){null!=a.rb&&(a.rb.stop(),a.rb=null)};OG=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.N(_.O,5,5006,"Period "+b+" not found");return c};
|
|
196
|
+
HH=function(a,b){var c=a.j.periods.findIndex(function(d){return d.id===b});return 0>c?null:a.j.periods[c+1]||null};ZG=function(a){return _.I(function(b){return a.hc?_.x(b,a.hc.abort(),0):b.C(0)})};zH=function(a){var b=new Map;a.audio&&b.set(_.Oc,a.audio);a.video&&b.set(_.Ng,a.video);a.text&&b.set(_.Fn,a.text);return b};
|
|
197
|
+
PH=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.F.Fj){d.C(2);break}_.F(d,3);return _.x(d,a.F.Fj(b),5);case 5:_.G(d,2);break;case 3:c=_.H(d),c.cause=b,b=c;case 2:if(!b.f)a.F.onError(b);_.z(d)}})};nH=function(a){return"("+a.type+":"+a.stream.id+")"};oH=function(a){return!a.Db&&null==a.rb&&!a.mc&&!a.Fc};aI=function(){this.a=null};
|
|
198
|
+
dI=function(){_.Ut.call(this,YB);var a=this;this.H=bI;this.j=this.ja=null;this.fh=0;this.Kj=2;this.gd=null;this.bh=!1;this.o=new _.si;this.oc=this.ih=this.Af=this.I=this.fd=this.B=this.L=this.A=null;this.ve=!1;this.a=this.K=this.J=null;this.da=[];this.f=null;this.h=new _.gG;this.Z=this.ed=null;this.jh=1E9;this.Gf=new Set;this.za=null;this.Mj=!1;this.Lj=0;this.fa=null;this.l=new lG;this.G=null;this.gb=_.gu;this.pe=new rG(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,
|
|
199
|
+
this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.ce=this.configuration.preferredTextLanguage;this.w=new iG;this.ka=this.Jb=null;this.Xc=new Map;this.se=null;this.xf=this.configuration.preferredTextRole;this.Yd=this.configuration.preferForcedSubtitles;this.o.on(window,"online",function(){a.H===cI&&pH(a.a)});this.If=this.ge=this.Jf=null;this.U=_.pa;this.we=new aI;this.ee=null};
|
|
200
|
+
eI=function(a){return new _.aD(function(b){var c=a.getTrackManager(),d=[];if(c){c=_.v(c.getVideoTracks());for(var e=c.next();!e.done;e=c.next())d.push.apply(d,_.kh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
201
|
+
fI=function(a,b){if(a.gb!==b){var c=_.R.Ol;if(a.gb===_.Ko&&b!==_.gu)c=c(b,_.nu),a.log.info(_.OB+c);else{var d=a.fh;d=0===d?0:Date.now()-d;var e=a.gb;a.gb=b;a.fh=Date.now();null!==a.I&&(a.I.A=4===b);a.G&&_.$t(a.G.a,a.gb);2===b&&(a.Kj=a.Yg?1:2);var f=a.Kj,g={currentState:a.gb,previousState:e,timeSinceLastStateChangeMS:d,reason:2===b||2===e?f:void 0},h=c(e,_.nu),l=c(b,_.nu);c=2!==b?"":"["+c(f,_.lu)+"]";a.log.info(_.ub+h+" -\x3e "+(l+c));a.trigger(new _.Q(_.eg,{detail:g}));(5===b||b===_.Ko)&&a.oc&&a.oc.stop();
|
|
202
|
+
2===b?a.trigger(new _.Q(_.$c,{detail:{bufferedTimeMS:-1,reason:f}})):2===e&&a.trigger(new _.Q(_.Zc,{detail:{bufferedTimeMS:d,reason:f}}))}}};gI=function(a){var b;return _.I(function(c){switch(c.a){case 1:b=a.w.a;if(!b){c.C(2);break}return _.x(c,b["catch"](function(){}),2);case 2:return a.ed&&(a.ed.release(),a.ed=null),_.x(c,_.Ut.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:fI(a,_.gu),_.z(c)}})};
|
|
203
|
+
hI=function(a){return _.I(function(b){if(1==b.a)return _.x(b,Promise.all(a.da.map(function(c){return c.stop()})),2);a.da=[];_.z(b)})};iI=function(a){a.da.map(function(b){return b.requestStop()})};jI=function(a){var b=new _.Zv;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
204
|
+
mI=function(a,b){var c,d;return _.I(function(e){a.U===_.pa?kI(a,b.cues):a.U===_.pb?(a.f=TE(a.f,PE(b)),c=a.configuration.playlist.endTime,d=a.f.presentationTimeline.a.a,c&&d>c&&(a.log.info("Reached end of playlist. Turning timeline static."),iI(a),a.da=[],_.zD(a.f.presentationTimeline,!0),a.trigger(new _.Q(_.Ce))),lI(a,a.f)):lH(a.a,b);_.z(e)})};nI=function(a){return _.I(function(b){iI(a);a.da=[];a.U===_.pb?a.trigger(new _.Q(_.Tf)):a.trigger(new _.Q(_.Ce));_.z(b)})};
|
|
205
|
+
lI=function(a,b){var c=a.getMediaPosition(),d=a.ge,e=b.periods,f=d.a;d.a=[];var g=null,h=null;e=_.v(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 _.Yv(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));zC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
206
|
+
0;d<f.length;d++)if(!f[d].ta(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.Q(_.Uf));QD(a.If);ND(a.K,b.cues)};tI=function(a){var b,c;return _.I(function(d){if(1==d.a)return oI(a),_.x(d,pI(a),2);if(3!=d.a){qI(a);b=_.jj(4)||_.jj(5);if(!b)return d.C(3);c=a.getSurface().getMedia();rI(a,c);return _.x(d,sI(a,c),3)}a.configuration=a.Ja;_.z(d)})};
|
|
207
|
+
uI=function(a,b){return _.I(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.C(2);if(a.Z)return c.C(3);a.Z=new AE(a.configuration.contentSteering,a.getNetworkEngine());a.Z.on(_.Jd,function(d){a.trigger(d)});return _.x(c,CE(a.Z,b),3)}return 2!=c.a?c["return"](a.Z):c["return"](null)})};
|
|
208
|
+
CI=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 _.lm,a.w.a=e,vI(a,b),_.F(l,2),oI(a),_.x(l,wI(a),4);case 4:return kG(a.w,e),a.ca=_.Un(b),a.configuration=_.Qn([a.Ja,b]),YC(a.configuration.xmlParser),a.ee&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(UB,a.ee),a.log.info(_.bb,a.configuration),a.log.info(_.tb,a.ca),_.x(l,xI(a,e),5);case 5:return kG(a.w,e),_.x(l,yI(a,b,a.getSourceIndex(),e,!1),
|
|
209
|
+
6);case 6:return f=l.f,kG(a.w,e),a.da=[f.parser],a.f=f.manifest,kI(a,f.manifest.cues),g=a,_.x(l,zI(a,a.f,a.configuration),7);case 7:g.A=l.f;kG(a.w,e);if(!c){l.C(8);break}return _.x(l,AI(a,e),9);case 9:kG(a.w,e),a.o.one(a.j,_.Ee,function(){var m=Date.now()/1E3-d;a.G&&(a.G.B=m)});case 8:e.resolve();_.G(l,0);break;case 2:h=_.H(l),BI(a,h,e),_.z(l)}})};
|
|
210
|
+
vI=function(a,b){b.cmcd&&b.cmcd.enabled&&(b.cmcd.sessionId||(b.cmcd.sessionId=a.ee?a.ee:void 0),a.ed=new NC(a.getNetworkEngine(),b.cmcd,{getBandwidthEstimate:function(){try{return a.getBandwidthEstimate()}catch(c){return null}},getBufferInfo:a.getBufferInfo.bind(a),getLoadedSource:a.getLoadedSource.bind(a),getMediaPosition:a.getMediaPosition.bind(a),getPlaybackRate:a.getPlaybackRate.bind(a),getPlayerState:a.getState.bind(a),ud:a.ud.bind(a)}))};
|
|
211
|
+
kI=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);ND(a.K,c)}else ND(a.K,b)};BI=function(a,b,c){b=DI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};DI=function(a,b,c){var d=a.w;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):jG(a.w)};wI=function(a){return a.ja?a.ja["catch"](function(){}):Promise.resolve()};
|
|
212
|
+
xI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.G=new _.eu,fI(a,1),c=EI(a,a.configuration),_.x(d,sI(a,c),2);kG(a.w,b);a.K=new LD;MD(a.K,function(e){a.log.info("Timeline cue found",e);FI(a,_.rg,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.Q(_.ug))});_.z(d)})};
|
|
213
|
+
yI=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=_.Un(f),h=g[c],_.x(n,GI(a,h),2);case 2:return l=n.f,kG(a.w,d),_.jn(eC),_.x(n,HI(a,l,h,f.id||""),3);case 3:m=n.f;kG(a.w,d);m.periods.forEach(function(p){p.parser=l});if(!e||!m.presentationTimeline.l){n.C(4);break}return _.x(n,l.stop(),5);case 5:kG(a.w,d);case 4:return _.jn("manifest.end"),_.ln("Fetch and parse manifest",eC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
214
|
+
II=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,yI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,PE(c.manifest)],e=SE(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.N(_.O,7,7003,"Failed to append load manifest");}})};EI=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.M.P(b.volume)||a.setVolume(b.volume);_.M.P(b.muted)||a.setMuted(b.muted);rI(a,c);return c};
|
|
215
|
+
rI=function(a,b){a.j||(a.o.on(b,_.ke,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)};qI=function(a){a.j&&(a.o.off(a.j,_.ke),a.j=null)};
|
|
216
|
+
pI=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.H!==JI&&(a.H=bI);if(b=a.j)a.o.off(b,_.Ee),a.o.off(b,_.tf),a.o.off(b,_.df),a.o.off(b,_.je),a.o.off(b,_.Kf),a.o.off(b,_.If);a.K&&(a.K.release(),a.K=null);a.fd&&(a.fd.release(),a.fd=null);a.oc&&(a.oc.stop(),a.oc=null);return _.x(c,hI(a),2);case 2:if(!a.h){c.C(3);break}return _.x(c,a.h.stop(),3);case 3:if(!a.a){c.C(5);break}return _.x(c,a.a.destroy(),6);case 6:a.a=null;case 5:if(!a.Z){c.C(7);break}return _.x(c,a.Z.destroy(),8);case 8:a.Z=
|
|
217
|
+
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.L){c.C(9);break}return _.x(c,a.L.destroy(),10);case 10:a.L=null;case 9:a.gd&&(a.gd.release(),a.gd=null);a.Af&&(a.Af.release(),a.Af=null);b&&b.src&&(b.removeAttribute("src"),b.load());if(!a.A){c.C(11);break}return _.x(c,a.A.destroy(),12);case 12:a.A=null;case 11:a.l.clear(),a.J=null,a.Gf.clear(),a.f=null,a.G=null,a.Xc.clear(),a.ve=!1,KI(a),_.z(c)}})};
|
|
218
|
+
sI=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=window.muxjs?new qF:new _.rF,d=_.Yt(a.configuration,[_.se,"single-native"]),e=d.create(a),a.R=e,f=eI(a),f.track(a),a.gd=f,g=new _.tF(b,c,e,f,a.configuration),_.x(h,g.open(),2);a.L=g;_.z(h)})};GI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.aw(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
219
|
+
HI=function(a,b,c,d){return(new _.Um(Promise.resolve().then(function(){var e,f,g;return _.I(function(h){switch(h.a){case 1:e=null;case 2:if(e){h.C(3);break}_.F(h,4);var l=c.url;var m=LI(a,d);l=b.start(l,m);return _.x(h,l,6);case 6:e=h.f;_.G(h,2);break;case 4:f=_.H(h);if(!a.dd)throw f;return _.x(h,a.dd(c.url,f),8);case 8:if(g=h.f)c.url=g;else throw f;h.C(2);break;case 3:if(0===e.periods.length)throw new _.N(_.O,4,4014);MI(e.periods);return h["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
221
220
|
return b.stop()})).T};
|
|
222
|
-
|
|
223
|
-
if(y.length&&!a.configuration.disableRestrictions){y=a.getPeriods();for(var A=0;A<y.length;A++)for(var C=y[A],E=_.v(C.variants),D=E.next();!D.done;D=E.next()){D=D.value;var J=[];D.audio&&J.push(D.audio);D.video&&J.push(D.video);J=_.v(J);for(var P=J.next();!P.done;P=J.next()){P=P.value;var U=D.allowedByKeySystem;if(P.keyId){var V=q[B?"00":P.keyId];V=!!V&&!
|
|
224
|
-
a.log.warn("DRM Key not available for KID: '"+(P.keyId+"'. Applying restrictions to "+V)));C===t&&U!==D.allowedByKeySystem&&(u=!0)}}}if(q=
|
|
225
|
-
|
|
226
|
-
_
|
|
227
|
-
|
|
228
|
-
b),a.h.configure(a.configuration.abr),a.
|
|
229
|
-
t},
|
|
230
|
-
e.h=a.configuration.streaming,a.a=e,a.H=
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
d,"buffered to end",b,"state",a.getState()),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());h=
|
|
239
|
-
m.video,c,d),4)}
|
|
240
|
-
|
|
241
|
-
h=!1;l=void 0;if(d){if(l=g.find(function(A){return A.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),h=!0,m=a.getTrackManager().
|
|
242
|
-
Error("Audio codecs not compatible with active audio.");return _.x(B,f.parser.loadVariant(l,f.id),4);case 4:return t=B.f,u=t.audio,a.
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.
|
|
250
|
-
|
|
251
|
-
e.value,(g=e.video)&&!
|
|
252
|
-
|
|
253
|
-
c.keySystem){f=_.v(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
d=a.h.chooseTrack(),
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
missingKeys:g,restrictedKeyStatuses:h});};
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
a.f.periods=g.periods;m=
|
|
268
|
-
y.add(C.video),C.audio&&y.add(C.audio);E=a.getNetworkEngine();D=_.v(_.
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
_.
|
|
276
|
-
_.r
|
|
277
|
-
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.
|
|
221
|
+
zI=function(a,b,c){var d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:_.jn("initDrm.start");d=new _.Xr({Cb:a.getNetworkEngine(),onError:function(q){return a.onError(q)},Cg:function(q){if(a.a){var t=mF(a),u=!1,y=Object.keys(q);0===y.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 B=1===y.length&&"00"===y[0];B&&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.");
|
|
222
|
+
if(y.length&&!a.configuration.disableRestrictions){y=a.getPeriods();for(var A=0;A<y.length;A++)for(var C=y[A],E=_.v(C.variants),D=E.next();!D.done;D=E.next()){D=D.value;var J=[];D.audio&&J.push(D.audio);D.video&&J.push(D.video);J=_.v(J);for(var P=J.next();!P.done;P=J.next()){P=P.value;var U=D.allowedByKeySystem;if(P.keyId){var V=q[B?"00":P.keyId];V=!!V&&!NI.includes(V);D.allowedByKeySystem=V}U!==D.allowedByKeySystem&&(V=P.type,P.type===_.Ng&&(V="video "+P.width+"x"+P.height+"@"+_.R.eg(P.bandwidth)),
|
|
223
|
+
a.log.warn("DRM Key not available for KID: '"+(P.keyId+"'. Applying restrictions to "+V)));C===t&&U!==D.allowedByKeySystem&&(u=!0)}}}if(q=PG(a.a)){B=RG(a.a);y=SG(a.a);a:{A=q.variants;for(C=0;C<A.length;C++)if(A[C].audio===B&&A[C].video===y){B=A[C];break a}B=null}if(!B||B.allowedByKeySystem)a.log.info(IB),OI(a),PI(a,q.variants)}u&&q!==t&&(a.log.info(IB),OI(a),PI(a,t.variants))}},Bg:function(q,t){a.trigger(new _.Q(_.Xd,{expirationTime:t}))},onEvent:function(q){return a.kg(q)},getConfiguration:function(){return a.getConfiguration()},
|
|
224
|
+
td:function(){return a.td()}});e=b.periods.every(function(q){return q.variants.some(function(t){return t.drmInfos.some(function(u){return u.licenseServerUriOrigin===_.$B})})});c.drmResolver&&(c.drm=c.drmResolver({hasLaurl:e}));f=c.drm;g=_.$n(f);d.f=g;h=f?f.offlineId||"":"";l=[];m=_.Gv(b.periods);if(!h){p.C(2);break}n=_.ei(_.ef);if(!n){p.C(2);break}return _.x(p,n.f(a,m),4);case 4:return _.x(p,n.a(h),5);case 5:l=p.f;case 2:return _.x(p,_.bs(d,m,l),6);case 6:return a.A=d,QI(a,b.periods),_.jn("initDrm.end"),
|
|
225
|
+
_.ln("Init DRM","initDrm.start","initDrm.end"),p["return"](d)}})};
|
|
226
|
+
AI=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,RI(a,c),SI(a,a.f.periods),a.pe=new rG(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.ce=a.configuration.preferredTextLanguage,a.xf=a.configuration.preferredTextRole,a.Yd=a.configuration.preferForcedSubtitles,_.x(q,_.ts(a.A,c),2);if(3!=q.a)return kG(a.w,
|
|
227
|
+
b),a.h.configure(a.configuration.abr),a.Pg&&a.h.setCmsdManager(a.Pg),a.h.init(function(t,u,y){var B,A,C;return _.I(function(E){if(1==E.a){if(!TI(a))return E["return"]();B=UI(a).find(function(D){return D.id===t.id})||null;if(!B)return a.log.warn("No matching variant found for track switch"),E.C(0);A=mF(a);return _.x(E,A.parser.loadVariant(B,A.id),3)}C=E.f;VI(a,C,u,y);_.z(E)})}),a.B=WI(a,c,a.configuration.startTime),a.fd=XI(a),a.I=new DG({pi:function(){return c.playbackRate},Go:function(t){c.playbackRate=
|
|
228
|
+
t},Zm:function(t){c.currentTime+=t}}),EG(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Af=new AG(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),YI(a,d),ZI(a)?WF(a.f,_.Ei(a.configuration.preferredVideoCodec),_.Ei(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):VF(a.f,_.Ei(a.configuration.preferredVideoCodec),_.Ei(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),e=$I(a),
|
|
229
|
+
e.h=a.configuration.streaming,a.a=e,a.H=cI,_.x(q,e.start(),3);kG(a.w,b);a.configuration.streaming.startAtSegmentBoundary&&(f=a.B.getTime(),g=aJ(a,f),hE(a.B.f,g));h=_.v(a.f.periods);for(l=h.next();!l.done;l=h.next())m=l.value,bJ(a,m);OI(a);n=UI(a);p=n.some(function(t){return t.primary});a.configuration.preferredAudioLanguage||p||a.log.warn("No preferred audio language set. We will choose an arbitrary language initially");PI(a,n);_.z(q)})};TI=function(a){return a.a?a.a.G:!1};
|
|
230
|
+
RI=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Xf&&a.xe?(a.J.a=xG,KI(a)):d.type===_.Vg&&3===a.getState()&&.1>a.getBufferInfo().Sa(a.getMediaPosition())?(a.J.a=xG,KI(a)):a.J&&cJ(a));yJ(a)}a.o.on(b,_.tf,c);a.o.on(b,_.df,c);a.o.on(b,_.je,c);a.o.on(b,_.Xf,c);a.o.on(b,_.Wf,c);a.o.on(b,_.If,c);a.o.on(b,_.Vg,c);a.o.on(b,_.Kf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
231
|
+
MI=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)})){_.Rh("Found variant with audio and video content, so filtering out audio-only content in all periods.");a=_.v(a);for(var c=a.next();!c.done;c=a.next())c=c.value,c.variants=c.variants.filter(b)}};WI=function(a,b,c){return new mE(b,a.f,a.configuration.streaming,c,function(d){a.fd&&oE(a.fd,!0,d);a.a&&mH(a.a)},function(d){return a.dispatchEvent(d)},a.U===_.pb)};
|
|
232
|
+
XI=function(a){var b=new pE(a.j),c=new BG(a.f);CG(c,function(){OI(a)});b.a.add(c);a.K&&(c=new rE(a.K),sE(c,function(d){d.Cf&&d.Cf();FI(a,_.sg,d)},function(d){d.Ag&&d.Ag();FI(a,_.tg,d)},function(d,e){e||(d.Cf&&d.Cf(),FI(a,_.sg,d),d.Ag&&d.Ag(),FI(a,_.tg,d))}),b.a.add(c));a.U===_.pb&&(c=new PD(a.ge,a.we,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.If=c);return b};YI=function(a,b){a.J=new yG(b,Math.min(.5,b/2));a.J.a=xG;KI(a);a.oc=(new _.ej(function(){cJ(a)})).Hb(.25)};
|
|
233
|
+
cJ=function(a){switch(a.H){case cI:a:if(a.j.ended||CF(a.L))var b=!0;else{if(a.isLive()){b=FD(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Ra(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.L){var d=EF(a.L);c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Sa(e),d=d.Sa(e),c=Math.min(c,d)):c=c?c.Sa(e):d?d.Sa(e):0}else c=0;if(d=a.J){d=a.J;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?wG:xG;d.a=c;d=e!==c}c=d;(d=zJ(a))&&a.ed&&(a.ed.f=!0);c||2===a.getState()&&!d?(a.log.debug("Buffering state changed. Is buffering",
|
|
234
|
+
d,"buffered to end",b,"state",a.getState()),KI(a)):a.ve&&yJ(a)};$I=function(a){var b={configuration:{Nm:a.U===_.pb},Ab:function(){return a.B.getTime()},X:a.L,Cb:a.getNetworkEngine(),od:a.Z,zg:a.fl.bind(a),Ui:a.qn.bind(a),onError:a.onError.bind(a),Vi:a.xn.bind(a),onEvent:a.kg.bind(a),$i:a.Yo.bind(a),Ef:a.Mn.bind(a),he:function(){return a.h},fg:a.hk.bind(a),Fj:a.No.bind(a),be:a.A};return new _.NG(a.f,b)};
|
|
235
|
+
fF=function(a,b){var c,d,e;return _.I(function(f){switch(f.a){case 1:c=_.AJ;if(!a.f||!a.a){f.C(0);break}d=mF(a);return _.x(f,d.parser.loadTextStream(b.id,d.id),3);case 3:return e=f.f,_.x(f,XG(a.a,e),4);case 4:return BJ(a,d,e,!1),_.x(f,CJ(a,e),5);case 5:a.ce=e.language,a.Yd=e.kind===c.lh,_.z(f)}})};
|
|
236
|
+
cF=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,h,l,m,n;_.I(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=mF(a);if(!e)throw Error(NB);if(!b)return a.ka=null,null!=a.se&&(a.pe=a.se,a.se=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=PI(a,e.variants),g=f.variant,null!=g&&TI(a)&&VI(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
|
|
237
|
+
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());h=UI(a);l=h.find(function(q){return q.id===b.id})||null;if(!l)throw a.log.error("No variant with id",b.id),Error("Variant not found.");if(!dG(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.ka=l.video.id;return _.x(p,e.parser.loadVariant(l,e.id),2)}if(4!=p.a){m=p.f;if(n=!!nF(a.l,e).ab){if(!m.video)return p.C(4);DJ(a,e,m.video,!1);return _.x(p,gH(a.a,
|
|
238
|
+
m.video,c,d),4)}EJ(a,e,m,!1);return _.x(p,FJ(a,m,c,d),4)}null==a.se&&(a.se=a.pe);a.pe=new sG(l);PI(a,e.variants);_.z(p)})};
|
|
239
|
+
HJ=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y;_.I(function(B){switch(B.a){case 1:if(a.configuration.streaming.disableAudioTracks)throw Error("Audio tracks are disabled by config.");if(!a.a||!a.f||!a.B)throw Error("Not ready to select audio track.");c=(a.f.muxedAudioTracks||[]).find(function(A){return A.id===b});if(!c){B.C(2);break}return _.x(B,GJ(a,c),3);case 3:return B["return"]();case 2:d=SG(a.a);e=RG(a.a);f=mF(a);if(!f)throw Error(NB);g=UI(a).filter(function(A){return A.audio.id===b&&dG(A)});
|
|
240
|
+
h=!1;l=void 0;if(d){if(l=g.find(function(A){return A.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),h=!0,m=a.getTrackManager().Ma()))n=m.renditions.map(function(A){return A.id}),l=g.find(function(A){return n.find(function(C){return C===String(A.video.id)})})}else l=g[0];if(!l)throw Error("Variant with target audio track not found.");q=(p=!!nF(a.l,f).ab)?!0:e.codecs.split(".")[0]===l.audio.codecs.split(".")[0];if(!q)throw a.log.warn("Cannot select audio track, codecs are not compatible with active track."),
|
|
241
|
+
Error("Audio codecs not compatible with active audio.");return _.x(B,f.parser.loadVariant(l,f.id),4);case 4:return t=B.f,u=t.audio,a.Jb=u.id,y=g.map(UE),a.h.setTracks(y),EJ(a,f,t,!1),h||!TI(a)?_.x(B,FJ(a,t,!0,0),0):_.x(B,iH(a.a,u),0)}})};
|
|
242
|
+
GJ=function(a,b){var c,d,e,f,g;return _.I(function(h){c=mF(a);if(!c)throw Error(NB);d=c.variants.filter(function(l){return l.video&&l.video.muxedAudioId===b.groupId&&dG(l)});if(0===d.length)throw Error("No variants containing muxed audio found.");e=d[0];(f=SG(a.a))&&(e=d.find(function(l){return l.video.id===f.id})||null);g=e&&e.video;if(!g)return h["return"]();a.Jb=b.id;a.log.info("Select muxed audio track "+b.id);IJ(a,c,b,!1);return _.x(h,fH(a.a),0)})};
|
|
243
|
+
iF=function(a){var b=a.bh;return a.f?a.L.getTextDisplayer().isTextVisible():b};eF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.bh;d=b;if(c===d)return g["return"]();a.bh=d;if(a.H!==cI)return g.C(0);a.L.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.C(0);if(!b)return $G(a.a),g.C(0);e=mF(a);f=_.fG(e.textStreams,a.ce,a.xf,a.Yd);return 0<f.length?_.x(g,XG(a.a,f[0]),0):g.C(0)})};
|
|
244
|
+
EJ=function(a,b,c,d){b.parser&&b.parser.setCurrentVariant(c);c.video&&DJ(a,b,c.video,d);c.audio&&JJ(a,b,c.audio,d)};JJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;a=nF(a.l,b);a.audio=c;a.ab=null;pF(e,c.id,_.X,d);c=e.Ta();yC(f,c,d)}};
|
|
245
|
+
DJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;nF(a.l,b).video=c;pF(e,c.id,_.dt,d);a=e.qa();f.j!==a&&(f.j=a,f.a.push({timestamp:Date.now()/1E3,id:a.id,trackId:a.track.id,type:a.track.type,fromAdaptation:d,width:a.width,height:a.height,bandwidth:a.bandwidth}))}};IJ=function(a,b,c,d){b=nF(a.l,b);b.audio=null;b.ab=c;if(b=a.getTrackManager())a=a.G.f,pF(b,c.id,_.X,d),c=b.Ta(),yC(a,c,d)};
|
|
246
|
+
BJ=function(a,b,c,d){nF(a.l,b).text=c;if(b=a.getTrackManager())pF(b,c.id,_.ct,d),c=b.Ya(),a=a.G.f,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}))};KJ=function(a){return a.U===_.pb&&"flat"===a.configuration.playlist.timeline};
|
|
247
|
+
SI=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.v(UI(a)),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var h=_.v(g.closedCaptions.keys()),l=h.next();!l.done;l=h.next())if(l=l.value,!e.has(l)){var m={id:a.jh++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Ga:0,mimeType:_.Gc,codecs:"",kind:_.cd,encrypted:!1,
|
|
248
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.Fn,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:g.roles,channelsCount:null,spatialAudio:!1,closedCaptions:null};e.set(l,m)}}e=_.v(e.values());for(f=e.next();!f.done;f=e.next())d.textStreams.push(f.value)}};
|
|
249
|
+
QI=function(a,b){for(var c=a.a?RG(a.a):null,d=a.a?SG(a.a):null,e=!ZI(a),f=_.v(b),g=f.next();!g.done;g=f.next())aG(a.A,c,d,g.value,e);c=BC(b,function(h){return h.variants.some(dG)});if(a.configuration.streaming.disableAudioTracks)for(d=_.v(b),e=d.next();!e.done;e=d.next())for(f=_.v(e.value.variants),e=f.next();!e.done;e=f.next())delete e.value.audio;if(a.configuration.streaming.disableVideoTracks)for(d=_.v(b),e=d.next();!e.done;e=d.next())for(f=_.v(e.value.variants),e=f.next();!e.done;e=f.next())e=
|
|
250
|
+
e.value,(g=e.video)&&!CC(g.type,_.Hn(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=_.v(b);for(e=c.next();!e.done;e=c.next())d=e.value,YF(d.variants,a.configuration.restrictions)&&a.a&&mF(a)===d&&OI(a),LJ(a,d.variants)};
|
|
251
|
+
bJ=function(a,b){var c=a.a?RG(a.a):null,d=a.a?SG(a.a):null,e=!ZI(a);aG(a.A,c,d,b,e);d=b.variants;if(a.configuration.streaming.disableAudioTracks)for(c=_.v(d),e=c.next();!e.done;e=c.next())delete e.value.audio;if(!d.some(dG))throw new _.N(_.O,4,4011);LJ(a,b.variants);YF(d,a.configuration.restrictions)&&a.a&&mF(a)===b&&OI(a);if(!_.jj(2)&&(c=a.A?a.A.getDrmInfo():null))for(d=_.v(d),e=d.next();!e.done;e=d.next()){e=_.v(e.value.drmInfos);for(var f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===
|
|
252
|
+
c.keySystem){f=_.v(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.ws(a.A,g.keyId,g.initData)||_.ms(a.A,g.initDataType,g.initData,g.keyId)}}};FJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;return _.I(function(e){return TI(a)?_.x(e,dH(a.a,b,c,d),0):(a.za=b,a.Mj=c,a.Lj=d,e.C(0))})};CJ=function(a,b){return _.I(function(c){return TI(a)?_.x(c,_.jH(a.a,b),0):(a.fa=b,c.C(0))})};
|
|
253
|
+
MJ=function(a){if(a.a&&a.f){var b=PG(a.a),c=mF(a);null!=b&&b===c&&(RG(a.a),SG(a.a),_.QG(a.a,_.Fn),nF(a.l,c),nF(a.l,c),nF(a.l,c),nF(a.l,c))}};aJ=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=RG(a.a),e=SG(a.a),f=mF(a);d=c(d,b);e=c(e,b);return null!=e&&null!=d?Math.max(e,d):null!=e?e:null!=d?d:b};zJ=function(a){return a.A&&a.A.G?!0:a.J?a.J.getState()===xG:!1};
|
|
254
|
+
KI=function(a){if(a.G&&a.J&&a.B){var b=2===NJ(a),c=a.I;c.l=b;HG(c,c.o?"seek":void 0);a.B.j.o=b;yJ(a);a.If&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.If,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.Q(_.Rf))))}};yJ=function(a){fI(a,NJ(a))};NJ=function(a){if(a.xe)var b=!1;else if(a.j&&a.j.ended)b=!0;else{b=a.getMediaDuration();var c=a.getMediaPosition();b=a.ve&&0<=c&&b<=c?!0:!1}return b?5:zJ(a)||a.xe?2:a.j&&a.j.paused?4:3};
|
|
255
|
+
PI=function(a,b){var c=OJ(a,b);if(!c)return{variant:null,ab:null};var d=PJ(a,c);return{variant:c,ab:d}};PJ=function(a,b){if(!b||!b.video)return null;var c=(a.f.muxedAudioTracks||[]).find(function(d){return d.groupId===b.video.muxedAudioId});return c&&c.primary?c:null};
|
|
256
|
+
OJ=function(a,b){try{LJ(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return dG(f)}),d=LE(c,a.Jb);c=a.pe.create(d);c=Array.from(c.values());var e=c.map(UE);a.h.setTracks(e);if(null!==a.ka&&null!==a.Jb&&(e=c.find(function(f){return f.video.id===a.ka&&f.audio.id===a.Jb}),a.ka=null,e))return e;if(a.configuration.abr.enabled||null===a.ka)return d=a.h.chooseTrack(),VE(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.ka});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
257
|
+
d=a.h.chooseTrack(),VE(d,c))};QJ=function(a,b){return _.fG(b,a.ce,a.xf,a.Yd)[0]||null};RJ=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g;_.I(function(h){if(1==h.a)return d=PI(a,b.variants),e=d.variant,a.Jb=e&&e.audio&&e.audio.id,e?_.x(h,b.parser.loadVariant(e,b.id),3):h.C(2);if(2!=h.a)return f=h.f,EJ(a,b,f,!0),_.x(h,FJ(a,f,c),2);g=QJ(a,b.textStreams);if(!g||!a.configuration.streaming.alwaysStreamText&&!iF(a))return h.C(0);BJ(a,b,g,!0);return _.x(h,CJ(a,g),0)})};
|
|
258
|
+
UJ=function(a,b){a.h.disable();a.log.debug("Choosing new streams after period changed");var c=PI(a,b.variants),d=c.variant,e=c.ab,f=QJ(a,b.textStreams);a.za&&(b.variants.includes(a.za)&&(d=a.za),a.za=null);a.fa&&(b.textStreams.includes(a.fa)&&(f=a.fa),a.fa=null);var g=d?d.video:null,h=d&&!e?d.audio:null;d&&b.parser&&b.parser.setCurrentVariant(d);g&&SJ(a,b,function(){return DJ(a,b,g,!0)});h&&SJ(a,b,function(){return JJ(a,b,h,!0)});e&&SJ(a,b,function(){return IJ(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
259
|
+
iF(a))&&SJ(a,b,function(){return BJ(a,b,f,!0)});b===mF(a)&&TJ(a);c=a.configuration.streaming.alwaysStreamText||iF(a)?f:null;return{video:g,audio:h,text:c,ab:e}};
|
|
260
|
+
VI=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;var e,f,g;_.I(function(h){if(1==h.a){if(!a.configuration.abr.enabled||!a.a)return h["return"]();e=VJ(a,b);f=!!nF(a.l,e).ab;if(!f)return h.C(2);g=b.video;if(!g)return h.C(2);SJ(a,e,function(){return DJ(a,e,g,!0)});e===mF(a)&&TJ(a);return _.x(h,gH(a.a,g,c,d),4)}if(2!=h.a)return h["return"]();SJ(a,e,function(){EJ(a,e,b,!0)});e===mF(a)&&TJ(a);dH(a.a,b,c,d);_.z(h)})};
|
|
261
|
+
OI=function(a){var b=a.getTrackManager();b&&a.H!==JI&&(b.m&&(lF(b),b.m.trigger(new _.Q(_.wg))),TJ(a))};TJ=function(a){var b=mF(a);if(b){var c=a.Xc.get(b)||[];for(a.Xc["delete"](b);c.length;)c.shift()()}};SJ=function(a,b,c){a.Xc.has(b)||a.Xc.set(b,[]);a.Xc.get(b).push(c)};FI=function(a,b,c){a.trigger(new _.Q(b,{detail:KD(c,KJ(a))}))};
|
|
262
|
+
LJ=function(a,b){var c=a.A?_.M.ph(a.A.ka):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],h=[],l=_.v(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=_.v(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?NI.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,
|
|
263
|
+
missingKeys:g,restrictedKeyStatuses:h});};WJ=function(a){if(null==mF(a))return[];MJ(a);return UI(a).filter(function(b){return dG(b)})};XJ=function(a){var b=mF(a);if(null==b)return[];MJ(a);return a.f.alternativeTextStreams?a.f.alternativeTextStreams:b.textStreams.filter(function(c){return!a.Gf.has(c)})};mF=function(a){var b=a.B.getTime(),c=null;a=_.v(a.f.periods);for(var d=a.next();!d.done;d=a.next())d=d.value,d.startTime<=b&&(c=d);return c};YJ=function(a){var b=mF(a);return b?nF(a.l,b).audio:null};
|
|
264
|
+
ZJ=function(a){var b=mF(a);return b?nF(a.l,b).video:null};VJ=function(a,b){for(var c=_.v(a.f.periods),d=c.next();!d.done;d=c.next())if(d=d.value,d.variants.some(function(e){return e.id===b.id}))return d;return null};oI=function(a){if(a.H===JI)throw new _.N(_.O,7,7E3,"Player is destroyed.");};
|
|
265
|
+
$J=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,u,y,B,A,C,E,D,J,P,U;return _.I(function(V){switch(V.a){case 1:return e=_.uu,_.F(V,2),_.x(V,_.aw(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=V.f;f.configure(a.configuration.manifest);var sa=f;var Da=b.url,wa=LI(a,a.configuration.id||"");sa=sa.start(Da,wa);return _.x(V,sa,5);case 5:g=V.f;MI(g.periods);if(!g.periods.length)throw new _.N(_.O,4,4014);return _.x(V,hI(a),6);case 6:a.da=[f];h=d&&d.id;l=c&&c.id;
|
|
266
|
+
a.f.periods=g.periods;m=gD(g.periods,a.B.getTime())||g.periods[0];ZI(a)?WF(a.f,_.Ei(a.configuration.preferredVideoCodec),_.Ei(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):VF(a.f,_.Ei(a.configuration.preferredVideoCodec),_.Ei(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=ME(h,l,m.variants);p=QJ(a,m.textStreams);PI(a,m.variants);q=n&&n.video;t=n&&n.audio;u=[];y=new Set;B=_.v(m.variants);for(A=B.next();!A.done;A=B.next())C=A.value,
|
|
267
|
+
C.video&&y.add(C.video),C.audio&&y.add(C.audio);E=a.getNetworkEngine();D=_.v(_.kh(y).concat(_.kh(m.textStreams)));for(J=D.next();!J.done;J=D.next())P=J.value,u.push(P.createSegmentIndex(E,a.configuration.streaming.attemptParameters));return _.x(V,Promise.all(u),7);case 7:uH(a.a,e.AUDIO,t);uH(a.a,e.VIDEO,q);uH(a.a,e.TEXT,p);n&&EJ(a,m,n,!1);a.log.info("Switch CDN successful.");_.G(V,0);break;case 2:U=_.H(V);if(!f){V.C(8);break}return _.x(V,f.stop(),8);case 8:throw U;}})};
|
|
268
|
+
LI=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return uI(a,c)},configurationId:b,filterNewPeriod:function(c){return bJ(a,c)},filterAllPeriods:function(c){return QI(a,c)},onEvent:function(c){return a.kg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return mI(a,c)},onTurnedStatic:function(){return nI(a)},he:function(){return a.h}}};
|
|
269
|
+
ZI=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.bg&&(_.jj(2)||_.jj(3)||_.jj(4)||_.jj(5)||_.jj(6)||_.kj()&&38===_.lj().major||_.kj()&&53===_.lj().major||_.kj()&&68===_.lj().major?!1:!0)};UI=function(a){return a.f.alternativeVariants&&0<a.f.alternativeVariants.length?a.f.alternativeVariants:a.B?mF(a).variants:a.f.periods[0].variants};aK=function(){};
|
|
270
|
+
bK=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}};cK=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};dK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
271
|
+
eK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.JC(b)&&a(b)}};
|
|
272
|
+
fK=function(){var a=MediaSource.isTypeSupported,b=/^dv(?:h[e1]|a[v1])\./;MediaSource.isTypeSupported=function(c){var d=c.split(/ *; */),e=d.shift(),f={};d=_.v(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)}};
|
|
273
|
+
gK=function(a){_.Vv.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=_.Pd;c.label===PB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.lC,PB));this.a.mode=_.qe};hK=function(a,b){var c=a.mode;a.mode=c===_.Yf?_.Yf:_.qe;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};iK=function(){};_.Up.prototype.f=_.nC(0,function(){return this.keyInfo});sC=[112,115,115,104,0,0,0,0];_.jK=0;
|
|
274
|
+
_.AJ={mh:_.kg,ep:_.cd,lh:_.me};NC.prototype.release=function(){oC(this.h,this.j)};_.TC.prototype.me=function(){return this.ga?this.ga-this.la+1:null};_.TC.prototype.f=function(){return this.keyInfo};_.UC.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.r=_.XC.prototype;_.r.De=function(a,b){var c=WC(a).childNodes[0];return b&&c.tagName!==b?null:c};_.r.Ka=function(a,b){var c=this.$(a,b);return 1!==c.length?null:c[0]};
|
|
275
|
+
_.r.$=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.r.Zb=_.ih(1);_.r.Ic=_.ih(3);_.r.ua=function(a){return a.childNodes.every(function(b){return b.tagName===_.da||"#cdata"===b.tagName})?a.childNodes.map(function(b){return b.textContent}).join(""):null};_.r.getAttributeNS=function(a,b,c){return(b=a.a.get(b))?a.attributes[b+":"+c]||null:null};_.r.W=_.ih(5);_.r.mf=_.ih(7);_.r.Kf=_.ih(11);
|
|
276
|
+
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.wf=_.ih(13);_.r.vf=_.ih(15);_.r.nd=_.ih(9);_.r.Lf=_.ih(17);_.r.Je=_.ih(19);_.r=_.aD.prototype;_.r.track=function(a){null!=this.player&&cD(this);a&&(this.player=a,this.player.on(_.Pf,this.kd,this))};_.r.release=function(){cD(this);this.S=[];this.f=this.h=null};
|
|
278
277
|
_.r.append=function(a,b,c){c=void 0===c?null:c;var d=this.h&&null!==c?this.h(c):null;d||this.log.debug("Unable to resolve rendition for ID",c);c={start:a,end:b,rendition:d,width:d?d.width:0,height:d?d.height:0,bandwidth:d?d.bandwidth:0};var e=this.S.find(function(f){return f.start>=a&&f.end<=b});if(e)e.rendition=d,e.width=c.width,e.height=c.height,e.bandwidth=c.bandwidth,e.start=c.start,e.end=c.end;else{d=_.v(this.S);for(e=d.next();!e.done;e=d.next())e=e.value,a>=e.start&&a<e.end?e.end=a:b>=e.start&&
|
|
279
|
-
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(
|
|
280
|
-
_.r.
|
|
281
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=
|
|
282
|
-
_.r.
|
|
283
|
-
_.r.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};_.r.isLive=function(){return 2===this.h.version?!this.a.f:Infinity===this.f&&!this.l};_.r.
|
|
284
|
-
|
|
285
|
-
_.r.
|
|
286
|
-
_.r.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.v(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.
|
|
287
|
-
_.r.
|
|
288
|
-
_.r.
|
|
289
|
-
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
290
|
-
f.
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
_.
|
|
297
|
-
_.r.
|
|
298
|
-
_.r.
|
|
299
|
-
_.r.
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
278
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort($C)}eD(this);this.kd();this.player&&this.player.trigger(new _.Q(_.Qg))};_.r.clear=function(){this.S=[];eD(this);this.player&&(this.player.trigger(new _.Q(_.Qg)),this.player.trigger(new _.Q(_.Uc)))};
|
|
279
|
+
_.r.kd=function(){if(this.player){var a=this.player.getMediaPosition();if(0<=a){a:{for(var b=this.S.length,c=Number.MAX_SAFE_INTEGER,d=0;d<b;d++){var e=this.S[d];c=Math.min(e.start,c);if(e.start<=a&&e.end>a){a=.1>e.end-a&&d<b-1?this.S[d+1].rendition:e.rendition;break a}if(e.start>a)break}a=0<b&&c>a&&.25>c-a?this.S[0].rendition:null}if(a&&this.f!==a&&(this.f=a,this.player)){c=b=-1;if(a)b=a.width||-1,c=a.height||-1;else if(d=this.player.getSurface().getMedia())b=d.videoWidth,c=d.videoHeight;this.player.trigger(new _.Q(_.Xc,
|
|
280
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=pD.prototype;_.r.destroy=function(){this.h=this.w=null;this.o.clear();return Promise.resolve()};_.r.remove=function(a,b){var c=this;return Promise.resolve().then(function(){!c.h||!c.h.remove(a,b)||null==c.a||b<=c.a||a>=c.f||(a<=c.a&&b>=c.f?c.a=c.f=null:a<=c.a&&b<c.f?c.a=b:a>c.a&&b>=c.f&&(c.f=a))})};_.r.Xb=function(){return this.a};_.r.Ra=function(){return this.f};
|
|
281
|
+
_.r.Oc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.Sa=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};uD.prototype.ac=function(){return this.h};uD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.wD.prototype;_.r.Kc=function(){return this.L};_.r.getDuration=function(){return 2===this.h.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.G};
|
|
282
|
+
_.r.offset=function(a){null!=this.w&&(this.w+=a);null!=this.o&&(this.o+=a)};_.r.isLive=function(){return 2===this.h.version?!this.a.f:Infinity===this.f&&!this.l};_.r.ue=function(){return!this.l};LD.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};LD.prototype.cues=function(){return this.a};PD.prototype.release=function(){this.f=this.j=this.h=this.a=null};PD.prototype.l=function(a){zC(this.a,a);QD(this)};
|
|
283
|
+
RD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.La().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=SD(this);return{value:a,done:!a}};_.r=_.TD.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
|
|
284
|
+
_.r.md=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};
|
|
285
|
+
_.r.get=function(a){if(0===this.a.length)return null;a-=this.a[0].position;return 0>a||a>=this.a.length?null:this.a[a]};_.r.offset=function(a){this.g.info("Apply offset"+a+" to segment index");for(var b=_.v(this.a),c=b.next();!c.done;c=b.next())c=c.value,c.startTime+=a,c.endTime+=a,c.Ga-=a};
|
|
286
|
+
_.r.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};_.r.getDuration=function(){return 0===this.a.length?0:this.a[this.a.length-1].endTime-this.a[0].startTime};
|
|
287
|
+
_.r.ra=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 _.Up(f.position,g.startTime,g.endTime,g.La,g.la,g.ga,g.Ga,g.keyInfo,g.ae,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.le,g.Qa),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
288
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.Up(d++,f.startTime,f.endTime,f.La,f.la,f.ga,f.Ga,f.keyInfo,f.ae,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.le,f.Qa),b.push(f);else b=a;a=b;if(c.length&&b.length){a=[];e=b[0].position;d=c.length;c=_.v(c);for(f=c.next();!f.done;f=c.next())f=f.value,a.push(new _.Up(e-d--,f.startTime,f.endTime,f.La,f.la,f.ga,f.Ga,f.keyInfo,f.ae,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
289
|
+
f.le,f.Qa));b=_.v(b);for(f=b.next();!f.done;f=b.next())a.push(f.value)}this.a=a};_.r.replace=function(a){this.a=a};YD.prototype.release=function(){this.h=null;this.f=function(){}};bE.prototype.release=function(){this.j&&(this.j.release(),this.j=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};bE.prototype.Ef=function(){this.A=!0;aE(this)};cE.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
290
|
+
gE.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};gE.prototype.getTime=function(){return this.l?this.a.currentTime:this.A};mE.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(){}};
|
|
291
|
+
mE.prototype.getTime=function(){var a=this.f.getTime();return 0<this.h.readyState&&!this.h.paused?JD(this.a,a):a};pE.prototype.release=function(){this.h.stop();for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())b.value.release();this.a.clear()};rE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};
|
|
292
|
+
rE.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.v(this.j.cues()),f=e.next();!f.done;d={Xf:d.Xf,Pe:d.Pe},f=e.next()){f=f.value;d.Xf=this.o.get(f)||null;d.Pe=qE(f,a);this.o.set(f,d.Pe);var g=this.w.find(function(h){return function(l){return l.Wc===h.Xf&&l.Vc===h.Pe}}(d));g&&g.Mc(f,b&&0===c)}};vE.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.nD(this.f),_.nD(this.h))};_.w(AE,_.zi);
|
|
293
|
+
AE.prototype.destroy=function(){this.B=this.h=this.A=null;this.o.clear();this.l.clear();this.j.clear();this.w.clear();null!=this.a&&(this.a.stop(),this.a=null);return this.D.destroy()};
|
|
294
|
+
AE.prototype.getBaseUriCollectionById=function(a){var b=this,c=this.l.get(a);if(!c)return this.g.warn("getBaseUriCollectionById: invalid baseUriSetId:"+a+"."),null;var d=Date.now();this.j.forEach(function(f,g){f.Rd&&d>f.Rd&&(f.Rd=0,b.trigger(new _.Q(_.Kd,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===DE(b,f.serviceLocationId).Rd});e.length||(e=c);e.length&&(c=this.w.get(a),zE(e,c)||(c={baseUriCollectionId:a,from:c||[],to:e},this.g.info("Steering server update baseUriCollectionId: "+
|
|
295
|
+
c.baseUriCollectionId+" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),this.trigger(new _.Q(_.Jd,{detail:c})),this.w.set(a,e)));return new _.xE(a,e)};AE.prototype.notifyThroughput=function(a,b,c){a=DE(this,a);wE(a.xh,b,c);a.Nf=!0};AE.prototype.banLocation=function(a){var b=DE(this,a);b.Rd=Date.now()+1E3*this.f;b.Nf=!1;this.g.info("service location "+a+" banned during "+this.f+CB);this.trigger(new _.Q(_.Kd,{detail:{serviceLocationId:a,banned:!0,bannedSeconds:this.f}}))};_.w(WE,_.zt);_.r=WE.prototype;_.r.initialize=function(a){this.m=a};_.r.release=function(){this.h=[];this.a.clear();this.f.clear()};_.r.load=function(){};_.r.destroy=function(){this.release();this.m=null};_.r.getVideoTracks=function(){return XE(this,_.dt)};_.r.getAudioTracks=function(){return XE(this,_.X)};_.r.pa=function(){return XE(this,_.ct)};_.r.qa=function(){return this.a.get(_.dt)||null};_.r.Ta=function(){return this.a.get(_.X)||null};_.r.Ya=function(){return this.a.get(_.ct)||null};
|
|
296
|
+
_.r.yb=function(){return this.f.get(_.dt)||null};_.r.Mb=function(){return this.f.get(_.X)||null};_.r.Nb=function(){return this.f.get(_.ct)||null};_.r.Ma=function(){return YE(this,_.dt)};_.r.oa=function(){return YE(this,_.X)};_.r.wa=function(){return YE(this,_.ct)};_.r.Gb=function(a){this.m&&ZE(this,_.dt,a)};_.r.Ha=function(a){this.m&&ZE(this,_.X,a)};_.r.Za=function(a){this.m&&ZE(this,_.ct,a)};
|
|
297
|
+
_.r.qb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)dF(this,a,b);else{var c=b,d=YE(this,_.dt);d&&(this.g.info("Unset video rendition."),d.trickPlay?this.g.info("Enabling ABR for trick play tracks is not supported"):(this.g.info("Enable ABR."),cF(this.m,null,c)))}};_.r.Eb=function(a){this.m&&(a?(bF(this,a,_.X),aF(this,a,_.X)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.X,a),HJ(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
298
|
+
_.r.addTextTrack=function(a){var b=this;return _.I(function(c){return b.m?_.x(c,b.m.addTextTrack(a.url,a.language,a.kind,a.mimeType,a.codec,a.label),0):c["return"]()})};_.r.xa=function(){return!!this.m&&this.m.xa()};
|
|
299
|
+
_.r.Fb=function(a){if(this.m){var b=a;if(!a){var c=this.Ya();if(c&&c.track.kind!==_.me){a=this.pa().find(function(e){return e.kind===_.me&&e.language===c.track.language});if(!a){var d=this.oa();d&&(a=this.pa().find(function(e){return e.kind===_.me&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?gF(this,b):hF(this)}};WE.prototype.setTextRendition=WE.prototype.Fb;WE.prototype.isAbrEnabled=WE.prototype.xa;WE.prototype.addTextTrack=WE.prototype.addTextTrack;WE.prototype.setAudioRendition=WE.prototype.Eb;
|
|
300
|
+
WE.prototype.setVideoRendition=WE.prototype.qb;WE.prototype.setTextTrack=WE.prototype.Za;WE.prototype.setAudioTrack=WE.prototype.Ha;WE.prototype.setVideoTrack=WE.prototype.Gb;WE.prototype.getTextTrack=WE.prototype.wa;WE.prototype.getAudioTrack=WE.prototype.oa;WE.prototype.getVideoTrack=WE.prototype.Ma;WE.prototype.getLoadingTextRendition=WE.prototype.Nb;WE.prototype.getLoadingAudioRendition=WE.prototype.Mb;WE.prototype.getLoadingVideoRendition=WE.prototype.yb;WE.prototype.getTextRendition=WE.prototype.Ya;
|
|
301
|
+
WE.prototype.getAudioRendition=WE.prototype.Ta;WE.prototype.getVideoRendition=WE.prototype.qa;WE.prototype.getTextTracks=WE.prototype.pa;WE.prototype.getAudioTracks=WE.prototype.getAudioTracks;WE.prototype.getVideoTracks=WE.prototype.getVideoTracks;qF.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Ni(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};qF.prototype.h=function(a,b){var c=_.Ni(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};qF.prototype.f=function(){this.a.resetCaptionStream()};_.rF.prototype.init=function(){};_.rF.prototype.h=function(){};_.rF.prototype.f=function(){};_.r=_.tF.prototype;
|
|
302
|
+
_.r.destroy=function(){var a=this;window.ManagedMediaSource&&(this.j.disableRemotePlayback=!1);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"](EC));for(e=1;e<d.length;++e)d[e].p["catch"](EC),d[e].p.reject()}this.f&&b.push(this.f.destroy());this.B&&b.push(this.B.destroy());for(var f in this.w)this.w[f].destroy(),delete this.w[f];return Promise.all(b).then(function(){a.l&&(a.l.release(),a.l=null);a.j&&(a.j.removeAttribute("src"),a.j.load(),
|
|
303
303
|
a.j=null);a.A="";a.o=null;a.f=null;a.B=null;a.a={};a.J={};a.w={};a.G={};a.H=null;a.O=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.L};
|
|
304
|
-
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,l,m,n,p,q,t,u,y,B;return _.I(function(A){switch(A.a){case 1:return e=_.
|
|
305
|
-
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),A.C(3)}})};_.r.
|
|
306
|
-
_.r.remove=function(a,b,c){var d=this;return a===_.
|
|
307
|
-
_.r.flush=function(a){return a===_.
|
|
308
|
-
_.r.
|
|
309
|
-
_.r.
|
|
310
|
-
_.r.
|
|
311
|
-
_.r.
|
|
312
|
-
_.r.
|
|
313
|
-
_.r.
|
|
314
|
-
_.r.chooseTrack=function(){var a=
|
|
304
|
+
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,h,l,m,n,p,q,t,u,y,B;return _.I(function(A){switch(A.a){case 1:return e=_.uu,_.x(A,d.L,2);case 2:f=_.v(a),g=f.next();case 3:if(g.done){A.C(0);break}h=g.value;l=_.v(h);m=l.next().value;p=n=l.next().value;q=m;t=_.Hn(p.mimeType,p.codecs);if(q===e.TEXT){BF(d,t);A.C(4);break}u=new Map;u.set(q,t);_.av(t)&&b&&!p.aesEncrypted||!_.sn(t,q)||!(y=_.sn(t))||(B=y(),d.w[q]=B,u=B.demuxMimeTypes(q,t),c&&u["delete"](e.AUDIO));return _.x(A,yF(d,u),7);case 7:d.O=
|
|
305
|
+
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),A.C(3)}})};_.r.Xb=function(a){return a===_.Fn?this.f.Xb():(a=DF(this,a))?a.Xb():null};_.r.Ra=function(a){return a===_.Fn?this.f.Ra():(a=DF(this,a))?a.Ra():null};_.r.Oc=function(a,b,c){return a===_.Fn?this.f.Oc(b):(a=DF(this,a))?a.Oc(b,!1,c):!1};_.r.Sa=function(a,b){if(a===_.Fn)return this.f.Sa(b);var c=DF(this,a);return c?c.Sa(b):0};
|
|
306
|
+
_.r.remove=function(a,b,c){var d=this;return a===_.Fn?this.f.remove(b,c):zF(this,a,this.wj.bind(this,a,b,c)).then(function(){if(a===_.Ng){var e=d.Xb(a),f=d.Ra(a);null!==e&&null!==f&&fD(d.D,e,f)}else a===_.Oc&&(e=d.D,e.player&&e.player.trigger(new _.Q(_.Uc)))})};_.r.clear=function(a){if(a===_.Fn){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return zF(this,a,this.wj.bind(this,a,0,this.o.duration))};
|
|
307
|
+
_.r.flush=function(a){return a===_.Fn?Promise.resolve():zF(this,a,this.di.bind(this,a))};_.r.endOfStream=function(a){var b=this;return MF(this,function(){CF(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.lg=function(a,b){this.g.debug("Appending data to "+a+AB);try{this.a[a].appendBuffer(b)}catch(c){throw this.g.warn("Failed to append data for "+a,c),c;}this.g.debug("Done Appending data to "+a+AB)};
|
|
308
|
+
_.r.wj=function(a,b,c){if(c<=b)this.Sc(a);else{this.g.debug("Removing data from "+a+" range:",b,c);try{this.a[a].remove(b,c)}catch(d){throw this.g.warn("Failed to remove data from "+a+" buffer. Range:",b,c,d),d;}this.g.debug("Done Removing data from "+a+" range:",b,c)}};
|
|
309
|
+
_.r.Xj=function(a){try{this.g.debug("Aborting operations for "+a+AB);var b=this.a[a].appendWindowStart,c=this.a[a].appendWindowEnd;this.a[a].abort();this.a[a].appendWindowStart=b;this.a[a].appendWindowEnd=c}catch(d){throw this.g.warn("Failed to abort operations for "+a+AB,d),d;}this.g.debug("Done Aborting operations for "+a+AB);this.Sc(a)};
|
|
310
|
+
_.r.di=function(a){try{this.j.readyState>HTMLMediaElement.HAVE_NOTHING?(this.g.debug("Flushing buffer for "+a),this.j.currentTime-=.001):this.g.warn("Skip buffer flush for "+a+" with element state: "+this.j.readyState)}catch(b){throw this.g.warn("Failed to flush buffer for "+a,b),b;}this.g.debug("Done Flushing buffer for "+a);this.Sc(a)};
|
|
311
|
+
_.r.Cj=function(a,b){0>b&&(b+=.001);try{this.g.debug("Setting timestamp offset for "+a,b),this.a[a].timestampOffset=b}catch(c){throw this.g.warn("Failed to set timestamp offset for "+a,b,c),c;}this.g.debug("Done Setting timestamp offset for "+a,b);this.Sc(a)};
|
|
312
|
+
_.r.zo=function(a,b,c){try{this.g.debug("Setting append window for "+a,b,c),this.a[a].appendWindowStart=0,this.a[a].appendWindowEnd=c,this.a[a].appendWindowStart=b}catch(d){throw this.g.warn("Failed to set append window for "+a,b,c,d),d;}this.g.debug("Done Setting append window for "+a,b,c);this.Sc(a)};_.r.gl=function(a){this.h[a][0].p.reject(new _.N(_.O,3,3014,{mediaError:this.j.error?this.j.error.code:0}))};
|
|
313
|
+
_.r.Sc=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),PF(this,a))};_.r.getTextDisplayer=function(){return this.B};var vF=window.URL.createObjectURL;_.r=_.gG.prototype;_.r.stop=function(){this.A=null;this.l=!1;this.f=[];this.o=1;this.h=null;this.D=!1};_.r.init=function(a){this.A=a};
|
|
314
|
+
_.r.chooseTrack=function(){var a=hG(this,!this.D&&this.a.initialRestrictions?this.a.initialRestrictions:this.a.restrictions,this.f),b=this.getBandwidthEstimate();this.f.length&&!a.length&&(this.g.warn("No tracks met the ABR restrictions. Choosing a track by lowest bandwidth."),a=hG(this,null,this.f),a=[a[0]]);this.h=Date.now();this.D=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],h=isNaN(this.o)||0===this.o?1:Math.abs(this.o),l=h*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
315
315
|
g=h*(g?g.bandwidth:Infinity)/this.a.bandwidthUpgradeTarget;this.g.debug("Bandwidth ranges:",(l/1E6).toFixed(3),(m/1E6).toFixed(3),(g/1E6).toFixed(3));b>=m&&b<=g&&(d=f)}return d||a[0]||this.f[0]};_.r.enable=function(){this.l=!0};_.r.disable=function(){this.l=!1};
|
|
316
|
-
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);
|
|
317
|
-
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.r.playbackRateChanged=function(a){this.o=a};_.r.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=
|
|
318
|
-
_.r.setTracks=function(a){this.f=a};_.r.setCmsdManager=function(a){this.j=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.B=!1;this.w=new
|
|
319
|
-
|
|
320
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
321
|
-
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.
|
|
322
|
-
_.r.resume=function(){if(!
|
|
323
|
-
_.r.
|
|
324
|
-
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.rb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.
|
|
325
|
-
_.r.
|
|
326
|
-
_.r.
|
|
327
|
-
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
328
|
-
_.r.getBufferInfo=function(a){if(this.L){var b=
|
|
329
|
-
_.r.seek=function(a,b){if(this.
|
|
330
|
-
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,_.
|
|
331
|
-
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.
|
|
332
|
-
case 6:f=y.f;b.da=f.map(function(B){return B.parser}).filter(function(B){return null!=B});g=f.filter(function(B){return B.manifest.presentationTimeline.isLive()});h=g[0];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===_.Ub)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 _.
|
|
333
|
-
null,0,m);p=f.map(function(B){return
|
|
334
|
-
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
335
|
-
_.r.
|
|
336
|
-
_.r.load=function(a){return
|
|
337
|
-
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
338
|
-
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===
|
|
339
|
-
_.r.
|
|
340
|
-
_.r.
|
|
341
|
-
_.r.getStats=function(){if(this.H!==
|
|
342
|
-
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?
|
|
343
|
-
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,u,y;return _.I(function(B){if(1==B.a){if(g.H!==
|
|
344
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(A){return 1===A?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
345
|
-
2)}if(y=_.
|
|
346
|
-
_.r.
|
|
347
|
-
_.r.
|
|
348
|
-
_.r.
|
|
349
|
-
|
|
350
|
-
_.r.
|
|
351
|
-
_.x(p,b
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.
|
|
355
|
-
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.v(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;
|
|
356
|
-
_.
|
|
357
|
-
_.
|
|
316
|
+
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);wE(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.B){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.B=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
317
|
+
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.chooseTrack(),d=this.getBandwidthEstimate();this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(d/1E3)+" kbps");c&&this.A(c)}};_.r.playbackRateChanged=function(a){this.o=a};_.r.getBandwidthEstimate=function(){if(this.j&&this.a.useCmsd){var a=pC(this.j,_.le);a=null==a?null:a;if(null!==a)return this.g.debug("Using CMSD estimatedThroughputKbps:",a),1E3*a}return this.w.getBandwidthEstimate(this.a.defaultBandwidthEstimate)};
|
|
318
|
+
_.r.setTracks=function(a){this.f=a};_.r.setCmsdManager=function(a){this.j=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.B=!1;this.w=new vE;var a=this.chooseTrack();a&&this.A(a)};lG.prototype.clear=function(){this.a.clear()};nG.prototype.add=function(a,b){var c=void 0===b?!0:b;if(qG(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Mh("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};nG.prototype.values=function(){return this.a.values()};sG.prototype.create=function(a){var b=this,c=this.a===_.bg&&ZC(),d=a.filter(function(e){return qG(b.f,e,!c)});return d.length?new nG(d[0],d):this.h.create(a)};
|
|
319
|
+
rG.prototype.create=function(a){var b=tG(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=uG(a,this.a);0<c.length?(a=c,b=!0):_.Mh("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=RF(a,this.f),b.length?a=b:_.Mh("No exact match for the channel count could be found."));b=vG(a,this.l);b.length?a=b:_.Mh("No exact match for spatial audio could be found.");b=this.h===_.bg&&ZC();c=new nG(a[0]);a=_.v(a);
|
|
320
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};yG.prototype.getState=function(){return this.a};var xG=0,wG=1;AG.prototype.release=function(){this.f.release()};BG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};BG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=gD(c,a)||c[0];b!==a&&this.f(a);this.a=a};DG.prototype.getConfiguration=function(){return this.j};DG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};DG.prototype.set=function(a,b){this.h=a;HG(this,b)};var KG=new _.br(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])});_.r=_.NG.prototype;_.r.destroy=function(){var a=this,b,c,d,e;return _.I(function(f){if(1==f.a){b=[];c=_.v(a.a.values());for(d=c.next();!d.done;d=c.next())e=d.value,YG(e),b.push(ZG(e));return _.x(f,Promise.all(b),2)}a.a.clear();a.o.clear();a.F=null;a.j=null;a.H=null;a.B.clear();a.h=null;a.f=!0;_.z(f)})};
|
|
321
|
+
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.F.Ab();c=gD(a.j.periods,b+_.nw);if(!c)throw new _.N(_.O,5,5006,"No period found.");d=a.F.zg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.N(_.O,5,5005,"No streams chosen.");a.I=!d.video&&!d.audio&&!!d.text;a.A=!!d.ab;return _.x(e,hH(a,d,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.F.zn&&a.F.zn();_.z(e)})};
|
|
322
|
+
_.r.resume=function(){if(!qH(this))for(var a=_.v(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,WG(this,b,0)};
|
|
323
|
+
_.r.gc=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=nH(a);if(a.Db||null==a.rb||a.Fc)return m["return"]();a.rb=null;if(!a.mc){m.C(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,sH(b,a,a.Sf,a.ef),3);case 3:return m["return"]();case 2:_.F(m,4);d=EH(b,a);null!=d&&(WG(b,a,d),a.wd=!1);_.G(m,5);break;case 4:return e=_.H(m),_.x(m,PH(b,e),6);case 6:return m["return"]();case 5:VH(b,a);if(!rH(b)){m.C(0);break}if(b.F.configuration.Nm){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
324
|
+
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())h=g.value,h.rb=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.F.X.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.F.X.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.F.Vi();_.z(m)}})};
|
|
325
|
+
_.r.Xn=function(a,b,c,d){var e=rC(d.reader),f=rC(d.reader),g=_.lq(d.reader),h=_.lq(d.reader),l=_.lq(d.reader),m=_.lq(d.reader);d=_.pq(d.reader,d.reader.Va()-d.reader.getPosition());a=a.startTime+b.startTime+h/g;if(c.includes(e))if("urn:mpeg:dash:event:2012"===e)this.F.$i();else this.F.onEvent(new _.Q("emsg",{detail:{startTime:a,endTime:a+l/g,schemeIdUri:e,value:f,timescale:g,presentationTimeDelta:h,eventDuration:l,id:m,messageData:d}}))};
|
|
326
|
+
_.r.Zo=function(a){var b=this,c=!1,d=0;(new _.qq).M(_.Pe,_.rq).M(_.yg,_.rq).M(_.Ke,_.rq).M(_.Oe,_.rq).M(_.gg,_.rq).ba(_.ig,_.sq).M("encv",function(e){e.reader.skip(78);_.rq(e)}).M("pasp",function(e){d=e.start+e.headerSize;var f=_.lq(e.reader),g=_.lq(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 _.dq(new DataView(a.data)),a.seek(d),_.W(a,1),_.W(a,1))};_.w(dI,_.Ut);_.r=dI.prototype;_.r.init=function(a,b){var c=a.getMedia();_.Ut.prototype.init.call(this,a,b);rI(this,c)};_.r.namespace=function(){return YB};_.r.setSeekInterceptor=function(a){this.ih=a||null};_.r.setPlaybackSessionId=function(a){this.ee=a};_.r.Th=function(){return new WE};_.r.getState=function(){return this.gb};_.r.getDrmInfo=function(){return this.A?this.A.getDrmInfo():null};
|
|
327
|
+
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){eF(a,!1);a.ve=!1;if(!a.ca)return c["return"]();a.log.debug("Unload player with source",a.ca);(b=a.getTrackManager())&&b.release();return a.H===JI?c["return"]():_.x(c,tI(a),2)}a.ca=null;a.fh=0;a.Jb=null;a.ka=null;a.getNetworkEngine().headers["delete"](UB);_.z(c)})};_.r.release=function(){var a=this;return _.I(function(b){if(a.ja)return b["return"](a.ja);a.ja=gI(a);a.ja["finally"](function(){a.ja=null});return b["return"](a.ja)})};
|
|
328
|
+
_.r.getBufferInfo=function(a){if(this.L){var b=EF(this.L),c=new _.ci(void 0,a);switch(a){case _.dt:return b.video?b.video:c;case _.X:return b.audio?b.audio:c;case _.ct:return b.text?b.text:c}return b.total?b.total:c}return this.gd?(b=bD(this.gd),AC(b,a)):_.Ut.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.we,b=this.getMediaPosition();a.a&&(a=a.a,b-=a.f,b=0>b?0:b>a.a?a.a:b);return b};_.r.getMediaPosition=function(){return this.B?this.B.getTime():_.Ut.prototype.getMediaPosition.call(this)};
|
|
329
|
+
_.r.seek=function(a,b){if(this.ih&&!this.ih(a,b))return Promise.resolve();var c=this.we;c=c.a?a+c.a.ac():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Ut.prototype.seek.call(this,c)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.we,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
330
|
+
_.r.getMediaDuration=function(){return this.f?this.f.presentationTimeline.getDuration():Infinity};_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,_.Ut.prototype.destroy.call(a),2);if(a.H===JI)return b["return"]();a.log.debug("Destroying player...");a.H=JI;qI(a);a.o&&(a.o.release(),a.o=null);a.ge=null;a.h=null;_.z(b)})};_.r.getTimeline=function(){return this.ge};
|
|
331
|
+
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,h,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.lm,b.w.a=c,_.F(y,2),oI(b),b.U=_.pb,_.x(y,wI(b),4);case 4:return kG(b.w,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ca=_.Un(d),b.configuration=_.Qn([b.Ja,d]),b.log.info("Loading playlist configurations",a),b.ge=jI(b.configuration),_.x(y,xI(b,c),5);case 5:return kG(b.w,c),e=a.map(function(B){return yI(b,B,0,null,!0)}),_.x(y,Promise.all(e),6);
|
|
332
|
+
case 6:f=y.f;b.da=f.map(function(B){return B.parser}).filter(function(B){return null!=B});g=f.filter(function(B){return B.manifest.presentationTimeline.isLive()});h=g[0];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===_.Ub)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 _.wD({version:2},
|
|
333
|
+
null,0,m);p=f.map(function(B){return PE(B.manifest)});q=SE(p,n);b.f=q;t=b;return _.x(y,zI(b,q,b.configuration),7);case 7:return t.A=y.f,kG(b.w,c),_.x(y,AI(b,c),8);case 8:kG(b.w,c);lH(b.a,q);lI(b,q);c.resolve();_.G(y,0);break;case 2:return u=_.H(y),_.x(y,hI(b),9);case 9:BI(b,u,c),_.z(y)}})};
|
|
334
|
+
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){oI(b);if(b.U!==_.pb)throw new _.N(_.O,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,II(b,a),2)}c=d.f;b.f=c.manifest;c.parser&&b.da.push(c.parser);lH(b.a,c.manifest);rH(b.a)&&b.a.resume();lI(b,c.manifest);_.z(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
335
|
+
_.r.Gh=function(){var a=this;return _.I(function(b){oI(a);if(!a.Jf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Jf);a.Jf=null;return _.x(b,AI(a,null),0)})};_.r.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return oI(b),_.jn("preload.start"),b.log.info("Preloading asset",a),_.x(c,CI(b,a,!1),2);b.Jf=a;b.log.info("Preloaded asset",a);_.jn("preload.end");_.ln("preload","preload.start","preload.end");_.z(c)})};
|
|
336
|
+
_.r.load=function(a){return CI(this,a)};_.r.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,pI(a),2);a.configuration=a.Ja;qI(a);_.z(b)})};_.r.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};_.r.dj=function(){this.log.debug("User seeking finished");this.J&&cJ(this);yJ(this)};
|
|
337
|
+
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:xD(b),end:HD(b)}}b=this.we;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.Kc=function(){return this.f?this.f.presentationTimeline.Kc():null};_.r.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
338
|
+
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===cI){if(_.jj()){this.log.warn("Pausing and unpausing to mitigate playbackRate platform issue.");var c=this.getSurface().getMedia();c.pause();this.I.set(a,b);c.play()}else this.I.set(a,b);(c=this.I.getConfiguration())&&c.preferTrickPlayTracks&&cH(this.a,1<Math.abs(a));this.h.playbackRateChanged(a)}};
|
|
339
|
+
_.r.ud=function(){if(!this.f||!this.B)return[];for(var a=ZJ(this),b=YJ(this),c=[],d=_.v(WJ(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=bG(e);f.af=e.video===a;f.$e=e.audio===b;c.push(f)}return c};
|
|
340
|
+
_.r.pa=function(){if(this.f&&this.B){var a=mF(this);if(null==a)a=null;else{if(!nF(this.l,a).text){var b=_.fG(a.textStreams,this.ce,this.xf,this.Yd);b.length&&(b=b[0],nF(this.l,a).text=b)}a=nF(this.l,a).text}b=[];for(var c=_.v(XJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=cG(d);e.bg=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
|
|
341
|
+
_.r.getStats=function(){if(this.H!==cI)return _.fu();yJ(this);var a=this.j;if(a.getVideoPlaybackQuality){a=a.getVideoPlaybackQuality();var b=this.G,c=Number(a.totalVideoFrames);b.o=Number(a.droppedVideoFrames);b.l=c}if(this.H===cI){(b=mF(this))?(a=nF(this.l,b).video,b=nF(this.l,b).audio,a=((a?a.bandwidth:0)||0)+((b?b.bandwidth:0)||0)):a=null;a&&(this.G.w=a);if(a=ZJ(this))b=this.G,c=a.height||NaN,b.A=a.width||NaN,b.j=c;a=this.h.getBandwidthEstimate();this.G.h=a}return this.G.getStats()};
|
|
342
|
+
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?OD(this.K,KJ(this)):[]};_.r.resetAbr=function(){this.h&&this.h.reset()};_.r.he=function(){return this.h};
|
|
343
|
+
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,h,l,m,n,p,q,t,u,y;return _.I(function(B){if(1==B.a){if(g.H!==cI)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");h=mF(g);l=_.uu;m=g.f.periods.indexOf(h);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-h.startTime;if(Infinity===q)throw new _.N(1,4,4040);t=new _.Up(1,0,q,function(){return[a]},0,null,0);u={id:g.jh++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
344
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(A){return 1===A?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.bC,initSegmentReference:null,mimeType:d,codecs:e||"",kind:c,encrypted:!1,keyId:null,language:b,originalLanguage:b,label:f||null,type:l.TEXT,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:null,spatialAudio:!1,closedCaptions:null};g.Gf.add(u);h.textStreams.push(u);return _.x(B,XG(g.a,u),
|
|
345
|
+
2)}if(y=_.QG(g.a,_.Fn))nF(g.l,h).text=y;g.Gf["delete"](u);g.log.debug("Choosing new streams after adding a text stream");RJ(g,h);OI(g);return B["return"](cG(u))})};
|
|
346
|
+
_.r.fl=function(a){this.log.debug(_.fC,a.id);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=UJ(this,a);this.log.debug("onChooseStreams_, chose video ",b.video);this.log.debug("onChooseStreams_, chose audio ",b.audio);this.log.debug("onChooseStreams_, chose text ",b.text);return b}catch(c){return this.onError(c),{audio:null,video:null,text:null,ab:null}}};
|
|
347
|
+
_.r.qn=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.log.debug("onCanSwitch_");a.configuration.abr.enabled&&a.h.enable();if(!a.za){b.C(2);break}return _.x(b,dH(a.a,a.za,a.Mj,a.Lj),3);case 3:a.za=null;case 2:if(!a.fa){b.C(0);break}return _.x(b,_.jH(a.a,a.fa),5);case 5:a.fa=null,_.z(b)}})};_.r.Yo=function(){var a=mF(this);a&&a.parser&&a.parser.update()};_.r.Mn=function(){this.B&&this.B.j.Ef()};
|
|
348
|
+
_.r.hk=function(a,b,c){if((void 0===c?"":c)===dC)return OI(this),this.xa()||(this.configuration.abr.enabled=!0,this.h.enable()),RJ(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===_.Oc&&(h=h&&l.language===a.language));return h})&&this.xa()){for(var d=_.v(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)}OI(this);this.xa()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
349
|
+
RJ(this,b)}return c};_.r.xn=function(){this.log.debug("endOfStream called by streaming engine");this.ve=!0};_.r.onError=function(a){if(this.H!==JI&&7001!==a.code&&7E3!==a.code){var b=new _.Q(_.ke,{detail:a});a.severity===_.O&&fI(this,_.Ko);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.kg=function(a){a.type===_.be?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Wg?KI(this):"emsg"!==a.type&&(a instanceof _.Q?this.dispatchEvent(a):this.log.debug(_.Ob,a.type)))};_.r.xa=function(){return this.configuration.abr.enabled};
|
|
350
|
+
_.r.No=function(a){var b=this,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.dd)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.xa();return _.x(p,b.dd(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.M.ra(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.x(p,tH(b.a),3);case 3:g=ZJ(b),h=YJ(b);case 4:return l=!1,_.F(p,7),b.log.info("Switching CDN to "+f.url+"."),_.x(p,$J(b,f,g,h),9);case 9:_.G(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
|
|
351
|
+
_.x(p,b.dd(f.url,a),10);case 10:if(n=p.f)f.url=n,l=!0;else throw m;case 6:l?p.C(4):(d&&b.h.enable(),pH(b.a,!0),b.ca[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.Q(_.fd,{newManifest:f.url})),_.z(p))}})};var JI=0,bI=1,cI=2,NI=[_.cf,_.ve];aK.prototype.a=function(){return YB};
|
|
352
|
+
aK.prototype.canPlay=function(a,b){if(_.nj())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 _.bw||_.Dn(a.url)in _.cw?!0:!1:!1;if(d&&e){if(_.jj(2))return 1;if(_.oj()&&c===_.Vl){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Mh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
353
|
+
aK.prototype.f=function(a){return a===_.pa||a===_.pb};aK.prototype.create=function(){return new dI};_.w(gK,_.Vv);_.r=gK.prototype;
|
|
354
|
+
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Mh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.R.Wg(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.hd}catch(g){f.align="middle"}e.writingMode===_.Lg?f.vertical="lr":e.writingMode===_.Mg&&(f.vertical="rl");e=f}e&&c.push(e)}var c=[],d=_.v(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?
|
|
355
|
+
e.startTime-f.startTime:e.endTime!==f.endTime?e.endTime-f.startTime:c.indexOf(f)-c.indexOf(e)});d=_.v(a);for(a=d.next();!a.done;a=d.next())this.a.addCue(a.value)};_.r.remove=function(a,b){if(!this.a)return!1;hK(this.a,function(c){return c.startTime<b&&c.endTime>a});return!0};_.r.isTextVisible=function(){return this.a.mode===_.Yf};_.r.setTextVisibility=function(a){null!==this.a&&(this.a.mode=a?_.Yf:_.qe)};_.r.destroy=function(){this.a&&hK(this.a,function(){return!0});this.a=null;return Promise.resolve()};iK.prototype.a=function(){return!0};iK.prototype.create=function(a){return new gK(a)};_.Wh(new aK);_.Xt("single-native",new iK);
|
|
356
|
+
_.gn(function(){_.Rh("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Qh("Patching Chromecast MSE bugs."),fK();else if(_.oj()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;dK();10>=a?(_.Qh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Qh("Patching Safari 11 \x26 12 MSE bugs."),bK(),cK()):(_.Qh("Patching Safari 13 MSE bugs."),bK())}else _.jj(2)||_.jj(3)||
|
|
357
|
+
_.jj(4)?eK():_.Qh("Using native MSE as-is.");else _.Qh("No MSE implementation available.")});};
|
|
358
358
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
359
359
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
360
360
|
else{_=this.clpp._;(f.call(g,this));}
|