@castlabs/prestoplay 6.22.0 → 6.23.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 +9 -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 +112 -112
- package/cjs/cl.conviva.js +32 -33
- package/cjs/cl.core.js +591 -586
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +81 -80
- package/cjs/cl.externs.js +43 -36
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +330 -325
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- 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 +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +477 -474
- package/cl.crypto.js +9 -9
- package/cl.dash.js +76 -75
- package/cl.externs.js +43 -36
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +295 -291
- 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.yospace.js +3 -3
- package/cl.youbora.js +28 -27
- package/package.json +1 -1
- package/typings.d.ts +53 -6
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
|
-
_.u.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.
|
|
7
|
-
_.J("clpp.freewheel.FreeWheelPlugin"
|
|
8
|
-
_.u.getTitle=function(){return""};_.u.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return 0};_.u.
|
|
9
|
-
_.u.
|
|
10
|
-
_.u.getPodIndex=function(){switch(this.
|
|
11
|
-
_.u.getWrapperCreativeIds=function(){return[]};_.u.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.u.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{
|
|
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
|
-
_.u.resume=function(){this.f&&this.f.resume()};_.u.pause=function(){this.f&&this.f.pause()};_.u.skip=function(){this.f&&this.f.skipCurrentAd()};_.u.getVolume=function(){return this.a?this.a.getAdVolume():1};_.u.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.u.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.u.
|
|
19
|
-
_.u.
|
|
20
|
-
void 0));this.l.resolve()};_.u.
|
|
21
|
-
_.u.
|
|
22
|
-
_.
|
|
23
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.u.
|
|
24
|
-
_.u.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var mV="clpp-freewheel",nV="clpp.freewheel.AdsManagerFactory",oV="freewheel",pV=function(){this.f=this.a=null},qV=function(){},rV=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""}},sV=function(a,b,c){this.h=a;this.f=b;this.a=c},tV=function(a){this.a=a},uV=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.Wh;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.mk;this.j=null},vV=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ig&&b.push("serverUrl");typeof a.profileId!==_.ig&&b.push("profileId");typeof a.videoAssetId!==_.ig&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.O(1,9,12001,{missingKeys:b.join(", ")});},wV=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.Cu,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)})},zV=function(a){return _.I(function(b){if(a.B.length)return xV(a),a.f=a.B.shift(),a.f.play(),b.F(0);yV(a);return _.y(b,a.m.a.play(),0)})},AV=function(a){a.A.length?(xV(a),a.f=a.A.shift(),a.f.play()):yV(a)},xV=function(a){var b=a.m.Wd(oV).cd();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(mV),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},yV=function(a){var b=a.m.Wd(oV).cd();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},BV=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 sV(a.a,c,d)});a.m.trigger(new _.L(b,d))},CV=function(){this.jd=new _.K(nV)};_.x(pV,_.Gv);_.u=pV.prototype;
|
|
6
|
+
_.u.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Iq(_.Xd,{id:mV}),this.f=_.Iq(_.r,{"class":_.vd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.O(1,9,12E3))};_.u.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.u.id=function(){return oV};_.u.cd=function(){return this.a};_.u.wl=function(){return this.f};
|
|
7
|
+
_.J("clpp.freewheel.FreeWheelPlugin",pV);pV.prototype.getAdVideo=pV.prototype.wl;pV.prototype.getAdContainer=pV.prototype.cd;pV.Id=oV;pV.AD_CONTAINER_ID=mV;qV.prototype.create=function(){return new pV};_.gt(new qV);_.u=sV.prototype;_.u.ob=function(){return"FreeWheel AdManager SDK"};_.u.pb=function(){return tv.freewheel.SDK.version};_.u.sb=function(){return 0};_.u.getId=function(){return this.a?this.a.getAdId():""};_.u.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ig?a:""};_.u.Sb=function(){return""};_.u.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.u.getAdSystem=function(){return""};_.u.getAdvertiserName=function(){return""};
|
|
8
|
+
_.u.getTitle=function(){return""};_.u.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return 0};_.u.Wb=function(){return!1};_.u.qb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.u.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
|
|
9
|
+
_.u.fb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.u.eb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.u.Qa=function(){return 0};_.u.Ra=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
|
+
_.u.getPodIndex=function(){switch(this.Ra()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.u.Fb=function(){switch(this.Ra()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.u.Gb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.u.gb=function(){return this.f.getAdCount()};_.u.getWrapperAdIds=function(){return[]};_.u.getWrapperAdSystems=function(){return[]};
|
|
11
|
+
_.u.getWrapperCreativeIds=function(){return[]};_.u.Vb=function(){return null};sV.prototype.getVideoElement=sV.prototype.Vb;sV.prototype.getWrapperCreativeIds=sV.prototype.getWrapperCreativeIds;sV.prototype.getWrapperAdSystems=sV.prototype.getWrapperAdSystems;sV.prototype.getWrapperAdIds=sV.prototype.getWrapperAdIds;sV.prototype.getSequenceLength=sV.prototype.gb;sV.prototype.getPositionInSequence=sV.prototype.Gb;sV.prototype.getPodTimeOffset=sV.prototype.Fb;sV.prototype.getPodIndex=sV.prototype.getPodIndex;
|
|
12
|
+
sV.prototype.getPodType=sV.prototype.Ra;sV.prototype.getMediaBitrate=sV.prototype.Qa;sV.prototype.getMediaHeight=sV.prototype.eb;sV.prototype.getMediaWidth=sV.prototype.fb;sV.prototype.getMediaUrl=sV.prototype.getMediaUrl;sV.prototype.getClickThroughUrl=sV.prototype.qb;sV.prototype.isBumper=sV.prototype.Wb;sV.prototype.getSkipTimeOffset=sV.prototype.getSkipTimeOffset;sV.prototype.getPosition=sV.prototype.getPosition;sV.prototype.getDuration=sV.prototype.getDuration;sV.prototype.getTitle=sV.prototype.getTitle;
|
|
13
|
+
sV.prototype.getAdvertiserName=sV.prototype.getAdvertiserName;sV.prototype.getAdSystem=sV.prototype.getAdSystem;sV.prototype.getApiFramework=sV.prototype.getApiFramework;sV.prototype.getSourceId=sV.prototype.Sb;sV.prototype.getCreativeId=sV.prototype.getCreativeId;sV.prototype.getId=sV.prototype.getId;sV.prototype.getTechnology=sV.prototype.sb;sV.prototype.getAdManagerVersion=sV.prototype.pb;sV.prototype.getAdManagerName=sV.prototype.ob;tV.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()}})};tV.prototype.Ib=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};tV.prototype.Hb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
14
|
+
tV.prototype.hasPostroll=tV.prototype.Hb;tV.prototype.hasPreroll=tV.prototype.Ib;tV.prototype.getCuePoints=tV.prototype.getCuePoints;_.u=uV.prototype;
|
|
15
|
+
_.u.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{vV(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!==_.ig&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,wV(),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,rV(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Xe&&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.Xm.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.an.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.$m.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.sm.bind(a));a.h.on(a.m,_.qg,a.kk.bind(a));a.h.on(a.m,_.fg,a.jk.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.u.start=function(){var a=this;return _.I(function(b){return _.y(b,zV(a),0)})};_.u.Vc=function(){};
|
|
18
|
+
_.u.resume=function(){this.f&&this.f.resume()};_.u.pause=function(){this.f&&this.f.pause()};_.u.skip=function(){this.f&&this.f.skipCurrentAd()};_.u.getVolume=function(){return this.a?this.a.getAdVolume():1};_.u.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.u.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.u.Sc=function(){return!0};_.u.sc=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);yV(a);a.a&&(a.a.dispose(),a.a=null);_.B(b)})};
|
|
19
|
+
_.u.Xm=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(_.Lc,{adsTimeline:new tV(this.a)})),this.j=new _.Au(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.Wd(oV).f);else this.m.onError(new _.O(1,9,10003,{errorType:0},
|
|
20
|
+
void 0));this.l.resolve()};_.u.an=function(a){BV(this,_.rc,a);this.j.start()};_.u.$m=function(a){this.f=null;a=a.slot;BV(this,_.sc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:zV(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:yV(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:AV(this)}};
|
|
21
|
+
_.u.sm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:BV(this,_.Hc,a);BV(this,_.Ac,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:BV(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:BV(this,_.wc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:BV(this,_.Cc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:BV(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:BV(this,_.vc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:BV(this,
|
|
22
|
+
_.uc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:BV(this,_.Dc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:BV(this,_.Fc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:BV(this,_.Gc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:BV(this,_.tc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:BV(this,_.Ec,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.O(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]}))}};_.u.kk=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();xV(this);this.f.play()}}};
|
|
24
|
+
_.u.jk=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.iq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.hq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.bq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);AV(this);break;case _.Vp:case _.fq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};uV.prototype.getPosition=uV.prototype.getPosition;uV.prototype.setVolume=uV.prototype.setVolume;
|
|
25
|
+
uV.prototype.getVolume=uV.prototype.getVolume;uV.prototype.skip=uV.prototype.skip;uV.prototype.pause=uV.prototype.pause;uV.prototype.resume=uV.prototype.resume;CV.prototype.name=function(){return nV};CV.prototype.a=function(a,b){return a.namespace()!==_.zd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.jd.warn("FreeWheel SDK is not loaded."),!1):!1};CV.prototype.create=function(a){return new uV(a)};_.Cq(new CV);};
|
|
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,74 +1,74 @@
|
|
|
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.
|
|
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]);_.D(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.
|
|
17
|
-
b})},
|
|
18
|
-
b){var c=new Set(a.map(function(d){return d.
|
|
19
|
-
_.
|
|
20
|
-
c.startTime+c.duration}},
|
|
21
|
-
e.drmInfos=d.drmInfos;e.keyId=d.keyId})},
|
|
22
|
-
new
|
|
23
|
-
e.id));var g={configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,endTime:e.endTime,id:e.id,type:_.
|
|
24
|
-
f===c.AUDIO&&(g="mp4a.40.2");
|
|
25
|
-
m.qe;
|
|
26
|
-
t.K),isNaN(a.a.availabilityWindowOverride)||(
|
|
27
|
-
c.
|
|
28
|
-
t.stream.streams[0];t=Object.assign({},{playlist:t.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.oc,kf:{width:v.width,height:v.height,frameRate:v.frameRate}});return
|
|
29
|
-
n=l.filter(function(q){return q.
|
|
30
|
-
a.a.suggestedPresentationDelay),_.y(
|
|
31
|
-
b,c){b=b.find(function(d){return null!==_.Y.
|
|
32
|
-
(c.value+").")),null):d/1E3},
|
|
33
|
-
_.
|
|
34
|
-
d.concat(b.slice(1).map(function(g){return
|
|
35
|
-
|
|
36
|
-
a.g.debug("Guessing stream type for",l.toString()),
|
|
37
|
-
A[
|
|
38
|
-
(b.push(m),d.add(l)))}}return b},
|
|
39
|
-
function(){var l,m,n,p,q,t,v,z,A,
|
|
40
|
-
groupId:n,kind:q,closedCaptions:null,kf:null}),2)}
|
|
41
|
-
return q["return"](n)})}))})},
|
|
42
|
-
d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q)),v=
|
|
43
|
-
g=f.playlist;h=f.codecs;l=f.type;m=f.fe;n=f.groupId;p=f.primary;q=f.kind;t=f.name;v=f.channelsCount;z=f.spatialAudio;A=f.closedCaptions;
|
|
44
|
-
findSegmentPosition:Jb.
|
|
45
|
-
spatialAudio:z,closedCaptions:A,
|
|
46
|
-
_.Y.
|
|
47
|
-
v._HLS_msn=q.toString(),null===t&&v._HLS_part&&delete v._HLS_part,null!==t&&(v._HLS_part=t.toString()),q=_.
|
|
48
|
-
},
|
|
49
|
-
{mf:l.mf},m=b.next()){var n=m.value;m=n.
|
|
50
|
-
a=0;q={
|
|
51
|
-
q=m,t=f.
|
|
52
|
-
|
|
53
|
-
e),_.y(
|
|
54
|
-
[];for(
|
|
55
|
-
e+" has raw media timestamp "+(l+" s."));a.J.set(b,l);return m["return"](l)})},
|
|
56
|
-
b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.
|
|
57
|
-
4,4042);}e=_.
|
|
58
|
-
{
|
|
59
|
-
var
|
|
60
|
-
}return 0},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
b,c))&&d.type===
|
|
64
|
-
_.
|
|
65
|
-
b,c)})},
|
|
66
|
-
|
|
67
|
-
f){return e.concat(f)},[]).reverse()[0]||null,type:
|
|
2
|
+
var f=function(window){var lL="Could not parse MP4 segment start time.",mL="Failed to infer discontinuity number",nL="Guessing audio-only",oL="METHOD",pL="SAMPLE-AES-CTR",qL="Setting playlist start time to ",rL="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",sL="application/vnd.apple.mpegurl",tL="sample",uL="whole-segment",vL=function(a){if(1>a.a)throw _.hn();--a.a},wL=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.O(_.P,4,4043,"Media playlist must have at least one segment!");if(null==
|
|
3
|
+
d[0].a)throw new _.O(_.P,4,4043,"Media playlist must have at least one full segment!");}this.f=a;this.a="";this.type=b;this.W=c;this.S=1===b?d:null},xL=function(a,b,c){c=void 0===c?[]:c;this.W=b;this.a=a;this.f=c;this.la=-1},yL=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.Yj(0,b),_.Uv.has(b.name)))return 1;return 0},zL=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.rj(e,"NAME"),g=_.rj(e,"QUERYPARAM");if(f)g=_.sj(e,"VALUE"),
|
|
4
|
+
c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.O(_.P,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.O(_.P,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},AL=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.O(_.P,4,4044,"Undefined variable '"+d+"'");return e})},BL=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
|
|
5
|
+
AL(d.value,b)})})},CL=function(a,b,c){BL(a,c);b.forEach(function(d){d.a&&(d.a=AL(d.a,c));BL(d.W,c);BL(d.f,c)})},DL=function(){this.f=0;this.a=new Map},GL=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.hi(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.O(_.P,4,4015);return 0===yL(b)?EL(a,b,c):FL(a,b,c)},FL=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=HL(a,b[e]);if(_.Vv.has(f.name))break;d.push(f);e++}b=IL(a,c,b.slice(e));
|
|
6
|
+
e=b.S;d=d.concat(b.W);a=JL(a,d,c);CL(d,e,a);return new wL(c,1,d,b.S)},EL=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=HL(a,b[e]);d.push(f);if(f.name===_.Ua){var g=b[e+1];if(!g)throw new _.O(_.P,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.tj(_.ac,g));e++}}b=_.Y.Qb(d,"EXT-X-DEFINE");_.Y.fj(b);b=zL(b,c);a.a=b;CL(d,[],a.a);return new wL(c,0,d)},IL=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=HL(a,h),_.Uv.has(h.name)||_.Xv.has(h.name)?
|
|
7
|
+
d.push(h):_.Wv.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Ra&&"PART"===_.rj(h,_.Zb)&&g.push(h):f.push(h)):_.Y.hi(h)||(h=_.Y.Jd(b,h.trim(),!1),e.push(new xL(h,f,g)),f=[],g=[])});0<g.length&&e.push(new xL(null,f,g));return{S:e,W:d}},HL=function(a,b){return _.Yj(a.f++,b)},JL=function(a,b,c){b=_.Y.Qb(b,"EXT-X-DEFINE");_.Y.fj(b);var d=zL(b,c);b.map(function(e){return _.rj(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.O(_.P,4,4044,"Cannot import variable '"+
|
|
8
|
+
e+"' as it is not defined in the master playlist");d.set(e,f)});return d},KL=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},LL=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},ML=function(){this.a=new Map;this.f=new Map},NL=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 _.O(_.P,4,4030);}LL(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}}LL(a,e)||d();
|
|
10
|
+
e+=10;e+=f}while(e<a.byteLength);return d()},OL=function(a){for(;a.getPosition()<a.Pa()-1;){var b=a.getPosition();if(71===_.jn(a))return vL(a),b}return-1},PL=function(a){function b(){d.seek(e+188);f=_.jn(d);71!==f&&(d.seek(e+192),f=_.jn(d));71!==f&&(d.seek(e+204),f=_.jn(d));71!==f&&c();vL(d)}function c(){throw new _.O(_.P,4,4030);}var d=new _.fn(new DataView(a),!1),e=0,f=0;e=OL(d);0>e&&(_.rw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.jn(d),71!==f&&
|
|
11
|
+
c(),a=_.kn(d),8191===(a&8191))b();else if(a&16384)if(a=(_.jn(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.jn(d),d.skip(a)),1!==_.ln(d)>>8)b();else{d.skip(3);a=_.jn(d)>>6;0!==a&&1!==a||c();0===_.jn(d)&&c();a=_.jn(d);var g=_.kn(d),h=_.kn(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},QL=function(a,b){var c=null,d=0;try{(new _.qn).N(_.Te,_.rn).N(_.rg,_.rn).N(_.Oe,_.rn).X("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.ln(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=
|
|
12
|
+
g}if(c||!d)throw _.rw.error("Unable to find timescale in init segment!"),new _.O(_.P,4,4030,lL,c);var e=0,f=!1;try{(new _.qn).N("moof",_.rn).N("traf",_.rn).X("tfdt",function(g){var h=d;if(0===g.version)h=_.ln(g.reader)/h;else{var l=_.ln(g.reader),m=_.ln(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 _.O(_.P,
|
|
13
|
+
4,4030,lL,c);return e},TL=function(a){var b=_.sj(a,oL);if(!RL.includes(b))return SL.error("PlayReady in HLS is only supported with [",RL.join(", "),"], not",b),null;a=_.sj(a,_.ac);b=_.cv(a);a=null;b=_.Fj(b.data);try{a=_.PD(_.zo(b))}catch(c){a=b}return _.bE(_.Md,[{initDataType:_.qd,initData:a}],"")},UL=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.ak()}},WL=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,t;return _.I(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");
|
|
14
|
+
if("audio/mpeg"===d||d===_.bd||d===_.ad)return v["return"](0);g=f;if(d!==_.$c){v.F(2);break}return _.y(v,VL(a,c,g),3);case 3:h=v.f;l=_.Fj(h.data);if(!LL(l))throw new _.O(_.P,4,4030,"AAC segment does not contain an ID3 tag.");return v["return"](NL(l));case 2:if(d!==_.Jg&&d!==_.cd){v.F(4);break}m=[VL(a,c,g)];b&&m.push(VL(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"](QL(p.data,q.data));case 4:if(d!==_.Ig){v.F(6);break}return _.y(v,VL(a,c,g),7);case 7:return t=
|
|
15
|
+
v.f,v["return"](PL(t.data));case 6:if(!_.Gt((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.O(_.P,4,4030);}})},VL=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=_.DE(b.Xa(),b.za,b.za+2048-1,a.a.attemptParameters),e.type=2,f=_.DE(b.Xa(),b.za,b.ma,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=_.F(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=_.F(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.O(_.P,4,4030,"Failed to fetch the media segment.");}})},XL=function(a){this.streams=a},YL=function(a,b){a.streams.forEach(function(c){c.yf=b})},ZL=function(a,b){a.streams.forEach(function(c){c.width=b})},$L=function(a,b){a.streams.forEach(function(c){c.height=b})},aM=function(a,b){a.streams.forEach(function(c){c.frameRate=
|
|
17
|
+
b})},bM=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},cM=function(a,b){var c=a.streams.find(function(d){d=d.S;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.S.find(function(d){return d.position===b})||null},dM=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},eM=function(a){this.a=a},fM=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},gM=function(a,
|
|
18
|
+
b){var c=new Set(a.map(function(d){return d.la}));return b.filter(function(d){return!c.has(d.la)})},iM=function(a,b){for(;a[0].la<b[0].la;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||hM(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&hM(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},nM=function(a,b,c,d,e){var f=b[0].length();f=KL(f).map(function(g){var h=fM(b,g)||[],l=dM(c,g)||[];g=dM(d,g)||[];var m=_.eh(jM(h)).concat(_.eh(l),
|
|
19
|
+
_.eh(g)).filter(Boolean);kM(m);var n=m[0];m=n.la;n=n.duration;return{configurationId:a,variants:h,textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,la:m}});e&&lM(f[0]);mM(f);return f},jM=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},lM=function(a){var b=jM(a.variants)[0].S[0].Ea;a.startTime+=b;a.endTime+=b},mM=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=
|
|
20
|
+
c.startTime+c.duration}},hM=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;oM(a.variants,b.variants);pM(_.Y.gf(a),_.Y.gf(b))},oM=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Ch(d),d]}));b.forEach(function(d){c.get(_.Y.Ch(d)).drmInfos=d.drmInfos})},pM=function(a,b){var c=new Map(a.map(function(d){return[d.oc,d]}));b.forEach(function(d){var e=c.get(d.oc);e.S=d.S;e.segmentIndex.replace(d.S);e.hc=d.hc;e.Ue=d.Ue;e.duration=d.duration;e.Hh=d.Hh;e.encrypted=d.encrypted;
|
|
21
|
+
e.drmInfos=d.drmInfos;e.keyId=d.keyId})},kM=function(a){var b=qM(a);a.forEach(function(c){_.yE(c.segmentIndex,b);c.duration=b;c.Ue=c.hc+b})},qM=function(a){var b=Infinity;_.Y.ml(a).forEach(function(c){b=Math.min(b,c.duration)});return b},rM=function(){var a=this;this.a=this.D=null;this.U=1;this.f=new ML;this.w="";this.M=new DL;this.G=0;this.j=null;this.h=new _.xl(function(){a.Yb()});this.l=_.hc;this.B=null;this.C=new _.sk;this.I=this.A=null;this.g=new _.K("clpp.hls.HlsParser");this.J=new Map;this.P=
|
|
22
|
+
new UL(this.Hf.bind(this));this.L=!1;this.H=null;this.K=!1;this.o=new Map},sM=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.oc})},tM=function(a,b){var c=new Set(b.map(function(h){return h.id}));a.o.forEach(function(h,l){c.has(l)||a.o["delete"](l)});for(var d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.o.get(e.id);if(f&&f.startTime!==e.startTime)a.D.onError(new _.O(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+
|
|
23
|
+
e.id));var g={configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,endTime:e.endTime,id:e.id,type:_.ui,eventElement:null};f&&!_.N.oi(f,g)||a.o.set(e.id,g)}return Array.from(a.o.values())},zM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z;return _.I(function(A){if(1==A.a){c=_.tq;d=uM(a,b,a.w,"");if(1===d.type){e=d.S[0].a;var G=_.nj(e)||"";f=null!=_.oj.video[G]?_.r:null!=_.oj.audio[G]?_.Zc:null;g="";f===c.VIDEO?g="avc1.42E01E":
|
|
24
|
+
f===c.AUDIO&&(g="mp4a.40.2");G=a.M;var E=a.w,C=a.a.hlsDefaultCodecs||g,H=[],M=[];M.push(new _.tj(_.ma,"0"));M.push(new _.tj(_.ac,E));C.length&&M.push(new _.tj(_.qa,C));H.push(new _.qj(G.f++,_.Ua,M));d=new wL(E,0,H)}h=_.Y.pn(d.W);return _.y(A,vM(a,h),2)}l=A.f;m=l.jm;n=l.periods;p=l.Cn;q=l.bo;if(!a.D)throw new _.O(_.P,7,7001);wM(a,n);G=!0;E=null;C=0;xM(a)||(G=!1,E=0,C=m.delay);H=a.a.timeline||{};H.type=void 0;E=new _.GE(H,E,C,!0,void 0,!!a.a.lowLatencyMode);_.JE(E,G);yM(E,n);p&&_.IE(E,p);t=E;if(!xM(a)){a.G=
|
|
25
|
+
m.qe;C=0;E=_.w(a.f.values());for(G=E.next();!G.done;G=E.next())C=Math.max(C,G.value.streams[0].hc);for(E=0;95443.7176888889<=C;)E+=95443.7176888889,C-=95443.7176888889;if(E)for(a.g.debug("Offsetting live streams by",E,"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.hc?(a.g.debug("Offset applied to",G.type),G.segmentIndex.offset(E)):a.g.debug("Offset NOT applied to",G.type)}G=_.Y.Hl(n);"LIVE"===a.l||"EVENT"===a.l?(G=Math.max(G,
|
|
26
|
+
t.K),isNaN(a.a.availabilityWindowOverride)||(G=a.a.availabilityWindowOverride),t.A=G):a.l===_.hc&&(t.f=G);v=tM(a,q);z={presentationTimeline:t,periods:n,minBufferTime:0,cues:v};a.g.debug("HLS playlist parsed",z);return A["return"](z)})},CM=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,AM(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Aj;h=a.B.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 t=
|
|
27
|
+
c.Mh(q.audio,g),v=c.Mh(q.video,g);q=BM(a,t,v,q.bandwidth);if(!q)throw new _.O(_.P,4,4047,{message:"Video and audio are encrypted in an incompatible way.",ap:v?v.Ub():void 0,audio:t?t.Ub():void 0});return q});m=a.D.configurationId;n=nM(m,l,e,f,!0);return p["return"](n)})},AM=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.tq,d=function(q){return q.stream.Fd()===c.VIDEO||q.stream.Fd()===c.AUDIO},e=b.filter(d),f=b.filter(function(q){return!d(q)}),g=function(q){q=q.map(function(t){var v=
|
|
28
|
+
t.stream.streams[0];t=Object.assign({},{playlist:t.playlist},{language:v.language,channelsCount:v.channelsCount,spatialAudio:v.spatialAudio,closedCaptions:v.closedCaptions,primary:v.primary,kind:v.kind||null,groupId:v.groupId,type:v.type,codecs:v.codecs,name:v.originalId,uri:v.oc,kf:{width:v.width,height:v.height,frameRate:v.frameRate}});return DM(a,t)});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;EM(a,h.concat(l));m=l.filter(function(q){return q.Fd()===c.sj});
|
|
29
|
+
n=l.filter(function(q){return q.Fd()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Aj:h})})},EM=function(a,b){b.forEach(function(c){a.f.a.set(c.Ub(),c)})},vM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,G,E;return _.I(function(C){switch(C.a){case 1:return c=_.Y,d=c.gn(b.kd.closedCaptions),e=FM(a,b.se),_.y(C,GM(a,b),2);case 2:return f=C.f,g=Object.values(f).flat().map(function(H){return H.playlist}),HM(a,g),h=g[0],l=c.rn(h.W),a.l=l,a.I=c.Pi(h.W),m=c.nn(h.W,l,a.a.lowLatencyMode||!1,
|
|
30
|
+
a.a.suggestedPresentationDelay),_.y(C,IM(a,f.Yg,e),3);case 3:return n=C.f,_.y(C,JM(a,f.se,n,d),4);case 4:return p=C.f,_.y(C,KM(a,f.Yn,e),5);case 5:return q=C.f,_.y(C,LM(a,f.Vf),6);case 6:return t=C.f,v=a.D.configurationId,z=nM(v,p,q,t,!xM(a)),a.D.filterAllPeriods(z),A=_.eh(f.se).concat(_.eh(f.Yg)).map(function(H){return H.playlist}),G=MM(a,A),E=NM(a,A,G),C["return"]({periods:z,Cn:G,bo:E,jm:m})}})},wM=function(a,b){xM(a)||2!==a.a.timeline.version||(a.H||(a.H=b[0].startTime),_.gG(b,-a.H))},NM=function(a,
|
|
31
|
+
b,c){b=b.find(function(d){return null!==_.Y.Wa(d.W,_.Ha)});if(!b)return[];if(null===c)throw new _.O(_.P,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.W.filter(function(d){return d.name===_.Ha}).map(function(d){return _.Y.hn(d,c,a.A,!xM(a))}).filter(Boolean)},MM=function(a,b){var c=b.flatMap(function(e){return e.S[0].W});c=_.Y.Wa(c,_.Sa);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: "+
|
|
32
|
+
(c.value+").")),null):d/1E3},GM=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([OM(a,b.kd.zj),OM(a,b.kd.Zn),OM(a,b.se),OM(a,b.Vf)]),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"]({Yg:e,Yn:f,se:g,Vf:h})})},QM=function(a,b){return Promise.all(b.map(function(c){return PM(a,c)}))},FM=function(a,b){for(var c=_.Y.Ie,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.rj(g,"AUDIO");f=_.rj(g,
|
|
33
|
+
_.gc);var l=_.rj(g,_.Rb);g=RM(a,g);if(l){var m=_.mj(_.Q,g);d.set(c(_.Q,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=SM(_.Zc,g),d.set(c(_.Zc,h),l));f&&(h=SM(_.r,g),d.set(c(_.r,f),h))}return d},KM=function(a,b,c){return Promise.all(b.map(function(d){return TM(a,d,c)}))},LM=function(a,b){return Promise.all(b.map(function(c){return UM(a,c)}))},IM=function(a,b,c){var d,e;return _.I(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[TM(a,b[0],c)];return _.y(f,d[0],2)}if(3!=f.a)return d=
|
|
34
|
+
d.concat(b.slice(1).map(function(g){return TM(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.co(e))})},JM=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v;return _.I(function(z){if(1==z.a){e=new Set;f=_.eh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.sj(f[l].tag,_.ma)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.y(z,VM(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(A){return VM(a,A,c,d,e)}),_.y(z,Promise.all(q),3);t=z.f;t.splice(g,0,p);v=t.reduce(_.ZD,[]);return z["return"](v)})},
|
|
35
|
+
VM=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(_.sj(h,_.ma)),m=f.tn(h),_.y(p,WM(a,b,m,c,d),2)):(n=p.f)?p["return"](XM(a,n,l,e)):p["return"]([])})},WM=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,A,G,E,C,H,M,R,V;return _.I(function(S){if(1==S.a)return f=_.tq,g=_.Y.Ie,h=b,l=h.tag,m=h.playlist,n=RM(a,l),p=_.rj(l,"AUDIO"),q=_.rj(l,_.gc),t=p?d.get(g(f.AUDIO,p))||[]:[],v=q?d.get(g(f.VIDEO,q))||[]:[],z=_.eh(t).concat(_.eh(v)),A={audio:t,video:v},
|
|
36
|
+
a.g.debug("Guessing stream type for",l.toString()),E=!1,C=m.a,H=A.audio.find(function(Ba){return Ba.Ub()===C}),M=_.mj(f.VIDEO,n),R=c||M,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(nL),G=f.AUDIO,E=!0):A.video.length?(a.g.debug(nL),G=f.AUDIO):(a.g.debug("Guessing video-only"),G=f.VIDEO):(G=f.AUDIO,a.g.debug(nL)),V=null,E?S.F(2):_.y(S,YM(a,b,n,G,e,c),3);2!=S.a&&(V=S.f);if(null==V)return S["return"](null);
|
|
37
|
+
A[G]=[V];G===f.AUDIO&&c&&z.forEach(function(Ba){ZL(Ba,c.width);$L(Ba,c.height);aM(Ba,c.frameRate)});_.Y.il(A);return S["return"](A)})},XM=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.el(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):(m=BM(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):
|
|
38
|
+
(b.push(m),d.add(l)))}}return b},BM=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.Al(h,l);if(!m)return null;var n=d;h={id:a.U++,language:h?h.language:_.ug,primary:!!h&&h.primary||!!l&&l.primary,audio:h,video:l,bandwidth:n,drmInfos:m,allowedByApplication:!0,allowedByKeySystem:!0};e.push(h)}return new eM(e)},TM=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"](ZM(a,g,
|
|
39
|
+
function(){var l,m,n,p,q,t,v,z,A,G,E,C,H,M,R;return _.I(function(V){if(1==V.a){l=_.tq;m=_.Y.Ie;n=_.sj(e,_.ab);p=_.Y.Ah(_.sj(e,_.Zb));q=_.Y.al(e);t=c.get(m(p,n))||"";v=_.rj(e,_.nb);z=_.rj(e,"NAME");A=e.getAttribute("DEFAULT");G=e.getAttribute("AUTOSELECT");E=_.rj(e,"CHANNELS");C=p===l.AUDIO?E?parseInt(E.split("/")[0],10):null:null;var S=p===l.AUDIO?(S=_.rj(e,"CHANNELS"))?S.includes("/JOC"):!1:!1;H=S;M=!!A&&!!G;return _.y(V,DM(a,{playlist:f,codecs:t,type:p,fe:v,primary:M,name:z,channelsCount:C,spatialAudio:H,
|
|
40
|
+
groupId:n,kind:q,closedCaptions:null,kf:null}),2)}R=V.f;return V["return"](R)})}))})},UM=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"](ZM(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.rj(d,_.qa)||"jpg",l=_.rj(d,_.nb),m=_.rj(d,"NAME"),_.y(q,DM(a,{playlist:e,codecs:h,type:_.ye,fe:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,groupId:null,kf:null}),2);n=q.f;(p=_.rj(d,_.ma))&&bM(n,Number(p));
|
|
41
|
+
return q["return"](n)})}))})},RM=function(a,b){var c=_.rj(b,_.qa,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=_.kE(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},YM=function(a,b,c,d,e,f){var g,h,l,m,n;return _.I(function(p){g=b;h=g.tag;l=g.playlist;m=_.tq;n=l.a;return p["return"](ZM(a,n,function(){var q,t,v,z;return _.I(function(A){if(1==A.a)return q=_.rj(h,_.pa),t=null,
|
|
42
|
+
d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q)),v=SM(d,c),_.y(A,DM(a,{playlist:l,codecs:v,type:d,closedCaptions:t,primary:!1,kind:null,fe:null,name:null,channelsCount:null,spatialAudio:!1,groupId:null,kf:f}),2);z=A.f;return A["return"](z)})}))})},ZM=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;c=c();a.f.set(b,c);return c},DM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,G,E,C,H,M,R;return _.I(function(V){if(1==V.a){c=$M;d=aN;e=_.tq;f=b;
|
|
43
|
+
g=f.playlist;h=f.codecs;l=f.type;m=f.fe;n=f.groupId;p=f.primary;q=f.kind;t=f.name;v=f.channelsCount;z=f.spatialAudio;A=f.closedCaptions;G=f.kf;E=_.Y.Th(m);if(1!==g.type)throw new _.O(_.P,4,4017);return _.y(V,bN(a,g,l,h),2)}C=V.f;H=a.a.lowLatencyMode?d.mj:d.oj;M=q;l!==e.TEXT||q||(M=_.lg);R=C.map(function(S){var Ba=S.S,Ca=S.kl,jb=S.mimeType;S=S.la;var Wa=Ba[0].startTime,Ma=Ba[Ba.length-1].endTime,wb=Ma-Wa,Jb=new _.bF(Ba),Cg=Ba[0].initSegment||null;return{id:_.kL++,originalId:t,createSegmentIndex:Promise.resolve.bind(Promise),
|
|
44
|
+
findSegmentPosition:Jb.Wc.bind(Jb),getSegmentReference:Jb.get.bind(Jb),adjustSegmentDurations:Jb.wd.bind(Jb),getDuration:Jb.getDuration.bind(Jb),segmentIndex:Jb,segmentLookupStrategy:H,initSegmentReference:Cg,mimeType:jb,codecs:h,kind:M,Hh:Ca.type,encrypted:Ca.type===c.rj,aesEncrypted:!!Ca.keyInfo,keyId:Ca.keyId,language:E,originalLanguage:m||_.ug,label:t,type:l,primary:p,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:G?G.frameRate:void 0,width:G?G.width:void 0,height:G?G.height:void 0,bandwidth:void 0,
|
|
45
|
+
roles:[],channelsCount:v,spatialAudio:z,closedCaptions:A,S:Ba,drmInfos:Ca.drmInfos,la:S,oc:g.a,yf:g.f,hc:Wa,Ue:Ma,duration:wb,groupId:n}});return V["return"](new XL(R))})},OM=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,cN(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))})},cN=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==
|
|
46
|
+
m.a){c=_.Y.em(b);d=_.rj(b,_.ac,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.Jd(a.w,d);return _.y(m,dN(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](uM(a,h,l,d))})},PM=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.Xi(b.streams[0].yf);if(a.a.lowLatencyMode&&a.I&&a.I.dh){var q=b.streams[b.streams.length-1].segmentIndex;if(q=q.a[q.a.length-1]){var t=q.a,v=t.length-1;q={mm:q.position,un:t&&0<t.length?v:null}}else q=null;if(t=q)q=t.mm,t=t.un,
|
|
47
|
+
v=_.Tk(p.a.toString()),v._HLS_msn=q.toString(),null===t&&v._HLS_part&&delete v._HLS_part,null!==t&&(v._HLS_part=t.toString()),q=_.Sk(v,!0),_.aj(p,new _.ej(q))}c=p.toString();return _.y(n,dN(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.Ub();h=b.streams[0].yf;l=e.uri;h!==l&&(h=l,YL(b,h));m=uM(a,f,h,g);return n["return"]({stream:b,playlist:m})})},uM=function(a,b,c,d){a=GL(a.M,b,c);a.a=d;return a},eN=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.O(_.P,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");
|
|
48
|
+
},fN=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.rj(c,_.ac)})||null}).map(function(b){return _.nj(b)});if(1<(new Set(a)).size)throw new _.O(_.P,4,4044,"Unexpected change in file format.");},gN=function(a,b,c){a=_.Y.Qb(a.W,_.Na);if(1<a.length)throw new _.O(_.P,4,4020);a=a[0];if(!a)return null;var d=_.sj(a,_.ac),e=_.Y.Jd(b,d);b=_.Y.Ni(a,null,!0);return new _.cE(function(){return[e]},b.za,b.ma,c)},iN=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(hN(b.f));for(var m=b.next();!m.done;l=
|
|
49
|
+
{mf:l.mf},m=b.next()){var n=m.value;m=n.ci;n=n.item;var p=0===m,q=p?a:h[h.length-1],t=p?d:q.endTime,v=Number(_.rj(n,_.Ea));v=t+v;p=_.Y.Ni(n,p?null:q.ma,p);q=_.rj(n,_.ac);q=_.Y.Jd(g,q);l.mf=q?[q]:[];t=new _.vj(c,t,v,function(z){return function(){return z.mf}}(l),p.za,p.ma,e,f,!1,null,null,null,null);if("YES"===_.rj(n,"INDEPENDENT")||0===m)t.h=!0;h.push(t)}return h},jN=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.W,q=c.a;0<_.Y.Qb(p,_.Na).length&&(n=gN(c,l,g));var t=null!=q,v=q?[q]:[];if(!t&&!a.a.lowLatencyMode)return null;
|
|
50
|
+
a=0;q={za:0,ma:null};var z=null;t?(c=_.Y.ln(p).duration,a=e+c,q=_.Y.Oi(p,b?b.ma:null)):(b=iN(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.ye?_.Y.sn(p):null;d=new _.vj(d,e,a,function(){return v},q.za,q.ma,f,g,!1,null,h?h.Yd:null,h?h.re:null,h?h.durationPerTile:null,z,n);d.la=m;return d},bN=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v,z,A,G;return _.I(function(E){switch(E.a){case 1:return e=_.Y,f=kN,g=lN,h=b.a,l=b.S,m=e.El(b.W,_.Oa),n=[],!xM(a)&&g.yj(l),_.y(E,mN(a,b.f,h,l,m,c,d),2);case 2:p=E.f,
|
|
51
|
+
q=m,t=f.Wn(l),v=0;case 3:if(!(v<t.length)){E.F(5);break}z=t[v];A=n[n.length-1]||null;return _.y(E,nN(a,b.f,z,q,p,c,d,A,t.length),6);case 6:G=E.f;n.push(G);q+=z.length;v++;E.F(3);break;case 5:return eN(n),E["return"](n)}})},mN=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,t,v,z,A,G,E;return _.I(function(C){if(1==C.a){h=d[0];if(null!=a.A)return C["return"](a.A);if(!xM(a)&&a.B)try{var H=a.f.get(c),M=H?cM(H,e)||null:null;if(!M)throw new _.O(_.P,4,4030,"Segment not found in pervious playlist update.");l=M.startTime+
|
|
52
|
+
M.Ea;a.g.debug(qL+l+".");a.A=l;return C["return"](l)}catch(R){if(m=a.f.get(c))n=m.streams[0].S[0].position,C=m.streams[m.streams.length-1].S,p=C[C.length-1].position,q=e,t=e+d.length-1,a.g.warn("Last #EXT-X-MEDIA-SEQUENCE values "+n+" - "+p+(", new values "+q+" - "+t+"."),b,m);throw new _.O(_.P,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.y(C,oN(a,f,g,h),2)}if(3!=C.a)return v=C.f,z=lN.qn(h,a.w,v),A=gN(h,b,z.keyInfo),G=_.Y.Sf(z.keyInfo,
|
|
53
|
+
e),_.y(C,pN(a,A,h,G,v,g),3);E=C.f;a.g.debug(qL+E+".");a.A=E;return C["return"](E)})},nN=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,t,v,z,A,G,E,C,H,M,R,V,S,Ba,Ca,jb,Wa,Ma;return _.I(function(wb){switch(wb.a){case 1:return m=_.Y,n=lN,p=c[0],q=null==h,fN(c),_.y(wb,oN(a,f,g,p),2);case 2:t=wb.f;v=n.kn(c,a.w,t,h?h.im:null,1===l);z=v[v.length-1];A=lN.qa(v);G=gN(p,b,A.keyInfo)||(h?h.Xl:null);E=_.Y.Sf(A.keyInfo,d);C=p.la;if(q){H=e;wb.F(3);break}return _.y(wb,qN(a,C,G,p,d,E,t,g),4);case 4:H=wb.f;case 3:M=H;R=
|
|
54
|
+
[];for(V=0;V<c.length;V++)if(S=c[V],Ba=R[R.length-1]||null,Ca=0===V?0:Ba.endTime,jb=d+V,Wa=m.Sf(A.keyInfo,jb),Ma=jN(a,Ba,S,jb,Ca,M,Wa,f,b,C,G))G=Ma.initSegment,R.push(Ma);return wb["return"]({S:R,kl:A,im:z,mimeType:t,endTime:R[R.length-1].endTime,la:C,Xl:G})}})},HM=function(a,b){b.forEach(function(c){var d=a.f.get(c.a);kN.Ej(c,d,!xM(a))});kN.fl(b)},qN=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.J.has(b)?m["return"](a.J.get(b)):_.y(m,pN(a,c,d,f,g,h),2);l=m.f;a.g.debug("Segment #"+
|
|
55
|
+
e+" has raw media timestamp "+(l+" s."));a.J.set(b,l);return m["return"](l)})},pN=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.cl(c,d);return h["return"](WL(a.P,b,g,e,f,null!=d))})},SM=function(a,b){if(1===b.length)return b[0];var c=_.mj(a,b);if(null!=c)return c;throw new _.O(_.P,4,4025,{codecList:b});},oN=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Wa(d.W,_.Na))?_.sj(f,_.ac):null;return h["return"](rN(a,b,c,e,g))})},rN=function(a,
|
|
56
|
+
b,c,d,e){var f,g,h,l,m;return _.I(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.pj(f,b,c))return n["return"](g);h=_.ek([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.Hf(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.O(_.P,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.split(";")[0])})},dN=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.ek([b],a.a.attemptParameters),c.type=1,_.y(f,a.Hf(c),2);d=f.f;e="";try{e=_.T.$(d.data)}catch(g){throw new _.O(_.P,
|
|
57
|
+
4,4042);}e=_.T.xi(e);e=e.trim();return f["return"]({text:e,response:d})})},xM=function(a){return a.l===_.hc},yM=function(a,b){_.Y.fm(b,function(c,d){_.NE(a,c.S,d.startTime)});_.FE(a.a,b[0].startTime,b[b.length-1].endTime)},sN=function(){},aN={mj:_.yD,oj:_.xD},$M={rj:tL,zo:uL,NONE:_.We},hN=function tN(a){var c,d,e,f,g,h;return _.Ah(tN,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.w(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.F(0):_.y(l,{ci:c,An:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,
|
|
58
|
+
{ci:c,item:e,An:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.u=ML.prototype;_.u.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)})};_.u.has=function(a){return this.a.has(a)};_.u.get=function(a){return this.a.get(a)||null};_.u.values=function(){return Array.from(this.a.values())};_.u.clear=function(){this.f.clear();this.a.clear()};
|
|
59
|
+
var kN={fl:function(a){var b=kN.tl(a),c=kN.hm(a);a.forEach(function(d){var e=d.S,f=e.findIndex(function(h){return h.la===b}),g=e.findIndex(function(h){return h.la===c+1});-1===g&&(g=e.length);d.S=e.slice(f,g)})},Ej:function(a,b,c){b=kN.Dl(a,b,c);a=_.w(a.S||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.fd(c.W,_.Ia)&&b++,c.la=b},Dl:function(a,b,c){var d=_.Y.Wa(a.W,_.Ja);if(d)return Number(d.value);d=kN.Zl(b);if(c&&d)try{return kN.Wl(a,b)}catch(e){throw new _.O(_.P,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
|
|
60
|
+
}return 0},Zl:function(a){return 0<kN.Gl(a)},Wn: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.fd(d.W,_.Ia)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Gl:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].S;return a[a.length-1].la},Wl:function(a,b){var c=_.Y.Wa(a.W,_.Oa);if(!c)throw kN.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(mL);c=Number(c.value);var d=
|
|
61
|
+
cM(b,c);if(!d)throw kN.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(mL);return d.la},hm:function(a){a=a.map(function(b){return b.S[b.S.length-1].la});return Math.min.apply(Math,_.eh(a))},tl:function(a){a=a.map(function(b){return b.S[0].la});return Math.max.apply(Math,_.eh(a))}};kN.g=new _.K("clpp.hls.DiscontinuityUtils");var uN={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Ig)throw new _.O(_.P,4,4041);if(_.sj(a,oL)===pL)throw new _.O(_.P,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.bE(_.Jd,[{initDataType:_.bg,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":TL,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":TL,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.sj(a,oL);if(!RL.includes(b))return SL.error("Widevine in HLS is only supported with [",
|
|
62
|
+
RL.join(", "),"], not",b),null;b=_.sj(a,_.ac);b=_.cv(b);b=_.Fj(b.data);b=_.bE(_.Od,[{initDataType:_.qd,initData:b}],"");if(a=_.rj(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},RL=["SAMPLE-AES",pL],SL=new _.K("clpp.hls.DrmParser");var lN={qn:function(a,b,c){return lN.ng(a.W,b,c)||{type:_.We,keyInfo:null,drmInfos:[],keyId:null}},kn:function(a,b,c,d,e){if(a.slice(1).some(lN.ai))throw new _.O(_.P,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.fd(a[0].W,_.La)||null===d){if((d=lN.ng(a[0].W,
|
|
63
|
+
b,c))&&d.type===uL){if(1<lN.Bh(a))throw new _.O(_.P,4,4046,rL+((e?"playlist":"discontinuity")+"."));return[d]}a=lN.Li(a,b,c);return 0===a.length?[{type:_.We,keyInfo:null,drmInfos:[],keyId:null}]:a}b=lN.Li(a,b,c);if(d.type===_.We||d.type===tL)return[d].concat(_.eh(b));if(0<lN.Bh(a))throw new _.O(_.P,4,4046,rL+((e?"playlist":"discontinuity")+"."));return[d]},qa:function(a){if(0===a.length)return{type:_.We,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===uL})||a.every(function(c){return c.type===
|
|
64
|
+
_.We}))return a[0];a=a.filter(function(c){return c.type===tL});var b=_.Di(a.flatMap(function(c){return c.drmInfos}));return{keyInfo:null,keyId:a[a.length-1].keyId,type:tL,drmInfos:b}},yj:function(a){a=lN.Lh(a);if(a.some(function(b){return lN.ai(b)})&&1<a.length)throw new _.O(_.P,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},ai:function(a){return _.Y.Qb(a.W,_.La).some(function(b){return"AES-128"===_.rj(b,oL)})},Li:function(a,b,c){return lN.Lh(a).map(function(d){return lN.ng(d.W,
|
|
65
|
+
b,c)})},Bh:function(a){return a.filter(function(b){return _.Y.fd(b.W,_.La)}).length},Lh:function(a){return a.filter(function(b){return _.Y.fd(b.W,_.La)})},ng:function(a,b,c){a=_.Y.Qb(a,_.La);if(0===a.length)return null;var d=_.sj(a[0],oL);if(1===a.length){if("NONE"===d)return{type:_.We,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.rj(a,"IV",""),{type:uL,keyInfo:{method:"AES-128",url:_.Y.Jd(b,_.sj(a,_.ac)),iv:d?_.Sj((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return _.sj(e,
|
|
66
|
+
oL)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===pL}))throw lN.g.warn("EXT-X-KEY methods "+b.join(", ")+" are incompatible."),new _.O(_.P,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.rj(e,"KEYFORMAT","identity"),g=uN[f]||null;(e=g?g(e,c):null)||lN.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.O(_.P,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:tL,drmInfos:b}},To:function(){return{type:_.We,keyInfo:null,drmInfos:[],keyId:null}}};lN.g=new _.K("clpp.hls.EncryptionUtils");_.u=XL.prototype;_.u.length=function(){return this.streams.length};_.u.Fl=function(){return this.streams[0].groupId};_.u.Fd=function(){return this.streams[0].type};_.u.zl=function(){return this.streams[0].codecs.split(",")};_.u.Ub=function(){return this.streams[0].oc};_.u.Pn=function(a){this.streams.forEach(function(b){b.codecs=a.join(",")})};eM.prototype.length=function(){return this.a.length};_.u=rM.prototype;_.u.configure=function(a){this.a=a;this.P.a=a};_.u.setCurrentVariant=function(a){this.j=a};_.u.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.L)throw Error("start() may be called only once!");c.L=!0;c.D=b;return _.y(l,dN(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.w=e.uri,_.y(l,zM(c,f),3);g=l.f;c.B=g;h=c.G;c.h&&0<h&&c.h.ca(h);return l["return"](g)})};_.u.requestStop=function(){this.K=!0};
|
|
68
68
|
_.u.stop=function(){this.h&&(this.h.stop(),this.h=null);var a=[];this.C&&(a.push(this.C.destroy()),this.C=null);this.f.clear();this.B=this.a=this.D=this.j=null;this.o.clear();return Promise.all(a)};
|
|
69
|
-
_.u.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:b=a.B;if(
|
|
70
|
-
g);m=
|
|
71
|
-
_.u.
|
|
69
|
+
_.u.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.I(function(p){switch(p.a){case 1:b=a.B;if(xM(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=sM(a),d=d.filter(function(q){return e.includes(q.Ub())}));return _.y(p,QM(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),HM(a,g),_.y(p,CM(a,f),3);case 3:h=p.f;gM(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});wM(a,h);l=MM(a,
|
|
70
|
+
g);m=NM(a,g,l);b.cues=tM(a,m);iM(b.periods,h);yM(c,h);if(n=_.Y.Ul(g))!0!==a.a.keepTimelineLive&&(a.l=_.hc,_.JE(c,!0),c.f=h[h.length-1].endTime),a.h.stop(),a.h=null;if(a.D.onUpdate)a.D.onUpdate(b);if(n&&a.D.onTurnedStatic)a.D.onTurnedStatic();if(!a.K){p.F(4);break}return _.y(p,a.stop(),4);case 4:return p["return"](b)}})};
|
|
71
|
+
_.u.Yb=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.nD);if(!a.D)return d["return"]();_.D(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.h&&0<a.G&&a.h.ca(a.G),_.sh(d,0);b=_.F(d);if(!(b instanceof _.O))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.h&&a.h.ca(.1));_.B(d)})};_.u.Hf=function(a){if(!this.C)throw new _.O(_.P,7,7001);a=this.D.networkingEngine.fetch(a);_.tk(this.C,a);return a.T};_.x(sN,_.Kt);sN.prototype.f=function(){_.Ju.m3u8=rM;_.Hu[_.gm]=rM;_.Hu[sL]=rM};sN.prototype.a=function(){_.FF("m3u8");_.GF(_.gm);_.GF(sL)};sN.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",sN);};
|
|
72
72
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
73
73
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
74
74
|
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 bV=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.N.R(a)){a:{var b=a.info;if(_.N.da(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=_.N.da(a)?a:null}},dV=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.Wh;this.h=(a=_.uv(_.Wc))?new a(this.m.getConfiguration()):null;this.g=new _.K("clpp.hlssmpte.ImageCueHandler");this.f=null;cV(this)},cV=function(a){a.a.one(a.m,_.Ie,function(){return eV(a)})},
|
|
3
|
+
eV=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Kc,function(d){return fV(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Qe}).forEach(function(d){fV(a,{track:d})});!gV(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."),hV(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
|
+
gV=function(a){return a.some(function(b){return b.kind===_.Qe})},hV=function(a,b){var c=a.m.getTrackManager(),d=c.oa(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Fa(d)};a.a.on(b.textTracks,_.Kc,function(g){g.track.kind===_.Qe&&(a.a.off(b.textTracks,_.Kc,f),f())});c.Fa(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},fV=function(a,b){var c=b.track;c.kind===_.Qe&&(a.g.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.we,a.a.on(c,_.Td,function(d){return iV(a,d)}))},iV=function(a,b){var c=jV(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 bV(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.T.$a(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)}}})},jV=function(a){return(a=
|
|
6
|
+
a.m.getTrackManager().ya())&&a.language&&a.language.toLowerCase()},kV=function(){this.a=null;this.f=!1},lV=function(){};dV.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.x(kV,_.Gv);kV.prototype.onPlayerCreated=function(){};kV.prototype.onContentWillLoad=function(a){if(this.f=_.Fl()){var b=a.getConfiguration();b=_.N.cb(b.hlssmpte||{});_.N.gi(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.N.ua(b.timestampOffset)||(b.timestampOffset=0);this.a=new dV(a,b.patchMetadataTrack,b.timestampOffset)}};kV.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)})};kV.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.J("clpp.hlssmpte.HlsSmptePlugin",kV);kV.Id="hlssmpte";lV.prototype.create=function(){return new kV};_.gt(new lV);};
|
|
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));}
|