@castlabs/prestoplay 6.23.1 → 6.25.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 +35 -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 +116 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +607 -591
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -86
- package/cjs/cl.externs.js +105 -54
- package/cjs/cl.freewheel.js +25 -24
- package/cjs/cl.hls.js +77 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +352 -342
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +15 -14
- 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 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +491 -478
- package/cl.crypto.js +9 -9
- package/cl.dash.js +82 -80
- package/cl.externs.js +105 -54
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +79 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +18 -17
- package/cl.mse.js +310 -306
- 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 +60 -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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -28
- package/package.json +1 -1
- package/typings.d.ts +54 -25
package/cjs/cl.freewheel.js
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
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
|
-
_.
|
|
7
|
-
_.J("clpp.freewheel.FreeWheelPlugin",
|
|
8
|
-
_.
|
|
9
|
-
_.
|
|
10
|
-
_.
|
|
11
|
-
_.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
_.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_.
|
|
23
|
-
|
|
24
|
-
_.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var rW="clpp-freewheel",sW="clpp.freewheel.AdsManagerFactory",tW="freewheel",uW=function(){this.f=this.a=null},vW=function(){},wW=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""}},xW=function(a,b,c){this.h=a;this.f=b;this.a=c},yW=function(a){this.a=a},zW=function(a){this.g=new _.K("clpp.freewheel.AdsManager");this.m=a;this.h=new _.wi;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.xk;this.j=null},AW=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ug&&b.push("serverUrl");typeof a.profileId!==_.ug&&b.push("profileId");typeof a.videoAssetId!==_.ug&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.O(1,9,12001,{missingKeys:b.join(", ")});},BW=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.bv,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)})},EW=function(a){return _.I(function(b){if(a.B.length)return CW(a),a.f=a.B.shift(),a.f.play(),b.F(0);DW(a);return _.y(b,a.m.a.play(),0)})},FW=function(a){a.A.length?(CW(a),a.f=a.A.shift(),a.f.play()):DW(a)},CW=function(a){var b=a.m.ge(tW).ud();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(rW),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},DW=function(a){var b=a.m.ge(tW).ud();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},GW=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 xW(a.a,c,d)});a.m.trigger(new _.L(b,d))},HW=function(){this.Ca=new _.K(sW)};_.x(uW,_.gw);_.u=uW.prototype;
|
|
6
|
+
_.u.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.tr(_.fe,{id:rW}),this.f=_.tr(_.r,{"class":_.Cd}),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 tW};_.u.ud=function(){return this.a};_.u.Wl=function(){return this.f};
|
|
7
|
+
_.J("clpp.freewheel.FreeWheelPlugin",uW);uW.prototype.getAdVideo=uW.prototype.Wl;uW.prototype.getAdContainer=uW.prototype.ud;uW.Id=tW;uW.AD_CONTAINER_ID=rW;vW.prototype.create=function(){return new uW};_.cu(new vW);_.u=xW.prototype;_.u.yb=function(){return"FreeWheel AdManager SDK"};_.u.zb=function(){return tv.freewheel.SDK.version};_.u.Db=function(){return 0};_.u.getId=function(){return this.a?this.a.getAdId():""};_.u.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ug?a:""};_.u.cc=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.gc=function(){return!1};_.u.Ab=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.qb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.u.pb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.u.Xa=function(){return 0};_.u.Ya=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.Ya()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.u.Pb=function(){switch(this.Ya()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.u.Cb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.u.rb=function(){return this.f.getAdCount()};_.u.getWrapperAdIds=function(){return[]};_.u.canSeek=function(){return!1};
|
|
11
|
+
_.u.getWrapperAdSystems=function(){return[]};_.u.getWrapperCreativeIds=function(){return[]};_.u.fc=function(){return null};xW.prototype.getVideoElement=xW.prototype.fc;xW.prototype.getWrapperCreativeIds=xW.prototype.getWrapperCreativeIds;xW.prototype.getWrapperAdSystems=xW.prototype.getWrapperAdSystems;xW.prototype.canSeek=xW.prototype.canSeek;xW.prototype.getWrapperAdIds=xW.prototype.getWrapperAdIds;xW.prototype.getSequenceLength=xW.prototype.rb;xW.prototype.getPositionInSequence=xW.prototype.Cb;
|
|
12
|
+
xW.prototype.getPodTimeOffset=xW.prototype.Pb;xW.prototype.getPodIndex=xW.prototype.getPodIndex;xW.prototype.getPodType=xW.prototype.Ya;xW.prototype.getMediaBitrate=xW.prototype.Xa;xW.prototype.getMediaHeight=xW.prototype.pb;xW.prototype.getMediaWidth=xW.prototype.qb;xW.prototype.getMediaUrl=xW.prototype.getMediaUrl;xW.prototype.getClickThroughUrl=xW.prototype.Ab;xW.prototype.isBumper=xW.prototype.gc;xW.prototype.getSkipTimeOffset=xW.prototype.getSkipTimeOffset;xW.prototype.getPosition=xW.prototype.getPosition;
|
|
13
|
+
xW.prototype.getDuration=xW.prototype.getDuration;xW.prototype.getTitle=xW.prototype.getTitle;xW.prototype.getAdvertiserName=xW.prototype.getAdvertiserName;xW.prototype.getAdSystem=xW.prototype.getAdSystem;xW.prototype.getApiFramework=xW.prototype.getApiFramework;xW.prototype.getSourceId=xW.prototype.cc;xW.prototype.getCreativeId=xW.prototype.getCreativeId;xW.prototype.getId=xW.prototype.getId;xW.prototype.getTechnology=xW.prototype.Db;xW.prototype.getAdManagerVersion=xW.prototype.zb;
|
|
14
|
+
xW.prototype.getAdManagerName=xW.prototype.yb;yW.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()}})};yW.prototype.Sb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};yW.prototype.Rb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
15
|
+
yW.prototype.hasPostroll=yW.prototype.Rb;yW.prototype.hasPreroll=yW.prototype.Sb;yW.prototype.getCuePoints=yW.prototype.getCuePoints;_.u=zW.prototype;
|
|
16
|
+
_.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{AW(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!==_.ug&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.y(m,BW(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
|
|
17
|
+
_.w(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,wW(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.gf&&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=
|
|
18
|
+
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.Cn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.Gn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.Fn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Wm.bind(a));a.h.on(a.m,_.Hg,a.Jk.bind(a));a.h.on(a.m,_.rg,a.Ik.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.u.start=function(){var a=this;return _.I(function(b){return _.y(b,EW(a),0)})};_.u.kd=function(){};
|
|
19
|
+
_.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.gd=function(){return!0};_.u.Ec=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);DW(a);a.a&&(a.a.dispose(),a.a=null);_.C(b)})};
|
|
20
|
+
_.u.Cn=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(_.Rc,{adsTimeline:new yW(this.a)})),this.j=new _.Zu(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.ge(tW).f);else this.m.onError(new _.O(1,9,10003,{errorType:0},
|
|
21
|
+
void 0));this.l.resolve()};_.u.Gn=function(a){GW(this,_.xc,a);this.j.start()};_.u.Fn=function(a){this.f=null;a=a.slot;GW(this,_.yc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:EW(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:DW(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:FW(this)}};
|
|
22
|
+
_.u.Wm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:GW(this,_.Nc,a);GW(this,_.Gc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:GW(this,_.Oc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:GW(this,_.Cc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:GW(this,_.Ic,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:GW(this,_.Pc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:GW(this,_.Bc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:GW(this,
|
|
23
|
+
_.Ac,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:GW(this,_.Jc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:GW(this,_.Lc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:GW(this,_.Mc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:GW(this,_.zc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:GW(this,_.Kc,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],
|
|
24
|
+
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.u.Jk=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();CW(this);this.f.play()}}};
|
|
25
|
+
_.u.Ik=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Vq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Uq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Oq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);FW(this);break;case _.Hq:case _.Sq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};zW.prototype.getPosition=zW.prototype.getPosition;zW.prototype.setVolume=zW.prototype.setVolume;
|
|
26
|
+
zW.prototype.getVolume=zW.prototype.getVolume;zW.prototype.skip=zW.prototype.skip;zW.prototype.pause=zW.prototype.pause;zW.prototype.resume=zW.prototype.resume;HW.prototype.name=function(){return sW};HW.prototype.a=function(a,b){return a.namespace()!==_.Hd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Ca.warn("FreeWheel SDK is not loaded."),!1):!1};HW.prototype.create=function(a){return new zW(a)};_.nr(new HW);};
|
|
26
27
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
28
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
29
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hls.js
CHANGED
|
@@ -1,75 +1,81 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
d[0].a)throw new _.
|
|
4
|
-
"VALUE"),c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.
|
|
5
|
-
|
|
6
|
-
e=b.S;d=d.concat(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
|
-
v.f,v["return"](
|
|
16
|
-
e.uris[0]);_.
|
|
17
|
-
|
|
18
|
-
b){var c=new Set(a.map(function(d){return d.
|
|
19
|
-
_.
|
|
20
|
-
c.startTime+c.duration}},
|
|
21
|
-
|
|
22
|
-
new
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
b.flatMap(function(e){return e.S[0]
|
|
33
|
-
|
|
34
|
-
c)}))},
|
|
35
|
-
return _.y(z,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
q.a)return h=_.
|
|
42
|
-
d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
e),2)
|
|
48
|
-
q=_.
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
a.
|
|
57
|
-
c,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
_.
|
|
71
|
-
|
|
72
|
-
_.
|
|
2
|
+
var f=function(window){var gM="Could not parse MP4 segment start time.",hM="Failed to infer discontinuity number",iM="Guessing audio-only",jM="METHOD",kM="SAMPLE-AES-CTR",lM="Setting playlist start time to ",mM="application/vnd.apple.mpegurl",nM="sample",oM=function(a){if(1>a.a)throw _.vn();--a.a},pM=function(a){a=_.Hj(a)||"";return null!=_.Ij.video[a]?_.r:null!=_.Ij.audio[a]?_.dd:null},qM=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.a=a;this.verbatimUri="";this.type=b;this.$=c;this.S=1===b?d:null},rM=function(a,b,c){c=void 0===c?[]:c;this.$=b;this.a=a;this.f=c;this.oa=-1},sM=function(a){a=_.w(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value,b.startsWith("#EXT-")&&(b=_.Xj(0,b),_.tw.has(b.name)))return 1;return 0},tM=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.S(e,_.xb),g=_.S(e,"QUERYPARAM");if(f)g=_.Lj(e,
|
|
4
|
+
"VALUE"),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},uM=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})},vM=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=
|
|
5
|
+
uM(d.value,b)})})},wM=function(a,b,c){vM(a,c);b.forEach(function(d){d.a&&(d.a=uM(d.a,c));vM(d.$,c);vM(d.f,c)})},xM=function(){this.h=0;this.a=new Map},AM=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.Bi(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.O(_.P,4,4015);return 0===sM(b)?yM(a,b,c):zM(a,b,c)},zM=function(a,b,c){for(var d=[],e=1;e<b.length;){var f=BM(a,b[e]);if(_.uw.has(f.name))break;d.push(f);e++}b=CM(a,c,b.slice(e));
|
|
6
|
+
e=b.S;d=d.concat(b.$);a=DM(a,d,c);wM(d,e,a);return new qM(c,1,d,b.S)},yM=function(a,b,c){for(var d=[],e=1;e<b.length;e++){var f=BM(a,b[e]);d.push(f);if(f.name===_.ab){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 _.Mj(_.cc,g));e++}}b=_.Y.ac(d,_.Oa);_.Y.zj(b);b=tM(b,c);a.a=b;wM(d,[],a.a);return new qM(c,0,d)},EM=function(a,b,c){var d=[],e=[];e.push(new _.Mj(_.pa,"0"));e.push(new _.Mj(_.cc,b));c.length&&e.push(new _.Mj(_.ua,c));d.push(new _.Kj(a.h++,
|
|
7
|
+
_.ab,e));return new qM(b,0,d)},CM=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=BM(a,h),_.tw.has(h.name)||_.xw.has(h.name)||_.ww.has(h.name)?d.push(h):_.vw.has(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===_.Ya&&"PART"===_.S(h,_.ac)&&g.push(h):f.push(h)):_.Y.Bi(h)||(h=_.Y.od(b,h.trim(),!1),e.push(new rM(h,f,g)),f=[],g=[])});0<g.length&&e.push(new rM(null,f,g));return{S:e,$:d}},BM=function(a,b){return _.Xj(a.h++,b)},DM=function(a,b,c){b=_.Y.ac(b,_.Oa);_.Y.zj(b);
|
|
8
|
+
var d=tM(b,c);b.map(function(e){return _.S(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 '"+e+"' as it is not defined in the master playlist");d.set(e,f)});return d},FM=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},GM=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]&&
|
|
9
|
+
128>a[b+9]?!0:!1},HM=function(){this.a=new Map;this.f=new Map},IM=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]<<21|l[1]<<14|l[2]<<7|l[3]}function d(){throw new _.O(_.P,4,4030);}GM(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"===
|
|
10
|
+
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}}GM(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},JM=function(a){for(;a.getPosition()<a.Wa()-1;){var b=a.getPosition();if(71===_.wn(a))return oM(a),b}return-1},KM=function(a){function b(){d.seek(e+188);f=_.wn(d);71!==f&&(d.seek(e+192),f=_.wn(d));71!==f&&(d.seek(e+204),f=_.wn(d));71!==f&&c();oM(d)}function c(){throw new _.O(_.P,4,4030);}var d=new _.tn(new DataView(a),
|
|
11
|
+
!1),e=0,f=0;e=JM(d);0>e&&(_.Vw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.wn(d),71!==f&&c(),a=_.xn(d),8191===(a&8191))b();else if(a&16384)if(a=(_.wn(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.wn(d),d.skip(a)),1!==_.yn(d)>>8)b();else{d.skip(3);a=_.wn(d)>>6;0!==a&&1!==a||c();0===_.wn(d)&&c();a=_.wn(d);var g=_.xn(d),h=_.xn(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},LM=function(a,b){var c=null,d=0;try{(new _.Dn).N(_.cf,_.En).N(_.Jg,
|
|
12
|
+
_.En).N(_.Ye,_.En).aa("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.yn(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Vw.error("Unable to find timescale in init segment!"),new _.O(_.P,4,4030,gM,c);var e=0,f=!1;try{(new _.Dn).N("moof",_.En).N("traf",_.En).aa("tfdt",function(g){var h=d;if(0===g.version)h=_.yn(g.reader)/h;else{var l=_.yn(g.reader),m=_.yn(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");
|
|
13
|
+
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,4,4030,gM,c);return e},OM=function(a){var b=_.Lj(a,jM);if(!MM.includes(b))return NM.error("PlayReady in HLS is only supported with [",MM.join(", "),"], not",b),null;a=_.Lj(a,_.cc);b=_.Dv(a);a=null;b=_.bk(b.data);try{a=_.tE(_.lp(b))}catch(c){a=b}return _.HE(_.Vd,[{initDataType:_.xd,initData:a}],"")},PM=function(a){this.g=new _.K("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.lk()}},
|
|
14
|
+
RM=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");if("audio/mpeg"===d||d===_.gd||d===_.fd)return v["return"](0);g=f;if(d!==_.ed){v.F(2);break}return _.y(v,QM(a,c,g),3);case 3:h=v.f;l=_.bk(h.data);if(!GM(l))throw new _.O(_.P,4,4030,"AAC segment does not contain an ID3 tag.");return v["return"](IM(l));case 2:if(d!==_.$g&&d!==_.hd){v.F(4);break}m=[QM(a,c,g)];b&&m.push(QM(a,b,!0));return _.y(v,Promise.all(m),5);case 5:return n=
|
|
15
|
+
v.f,p=n[0],q=n[1]||n[0],v["return"](LM(p.data,q.data));case 4:if(d!==_.Zg){v.F(6);break}return _.y(v,QM(a,c,g),7);case 7:return t=v.f,v["return"](KM(t.data));case 6:if(!_.Cu((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.O(_.P,4,4030);}})},QM=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=_.nF(b.eb(),b.Da,b.Da+2048-1,a.a.attemptParameters),e.type=2,f=_.nF(b.eb(),b.Da,b.pa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=
|
|
16
|
+
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=_.H(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.",e.uris[0]);_.D(n,5);return _.y(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.H(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.");
|
|
17
|
+
}})},SM=function(a){this.streams=a},TM=function(a,b){a.streams.forEach(function(c){c.Rf=b})},UM=function(a,b){a.streams.forEach(function(c){c.width=b})},VM=function(a,b){a.streams.forEach(function(c){c.height=b})},WM=function(a,b){a.streams.forEach(function(c){c.frameRate=b})},XM=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},YM=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===
|
|
18
|
+
b})||null},ZM=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},$M=function(a){this.a=a},aN=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},bN=function(a,b){var c=new Set(a.map(function(d){return d.oa}));return b.filter(function(d){return!c.has(d.oa)})},dN=function(a,b){for(;a[0].oa<b[0].oa;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||cN(c,d);
|
|
19
|
+
var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&cN(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},iN=function(a,b,c,d,e){var f=b[0].length();f=FM(f).map(function(g){var h=aN(b,g)||[],l=ZM(c,g)||[];g=ZM(d,g)||[];var m=_.vh(eN(h)).concat(_.vh(l),_.vh(g)).filter(Boolean);fN(m);var n=m[0];m=n.oa;n=n.duration;return{configurationId:a,variants:h,textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,oa:m}});e&&gN(f[0]);hN(f);return f},eN=function(a){a=
|
|
20
|
+
new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},gN=function(a){var b=eN(a.variants)[0].S[0].Ja;a.startTime+=b;a.endTime+=b},hN=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}},cN=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;jN(a.variants,b.variants);kN(_.Y.Df(a),_.Y.Df(b))},jN=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Th(d),
|
|
21
|
+
d]}));b.forEach(function(d){c.get(_.Y.Th(d)).drmInfos=d.drmInfos})},kN=function(a,b){var c=new Map(a.map(function(d){return[d.Ac,d]}));b.forEach(function(d){var e=c.get(d.Ac);e.S=d.S;d.S.forEach(function(f){f.initSegment=e.initSegmentReference});e.segmentIndex.replace(d.S);e.rc=d.rc;e.kf=d.kf;e.duration=d.duration;e.Yh=d.Yh;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;e.keyId=d.keyId})},fN=function(a){var b=lN(a);a.forEach(function(c){_.iF(c.segmentIndex,b);c.duration=b;c.kf=c.rc+b})},lN=function(a){var b=
|
|
22
|
+
Infinity;_.Y.Ll(a).forEach(function(c){b=Math.min(b,c.duration)});return b},mN=function(){var a=this;this.a=this.D=null;this.h=1;this.j=new HM;this.o="";this.U=new xM;this.H=0;this.w=null;this.l=new _.mi(function(){a.ic()});this.A=_.kc;this.f=null;this.G=new _.Ak;this.K=this.C=null;this.g=new _.K("clpp.hls.HlsParser");this.L=new Map;this.Y=new PM(this.ag.bind(this));this.P=!1;this.I=null;this.M=!1;this.B=new Map;this.J=new Set},nN=function(a){if(null===a.w)return[];a=a.w;return[a.audio,a.video].filter(function(b){return b}).map(function(b){return b.Ac})},
|
|
23
|
+
oN=function(a,b){var c=new Set(b.map(function(h){return h.id}));a.B.forEach(function(h,l){c.has(l)||a.B["delete"](l)});for(var d=_.w(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.B.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"+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:_.Qi,eventElement:null};
|
|
24
|
+
f&&!_.N.Ii(f,g)||a.B.set(e.id,g)}return Array.from(a.B.values())},xN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,E,G,B,F;return _.I(function(M){switch(M.a){case 1:c=_.er;d=pN(a,b,a.o,"");if(1===d.type){e=d.S[0].a;f=pM(e);if(!f)throw new _.O(_.P,4,4021,"Unknown file extension "+e);g="";f===c.VIDEO?g="avc1.42E01E":f===c.AUDIO&&(g="mp4a.40.2");d=EM(a.U,a.o,a.a.hlsDefaultCodecs||g)}h=_.Y.Un(d.$);l=qN(h.Qc.qh);l.forEach(function(R){a.J.add(R.groupId)});return _.y(M,rN(a,h),4);case 4:m=M.f;M.F(3);break;
|
|
25
|
+
case 5:m=M.f;case 3:n=m;p=n.Lm;q=n.periods;t=n.fo;v=n.Ho;z=n.alternativeVariants;A=n.alternativeTextStreams;E=n.alternativeImageStreams;if(!a.D)throw new _.O(_.P,7,7001);sN(a,q);G=tN(a,p.delay,q,t);uN(a)||(a.H=p.Fe,vN(a));wN(a,G,q);B=oN(a,v);F={presentationTimeline:G,periods:q,minBufferTime:0,cues:B,muxedAudioTracks:l};z&&(F.alternativeVariants=z);A&&(F.alternativeTextStreams=A);E&&(F.alternativeImageStreams=E);a.g.debug("HLS playlist parsed",F);return M["return"](F)}})},qN=function(a){return a.filter(function(b){return b.name===
|
|
26
|
+
_.Ua&&_.S(b,_.ac)===_.ja&&!_.S(b,_.cc)}).map(function(b){var c=_.Y.gi(b),d=_.S(b,_.qb)||_.Ng;return{groupId:_.Lj(b,_.gb),id:_.fM++,label:_.Lj(b,_.xb),language:d,channelsCount:c,primary:"YES"===_.S(b,"DEFAULT")}})},AN=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,yN(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Vj;h=a.f.periods[0].variants;a.a.lowLatencyMode&&null!==a.w&&(h=h.filter(function(q){return q.id===a.w.id}));l=h.map(function(q){var t=c.bi(q.audio,
|
|
27
|
+
g),v=c.bi(q.video,g);q=zN(a,t,v,q.bandwidth);if(!q)throw new _.O(_.P,4,4047,{message:"Video and audio are encrypted in an incompatible way.",Gp:v?v.ec():void 0,audio:t?t.ec():void 0});return q});m=a.D.configurationId;n=iN(m,l,e,f,!0);return p["return"](n)})},yN=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.er,d=function(q){return q.stream.a()===c.VIDEO||q.stream.a()===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.Ac,Ie:{width:v.width,height:v.height,frameRate:v.frameRate}});return BN(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;CN(a,h.concat(l));m=l.filter(function(q){return q.a()===c.jh});n=
|
|
29
|
+
l.filter(function(q){return q.a()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Vj:h})})},CN=function(a,b){b.forEach(function(c){a.j.a.set(c.ec(),c)})},rN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,E,G;return _.I(function(B){switch(B.a){case 1:return c=_.Y,d=c.Mn(b.Qc.closedCaptions),e=DN(a,b.He),_.y(B,EN(a,b),2);case 2:return f=B.f,g=Object.values(f).flat().map(function(F){return F.playlist}),FN(a,g),h=g[0],l=c.hj(h.$),a.A=l,a.K=c.ij(h.$),m=c.Tn(h.$,l,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay,
|
|
30
|
+
a.a.liveRefreshPeriod),_.y(B,GN(a,f.rh,e),3);case 3:return n=B.f,_.y(B,HN(a,f.He,n,d),4);case 4:return p=B.f,_.y(B,IN(a,f.Do,e),5);case 5:return q=B.f,_.y(B,JN(a,f.ng),6);case 6:return t=B.f,v=a.D.configurationId,z=iN(v,p,q,t,!uN(a)),a.D.filterAllPeriods(z),A=_.vh(f.He).concat(_.vh(f.rh)).map(function(F){return F.playlist}),E=KN(a,A),G=LN(a,A,E),B["return"]({periods:z,fo:E,Ho:G,Lm:m})}})},NN=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=_.Y.od(a.o,b.verbatimUri),_.y(h,MN(a,
|
|
31
|
+
c),2);d=h.f;e=d.response;f=d.text;g=e.uri;return h["return"](pN(a,f,g,b.verbatimUri))})},sN=function(a,b){uN(a)||2!==a.a.timeline.version||(a.I||(a.I=b[0].startTime),_.RG(b,-a.I))},LN=function(a,b,c){b=b.find(function(d){return null!==_.Y.cb(d.$,_.Na)});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.$.filter(function(d){return d.name===_.Na}).map(function(d){return _.Y.Nn(d,c,a.C,!uN(a))}).filter(Boolean)},
|
|
32
|
+
KN=function(a,b){var c=b.flatMap(function(e){return e.S[0].$});c=_.Y.cb(c,_.Za);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},EN=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.y(l,Promise.all([ON(a,b.Qc.qh),ON(a,b.Qc.Eo),ON(a,b.He),ON(a,b.ng)]),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"]({rh:e,
|
|
33
|
+
Do:f,He:g,ng:h})})},QN=function(a,b){return Promise.all(b.map(function(c){return PN(a,c)}))},DN=function(a,b){for(var c=_.Y.Ye,d=new Map,e=_.w(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.S(g,_.ja);f=_.S(g,_.jc);var l=_.S(g,_.Tb);g=RN(a,g);if(l){var m=_.Gj(_.Q,g);d.set(c(_.Q,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=SN(_.dd,g),d.set(c(_.dd,h),l));f&&(h=SN(_.r,g),d.set(c(_.r,f),h))}return d},IN=function(a,b,c){return Promise.all(b.map(function(d){return TN(a,d,c)}))},JN=function(a,b){return Promise.all(b.map(function(c){return UN(a,
|
|
34
|
+
c)}))},GN=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=[TN(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 TN(a,g,c)})),_.y(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.Io(e))})},HN=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=_.vh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.Lj(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();
|
|
35
|
+
return _.y(z,VN(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(A){return VN(a,A,c,d,e)}),_.y(z,Promise.all(q),3);t=z.f;t.splice(g,0,p);v=t.reduce(_.EE,[]);return z["return"](v)})},WN=function(a,b,c){var d;return _.I(function(e){if(1==e.a)return _.y(e,BN(a,{playlist:c,codecs:b.codecs,type:b.type,yd:b.originalLanguage,yc:b.id,groupId:b.groupId,primary:b.primary,kind:b.kind||null,name:b.label,channelsCount:b.channelsCount,spatialAudio:b.spatialAudio||!1,closedCaptions:b.closedCaptions,Ie:{width:b.width,
|
|
36
|
+
height:b.height,frameRate:b.frameRate}}),2);d=e.f;b.bandwidth&&XM(d,b.bandwidth);return e["return"](d)})},VN=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(_.Lj(h,_.pa)),m=f.Wn(h),_.y(p,XN(a,b,m,c,d),2)):(n=p.f)?p["return"](YN(a,n,l,e)):p["return"]([])})},ZN=function(a,b,c,d,e,f){var g=RN(a,b);a.g.debug("Guessing stream type for",b.toString());b=!1;var h=_.Gj(_.r,g),l=d+e;1!==g.length||c||h?!l&&1<g.length?(a.g.debug("Guessing multiplexed audio+video"),
|
|
37
|
+
c=_.r,g=[g.join(",")]):d&&f?(a.g.debug(iM),c=_.dd,b=!0):e?(a.g.debug(iM),c=_.dd):(a.g.debug("Guessing video-only"),c=_.r):(c=_.dd,a.g.debug(iM));return{type:c,Uj:g,um:b}},XN=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,A,E,G,B,F,M;return _.I(function(R){if(1==R.a)return f=_.er,g=_.Y.Ye,h=b,l=h.tag,m=h.playlist,n=_.S(l,_.ja),p=_.S(l,_.jc),q=n?d.get(g(f.AUDIO,n))||[]:[],t=p?d.get(g(f.VIDEO,p))||[]:[],v={audio:q,video:t},z=m.verbatimUri,A=v.audio.find(function(la){return la.ec()===z}),E=ZN(a,l,c,v.audio.length,
|
|
38
|
+
v.video.length,A),G=E.type,B=E.Uj,F=E.um,M=null,F?R.F(2):_.y(R,$N(a,b,B,G,e,c),3);2!=R.a&&(M=R.f);if(null==M)return R["return"](null);v[G]=[M];G===f.AUDIO&&c&&v.video.forEach(function(la){UM(la,c.width);VM(la,c.height);WM(la,c.frameRate)});return R["return"](v)})},YN=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.Cl(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):
|
|
39
|
+
(m=zN(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},zN=function(a,b,c,d,e){for(var f=[],g=(c||b).length(),h=0;h<g;h++){var l=b?b.streams[h]||null:null,m=c?c.streams[h]||null:null,n=_.Y.$l(l,m);if(!n)return null;var p=d;l={id:e?e:a.h++,language:l?l.language:_.Ng,primary:!!l&&l.primary||!!m&&m.primary,audio:l,video:m,bandwidth:p,drmInfos:n,allowedByApplication:!0,allowedByKeySystem:!0};f.push(l)}return new $M(f)},TN=function(a,b,c){var d,
|
|
40
|
+
e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.verbatimUri;return h["return"](aO(a,g,function(){var l,m,n,p,q,t,v,z,A,E,G,B,F;return _.I(function(M){if(1==M.a){l=_.er;m=_.Y.Ye;n=_.Lj(e,_.gb);p=_.Y.Sh(_.Lj(e,_.ac));q=_.Y.yl(e);t=c.get(m(p,n))||"";v=_.S(e,_.qb);z=_.S(e,_.xb);A=_.S(e,"DEFAULT");E=p===l.AUDIO?_.Y.gi(e):null;var R=p===l.AUDIO?(R=_.S(e,"CHANNELS"))?R.includes("/JOC"):!1:!1;G=R;B="YES"===A;return _.y(M,BN(a,{playlist:f,codecs:t,type:p,yd:v,primary:B,name:z,channelsCount:E,spatialAudio:G,
|
|
41
|
+
groupId:n,kind:q,yc:null,closedCaptions:null,Ie:null}),2)}F=M.f;return M["return"](F)})}))})},UN=function(a,b){var c,d,e,f;return _.I(function(g){c=b;d=c.tag;e=c.playlist;f=e.verbatimUri;return g["return"](aO(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.S(d,_.ua)||"jpg",l=_.S(d,_.qb),m=_.S(d,_.xb),_.y(q,BN(a,{playlist:e,codecs:h,type:_.Ie,yd:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,yc:null,groupId:null,Ie:null}),2);n=q.f;(p=_.S(d,
|
|
42
|
+
_.pa))&&XM(n,Number(p));return q["return"](n)})}))})},RN=function(a,b){var c=_.S(b,_.ua,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);c=_.Y.Gl(c);var d=new Set,e=[];c=_.w(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.QE(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},$N=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=_.er;n=l.verbatimUri;return p["return"](aO(a,n,function(){var q,t,v,z,A;return _.I(function(E){if(1==
|
|
43
|
+
E.a){q=_.S(h,_.ta);t=null;d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q));var G=_.S(h,_.ja)||void 0;v=G&&a.J.has(G)?G:void 0;G=SN(d,c);if(v){var B=SN(_.dd,c);G+=","+B}z=G;return _.y(E,BN(a,{playlist:l,codecs:z,type:d,closedCaptions:t,primary:!1,kind:null,yd:null,name:null,channelsCount:null,spatialAudio:!1,yc:null,groupId:null,muxedAudioId:v,Ie:f}),2)}A=E.f;return E["return"](A)})}))})},aO=function(a,b,c){if(a.j.has(b))return a=a.j.get(b),Promise.resolve(a);if(a.j.f.has(b))return a.j.f.get(b)||null;c=c();
|
|
44
|
+
a.j.set(b,c);return c},BN=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,E,G,B,F,M,R,la,U,ra;return _.I(function(Ba){if(1==Ba.a){c=bO;d=cO;e=_.er;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.yd;n=f.yc;p=f.groupId;q=f.muxedAudioId;t=f.primary;v=f.kind;z=f.name;A=f.channelsCount;E=f.spatialAudio;G=f.closedCaptions;B=f.Ie;F=_.Y.ki(m);if(1!==g.type)throw new _.O(_.P,4,4017);return _.y(Ba,dO(a,g,l,h),2)}M=Ba.f;R=a.a.lowLatencyMode?d.Hj:d.Jj;la=v;l!==e.TEXT||v||(la=_.xg);U=_.Y.hj(g.$);ra=M.map(function(Ca){var Da=
|
|
45
|
+
Ca.S,Ma=Ca.Il,Ab=Ca.mimeType,qe=Ca.oa,Gf=Da[0].startTime,Lg=Da[Da.length-1].endTime,$u=Lg-Gf,pd=new _.MF(Da),Qn=Da[0].initSegment||null;return{id:null===n?_.fM++:n,originalId:z,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:pd.ld.bind(pd),getSegmentReference:pd.get.bind(pd),adjustSegmentDurations:pd.Md.bind(pd),getDuration:pd.getDuration.bind(pd),segmentIndex:pd,segmentLookupStrategy:R,initSegmentReference:Qn,mimeType:Ab,codecs:h,kind:la,Yh:Ma.type,encrypted:Ma.type===c.Mj,aesEncrypted:Ca.aesEncrypted,
|
|
46
|
+
keyId:Ma.keyId,language:F,originalLanguage:m||_.Ng,label:z,type:l,primary:t,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:B?B.frameRate:void 0,width:B?B.width:void 0,height:B?B.height:void 0,bandwidth:void 0,roles:[],channelsCount:A,spatialAudio:E,closedCaptions:G,S:Da,drmInfos:Ma.drmInfos,oa:qe,Ac:g.verbatimUri,Rf:g.a,rc:Gf,kf:Lg,duration:$u,groupId:p,Ap:U,muxedAudioId:q}});return Ba["return"](new SM(ra))})},ON=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.y(d,Promise.all(b.map(function(e){var f;
|
|
47
|
+
return _.I(function(g){if(1==g.a)return _.y(g,eO(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))})},eO=function(a,b){var c,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){c=_.Y.Fm(b);d=_.S(b,_.cc,void 0,{required:c});if(!d)return m["return"](null);e=_.Y.od(a.o,d);return _.y(m,MN(a,e),2)}f=m.f;g=f.response;h=f.text;l=g.uri;return m["return"](pN(a,h,l,d))})},PN=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new _.sj(b.streams[0].Rf);
|
|
48
|
+
if(a.a.lowLatencyMode&&a.K&&a.K.vh){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={Om:q.position,Xn:t&&0<t.length?v:null}}else q=null;if(t=q)q=t.Om,t=t.Xn,v=_.dl(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=_.bl(v,!0),_.vj(p,new _.zj(q))}c=p.toString();return _.y(n,MN(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.ec();h=b.streams[0].Rf;l=e.uri;h!==l&&(h=l,TM(b,h));m=pN(a,f,h,g);
|
|
49
|
+
return n["return"]({stream:b,playlist:m})})},pN=function(a,b,c,d){a=AM(a.U,b,c);a.verbatimUri=d;return a},fO=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.");},gO=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.S(c,_.cc)})||null}).map(function(b){return _.Hj(b)});if(1<(new Set(a)).size)throw new _.O(_.P,4,4044,"Unexpected change in file format.");
|
|
50
|
+
},tN=function(a,b,c,d){var e=!0,f=null,g=0;uN(a)||(e=!1,f=0,g=b);b=a.a.timeline||{};b.type=void 0;a=new _.qF(b,f,g,!0,void 0,!!a.a.lowLatencyMode);_.tF(a,e);hO(a,c);d&&_.sF(a,d);return a},iO=function(a,b,c){a=_.Y.ac(a.$,_.Ta);if(1<a.length)throw new _.O(_.P,4,4020);a=a[0];if(!a)return null;var d=_.Lj(a,_.cc),e=_.Y.od(b,d);b=_.Y.fj(a,null,!0);return new _.IE(function(){return[e]},b.Da,b.pa,c)},kO=function(a,b,c,d,e,f,g){var h=[],l={};b=_.w(jO(b.f));for(var m=b.next();!m.done;l={Hf:l.Hf},m=b.next()){var n=
|
|
51
|
+
m.value;m=n.wi;n=n.item;var p=0===m,q=p?a:h[h.length-1],t=p?d:q.endTime,v=Number(_.S(n,_.Ja));v=t+v;p=_.Y.fj(n,p?null:q.pa,p);q=_.S(n,_.cc);q=_.Y.od(g,q);l.Hf=q?[q]:[];t=new _.Oj(c,t,v,function(z){return function(){return z.Hf}}(l),p.Da,p.pa,e,f,!1,null,null,null,null);if("YES"===_.S(n,"INDEPENDENT")||0===m)t.h=!0;h.push(t)}return h},lO=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.$,q=c.a;0<_.Y.ac(p,_.Ta).length&&(n=iO(c,l,g));var t=null!=q,v=q?[q]:[];if(!t&&!a.a.lowLatencyMode)return null;a=0;q={Da:0,
|
|
52
|
+
pa:null};var z=null;t?(c=_.Y.Qn(p).duration,a=e+c,q=_.Y.gj(p,b?b.pa:null)):(b=kO(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.Ie?_.Y.Vn(p):null;d=new _.Oj(d,e,a,function(){return v},q.Da,q.pa,f,g,!1,null,h?h.je:null,h?h.Ge:null,h?h.durationPerTile:null,z,n);d.oa=m;return d},dO=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v,z,A;return _.I(function(E){switch(E.a){case 1:return e=_.Y,f=mO,g=b.verbatimUri,h=b.S,l=e.dm(b.$,_.Va),m=[],_.y(E,nO(a,b.a,g,h,l,c,d),2);case 2:n=E.f,p=l,q=f.Bo(h),t=0;case 3:if(!(t<
|
|
53
|
+
q.length)){E.F(5);break}v=q[t];z=m[m.length-1]||null;return _.y(E,oO(a,b.a,v,p,n,c,d,z),6);case 6:A=E.f;m.push(A);p+=v.length;t++;E.F(3);break;case 5:return fO(m),E["return"](m)}})},nO=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,t,v,z,A,E;return _.I(function(G){if(1==G.a){h=d[0];if(null!=a.C)return G["return"](a.C);if(!uN(a)&&a.f)try{var B=a.j.get(c),F=B?YM(B,e)||null:null;if(!F)throw new _.O(_.P,4,4030,"Segment not found in pervious playlist update.");l=F.startTime+F.Ja;a.g.debug(lM+l+".");a.C=l;return G["return"](l)}catch(M){if(m=
|
|
54
|
+
a.j.get(c))n=m.streams[0].S[0].position,G=m.streams[m.streams.length-1].S,p=G[G.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(G,pO(a,f,g,h),2)}if(3!=G.a)return v=G.f,z=qO.cj(h.$,a.o,e),A=iO(h,b,z),_.y(G,rO(a,A,h,z,v,g),3);E=G.f;a.g.debug(lM+E+".");a.C=E;return G["return"](E)})},oO=function(a,
|
|
55
|
+
b,c,d,e,f,g,h){var l,m,n,p,q,t,v,z,A,E,G,B,F,M,R,la,U,ra,Ba,Ca,Da,Ma;return _.I(function(Ab){switch(Ab.a){case 1:return l=qO,m=c[0],n=null==h,gO(c),_.y(Ab,pO(a,f,g,m),2);case 2:p=Ab.f;q=l.Pn(c,p,h?h.Jm:null);t=q[q.length-1];v=qO.ua(q);z=h?h.Km:null;A=sO(z,m.$,a.o,d);E=iO(m,b,A)||(h?h.wm:null);G=m.oa;if(n){B=e;Ab.F(3);break}return _.y(Ab,tO(a,G,E,m,d,A,p,g),4);case 4:B=Ab.f;case 3:F=B;M=[];R=!1;for(la=0;la<c.length;la++)if(U=c[la],ra=M[M.length-1]||null,Ba=0===la?0:ra.endTime,Ca=d+la,(z=Da=sO(z,U.$,
|
|
56
|
+
a.o,Ca))&&(R=!0),Ma=lO(a,ra,U,Ca,Ba,F,Da,f,b,G,E))E=Ma.initSegment,M.push(Ma);return Ab["return"]({S:M,Il:v,Jm:t,aesEncrypted:R,mimeType:p,endTime:M[M.length-1].endTime,oa:G,wm:E,Km:z})}})},sO=function(a,b,c,d){return b.some(function(e){return e.name===_.Sa&&"NONE"===_.S(e,jM)})?null:(b=qO.cj(b,c,d))?b:a&&a.generatedIv?Object.assign({},a,{iv:qO.fi(d)}):a},FN=function(a,b){b.forEach(function(c){var d=a.j.get(c.verbatimUri);mO.Zj(c,d,!uN(a))});mO.Dl(b)},tO=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==
|
|
57
|
+
m.a)return a.L.has(b)?m["return"](a.L.get(b)):_.y(m,rO(a,c,d,f,g,h),2);l=m.f;a.g.debug("Segment #"+e+" has raw media timestamp "+(l+" s."));a.L.set(b,l);return m["return"](l)})},rO=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.Al(c,d);return h["return"](RM(a.Y,b,g,e,f,null!=d))})},SN=function(a,b){if(1===b.length)return b[0];var c=_.Gj(a,b);if(null!=c)return c;throw new _.O(_.P,4,4025,{codecList:b});},pO=function(a,b,c,d){var e,f,g;return _.I(function(h){e=
|
|
58
|
+
d.a;g=(f=_.Y.cb(d.$,_.Ta))?_.Lj(f,_.cc):null;return h["return"](uO(a,b,c,e,g))})},uO=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);if(g=_.Jj(f,b,c))return n["return"](g);h=_.pk([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.y(n,a.ag(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.toLowerCase().split(";")[0])})},wN=function(a,b,c){c=_.Y.fm(c);"LIVE"===a.A||
|
|
59
|
+
"EVENT"===a.A?(c=Math.max(c,b.K),isNaN(a.a.availabilityWindowOverride)||(c=a.a.availabilityWindowOverride),b.A=c):a.A===_.kc&&(b.f=c)},vN=function(a){for(var b=0,c=_.w(a.j.values()),d=c.next();!d.done;d=c.next())b=Math.max(b,d.value.streams[0].rc);for(c=0;95443.7176888889<=b;)c+=95443.7176888889,b-=95443.7176888889;if(c)for(a.g.debug("Offsetting live streams by",c,"to compensate for rollover"),b=_.w(a.j.values()),d=b.next();!d.done;d=b.next())d=d.value.streams[0],95443.7176888889>d.rc?(a.g.debug("Offset applied to",
|
|
60
|
+
d.type),d.segmentIndex.offset(c)):a.g.debug("Offset NOT applied to",d.type)},MN=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.pk([b],a.a.attemptParameters),c.type=1,_.y(f,a.ag(c),2);d=f.f;e="";try{e=_.T.ea(d.data)}catch(g){throw new _.O(_.P,4,4042);}e=_.T.Pi(e);e=e.trim();return f["return"]({text:e,response:d})})},uN=function(a){return a.A===_.kc},hO=function(a,b){_.Y.Gm(b,function(c,d){_.xF(a,c.S,d.startTime)});_.pF(a.a,b[0].startTime,b[b.length-1].endTime)},vO=function(){},
|
|
61
|
+
cO={Hj:_.bE,Jj:_.aE},bO={Mj:nM,cp:"whole-segment",NONE:_.ff},jO=function wO(a){var c,d,e,f,g,h;return _.Rh(wO,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,{wi:c,co:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.y(l,{wi:c,item:e,co:d,next:h},5):l.F(5)}c++;d=e;e=h;g=f.next();return l.F(2)})};_.u=HM.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)})};
|
|
62
|
+
_.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()};
|
|
63
|
+
var mO={Dl:function(a){var b=mO.Tl(a),c=mO.Im(a);a.forEach(function(d){var e=d.S,f=e.findIndex(function(h){return h.oa===b}),g=e.findIndex(function(h){return h.oa===c+1});-1===g&&(g=e.length);d.S=e.slice(f,g)})},Zj:function(a,b,c){b=mO.cm(a,b,c);a=_.w(a.S||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.me(c.$,_.Pa)&&b++,c.oa=b},cm:function(a,b,c){var d=_.Y.cb(a.$,_.Qa);if(d)return Number(d.value);d=mO.ym(b);if(c&&d)try{return mO.vm(a,b)}catch(e){throw new _.O(_.P,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
|
|
64
|
+
}return 0},ym:function(a){return 0<mO.em(a)},Bo: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.me(d.$,_.Pa)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},em:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].S;return a[a.length-1].oa},vm:function(a,b){var c=_.Y.cb(a.$,_.Va);if(!c)throw mO.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(hM);c=Number(c.value);var d=
|
|
65
|
+
YM(b,c);if(!d)throw mO.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(hM);return d.oa},Im:function(a){a=a.map(function(b){return b.S[b.S.length-1].oa});return Math.min.apply(Math,_.vh(a))},Tl:function(a){a=a.map(function(b){return b.S[0].oa});return Math.max.apply(Math,_.vh(a))}};mO.g=new _.K("clpp.hls.DiscontinuityUtils");var xO={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Zg)throw new _.O(_.P,4,4041);if(_.Lj(a,jM)===kM)throw new _.O(_.P,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.HE(_.Sd,[{initDataType:_.ng,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":OM,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":OM,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.Lj(a,jM);if(!MM.includes(b))return NM.error("Widevine in HLS is only supported with [",
|
|
66
|
+
MM.join(", "),"], not",b),null;b=_.Lj(a,_.cc);b=_.Dv(b);b=_.bk(b.data);b=_.HE(_.Xd,[{initDataType:_.xd,initData:b}],"");if(a=_.S(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},MM=["SAMPLE-AES",kM],NM=new _.K("clpp.hls.DrmParser");var qO={Pn:function(a,b,c){if(_.Y.me(a[0].$,_.Sa)||null===c)return c=qO.dj(a,b),0===c.length?[{type:_.ff,drmInfos:[],keyId:null}]:c;a=qO.dj(a,b);return[c].concat(_.vh(a))},ua:function(a){if(0===a.length)return{type:_.ff,drmInfos:[],keyId:null};if(a.some(function(c){return"whole-segment"===c.type})||a.every(function(c){return c.type===_.ff}))return a[0];a=a.filter(function(c){return c.type===nM});var b=_.Zi(a.flatMap(function(c){return c.drmInfos}));return{keyId:a[a.length-1].keyId,type:nM,drmInfos:b}},
|
|
67
|
+
dj:function(a,b){return qO.Ml(a).map(function(c){return qO.Sn(c.$,b)}).filter(Boolean)},Ml:function(a){return a.filter(function(b){return _.Y.me(b.$,_.Sa)})},Sn:function(a,b){var c=_.Y.ac(a,_.Sa).filter(function(e){return"AES-128"!==_.Lj(e,jM)});if(0===c.length)return null;var d=_.Lj(c[0],jM);if(1===c.length&&"NONE"===d)return{type:_.ff,drmInfos:[],keyId:null};d=c.map(function(e){return _.Lj(e,jM)});if(!d.every(function(e){return"SAMPLE-AES"===e})&&!d.every(function(e){return e===kM}))throw qO.g.warn("EXT-X-KEY methods "+
|
|
68
|
+
d.join(", ")+" are incompatible."),new _.O(_.P,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");c=c.map(function(e){var f=_.S(e,"KEYFORMAT","identity"),g=xO[f]||null;(e=g?g(e,b):null)||qO.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===c.length)throw new _.O(_.P,4,4026);return{keyId:c.map(function(e){return e.keyIds}).reduce(function(e,f){return e.concat(f)},[]).reverse()[0]||null,type:nM,drmInfos:c}},xp:function(){return{type:_.ff,drmInfos:[],keyId:null}},
|
|
69
|
+
cj:function(a,b,c){a=_.Y.ac(a,_.Sa)[0];if(!a||"AES-128"!==_.Lj(a,jM))return null;var d=qO.Yl(a,c);c=d.iv;d=d.generatedIv;return{method:"AES-128",url:_.Y.od(b,_.Lj(a,_.cc)),iv:c,generatedIv:d}},fi:function(a){return _.en(new Uint8Array(12),new Uint8Array([a>>24&255,a>>16&255,a>>8&255,a&255]))},Yl:function(a,b){var c=_.S(a,"IV","");if(c)return{iv:_.bn((c||"0x").slice(2)),generatedIv:!1};c=_.S(a,"KEYFORMAT");return null==c||"identity"===c?{iv:qO.fi(b),generatedIv:!0}:{iv:null,generatedIv:!1}}};
|
|
70
|
+
qO.g=new _.K("clpp.hls.EncryptionUtils");SM.prototype.length=function(){return this.streams.length};SM.prototype.f=function(){return this.streams[0].groupId};SM.prototype.a=function(){return this.streams[0].type};SM.prototype.ec=function(){return this.streams[0].Ac};$M.prototype.length=function(){return this.a.length};_.u=mN.prototype;_.u.configure=function(a){this.a=a;this.Y.a=a};_.u.setCurrentVariant=function(a){this.w=a};_.u.start=function(a,b){var c=this,d,e,f,g,h;return _.I(function(l){if(1==l.a){if(c.P)throw Error("start() may be called only once!");c.P=!0;c.D=b;return _.y(l,MN(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.o=e.uri,_.y(l,xN(c,f),3);g=l.f;c.f=g;h=c.H;c.l&&0<h&&c.l.fa(h);return l["return"](g)})};_.u.requestStop=function(){this.M=!0};
|
|
71
|
+
_.u.stop=function(){this.l&&(this.l.stop(),this.l=null);var a=[];this.G&&(a.push(this.G.destroy()),this.G=null);this.j.clear();this.f=this.a=this.D=this.w=null;this.B.clear();this.J.clear();return Promise.all(a)};
|
|
72
|
+
_.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.f;if(uN(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.A&&(a.C=null);d=Array.from(a.j.values());a.a.lowLatencyMode&&null!==a.w&&(e=nN(a),d=d.filter(function(q){return e.includes(q.ec())}));return _.y(p,QN(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),FN(a,g),_.y(p,AN(a,f),3);case 3:h=p.f;bN(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});sN(a,h);l=KN(a,
|
|
73
|
+
g);m=LN(a,g,l);b.cues=oN(a,m);dN(b.periods,h);hO(c,h);if(n=_.Y.sm(g))!0!==a.a.keepTimelineLive&&(a.A=_.kc,_.tF(c,!0),c.f=h[h.length-1].endTime),a.l.stop(),a.l=null;if(a.D.onUpdate)a.D.onUpdate(b);if(n&&a.D.onTurnedStatic)a.D.onTurnedStatic();if(!a.M){p.F(4);break}return _.y(p,a.stop(),4);case 4:return p["return"](b)}})};
|
|
74
|
+
_.u.loadVariant=function(a,b){var c=this,d,e,f,g,h,l,m,n,p,q,t,v,z,A,E;return _.I(function(G){if(1==G.a){d=a.id;if(e=c.f.periods.find(function(B){return B.id===b}))if(f=e.variants.find(function(B){return B.id===d}))return G["return"](f);g=c.f.alternativeVariants.find(function(B){return B.id===d});if(!g)throw new _.nj("No alternative variant with id: "+d);h=g;m=l=null;h.audio&&(n=h.audio,l=aO(c,n.verbatimUri,function(){var B;return _.I(function(F){if(1==F.a)return _.y(F,NN(c,n),2);B=F.f;return F["return"](WN(c,
|
|
75
|
+
n,B))})}));h.video&&(p=h.video,m=aO(c,p.verbatimUri,function(){var B;return _.I(function(F){if(1==F.a)return _.y(F,NN(c,p),2);B=F.f;return F["return"](WN(c,p,B))})}));return _.y(G,l,2)}if(3!=G.a)return q=G.f,_.y(G,m,3);t=G.f;if(v=zN(c,q,t,h.bandwidth,h.id))A=c.D.configurationId,E=iN(A,[v],[],[],!uN(c)),c.D.filterAllPeriods(E),E.forEach(function(B,F){c.f.periods[F].variants.push(B.variants[0]);b===c.f.periods[F].id&&(z=B.variants[0])});if(!z)throw new _.nj("Could load variant with id: "+d);return G["return"](z)})};
|
|
76
|
+
_.u.loadTextStream=function(a,b){var c=this,d,e,f,g,h,l;return _.I(function(m){if(1==m.a){(e=c.f.periods.find(function(n){return n.id===b}))&&(f=e.textStreams.find(function(n){return n.id===a})||null)&&(d=f);if(d||!c.f.alternativeTextStreams)return m.F(2);g=c.f.alternativeTextStreams.find(function(n){return n.id===a})||null;if(!g)throw new _.nj(_.kD+a);h=g;return _.y(m,aO(c,h.verbatimUri,function(){var n;return _.I(function(p){if(1==p.a)return _.y(p,NN(c,h),2);n=p.f;return p["return"](WN(c,h,n))})}),
|
|
77
|
+
3)}2!=m.a&&(l=m.f)&&c.f.periods.forEach(function(n,p){var q=l.streams[p];c.f.periods[p].textStreams.push(q);q.id===a&&(d=q)});if(!d)throw new _.nj(_.kD+a);return m["return"](d)})};_.u.ic=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.RD);if(!a.D)return d["return"]();_.D(d,2);return _.y(d,a.update(),4)}if(2!=d.a)return a.l&&0<a.H&&a.l.fa(a.H),_.Jh(d,0);b=_.H(d);if(!(b instanceof _.O))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.l&&a.l.fa(.1));_.C(d)})};
|
|
78
|
+
_.u.ag=function(a){if(!this.G)throw new _.O(_.P,7,7001);a=this.D.networkingEngine.fetch(a);_.Bk(this.G,a);return a.T};_.x(vO,_.Gu);vO.prototype.f=function(){_.iv.m3u8=mN;_.gv[_.mm]=mN;_.gv[mM]=mN};vO.prototype.a=function(){_.pG("m3u8");_.qG(_.mm);_.qG(mM)};vO.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",vO);};
|
|
73
79
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
74
80
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
75
81
|
else{_=this.clpp._;(f.call(g,this));}
|