@castlabs/prestoplay 6.34.0-beta.1 → 6.35.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +601 -597
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +100 -100
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +26 -26
- package/cjs/cl.hls.js +76 -76
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +26 -26
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -352
- 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 +5 -5
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +3 -3
- package/cjs/cl.youbora.js +39 -39
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -14
- package/cl.cast.js +98 -98
- package/cl.conviva.js +28 -27
- package/cl.core.js +477 -473
- package/cl.crypto.js +8 -8
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +20 -20
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +299 -301
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +5 -5
- 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 +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- 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 +24 -125
package/cjs/cl.mse.js
CHANGED
|
@@ -1,369 +1,368 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
uC=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,k=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.Md;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())?wC(g):void 0;f=1E3*f().Xa(k());k=["a","v","av"].includes(q)?f:void 0;var A=!1;!a.f||"v"!==q&&"av"!==q||(A=!0,a.f=!1);n=xC(n,q);if(p&&t&&p!==t){var D=p.Ia()[0],
|
|
2
|
+
var f=function(window){var vB,wB,xB,yB,zB,AB,BB,CB,DB,FB,GB,HB,IB,KB,LB,MB,NB,PB,QB,RB,SB,TB,UB,VB,WB,YB,aC,bC,dC,eC,fC,gC,hC,iC,kC,mC,nC,sC,tC,uC,vC,wC,xC,yC,AC,EC,FC,GC,HC,IC,KC,LC,NC,MC,PC,OC,QC,SC,TC,VC,WC,XC,ZC,$C,aD,bD,cD,dD,eD,fD,hD,mD,nD,oD,pD,rD,xD,CD,FD,uD,ED,GD,HD,ID,JD,KD,LD,MD,ND,OD,PD,RD,TD,UD,VD,SD,XD,WD,YD,ZD,bE,cE,aE,$D,dE,hE,gE,iE,fE,eE,kE,jE,lE,mE,nE,qE,rE,uE,vE,xE,yE,wE,zE,CE,AE,BE,DE,EE,FE,GE,HE,IE,JE,LE,ME,NE,PE,QE,OE,RE,SE,TE,UE,VE,WE,XE,YE,ZE,aF,dF,eF,iF,gF,hF,mF,lF,nF,rF,pF,tF,vF,uF,xF,yF,zF,BF,
|
|
3
|
+
AF,CF,DF,EF,FF,IF,HF,KF,wF,LF,JF,MF,GF,SF,TF,PF,NF,QF,RF,UF,VF,YF,XF,ZF,$F,aG,OF,bG,WF,eG,hG,gG,fG,iG,jG,lG,kG,mG,kF,nG,oG,rG,pG,qG,tG,sG,uG,vG,wG,zG,BG,AG,CG,DG,EG,FG,IG,HG,GG,KG,JG,MG,QG,SG,TG,YG,aH,bH,dH,eH,gH,hH,jH,nH,mH,NG,oH,rH,sH,tH,vH,wH,cH,AH,fH,iH,WG,DH,CH,UG,lH,GH,EH,yH,zH,IH,HH,FH,PH,QH,KH,SH,UH,MH,WH,VH,NH,OH,XH,VG,xH,YH,ZH,LH,TH,bI,aI,$H,uH,XG,ZG,PG,JH,$G,BH,RH,pH,qH,cI,fI,gI,hI,iI,jI,kI,nI,oI,mI,uI,vI,DI,wI,lI,CI,EI,xI,yI,zI,JI,FI,sI,rI,qI,tI,HI,II,AI,BI,UI,SI,NI,XI,YI,ZI,dJ,aJ,cF,
|
|
4
|
+
$E,IJ,HJ,fF,bF,kJ,KJ,jJ,JJ,hJ,LJ,TI,MJ,RI,cJ,GJ,iJ,OJ,bJ,fJ,LI,eJ,QI,QJ,PJ,RJ,SJ,VJ,WI,PI,UJ,TJ,GI,NJ,XJ,YJ,jF,ZJ,$J,WJ,pI,aK,MI,$I,VI,bK,cK,dK,eK,fK,gK,hK,iK,jK,oC;vB=" buffer";wB=" is being or has been set up";xB=" seconds";yB="\x3c/DATA\x3e\x3c/WRMHEADER\x3e";zB="\x3c/LA_URL\x3e";AB="\x3cLA_URL\x3e";BB='\x3cWRMHEADER xmlns\x3d"http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version\x3d"';CB="Cannot get segment, period ID unknown";DB="Choosing new streams after key status change";
|
|
5
|
+
_.EB="Could not load text stream with id: ";FB="IterateSegmentReference";GB="Jumping forward";HB="MediaSource threw QuotaExceededError:";IB="Period not found.";_.JB="Player is in ERROR state and can not switch to ";KB="PrestoPlay TextTrack";LB="Removing audio from variant - audio not compatible with platform";MB="Setting playback rate to\x3d";NB="URI-REPLACEMENT";_.OB="Updating manifest...";PB="X-Playback-Session-Id";QB="bufferBehind\x3d";RB="bufferedBehind\x3d";SB="cannot find segment";TB="clpp.mse.Player";
|
|
6
|
+
UB="content-steering-change";VB="content-steering-location-ban-update";WB="currentPeriod.startTime\x3d";_.XB="dashif:Laurl";YB="fetching init segment";_.ZB="getSegmentNextReference";_.$B="iterateSegmentReference";aC="key-restriction";bC="manifest.start";_.cC="onChooseStreams_ period";dC="presentationTime:";eC="presentationTime\x3d";fC="reference.endTime\x3d";gC="reference.position\x3d";hC="reference.startTime\x3d";iC="single-native";_.jC="subtitles";kC="switch: Stream ";
|
|
7
|
+
_.lC=function(a,b){return _.gh[a]=b};mC=function(a,b){a.a=a.a.filter(function(c){return c!==b})};nC=function(a){for(var b=a.a+a.f.byteOffset,c=void 0;_.Mn(a);)if(0===_.On(a)){c=a.a+a.f.byteOffset-1;break}a=a.f.buffer.slice(b,c);return _.S.ga(a)};_.pC=function(a){var b=new Uint8Array(oC),c=4+b.byteLength+a.j.byteLength+4+a.f.byteLength,d=new _.In(c,!1);_.V(d,c);_.Kn(d,b);_.Kn(d,a.j);_.V(d,a.f.byteLength);_.Kn(d,a.f);return _.Wi(d.buffer)};
|
|
8
|
+
_.qC=function(a,b,c,d){var e=_.Ll(b);if(8!==e.byteLength)e="";else{var f=_.mp(e);e=_.Il(f);b:switch(f=f.byteLength,_.Ph("Trying to create PlayReady header in version",a),a){case "4.0.0.0":e=[BB+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?AB+d+zB:"",yB].join("");break b;case "4.1.0.0":e=[BB+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?AB+d+zB:"",yB].join("");break b;case "4.2.0.0":case "4.3.0.0":e=[BB+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?AB+d+zB:"",yB].join("");break b;default:_.Kh("Cannot create PlayReady header in version",a),e=""}}if(!e)return null;_.Ph("New payload",e);e=_.Wi(_.S.eg(e,!0));return new _.ip(_.np,
|
|
10
|
+
b,d||null,e,a,c)};_.rC=function(a,b){return b===a.version?a:_.qC(b,a.a,a.l||void 0,a.h||void 0)};sC=function(a,b){if(_.si("Edge/"))return!0;b=b.toLowerCase();if(_.ti()&&b.includes('codecs\x3d"ac-3"')){var c=b.replace("ac-3",_.ge);return a.K.has(b)||a.K.has(c)}return a.K.has(b)};
|
|
11
|
+
tC=function(a,b){var c=b.audio,d=b.video;if(c&&c.encrypted&&(c=_.$p(c),!sC(a,c))||d&&d.encrypted&&(d=_.$p(d),!sC(a,d)))return!1;var e=a.keySystem();return 0===b.drmInfos.length||b.drmInfos.some(function(f){return f.keySystem===e})};uC=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}))};vC=function(a,b){if(null==a.a)return null;var c=a.a[a.a.length-1];return c?c[b]:null};
|
|
12
|
+
wC=function(a){a=vC(a,_.Ew);return null==a?null:a};xC=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.kc()+d.getDuration();)c+=1,d=a.a[c]||null;a.f=d?c:a.a.length-1}else a.f=-1};yC=function(a){return 1001===a||1002===a||1003===a};_.zC=function(a,b){return a.concat(b)};AC=function(){};_.BC=function(a,b){return 0===b.length?a:a.map(function(c){return b.map(function(d){return _.hk(d,c)})}).reduce(_.zC,[])};
|
|
13
|
+
_.CC=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:b||[],keyIds:[],periodId:c?c:null}};_.DC=function(a,b,c,d,e,f,g){f=void 0===f?function(){return""}:f;this.Ia=a;this.la=b;this.fa=c;this.keyInfo=d||null;this.Fd=_.N.R(e)?!1:!!e;this.Kd=f?f:function(){return""};this.Oa=g};
|
|
14
|
+
EC=function(a){return a.language?_.Ik(a.language):a.audio&&a.audio.language?_.Ik(a.audio.language):a.video&&a.video.language?_.Ik(a.video.language):_.zg};FC=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};GC=function(a,b){var c=_.Hm(b,a);if(!c)return!1;c=c();var d=c.isMuxed(a,b);c.destroy();return d};
|
|
15
|
+
HC=function(a){function b(d,e){null!=d&&c.push(e+'\x3d"'+String(d).trim()+'"')}var c=[a.mimeType];b(a.codecs,_.Cd);b(a.frameRate,"framerate");b(a.bandwidth,"bitrate");b(a.width,_.ah);b(a.height,_.qe);b(a.channelsCount,"channels");return c.join(";").replace(/\s/g,"")};IC=function(a){return a.split(",").map(function(b){return b.trim()}).filter(function(b){return 0<b.length})};
|
|
16
|
+
_.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(",")};KC=function(a,b){var c=_.JC(_.Km(a)),d=_.Jm(a),e=_.JC(_.Km(b));return d===_.Jm(b)&&c===e};
|
|
17
|
+
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,qq:c,rq:c},e=["nor","nrr","sid","cid"],f=["ot","sf","st"],g=["mtp"],k={},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);
|
|
18
|
+
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===_.bd&&(u=t?""+q:"");u&&n.push(u)}}0<n.length&&(k[m]=n.join(","))}return k};NC=function(a,b,c){this.h=a;this.a=b;this.g=new _.L("clpp.net.CmcdManager");this.j=MC(this);this.h.a.push(this.j);this.l=c;this.f=!1};
|
|
19
|
+
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,k=d.getMediaPosition,l=d.getPlaybackRate,m=d.getPlayerState,n=d.Md;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().Za(k());k=["a","v","av"].includes(q)?f:void 0;var A=!1;!a.f||"v"!==q&&"av"!==q||(A=!0,a.f=!1);n=PC(n,q);if(p&&t&&p!==t){var D=p.Ia()[0],
|
|
21
20
|
B=t.Ia()[0];var E=new URL(B);D=new URL(D);if(E.origin!==D.origin)E=B;else{B=E.pathname.split("/").slice(1);for(D=D.pathname.split("/").slice(1,-1);B[0]===D[0];)B.shift(),D.shift();for(;D.length;)D.shift(),B.unshift("..");E=B.join("/")+E.search+E.hash}}else E=void 0;p&&t&&(t.la||t.fa)&&(p.la!==t.la||p.fa!==t.fa)?(B=t.la+"-",t.fa&&(B+=t.fa),t=B):t=void 0;a:{if(p&&d&&(B=d.bandwidth)){B=B*(p.endTime-p.startTime)/1E3/((f/1E3||500)/(y||1)/1E3);B=a.a.rtpMultiplier?B*a.a.rtpMultiplier:B;break a}B=void 0}(D=
|
|
22
|
-
a.a.contentId)&&64<D.length&&(a.g.warn("CMCD contentId: "+D+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),D=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},k&&{bl:k},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:6===m},D&&{cid:D},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:A},B&&{rtp:B});if("query"===a.a.deliveryMode){if(d=
|
|
23
|
-
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.
|
|
24
|
-
|
|
25
|
-
_.
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
a.a.contentId)&&64<D.length&&(a.g.warn("CMCD contentId: "+D+" is longer than 64 characters,\n it will be ignored.\n Refer to the CMCD spec for more details."),D=void 0);d=Object.assign({},d&&{br:d.bandwidth},p&&{d:p.endTime-p.startTime},q&&{ot:q},n&&{tb:n},k&&{bl:k},{dl:f/y},e&&{mtp:e/1E3},E&&{nor:E},t&&{nrr:t},{su:6===m},D&&{cid:D},1!==l&&{pr:l},g&&{sf:g},{sid:a.a.sessionId},u&&{st:u},1!==a.a.version&&{v:a.a.version},{bs:A},B&&{rtp:B});if("query"===a.a.deliveryMode){if(d=LC(d),
|
|
22
|
+
(d=Object.values(d).join(","))&&b.uris)for(p=0;p<b.uris.length;p++)q=new _.ck(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)}};
|
|
23
|
+
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.pf||void 0;case "v":return c.fg||void 0;default:return c.bandwidth}};OC=function(a){switch(a.type){case _.Jc:return"d";case _.Ym:return"h";case _.Pc:return"s";default:return"o"}};QC=function(a,b){for(var c=new _.on(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};
|
|
24
|
+
_.RC=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};
|
|
25
|
+
SC=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}})};
|
|
26
|
+
TC=function(a){function b(k,l){return new _.RC(void 0===l?_.ea:l,k,{},[],null,g)}function c(k){k=void 0===k?"":k;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(k,m))throw k=a.substring(0,e).split("\n"),Error("Unexpected close tag\nLine: "+(k.length-1)+"\nColumn: "+(k[k.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
27
|
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(k),a.o.get(f).set(k,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
|
-
|
|
53
|
-
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>=
|
|
54
|
-
g),a.B=!0,a.a.currentTime=g)}}}};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.o=(new _.
|
|
58
|
-
|
|
28
|
+
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 _.RC(m,
|
|
29
|
+
null,p,q,n,g))}else m=e,e=a.indexOf("\x3c",e)-1,-2===e&&(e=f),m=SC(a.slice(m,e+1)).trim(),0<m.length&&l.push(b(m)),e++;return l}function d(){for(var k=e;-1==="\r\n\t\x3e/\x3d ".indexOf(a[e])&&a[e];)e++;return a.slice(k,e)}var e=0,f=a.length,g=new Map;return new _.RC("#document",null,{},c(""),null,g)};_.UC=function(){};
|
|
30
|
+
VC=function(a){switch(a){case _.xn:_.Dw.info("Select DOM parser for XML");_.jp=new _.cp;break;case "txml":_.Dw.info("Select TXML parser for XML");_.jp=new _.UC;break;default:_.Dw.warn("XML parser option unknown, using default DOM parser. Option: "+a),_.jp=new _.cp}};WC=function(){return!!window.SourceBuffer&&!!SourceBuffer.prototype&&!!SourceBuffer.prototype.changeType};XC=function(a,b){return a.start-b.start};
|
|
31
|
+
_.YC=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};ZC=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}})};$C=function(a){a.player&&(a.player.off(_.Qf,a.Bd),a.a&&a.player.off(_.ug,a.Bd));a.player=null};aD=function(a){a.player&&a.player.trigger(new _.R(_.Yc))};
|
|
32
|
+
bD=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(_.ug,a.Bd,a),a.a=!0):!b&&a.a&&(a.log.debug("Stop tracking timeupdates"),a.player.off(_.ug,a.Bd),a.a=!1)}};cD=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 _.R(_.Pg))};
|
|
33
|
+
dD=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};eD=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};fD=function(a,b){for(var c=0;c<a.length;c++)if(eD(a[c]).has(b))return c;return-1};
|
|
34
|
+
hD=function(a,b){Array.from(eD(a)).forEach(function(c){c.segmentIndex&&_.gD(c.segmentIndex,b)})};_.iD=function(a){this.h=Math.exp(Math.log(.5)/a);this.f=this.a=0};_.jD=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)};_.kD=function(a){return a.a/(1-Math.pow(a.h,a.f))};
|
|
35
|
+
_.lD=function(a,b,c,d,e,f,g,k){a=_.Wk(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);k&&(a.timescale=k);return a};mD=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};
|
|
36
|
+
nD=function(a,b,c,d){return Promise.resolve().then(function(){if(a.w&&a.h)if(null==c||null==d)a.w.parseInit(_.Wi(b));else{var e={periodStart:a.A,segmentStart:c,segmentEnd:d};e=a.w.parseMedia(_.Wi(b),e);var f=e.cues.filter(function(g){return g.startTime>=a.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)}})};
|
|
37
|
+
oD=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,[])};
|
|
38
|
+
pD=function(a,b,c,d,e){var f=c+" "+d,g=new Map;b=_.v(b);for(var k=b.next();!k.done;k=b.next()){var l=k.value;k=l.stream;g.has(k)||g.set(k,new Map);g.get(k).has(f)||g.get(k).set(f,[]);l.startTime+=e;l.endTime+=e;l.startTime>=a.j&&l.startTime<a.l&&(l=new _.Rj(l.startTime,l.endTime,l.text),g.get(k).get(f).push(l),k===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()),k=b.next();!k.done;k=b.next())k=k.value,l=
|
|
39
|
+
g.get(f).get(k),a.o.get(f).set(k,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))};_.qD=function(a){a=a.toLowerCase();return _.Cv[a]||window.muxjs&&a===_.Ic?!0:!1};rD=function(a){this.a=this.h=0;this.f=a};_.sD=function(a,b,c){a.h=b;a.a=c};
|
|
40
|
+
_.tD=function(a,b,c,d,e,f){f=void 0===f?!1:f;this.j=a;this.G=b;this.K=c;this.A=this.f=Infinity;this.h=1;this.H=0;this.w=this.l=null;this.I=0;this.D=this.o=d;this.M=void 0===e?!0:e;this.g=new _.L("clpp.media.PresentationTimeline");this.P=f;this.L=null;this.a=new rD(d);this.J=null;this.B=this.j.type||null};_.vD=function(a,b){a.L={offsetDateTime:b-uD(a),seekRangeStartDateTime:b}};_.wD=function(a,b){a.o=b;a.D=b;a.a.f=b};xD=function(a){return 2===a.j.version?a.a.f?a.a.a:null:a.o?a.f:a.D?a.w:null};
|
|
41
|
+
_.zD=function(a,b,c){if(0!==b.length){var d=b[0].startTime+c;c=b[b.length-1].endTime+c;b=b.reduce(function(e,f){return Math.max(e,f.endTime-f.startTime)},a.h);_.yD(a,{Gc:d,oc:c,pc:b},"notifySegments")}};_.yD=function(a,b,c){var d=b.Gc;a.l=null==a.l?d:Math.min(a.l,d);a.h=Math.max(a.h,b.pc);_.AD(a,b.oc);null!=a.G&&a.M&&(a.G=(Date.now()+a.I)/1E3-(a.w||0)-a.h);a.g.debug(c+": maxSegmentDuration\x3d"+a.h)};_.AD=function(a,b){a.w=Math.max(a.w||0,b)};
|
|
42
|
+
_.BD=function(a,b){a.h=Math.max(a.h,b);a.g.debug("notifyNewSegmentDuration: maxSegmentDuration\x3d"+a.h)};_.DD=function(a){return 2===a.j.version?a.a.kc():Infinity===a.A?0:Math.max(0,CD(a)-a.A)};CD=function(a){if(2===a.j.version)a=a.a.a;else if(a.o)a=a.f;else if(a.D)a=a.w||0;else{if("startover"===a.B)var b=a.J||0;else b=(Date.now()+a.I)/1E3,b=a.P?Math.max(0,b-(a.h-a.H)-a.G):Math.max(0,b-a.h-a.G);a=Math.min(b,a.f)}return a};
|
|
43
|
+
FD=function(a,b){if(2===a.j.version)return a.a.kc();var c=Math.max(a.l,0);return Infinity===a.A?Math.ceil(1E3*c)/1E3:Math.max(c,Math.min(CD(a)-a.A+b,ED(a)))};uD=function(a){return 2===a.j.version?a.a.kc():FD(a,0)};ED=function(a){var b=a.Ie()&&!a.D?a.K:0;return 2===a.j.version?a.a.a-b:Math.max(0,CD(a)-b)};GD=function(a,b){var c=uD(a);if(b<c)return c;c=ED(a);2===a.j.version&&(c=a.a.a);return b>c?c:b};
|
|
44
|
+
HD=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}};ID=function(){this.f=function(){};this.h=function(){};this.a=new Set};JD=function(a,b,c){a.f=b;a.h=c};
|
|
45
|
+
KD=function(a,b){for(var c=[],d=!1,e={},f=_.v(b),g=f.next();!g.done;e={pd:e.pd},g=f.next())e.pd=g.value,a.a.has(e.pd)||(c.push(e.pd),g=Array.from(a.a.values()).some(function(k){return function(l){return l.id===k.pd.id}}(e)),e.pd.id&&g&&(d=!0));e=a.a.size;a.a.clear();b.forEach(function(k){return a.a.add(k)});f=a.a.size;c.forEach(function(k){return a.f(k)});(d||0<c.length||e!==f)&&a.h()};
|
|
46
|
+
LD=function(a,b){b=void 0===b?!1:b;return Array.from(a.a.values()).map(function(c){return HD(c,b)}).sort(function(c,d){return c.startTime-d.startTime})};MD=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 _.bw("crop",a,d.endTime?d.endTime-a:Infinity,!1))};ND=function(a){var b=a.a.Ci(),c=a.h,d=b?b.id:null;(c?c.id:null)!==d&&b&&a.f(new _.R(_.Tf,{id:d}));a.h=b;"basic"===a.o.timeline&&(a.j.a=b)};
|
|
47
|
+
OD=function(a,b,c){this.h=a;this.a=b;this.f=c;this.g=new _.L("clpp.media.SegmentIterator")};PD=function(a){var b=a.h.get(a.a);if(!b)return null;0<b.a.length&&b.Ia().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};_.QD=function(a){this.a=a;this.g=new _.L("clpp.media.SegmentIndex")};
|
|
48
|
+
RD=function(a,b){var c=a.vf(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 OD(a,c,e)};_.gD=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
|
+
TD=function(a,b){this.h=a;this.l=SD(a);this.a=a.a.currentTime;this.j=Date.now()/1E3;this.o=b;this.f=function(){}};UD=function(a,b){a.f=b};VD=function(a){this.a=a};SD=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
|
+
XD=function(a,b,c,d,e){var f=this;this.a=a;this.H=b;this.h=c;this.G=e;this.j=new _.gi;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,_.Ug,function(){return WD(f)});this.w=(new _.oi(function(){WD(f)})).Rb(.25)};
|
|
51
|
+
WD=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 _.on(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 k=0;k<f.length;k++)if(f.start(k)>c&&(0===k||f.end(k-1)-c<=g)){f=k;break a}f=null}if(null==f){if(a.f){a=a.f;d=a.h;c=SD(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>=ED(a.H)))){k=g-c;b=k<=b;var l=!1;k<e||(b||a.l||(a.l=!0,e=new _.R("largegap",{detail:{currentTime:c,gapSize:k}}),e.cancelable=!0,a.G(e),a.h.jumpLargeGaps&&!e.defaultPrevented?l=!0:_.Oh("Ignoring large gap at",c,"size",k)),!b&&!l)||(0===f?_.Oh(GB,k,"seconds because of gap before start time of",g):_.Oh(GB,k,"seconds because of gap starting at",d.end(f-1),"and ending at",
|
|
53
|
+
g),a.B=!0,a.a.currentTime=g)}}}};YD=function(a){var b=this;this.f=a;this.o=10;this.l=this.h=this.j=0;this.a=new _.oi(function(){0>=b.j?(_.Kh(["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--)})};ZD=function(a,b){a.h=a.f.currentTime;a.l=b;a.j=a.o;a.f.currentTime=b;a.a.Rb(.1)};bE=function(a,b,c,d){this.a=a;this.j=b;this.o=d;this.A=c;this.l=!1;this.f=new _.gi;this.h=new YD(a);this.w=!1;0<a.readyState?$D(this,c):aE(this,c)};
|
|
54
|
+
cE=function(a,b){0<a.a.readyState?ZD(a.h,b):aE(a,b)};aE=function(a,b){a.A=b;a.f.off(a.a,_.Fe);a.f.one(a.a,_.Fe,function(){$D(a,b)})};$D=function(a,b){a.w||(a.w=!0,a.o&&a.o());.001>Math.abs(a.a.currentTime-b)?dE(a):(a.f.one(a.a,_.Xf,function(){dE(a)}),ZD(a.h,0===a.a.currentTime?b:a.a.currentTime))};dE=function(a){_.ui()&&79===_.Ri().major&&!a.l&&a.j();a.l=!0;a.f.on(a.a,_.Xf,function(){return a.j()})};
|
|
55
|
+
hE=function(a,b,c,d,e,f,g){var k=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 XD(a,b.presentationTimeline,c,eE(this,a,c),f);this.f=new bE(a,function(){a:{var l=k.j;var m=l.B;l.B=!1;l.D=!0;l.A=!1;l.l=!1;l=k.f.getTime();var n=fE(k,l);if(Math.abs(n-l)>k.l.gapTolerance){var p=(new Date).getTime()/1E3;if(!k.w||k.w<p-1){k.w=p;cE(k.f,n);m=void 0;break a}}k.g.debug("Seek to "+l);k.A(m?1:0);m=void 0}return m},gE(this,d,g),function(){k.j.I=!0});
|
|
56
|
+
this.o=(new _.oi(function(){if(0!==k.h.readyState&&!k.h.paused){var l=k.f.getTime(),m=uD(k.a),n=ED(k.a);3>n-m&&(m=n-3);l<m&&(m=fE(k,l),k.g.info("Jumping forward "+(m-l)+" seconds to catch up with the seek range."),k.h.currentTime=m)}})).Rb(.25);this.g=new _.L("clpp.mse.Playhead")};gE=function(a,b,c){null==b?b=Infinity>a.a.getDuration()||c?uD(a.a):ED(a.a):0>b&&(b=ED(a.a)+b);return iE(a,GD(a.a,b))};iE=function(a,b){var c=a.a.getDuration();return b>=c?c-a.l.durationBackoff:b};
|
|
57
|
+
fE=function(a,b){if("startover"===a.a.bd())return b;var c=new _.on(a.h.buffered);c=c.Fc.bind(c);var d=Math.max(a.B,a.l.rebufferingGoal),e=a.l.safeSeekOffset,f=uD(a.a),g=ED(a.a),k=a.a.getDuration();3>g-f&&(f=g-3);var l=FD(a.a,d),m=FD(a.a,e);d=FD(a.a,d+e);if(b>=k)return a.g.debug("Playhead past duration."),iE(a,b);if(b>g)return a.g.debug("Playhead past end."),g;if(b<f){if(c(m))return a.g.debug("Playhead before start \x26 start is buffered"),m;a.g.debug("Playhead before start \x26 start is unbuffered");
|
|
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
|
-
k.start(l+1)-f;break a}k=null}k&&(e=Math.min(k+.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
|
-
|
|
82
|
-
d=
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
l.
|
|
89
|
-
|
|
90
|
-
_.z(f)}})};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
b.push(e),c.active&&a.a.set(_.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||
|
|
103
|
-
null!==d&&null!==e&&k){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.T&&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=
|
|
104
|
-
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
m);_.zh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.Q,3,3015,{mediaError:n})))}})};
|
|
109
|
-
|
|
110
|
-
b.length;c={
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"variant.video",
|
|
118
|
-
|
|
119
|
-
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,audioMimeType:k,codecs:f.join(", "),audioCodec:d,
|
|
120
|
-
!!c.trickPlay,a.fg=c.bandwidth||null);b&&(a.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_.
|
|
124
|
-
e.filter(function(k){return 0===k.roles.length}),b.length)return b;b=e.map(function(k){return k.roles}).reduce(_.
|
|
125
|
-
|
|
126
|
-
_.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
59
|
+
eE=function(a,b,c){if(!c.stallEnabled)return null;var d=c.gapDetectionThreshold,e=c.stallSkip;c=new TD(new VD(b),c.stallThreshold);UD(c,function(f,g){a.g.warn("Stall detected at "+f+" for "+g+" seconds.");if(e){var k=new _.on(b.buffered),l;if(l=_.si("Edge/")||_.ti()||_.ui()&&79===_.Ri().major)a:{if(k.length&&!(1>=k.length))for(l=0;l<k.length-1;l++)if(f>k.start(l)&&f<k.end(l)){l=k.start(l+1)-k.end(l)>=d;break a}l=!1}if(l){a:{if(k.length&&!(1>=k.length))for(l=0;l<k.length-1;l++)if(f>k.start(l)&&f<k.end(l)){k=
|
|
60
|
+
k.start(l+1)-f;break a}k=null}k&&(e=Math.min(k+.1,e))}a.g.warn("Seeking forward "+e+" seconds to break stall.");b.currentTime+=e}else a.g.warn("Pausing and unpausing to break stall."),b.pause(),b.play()});return c};kE=function(a){var b=this;this.f=a;this.a=new Set;this.h=(new _.oi(function(){jE(b,!1)})).Rb(.25)};jE=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
|
+
lE=function(a,b){var c=a.offset||0;return b<a.startTime+c?1:b>a.endTime+c?3:2};
|
|
62
|
+
mE=function(a){var b=this;this.j=a;this.o=new Map;this.a=function(){};this.f=function(){};this.h=function(){};this.w=[{nd:null,md:2,dd:function(c,d){return b.a(c,d)}},{nd:1,md:2,dd:function(c,d){return b.a(c,d)}},{nd:3,md:2,dd:function(c,d){return b.a(c,d)}},{nd:2,md:1,dd:function(c,d){return b.f(c,d)}},{nd:2,md:3,dd:function(c,d){return b.f(c,d)}},{nd:1,md:3,dd:function(c,d){return b.h(c,d)}},{nd:3,md:1,dd:function(c,d){return b.h(c,d)}}]};nE=function(a,b,c,d){a.a=b;a.f=c;a.h=d};
|
|
63
|
+
_.oE=function(a){_.gw[a]&&delete _.gw[a]};_.pE=function(a){_.fw[a]&&delete _.fw[a]};qE=function(){this.f=new _.iD(2);this.h=new _.iD(5);this.a=0};rE=function(a,b,c){if(!(16E3>c)){var d=8E3*c/b;b/=1E3;a.a+=c;_.jD(a.f,b,d);_.jD(a.h,b,d)}};_.sE=function(a,b){this.id=a;this.pa=b};
|
|
64
|
+
_.tE=function(a,b){return a.pa.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()})};uE=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
|
+
vE=function(a,b){_.rn.call(this);this.A=a;this.h=null;this.B=b;this.D=new _.ml;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
|
+
xE=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,li:b.defaultServiceLocation?b.defaultServiceLocation.split(","):[]};b.baseUriCollections.forEach(function(d){var e=[];if(a.h.li.length)for(var f=
|
|
67
|
+
{},g=_.v(a.h.li),k=g.next();!k.done;f={jf:f.jf},k=g.next())f.jf=k.value,(k=d.pa.find(function(l){return function(m){return m.serviceLocationId===l.jf}}(f)))?e.push(k):a.g.warn("setManifestConfig: could not get default location:","pathwayId: "+f.jf+" processedLocations:",e);e.length?a.l.set(d.id,e):a.l.set(d.id,d.pa);a.o.set(d.id,d.pa)});if(b.contentSteeringServerUri){if(a.h.queryBeforeStart)return c["return"](wE(a));a.g.info("defaultServiceLocations: "+b.defaultServiceLocation);wE(a)}_.z(c)})};
|
|
68
|
+
yE=function(a,b){var c=a.j.get(b);c||(c={ge:0,Oh:new qE,bg:!1},a.j.set(b,c));return c};
|
|
69
|
+
wE=function(a,b){var c,d,e,f,g,k,l;return _.I(function(m){if(1==m.a)return b=b||a.h.contentSteeringServerUri,c=zE(a,b),a.g.info("Sending request to content steering server, URI: "+c),d=_.Wk(c,a.A.attemptParameters),d.type=7,e=a.B.fetch(d),_.ol(a.D,e),_.x(m,e.U,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;AE(a,a.f)}else try{k=_.S.ga(f.data),l=JSON.parse(k),1===l.VERSION?BE(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 _.oi(function(){wE(a)});AE(a,a.f)}_.z(m)})};
|
|
71
|
+
zE=function(a,b){var c=new URL(b),d=[],e=[];a.j.forEach(function(f,g){f.bg&&(d.push(g),e.push(parseInt(f.Oh.getBandwidthEstimate(1E4),10)));f.bg=!1});d.length?a.h.manifestType===_.Jc?(c.searchParams.set("_DASH_pathway",'"'+d.toString()+'"'),c.searchParams.set("_DASH_throughput",e.toString())):a.h.manifestType===_.Ym&&(c.searchParams.set("_HLS_pathway",'"'+d.toString()+'"'),c.searchParams.set("_HLS_throughput",e.toString())):a.g.debug("addQueryParams_: serviceLocations EMPTY");return c.toString()};
|
|
72
|
+
CE=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={ce:a.ce,gc:a.gc,Yd:a.Yd},b=c.next())if(a.ce=b.value,b=f.find(function(g){return function(k){return k.serviceLocationId===g.ce}}(a)))e.push(b);else if(a.gc=d.find(function(g){return function(k){return k.ID===g.ce}}(a)),a.gc&&(b=f.find(function(g){return function(k){return k.serviceLocationId===g.gc["BASE-ID"]}}(a))))a.Yd={serviceLocationId:a.ce,uri:b.uri,params:{}},a.gc[NB]&&(a.gc[NB].HOST&&
|
|
73
|
+
(b=new URL(b.uri),b.hostname=a.gc[NB].HOST,a.Yd.uri=b.toString()),a.gc[NB].PARAMS&&Object.entries(a.gc[NB].PARAMS).forEach(function(g){return function(k){var l=_.v(k);k=l.next().value;l=l.next().value;g.Yd.params[k]=l}}(a))),e.push(a.Yd);return e};AE=function(a,b){a.g.info("Scheduling next steering manifest update in "+b+" s.");a.a.ia(b)};
|
|
74
|
+
BE=function(a,b,c){null!=a.a&&(a.a.stop(),a.a=null);var d=b["RELOAD-URI"]||c;a.a=new _.oi(function(){wE(a,d)});if(c=b.TTL)a.f=c;AE(a,a.f);var e=b["PATHWAY-PRIORITY"]||[],f=b["PATHWAY-CLONES"]||[];a.j.forEach(function(g,k){e.includes(k)||a.j["delete"](k)});a.o.forEach(function(g,k){var l=CE(a,k,e,f);a.l.set(k,l)})};
|
|
75
|
+
DE=function(a,b){var c=String(_.tw++);c=new _.fm(c,a);c.mimeType=_.gm(b.mimeType);if(a===_.hm||a===_.im)c.label=_.gm(b.label),c.language=_.gm(b.language),c.originalLanguage=_.gm(b.originalLanguage);a===_.jm?(c.frameRate=b.frameRate,c.roles=b.roles,c.trickPlay=b.trickPlay):a===_.im?(c.channelsCount=b.channelsCount,c.roles=b.tg||[],c.mimeType=_.gm(b.audioMimeType)):(c.kind=_.gm(b.kind),c.roles=b.roles);c.accessibility=a===_.jm||a===_.im?(b.accessibility||[]).filter(function(d){return d.type===a}):b.accessibility||
|
|
76
|
+
[];return c};EE=function(a,b,c){var d=new _.om(a===_.jm?""+b.vc:a===_.im?""+b.Ac:""+b.id,c);switch(a){case _.jm:d.codec=_.gm(b.Yj);d.bandwidth=b.fg||b.bandwidth;d.width=b.width;d.height=b.height;d.originalId=b.ah;break;case _.im:d.codec=_.gm(b.audioCodec);d.bandwidth=b.pf||b.bandwidth;d.originalId=b.$g;break;default:d.codec=_.gm(b.codecs),d.originalId=b.sj}(a=c.renditions.find(function(e){return _.N.wa(e,d,null,["id","track"])}))||c.renditions.push(d);return a||d};
|
|
77
|
+
FE=function(a,b){var c=a.reduce(function(d,e){b===_.jm?null===e.vc||d[e.vc]&&!e.nf||(d[e.vc]=e):b===_.im&&(null===e.Ac||d[e.Ac]&&!e.mf||(d[e.Ac]=e));return d},{});return Object.values(c)};GE=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};HE=function(a){this.F=a;this.g=new _.L("clpp.mse.StateManager");this.h=this.a=0;this.f=2};
|
|
78
|
+
IE=function(a,b){if(a.a!==b){var c=_.S.Vc;if(3===a.a&&0!==b)c=c(b,_.jj),a.g.info(_.JB+c);else{c=a.h;c=0===c?0:Date.now()-c;var d=a.a;a.a=b;a.h=Date.now();a.F.Kn(b);6===b&&(a.F.isSeeking()?a.f=1:a.f=2);var e=a.f,f=void 0;if(6===b||6===d)f=e;a.F.trigger(new _.R(_.uf,{detail:{currentState:b,previousState:d,timeSinceLastStateChangeMS:c,reason:f}}));11!==b&&3!==b||a.F.mo();6===b?a.F.trigger(new _.R(_.dd,{detail:{bufferedTimeMS:-1,reason:e}})):6===d&&a.F.trigger(new _.R(_.cd,{detail:{bufferedTimeMS:c,reason:e}}))}}};
|
|
79
|
+
JE=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};_.KE=function(a,b){a.forEach(function(c){c.startTime+=b;c.endTime+=b})};LE=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}};ME=function(a){return Object.assign({},a,{periods:a.periods.map(function(b){return Object.assign({},b)})})};
|
|
80
|
+
NE=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=_.jh(a[0].periods).concat(),d={},e=1;e<a.length;d={lf:d.lf},e++)d.lf=LE(a[e-1]).end,_.KE(a[e].periods,d.lf),c.push.apply(c,_.jh(a[e].periods)),a[e].cues.forEach(function(f){return function(g){g.offset=f.lf}}(d));d=a.flatMap(function(f){return f.cues});c={periods:c,presentationTimeline:b,minBufferTime:0,cues:d,alternativeVariants:a[0].alternativeVariants};
|
|
81
|
+
d=LE(c).end;_.sD(b.a,0,d);(d=a[0].presentationTimeline.$c())&&_.vD(b,d.seekRangeStartDateTime);return c};PE=function(a,b){try{if(1===a.length)return a[0];if(!a.every(OE))throw new _.di("Period durations must be finite");return NE(a,b)}catch(c){throw new _.O(_.Q,7,7003,"Failed to join manifests into a continuous playlist!",c);}};
|
|
82
|
+
QE=function(a,b){var c=b.periods[0].configurationId,d=_.jh(a.periods).concat().filter(function(f){return f.configurationId!==c}),e=a.presentationTimeline;d={periods:d,presentationTimeline:e,minBufferTime:0};_.wD(e,b.presentationTimeline.o);return PE([d,b],e)};OE=function(a){return a.periods.every(function(b){return null!=b.endTime&&0<=b.endTime&&isFinite(b.endTime)})};
|
|
83
|
+
RE=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}};SE=function(a,b){return b.find(function(c){return c.id===a.id})||null};TE=function(){this.g=new _.L("clpp.mse.TrackManager");this.m=null;this.h=[];this.a=new Map;this.f=new Map};UE=function(a,b){return a.h.filter(function(c){return c.type===b})};VE=function(a,b){var c=a.a.get(b)||null;return c&&c.track};
|
|
84
|
+
WE=function(a,b,c){if(!c||VE(a,c.type)!==c||a.m.ya())switch(c=c?c.renditions[0]||null:null,b){case _.jm:a.Cb(c);break;case _.im:a.Ob(c);break;case _.hm:a.Pb(c);break;default:throw Error("Unknown track type "+b);}};XE=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)};YE=function(a,b,c){return a.m.ya()?!0:(a.a.get(c)||null)===b?!1:!0};
|
|
85
|
+
ZE=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");};
|
|
86
|
+
aF=function(a,b,c){ZE(a,b,_.jm);if(YE(a,b,_.jm)){var d=a.m;a.g.info("Set video rendition with ID: "+b.id);var e=a.a.get(_.im)||null,f=null;if(e&&!e.a){var g=d.Md().filter(function(l){return l.vc===parseInt(b.id,10)});f=g.find(function(l){return l.Ac===parseInt(e.id,10)})||null;if(!f){a.g.debug("Unable to find exact variant. Searching for equivalent");var k=e.track.renditions.map(function(l){return l.id}).filter(function(l){return l!==e.id});f=g.find(function(l){return k.find(function(m){return m===
|
|
87
|
+
l.Ac})})||null}}else f=d.Md().find(function(l){return l.vc===parseInt(b.id,10)})||null;f?(a.f.set(_.jm,b),$E(d,f,c)):a.g.warn("Cannot find matching variant")}};
|
|
88
|
+
dF=function(a,b){var c,d,e;_.I(function(f){switch(f.a){case 1:c=_.hm;ZE(a,b,c);if(!YE(a,b,c))return f["return"]();d=a.m.ra().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);XE(a,b);return _.x(f,bF(a.m,!0),4);case 4:return _.x(f,cF(a.m,d),5);case 5:a.m.trigger(new _.R(_.pg));_.G(f,0);break;case 2:e=_.H(f),a.g.warn("Failed to set text rendition",e),
|
|
89
|
+
_.z(f)}})};eF=function(a){var b,c,d;_.I(function(e){if(1==e.a){b=_.hm;c=VE(a,b);if(!c)return e["return"]();a.g.info("Unset text rendition.");_.F(e,2);return _.x(e,bF(a.m,!1),4)}if(2!=e.a)return a.a.set(b,null),a.m.trigger(new _.R(_.pg)),_.G(e,0);d=_.H(e);a.g.warn("Failed to unset text rendition",d);_.z(e)})};
|
|
90
|
+
iF=function(a){if(a.m){a.g.debug("Track list change detected, updating track list");for(var b=[],c=_.v(Object.values(_.uw)),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.ra());for(var e=d.next();!e.done;c={Oc:c.Oc},e=d.next()){e=e.value;c.Oc=DE(_.hm,e);var f=b.find(function(k){return function(l){return k.Oc.wa(l)}}(c));c.Oc=f||c.Oc;var g=EE(_.hm,e,c.Oc);e.rg&&a.a.set(_.hm,g);f||b.push(c.Oc)}fF(a.m)||a.a.set(_.hm,null);c=a.m.Md();gF(a,b,c,_.jm);gF(a,b,c,_.im);
|
|
91
|
+
hF(a,b);a.h=b}};gF=function(a,b,c,d){var e=FE(c,d);c={};e=_.v(e);for(var f=e.next();!f.done;c={Pc:c.Pc},f=e.next()){f=f.value;c.Pc=DE(d,f);var g=b.find(function(l){return function(m){return l.Pc.wa(m)}}(c));c.Pc=g||c.Pc;var k=EE(d,f,c.Pc);(d===_.jm&&f.nf||d===_.im&&f.mf)&&a.a.set(d,k);g||b.push(c.Pc)}};
|
|
92
|
+
hF=function(a,b){var c=a.m;if(c.f){var d=(d=jF(c))?kF(c.l,d).rb: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(_.tw++),e=new _.fm(e,_.im),e.mimeType="",e.label=c.label,e.language=c.language,e.originalLanguage=c.language,e.channelsCount=c.channelsCount,e.roles=[],e.accessibility=[],f=new _.om(""+c.id,e),f.codec="",f.bandwidth=0,f.originalId=c.label,f.a=!0,
|
|
93
|
+
e.renditions.push(f),b.push(e),c.active&&a.a.set(_.im,e.renditions[0])};mF=function(a,b,c,d){a.h.length||iF(a);var e=a.a.get(c)||null;(b=lF(a,b,c))&&e!==b&&(XE(a,b),c===_.im?a.m.trigger(new _.R(_.Zc)):c===_.jm&&a.m.trigger(new _.R(_.Qg,{details:{width:b.width||0,height:b.height||0,bandwidth:b.bandwidth,track:b.track,abrSelection:d}})))};lF=function(a,b,c){return UE(a,c).flatMap(function(d){return d.renditions}).find(function(d){return parseInt(d.id,10)===b})||null};
|
|
94
|
+
nF=function(){this.a=new muxjs.mp4.CaptionParser;this.l=[];this.j={}};_.oF=function(){};_.qF=function(a,b,c,d,e){this.j=a;this.B=c;this.a={};this.J={};this.M=!1;this.f=null;this.h={};this.l=new _.gi;this.K=!1;this.w={};this.H=b;this.D=d;this.I=e;this.T=this.I.streaming.maxSegmentToMediaOffset||1;this.L=new _.pl;this.A="";this.G={};this.o=pF(this,this.L);this.P=!0;this.g=new _.L("clpp.mse.MediaSourceEngine")};
|
|
95
|
+
rF=function(a){var b=_.Im(a.mimeType,a.codecs),c=HC(a);return _.qD(b)||_.Fu(c)||(_.Hm(b,a.type)?!0:!1)};
|
|
96
|
+
pF=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.P=!0});a.l.on(c,"endstreaming",function(){a.P=!1});a.A=sF(c);a.j.src=a.A;return c}c=new MediaSource;a.A=sF(c);a.l.one(c,"sourceopen",function(){URL.revokeObjectURL(a.A);b.resolve()});a.j.src=a.A;return c};tF=function(a){a.g.debug("Reset transmuxers.");Object.values(a.w).forEach(function(b){return b.reset()})};
|
|
97
|
+
vF=function(a,b){var c,d,e,f,g,k,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;k=f.next().value;l=g;m=a.a[l];return m?_.x(p,uF(a,l,m),5):(n=a.o.addSourceBuffer(k),a.l.on(n,_.le,a.wl.bind(a,l)),a.l.on(n,"updateend",a.gd.bind(a,l)),a.a[l]=n,p.C(5))}a.J[l]=k;a.h[l]=[];a.G[l]=!1;d=c.next();return p.C(2)})};uF=function(a,b,c){return _.I(function(d){return _.x(d,wF(a,b,function(){c.remove(0,Infinity)}),0)})};
|
|
98
|
+
xF=function(a){return a.I.streaming.ignoreManagedMediaSourceStreamingHints?!0:a.P};yF=function(a,b){a.f||(a.f=new mD(a.I,a.B));var c=a.f;if(b!==_.Ic){var d=_.Cv[b];if(!d)throw new _.O(_.Q,2,2012,"Text parser is unavailable for "+b);c.w=new d(c.D)}};zF=function(a){return a.o?a.o.readyState===_.ke:!0};BF=function(a){var b={};b.total=new _.on(a.j.buffered,"total");b.audio=AF(a,_.Rc);b.video=AF(a,_.Kg);var c=[];a.f&&(c=[{start:a.f.hc(),end:a.f.Ya()}]);b.text=QC(c,_.kk);return b};
|
|
99
|
+
AF=function(a,b){try{return new _.on(a.a[b].buffered,b)}catch(c){return b in a.a&&a.g.error("failed to get buffered range for "+b,c),null}};CF=function(a,b){if(!a.a[b])return"";var c=AF(a,b);return c?c.toString():""};
|
|
100
|
+
DF=function(a,b,c,d,e,f,g,k,l){k=void 0===k?!1:k;l=void 0===l?!1:l;var m=a.a[b],n=-1,p=0;m&&m.buffered&&(p=m.buffered.length);b===_.Kg&&null!==d&&null!==e&&k&&(n=0<p?m.buffered.end(p-1):-1);b===_.kk?l=nD(a.f,c,d,e):a.w[b]?(c=a.w[b].transmux(c),c.captions&&0<c.captions.length&&(a.f||yF(a,_.ng),pD(a.f,c.captions,d,e,a.a.video.timestampOffset)),f=[],0<c.audio.byteLength&&a.a.audio&&!l&&f.push(wF(a,_.Rc,a.Dg.bind(a,_.Rc,c.audio.buffer))),0<c.video.byteLength&&a.a.video&&f.push(wF(a,_.Kg,a.Dg.bind(a,_.Kg,
|
|
101
|
+
c.video.buffer))),l=Promise.all(f)):(f&&window.muxjs&&(a.f||yF(a,_.ng),null==d&&null==e?a.H.init(c):a.H.h(c,function(q){q.length&&pD(a.f,q,d,e,a.a.video.timestampOffset)})),l=wF(a,b,a.Dg.bind(a,b,c)));return l.then(function(){if(b===_.Kg&&null!==d&&null!==e&&!k)a.D.append(d,e,g),null!==d&&null!==e&&a.g.debug("Appended video segment ",d,e,"Buffer:",CF(a,b));else if(b===_.Rc&&null!==d&&null!==e)aD(a.D),null!==d&&null!==e&&a.g.debug("Appended audio segment ",d,e,"Buffer:",CF(a,b));else if(b===_.Kg&&
|
|
102
|
+
null!==d&&null!==e&&k){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.T&&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=wF(a,b,function(){a.Qj(b,u)}),t=wF(a,b,a.xi.bind(a,b,!1)),
|
|
103
|
+
Promise.all([q,t])}null!==d&&null!==e&&(a.G[b]=!0)})["catch"](function(q){throw q;})};EF=function(a,b){var c=a.Ya(_.Kg)||0;oD(a.f,b,c)};FF=function(a){a.f&&oD(a.f,"",0)};IF=function(a,b,c,d,e,f,g){var k,l;return _.I(function(m){if(1==m.a){k=_.Qq;if(b===k.TEXT){a.f.A=c;var n=a.f;n.j=d;n.l=e;return m["return"]()}return _.x(m,GF(a,b,f,g),2)}l=HF(a,b,c,d,e);a.M&&(l=l.concat(HF(a,k.AUDIO,c,d,e)));return _.x(m,Promise.all(l),0)})};
|
|
104
|
+
HF=function(a,b,c,d,e){return[wF(a,b,a.mk.bind(a,b)),wF(a,b,a.Qj.bind(a,b,c)),wF(a,b,a.Uo.bind(a,b,d,e))]};KF=function(a,b){JF(a,function(){a.o.duration=b})};wF=function(a,b,c){if(a.K)return Promise.reject();c={start:c,p:new _.pl};a.h[b].push(c);1===a.h[b].length&&LF(a,b);return c.p};
|
|
105
|
+
LF=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 _.O(_.Q,3,3017,{type:b})):c.p.reject(new _.O(_.Q,3,3015,{mediaError:d})),MF(a,b)}else a.g.debug("No more scheduled operations for "+b)};
|
|
106
|
+
JF=function(a,b){var c,d,e,f,g,k,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 _.pl,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(k in a.a)a.h[k].length&&a.h[k].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)MF(a,
|
|
107
|
+
m);_.zh(p);break;case 5:return n=_.H(p),p["return"](Promise.reject(new _.O(_.Q,3,3015,{mediaError:n})))}})};MF=function(a,b){a.h[b].shift();LF(a,b)};GF=function(a,b,c,d){var e,f,g;return _.I(function(k){e=_.Qq;if(b===e.TEXT||!WC()||a.I.mediaSource.codecSwitchingStrategy!==_.bg)return k["return"]();f=a.J[b];g=_.Im(c,d);return KC(f,g)?k["return"]():_.x(k,wF(a,b,function(){a.g.info("Change MIME type of "+b+" to "+g);a.a[b].changeType(g);a.J[b]=g;a.gd(b)}),0)})};
|
|
108
|
+
SF=function(a,b,c,d){var e=a.periods.flatMap(function(n){return n.variants}),f=e;if(b.length||c.length)f=NF(f,b,c);f=OF(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 k=e.next();!k.done;k=e.next())k=k.value,null!==k.audio&&d.add(g(k.audio.codecs));b.push(d)}var l=b[0];c={};for(d=1;d<
|
|
109
|
+
b.length;c={kg:c.kg},d++)c.kg=b[d],l=new Set(_.jh(l).concat().filter(function(n){return function(p){return n.kg.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=PF(f);var m=QF(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(RF(n)===m)return!0;_.Ph("Dropping Variant (better codec available)",n);return!1})};
|
|
110
|
+
TF=function(a,b,c,d){var e=a.periods.flatMap(function(f){return f.variants});if(b.length||c.length)e=NF(e,b,c);e=OF(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)})};PF=function(a){var b=new _.fi;a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=RF(c);b.push(d,c)}return b};
|
|
111
|
+
NF=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};
|
|
112
|
+
QF=function(a){var b="",c=Infinity;a.forEach(function(d,e){var f=e.reduce(function(g,k){return g+k.bandwidth||0},0)/e.length;_.Ph(_.Cd,d,"avg bandwidth",f);f<c&&(b=d,c=f)});return b};RF=function(a){var b="";a.video&&(b=_.JC(a.video.codecs));var c="";a.audio&&(c=_.JC(a.audio.codecs));return b+"-"+c};
|
|
113
|
+
UF=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};VF=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=UF(e,b);f!==e.allowedByApplication&&(c=!0)}return c};
|
|
114
|
+
YF=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.X&&!tC(a,n))return _.Ph("Dropping variant - not compatible with key system",n),!1;var p=n.audio,q=n.video;if(p&&!rF(p)){var t=p.codecs;0<=p.codecs.indexOf(_.ge)?(_.Ph("Trying to use AC-3 for EC-3"),p.codecs=p.codecs.replace(_.ge,"ac-3"),rF(p)?_.Oh("Using AC-3 instead of EC-3 for",WF(p)):(p.codecs=t,_.Oh(LB,WF(p)),n.audio=null,f=!0,p=null)):(_.Oh(LB,WF(p)),n.audio=null,f=!0,p=null)}return q&&!rF(q)?(_.Oh("Dropping variant - video not compatible with platform",
|
|
115
|
+
WF(q)),!1):p&&b&&!XF(p,b,e)?(_.Oh("Dropping variant - not compatible with active audio","active audio",WF(b),"variant.audio",WF(p)),!1):q&&c&&!XF(q,c,e)?(_.Oh("Dropping variant - not compatible with active video","active video",WF(c),"variant.video",WF(q)),!1):!0});if(f){for(var g=!1,k=!1,l=_.v(d.variants),m=l.next();!m.done;m=l.next())m=m.value,!g&&m.video&&m.audio&&(g=!0),k||m.audio||!m.video||(k=!0);g&&k&&(d.variants=d.variants.filter(function(n){return n.video&&!n.audio?(_.Oh("Dropping variant - not compatible with video + audio",
|
|
116
|
+
"variant.video",WF(n.video)),!1):!0}))}d.textStreams=d.textStreams.filter(function(n){var p=_.qD(_.Im(n.mimeType,n.codecs));p||_.Ph("Dropping text stream. Is not supported by the platform.",n);return p})};XF=function(a,b,c){return a.mimeType!==b.mimeType||(void 0===c||c)&&a.codecs.split(".")[0]!==b.codecs.split(".")[0]?!1:!0};
|
|
117
|
+
ZF=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,k=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,nf:!1,mf:!1,rg:!1,
|
|
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,audioMimeType:k,codecs:f.join(", "),audioCodec:d,Yj:e,primary:a.primary,roles:Array.from(m),tg:Array.from(n),vc:null,Ac:null,channelsCount:null,spatialAudio:!1,pf:null,fg:null,ah:null,$g:null,sj:null,accessibility:q};c&&(a.vc=c.id,a.ah=c.originalId,a.width=c.width||null,a.height=c.height||null,a.frameRate=c.frameRate||null,a.trickPlay=
|
|
119
|
+
!!c.trickPlay,a.fg=c.bandwidth||null);b&&(a.Ac=b.id,a.$g=b.originalId,a.originalLanguage=b.originalLanguage,a.channelsCount=b.channelsCount,a.pf=b.bandwidth||null,a.label=b.label,a.tg=b.roles);return a};
|
|
120
|
+
$F=function(a){return{id:a.id,nf:!1,mf:!1,rg:!1,type:_.kk,bandwidth:0,language:a.language,originalLanguage:a.originalLanguage,label:a.label,kind:a.kind||null,width:null,height:null,frameRate:null,trickPlay:!1,mimeType:a.mimeType,audioMimeType:null,codecs:a.codecs||null,audioCodec:null,Yj:null,primary:a.primary,roles:a.roles,tg:null,vc:null,Ac:null,channelsCount:null,spatialAudio:!1,pf:null,fg:null,ah:null,$g:null,sj:a.originalId,accessibility:a.accessibility,keyId:null}};
|
|
121
|
+
aG=function(a){return a.allowedByApplication&&a.allowedByKeySystem};OF=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))};
|
|
122
|
+
_.cG=function(a,b,c,d){b=_.Fj(b);var e=a,f=a.filter(function(k){return k.primary});f.length&&(e=f);var g=e.length?e[0].language:"";e=e.filter(function(k){return k.language===g});b.some(function(k){var l=_.Mk(_.Ik(k),a.map(function(m){return m.language}));return l?(e=a.filter(function(m){return _.Ik(m.language)===l}),!0):!1});d&&e.some(function(k){return k.kind===_.ne})&&(e=e.filter(function(k){return k.kind===_.ne}));if(c){b=bG(e,c);if(b.length)return b;_.Kh("No exact match for the text role could be found.")}else if(b=
|
|
123
|
+
e.filter(function(k){return 0===k.roles.length}),b.length)return b;b=e.map(function(k){return k.roles}).reduce(_.zC,[]);return b.length?bG(e,b[0]):e};bG=function(a,b){return a.filter(function(c){return c.roles.includes(b)})};
|
|
124
|
+
WF=function(a){var b=HC(a);return a.type===_.Rc?"type\x3daudio mimeType\x3d"+a.mimeType+" codecs\x3d"+a.codecs+" codecInfo\x3d"+b+" bandwidth\x3d"+a.bandwidth+" channelsCount\x3d"+a.channelsCount:a.type===_.Kg?"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"};
|
|
125
|
+
_.dG=function(){this.g=new _.L("clpp.abr");this.o=null;this.l=!1;this.w=new qE;this.f=[];this.B=1;this.H=this.G=!1;this.A=this.a=this.h=this.j=null;this.D=new Set};
|
|
126
|
+
eG=function(a,b,c,d){if(a.l&&!c.stopped&&!b.a){var e=Date.now()-c.ep,f=b.f?b.f.bytesLoaded||0:0,g=b.f?b.f.bytesRemaining:-1;if(0>=f||e<d)c.uh=setTimeout(function(){return eG(a,b,c,d)},500);else{var k=a.f.find(function(m){return m.id===a.j});k=k?k.bandwidth:a.getBandwidthEstimate();var l=8E3*f/e;fG(a,l,k,0<=g?8E3*g/l:Infinity)&&gG(a,k)?(rE(a.w,e,f),c.stop(),b.abort(),hG(a,l)):c.uh=setTimeout(function(){return eG(a,b,c,d)},500)}}};hG=function(a,b){var c=gG(a,b)||a.f[0];a.h=Date.now();a.o(c)};
|
|
127
|
+
gG=function(a,b){return iG(a,a.a.restrictions||null,a.f).filter(function(c){return c.bandwidth<b}).pop()||null};fG=function(a,b,c,d){return 0===b||Infinity===d||300>d?!1:b<c/(a.a.bandwidthDowngradeTarget||1)};
|
|
128
|
+
iG=function(a,b,c){if(a.A&&a.a.useCmsd){var d=wC(a.A);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 UF(e,b)}));return a.sort(function(e,f){return e.bandwidth-f.bandwidth})};jG=function(){this.a=null};lG=function(a,b){if(b&&(null==a.a||a.a!==b))throw kG(a);};
|
|
129
|
+
kG=function(a){return new _.O(_.Q,7,7E3,a.a?"Another load operation was started while a load operation was in progress.":"Player was released while a load operation was in progress.")};mG=function(){this.a=new Map};kF=function(a,b){a.a.has(b)||a.a.set(b,new nG);return a.a.get(b)};nG=function(){this.text=this.video=this.rb=this.audio=null};oG=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)};
|
|
130
|
+
rG=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||pG(d,e))&&qG(d.roles,e.roles))}!d&&(d=a.video&&b.video)&&(a=a.video,b=b.video,d=!((!c||pG(a,b))&&qG(a.roles,b.roles)));return d?!1:!0};
|
|
131
|
+
pG=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};qG=function(a,b){var c=new Set(a),d=new Set(b);c["delete"](_.He);d["delete"](_.He);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};
|
|
132
|
+
tG=function(a){var b=void 0===b?_.Ff:b;this.f=a;this.a=b;this.h=new sG(a.language,"",a.audio&&a.audio.channelsCount?a.audio.channelsCount:0,!1,b)};sG=function(a,b,c,d,e){this.j=_.Fj(a);this.a=b;this.f=c;this.l=void 0===d?!1:d;this.h=void 0===e?_.Ff:e};uG=function(a,b){var c=null;b.some(function(d){c=_.Mk(_.Ik(d),a.map(function(e){return EC(e)}));return!!c});return c?a.filter(function(d){return c===EC(d)}):[]};
|
|
133
|
+
vG=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)})};wG=function(a,b){return a.filter(function(c){return c.audio&&c.audio.spatialAudio!==b?!1:!0})};zG=function(a,b){this.a=xG;this.f=(new Map).set(xG,b).set(yG,a)};
|
|
134
|
+
BG=function(a){var b=this;this.F=a;this.a=a.getConfiguration().streaming;this.f=new _.gi;this.g=new _.L("clpp.mse.media.LiveEdgeObserver");AG(this)&&(a=this.F.getSurface().getMedia(),this.f.on(a,_.ug,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."),
|
|
136
135
|
b.F.setPlaybackRate(b.a.chasingRate,_.Nd)):1<e&&c<=f&&(b.g.debug("On live edge, reduce playback rate."),b.F.setPlaybackRate(1))}))};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
a;if(0===g.length||!e)throw _.Qh("Failed to find boxes needed to fake encryption!"),_.Qh("Failed init segment (hex):",_.
|
|
142
|
-
|
|
143
|
-
b.start);b=_.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
m),q["return"]();p=
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
b)};
|
|
153
|
-
|
|
154
|
-
_.
|
|
155
|
-
|
|
156
|
-
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.
|
|
157
|
-
u>=q))return y=
|
|
158
|
-
C=!0:(K=g.
|
|
159
|
-
|
|
136
|
+
AG=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};CG=function(a){this.h=a;this.a=null;this.f=function(){}};DG=function(a,b){a.f=b};
|
|
137
|
+
EG=function(a){var b=this;this.f=a;this.o=this.w=this.l=!1;this.h=this.f.Dc();this.A=_.Nd;this.j=null;this.a=new _.oi(function(){b.w||b.f.qn(.25*b.h)});this.g=new _.L("clpp.mse.media.PlayRateController")};FG=function(a,b){a.j=b;a.j.speedUpMode&&(a.A=a.j.speedUpMode)};
|
|
138
|
+
IG=function(a,b){a.a.stop();a.l||(a.o=!1);var c=a.l?0:a.h;if((b?b:a.A)===_.Nd||0===c||1===c)try{GG(a,c)}catch(d){a.g.warn('Set playbackRate using "decoder" mode fails, due to unsupported range by platform. Fallback to "seek" mode.',d),HG(a)}else HG(a)};HG=function(a){a.g.debug(MB,a.h,' using "seek" mode.');GG(a,0);a.o=!0;a.a.Rb(.25)};GG=function(a,b){if(a.f.Dc()!==b){a.g.debug(MB,b,' using native playbackRate "decoder" mode.');try{a.f.Wd(b)}catch(c){throw c;}}};
|
|
139
|
+
KG=function(a){function b(){d=!0}function c(m){f.push(m);_.Wn(m)}a=_.Wi(a);var d=!1,e,f=[],g=[];(new _.Vn).N(_.Oe,c).N(_.wg,c).N(_.Je,c).N(_.Ne,c).N(_.gg,c).da(_.ig,function(m){e=m;f.push(m);_.Xn(m)}).da("encv",b).da("enca",b).da("avc1",function(m){g.push({N:m,Td:1701733238})}).da("avc3",function(m){g.push({N:m,Td:1701733238})}).da("ac-3",function(m){g.push({N:m,Td:1701733217})}).da(_.ge,function(m){g.push({N:m,Td:1701733217})}).da("mp4a",function(m){g.push({N:m,Td:1701733217})}).parse(a);if(d)return _.Oh("Init segment already indicates encryption."),
|
|
140
|
+
a;if(0===g.length||!e)throw _.Qh("Failed to find boxes needed to fake encryption!"),_.Qh("Failed init segment (hex):",_.Ml(a)),new _.O(_.Q,3,14E3);g.reverse();for(var k=_.v(g),l=k.next();!l.done;l=k.next())l=l.value,_.Oh('Inserting "'+_.$n(l.Td)+'" box into init segment.'),a=JG(a,e,l.N,f,l.Td);return a};
|
|
141
|
+
JG=function(a,b,c,d,e){var f=LG.value(),g=a.subarray(c.start,c.start+c.size),k=_.bj(g),l=new Uint8Array(c.size+f.byteLength);l.set(g,0);g=_.bj(l);g.setUint32(4,e);l.set(f,c.size);e=k.getUint32(4);g.setUint32(c.size+16,e);MG(l,0,l.byteLength);e=new Uint8Array(a.byteLength+l.byteLength);c=_.si("Xbox One")||_.ri()?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,MG(e,d.start,d.size+l.byteLength);l=_.bj(e,
|
|
142
|
+
b.start);b=_.ao(b);a=l.getUint32(b);l.setUint32(b,a+1);return e};MG=function(a,b,c){a=_.bj(a,b);b=a.getUint32(0);0!==b&&(1===b?(a.setUint32(8,c>>32),a.setUint32(12,c&4294967295)):a.setUint32(0,c))};_.OG=function(a,b){this.F=b;this.j=a;NG(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};
|
|
143
|
+
QG=function(a){var b=a.a.get(_.Kg);return b?PG(a,b.qc):(b=a.a.get(_.Rc))?PG(a,b.qc):null};SG=function(a){return _.RG(a,_.Rc)};TG=function(a){return _.RG(a,_.Kg)};
|
|
144
|
+
YG=function(a,b){var c,d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:return c=_.Qq,_.x(q,a.F.Y.clear(c.TEXT),2);case 2:return a.J++,a.K=!1,d=a.J,e=a.F.Y,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,UG(a,g),4);case 4:if(a.f)return q["return"]();l=(k=e.getTextDisplayer().isTextVisible())||a.h.alwaysStreamText;if(a.J===d&&!a.a.has(c.TEXT)&&!a.K&&l){m=a.F.Hb();n=VG(a,m);if(null==n)return a.g.warn("Cannot set up text media state, period not found at",
|
|
145
|
+
m),q["return"]();p=WG(b,n,0);a.a.set(c.TEXT,p);XG(a,p,0)}_.z(q)}})};aH=function(a){a.K=!0;var b=a.a.get(_.kk);b&&(a.g.info("Unload text stream"),ZG(b),$G(b)["catch"](function(){}),a.a["delete"](_.kk))};bH=function(a){var b,c;return _.I(function(d){if(1==d.a){b=_.Qq;c=a.a.get(b.AUDIO);if(!c)return d.C(0);a.g.info("Unload audio stream");ZG(c);return _.x(d,$G(c)["catch"](function(){}),3)}a.a["delete"](b.AUDIO);_.z(d)})};
|
|
146
|
+
dH=function(a,b){var c,d,e,f,g,k;_.I(function(l){if(1==l.a){c=_.Qq;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||(k=d.Kc))return l["return"]();a.g.debug("Switching to trick mode",g);return _.x(l,cH(a,g,!1,0),5)}f=d.Kc;if(!f)return l["return"]();a.g.debug("Switching back from trick mode",f);d.Kc=null;return _.x(l,cH(a,f,!0,0),0)}d.Kc=e;_.z(l)})};
|
|
147
|
+
eH=function(a,b,c,d){return _.I(function(e){return 1==e.a?b.video?_.x(e,cH(a,b.video,c,d),2):e.C(2):b.audio?_.x(e,cH(a,b.audio,c,d),0):e.C(0)})};gH=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,bH(a),2)}b=_.Qq;c=a.a.get(b.VIDEO);return _.x(d,fH(a,c),0)})};hH=function(a,b,c,d){return _.I(function(e){return _.x(e,cH(a,b,c,d),0)})};
|
|
148
|
+
jH=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.Hb();return _.x(d,iH(a,{audio:b},c),2)}return _.x(d,cH(a,b,!0,0),0)})};_.kH=function(a,b){return _.I(function(c){return _.x(c,cH(a,b,!0,0),0)})};nH=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;NG(a.j);lH(a);mH(a)};
|
|
149
|
+
mH=function(a){a=_.v(a.a.values());for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.ma,d=b.nc;c&&d&&(c=d.getSegmentReference(c.position))&&(b.ma=c)}};NG=function(a){a.periods.every(function(b){return typeof b.id===_.hg})};
|
|
150
|
+
oH=function(a){var b=a.F.Hb(),c=!1,d=VG(a,b);if(Array.from(a.a.values()).every(function(k){return k.qc===d}))for(var e=_.v(a.a.keys()),f=e.next();!f.done;f=e.next()){f=f.value;var g=a.a.get(f);g.stream.segmentIterator=null;a.F.Y.Fc(f,b,0)||(fH(a,g),c=!0)}else if(!Array.from(a.a.keys()).every(function(k){return a.F.Y.Fc(k,b,0)})){a.g.debug("(all): seeked: unbuffered seek: clearing all buffers");c=_.v(a.a.values());for(e=c.next();!e.done;e=c.next())fH(a,e.value);c=!0}c||a.g.debug("(all): seeked: buffered seek: presentationTime\x3d"+
|
|
151
|
+
b)};rH=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=pH(d);if(d.Od||b&&qH(d))a.g.info(e,"Retrying after failure..."),d.Od=!1,XG(a,d,.1)}};sH=function(a){return Array.from(a.a.values()).some(function(b){return null!==b.Db})};
|
|
152
|
+
tH=function(a){var b=Array.from(a.a.values());return a.D&&b.every(function(c){return c.endOfStream})};vH=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,ZG(e),e.Nb&&e.cc&&(e.Nb=!1,b.push(e.cc.abort())),e.wc&&b.push(uH(a,e,!0,0));return _.x(f,Promise.all(b),0)})};wH=function(a,b,c){(a=a.a.get(b))&&c&&(ZG(a),a.stream=c,a.nc=c,a.ma&&(a.ma=c.getSegmentReference(a.ma.position)),a.ma||(a.nc=null))};
|
|
153
|
+
_.RG=function(a,b){var c=a.a.get(b);return c?c.Kc||c.stream:null};
|
|
154
|
+
cH=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u,y,A,D,B;return _.I(function(E){switch(E.a){case 1:e=_.Qq;f=b.type;if((g=a.a.get(f))||b.type!==e.TEXT||!a.h.ignoreTextStreamFailures){E.C(2);break}return _.x(E,YG(a,b),3);case 3:return E["return"]();case 2:if(!g)return E["return"]();k=xH(a,b).id;if(c&&k!==g.qc){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,fH(a,n);return E["return"]()}g.Kc&&
|
|
155
|
+
(a.g.debug("switch during trick play mode",b),b.trickModeVideo?(g.Kc=b,b=b.trickModeVideo,a.g.debug("switch found trick play stream",b)):(g.Kc=null,a.g.debug("switch found no special trick play stream")));var C=a.B.get(k);if(!C||!C.hh)return E["return"]();if((C=a.o.get(b.id))&&C.hh){E.C(4);break}return _.x(E,UG(a,new Set([b])),4);case 4:if(g.stream===b)return p=pH(g),a.g.debug(kC+p+" already active"),E["return"]();q=a.j.presentationTimeline.getDuration();t=a.F.Hb();u=yH(a,g,t);if(!c&&(g.endOfStream||
|
|
156
|
+
u>=q))return y=pH(g),a.g.debug(kC+y+" already buffered to the end. Not switching."),E["return"]();b.type===e.TEXT&&(A=_.Im(b.mimeType,b.codecs),yF(a.F.Y,A));g.stream=b;g.stream.segmentIterator=null;g.Nf=!0;D=pH(g);a.g.debug("switch: switching to Stream "+D);if(g.cc){var K=a.F.Hb(),P=a.F.Y.Ya(g.type);C=(C=zH(a,g,K,P,k))?C.Ae():null;if(null==C)C=!1;else{var T=g.stream.initSegmentReference;T&&(C+=T.Ae()||0);T=a.F.xe().getBandwidthEstimate();8*C/T<(null===P?0:P-K)-Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal)?
|
|
157
|
+
C=!0:(K=g.cc,K=K.f?K.f.bytesRemaining:-1,C=0>K||K>C?!0:!1)}}else C=!1;C&&(a.g.info("Aborting current segment request to switch."),g.cc.abort());if(!c){E.C(0);break}if(g.Sc){g.gg=!0;E.C(0);break}if(g.Nb){g.wc=!0;g.tf=d;g.gg=!0;E.C(0);break}ZG(g);_.F(E,9);return _.x(E,uH(a,g,!0,d),11);case 11:_.G(E,0);break;case 9:B=_.H(E);if(a.F)a.F.onError(B);_.z(E)}})};AH=function(a){a.G=!0;a.g.debug("calling onCanSwitch()...");a.F.ij()};
|
|
158
|
+
fH=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a){c=pH(b);if(b.Sc)return a.g.debug(c,"clear: already clearing the buffer"),f["return"]();if(b.wc)return a.g.debug(c,"clear: already waiting"),f["return"]();if(b.Nb)return a.g.debug(c,"clear: currently updating"),b.wc=!0,b.tf=0,f["return"]();d=b.type;if(null==a.F.Y.hc(d))return a.g.debug(c,"clear: nothing buffered"),null==b.Db&&XG(a,b,0),f["return"]();a.g.debug(c,"clear: handling right now");ZG(b);_.F(f,2);return _.x(f,uH(a,b,!1,0),4)}if(2!=
|
|
160
159
|
f.a)return _.G(f,0);e=_.H(f);if(a.F)a.F.onError(e);_.z(f)})};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
160
|
+
iH=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.F.Hb();e=VG(a,d);if(null==e)return a.g.warn("Cannot initialize streams, period not found at",d),l["return"]();f=BH(b);g=a.F.Y;k=a.h.forceNativeTS;return _.x(l,g.init(f,k,a.h.disableAudioTracks),2)}if(3!=l.a){if(a.f)return l["return"]();lH(a);return _.x(l,UG(a,new Set(f.values())),3)}if(a.f)return l["return"]();f.forEach(function(m,n){if(!a.a.has(n)){var p=WG(m,e,c);a.a.set(n,p);XG(a,p,0)}});_.z(l)})};
|
|
161
|
+
WG=function(a,b,c){return{stream:a,type:a.type,nc:null,segmentIterator:null,ma:null,Kc:null,Nf:!0,qc:b,endOfStream:!1,Nb:!1,Db:null,wc:!1,tf:0,gg:!1,Sc:!1,fh:!1,Od:!1,Nj:c||0,cc:null,zf:!1,$i:0}};DH=function(a){a.g.debug("(all) setupAllPeriods_");a.j.periods.map(function(b){return b.id}).forEach(function(b){CH(a,b)["catch"](AC)})};
|
|
162
|
+
CH=function(a,b){var c=a.B.get(b);if(c)return a.g.debug("(all) Period "+b+wB),c;a.g.debug("(all) setting up period "+b);var d=new _.pl;a.B.set(b,d);c=PG(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 UG(a,e)}).then(function(){a.f||(d.resolve(),a.g.debug("(all) setup Period "+
|
|
164
163
|
b))})["catch"](function(k){a.f||(d["catch"](function(){}),d.reject(),a.B["delete"](b),a.g.warn("(all) failed to setup Period "+b),a.F.onError(k))});return d};
|
|
165
|
-
|
|
166
|
-
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw k;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)}})};
|
|
167
|
-
|
|
168
|
-
if(null!=l&&f>=l&&!b.zf)return
|
|
169
|
-
null);d=Infinity;k=_.v(a.a.values());for(m=k.next();!m.done;m=k.next())m=m.value,c(m)||(m=
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
e,
|
|
173
|
-
else if(f=
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
C}}b.
|
|
178
|
-
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),B.C(0);if(7001===D.code)return b.
|
|
179
|
-
2,2010,D,void 0,D.svtaCode));else a.F.onError(new _.O(1,2,2010,D,void 0,5001));return B.C(0)}if(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
p=
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
case 2:if(C=e.encrypted&&e.keyId&&a.F.qe)C=a.F.qe.o.get(e.keyId),C=!(!C||C!==_.
|
|
187
|
-
a.
|
|
188
|
-
b.
|
|
189
|
-
|
|
190
|
-
k);return _.x(l,a.F.Y.remove(b.type,f,f+k),2)}if(a.f)return l["return"]();a.g.debug(d,"evicted "+k+
|
|
191
|
-
|
|
192
|
-
case 4:if(a.f)return C["return"]();
|
|
193
|
-
y+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();A=_.v(Array.from(q.keys()));for(u=A.next();!u.done;u=A.next())if(D=u.value,!a.a.has(D))if(D===d.TEXT)
|
|
194
|
-
0);_.z(T)})});return _.x(C,Promise.all(E),5);case 5:if(a.f)return C["return"]();
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
u);return k?y["return"]():_.x(y,d(q.data,!1),0)})};
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
a.W.stop()},trigger:function(b){return a.trigger(b)}});this.Ge=new
|
|
207
|
-
"online",function(){a.H===
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
0;d<f.length;d++)if(!f[d].
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
6);case 6:return f=l.f,
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.
|
|
225
|
-
|
|
226
|
-
|
|
164
|
+
UG=function(a,b){var c,d,e,f,g,k,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+wB),c.push(g)):(a.g.debug("(all) setting up stream "+f.id),a.o.set(f.id,new _.pl),c.push(f.createSegmentIndex(a.F.Mb,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:k=_.H(u);if(a.f)return u["return"]();l=_.v(b);for(e=l.next();!e.done;e=
|
|
165
|
+
l.next())if(m=e.value,n=a.o.get(m.id))n["catch"](function(){}),n.reject(),a.o["delete"](m.id);throw k;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)}})};lH=function(a){var b=a.j.presentationTimeline.getDuration();Infinity>b?KF(a.F.Y,b):KF(a.F.Y,Math.pow(2,32))};
|
|
166
|
+
GH=function(a,b){function c(n){return n.type===_.kk&&n.stream.mimeType===_.Ic}if(c(b))return EF(a.F.Y,b.stream.originalId||""),null;b.type===_.kk&&FF(a.F.Y);if(!xF(a.F.Y)&&b.type!==_.kk)return a.h.bufferLimitUpdateInterval?a.h.bufferLimitUpdateInterval/2:.5;var d=pH(b),e=a.F.Hb(),f=yH(a,b,e);a.g.debug(d,"timeNeeded\x3d"+f);var g=a.F.Y.Za(b.type,e);a.g.debug(d,"update_:",eC+e,"bufferedAhead\x3d"+g);var k=Math.max(a.j.minBufferTime||0,a.h.rebufferingGoal,a.h.bufferingGoal)*a.l,l=xD(a.j.presentationTimeline);
|
|
167
|
+
if(null!=l&&f>=l&&!b.zf)return EH(a,b),null;b.endOfStream=!1;l=xH(a,b.stream).id;var m=VG(a,f);null!=m&&(b.qc=m);if(m!==l)return a.g.debug(d,"need Period "+m,eC+e,"timeNeeded\x3d"+f,"currentPeriodId\x3d"+l),null;if(g>=k)return a.g.debug(d,"buffering goal met"),a.h.bufferLimitUpdateInterval||.5;g=a.F.Y.Ya(b.type);g=zH(a,b,e,g,l);if(!g)return a.j.presentationTimeline.isLive()||b.type===_.kk?a.h.bufferLimitUpdateInterval||1:(a.g.debug("Media state "+d+": no next segment found. Assuming EOS."),EH(a,b),
|
|
168
|
+
null);d=Infinity;k=_.v(a.a.values());for(m=k.next();!m.done;m=k.next())m=m.value,c(m)||(m=yH(a,m,e),d=Math.min(d,m));if(f>=d+a.j.presentationTimeline.h)return a.h.bufferLimitUpdateInterval||1;b.Nj=0;FH(a,b,e,l,g)["catch"](function(){});return null};EH=function(a,b){a.g.debug(pH(b),"buffered to end of presentation");b.endOfStream=!0;if(b.type===_.Kg){var c=a.a.get(_.kk);c&&c.stream.mimeType===_.Ic&&(c.endOfStream=!0)}};
|
|
169
|
+
yH=function(a,b,c){return b.nc&&b.ma?xH(a,b.nc).startTime+b.ma.endTime:Math.max(c,b.Nj)};
|
|
170
|
+
zH=function(a,b,c,d,e){if(null==e)return a.g.warn(CB),null;if(b.stream.segmentLookupStrategy===_.$B)b.stream.segmentIterator?a=PD(b.stream.segmentIterator):b.ma||d?(c=b.ma?b.ma.endTime:d,a.g.info(FB,"looking up segment from new stream endTime:",c),b.stream.segmentIterator=RD(b.stream.segmentIndex,c),e=b.stream.segmentIterator.next().value,null===e&&(b.stream.segmentIterator=null,a.g.warn(FB,SB,"endTime:",c,b.ma)),a=e):(e=PG(a,e),e=Math.max(0,c-e.startTime),a.g.info(FB,"looking up segment","lookupTime:",
|
|
171
|
+
e,dC,c),b.stream.segmentIterator=RD(b.stream.segmentIndex,e),b=b.stream.segmentIterator.next().value,null===b&&a.g.warn(FB,SB,"lookupTime:",e,dC,c),a=b);else{var f=pH(b);if(b.ma&&b.stream===b.nc)c=b.ma.position+1,a.g.debug(f,"next position known:","position\x3d"+c),a=HH(a,b,e,c);else{if(b.ma){a.g.debug(f,"next position unknown: another Stream buffered");f=xH(a,b.nc);var g=IH(a,b,f.startTime+b.ma.endTime,e)}else a.g.debug(f,"next position unknown: nothing buffered"),g=IH(a,b,d||c,e);if(null==g)a=null;
|
|
172
|
+
else if(f=HH(a,b,e,g),null==f)a=null;else{var k=null==a.h?!1:a.h.ignoreDrift;null!=d||k||(d=f,d.Va+d.startTime+2>c&&(a=HH(a,b,e,Math.max(0,g-1)))&&(f=a));a=f}}}return a};IH=function(a,b,c,d){var e=pH(b);d=PG(a,d);var f=Math.max(0,c-d.startTime);b=b.stream.findSegmentPosition(f);a.g.debug(e,"Looked up segment:",eC+c,"lookupTime\x3d"+f,WB+d.startTime,"Result: segment position\x3d"+b);null==b&&a.g.warn(e,"cannot find segment:",WB+d.startTime,"lookupTime\x3d"+f);return b};
|
|
173
|
+
HH=function(a,b,c,d){var e=pH(b);if(null==c)return a.g.warn(e,CB),null;c=PG(a,c);var f=b.stream.getSegmentReference(d);if(!f)return a.g.debug(e,"segment does not exist:",WB+c.startTime,"position\x3d"+d),null;var g=a.j.presentationTimeline;d=_.DD(g);g=CD(g);return!b.zf&&(c.startTime+f.endTime<d||c.startTime+f.startTime>g)?(a.g.debug(e,"segment is not available:",WB+c.startTime,hC+f.startTime,fC+f.endTime,"availabilityStart\x3d"+d,"availabilityEnd\x3d"+g),null):f};
|
|
174
|
+
FH=function(a,b,c,d,e){var f,g,k,l,m,n,p,q,t,u,y;return _.I(function(A){f=_.Qq;g=pH(b);k=PG(a,d);a.g.debug(g,"fetchAndAppend_:",eC+c,WB+k.startTime,gC+e.position,hC+e.startTime,fC+e.endTime);l=b.stream;m=b.stream.segmentIterator;n=a.j.presentationTimeline.getDuration();p=JH(a,d);q=Math.max(0,k.startTime-.1);t=p?p.startTime+.01:n;u=KH(a,b,k,q,t,e);b.Nb=!0;b.Nf=!1;a.g.debug(g,"fetching segment");y=a.F.Y.Ya(b.type)||0;u.then(function(){return a.f||a.w?null:LH(a,b,e,function(D,B){return a.f||a.w?null:
|
|
175
|
+
MH(a,b,c,k,l,e,D,B)})}).then(function(){if(!a.f&&!a.w){if(!a.j.presentationTimeline.isLive()&&b.type!==_.kk){var D=pH(b),B=(a.F.Y.Ya(b.type)||0)-y,E=e.endTime-e.startTime,C=B-E;if(Math.abs(C)>=Math.min(.01,E)&&Math.abs(C)<=Math.min(1,E)){a.g.debug(D,"Adjusted segment",e.position,"with real duration",B,"and accounted for",C,"delta between segment duration and real duration");b.zf=!0;D=a.j.periods;l.adjustSegmentDurations(e.position,C);B=fD(D,l);E=D[B];var K=l.getDuration();hD(E,K);for(B+=1;B<D.length;B++)D[B].startTime+=
|
|
176
|
+
C}}b.Nb=!1;b.fh=!1;b.wc||a.F.Tf();m&&(C=m.next().value)&&a.g.debug("New iterated segment",C);XG(a,b,0);a.D?C=!1:(a.D=NH(a),C=a.D);C&&(a.g.debug("startup complete"),C=xH(a,l).id,OH(a,C),a.F.lo&&(a.g.debug("calling onStartupComplete()..."),a.F.lo()));a.g.debug(g,"finished fetch and append")}})["catch"](function(D){return _.I(function(B){if(a.f||a.w)return B["return"]();b.Nb=!1;if(b.type===f.TEXT&&a.h.ignoreTextStreamFailures)return 1001===D.code?a.g.warn(g,"Text stream failed to download. Proceeding without it."):
|
|
177
|
+
a.g.warn(g,"Text stream failed to parse. Proceeding without it."),a.a["delete"](f.TEXT),B.C(0);if(7001===D.code)return b.Nb=!1,b.Db=null,XG(a,b,0),B.C(0);if(3017===D.code)return PH(a,b,D),B.C(0);if(1001===D.code&&D.data&&404===D.data[1])return a.g.warn(g,"request for segment failed","segment not available on server",gC+e.position,hC+e.startTime,fC+e.endTime,"error\x3d"+D),b.Nb=!1,b.Db=null,XG(a,b,1),B.C(0);if(b.type===f.TEXT){if(!(D instanceof _.O))return B["return"]();ZG(b);if(yC(D.code))a.F.onError(new _.O(1,
|
|
178
|
+
2,2010,D,void 0,D.svtaCode));else a.F.onError(new _.O(1,2,2010,D,void 0,5001));return B.C(0)}if(yC(D.code))return _.x(B,QH(a,b,k,D),0);a.g.error(g,"failed fetch and append: code\x3d"+D.code);b.Od=!0;D instanceof _.O&&D.a(_.Q);return _.x(B,RH(a,D),0)})});_.z(A)})};
|
|
179
|
+
PH=function(a,b,c){var d=pH(b);if(Array.from(a.a.values()).some(function(f){return f!==b&&f.fh}))a.g.debug(d,HB,"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.Od=!0;a.w=!0;a.F.onError(c);return}a.g.warn(d,HB,"reducing buffering goals by "+(100-Math.round(100*a.l))+"%");b.fh=!0}XG(a,b,4)};
|
|
180
|
+
QH=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.wg(b.stream,c));if(!f)return g.C(0);b.Od=!0;d.a(_.Q);return _.x(g,RH(a,d),0)})};
|
|
181
|
+
KH=function(a,b,c,d,e,f){var g,k,l,m,n,p;return _.I(function(q){g=c.startTime-f.Va;k=b.Nf||f.initSegment!==(b.ma&&b.ma.initSegment);if(!k&&g===b.$i)return q["return"]();b.$i=g;l=pH(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=IF(a.F.Y,b.type,g,d,e,b.stream.mimeType,b.stream.codecs);if(!b.stream.initSegmentReference||!k)return q["return"](m);a.g.debug(l,YB);n=f&&f.initSegment||b.stream.initSegmentReference;
|
|
182
|
+
p=SH(a,b,n,l);return q["return"](Promise.all([m,p]))})};SH=function(a,b,c,d){var e,f;return _.I(function(g){switch(g.a){case 1:return _.F(g,2),_.x(g,TH(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,UH(a,e,b),5);case 5:return _.x(g,DF(a.F.Y,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.Nf=!0,f;}})};
|
|
183
|
+
UH=function(a,b,c){var d;return _.I(function(e){if(!a.h.patchEdgeWhenMixedContent||!_.ri())return e.C(0);d=KG(b);return _.x(e,DF(a.F.Y,c.type,d.buffer,null,null,!!c.stream.closedCaptions&&0<c.stream.closedCaptions.size),0)})};
|
|
184
|
+
MH=function(a,b,c,d,e,f,g,k){k=void 0===k?!1:k;var l,m,n,p,q,t,u,y,A,D,B;return _.I(function(E){switch(E.a){case 1:l=pH(b);if(!(e&&e.keyId&&a.F.qe)){E.C(2);break}a:{var C=a.F.qe;var K=e.keyId;if(K)for(var P=_.v(C.h.keys()),T=P.next();!T.done;T=P.next()){T=C.h.get(T.value);for(var W=0;W<T.Eb.length;W++)if(T.Eb[W]===K){C=T;break a}}C=null}m=C?C.Ab: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!");
|
|
185
|
+
case 2:if(C=e.encrypted&&e.keyId&&a.F.qe)C=a.F.qe.o.get(e.keyId),C=!(!C||C!==_.df&&C!==_.ve);if(!C){E.C(7);break}ZG(b);n=xH(a,e).id;p=OH(a,n);if(!p){E.C(8);break}return _.x(E,p,8);case 8:return q=a.F.wg(e,d,aC),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 _.Vn).da("emsg",
|
|
186
|
+
a.vo.bind(a,d,f,e.emsgSchemeIdUris)).parse(g),_.x(E,VH(a,b,c),10);case 10:if(a.f)return E["return"]();A=f.startTime+d.startTime;D=f.endTime+d.startTime;a.g.debug(l,"Appending segment with "+(A.toFixed(3)+" - "+D.toFixed(3)+" KeyID: ")+(e.keyId+" Width: ")+(e.width+" Height: "+e.height+" Bitrate: ")+(_.S.vg(e.bandwidth)+" Fragment: ")+k);B=e.type===_.Kg&&null!=e.muxedAudioId&&!a.A;return _.x(E,DF(a.F.Y,b.type,g,A,D,y,e.id,k,B),11);case 11:if(a.f)return E["return"]();a.g.debug(l,"appended media segment");
|
|
187
|
+
b.nc=e;b.ma=f;_.z(E)}})};WH=function(a,b,c){(new _.Vn).N(_.Oe,_.Wn).N(_.wg,_.Wn).N(_.Je,_.Wn).N(_.Ne,_.Wn).N(_.gg,_.Wn).da(_.ig,_.Xn).N("encv",function(d){d.reader.skip(78);_.Wn(d)}).N(_.ag,_.Wn).N("schi",_.Wn).N("tenc",function(d){d.reader.skip(6);if(_.On(d.reader)){d.reader.skip(1);var e=_.Ml(_.Un(d.reader,16));e!==b.stream.keyId&&(a.g.debug(pH(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)};
|
|
188
|
+
VH=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a){if(a.f)return l["return"]();d=pH(b);a.g.debug(d,"checking buffer length");e=Math.max(a.h.bufferBehind,a.j.presentationTimeline.h);f=a.F.Y.hc(b.type);if(null==f)return a.g.debug(d,"buffer behind okay because nothing buffered:",eC+c,QB+e),l["return"]();g=c-f;k=g-e;if(.01>=k)return a.g.debug(d,"buffer behind okay:",eC+c,RB+g,QB+e,"underflow\x3d"+Math.abs(k)),l["return"]();a.g.debug(d,"buffer behind too large:",eC+c,RB+g,QB+e,"overflow\x3d"+
|
|
189
|
+
k);return _.x(l,a.F.Y.remove(b.type,f,f+k),2)}if(a.f)return l["return"]();a.g.debug(d,"evicted "+k+xB);_.z(l)})};NH=function(a){return a.I?!0:Array.from(a.a.values()).filter(function(b){return b.type!==_.kk}).every(function(b){return!b.wc&&!b.Sc&&b.ma})};OH=function(a,b){var c=null;a.B.has(b)||(c=CH(a,b).then(function(){a.f||AH(a)})["catch"](AC));DH(a);return c};
|
|
190
|
+
XH=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y,A,D,B,E;_.I(function(C){switch(C.a){case 1:c=pH(b);d=_.Qq;e=xH(a,b.stream).id;if(b.qc===e)return C["return"]();f=b.qc;g=Array.from(a.a.values());k=g.every(function(K){return K.qc===f});if(!k)return a.g.debug(c,"not all MediaStates need Period "+f),C["return"]();l=g.every(qH);if(!l)return a.g.debug(c,"all MediaStates need Period "+f+", but not all MediaStates are idle"),C["return"]();a.g.debug(c,"all need Period "+f);_.F(C,2);return _.x(C,CH(a,f),4);
|
|
191
|
+
case 4:if(a.f)return C["return"]();tF(a.F.Y);m=g.every(function(K){var P=qH(K),T=xH(a,K.stream).id;return P&&K.qc===f&&T!==f});if(!m)return a.g.debug(c,"ignoring transition to Period",f,"since another is happening"),C["return"]();n=PG(a,f);a.g.debug(c,"Streaming period",f,n);a.G=!1;a.g.debug(c,"calling onChooseStreams()...");p=a.F.Sg(n);a.I=!p.audio&&!p.video&&!!p.text;q=BH(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 "+
|
|
192
|
+
y+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();A=_.v(Array.from(q.keys()));for(u=A.next();!u.done;u=A.next())if(D=u.value,!a.a.has(D))if(D===d.TEXT)iH(a,{text:q.get(d.TEXT)},n.startTime),q["delete"](D);else return a.g.error(c,"invalid Streams chosen: unusable "+D+" Stream"),a.F.onError(new _.O(_.Q,5,5005)),C["return"]();B=Array.from(a.a.keys());E=B.map(function(K){var P;return _.I(function(T){if(1==T.a)return P=q.get(K),P?_.x(T,cH(a,P,!1,0),3):(a.a["delete"](K),T.C(0));XG(a,a.a.get(K),
|
|
193
|
+
0);_.z(T)})});return _.x(C,Promise.all(E),5);case 5:if(a.f)return C["return"]();AH(a);_.G(C,0);break;case 2:_.H(C),_.z(C)}})};VG=function(a,b){var c=dD(a.j.periods,b+_.rw);return c?c.id:null};xH=function(a,b){var c=a.j.periods,d=fD(c,b);c=c[d];if(!c)throw new _.O(_.Q,5,5006,"No period found for stream with ID "+b.id+".");return c};YH=function(a,b){if(a.F.Dd){var c=b.Oa;if(c)return a.F.Dd.getBaseUriCollectionById(c.id)}return null};
|
|
194
|
+
ZH=function(a,b,c){if(a.F.Dd&&b){c&&0===c.request.uriIndex||a.F.Dd.banLocation(b.pa[0].serviceLocationId);var d=c.request,e=c.timeMs;c=c.data.byteLength;e&&c&&a.F.Dd.notifyThroughput(b.pa[d.uriIndex].serviceLocationId,e,c)}};
|
|
195
|
+
LH=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){if(1==y.a)return e=$H(a,c,b.type),f=c.f(),g=c.Fd||a.h.disableFragmentSupport||!!f,k=!1,e.onFragment=g?null:function(A){k=!0;return d(A.data,!0)},e.disableMergedFragments=a.h.disableMergedFragments,a.g.debug("fetching media segment",c),l=aI(a,b,c,!1),m=bI(a,e,b,c,l),n=a.F.xe(),(p=b.cc)&&a.h.enableStalledSegmentAbort&&n.beginSegmentMonitor(p,1E3*a.h.rebufferingGoal),_.x(y,m,2);q=y.f;t=q.timeMs;u=q.data.byteLength;t&&u&&n.segmentDownloaded(t,
|
|
196
|
+
u);return k?y["return"]():_.x(y,d(q.data,!1),0)})};TH=function(a,b,c){var d,e,f,g;return _.I(function(k){if(1==k.a)return d=_.Qq,e=$H(a,c,b.type),e.responseModifiers.push(function(l){WH(a,b,l.data)}),b.type===d.VIDEO&&a.h.overridePasp&&e.responseModifiers.push(a.wp.bind(a)),a.g.debug(YB,c),f=aI(a,b,c,!0),_.x(k,bI(a,e,b,c,f),2);g=k.f;return k["return"](g.data)})};
|
|
197
|
+
bI=function(a,b,c,d,e){var f=YH(a,d);b=_.dm(a.F.Mb,b,e);c.cc=b;return b.U.then(function(g){ZH(a,f,g);c.cc=null;return g})["catch"](function(g){ZH(a,f);throw g;})};
|
|
198
|
+
aI=function(a,b,c,d){var e=zH(a,b,a.F.Hb(),c.endTime,xH(a,b.stream).id);if(d)var f="i";else a:{if(f=b.stream){var g=f.type;if(g===_.Kg){f=GC(f.type,_.Im(f.mimeType,f.codecs))?"av":"v";break a}if(g===_.Rc){f="a";break a}if(g===_.mg){f=f.mimeType===_.Kc?"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}};
|
|
199
|
+
$H=function(a,b,c){var d=[],e=YH(a,b);e&&(d=b.Kd(),d=_.tE(e,d));d.length||(d=b.Ia());a=_.lD(d,b.la,b.fa,a.h.attemptParameters,b.startTime,b.endTime,c,b.timescale);a.type=2;if(b=b.f())a.keyInfo=b;return a};
|
|
200
|
+
uH=function(a,b,c,d){var e,f,g,k;return _.I(function(l){if(1==l.a)return e=pH(b),b.wc=!1,b.gg=!1,b.tf=0,b.Sc=!0,b.stream.segmentIterator=null,a.g.debug(e,"clearing buffer"),d?(g=a.F.Hb(),k=a.F.Y.getDuration(),f=a.F.Y.remove(b.type,g+d,k)):f=a.F.Y.clear(b.type).then(function(){return!a.f&&c?a.F.Y.flush(b.type):null}),_.x(l,f,2);if(a.f)return l["return"]();a.g.debug(e,"cleared buffer");b.nc=null;b.ma=null;b.Sc=!1;b.endOfStream=!1;b.zf=!1;XG(a,b,0);_.z(l)})};
|
|
201
|
+
XG=function(a,b,c){a.g.debug(pH(b),"updating in "+c+xB);b.Db=(new _.mi(function(){var d;return _.I(function(e){if(1==e.a)return _.F(e,2),_.x(e,a.rc(b),4);if(2!=e.a)return _.G(e,0);d=_.H(e);if(a.F)a.F.onError(d);_.z(e)})})).ia(c)};ZG=function(a){null!=a.Db&&(a.Db.stop(),a.Db=null)};PG=function(a,b){var c=a.j.periods.find(function(d){return d.id===b})||null;if(!c)throw new _.O(_.Q,5,5006,"Period "+b+" not found");return c};
|
|
202
|
+
JH=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};$G=function(a){return _.I(function(b){return a.cc?_.x(b,a.cc.abort(),0):b.C(0)})};BH=function(a){var b=new Map;a.audio&&b.set(_.Rc,a.audio);a.video&&b.set(_.Kg,a.video);a.text&&b.set(_.kk,a.text);return b};
|
|
203
|
+
RH=function(a,b){var c;return _.I(function(d){switch(d.a){case 1:if(a.f)return d["return"]();if(!a.F.Tj){d.C(2);break}_.F(d,3);return _.x(d,a.F.Tj(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)}})};pH=function(a){return"("+a.type+":"+a.stream.id+")"};qH=function(a){return!a.Nb&&null==a.Db&&!a.wc&&!a.Sc};cI=function(){this.a=null};
|
|
204
|
+
fI=function(){_.Cn.call(this,TB);var a=this;this.H=dI;this.yd=this.j=this.na=null;this.wh=!1;this.o=new _.gi;this.W=this.zh=this.Pf=this.I=this.wd=this.B=this.M=this.A=null;this.Ke=!1;this.a=this.K=this.J=null;this.T=[];this.f=null;this.h=new _.dG;this.ba=this.vd=null;this.ak=1E9;this.Vf=new Set;this.Fa=null;this.$j=!1;this.Zj=0;this.ha=null;this.l=new mG;this.G=null;this.ud=new HE({isSeeking:function(){return a.rh},Kn:function(b){null!==a.I&&(a.I.w=10===b);a.G&&_.Bq(a.G.a,b)},mo:function(){a.W&&
|
|
205
|
+
a.W.stop()},trigger:function(b){return a.trigger(b)}});this.Ge=new sG(this.configuration.preferredAudioLanguage||[],this.configuration.preferredAudioRole,this.configuration.preferredAudioChannelCount,this.configuration.preferSpatialAudio,this.configuration.mediaSource.codecSwitchingStrategy);this.ue=this.configuration.preferredTextLanguage;this.w=new jG;this.Ba=this.Tb=null;this.od=new Map;this.Je=null;this.Mf=this.configuration.preferredTextRole;this.re=this.configuration.preferForcedSubtitles;this.o.on(window,
|
|
206
|
+
"online",function(){a.H===eI&&rH(a.a)});this.Xf=this.De=this.Yf=null;this.X=_.ta;this.Le=new cI;this.we=null};gI=function(a){return new _.YC(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,_.jh(e.value.renditions))}return d.find(function(f){return f.id===b.toString()})||null})};
|
|
207
|
+
hI=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.vd&&(a.vd.release(),a.vd=null),_.x(c,_.Cn.prototype.release.call(a),4);case 4:return _.x(c,a.unload(),5);case 5:IE(a.ud,0),_.z(c)}})};iI=function(a){return _.I(function(b){if(1==b.a)return _.x(b,Promise.all(a.T.map(function(c){return c.stop()})),2);a.T=[];_.z(b)})};jI=function(a){a.T.map(function(b){return b.requestStop()})};
|
|
208
|
+
kI=function(a){var b=new _.cw;(a=a.playlist)&&a.cropTimeline&&(a.startTime||a.endTime)&&(b.h={start:a.startTime||null,end:a.endTime||null});return b};
|
|
209
|
+
nI=function(a,b){var c,d,e;return _.I(function(f){c=a.T[a.T.length-1];b.periods.forEach(function(g){g.parser=c});a.X===_.ta?(lI(a,b.cues),nH(a.a,b)):a.X===_.ob&&(a.f=QE(a.f,ME(b)),d=a.configuration.playlist.endTime,e=a.f.presentationTimeline.a.a,d&&e>d&&(a.log.info("Reached end of playlist. Turning timeline static."),jI(a),a.T=[],_.wD(a.f.presentationTimeline,!0),a.trigger(new _.R(_.Ce))),mI(a,a.f),nH(a.a,a.f));_.z(f)})};
|
|
210
|
+
oI=function(a){return _.I(function(b){jI(a);a.T=[];a.X===_.ob?a.trigger(new _.R(_.Uf)):a.trigger(new _.R(_.Ce));_.z(b)})};
|
|
211
|
+
mI=function(a,b){var c=a.getMediaPosition(),d=a.De,e=b.periods,f=d.a;d.a=[];var g=null,k=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?k.a+=m:(g=l.configurationId||"",k=new _.bw(g||"",l.startTime,m,!1),d.a.push(k))}d.h&&(k=d.h,g=k.start,k=k.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!=k&&g&&k>=g.f&&k<=g.f+g.a&&(g.a=k-g.f));xC(d,c);a:if(c=d.a,f.length!==c.length)f=!1;else{for(d=
|
|
212
|
+
0;d<f.length;d++)if(!f[d].wa(c[d])){f=!1;break a}f=!0}!f&&a.trigger(new _.R(_.Vf));ND(a.Xf);KD(a.K,b.cues)};uI=function(a){var b,c;return _.I(function(d){if(1==d.a)return pI(a),_.x(d,qI(a),2);if(3!=d.a){rI(a);b=_.ti(4)||_.ti(5);if(!b)return d.C(3);c=a.getSurface().getMedia();sI(a,c);return _.x(d,tI(a,c),3)}a.configuration=a.wb;_.z(d)})};
|
|
213
|
+
vI=function(a,b){return _.I(function(c){if(1==c.a){if(!a.configuration.contentSteering.enabled)return c.C(2);if(a.ba)return c.C(3);a.ba=new vE(a.configuration.contentSteering,a.getNetworkEngine());a.ba.on(UB,function(d){a.trigger(d)});return _.x(c,xE(a.ba,b),3)}return 2!=c.a?c["return"](a.ba):c["return"](null)})};
|
|
214
|
+
DI=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:return d=Date.now()/1E3,e=new _.pl,a.w.a=e,wI(a,b),_.F(l,2),pI(a),_.x(l,xI(a),4);case 4:return lG(a.w,e),a.ea=_.Kq(b),a.configuration=_.An([a.wb,b]),VC(a.configuration.xmlParser),a.we&&a.configuration.mse.sendPlaybackSessionIdHeader&&a.getNetworkEngine().headers.set(PB,a.we),a.log.info(_.bb,a.configuration),a.log.info(_.sb,a.ea),_.x(l,yI(a,e),5);case 5:return lG(a.w,e),_.x(l,zI(a,b,a.getSourceIndex(),e,!1),
|
|
215
|
+
6);case 6:return f=l.f,lG(a.w,e),a.T=[f.parser],a.f=f.manifest,lI(a,f.manifest.cues),g=a,_.x(l,AI(a,a.f,a.configuration),7);case 7:g.A=l.f;lG(a.w,e);if(!c){l.C(8);break}return _.x(l,BI(a,e),9);case 9:lG(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:k=_.H(l),CI(a,k,e),_.z(l)}})};
|
|
216
|
+
wI=function(a,b){b.cmcd&&b.cmcd.enabled&&(b.cmcd.sessionId||(b.cmcd.sessionId=a.we?a.we:void 0),a.vd=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),Md:a.Md.bind(a)}))};
|
|
217
|
+
lI=function(a,b){if(a.configuration.ads.hls.mockCuesFn){var c=a.configuration.ads.hls.mockCuesFn(a);KD(a.K,c)}else KD(a.K,b)};CI=function(a,b,c){b=EI(a,b,c);c["catch"](function(){});c.reject(b);a.onError(b);throw b;};EI=function(a,b,c){var d=a.w;return null!=d.a&&d.a===c||b instanceof _.O&&7E3===b.code?b instanceof _.O?b:new _.O(_.Q,7,7003,"Unexpected error.",b):kG(a.w)};xI=function(a){return a.na?a.na["catch"](function(){}):Promise.resolve()};
|
|
218
|
+
yI=function(a,b){var c;return _.I(function(d){if(1==d.a)return a.G=new _.Gq,IE(a.ud,2),c=FI(a,a.configuration),_.x(d,tI(a,c),2);lG(a.w,b);a.K=new ID;JD(a.K,function(e){a.log.info("Timeline cue found",e);GI(a,_.qg,e)},function(){a.log.info("Timeline cues changed");a.trigger(new _.R(_.tg))});_.z(d)})};
|
|
219
|
+
zI=function(a,b,c,d,e){var f,g,k,l,m;return _.I(function(n){switch(n.a){case 1:return f=b,g=_.Kq(f),k=g[c],_.x(n,HI(a,k),2);case 2:return l=n.f,lG(a.w,d),_.qp(bC),_.x(n,II(a,l,k,f.id||""),3);case 3:m=n.f;lG(a.w,d);m.periods.forEach(function(p){p.parser=l});if(!e||!m.presentationTimeline.o){n.C(4);break}return _.x(n,l.stop(),5);case 5:lG(a.w,d);case 4:return _.qp("manifest.end"),_.sp("Fetch and parse manifest",bC,"manifest.end"),n["return"]({parser:l,manifest:m})}})};
|
|
220
|
+
JI=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,zI(a,b,0,null,!0),2);c=f.f;try{return d=[a.f,ME(c.manifest)],e=PE(d,a.f.presentationTimeline),f["return"]({parser:c.parser,manifest:e})}catch(g){throw new _.O(_.Q,7,7003,"Failed to append load manifest");}})};FI=function(a,b){var c=a.getSurface().getMedia();c.loop=!!b.loop;_.N.R(b.volume)||a.setVolume(b.volume);_.N.R(b.muted)||a.setMuted(b.muted);sI(a,c);return c};
|
|
221
|
+
sI=function(a,b){a.j||(a.o.on(b,_.le,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 _.O(_.Q,3,3016,{code:c,extendedError:d,message:a.j.error.message})}}else c=null;if(c)a.onError(c)}),a.j=b)};rI=function(a){a.j&&(a.o.off(a.j,_.le),a.j=null);a.W&&(a.W.stop(),a.W=null)};
|
|
222
|
+
qI=function(a){var b;return _.I(function(c){switch(c.a){case 1:a.H!==KI&&(a.H=dI);if(b=a.j)a.o.off(b,_.Ee),a.o.off(b,_.vf),a.o.off(b,_.ef),a.o.off(b,_.ke),a.o.off(b,_.Lf),a.o.off(b,_.Jf);a.K&&(a.K.release(),a.K=null);a.wd&&(a.wd.release(),a.wd=null);a.W&&(a.W.stop(),a.W=null);return _.x(c,iI(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.ba){c.C(7);break}return _.x(c,a.ba.destroy(),8);case 8:a.ba=
|
|
223
|
+
null;case 7:a.B&&(a.B.release(),a.B=null);a.I&&(a.I.release(),a.I=null);if(!a.M){c.C(9);break}return _.x(c,a.M.destroy(),10);case 10:a.M=null;case 9:a.yd&&(a.yd.release(),a.yd=null);a.Pf&&(a.Pf.release(),a.Pf=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.Vf.clear(),a.f=null,a.G=null,a.od.clear(),a.Ke=!1,LI(a),_.z(c)}})};
|
|
224
|
+
tI=function(a,b){var c,d,e,f,g;return _.I(function(k){if(1==k.a)return c=window.muxjs?new nF:new _.oF,d=_.yq(a.configuration,[_.se,iC]),e=d.create(a),a.L=e,f=gI(a),f.track(a),a.yd=f,g=new _.qF(b,c,e,f,a.configuration),_.x(k,g.open(),2);a.M=g;_.z(k)})};HI=function(a,b){var c,d;return _.I(function(e){if(1==e.a)return c=a.getNetworkEngine(),_.x(e,_.ew(b.url,c,a.configuration.manifest.attemptParameters,b.type||null),2);d=e.f;d.configure(a.configuration.manifest);return e["return"](d)})};
|
|
225
|
+
II=function(a,b,c,d){return(new _.Rl(Promise.resolve().then(function(){var e,f,g;return _.I(function(k){switch(k.a){case 1:e=null;case 2:if(e){k.C(3);break}_.F(k,4);var l=c.url;var m=MI(a,d);l=b.start(l,m);return _.x(k,l,6);case 6:e=k.f;_.G(k,2);break;case 4:f=_.H(k);if(!a.yc)throw f;return _.x(k,a.yc(c.url,f),8);case 8:if(g=k.f)c.url=g;else throw f;k.C(2);break;case 3:if(0===e.periods.length)throw new _.O(_.Q,4,4014);NI(e.periods);return k["return"](e)}})}),function(){a.log.info("Aborting parser step...");
|
|
227
226
|
return b.stop()})).U};
|
|
228
|
-
|
|
229
|
-
if(A.length&&!a.configuration.disableRestrictions){A=a.getPeriods();for(var B=0;B<A.length;B++)for(var E=A[B],C=_.v(E.variants),K=C.next();!K.done;K=C.next()){K=K.value;var P=[];K.audio&&P.push(K.audio);K.video&&P.push(K.video);P=_.v(P);for(var T=P.next();!T.done;T=P.next()){T=T.value;var W=K.allowedByKeySystem;if(T.keyId){var oa=t[D?"00":T.keyId];oa=!!oa&&!
|
|
230
|
-
a.log.warn("DRM Key not available for KID: '"+(T.keyId+"'. Applying restrictions to "+oa)));E===u&&W!==K.allowedByKeySystem&&(y=!0)}}}if(t=
|
|
231
|
-
Jd:function(){return a.Jd()}});e=b.periods.every(function(t){return t.variants.some(function(u){return u.drmInfos.some(function(y){return y.licenseServerUriOrigin===_.
|
|
232
|
-
_.
|
|
233
|
-
|
|
234
|
-
b),a.h.configure(a.configuration.abr),a.
|
|
235
|
-
Wd:function(t){c.playbackRate=t},
|
|
236
|
-
e=
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(a.log.debug("Buffering state changed. Is buffering",d,"buffered to end",b,"state",a.getState()),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());k=
|
|
245
|
-
m.video,c,d),4)}
|
|
246
|
-
|
|
247
|
-
k=!1;l=void 0;if(d){if(l=g.find(function(D){return D.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),k=!0,m=a.getTrackManager().
|
|
248
|
-
Error("Audio codecs not compatible with active audio.");return _.x(A,f.parser.loadVariant(l,f.id),4);case 4:return t=A.f,u=t.audio,a.
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
_.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
d=a.h.chooseTrack(),
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
missingKeys:g,restrictedKeyStatuses:k});};
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
a.f.periods=g.periods;m=
|
|
274
|
-
B.video&&y.add(B.video),B.audio&&y.add(B.audio);E=a.getNetworkEngine();C=_.v(_.jh(y).concat(_.jh(m.textStreams)));for(K=C.next();!K.done;K=C.next())P=K.value,u.push(P.createSegmentIndex(E,a.configuration.streaming.attemptParameters));return _.x(W,Promise.all(u),7);case 7:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
_.
|
|
282
|
-
_.r.aa=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.r.
|
|
283
|
-
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.Lf=_.hh(13);_.r.Kf=_.hh(15);_.r.Cd=_.hh(9);_.r.$f=_.hh(17);_.r.Ye=_.hh(19);_.
|
|
227
|
+
AI=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:_.qp("initDrm.start");d=new _.xp({Mb:a.getNetworkEngine(),onError:function(t){return a.onError(t)},Vg:function(t){if(a.a){var u=jF(a),y=!1,A=Object.keys(t);0===A.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 D=1===A.length&&"00"===A[0];D&&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.");
|
|
228
|
+
if(A.length&&!a.configuration.disableRestrictions){A=a.getPeriods();for(var B=0;B<A.length;B++)for(var E=A[B],C=_.v(E.variants),K=C.next();!K.done;K=C.next()){K=K.value;var P=[];K.audio&&P.push(K.audio);K.video&&P.push(K.video);P=_.v(P);for(var T=P.next();!T.done;T=P.next()){T=T.value;var W=K.allowedByKeySystem;if(T.keyId){var oa=t[D?"00":T.keyId];oa=!!oa&&!OI.includes(oa);K.allowedByKeySystem=oa}W!==K.allowedByKeySystem&&(oa=T.type,T.type===_.Kg&&(oa="video "+T.width+"x"+T.height+"@"+_.S.vg(T.bandwidth)),
|
|
229
|
+
a.log.warn("DRM Key not available for KID: '"+(T.keyId+"'. Applying restrictions to "+oa)));E===u&&W!==K.allowedByKeySystem&&(y=!0)}}}if(t=QG(a.a)){D=SG(a.a);A=TG(a.a);a:{B=t.variants;for(E=0;E<B.length;E++)if(B[E].audio===D&&B[E].video===A){D=B[E];break a}D=null}if(!D||D.allowedByKeySystem)a.log.info(DB),PI(a),QI(a,t.variants)}y&&t!==u&&(a.log.info(DB),PI(a),QI(a,u.variants))}},Ug:function(t,u){a.trigger(new _.R(_.Zd,{expirationTime:u}))},onEvent:function(t){return a.Cg(t)},getConfiguration:function(){return a.getConfiguration()},
|
|
230
|
+
Jd:function(){return a.Jd()}});e=b.periods.every(function(t){return t.variants.some(function(u){return u.drmInfos.some(function(y){return y.licenseServerUriOrigin===_.XB})})});c.drmResolver&&(f=c.drmResolver({hasLaurl:e}),(c.drm=f)&&_.ir(c.drm));g=c.drm;k=_.gl(g);d.f=k;l=g?g.offlineId||"":"";m=[];n=_.yv(b.periods);if(!l){q.C(2);break}p=_.br(_.ff);if(!p){q.C(2);break}return _.x(q,p.f(a,n),4);case 4:return _.x(q,p.a(l),5);case 5:m=q.f;case 2:return _.x(q,_.Cp(d,n,m),6);case 6:return a.A=d,RI(a,b.periods),
|
|
231
|
+
_.qp("initDrm.end"),_.sp("Init DRM","initDrm.start","initDrm.end"),q["return"](d)}})};
|
|
232
|
+
BI=function(a,b){var c,d,e,f,g,k,l,m,n,p;return _.I(function(q){if(1==q.a)return c=a.j,SI(a,c),TI(a,a.f.periods),a.Ge=new sG(a.configuration.preferredAudioLanguage||[],a.configuration.preferredAudioRole,a.configuration.preferredAudioChannelCount,a.configuration.preferSpatialAudio,a.configuration.mediaSource.codecSwitchingStrategy),a.ue=a.configuration.preferredTextLanguage,a.Mf=a.configuration.preferredTextRole,a.re=a.configuration.preferForcedSubtitles,_.x(q,_.Tp(a.A,c),2);if(3!=q.a)return lG(a.w,
|
|
233
|
+
b),a.h.configure(a.configuration.abr),a.ih&&a.h.setCmsdManager(a.ih),a.h.init(function(t,u,y){var A,D,B;return _.I(function(E){if(1==E.a){if(!UI(a))return E["return"]();a.log.info("ABR switch to "+t.width+"x"+t.height);A=VI(a).find(function(C){return C.id===t.id})||null;if(!A)return a.log.warn("No matching variant found for track switch"),E.C(0);D=jF(a);return _.x(E,D.parser.loadVariant(A,D.id),3)}B=E.f;WI(a,B,u,y);_.z(E)})}),a.B=XI(a,c,a.configuration.startTime),a.wd=YI(a),a.I=new EG({Dc:function(){return c.playbackRate},
|
|
234
|
+
Wd:function(t){c.playbackRate=t},qn:function(t){c.currentTime+=t}}),FG(a.I,a.configuration.trickPlay),a.isLive()&&a.configuration.streaming.enableLiveEdgeChasing&&(a.Pf=new BG(a)),d=Math.max(1E-4,a.configuration.streaming.rebufferingGoal),ZI(a,d),$I(a)?TF(a.f,_.Fj(a.configuration.preferredVideoCodec),_.Fj(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):SF(a.f,_.Fj(a.configuration.preferredVideoCodec),_.Fj(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount),
|
|
235
|
+
e=aJ(a),e.h=a.configuration.streaming,a.a=e,a.H=eI,_.x(q,e.start(),3);lG(a.w,b);a.configuration.streaming.startAtSegmentBoundary&&(f=a.B.getTime(),g=bJ(a,f),cE(a.B.f,g));k=_.v(a.f.periods);for(l=k.next();!l.done;l=k.next())m=l.value,cJ(a,m);PI(a);n=VI(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");QI(a,n);_.z(q)})};UI=function(a){return a.a?a.a.G:!1};
|
|
236
|
+
SI=function(a,b){function c(d){a.j&&a.J&&(d.type===_.Xf&&a.xd?(a.J.a=yG,LI(a)):d.type===_.Ug&&8===a.getState()&&.1>a.getBufferInfo().Za(a.getMediaPosition())?(a.J.a=yG,LI(a)):a.J&&dJ(a));eJ(a)}a.o.on(b,_.vf,c);a.o.on(b,_.ef,c);a.o.on(b,_.ke,c);a.o.on(b,_.Xf,c);a.o.on(b,_.Wf,c);a.o.on(b,_.Jf,c);a.o.on(b,_.Ug,c);a.o.on(b,_.Lf,function(){if(a.j){var d=a.j.playbackRate;0!==d&&a.I.set(d)}})};
|
|
237
|
+
NI=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)})){_.Ph("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)}};XI=function(a,b,c){return new hE(b,a.f,a.configuration.streaming,c,function(d){a.wd&&jE(a.wd,!0,d);a.a&&oH(a.a)},function(d){return a.dispatchEvent(d)},a.X===_.ob)};
|
|
238
|
+
YI=function(a){var b=new kE(a.j),c=new CG(a.f);DG(c,function(){PI(a)});b.a.add(c);a.K&&(c=new mE(a.K),nE(c,function(d){d.Rf&&d.Rf();GI(a,_.rg,d)},function(d){d.Tg&&d.Tg();GI(a,_.sg,d)},function(d,e){e||(d.Rf&&d.Rf(),GI(a,_.rg,d),d.Tg&&d.Tg(),GI(a,_.sg,d))}),b.a.add(c));a.X===_.ob&&(c=new MD(a.De,a.Le,function(d){return a.trigger(d)},a.configuration.playlist),b.a.add(c),a.Xf=c);return b};ZI=function(a,b){a.J=new zG(b,Math.min(.5,b/2));a.J.a=yG;LI(a);a.W=(new _.oi(function(){dJ(a)})).Rb(.25)};
|
|
239
|
+
dJ=function(a){if(a.j){switch(a.H){case eI:a:if(a.j.ended||zF(a.M))var b=!0;else{if(a.isLive()){b=CD(a.f.presentationTimeline);var c=a.getBufferInfo();if(null!==c&&(c=c.Ya(),null!==c&&c>=b)){b=!0;break a}}b=!1}break;default:b=!1}if(a.M){var d=BF(a.M);c=d.video;d=d.audio;var e=a.j.currentTime;c&&d?(c=c.Za(e),d=d.Za(e),c=Math.min(c,d)):c=c?c.Za(e):d?d.Za(e):0}else c=0;if(d=a.J){d=a.J;var f=b,g=d.f.get(d.a);e=d.a;c=f||c>=g?xG:yG;d.a=c;d=e!==c}c=d;(d=fJ(a))&&a.vd&&(a.vd.f=!0);c||6===a.getState()&&!d?
|
|
240
|
+
(a.log.debug("Buffering state changed. Is buffering",d,"buffered to end",b,"state",a.getState()),LI(a)):a.Ke&&eJ(a)}};aJ=function(a){var b={configuration:{an:a.X===_.ob},Hb:function(){return a.B.getTime()},Y:a.M,Mb:a.getNetworkEngine(),Dd:a.ba,Sg:a.vl.bind(a),ij:a.Hn.bind(a),onError:a.onError.bind(a),jj:a.Qn.bind(a),onEvent:a.Cg.bind(a),nj:a.vp.bind(a),Tf:a.fo.bind(a),xe:function(){return a.h},wg:a.yk.bind(a),Tj:a.ip.bind(a),qe:a.A};return new _.OG(a.f,b)};
|
|
241
|
+
cF=function(a,b){var c,d,e;return _.I(function(f){switch(f.a){case 1:c=_.gJ;if(!a.f||!a.a){f.C(0);break}d=jF(a);return _.x(f,d.parser.loadTextStream(b.id,d.id),3);case 3:return e=f.f,_.x(f,YG(a.a,e),4);case 4:return hJ(a,d,e,!1),_.x(f,iJ(a,e),5);case 5:a.ue=e.language,a.re=e.kind===c.Ch,_.z(f)}})};
|
|
242
|
+
$E=function(a,b,c){c=void 0===c?!1:c;var d=void 0===d?0:d;var e,f,g,k,l,m,n;_.I(function(p){if(1==p.a){if(!a.f||!a.a)throw Error("Player not ready to select tracks.");e=jF(a);if(!e)throw Error(IB);if(!b)return a.Ba=null,null!=a.Je&&(a.Ge=a.Je,a.Je=null),a.configuration.abr.enabled||(a.log.info("Enable ABR Selection"),a.configuration.abr.enabled=!0,a.h.enable()),f=QI(a,e.variants),g=f.variant,null!=g&&UI(a)&&WI(a,g),p["return"]();a.configuration.abr.enabled&&(a.log.info("Disable ABR and enable manual track selection to select "+
|
|
243
|
+
(b.width+"x"+b.height+"@"+b.bandwidth)),a.configuration.abr.enabled=!1,a.h.disable());k=VI(a);l=k.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(!aG(l))throw a.log.error("Unable to switch to restricted track",b.id),Error("Unable to switch to restricted track.");a.Ba=l.video.id;return _.x(p,e.parser.loadVariant(l,e.id),2)}if(4!=p.a){m=p.f;if(n=!!kF(a.l,e).rb){if(!m.video)return p.C(4);jJ(a,e,m.video,!1);return _.x(p,hH(a.a,
|
|
244
|
+
m.video,c,d),4)}kJ(a,e,m,!1);return _.x(p,GJ(a,m,c,d),4)}null==a.Je&&(a.Je=a.Ge);a.Ge=new tG(l);QI(a,e.variants);_.z(p)})};
|
|
245
|
+
IJ=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,t,u,y;_.I(function(A){switch(A.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(D){return D.id===b});if(!c){A.C(2);break}return _.x(A,HJ(a,c),3);case 3:return A["return"]();case 2:d=TG(a.a);e=SG(a.a);f=jF(a);if(!f)throw Error(IB);g=VI(a).filter(function(D){return D.audio.id===b&&aG(D)});
|
|
246
|
+
k=!1;l=void 0;if(d){if(l=g.find(function(D){return D.video.id===d.id}),!l&&(a.log.debug("Cannot find exact variant, looking for anything else that matches with given audioId"),k=!0,m=a.getTrackManager().Ra()))n=m.renditions.map(function(D){return D.id}),l=g.find(function(D){return n.find(function(B){return B===String(D.video.id)})})}else l=g[0];if(!l)throw Error("Variant with target audio track not found.");q=(p=!!kF(a.l,f).rb)?!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."),
|
|
247
|
+
Error("Audio codecs not compatible with active audio.");return _.x(A,f.parser.loadVariant(l,f.id),4);case 4:return t=A.f,u=t.audio,a.Tb=u.id,y=g.map(RE),a.h.setTracks(y),kJ(a,f,t,!1),k||!UI(a)?_.x(A,GJ(a,t,!0,0),0):_.x(A,jH(a.a,u),0)}})};
|
|
248
|
+
HJ=function(a,b){var c,d,e,f,g;return _.I(function(k){c=jF(a);if(!c)throw Error(IB);d=c.variants.filter(function(l){return l.video&&l.video.muxedAudioId===b.groupId&&aG(l)});if(0===d.length)throw Error("No variants containing muxed audio found.");e=d[0];(f=TG(a.a))&&(e=d.find(function(l){return l.video.id===f.id})||null);g=e&&e.video;if(!g)return k["return"]();a.Tb=b.id;a.log.info("Select muxed audio track "+b.id);JJ(a,c,b,!1);return _.x(k,gH(a.a),0)})};
|
|
249
|
+
fF=function(a){var b=a.wh;return a.f?a.M.getTextDisplayer().isTextVisible():b};bF=function(a,b){var c,d,e,f;return _.I(function(g){c=a.wh;d=b;if(c===d)return g["return"]();a.wh=d;if(a.H!==eI)return g.C(0);a.M.getTextDisplayer().setTextVisibility(b);if(a.configuration.streaming.alwaysStreamText)return g.C(0);if(!b)return aH(a.a),g.C(0);e=jF(a);f=_.cG(e.textStreams,a.ue,a.Mf,a.re);return 0<f.length?_.x(g,YG(a.a,f[0]),0):g.C(0)})};
|
|
250
|
+
kJ=function(a,b,c,d){b.parser&&b.parser.setCurrentVariant(c);c.video&&jJ(a,b,c.video,d);c.audio&&KJ(a,b,c.audio,d)};KJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;a=kF(a.l,b);a.audio=c;a.rb=null;mF(e,c.id,_.im,d);c=e.$a();uC(f,c,d)}};
|
|
251
|
+
jJ=function(a,b,c,d){var e=a.getTrackManager();if(e){var f=a.G.f;kF(a.l,b).video=c;mF(e,c.id,_.jm,d);a=e.sa();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}))}};JJ=function(a,b,c,d){b=kF(a.l,b);b.audio=null;b.rb=c;if(b=a.getTrackManager())a=a.G.f,mF(b,c.id,_.im,d),c=b.$a(),uC(a,c,d)};
|
|
252
|
+
hJ=function(a,b,c,d){kF(a.l,b).text=c;if(b=a.getTrackManager())mF(b,c.id,_.hm,d),c=b.ib(),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}))};LJ=function(a){return a.X===_.ob&&"flat"===a.configuration.playlist.timeline};
|
|
253
|
+
TI=function(a,b){for(var c=0;c<b.length;c++){for(var d=b[c],e=new Map,f=_.v(VI(a)),g=f.next();!g.done;g=f.next())if(g=g.value,g.video&&g.video.closedCaptions){g=g.video;for(var k=_.v(g.closedCaptions.keys()),l=k.next();!l.done;l=k.next())if(l=l.value,!e.has(l)){var m={id:a.ak++,originalId:l,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:function(){return null},getSegmentReference:function(){return null},initSegmentReference:null,Va:0,mimeType:_.Ic,codecs:"",kind:_.gd,encrypted:!1,
|
|
254
|
+
keyId:null,language:g.closedCaptions.get(l),label:null,type:_.kk,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)}};
|
|
255
|
+
MJ=function(a,b){if(a.configuration.streaming.disableAudioTracks){for(var c=_.v(b),d=c.next();!d.done;d=c.next()){var e=_.v(d.value.variants);for(d=e.next();!d.done;d=e.next())delete d.value.audio}a.log.debug("Audio removed due to disableAudioTracks")}if(a.configuration.streaming.disableVideoTracks){c=_.v(b);for(d=c.next();!d.done;d=c.next())for(e=_.v(d.value.variants),d=e.next();!d.done;d=e.next()){d=d.value;var f=d.video;f&&!GC(f.type,_.Im(f.mimeType,f.codecs))&&delete d.video}a.log.debug("Video removed due to disableVideoTracks")}};
|
|
256
|
+
RI=function(a,b){MJ(a,b);for(var c=a.a?SG(a.a):null,d=a.a?TG(a.a):null,e=!$I(a),f=_.v(b),g=f.next();!g.done;g=f.next())YF(a.A,c,d,g.value,e);c=FC(b,function(k){return k.variants.some(aG)});if(0===c)throw new _.O(_.Q,4,4032);if(c<b.length)throw new _.O(_.Q,4,4011);c=_.v(b);for(d=c.next();!d.done;d=c.next())d=d.value,VF(d.variants,a.configuration.restrictions)&&a.a&&jF(a)===d&&PI(a),NJ(a,d.variants)};
|
|
257
|
+
cJ=function(a,b){MJ(a,[b]);var c=b.variants,d=a.a?SG(a.a):null,e=a.a?TG(a.a):null,f=!$I(a);YF(a.A,d,e,b,f);if(!c.some(aG))throw new _.O(_.Q,4,4011);NJ(a,b.variants);VF(c,a.configuration.restrictions)&&a.a&&jF(a)===b&&PI(a);if(!_.ti(2)&&(d=a.A?a.A.getDrmInfo():null))for(c=_.v(c),e=c.next();!e.done;e=c.next())for(e=_.v(e.value.drmInfos),f=e.next();!f.done;f=e.next())if(f=f.value,f.keySystem===d.keySystem){f=_.v(f.initData||[]);for(var g=f.next();!g.done;g=f.next())g=g.value,_.Wp(a.A,g.keyId,g.initData)||
|
|
258
|
+
_.Np(a.A,g.initDataType,g.initData,g.keyId)}};GJ=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;return _.I(function(e){return UI(a)?_.x(e,eH(a.a,b,c,d),0):(a.Fa=b,a.$j=c,a.Zj=d,e.C(0))})};iJ=function(a,b){return _.I(function(c){return UI(a)?_.x(c,_.kH(a.a,b),0):(a.ha=b,c.C(0))})};OJ=function(a){if(a.a&&a.f){var b=QG(a.a),c=jF(a);null!=b&&b===c&&(SG(a.a),TG(a.a),_.RG(a.a,_.kk),kF(a.l,c),kF(a.l,c),kF(a.l,c),kF(a.l,c))}};
|
|
259
|
+
bJ=function(a,b){function c(g,k){if(!g)return null;var l=g.findSegmentPosition(k-f.startTime);return null==l?null:(l=g.getSegmentReference(l))?l.startTime+f.startTime:null}var d=SG(a.a),e=TG(a.a),f=jF(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};fJ=function(a){return a.A&&a.A.G?!0:a.J?a.J.getState()===yG:!1};
|
|
260
|
+
LI=function(a){if(a.G&&a.J&&a.B){var b=fJ(a)||a.xd,c=a.I;c.l=b;IG(c,c.o?"seek":void 0);a.B.j.o=b;eJ(a);a.Xf&&(c=1>Math.abs(a.getMediaDuration()-a.getMediaPosition()),a=a.Xf,b&&c&&(b=a.a,b.a[b.a.length-1]&&a.f(new _.R(_.Sf))))}};eJ=function(a){var b=a.ud;if(a.xd)var c=!1;else if(a.j&&a.j.ended)c=!0;else{c=a.getMediaDuration();var d=a.getMediaPosition();c=a.Ke&&0<=d&&c<=d?!0:!1}a=c?11:fJ(a)||a.xd?6:a.j&&a.j.paused?10:8;IE(b,a)};
|
|
261
|
+
QI=function(a,b){var c=PJ(a,b);if(!c)return{variant:null,rb:null};var d=QJ(a,c);return{variant:c,rb:d}};QJ=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};
|
|
262
|
+
PJ=function(a,b){try{NJ(a,b)}catch(f){return a.onError(f),null}var c=b.filter(function(f){return aG(f)}),d=GE(c,a.Tb);c=a.Ge.create(d);c=Array.from(c.values());var e=c.map(RE);a.h.setTracks(e);if(null!==a.Ba&&null!==a.Tb&&(e=c.find(function(f){return f.video.id===a.Ba&&f.audio.id===a.Tb}),a.Ba=null,e))return e;if(a.configuration.abr.enabled||null===a.Ba)return d=a.h.chooseTrack(),SE(d,c);d=d.find(function(f){return null!==f.video&&f.video.id===a.Ba});return d?d:(a.log.warn("Selected video track not found. Falling back to ABR selection"),
|
|
263
|
+
d=a.h.chooseTrack(),SE(d,c))};RJ=function(a,b){return _.cG(b,a.ue,a.Mf,a.re)[0]||null};SJ=function(a,b,c){c=void 0===c?!0:c;var d,e,f,g;_.I(function(k){if(1==k.a)return d=QI(a,b.variants),e=d.variant,a.Tb=e&&e.audio&&e.audio.id,e?_.x(k,b.parser.loadVariant(e,b.id),3):k.C(2);if(2!=k.a)return f=k.f,kJ(a,b,f,!0),_.x(k,GJ(a,f,c),2);g=RJ(a,b.textStreams);if(!g||!a.configuration.streaming.alwaysStreamText&&!fF(a))return k.C(0);hJ(a,b,g,!0);return _.x(k,iJ(a,g),0)})};
|
|
264
|
+
VJ=function(a,b){a.h.disable();a.log.debug("Choosing new streams after period changed");var c=QI(a,b.variants),d=c.variant,e=c.rb,f=RJ(a,b.textStreams);a.Fa&&(b.variants.includes(a.Fa)&&(d=a.Fa),a.Fa=null);a.ha&&(b.textStreams.includes(a.ha)&&(f=a.ha),a.ha=null);var g=d?d.video:null,k=d&&!e?d.audio:null;d&&b.parser&&b.parser.setCurrentVariant(d);g&&TJ(a,b,function(){return jJ(a,b,g,!0)});k&&TJ(a,b,function(){return KJ(a,b,k,!0)});e&&TJ(a,b,function(){return JJ(a,b,e,!0)});f&&(a.configuration.streaming.alwaysStreamText||
|
|
265
|
+
fF(a))&&TJ(a,b,function(){return hJ(a,b,f,!0)});b===jF(a)&&UJ(a);c=a.configuration.streaming.alwaysStreamText||fF(a)?f:null;return{video:g,audio:k,text:c,rb:e}};
|
|
266
|
+
WI=function(a,b,c,d){c=void 0===c?!1:c;d=void 0===d?0:d;var e,f,g;_.I(function(k){if(1==k.a){if(!a.configuration.abr.enabled||!a.a)return k["return"]();e=WJ(a,b);f=!!kF(a.l,e).rb;if(!f)return k.C(2);g=b.video;if(!g)return k.C(2);TJ(a,e,function(){return jJ(a,e,g,!0)});e===jF(a)&&UJ(a);return _.x(k,hH(a.a,g,c,d),4)}if(2!=k.a)return k["return"]();TJ(a,e,function(){kJ(a,e,b,!0)});e===jF(a)&&UJ(a);eH(a.a,b,c,d);_.z(k)})};
|
|
267
|
+
PI=function(a){var b=a.getTrackManager();b&&a.H!==KI&&(b.m&&(iF(b),b.m.trigger(new _.R(_.vg))),UJ(a))};UJ=function(a){var b=jF(a);if(b){var c=a.od.get(b)||[];for(a.od["delete"](b);c.length;)c.shift()()}};TJ=function(a,b,c){a.od.has(b)||a.od.set(b,[]);a.od.get(b).push(c)};GI=function(a,b,c){a.trigger(new _.R(b,{detail:HD(c,LJ(a))}))};
|
|
268
|
+
NJ=function(a,b){var c=a.A?_.N.Gh(a.A.na):{},d=Object.keys(c);d=d.length&&"00"===d[0];for(var e=!1,f=!1,g=[],k=[],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?OI.includes(q)&&(k.includes(q)||k.push(q)):g.includes(p.keyId)||g.push(p.keyId)}m.allowedByApplication?m.allowedByKeySystem&&(e=!0):f=!0}if(!e)throw new _.O(_.Q,4,4012,{hasAppRestrictions:f,
|
|
269
|
+
missingKeys:g,restrictedKeyStatuses:k});};XJ=function(a){if(null==jF(a))return[];OJ(a);return VI(a).filter(function(b){return aG(b)})};YJ=function(a){var b=jF(a);if(null==b)return[];OJ(a);return a.f.alternativeTextStreams?a.f.alternativeTextStreams:b.textStreams.filter(function(c){return!a.Vf.has(c)})};jF=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};ZJ=function(a){var b=jF(a);return b?kF(a.l,b).audio:null};
|
|
270
|
+
$J=function(a){var b=jF(a);return b?kF(a.l,b).video:null};WJ=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};pI=function(a){if(a.H===KI)throw new _.O(_.Q,7,7E3,"Player is destroyed.");};
|
|
271
|
+
aK=function(a,b,c,d){var e,f,g,k,l,m,n,p,q,t,u,y,A,D,B,E,C,K,P,T;return _.I(function(W){switch(W.a){case 1:return e=_.Qq,_.F(W,2),_.x(W,_.ew(b.url,a.getNetworkEngine(),a.configuration.manifest.attemptParameters,b.type||null),4);case 4:f=W.f;f.configure(a.configuration.manifest);var oa=f;var Aa=b.url,wa=MI(a,a.configuration.id||"");oa=oa.start(Aa,wa);return _.x(W,oa,5);case 5:g=W.f;NI(g.periods);if(!g.periods.length)throw new _.O(_.Q,4,4014);return _.x(W,iI(a),6);case 6:a.T=[f];k=d&&d.id;l=c&&c.id;
|
|
272
|
+
a.f.periods=g.periods;m=dD(g.periods,a.B.getTime())||g.periods[0];$I(a)?TF(a.f,_.Fj(a.configuration.preferredVideoCodec),_.Fj(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount):SF(a.f,_.Fj(a.configuration.preferredVideoCodec),_.Fj(a.configuration.preferredAudioCodec),a.configuration.preferredAudioChannelCount);n=JE(k,l,m.variants);p=RJ(a,m.textStreams);QI(a,m.variants);q=n&&n.video;t=n&&n.audio;u=[];y=new Set;A=_.v(m.variants);for(D=A.next();!D.done;D=A.next())B=D.value,
|
|
273
|
+
B.video&&y.add(B.video),B.audio&&y.add(B.audio);E=a.getNetworkEngine();C=_.v(_.jh(y).concat(_.jh(m.textStreams)));for(K=C.next();!K.done;K=C.next())P=K.value,u.push(P.createSegmentIndex(E,a.configuration.streaming.attemptParameters));return _.x(W,Promise.all(u),7);case 7:wH(a.a,e.AUDIO,t);wH(a.a,e.VIDEO,q);wH(a.a,e.TEXT,p);n&&kJ(a,m,n,!1);a.log.info("Switch CDN successful.");_.G(W,0);break;case 2:T=_.H(W);if(!f){W.C(8);break}return _.x(W,f.stop(),8);case 8:throw T;}})};
|
|
274
|
+
MI=function(a,b){return{networkingEngine:a.getNetworkEngine(),onContentSteeringInfoFound:function(c){return vI(a,c)},configurationId:b,filterNewPeriod:function(c){return cJ(a,c)},filterAllPeriods:function(c){return RI(a,c)},onEvent:function(c){return a.Cg(c)},onError:function(c){return a.onError(c)},onUpdate:function(c){return nI(a,c)},onTurnedStatic:function(){return oI(a)},xe:function(){return a.h}}};
|
|
275
|
+
$I=function(a){return a.configuration.mediaSource.codecSwitchingStrategy===_.bg&&(_.ti(2)||_.ti(3)||_.ti(4)||_.ti(5)||_.ti(6)||_.ui()&&38===_.Ri().major||_.ui()&&53===_.Ri().major||_.ui()&&68===_.Ri().major?!1:!0)};VI=function(a){return a.f.alternativeVariants&&0<a.f.alternativeVariants.length?a.f.alternativeVariants:a.B?jF(a).variants:a.f.periods[0].variants};bK=function(){};
|
|
276
|
+
cK=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}};dK=function(){var a=SourceBuffer.prototype.remove;SourceBuffer.prototype.remove=function(b,c){return a.call(this,b,c-.001)}};eK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"mp2t"===b.split(/ *; */)[0].split("/")[1].toLowerCase()?!1:a(b)}};
|
|
277
|
+
fK=function(){var a=MediaSource.isTypeSupported;MediaSource.isTypeSupported=function(b){return"opus"!==_.JC(b)&&a(b)}};
|
|
278
|
+
gK=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 k=!1,l=!1;c=d.split(",").filter(function(n){b.test(n)&&(l=!0);/^(hev|hvc)1\.2/.test(n)&&(k=!0);return!0});l&&(k=!1);f.codecs=c.join(",");k&&(f.eotf="smpte2084");for(var m in f)e+="; "+m+'\x3d"'+f[m]+'"';return cast.__platform__.canDisplayType(e)}};
|
|
279
|
+
hK=function(a){_.Zv.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=_.Qd;c.label===KB&&(this.a=c)}this.a||(this.a=a.addTextTrack(_.jC,KB));this.a.mode=_.re};iK=function(a,b){var c=a.mode;a.mode=c===_.Yf?_.Yf:_.re;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};jK=function(){};_.vk.prototype.f=_.lC(0,function(){return this.keyInfo});oC=[112,115,115,104,0,0,0,0];_.gJ={Dh:_.kg,Bp:_.gd,Ch:_.ne};
|
|
280
|
+
_.DC.prototype.Ae=function(){return this.fa?this.fa-this.la+1:null};_.DC.prototype.f=function(){return this.keyInfo};NC.prototype.release=function(){mC(this.h,this.j)};_.RC.prototype.getAttribute=function(a){a=this.attributes[a];return null==a?null:a};_.r=_.UC.prototype;_.r.Se=function(a,b){var c=TC(a).childNodes[0];return b&&c.tagName!==b?null:c};_.r.Qa=function(a,b){var c=this.aa(a,b);return 1!==c.length?null:c[0]};
|
|
281
|
+
_.r.aa=function(a,b){return Array.from(a.childNodes).filter(function(c){return c.tagName===b})};_.r.jc=_.hh(1);_.r.Xc=_.hh(3);_.r.ua=function(a){return a.childNodes.every(function(b){return b.tagName===_.ea||"#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.Z=_.hh(5);_.r.Df=_.hh(7);_.r.Zf=_.hh(11);
|
|
282
|
+
_.r.removeChild=function(a,b){a.childNodes=a.childNodes.filter(function(c){return c!==b})};_.r.Lf=_.hh(13);_.r.Kf=_.hh(15);_.r.Cd=_.hh(9);_.r.$f=_.hh(17);_.r.Ye=_.hh(19);_.kK=0;_.r=_.YC.prototype;_.r.track=function(a){null!=this.player&&$C(this);a&&(this.player=a,this.player.on(_.Qf,this.Bd,this))};_.r.release=function(){$C(this);this.S=[];this.f=this.h=null};
|
|
284
283
|
_.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&&
|
|
285
|
-
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(
|
|
284
|
+
b<e.end&&(e.start=b);this.S.push(c);this.S.sort(XC)}bD(this);this.Bd();this.player&&this.player.trigger(new _.R(_.Pg))};_.r.clear=function(){this.S=[];bD(this);this.player&&(this.player.trigger(new _.R(_.Pg)),this.player.trigger(new _.R(_.Yc)))};
|
|
286
285
|
_.r.Bd=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 _.R(_.ad,
|
|
287
|
-
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=
|
|
288
|
-
_.r.
|
|
289
|
-
_.r.offset=function(a){null!=this.l&&(this.l+=a);null!=this.w&&(this.w+=a)};_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Ie=function(){return!this.o};_.r
|
|
290
|
-
|
|
286
|
+
{detail:{width:b,height:c,bandwidth:a?a.bandwidth:null,rendition:a}}))}}}};_.r=mD.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.hc=function(){return this.a};_.r.Ya=function(){return this.f};
|
|
287
|
+
_.r.Fc=function(a){return null==this.a||null==this.f?!1:a>=this.a&&a<this.f};_.r.Za=function(a){return null==this.f||this.f<a?0:this.f-Math.max(a,this.a)};rD.prototype.kc=function(){return this.h};rD.prototype.getDuration=function(){return this.f?this.a-this.h:Infinity};_.r=_.tD.prototype;_.r.$c=function(){return this.L};_.r.getDuration=function(){return 2===this.j.version?this.a.getDuration():this.f};_.r.getPresentationStartTime=function(){return this.G};
|
|
288
|
+
_.r.offset=function(a){null!=this.l&&(this.l+=a);null!=this.w&&(this.w+=a)};_.r.isLive=function(){return 2===this.j.version?!this.a.f:Infinity===this.f&&!this.o};_.r.Ie=function(){return!this.o};_.r.bd=function(){return this.B};ID.prototype.release=function(){this.f=function(){};this.h=function(){};this.a.clear()};ID.prototype.cues=function(){return this.a};MD.prototype.release=function(){this.f=this.j=this.h=this.a=null};MD.prototype.l=function(a){xC(this.a,a);ND(this)};
|
|
289
|
+
OD.prototype.next=function(){var a=this.h.get(this.a);a&&0<a.a.length?(this.f+=1,a.Ia().length&&this.f===a.a.length&&(this.a+=1,this.f=0)):(this.a+=1,this.f=0);a=PD(this);return{value:a,done:!a}};_.r=_.QD.prototype;_.r.destroy=function(){this.a=[];return Promise.resolve()};
|
|
291
290
|
_.r.vf=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};
|
|
292
|
-
_.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.
|
|
293
|
-
_.r.
|
|
294
|
-
_.r.ta=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 _.
|
|
295
|
-
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.
|
|
296
|
-
f.Kd,f.
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
c.baseUriCollectionId+" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),this.trigger(new _.R(
|
|
303
|
-
_.r.Gb=function(){return this.f.get(_.
|
|
304
|
-
_.r.Cb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)
|
|
305
|
-
_.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.
|
|
306
|
-
_.r.
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
_.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"](
|
|
291
|
+
_.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.Va-=a};
|
|
292
|
+
_.r.sg=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};
|
|
293
|
+
_.r.ta=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 _.vk(f.position,g.startTime,g.endTime,g.Ia,g.la,g.fa,g.Va,g.keyInfo,g.Fd,g.timescale,g.horizontalTiles,g.verticalTiles,g.durationPerTile,null,null,g.Kd,g.Oa),b.push(f)):b.push(f),d++),e++)}for(;d<this.a.length;)b.push(this.a[d++]);
|
|
294
|
+
if(b.length)for(d=b[b.length-1].position+1;e<a.length;)f=a[e++],f=new _.vk(d++,f.startTime,f.endTime,f.Ia,f.la,f.fa,f.Va,f.keyInfo,f.Fd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,f.Kd,f.Oa),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 _.vk(e-d--,f.startTime,f.endTime,f.Ia,f.la,f.fa,f.Va,f.keyInfo,f.Fd,f.timescale,f.horizontalTiles,f.verticalTiles,f.durationPerTile,null,null,
|
|
295
|
+
f.Kd,f.Oa));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};TD.prototype.release=function(){this.h=null;this.f=function(){}};XD.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};XD.prototype.Tf=function(){this.A=!0;WD(this)};YD.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};
|
|
296
|
+
bE.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};bE.prototype.getTime=function(){return this.l?this.a.currentTime:this.A};hE.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(){}};
|
|
297
|
+
hE.prototype.getTime=function(){var a=this.f.getTime();return 0<this.h.readyState&&!this.h.paused?GD(this.a,a):a};kE.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()};mE.prototype.release=function(){this.j=null;this.o.clear();this.a=function(){};this.f=function(){};this.h=function(){}};
|
|
298
|
+
mE.prototype.l=function(a,b,c){if(this.j)for(var d={},e=_.v(this.j.cues()),f=e.next();!f.done;d={lg:d.lg,cf:d.cf},f=e.next()){f=f.value;d.lg=this.o.get(f)||null;d.cf=lE(f,a);this.o.set(f,d.cf);var g=this.w.find(function(k){return function(l){return l.nd===k.lg&&l.md===k.cf}}(d));g&&g.dd(f,b&&0===c)}};qE.prototype.getBandwidthEstimate=function(a){return 128E3>this.a?a:Math.min(_.kD(this.f),_.kD(this.h))};_.w(vE,_.rn);
|
|
299
|
+
vE.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()};
|
|
300
|
+
vE.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.ge&&d>f.ge&&(f.ge=0,b.trigger(new _.R(VB,{detail:{serviceLocationId:g,banned:!1,bannedSeconds:0}})))});var e=c.filter(function(f){return 0===yE(b,f.serviceLocationId).ge});e.length||(e=c);e.length&&(c=this.w.get(a),uE(e,c)||(c={baseUriCollectionId:a,from:c||[],to:e},this.g.info("Steering server update baseUriCollectionId: "+
|
|
301
|
+
c.baseUriCollectionId+" from: "+JSON.stringify(c.from)+" to: "+JSON.stringify(c.to)),this.trigger(new _.R(UB,{detail:c})),this.w.set(a,e)));return new _.sE(a,e)};vE.prototype.notifyThroughput=function(a,b,c){a=yE(this,a);rE(a.Oh,b,c);a.bg=!0};vE.prototype.banLocation=function(a){var b=yE(this,a);b.ge=Date.now()+1E3*this.f;b.bg=!1;this.g.info("service location "+a+" banned during "+this.f+xB);this.trigger(new _.R(VB,{detail:{serviceLocationId:a,banned:!0,bannedSeconds:this.f}}))};HE.prototype.getState=function(){return this.a};_.w(TE,_.Om);_.r=TE.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 UE(this,_.jm)};_.r.getAudioTracks=function(){return UE(this,_.im)};_.r.ra=function(){return UE(this,_.hm)};_.r.sa=function(){return this.a.get(_.jm)||null};_.r.$a=function(){return this.a.get(_.im)||null};_.r.ib=function(){return this.a.get(_.hm)||null};
|
|
302
|
+
_.r.Gb=function(){return this.f.get(_.jm)||null};_.r.Xb=function(){return this.f.get(_.im)||null};_.r.Yb=function(){return this.f.get(_.hm)||null};_.r.Ra=function(){return VE(this,_.jm)};_.r.qa=function(){return VE(this,_.im)};_.r.xa=function(){return VE(this,_.hm)};_.r.Qb=function(a){this.m&&WE(this,_.jm,a)};_.r.La=function(a){this.m&&WE(this,_.im,a)};_.r.lb=function(a){this.m&&WE(this,_.hm,a)};
|
|
303
|
+
_.r.Cb=function(a,b){b=void 0===b?!1:b;if(this.m)if(a)aF(this,a,b);else{var c=b,d=VE(this,_.jm);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."),$E(this.m,null,c)))}};_.r.Ob=function(a){this.m&&(a?(ZE(this,a,_.im),YE(this,a,_.im)&&(this.g.info("Set audio rendition with ID: "+a.id),this.f.set(_.im,a),IJ(this.m,parseInt(a.id,10)))):this.g.info("Enabling ABR for audio is not supported"))};
|
|
304
|
+
_.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.ya=function(){return!!this.m&&this.m.ya()};
|
|
305
|
+
_.r.Pb=function(a){if(this.m){var b=a;if(!a){var c=this.ib();if(c&&c.track.kind!==_.ne){a=this.ra().find(function(e){return e.kind===_.ne&&e.language===c.track.language});if(!a){var d=this.qa();d&&(a=this.ra().find(function(e){return e.kind===_.ne&&e.language===d.language}))}a&&(b=a.renditions[0])}}b?dF(this,b):eF(this)}};_.r.detach=function(){};TE.prototype.setTextRendition=TE.prototype.Pb;TE.prototype.isAbrEnabled=TE.prototype.ya;TE.prototype.addTextTrack=TE.prototype.addTextTrack;
|
|
306
|
+
TE.prototype.setAudioRendition=TE.prototype.Ob;TE.prototype.setVideoRendition=TE.prototype.Cb;TE.prototype.setTextTrack=TE.prototype.lb;TE.prototype.setAudioTrack=TE.prototype.La;TE.prototype.setVideoTrack=TE.prototype.Qb;TE.prototype.getTextTrack=TE.prototype.xa;TE.prototype.getAudioTrack=TE.prototype.qa;TE.prototype.getVideoTrack=TE.prototype.Ra;TE.prototype.getLoadingTextRendition=TE.prototype.Yb;TE.prototype.getLoadingAudioRendition=TE.prototype.Xb;TE.prototype.getLoadingVideoRendition=TE.prototype.Gb;
|
|
307
|
+
TE.prototype.getTextRendition=TE.prototype.ib;TE.prototype.getAudioRendition=TE.prototype.$a;TE.prototype.getVideoRendition=TE.prototype.sa;TE.prototype.getTextTracks=TE.prototype.ra;TE.prototype.getAudioTracks=TE.prototype.getAudioTracks;TE.prototype.getVideoTracks=TE.prototype.getVideoTracks;nF.prototype.init=function(a){var b=muxjs.mp4.probe;a=_.Wi(a);this.l=b.videoTrackIds(a);this.j=b.timescale(a)||{};this.a.init()};nF.prototype.h=function(a,b){var c=_.Wi(a);(c=this.a.parse(c,this.l,this.j))&&c.captions&&b(c.captions);this.a.clearParsedCaptions()};nF.prototype.f=function(){this.a.resetCaptionStream()};_.oF.prototype.init=function(){};_.oF.prototype.h=function(){};_.oF.prototype.f=function(){};_.r=_.qF.prototype;
|
|
308
|
+
_.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"](AC));for(e=1;e<d.length;++e)d[e].p["catch"](AC),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(),
|
|
310
309
|
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.M=!1;for(var g in a.h);a.h={}})};_.r.open=function(){return this.L};
|
|
311
|
-
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,k,l,m,n,p,q,t,u,y,A;return _.I(function(D){switch(D.a){case 1:return e=_.
|
|
312
|
-
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),D.C(3)}})};_.r.
|
|
313
|
-
_.r.remove=function(a,b,c){var d=this;return a===_.
|
|
314
|
-
_.r.flush=function(a){return a===_.
|
|
315
|
-
_.r.
|
|
316
|
-
_.r.
|
|
317
|
-
_.r.
|
|
318
|
-
_.r.
|
|
319
|
-
_.r.
|
|
320
|
-
_.r.gd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),
|
|
321
|
-
_.r.chooseTrack=function(){var a=
|
|
310
|
+
_.r.init=function(a,b,c){c=void 0===c?!1:c;var d=this,e,f,g,k,l,m,n,p,q,t,u,y,A;return _.I(function(D){switch(D.a){case 1:return e=_.Qq,_.x(D,d.L,2);case 2:f=_.v(a),g=f.next();case 3:if(g.done){D.C(0);break}k=g.value;l=_.v(k);m=l.next().value;p=n=l.next().value;q=m;t=_.Im(p.mimeType,p.codecs);if(q===e.TEXT){yF(d,t);D.C(4);break}u=new Map;u.set(q,t);_.Fu(t)&&b&&!p.aesEncrypted||!_.Hm(t,q)||!(y=_.Hm(t))||(A=y(),d.w[q]=A,u=A.demuxMimeTypes(q,t),c&&u["delete"](e.AUDIO));return _.x(D,vF(d,u),7);case 7:d.M=
|
|
311
|
+
u.has(e.AUDIO)&&u.has(e.VIDEO);case 4:g=f.next(),D.C(3)}})};_.r.hc=function(a){return a===_.kk?this.f.hc():(a=AF(this,a))?a.hc():null};_.r.Ya=function(a){return a===_.kk?this.f.Ya():(a=AF(this,a))?a.Ya():null};_.r.Fc=function(a,b,c){return a===_.kk?this.f.Fc(b):(a=AF(this,a))?a.Fc(b,!1,c):!1};_.r.Za=function(a,b){if(a===_.kk)return this.f.Za(b);var c=AF(this,a);return c?c.Za(b):0};
|
|
312
|
+
_.r.remove=function(a,b,c){var d=this;return a===_.kk?this.f.remove(b,c):wF(this,a,this.Kj.bind(this,a,b,c)).then(function(){if(a===_.Kg){var e=d.hc(a),f=d.Ya(a);null!==e&&null!==f&&cD(d.D,e,f)}else a===_.Rc&&(e=d.D,e.player&&e.player.trigger(new _.R(_.Yc)))})};_.r.clear=function(a){if(a===_.kk){if(!this.f)return Promise.resolve();this.H.f();return this.f.remove(0,Infinity)}return wF(this,a,this.Kj.bind(this,a,0,this.o.duration))};
|
|
313
|
+
_.r.flush=function(a){return a===_.kk?Promise.resolve():wF(this,a,this.xi.bind(this,a))};_.r.endOfStream=function(a){var b=this;return JF(this,function(){zF(b)||(a?b.o.endOfStream(a):b.o.endOfStream())})};_.r.getDuration=function(){return this.o.duration};_.r.Dg=function(a,b){this.g.debug("Appending data to "+a+vB);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+vB)};
|
|
314
|
+
_.r.Kj=function(a,b,c){if(c<=b)this.gd(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)}};
|
|
315
|
+
_.r.mk=function(a){try{this.g.debug("Aborting operations for "+a+vB);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+vB,d),d;}this.g.debug("Done Aborting operations for "+a+vB);this.gd(a)};
|
|
316
|
+
_.r.xi=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.gd(a)};
|
|
317
|
+
_.r.Qj=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.gd(a)};
|
|
318
|
+
_.r.Uo=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.gd(a)};_.r.wl=function(a){a:switch(a){case _.Rc:var b=2008;break a;case _.Kg:b=2007;break a;default:b=5001}this.h[a][0].p.reject(new _.O(_.Q,3,3014,{mediaError:this.j.error?this.j.error.code:0},void 0,b))};
|
|
319
|
+
_.r.gd=function(a){var b=this.h[a][0];b&&(b.p.resolve(),this.g.debug("Update-End received for "+a),MF(this,a))};_.r.getTextDisplayer=function(){return this.B};var sF=window.URL.createObjectURL;_.r=_.dG.prototype;_.r.stop=function(){this.o=null;this.l=!1;this.f=[];this.B=1;this.h=null;this.H=!1;this.j=null;for(var a=_.v(this.D),b=a.next();!b.done;b=a.next())b=b.value,b();this.D.clear()};_.r.init=function(a){this.o=a};
|
|
320
|
+
_.r.chooseTrack=function(){var a=iG(this,!this.H&&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=iG(this,null,this.f),a=[a[0]]);this.h=Date.now();this.H=!0;for(var c=a,d=c[0]||null,e=0;e<c.length;e++){var f=c[e],g=c[e+1],k=isNaN(this.B)||0===this.B?1:Math.abs(this.B),l=k*f.bandwidth,m=l/this.a.bandwidthDowngradeTarget;
|
|
322
321
|
g=k*(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)}this.j=(a=d||a[0]||this.f[0])?a.id:null;return a};_.r.enable=function(){this.l=!0};_.r.disable=function(){this.l=!1};
|
|
323
|
-
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l)
|
|
322
|
+
_.r.segmentDownloaded=function(a,b){this.g.debug("Segment downloaded:","deltaTimeMs\x3d"+a,"numBytes\x3d"+b,"lastTimeChosenMs\x3d"+this.h,"enabled\x3d"+this.l);rE(this.w,a,b);if(null!=this.h&&this.l)a:{this.g.debug("Suggesting Streams...");if(!this.G){if(!(128E3<=this.w.a)){this.g.debug("Still waiting for a good estimate...");break a}this.G=!0;if(this.a.useSwitchIntervalForInitialSwitch&&Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Skipping initial estimation switch due to switch interval...");
|
|
324
323
|
break a}}else if(Date.now()-this.h<1E3*this.a.switchInterval){this.g.debug("Still within switch interval...");break a}var c=this.j,d=this.chooseTrack();d&&d.id===c||(c=this.getBandwidthEstimate(),this.g.debug("Calling switch_(), bandwidth\x3d"+Math.round(c/1E3)+" kbps"),d&&this.o(d))}};_.r.playbackRateChanged=function(a){this.B=a};
|
|
325
|
-
_.r.getBandwidthEstimate=function(){if(this.A&&this.a.useCmsd){var a=
|
|
326
|
-
_.r.beginSegmentMonitor=function(a,b){var c=this;if(this.o){var d={
|
|
327
|
-
|
|
328
|
-
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};
|
|
329
|
-
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.F.Hb();c=
|
|
330
|
-
_.r.resume=function(){if(!
|
|
331
|
-
_.r.
|
|
332
|
-
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())k=g.value,k.Db=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.F.Y.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.F.Y.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.F.
|
|
333
|
-
_.r.
|
|
334
|
-
e?a.startTime+b.startTime+l/k:a.startTime+p/k,c.includes(f))if("urn:mpeg:dash:event:2012"===f)this.F.
|
|
335
|
-
_.r.
|
|
336
|
-
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){
|
|
337
|
-
_.r.getBufferInfo=function(a){if(this.
|
|
338
|
-
_.r.seek=function(a,b){if(this.
|
|
339
|
-
_.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,_.
|
|
340
|
-
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.
|
|
341
|
-
case 6:f=y.f;b.
|
|
342
|
-
null,0,m);p=f.map(function(A){return
|
|
343
|
-
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){
|
|
344
|
-
_.r.
|
|
345
|
-
_.r.load=function(a){return
|
|
346
|
-
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:
|
|
347
|
-
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===
|
|
348
|
-
_.r.Md=function(){if(!this.f||!this.B)return[];for(var a
|
|
349
|
-
_.r.ra=function(){if(this.f&&this.B){var a=
|
|
350
|
-
_.r.getStats=function(){if(this.H!==
|
|
351
|
-
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?
|
|
352
|
-
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,k,l,m,n,p,q,t,u,y;return _.I(function(A){if(1==A.a){if(g.H!==
|
|
353
|
-
findSegmentPosition:function(){return 1},getSegmentReference:function(D){return 1===D?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.
|
|
354
|
-
2)}if(y=_.
|
|
355
|
-
_.r.
|
|
356
|
-
_.r.
|
|
357
|
-
_.r.
|
|
358
|
-
|
|
359
|
-
_.r.
|
|
360
|
-
_.x(p,b.
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Kh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.
|
|
364
|
-
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;
|
|
365
|
-
_.
|
|
366
|
-
_.
|
|
324
|
+
_.r.getBandwidthEstimate=function(){if(this.A&&this.a.useCmsd){var a=vC(this.A,_.me);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)};_.r.setTracks=function(a){this.f=a;this.j=null};_.r.setCmsdManager=function(a){this.A=a};_.r.configure=function(a){this.a=a};_.r.reset=function(){this.G=!1;this.w=new qE;var a=this.j,b=this.chooseTrack();b&&b.id!==a&&this.o(b)};
|
|
325
|
+
_.r.beginSegmentMonitor=function(a,b){var c=this;if(this.o){var d={ep:Date.now(),uh:null,stopped:!1,stop:function(){d.stopped||(d.stopped=!0,clearTimeout(d.uh),c.D["delete"](d.stop))}};a.U["finally"](d.stop)["catch"](function(){});this.D.add(d.stop);eG(this,a,d,b)}};mG.prototype.clear=function(){this.a.clear()};oG.prototype.add=function(a,b){var c=void 0===b?!0:b;if(rG(this.f,a,void 0===c?!0:c))return this.a.add(a),!0;_.Kh("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};oG.prototype.values=function(){return this.a.values()};tG.prototype.create=function(a){var b=this,c=this.a===_.bg&&WC(),d=a.filter(function(e){return rG(b.f,e,!c)});return d.length?new oG(d[0],d):this.h.create(a)};
|
|
326
|
+
sG.prototype.create=function(a){var b=uG(a,this.j);0<b.length&&(a=b);b=!1;if(this.a){var c=vG(a,this.a);0<c.length?(a=c,b=!0):_.Kh("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=OF(a,this.f),b.length?a=b:_.Kh("No exact match for the channel count could be found."));b=wG(a,this.l);b.length?a=b:_.Kh("No exact match for spatial audio could be found.");b=this.h===_.bg&&WC();c=new oG(a[0]);a=_.v(a);
|
|
327
|
+
for(var d=a.next();!d.done;d=a.next())c.add(d.value,!b);return c};zG.prototype.getState=function(){return this.a};var yG=0,xG=1;BG.prototype.release=function(){this.f.release()};CG.prototype.release=function(){this.a=this.h=null;this.f=function(){}};CG.prototype.l=function(a){var b=this.a,c=this.h.periods;a=dD(c,a)||c[0];b!==a&&this.f(a);this.a=a};EG.prototype.getConfiguration=function(){return this.j};EG.prototype.release=function(){this.a&&(this.a.stop(),this.a=null);this.f=null};EG.prototype.set=function(a,b){this.h=a;IG(this,b)};var LG=new _.to(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=_.OG.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,ZG(e),b.push($G(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)})};
|
|
328
|
+
_.r.start=function(){var a=this,b,c,d;return _.I(function(e){if(1==e.a){b=a.F.Hb();c=dD(a.j.periods,b+_.rw);if(!c)throw new _.O(_.Q,5,5006,"No period found.");d=a.F.Sg(c);if(!d.video&&!d.audio&&!d.text)throw a.g.error("start(): No streams chosen"),new _.O(_.Q,5,5005,"No streams chosen.");a.I=!d.video&&!d.audio&&!!d.text;a.A=!!d.rb;return _.x(e,iH(a,d,b),2)}if(a.f)return e["return"]();a.g.debug("init: completed initial Stream setup");a.F.Sn&&a.F.Sn();_.z(e)})};
|
|
329
|
+
_.r.resume=function(){if(!sH(this))for(var a=_.v(this.a.values()),b=a.next();!b.done;b=a.next())b=b.value,b.endOfStream=!1,XG(this,b,0)};
|
|
330
|
+
_.r.rc=function(a){var b=this,c,d,e,f,g,k,l;return _.I(function(m){switch(m.a){case 1:if(b.f)return m["return"]();c=pH(a);if(a.Nb||null==a.Db||a.Sc)return m["return"]();a.Db=null;if(!a.wc){m.C(2);break}b.g.debug(c,"skipping update and clearing the buffer");return _.x(m,uH(b,a,a.gg,a.tf),3);case 3:return m["return"]();case 2:_.F(m,4);d=GH(b,a);null!=d&&(XG(b,a,d),a.Od=!1);_.G(m,5);break;case 4:return e=_.H(m),_.x(m,RH(b,e),6);case 6:return m["return"]();case 5:XH(b,a);if(!tH(b)){m.C(0);break}if(b.F.configuration.an){b.g.debug("End of stream reached, keeping MediaSource open.");
|
|
331
|
+
f=_.v(b.a.values());for(g=f.next();!g.done;g=f.next())k=g.value,k.Db=null;return m["return"]()}b.g.debug("End of stream reached, calling ms.endOfStream().");return _.x(m,b.F.Y.endOfStream(),8);case 8:if(b.f)return m["return"]();l=b.F.Y.getDuration();l<b.j.presentationTimeline.getDuration()&&(b.j.presentationTimeline.f=l);b.F.jj();_.z(m)}})};
|
|
332
|
+
_.r.vo=function(a,b,c,d){var e=d.version;if(0===e){var f=nC(d.reader);var g=nC(d.reader);var k=_.Qn(d.reader);var l=_.Qn(d.reader);var m=_.Qn(d.reader);var n=_.Qn(d.reader)}else if(1===e){k=_.Qn(d.reader);var p=_.Sn(d.reader);m=_.Qn(d.reader);n=_.Qn(d.reader);f=nC(d.reader);g=nC(d.reader)}else{this.g.warn("Ignoring EMSG box with unsupported version "+e+".");return}if(0===k)this.g.warn("Ignoring EMSG box with invalid timescale 0.");else if(d=_.Un(d.reader,d.reader.eb()-d.reader.getPosition()),a=0===
|
|
333
|
+
e?a.startTime+b.startTime+l/k:a.startTime+p/k,c.includes(f))if("urn:mpeg:dash:event:2012"===f)this.F.nj();else this.F.onEvent(new _.R("emsg",{detail:{startTime:a,endTime:a+m/k,schemeIdUri:f,value:g,version:e,timescale:k,presentationTimeDelta:l,iq:p,eventDuration:m,id:n,messageData:d}}))};
|
|
334
|
+
_.r.wp=function(a){var b=this,c=!1,d=0;(new _.Vn).N(_.Oe,_.Wn).N(_.wg,_.Wn).N(_.Je,_.Wn).N(_.Ne,_.Wn).N(_.gg,_.Wn).da(_.ig,_.Xn).N("encv",function(e){e.reader.skip(78);_.Wn(e)}).N("pasp",function(e){d=e.start+e.headerSize;var f=_.Qn(e.reader),g=_.Qn(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 _.In(new DataView(a.data)),a.seek(d),_.V(a,1),_.V(a,1))};_.w(fI,_.Cn);_.r=fI.prototype;_.r.init=function(a,b){var c=a.getMedia();_.Cn.prototype.init.call(this,a,b);sI(this,c)};_.r.namespace=function(){return TB};_.r.setSeekInterceptor=function(a){this.zh=a||null};_.r.setPlaybackSessionId=function(a){this.we=a};_.r.ji=function(){return new TE};_.r.getState=function(){return this.ud.getState()};_.r.getDrmInfo=function(){return this.A?this.A.getDrmInfo():null};
|
|
335
|
+
_.r.unload=function(){var a=this,b;return _.I(function(c){if(1==c.a){bF(a,!1);a.Ke=!1;if(!a.ea)return c["return"]();a.log.debug("Unload player with source",a.ea);(b=a.getTrackManager())&&b.release();return a.H===KI?c["return"]():_.x(c,uI(a),2)}a.ea=null;a.ud.h=0;a.Tb=null;a.Ba=null;a.getNetworkEngine().headers["delete"](PB);_.z(c)})};_.r.release=function(){var a=this;return _.I(function(b){if(a.na)return b["return"](a.na);a.na=hI(a);a.na["finally"](function(){a.na=null});return b["return"](a.na)})};
|
|
336
|
+
_.r.getBufferInfo=function(a){if(this.M){var b=BF(this.M),c=new _.on(void 0,a);switch(a){case _.jm:return b.video?b.video:c;case _.im:return b.audio?b.audio:c;case _.hm:return b.text?b.text:c}return b.total?b.total:c}return this.yd?(b=ZC(this.yd),QC(b,a)):_.Cn.prototype.getBufferInfo.call(this,a)};_.r.getPosition=function(){var a=this.Le,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():_.Cn.prototype.getMediaPosition.call(this)};
|
|
337
|
+
_.r.seek=function(a,b){if(this.zh&&!this.zh(a,b))return Promise.resolve();var c=this.Le;c=c.a?a+c.a.kc():a;c!==a&&this.log.info("Seeking to "+a+" s corresponding to media time of "+(c+" s."));return _.Cn.prototype.seek.call(this,c)};_.r.getPresentationStartTime=function(){return this.f?this.f.presentationTimeline.getPresentationStartTime():null};_.r.getDuration=function(){var a=this.Le,b=this.getMediaDuration();return a.a?a.a.getDuration():b};
|
|
338
|
+
_.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,_.Cn.prototype.destroy.call(a),2);if(a.H===KI)return b["return"]();a.log.debug("Destroying player...");a.H=KI;rI(a);a.o&&(a.o.release(),a.o=null);a.De=null;a.h=null;_.z(b)})};_.r.getTimeline=function(){return this.De};
|
|
339
|
+
_.r.setupPlaylist=function(a){var b=this,c,d,e,f,g,k,l,m,n,p,q,t,u;return _.I(function(y){switch(y.a){case 1:return c=new _.pl,b.w.a=c,_.F(y,2),pI(b),b.X=_.ob,_.x(y,xI(b),4);case 4:return lG(b.w,c),d=a[0],d.playlist&&d.playlist.startTime&&(d.startTime=d.playlist.startTime),b.ea=_.Kq(d),b.configuration=_.An([b.wb,d]),b.log.info("Loading playlist configurations",a),b.De=kI(b.configuration),_.x(y,yI(b,c),5);case 5:return lG(b.w,c),e=a.map(function(A){return zI(b,A,0,null,!0)}),_.x(y,Promise.all(e),6);
|
|
340
|
+
case 6:f=y.f;b.T=f.map(function(A){return A.parser}).filter(function(A){return null!=A});g=f.filter(function(A){return A.manifest.presentationTimeline.isLive()});k=g[0];if(1<g.length)throw new _.O(_.Q,7,7003,"Playlist of multiple live streams is not supported.");if(k){l=b.configuration.playlist.content;if(l===_.Tb)throw new _.O(_.Q,7,7003,"Cannot play live content in VOD mode.");if("IPR"===l&&k!==f[f.length-1])throw new _.O(_.Q,7,7003,"Wrong order of playlist assets.");}m=null==k;n=new _.tD({version:2},
|
|
341
|
+
null,0,m);p=f.map(function(A){return ME(A.manifest)});q=PE(p,n);b.f=q;t=b;return _.x(y,AI(b,q,b.configuration),7);case 7:return t.A=y.f,lG(b.w,c),_.x(y,BI(b,c),8);case 8:lG(b.w,c);nH(b.a,q);mI(b,q);c.resolve();_.G(y,0);break;case 2:return u=_.H(y),_.x(y,iI(b),9);case 9:CI(b,u,c),_.z(y)}})};
|
|
342
|
+
_.r.appendLoad=function(a){var b=this,c;return _.I(function(d){if(1==d.a){pI(b);if(b.X!==_.ob)throw new _.O(_.Q,7,7003,"Cannot append-load to non-playlist player.");return _.x(d,JI(b,a),2)}c=d.f;b.f=c.manifest;c.parser&&b.T.push(c.parser);nH(b.a,c.manifest);tH(b.a)&&b.a.resume();mI(b,c.manifest);_.z(d)})};_.r.seekWith=function(a){return this.seek(this.getPosition()+a)};
|
|
343
|
+
_.r.Xh=function(){var a=this;return _.I(function(b){pI(a);if(!a.Yf)return a.log.warn("No preloaded asset found"),b["return"]();a.log.info("Loading preloaded asset",a.Yf);a.Yf=null;return _.x(b,BI(a,null),0)})};_.r.preload=function(a){var b=this;return _.I(function(c){if(1==c.a)return pI(b),_.qp("preload.start"),b.log.info("Preloading asset",a),_.x(c,DI(b,a,!1),2);b.Yf=a;b.log.info("Preloaded asset",a);_.qp("preload.end");_.sp("preload","preload.start","preload.end");_.z(c)})};
|
|
344
|
+
_.r.load=function(a){return DI(this,a)};_.r.detach=function(){var a=this;return _.I(function(b){if(1==b.a)return _.x(b,qI(a),2);a.configuration=a.wb;rI(a);_.z(b)})};_.r.isLive=function(){var a;this.f?(a=this.f.presentationTimeline.isLive())||(a=this.f.presentationTimeline,a=Infinity!==a.f&&!a.o):a=!1;return a};_.r.rj=function(){this.log.debug("User seeking finished");this.J&&dJ(this);eJ(this)};
|
|
345
|
+
_.r.getSeekRange=function(){var a={start:0,end:0};if(this.f){var b=this.f.presentationTimeline;a={start:uD(b),end:ED(b)}}b=this.Le;b.a?(b=b.a.getDuration(),b>a.end&&(b=a.end),b={start:0,end:b}):b=a;return b};_.r.$c=function(){return this.f?this.f.presentationTimeline.$c():null};_.r.getPlaybackRate=function(){if(this.I){var a=this.I;a=a.l?0:a.h}else a=0;return a};
|
|
346
|
+
_.r.setPlaybackRate=function(a,b){if(0===a)this.log.warn("A trick play rate of 0 is unsupported!");else if(this.H===eI){if(_.ti()){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&&dH(this.a,1<Math.abs(a));this.h.playbackRateChanged(a)}};
|
|
347
|
+
_.r.Md=function(){if(!this.f||!this.B)return[];for(var a=$J(this),b=ZJ(this),c=[],d=_.v(XJ(this)),e=d.next();!e.done;e=d.next()){e=e.value;var f=ZF(e);f.nf=e.video===a;f.mf=e.audio===b;c.push(f)}return c};
|
|
348
|
+
_.r.ra=function(){if(this.f&&this.B){var a=jF(this);if(null==a)a=null;else{if(!kF(this.l,a).text){var b=_.cG(a.textStreams,this.ue,this.Mf,this.re);b.length&&(b=b[0],kF(this.l,a).text=b)}a=kF(this.l,a).text}b=[];for(var c=_.v(YJ(this)),d=c.next();!d.done;d=c.next()){d=d.value;var e=$F(d);e.rg=d===a;b.push(e)}return b}return[]};_.r.getPeriods=function(){return this.f.periods};
|
|
349
|
+
_.r.getStats=function(){if(this.H!==eI)return _.Hq();eJ(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===eI){(b=jF(this))?(a=kF(this.l,b).video,b=kF(this.l,b).audio,a=((a?a.bandwidth:0)||0)+((b?b.bandwidth:0)||0)):a=null;a&&(this.G.w=a);if(a=$J(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()};
|
|
350
|
+
_.r.getBandwidthEstimate=function(){return this.h.getBandwidthEstimate()};_.r.getCueTimeline=function(){return this.K};_.r.getTimelineCues=function(){return this.K?LD(this.K,LJ(this)):[]};_.r.resetAbr=function(){this.h&&this.h.reset()};_.r.xe=function(){return this.h};
|
|
351
|
+
_.r.addTextTrack=function(a,b,c,d,e,f){var g=this,k,l,m,n,p,q,t,u,y;return _.I(function(A){if(1==A.a){if(g.H!==eI)throw g.log.error("Must call load() and wait for it to resolve before adding text tracks."),Error("State error!");k=jF(g);l=_.Qq;m=g.f.periods.indexOf(k);n=m+1;p=n>=g.f.periods.length?g.f.presentationTimeline.getDuration():g.f.periods[n].startTime;q=p-k.startTime;if(Infinity===q)throw new _.O(1,4,4040);t=new _.vk(1,0,q,function(){return[a]},0,null,0);u={id:g.ak++,originalId:null,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
352
|
+
findSegmentPosition:function(){return 1},getSegmentReference:function(D){return 1===D?t:null},adjustSegmentDurations:function(){},getDuration:function(){return q},segmentLookupStrategy:_.ZB,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.Vf.add(u);k.textStreams.push(u);return _.x(A,YG(g.a,u),
|
|
353
|
+
2)}if(y=_.RG(g.a,_.kk))kF(g.l,k).text=y;g.Vf["delete"](u);g.log.debug("Choosing new streams after adding a text stream");SJ(g,k);PI(g);return A["return"]($F(u))})};
|
|
354
|
+
_.r.vl=function(a){this.log.debug(_.cC,a.id);try{this.log.debug("onChooseStreams_, choosing variant from ",a.variants);this.log.debug("onChooseStreams_, choosing text from ",a.textStreams);var b=VJ(this,a);this.log.debug("onChooseStreams_, chose 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,rb:null}}};
|
|
355
|
+
_.r.Hn=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.Fa){b.C(2);break}return _.x(b,eH(a.a,a.Fa,a.$j,a.Zj),3);case 3:a.Fa=null;case 2:if(!a.ha){b.C(0);break}return _.x(b,_.kH(a.a,a.ha),5);case 5:a.ha=null,_.z(b)}})};_.r.vp=function(){var a=jF(this);a&&a.parser&&a.parser.update()};_.r.fo=function(){this.B&&this.B.j.Tf()};
|
|
356
|
+
_.r.yk=function(a,b,c){if((void 0===c?"":c)===aC)return PI(this),this.ya()||(this.configuration.abr.enabled=!0,this.h.enable()),SJ(this,b,!1),!0;if(c=b.variants.some(function(g){var k=!1,l=g[a.type];l&&(k=g.allowedByApplication&&l.id!==a.id,a.type===_.Rc&&(k=k&&l.language===a.language));return k})&&this.ya()){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)}PI(this);this.ya()||(this.configuration.abr.enabled=!0,this.h.enable());
|
|
357
|
+
SJ(this,b)}return c};_.r.Qn=function(){this.log.debug("endOfStream called by streaming engine");this.Ke=!0};_.r.onError=function(a){if(this.H!==KI&&7001!==a.code&&7E3!==a.code){var b=new _.R(_.le,{detail:a});a.severity===_.Q&&IE(this.ud,3);this.trigger(b);b.defaultPrevented&&(b.a=!0)}};_.r.Cg=function(a){a.type===_.de?this.dispatchEvent(a):"largegap"!==a.type&&(a.type===_.Vg?LI(this):"emsg"!==a.type&&(a instanceof _.R?this.dispatchEvent(a):this.log.debug(_.Nb,a.type)))};_.r.ya=function(){return this.configuration.abr.enabled};
|
|
358
|
+
_.r.ip=function(a){var b=this,c,d,e,f,g,k,l,m,n;return _.I(function(p){switch(p.a){case 1:if(!b.yc)return p["return"]();b.log.info("Attempt to switch CDN.");c=b.getLoadedSource();d=b.ya();return _.x(p,b.yc(c.url,a),2);case 2:e=p.f;if(!e)return p["return"]();f=_.N.ta(b.getLoadedSource(),{url:e});d&&b.h.disable();return _.x(p,vH(b.a),3);case 3:g=$J(b),k=ZJ(b);case 4:return l=!1,_.F(p,7),b.log.info("Switching CDN to "+f.url+"."),_.x(p,aK(b,f,g,k),9);case 9:_.G(p,6);break;case 7:return m=_.H(p),b.log.info("Switch failed"),
|
|
359
|
+
_.x(p,b.yc(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(),rH(b.a,!0),b.ea[b.getSourceIndex()]=f,a.f=!0,b.trigger(new _.R(_.kd,{newManifest:f.url})),_.z(p))}})};var KI=0,dI=1,eI=2,OI=[_.df,_.ve];bK.prototype.a=function(){return TB};
|
|
360
|
+
bK.prototype.canPlay=function(a,b){if(_.vi())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 _.fw||_.ik(a.url)in _.gw?!0:!1:!1;if(d&&e){if(_.ti(2))return 1;if(_.wi()&&c===_.Ym){if(b.streaming.preferNativeHlsOnSafari)return 1;_.Kh("Support for MSE + FairPlay on Apple is experimental. In case of issues, consider using native HLS.")}return 2}return 0};
|
|
361
|
+
bK.prototype.f=function(a){return a===_.ta||a===_.ob};bK.prototype.create=function(){return new fI};_.w(hK,_.Zv);_.r=hK.prototype;_.r.getClass=function(){return iC};_.r.isRenderer=function(){return!1};
|
|
362
|
+
_.r.append=function(a){function b(e){if(e.startTime>=e.endTime)_.Kh("Invalid cue times: "+e.startTime+" - "+e.endTime),e=null;else{var f=e.payload||"";f=f.replace(/<br\s*\/?>/igm,"\n");f=_.S.ph(f);f=new VTTCue(e.startTime,e.endTime,f);f.line=-1;try{f.align=_.md}catch(g){f.align="middle"}e.writingMode===_.Ig?f.vertical="lr":e.writingMode===_.Jg&&(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?
|
|
363
|
+
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;iK(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:_.re)};_.r.destroy=function(){this.a&&iK(this.a,function(){return!0});this.a=null;return Promise.resolve()};jK.prototype.a=function(){return!0};jK.prototype.create=function(a){return new hK(a)};_.Uh(new bK);_.xq(iC,new jK);
|
|
364
|
+
_.kt(function(){_.Ph("MediaSource.install");if(window.MediaSource)if(window.cast&&cast.__platform__&&cast.__platform__.canDisplayType)_.Oh("Patching Chromecast MSE bugs."),gK();else if(_.wi()){var a=navigator.appVersion;a=0<=a.indexOf("Version")?parseInt(a.match(/Version\/(\d+)/)[1],10):13;eK();10>=a?(_.Oh("Blacklisting MSE on Safari \x3c\x3d 10."),window.MediaSource=null):12>=a?(_.Oh("Patching Safari 11 \x26 12 MSE bugs."),cK(),dK()):(_.Oh("Patching Safari 13 MSE bugs."),cK())}else _.ti(2)||_.ti(3)||
|
|
365
|
+
_.ti(4)?fK():_.Oh("Using native MSE as-is.");else _.Oh("No MSE implementation available.")});};
|
|
367
366
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
368
367
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
369
368
|
else{_=this.clpp._;(f.call(g,this));}
|