@castlabs/prestoplay 6.17.1 → 6.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +566 -558
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +75 -74
- package/cjs/cl.externs.js +46 -46
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +71 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +311 -311
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +15 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +456 -450
- package/cl.crypto.js +8 -8
- package/cl.dash.js +70 -69
- package/cl.externs.js +46 -46
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +274 -273
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +2 -2
- package/typings.d.ts +37 -3
package/cjs/cl.freewheel.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.
|
|
4
|
-
_.y(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.y(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},
|
|
5
|
-
a.a.registerVideoDisplayBase(
|
|
6
|
-
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.
|
|
7
|
-
_.J("clpp.freewheel.FreeWheelPlugin",
|
|
8
|
-
_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.
|
|
9
|
-
_.t.
|
|
10
|
-
_.t.getPodIndex=function(){switch(this.
|
|
11
|
-
_.t.getWrapperCreativeIds=function(){return[]};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.
|
|
16
|
-
_.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,
|
|
17
|
-
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.
|
|
18
|
-
_.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.
|
|
19
|
-
_.t.
|
|
20
|
-
void 0));this.l.resolve()};_.t.
|
|
21
|
-
_.t.
|
|
22
|
-
_.
|
|
23
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.
|
|
24
|
-
_.t.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var iT="clpp-freewheel",jT="clpp.freewheel.AdsManagerFactory",kT="freewheel",lT=function(){this.f=this.a=null},mT=function(){},nT=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},oT=function(a,b,c){this.h=a;this.f=b;this.a=c},pT=function(a){this.a=a},qT=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Xh;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.Rj;this.j=null},rT=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.mg&&b.push("serverUrl");typeof a.profileId!==_.mg&&b.push("profileId");typeof a.videoAssetId!==_.mg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},sT=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.Lt,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
|
|
4
|
+
_.y(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.y(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},vT=function(a){return _.I(function(b){if(a.B.length)return tT(a),a.f=a.B.shift(),a.f.play(),b.F(0);uT(a);return _.y(b,a.m.a.play(),0)})},wT=function(a){a.A.length?(tT(a),a.f=a.A.shift(),a.f.play()):uT(a)},tT=function(a){var b=a.m.rc(kT).Xc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(iT),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},uT=function(a){var b=a.m.rc(kT).Xc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},xT=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new oT(a.a,c,d)});a.m.trigger(new _.L(b,d))},yT=function(){this.dd=new _.K(jT)};_.x(lT,_.Gu);_.t=lT.prototype;
|
|
6
|
+
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Yp(_.be,{id:iT}),this.f=_.Yp(_.r,{"class":_.Ad}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.N(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return kT};_.t.Xc=function(){return this.a};_.t.Mk=function(){return this.f};
|
|
7
|
+
_.J("clpp.freewheel.FreeWheelPlugin",lT);lT.prototype.getAdVideo=lT.prototype.Mk;lT.prototype.getAdContainer=lT.prototype.Xc;lT.Id=kT;lT.AD_CONTAINER_ID=iT;mT.prototype.create=function(){return new lT};_.br(new mT);_.t=oT.prototype;_.t.Cb=function(){return"FreeWheel AdManager SDK"};_.t.Db=function(){return tv.freewheel.SDK.version};_.t.Jb=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.mg?a:""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return""};
|
|
8
|
+
_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.vc=function(){return!1};_.t.Wb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
|
|
9
|
+
_.t.Gb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.Fb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.qb=function(){return 0};_.t.gb=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
|
|
10
|
+
_.t.getPodIndex=function(){switch(this.gb()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Xb=function(){switch(this.gb()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Yb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.Ib=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
|
|
11
|
+
_.t.getWrapperCreativeIds=function(){return[]};oT.prototype.getWrapperCreativeIds=oT.prototype.getWrapperCreativeIds;oT.prototype.getWrapperAdSystems=oT.prototype.getWrapperAdSystems;oT.prototype.getWrapperAdIds=oT.prototype.getWrapperAdIds;oT.prototype.getSequenceLength=oT.prototype.Ib;oT.prototype.getPositionInSequence=oT.prototype.Yb;oT.prototype.getPodTimeOffset=oT.prototype.Xb;oT.prototype.getPodIndex=oT.prototype.getPodIndex;oT.prototype.getPodType=oT.prototype.gb;
|
|
12
|
+
oT.prototype.getMediaBitrate=oT.prototype.qb;oT.prototype.getMediaHeight=oT.prototype.Fb;oT.prototype.getMediaWidth=oT.prototype.Gb;oT.prototype.getMediaUrl=oT.prototype.getMediaUrl;oT.prototype.getClickThroughUrl=oT.prototype.Wb;oT.prototype.isBumper=oT.prototype.vc;oT.prototype.getSkipTimeOffset=oT.prototype.getSkipTimeOffset;oT.prototype.getDuration=oT.prototype.getDuration;oT.prototype.getTitle=oT.prototype.getTitle;oT.prototype.getAdvertiserName=oT.prototype.getAdvertiserName;
|
|
13
|
+
oT.prototype.getAdSystem=oT.prototype.getAdSystem;oT.prototype.getApiFramework=oT.prototype.getApiFramework;oT.prototype.getCreativeId=oT.prototype.getCreativeId;oT.prototype.getId=oT.prototype.getId;oT.prototype.getTechnology=oT.prototype.Jb;oT.prototype.getAdManagerVersion=oT.prototype.Db;oT.prototype.getAdManagerName=oT.prototype.Cb;pT.prototype.getCuePoints=function(){return this.a.getTemporalSlots().map(function(a){switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})};pT.prototype.Zb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};pT.prototype.sb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
14
|
+
pT.prototype.hasPostroll=pT.prototype.sb;pT.prototype.hasPreroll=pT.prototype.Zb;pT.prototype.getCuePoints=pT.prototype.getCuePoints;_.t=qT.prototype;
|
|
15
|
+
_.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{rT(b)}catch(n){return a.m.onError(n),a.l.resolve(),m["return"](a.l)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.mg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,sT(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
|
|
16
|
+
_.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,nT(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.$e&&Object.keys(b.keyValues).forEach(function(n){return a.a.addKeyValue(n,b.keyValues[n])});a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);if(Array.isArray(b.parameters))for(g=_.w(b.parameters),h=g.next();!h.done;h=
|
|
17
|
+
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.h.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.tm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.xm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.wm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Nl.bind(a));a.h.on(a.m,_.ug,a.Dj.bind(a));a.h.on(a.m,_.jg,a.Cj.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.t.start=function(){var a=this;return _.I(function(b){return _.y(b,vT(a),0)})};
|
|
18
|
+
_.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);uT(a);a.a&&(a.a.dispose(),a.a=null);_.B(b)})};
|
|
19
|
+
_.t.tm=function(a){var b=this;if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.L(_.Qc,{adsTimeline:new pT(this.a)})),this.j=new _.Jt(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.rc(kT).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
|
|
20
|
+
void 0));this.l.resolve()};_.t.xm=function(a){xT(this,_.zc,a);this.j.start()};_.t.wm=function(a){this.f=null;a=a.slot;xT(this,_.Ac);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:vT(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:uT(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:wT(this)}};
|
|
21
|
+
_.t.Nl=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:xT(this,_.Mc,a);xT(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:xT(this,_.Nc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:xT(this,_.Ec,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:xT(this,_.Hc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:xT(this,_.Oc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:xT(this,_.Dc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:xT(this,
|
|
22
|
+
_.Cc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:xT(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:xT(this,_.Kc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:xT(this,_.Lc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:xT(this,_.Bc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:xT(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.N(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
|
|
23
|
+
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.Dj=function(){var a=this;if(!this.f){var b=this.m.getPosition();if(this.f=this.o.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.o.findIndex(function(d){return d===a.f});this.o.splice(c,1);this.m.pause();tT(this);this.f.play()}}};
|
|
24
|
+
_.t.Cj=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Bp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Ap:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.up:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);wT(this);break;case _.np:case _.yp:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};qT.prototype.getPosition=qT.prototype.getPosition;qT.prototype.setVolume=qT.prototype.setVolume;
|
|
25
|
+
qT.prototype.getVolume=qT.prototype.getVolume;qT.prototype.skip=qT.prototype.skip;qT.prototype.pause=qT.prototype.pause;qT.prototype.resume=qT.prototype.resume;qT.prototype.start=qT.prototype.start;yT.prototype.name=function(){return jT};yT.prototype.isSupported=function(a,b){return a.namespace()===_.Hd?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.dd.warn("FreeWheel SDK is not loaded."),!1)};yT.prototype.create=function(a){return new qT(a)};yT.prototype.create=yT.prototype.create;yT.prototype.isSupported=yT.prototype.isSupported;yT.prototype.name=yT.prototype.name;_.Vp(new yT);};
|
|
26
26
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
27
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
28
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hls.js
CHANGED
|
@@ -1,73 +1,75 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
d[0].a)throw new _.
|
|
4
|
-
c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.
|
|
5
|
-
|
|
6
|
-
e=b.U;d=d.concat(b.X);a=
|
|
7
|
-
d.push(h):_.
|
|
8
|
-
e+"' as it is not defined in the master playlist");d.set(e,f)});return d},
|
|
9
|
-
21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.
|
|
10
|
-
e+=10;e+=f}while(e<a.byteLength);return d()},
|
|
11
|
-
c(),a=_.
|
|
12
|
-
g}if(c||!d)throw _.
|
|
13
|
-
4,4030,
|
|
14
|
-
if("audio/mpeg"===d||d===_.
|
|
15
|
-
"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.
|
|
16
|
-
e.uris[0]);_.
|
|
17
|
-
b})},
|
|
18
|
-
|
|
19
|
-
textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,ga:m}});e&&
|
|
20
|
-
|
|
21
|
-
e.keyId=d.keyId})},
|
|
22
|
-
this.
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
if(
|
|
26
|
-
f=d.thumbStreams;g=d.
|
|
27
|
-
_.
|
|
28
|
-
frameRate:v.frameRate}});return
|
|
29
|
-
d=
|
|
30
|
-
2!==a.a.timeline.version||(a.
|
|
31
|
-
(c.value+").")),null):d/1E3},
|
|
32
|
-
_.
|
|
33
|
-
g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.
|
|
34
|
-
g,h,l,m,n;return _.
|
|
35
|
-
|
|
36
|
-
return
|
|
37
|
-
b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.
|
|
38
|
-
_.
|
|
39
|
-
b;d=c.tag;e=c.playlist;f=e.a;return g["return"](
|
|
40
|
-
new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.
|
|
41
|
-
|
|
42
|
-
I=g.closedCaptions;F=g.
|
|
43
|
-
findSegmentPosition:fd.find.bind(fd),getSegmentReference:fd.get.bind(fd),adjustSegmentDurations:fd.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
u=u.
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
u,v,function(z){return function(){return z.
|
|
50
|
-
h?h.
|
|
51
|
-
mL=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,u,v,z,
|
|
52
|
-
n+" - "+p+(", new values "+q+" - "+u+"."),b,m);throw new _.
|
|
53
|
-
p=c[0],q=null==h,
|
|
54
|
-
ga:
|
|
55
|
-
b){if(1===b.length)return b[0];var c=_.
|
|
56
|
-
4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_.t.
|
|
68
|
-
_.t.
|
|
69
|
-
|
|
70
|
-
_.t.
|
|
2
|
+
var f=function(window){var sJ="Could not parse MP4 segment start time.",tJ="Failed to infer discontinuity number",uJ="Guessing audio-only",vJ="METHOD",wJ="SAMPLE-AES-CTR",xJ="Setting playlist start time to ",yJ="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",zJ="application/vnd.apple.mpegurl",AJ="sample",BJ="whole-segment",CJ=function(a){if(1>a.a)throw _.Km();--a.a},DJ=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.N(_.O,4,4043,"Media playlist must have at least one segment!");if(null==
|
|
3
|
+
d[0].a)throw new _.N(_.O,4,4043,"Media playlist must have at least one full segment!");}this.f=a;this.a="";this.type=b;this.X=c;this.U=1===b?d:null},EJ=function(a,b,c){c=void 0===c?[]:c;this.X=b;this.a=a;this.f=c;this.ga=-1},FJ=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.Hj(0,b),_.jv.has(b.name)))return 1;return 0},GJ=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.bj(e,"NAME"),g=_.bj(e,"QUERYPARAM");if(f)g=_.cj(e,"VALUE"),
|
|
4
|
+
c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.N(_.O,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.N(_.O,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},HJ=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},IJ=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
|
|
5
|
+
HJ(d.value,b)})})},JJ=function(a,b,c){IJ(a,c);b.forEach(function(d){d.a&&(d.a=HJ(d.a,c));IJ(d.X,c);IJ(d.f,c)})},KJ=function(){this.f=0;this.a=new Map},NJ=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.Fh(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.N(_.O,4,4015);return 0===FJ(b)?LJ(a,b,c):MJ(a,b,c)},MJ=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=OJ(a,b[e]);if(_.kv.has(f.name))break;d.push(f);e++}b=PJ(a,c,b.slice(e));
|
|
6
|
+
e=b.U;d=d.concat(b.X);a=QJ(a,d,c);JJ(d,e,a);return new DJ(c,1,d,b.U)},LJ=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=OJ(a,b[e]);d.push(f);if(f.name===_.Ya){var g=b[e+1];if(!g)throw new _.N(_.O,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.dj(_.hc,g));e++}}b=_.Y.Bb(d,"EXT-X-DEFINE");_.Y.Ai(b);b=GJ(b,c);a.a=b;JJ(d,[],a.a);return new DJ(c,0,d)},PJ=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=OJ(a,h),_.jv.has(h.name)||_.mv.has(h.name)?
|
|
7
|
+
d.push(h):_.lv.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Va&&"PART"===_.bj(h,_.fc)&&g.push(h):f.push(h)):_.Y.Fh(h)||(h=_.Y.vd(b,h.trim(),!1),e.push(new EJ(h,f,g)),f=[],g=[])});0<g.length&&e.push(new EJ(null,f,g));return{U:e,X:d}},OJ=function(a,b){return _.Hj(a.f++,b)},QJ=function(a,b,c){b=_.Y.Bb(b,"EXT-X-DEFINE");_.Y.Ai(b);var d=GJ(b,c);b.map(function(e){return _.bj(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.N(_.O,4,4044,"Cannot import variable '"+
|
|
8
|
+
e+"' as it is not defined in the master playlist");d.set(e,f)});return d},RJ=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},SJ=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},TJ=function(){this.a=new Map;this.f=new Map},UJ=function(a){function b(l,m,n){for(var p="";m<n;m++)p+="%"+("00"+l[m].toString(16)).slice(-2);return p}function c(l){return l[0]<<
|
|
9
|
+
21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.N(_.O,4,4030);}SJ(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}SJ(a,e)||d();
|
|
10
|
+
e+=10;e+=f}while(e<a.byteLength);return d()},VJ=function(a){for(;a.getPosition()<a.Ia()-1;){var b=a.getPosition();if(71===_.Lm(a))return CJ(a),b}return-1},WJ=function(a){function b(){d.seek(e+188);f=_.Lm(d);71!==f&&(d.seek(e+192),f=_.Lm(d));71!==f&&(d.seek(e+204),f=_.Lm(d));71!==f&&c();CJ(d)}function c(){throw new _.N(_.O,4,4030);}var d=new _.Im(new DataView(a),!1),e=0,f=0;e=VJ(d);0>e&&(_.Iv.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Lm(d),71!==f&&
|
|
11
|
+
c(),a=_.Mm(d),8191===(a&8191))b();else if(a&16384)if(a=(_.Lm(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.Lm(d),d.skip(a)),1!==_.W(d)>>8)b();else{d.skip(3);a=_.Lm(d)>>6;0!==a&&1!==a||c();0===_.Lm(d)&&c();a=_.Lm(d);var g=_.Mm(d),h=_.Mm(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},XJ=function(a,b){var c=null,d=0;try{(new _.Rm).M(_.We,_.Sm).M(_.vg,_.Sm).M(_.Re,_.Sm).Y("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.W(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=
|
|
12
|
+
g}if(c||!d)throw _.Iv.error("Unable to find timescale in init segment!"),new _.N(_.O,4,4030,sJ,c);var e=0,f=!1;try{(new _.Rm).M("moof",_.Sm).M("traf",_.Sm).Y("tfdt",function(g){var h=d;if(0===g.version)h=_.W(g.reader)/h;else{var l=_.W(g.reader),m=_.W(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,
|
|
13
|
+
4,4030,sJ,c);return e},$J=function(a){var b=_.cj(a,vJ);if(!YJ.includes(b))return ZJ.error("PlayReady in HLS is only supported with [",YJ.join(", "),"], not",b),null;a=_.cj(a,_.hc);b=_.ru(a);a=null;b=_.oj(b.data);try{a=_.yC(_.Un(b))}catch(c){a=b}return _.LC(_.Td,[{initDataType:_.vd,initData:a}],"")},aK=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Jj()}},cK=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,u;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");
|
|
14
|
+
if("audio/mpeg"===d||d===_.gd||d===_.ed)return v["return"](0);g=f;if(d!==_.dd){v.F(2);break}return _.y(v,bK(a,c,g),3);case 3:return h=v.f,l=_.oj(h.data),SJ(l)?v["return"](UJ(l)):v["return"](WJ(h.data));case 2:if(d!==_.Mg&&d!==_.hd){v.F(4);break}m=[bK(a,c,g)];b&&m.push(bK(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](XJ(p.data,q.data));case 4:if(d!==_.Lg){v.F(6);break}return _.y(v,bK(a,c,g),7);case 7:return u=v.f,v["return"](WJ(u.data));case 6:if(!_.Cr((d.split("/")[0]||
|
|
15
|
+
"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.N(_.O,4,4030);}})},bK=function(a,b,c){var d,e,f,g,h,l,m;return _.I(function(n){switch(n.a){case 1:return d=b.f(),e=_.mD(b.Sa(),b.xa,b.xa+2048-1,a.a.attemptParameters),e.type=2,f=_.mD(b.Sa(),b.xa,b.ka,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.D(n,2),g=c?f:e,_.y(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.E(n);if(7001===l.code||c)throw l;a.g.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS pre-flights.",
|
|
16
|
+
e.uris[0]);_.D(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.E(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.N(_.O,4,4030,"Failed to fetch the media segment.");}})},dK=function(a){this.streams=a},eK=function(a,b){a.streams.forEach(function(c){c.hf=b})},fK=function(a,b){a.streams.forEach(function(c){c.width=b})},gK=function(a,b){a.streams.forEach(function(c){c.height=b})},hK=function(a,b){a.streams.forEach(function(c){c.frameRate=
|
|
17
|
+
b})},iK=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},jK=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},kK=function(a){this.a=a},lK=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},mK=function(a,b){var c=new Set(a.map(function(d){return d.ga}));return b.filter(function(d){return!c.has(d.ga)})},pK=function(a,b){for(;a[0].ga<b[0].ga;)a.splice(0,1);var c=a[0],d=b[0];
|
|
18
|
+
nK(c,d)||oK(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&!nK(c,d)&&oK(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},qK=function(a,b){var c=a[a.length-1],d=b.findIndex(function(f){return f.ga===c.ga}),e=b[d];nK(c,e)||oK(c,e);for(d+=1;d<b.length;d++)a.push(b[d])},vK=function(a,b,c,d,e){var f=b[0].length();f=RJ(f).map(function(g){var h=lK(b,g)||[],l=jK(c,g)||[];g=jK(d,g)||[];var m=_.fh(rK(h)).concat(_.fh(l),_.fh(g)).filter(Boolean);sK(m);var n=m[0];m=n.ga;n=n.duration;return{configurationId:a,variants:h,
|
|
19
|
+
textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,ga:m}});e&&tK(f[0]);uK(f);return f},rK=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},tK=function(a){var b=rK(a.variants)[0].U[0].Aa;a.startTime+=b;a.endTime+=b},uK=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:c.startTime;c.endTime=c.startTime+c.duration}},nK=function(a,b){return a.startTime===b.startTime&&a.endTime===b.endTime},
|
|
20
|
+
oK=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;wK(a.variants,b.variants);xK(_.Y.Qe(a),_.Y.Qe(b))},wK=function(a,b){var c=new Map(a.map(function(d){return[_.Y.bh(d),d]}));b.forEach(function(d){c.get(_.Y.bh(d)).drmInfos=d.drmInfos})},xK=function(a,b){var c=new Map(a.map(function(d){return[d.hc,d]}));b.forEach(function(d){var e=c.get(d.hc);e.U=d.U;e.segmentIndex.replace(d.U);e.ac=d.ac;e.Ee=d.Ee;e.duration=d.duration;e.gh=d.gh;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;
|
|
21
|
+
e.keyId=d.keyId})},sK=function(a){var b=yK(a);a.forEach(function(c){_.hD(c.segmentIndex,b);c.duration=b;c.Ee=c.ac+b})},yK=function(a){var b=Infinity;_.Y.Ck(a).forEach(function(c){b=Math.min(b,c.duration)});return b},zK=function(){var a=this;this.a=this.C=null;this.R=1;this.f=new TJ;this.w="";this.L=new KJ;this.D=0;this.j=null;this.h=new _.Zk(function(){a.Mb()});this.l=_.oc;this.o=null;this.B=new _.Vj;this.A=null;this.g=new _.K("clpp.hls.HlsParser");this.I=new Map;this.N=new aK(this.sf.bind(this));
|
|
22
|
+
this.K=!1;this.H=null;this.J=!1;this.G=new Map},AK=function(a){if(null===a.j)return[];a=a.j;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.hc})},BK=function(a,b){for(var c=_.w(b),d=c.next();!d.done;d=c.next()){d=d.value;var e=a.G.get(d.id);if(e&&e.startTime!==d.startTime)a.C.onError(new _.N(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+d.id));e||(a.G.set(d.id,d),a.C.onTimelineCueAdded({configurationId:a.C.configurationId,schemeIdUri:d.schemeIdUri,va:d.va,
|
|
23
|
+
value:"",startTime:d.startTime,endTime:d.endTime,id:d.id,type:_.iv,eventElement:null}))}},HK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z;return _.I(function(A){if(1==A.a){c=_.Mp;d=_.Y;e=CK(a,b,a.w,"");if(1===e.type){f=e.U[0].a;var G=_.Yi(f)||"";g=null!=_.Zi.video[G]?_.r:null!=_.Zi.audio[G]?_.cd:null;h="";g===c.VIDEO?h="avc1.42E01E":g===c.AUDIO&&(h="mp4a.40.2");G=a.L;var F=a.w,C=a.a.hlsDefaultCodecs||h,H=[],Q=[];Q.push(new _.dj(_.pa,"0"));Q.push(new _.dj(_.hc,F));C.length&&Q.push(new _.dj(_.ta,C));
|
|
24
|
+
H.push(new _.aj(G.f++,_.Ya,Q));e=new DJ(F,0,H)}l=_.Y.Km(e.X);return _.y(A,DK(a,l),2)}m=A.f;n=m.periods;p=m.Vm;q=m.sn;if(!a.C)throw new _.N(_.O,7,7001);u=d.Xk(n[0]);EK(a,n);G=!0;F=null;C=0;FK(a)||(G=!1,F=0,C=u.delay);H=a.a.timeline||{};H.type=void 0;F=new _.pD(H,F,C,!0,void 0,!!a.a.lowLatencyMode);_.sD(F,G);GK(F,n);p&&_.rD(F,p);v=F;if(!FK(a)){a.D=u.Bc;C=0;F=_.w(a.f.values());for(G=F.next();!G.done;G=F.next())C=Math.max(C,G.value.streams[0].ac);for(F=0;95443.7176888889<=C;)F+=95443.7176888889,C-=95443.7176888889;
|
|
25
|
+
if(F)for(a.g.debug("Offsetting live streams by",F,"to compensate for rollover"),C=_.w(a.f.values()),G=C.next();!G.done;G=C.next())G=G.value.streams[0],95443.7176888889>G.ac?(a.g.debug("Offset applied to",G.type),G.segmentIndex.offset(F)):a.g.debug("Offset NOT applied to",G.type)}G=_.Y.Yk(n);"LIVE"===a.l||"EVENT"===a.l?(G=Math.max(G,v.K),isNaN(a.a.availabilityWindowOverride)||(G=a.a.availabilityWindowOverride),v.A=G):a.l===_.oc&&(v.f=G);BK(a,q);z={presentationTimeline:v,adaptedPeriods:_.fh(n).concat(),
|
|
26
|
+
periods:n,minBufferTime:0};a.g.debug("HLS playlist parsed",z);return A["return"](z)})},KK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Y,_.y(p,IK(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Vi;h=a.o.periods[0].variants;a.a.lowLatencyMode&&null!==a.j&&(h=h.filter(function(q){return q.id===a.j.id}));l=h.map(function(q){var u=c.lh(q.audio,g),v=c.lh(q.video,g);q=JK(a,u,v,q.bandwidth);if(!q)throw new _.N(_.O,4,4047,{message:"Video and audio are encrypted in an incompatible way.",
|
|
27
|
+
oo:v?v.Kb():void 0,audio:u?u.Kb():void 0});return q});m=a.C.configurationId;n=vK(m,l,e,f,!0);return p["return"](n)})},IK=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.Mp,d=function(q){return q.stream.td()===c.VIDEO||q.stream.td()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),g=function(q){q=q.map(function(u){var v=u.stream.streams[0];u=Object.assign({},{playlist:u.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,
|
|
28
|
+
closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.hc,Te:{width:v.width,height:v.height,frameRate:v.frameRate}});return LK(a,u)});return Promise.all(q)},_.y(p,g(e),2);if(3!=p.a)return h=p.f,_.y(p,g(f),3);l=p.f;MK(a,h.concat(l));m=l.filter(function(q){return q.td()===c.Oi});n=l.filter(function(q){return q.td()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Vi:h})})},MK=function(a,b){b.forEach(function(c){a.f.a.set(c.Kb(),
|
|
29
|
+
c)})},DK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){switch(z.a){case 1:return c=_.Y.Dm(b.ed.closedCaptions),d=NK(a,b.ce),_.y(z,OK(a,b),2);case 2:return e=z.f,f=Object.values(e).flat().map(function(A){return A.playlist}),PK(a,f),_.y(z,QK(a,e.Bg,d),3);case 3:return g=z.f,_.y(z,RK(a,e.ce,g,c),4);case 4:return h=z.f,_.y(z,SK(a,e.nn,d),5);case 5:return l=z.f,_.y(z,TK(a,e.Hf),6);case 6:return m=z.f,n=a.C.configurationId,p=vK(n,h,l,m,!FK(a)),a.C.filterAllPeriods(p),q=_.fh(e.ce).concat(_.fh(e.Bg)).map(function(A){return A.playlist}),
|
|
30
|
+
u=UK(a,q),v=VK(a,q,u),z["return"]({periods:p,Vm:u,sn:v})}})},EK=function(a,b){FK(a)||2!==a.a.timeline.version||(a.H||(a.H=b[0].startTime),_.fF(b,-a.H))},VK=function(a,b,c){b=b.find(function(d){return null!==_.Y.Ra(d.X,_.La)});if(!b)return[];if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.X.filter(function(d){return d.name===_.La}).map(function(d){return _.Y.Em(d,c,a.A,!FK(a))}).filter(Boolean)},UK=function(a,b){var c=b.flatMap(function(e){return e.U[0].X});
|
|
31
|
+
c=_.Y.Ra(c,_.Wa);if(!c)return null;var d=(new Date(c.value)).getTime();return isNaN(d)?(a.g.warn("Failed to parse EXT-X-PROGRAM-DATE-TIME tag value (value: "+(c.value+").")),null):d/1E3},OK=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([WK(a,b.ed.Ui),WK(a,b.ed.pn),WK(a,b.ce),WK(a,b.Hf)]),2);c=l.f;d=_.w(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({Bg:e,nn:f,ce:g,Hf:h})})},YK=function(a,b){return Promise.all(b.map(function(c){return XK(a,
|
|
32
|
+
c)}))},NK=function(a,b){for(var c=_.Y.te,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.bj(g,"AUDIO");f=_.bj(g,_.nc);var l=_.bj(g,_.Yb);g=ZK(a,g);if(l){var m=_.Xi(_.P,g);d.set(c(_.P,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=$K(_.cd,g),d.set(c(_.cd,h),l));f&&(h=$K(_.r,g),d.set(c(_.r,f),h))}return d},SK=function(a,b,c){return Promise.all(b.map(function(d){return aL(a,d,c)}))},TK=function(a,b){return Promise.all(b.map(function(c){return bL(a,c)}))},QK=function(a,b,c){var d,
|
|
33
|
+
e;return _.I(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[aL(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return aL(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.tn(e))})},RK=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v;return _.I(function(z){if(1==z.a){e=new Set;f=_.fh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.cj(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.y(z,cL(a,n,c,d,e),2)}if(3!=
|
|
34
|
+
z.a)return p=z.f,q=f.map(function(A){return cL(a,A,c,d,e)}),_.y(z,Promise.all(q),3);u=z.f;u.splice(g,0,p);v=u.reduce(_.IC,[]);return z["return"](v)})},cL=function(a,b,c,d,e){var f,g,h,l,m,n;return _.I(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.cj(h,_.pa)),m=f.Om(h),_.y(p,dL(a,b,m,c,d),2)):(n=p.f)?p["return"](eL(a,n,l,e)):p["return"]([])})},dL=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na;return _.I(function(da){if(1==da.a)return f=_.Mp,g=_.Y.te,h=b,l=h.tag,m=h.playlist,
|
|
35
|
+
n=ZK(a,l),p=_.bj(l,"AUDIO"),q=_.bj(l,_.nc),u=p?d.get(g(f.AUDIO,p))||[]:[],v=q?d.get(g(f.VIDEO,q))||[]:[],z=_.fh(u).concat(_.fh(v)),A={audio:u,video:v},a.g.debug("Guessing stream type for",l.toString()),F=!1,C=m.a,H=A.audio.find(function(Ba){return Ba.Kb()===C}),Q=_.Xi(f.VIDEO,n),R=c||Q,1!==n.length||R?!z.length&&1<n.length?(a.g.debug("Guessing multiplexed audio+video"),G=f.VIDEO,n=[n.join(",")]):A.audio.length&&H?(a.g.debug(uJ),G=f.AUDIO,F=!0):A.video.length?(a.g.debug(uJ),G=f.AUDIO):(a.g.debug("Guessing video-only"),
|
|
36
|
+
G=f.VIDEO):(G=f.AUDIO,a.g.debug(uJ)),na=null,F?da.F(2):_.y(da,fL(a,b,n,G,e,c),3);2!=da.a&&(na=da.f);if(null==na)return da["return"](null);A[G]=[na];G===f.AUDIO&&c&&z.forEach(function(Ba){fK(Ba,c.width);gK(Ba,c.height);hK(Ba,c.frameRate)});_.Y.yk(A);return da["return"](A)})},eL=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.w(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.w(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.uk(g,m);d.has(l)?
|
|
37
|
+
a.g.debug("Skipping variant which only differs in text streams."):(m=JK(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},JK=function(a,b,c,d){for(var e=[],f=(c||b).length(),g=0;g<f;g++){var h=b?b.streams[g]||null:null,l=c?c.streams[g]||null:null,m=_.Y.Qk(h,l);if(!m)return null;var n=d;h={id:a.R++,language:h?h.language:_.yg,primary:!!h&&h.primary||!!l&&l.primary,audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};
|
|
38
|
+
e.push(h)}return new kK(e)},aL=function(a,b,c){var d,e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.a;return h["return"](gL(a,g,function(){var l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R;return _.I(function(na){if(1==na.a){l=_.Mp;m=_.Y.te;n=_.cj(e,_.gb);p=_.Y.$g(_.cj(e,_.fc));q=_.Y.qk(e);u=c.get(m(p,n))||"";v=_.bj(e,_.vb);z=_.bj(e,"NAME");A=e.getAttribute("DEFAULT");G=e.getAttribute("AUTOSELECT");F=_.bj(e,"CHANNELS");C=p===l.AUDIO?F?parseInt(F.split("/")[0],10):null:null;var da=p===l.AUDIO?(da=_.bj(e,
|
|
39
|
+
"CHANNELS"))?da.includes("/JOC"):!1:!1;H=da;Q=!!A&&!!G;return _.y(na,LK(a,{playlist:f,codecs:u,type:p,Sd:v,primary:Q,name:z,channelsCount:C,spatialAudio:H,groupId:n,kind:q,closedCaptions:null,Te:null}),2)}R=na.f;return na["return"](R)})}))})},bL=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.a;return g["return"](gL(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.bj(d,_.ta)||"jpg",l=_.bj(d,_.vb),m=_.bj(d,"NAME"),_.y(q,LK(a,{playlist:e,codecs:h,
|
|
40
|
+
type:_.Be,Sd:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,groupId:null,Te:null}),2);n=q.f;(p=_.bj(d,_.pa))&&iK(n,Number(p));return q["return"](n)})}))})},ZK=function(a,b){var c=_.bj(b,_.ta,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.UC(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},fL=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=
|
|
41
|
+
b;h=g.tag;l=g.playlist;m=_.Mp;n=l.a;return p["return"](gL(a,n,function(){var q,u,v,z;return _.I(function(A){if(1==A.a)return q=_.bj(h,_.sa),u=null,d===m.VIDEO&&q&&"NONE"!==q&&(u=e.get(q)),v=$K(d,c),_.y(A,LK(a,{playlist:l,codecs:v,type:d,closedCaptions:u,primary:!1,kind:null,Sd:null,name:null,channelsCount:null,spatialAudio:!1,groupId:null,Te:f}),2);z=A.f;return A["return"](z)})}))})},gL=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.f.has(b))return a.f.f.get(b)||null;
|
|
42
|
+
c=c();a.f.set(b,c);return c},LK=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na,da,Ba,ab,bb;return _.I(function(Qa){if(1==Qa.a){c=hL;d=iL;e=_.Mp;f=_.Y;g=b;h=g.playlist;l=g.codecs;m=g.type;n=g.Sd;p=g.groupId;q=g.primary;u=g.kind;v=g.name;z=g.channelsCount;A=g.spatialAudio;G=g.closedCaptions;F=g.Te;C=_.Y.th(n);if(1!==h.type)throw new _.N(_.O,4,4017);H=_.Y.Mm(h.X,null==a.o);a.l=H;Q=_.Y.Jm(h.X,H,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay);return _.y(Qa,jL(a,h,m,l),2)}R=Qa.f;
|
|
43
|
+
na=a.a.lowLatencyMode?d.Ii:d.Ki;da=u;m!==e.TEXT||u||(da=_.pg);Ba=f.ii(h.X);ab=Ba.me;bb=R.map(function(Ca){var fb=Ca.U,pc=Ca.Ak,Eg=Ca.mimeType;Ca=Ca.ga;var Fg=fb[0].startTime,wn=fb[fb.length-1].endTime,hu=wn-Fg,fd=new _.LD(fb),xn=fb[0].initSegment||null;return{id:_.rJ++,originalId:v,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:fd.find.bind(fd),getSegmentReference:fd.get.bind(fd),adjustSegmentDurations:fd.od.bind(fd),getDuration:fd.getDuration.bind(fd),segmentIndex:fd,segmentLookupStrategy:na,
|
|
44
|
+
initSegmentReference:xn,mimeType:Eg,codecs:l,kind:da,gh:pc.type,encrypted:pc.type===c.Ni,keyId:pc.keyId,language:C,originalLanguage:n||_.yg,label:v,type:m,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:F?F.frameRate:void 0,width:F?F.width:void 0,height:F?F.height:void 0,bandwidth:void 0,roles:[],channelsCount:z,spatialAudio:A,closedCaptions:G,keyInfo:pc.keyInfo,U:fb,drmInfos:pc.drmInfos,ga:Ca,hc:h.a,hf:h.f,ac:Fg,Ee:wn,duration:hu,me:ab,groupId:p,Bl:Q}});return Qa["return"](new dK(bb))})},
|
|
45
|
+
WK=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.y(g,kL(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},kL=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.xl(b);d=_.bj(b,_.hc,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.vd(a.w,d);return _.y(m,lL(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](CK(a,
|
|
46
|
+
h,l,d))})},XK=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.Ji(b.streams[0].hf);if(a.a.lowLatencyMode&&b.streams[0].me){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var u=q.a,v=u.length-1;q={Gl:q.position,Pm:u&&0<u.length?v:null}}else q=null;if(u=q)q=u.Gl,u=u.Pm,v=_.wk(p.a.toString()),v._HLS_msn=q.toString(),null===u&&v._HLS_part&&delete v._HLS_part,null!==u&&(v._HLS_part=u.toString()),q=_.vk(v,!0),_.Mi(p,new _.Qi(q))}c=p.toString();return _.y(n,
|
|
47
|
+
lL(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.Kb();h=b.streams[0].hf;l=e.uri;h!==l&&(h=l,eK(b,h));m=CK(a,f,h,g);return n["return"]({stream:b,playlist:m})})},CK=function(a,b,c,d){a=NJ(a.L,b,c);a.a=d;return a},mL=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.N(_.O,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},nL=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.bj(c,_.hc)})||
|
|
48
|
+
null}).map(function(b){return _.Yi(b)});if(1<(new Set(a)).size)throw new _.N(_.O,4,4044,"Unexpected change in file format.");},oL=function(a,b,c){a=_.Y.Bb(a.X,_.Ra);if(1<a.length)throw new _.N(_.O,4,4020);a=a[0];if(!a)return null;var d=_.cj(a,_.hc),e=_.Y.vd(b,d);b=_.Y.gi(a,null,!0);return new _.MC(function(){return[e]},b.xa,b.ka,c)},pL=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(_.qJ(b.f));for(var m=b.next();!m.done;l={Ve:l.Ve},m=b.next()){var n=m.value;m=n.Ah;n=n.item;var p=0===m,q=p?a:h[h.length-
|
|
49
|
+
1],u=p?d:q.endTime,v=Number(_.bj(n,_.Ha));v=u+v;p=_.Y.gi(n,p?null:q.ka,p);q=_.bj(n,_.hc);q=_.Y.vd(g,q);l.Ve=q?[q]:[];u=new _.fj(c,u,v,function(z){return function(){return z.Ve}}(l),p.xa,p.ka,e,f,!1,null,null,null,null);if("YES"===_.bj(n,"INDEPENDENT")||0===m)u.h=!0;h.push(u)}return h},qL=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.X,q=c.a;0<_.Y.Bb(p,_.Ra).length&&(n=oL(c,l,g));var u=null!=q,v=q?[q]:[];if(!u&&!a.a.lowLatencyMode)return null;a=0;q={xa:0,ka:null};var z=null;u?(c=_.Y.Hm(p).duration,a=e+c,
|
|
50
|
+
q=_.Y.hi(p,b?b.ka:null)):(b=pL(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.Be?_.Y.Nm(p):null;d=new _.fj(d,e,a,function(){return v},q.xa,q.ka,f,g,!1,null,h?h.Jd:null,h?h.be:null,h?h.durationPerTile:null,z,n);d.ga=m;return d},jL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,u,v,z,A,G;return _.I(function(F){switch(F.a){case 1:return e=_.Y,f=rL,g=sL,h=b.a,l=b.U,m=e.Uk(b.X,_.Sa),n=[],!FK(a)&&g.Ti(l),_.y(F,tL(a,b.f,h,l,m,c,d),2);case 2:p=F.f,q=m,u=f.ln(l),v=0;case 3:if(!(v<u.length)){F.F(5);break}z=u[v];
|
|
51
|
+
A=n[n.length-1]||null;return _.y(F,uL(a,b.f,z,q,p,c,d,A,u.length),6);case 6:G=F.f;n.push(G);q+=z.length;v++;F.F(3);break;case 5:return mL(n),F["return"](n)}})},tL=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,u,v,z,A,G,F;return _.I(function(C){if(1==C.a){h=d[0];if(null!=a.A)return C["return"](a.A);if(!FK(a)&&a.o)try{var H=a.f.get(c),Q=H?H.find(e)||null:null;if(!Q)throw new _.N(_.O,4,4030,"Segment not found in pervious playlist update.");l=Q.startTime+Q.Aa;a.g.debug(xJ+l+".");a.A=l;return C["return"](l)}catch(R){if(m=
|
|
52
|
+
a.f.get(c))n=m.streams[0].U[0].position,C=m.streams[m.streams.length-1].U,p=C[C.length-1].position,q=e,u=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+u+"."),b,m);throw new _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(C,vL(a,f,g,h),2)}if(3!=C.a)return v=C.f,z=sL.Lm(h,a.w,v),A=oL(h,b,z.keyInfo),G=_.Y.Df(z.keyInfo,e),_.y(C,wL(a,A,h,G,v,g),3);F=C.f;a.g.debug(xJ+F+".");a.A=F;return C["return"](F)})},
|
|
53
|
+
uL=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,u,v,z,A,G,F,C,H,Q,R,na,da,Ba,ab,bb,Qa,Ca;return _.I(function(fb){switch(fb.a){case 1:return m=_.Y,n=sL,p=c[0],q=null==h,nL(c),_.y(fb,vL(a,f,g,p),2);case 2:u=fb.f;v=n.Gm(c,a.w,u,h?h.Al:null,1===l);z=v[v.length-1];A=sL.pa(v);G=oL(p,b,A.keyInfo)||(h?h.ol:null);F=_.Y.Df(A.keyInfo,d);C=p.ga;if(q){H=e;fb.F(3);break}return _.y(fb,xL(a,C,G,p,d,F,u,g),4);case 4:H=fb.f;case 3:Q=H;R=[];for(na=0;na<c.length;na++)if(da=c[na],Ba=R[R.length-1]||null,ab=0===na?0:Ba.endTime,
|
|
54
|
+
bb=d+na,Qa=m.Df(A.keyInfo,bb),Ca=qL(a,Ba,da,bb,ab,Q,Qa,f,b,C,G))G=Ca.initSegment,R.push(Ca);return fb["return"]({U:R,Ak:A,Al:z,mimeType:u,endTime:R[R.length-1].endTime,ga:C,ol:G})}})},PK=function(a,b){b.forEach(function(c){var d=a.f.get(c.a);rL.Zi(c,d,!FK(a))});rL.vk(b)},xL=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.I.has(b)?m["return"](a.I.get(b)):_.y(m,wL(a,c,d,f,g,h),2);l=m.f;a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.I.set(b,l);return m["return"](l)})},
|
|
55
|
+
wL=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.tk(c,d);return h["return"](cK(a.N,b,g,e,f,null!=d))})},$K=function(a,b){if(1===b.length)return b[0];var c=_.Xi(a,b);if(null!=c)return c;throw new _.N(_.O,4,4025,{codecList:b});},vL=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Ra(d.X,_.Ra))?_.cj(f,_.hc):null;return h["return"](yL(a,b,c,e,g))})},yL=function(a,b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);
|
|
56
|
+
if(g=_.$i(f,b,c))return n["return"](g);h=_.Mj([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.sf(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.N(_.O,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},lL=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.Mj([b],a.a.attemptParameters),c.type=1,_.y(f,a.sf(c),2);d=f.f;e="";try{e=_.S.ba(d.data)}catch(g){throw new _.N(_.O,4,4042);}e=_.S.Qh(e);e=e.trim();return f["return"]({text:e,
|
|
57
|
+
response:d})})},FK=function(a){return a.l===_.oc},GK=function(a,b){_.Y.Mh(b,function(c,d){_.wD(a,c.U,d.startTime)});_.oD(a.a,b[0].startTime,b[b.length-1].endTime)},zL=function(){},iL={Ii:_.iC,Ki:_.hC},hL={Ni:AJ,Pn:BJ,NONE:_.Ze};_.t=TJ.prototype;_.t.set=function(a,b){var c=this;this.f.set(a,b);return b.then(function(d){return c.a.set(a,d)})["catch"](function(){}).then(function(){return c.f["delete"](a)})};_.t.has=function(a){return this.a.has(a)};_.t.get=function(a){return this.a.get(a)||null};
|
|
58
|
+
_.t.values=function(){return Array.from(this.a.values())};_.t.clear=function(){this.f.clear();this.a.clear()};
|
|
59
|
+
var rL={vk:function(a){var b=rL.Jk(a),c=rL.zl(a);a.forEach(function(d){var e=d.U,f=e.findIndex(function(h){return h.ga===b}),g=e.findIndex(function(h){return h.ga===c+1});-1===g&&(g=e.length);d.U=e.slice(f,g)})},Zi:function(a,b,c){b=rL.Tk(a,b,c);a=_.w(a.U||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.bd(c.X,_.Ma)&&b++,c.ga=b},Tk:function(a,b,c){var d=_.Y.Ra(a.X,_.Na);if(d)return Number(d.value);d=rL.rl(b);if(c&&d)try{return rL.nl(a,b)}catch(e){throw new _.N(_.O,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
|
|
60
|
+
}return 0},rl:function(a){return 0<rL.Wk(a)},ln:function(a){if(0===a.length)return[];var b=[],c=[];a=_.w(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.bd(d.X,_.Ma)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Wk:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].U;return a[a.length-1].ga},nl:function(a,b){var c=_.Y.Ra(a.X,_.Sa);if(!c)throw rL.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(tJ);c=Number(c.value);var d=
|
|
61
|
+
b.find(c);if(!d)throw rL.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(tJ);return d.ga},zl:function(a){a=a.map(function(b){return b.U[b.U.length-1].ga});return Math.min.apply(Math,_.fh(a))},Jk:function(a){a=a.map(function(b){return b.U[0].ga});return Math.max.apply(Math,_.fh(a))}};rL.g=new _.K("clpp.hls.DiscontinuityUtils");var AL={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Lg)throw new _.N(_.O,4,4041);if(_.cj(a,vJ)===wJ)throw new _.N(_.O,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.LC(_.Rd,[{initDataType:_.fg,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":$J,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":$J,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.cj(a,vJ);if(!YJ.includes(b))return ZJ.error("Widevine in HLS is only supported with [",
|
|
62
|
+
YJ.join(", "),"], not",b),null;b=_.cj(a,_.hc);b=_.ru(b);b=_.oj(b.data);b=_.LC(_.Vd,[{initDataType:_.vd,initData:b}],"");if(a=_.bj(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},YJ=["SAMPLE-AES",wJ],ZJ=new _.K("clpp.hls.DrmParser");var sL={Lm:function(a,b,c){return sL.Yf(a.X,b,c)||{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}},Gm:function(a,b,c,d,e){if(a.slice(1).some(sL.yh))throw new _.N(_.O,4,4046,e?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");if(_.Y.bd(a[0].X,_.Pa)||null===d){if((d=sL.Yf(a[0].X,
|
|
63
|
+
b,c))&&d.type===BJ){if(1<sL.ah(a))throw new _.N(_.O,4,4046,yJ+((e?"playlist":"discontinuity")+"."));return[d]}a=sL.ei(a,b,c);return 0===a.length?[{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}]:a}b=sL.ei(a,b,c);if(d.type===_.Ze||d.type===AJ)return[d].concat(_.fh(b));if(0<sL.ah(a))throw new _.N(_.O,4,4046,yJ+((e?"playlist":"discontinuity")+"."));return[d]},pa:function(a){if(0===a.length)return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===BJ})||a.every(function(c){return c.type===
|
|
64
|
+
_.Ze}))return a[0];a=a.filter(function(c){return c.type===AJ});var b=_.qi(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:AJ,drmInfos:b}},Ti:function(a){a=sL.kh(a);if(a.some(function(b){return sL.yh(b)})&&1<a.length)throw new _.N(_.O,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},yh:function(a){return _.Y.Bb(a.X,_.Pa).some(function(b){return"AES-128"===_.bj(b,vJ)})},ei:function(a,b,c){return sL.kh(a).map(function(d){return sL.Yf(d.X,
|
|
65
|
+
b,c)})},ah:function(a){return a.filter(function(b){return _.Y.bd(b.X,_.Pa)}).length},kh:function(a){return a.filter(function(b){return _.Y.bd(b.X,_.Pa)})},Yf:function(a,b,c){a=_.Y.Bb(a,_.Pa);if(0===a.length)return null;var d=_.cj(a[0],vJ);if(1===a.length){if("NONE"===d)return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.bj(a,"IV",""),{type:BJ,keyInfo:{method:"AES-128",url:_.Y.vd(b,_.cj(a,_.hc)),iv:d?_.Bj((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.cj(e,
|
|
66
|
+
vJ)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===wJ}))throw sL.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.N(_.O,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.bj(e,"KEYFORMAT","identity"),g=AL[f]||null;(e=g?g(e,c):null)||sL.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.N(_.O,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,
|
|
67
|
+
f){return e.concat(f)},[]).reverse()[0]||null,type:AJ,drmInfos:b}},io:function(){return{type:_.Ze,keyInfo:null,drmInfos:[],keyId:null}}};sL.g=new _.K("clpp.hls.EncryptionUtils");_.t=dK.prototype;_.t.length=function(){return this.streams.length};_.t.Vk=function(){return this.streams[0].groupId};_.t.td=function(){return this.streams[0].type};_.t.Pk=function(){return this.streams[0].codecs.split(",")};_.t.Kb=function(){return this.streams[0].hc};_.t.dn=function(a){this.streams.forEach(function(b){b.codecs=a.join(",")})};
|
|
68
|
+
_.t.find=function(a){var b=this.streams.find(function(c){c=c.U;return c[0].position<=a&&a<=c[c.length-1].position});return null==b?null:b.U.find(function(c){return c.position===a})||null};kK.prototype.length=function(){return this.a.length};_.t=zK.prototype;_.t.configure=function(a){this.a=a;this.N.a=a};_.t.setCurrentVariant=function(a){this.j=a};_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.K)throw Error("start() may be called only once!");c.K=!0;c.C=b;return _.y(l,lL(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.w=e.uri,_.y(l,HK(c,f),3);g=l.f;c.o=g;h=c.D;c.h&&0<h&&c.h.da(h);return l["return"](g)})};_.t.requestStop=function(){this.J=!0};
|
|
69
|
+
_.t.stop=function(){this.h&&(this.h.stop(),this.h=null);var a=[];this.B&&(a.push(this.B.destroy()),this.B=null);this.f.clear();this.o=this.a=this.C=this.j=null;this.G.clear();return Promise.all(a)};
|
|
70
|
+
_.t.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a){b=a.o;if(FK(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.l&&(a.A=null);d=Array.from(a.f.values());a.a.lowLatencyMode&&null!==a.j&&(e=AK(a),d=d.filter(function(q){return e.includes(q.Kb())}));return _.y(p,YK(a,d),2)}if(3!=p.a)return f=p.f,g=f.map(function(q){return q.playlist}),PK(a,g),_.y(p,KK(a,f),3);h=p.f;mK(b.periods,h).forEach(function(q){a.C.filterNewPeriod(q)});EK(a,h);l=UK(a,g);m=VK(a,
|
|
71
|
+
g,l);BK(a,m);pK(b.periods,h);qK(b.adaptedPeriods,h);GK(c,h);if(n=_.Y.ll(g))!0!==a.a.keepTimelineLive&&(a.l=_.oc,_.sD(c,!0),c.f=h[h.length-1].endTime),a.h.stop(),a.h=null;if(a.C.onUpdate)a.C.onUpdate(b);if(n&&a.C.onTurnedStatic)a.C.onTurnedStatic();return a.J?_.y(p,a.stop(),0):p.F(0)})};
|
|
72
|
+
_.t.Mb=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.$B);if(!a.C)return d["return"]();_.D(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.h&&0<a.D&&a.h.da(a.D),_.th(d,0);b=_.E(d);if(!(b instanceof _.N))throw b;a.C&&(a.C.onError(b),c=b,1===c.severity&&a.h&&a.h.da(.1));_.B(d)})};_.t.sf=function(a){if(!this.B)throw new _.N(_.O,7,7001);a=this.C.networkingEngine.fetch(a);_.Wj(this.B,a);return a.P};_.x(zL,_.Ts);zL.prototype.f=function(){_.St.m3u8=zK;_.Qt[_.Il]=zK;_.Qt[zJ]=zK};zL.prototype.a=function(){_.oE("m3u8");_.pE(_.Il);_.pE(zJ)};zL.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",zL);};
|
|
71
73
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
72
74
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
73
75
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hlssmpte.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
c.mode=_.
|
|
6
|
-
a.m.getTrackManager().
|
|
7
|
-
_.J("clpp.hlssmpte.HlsSmptePlugin"
|
|
2
|
+
var f=function(window){var YS=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.M.S(a)){a:{var b=a.info;if(_.M.ca(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.M.ca(a)?a:null}},$S=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.Xh;this.h=(a=_.uu(_.$c))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;ZS(this)},ZS=function(a){a.a.one(a.m,_.Le,function(){return aT(a)})},
|
|
3
|
+
aT=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Pc,function(d){return bT(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Te}).forEach(function(d){bT(a,{track:d})});!cT(c)&&a.l&&(a.g.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),dT(a,b))}else a.g.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.g.warn("A video element is not available. Skipping.")},
|
|
4
|
+
cT=function(a){return a.some(function(b){return b.kind===_.Te})},dT=function(a,b){var c=a.m.getTrackManager(),d=c.ma(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ba(d)};a.a.on(b.textTracks,_.Pc,function(g){g.track.kind===_.Te&&(a.a.off(b.textTracks,_.Pc,f),f())});c.Ba(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},bT=function(a,b){var c=b.track;c.kind===_.Te&&(a.g.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.ye,a.a.on(c,_.Yd,function(d){return eT(a,d)}))},eT=function(a,b){var c=fT(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.f&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new YS(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.S.Wa(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.m.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},fT=function(a){return(a=
|
|
6
|
+
a.m.getTrackManager().wa())&&a.language&&a.language.toLowerCase()},gT=function(){this.a=null;this.f=!1},hT=function(){};$S.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(gT,_.Gu);gT.prototype.onPlayerCreated=function(){};gT.prototype.onContentWillLoad=function(a){if(this.f=_.gl()){var b=a.getConfiguration();b=_.M.Oa(b.hlssmpte||{});_.M.Eh(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.M.sa(b.timestampOffset)||(b.timestampOffset=0);this.a=new $S(a,b.patchMetadataTrack,b.timestampOffset)}};gT.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.y(b,a.a.destroy(),3):b.F(0);a.a=null;_.B(b)})};gT.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.J("clpp.hlssmpte.HlsSmptePlugin",gT);gT.Id="hlssmpte";hT.prototype.create=function(){return new gT};_.br(new hT);};
|
|
8
8
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
9
9
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
10
10
|
else{_=this.clpp._;(f.call(g,this));}
|