@castlabs/prestoplay 6.27.0 → 6.28.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 +19 -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 +113 -112
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +625 -624
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -89
- package/cjs/cl.externs.js +80 -72
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +78 -79
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +347 -347
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +4 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -17
- 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 +38 -38
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -5
- package/cl.cast.js +91 -90
- package/cl.conviva.js +27 -27
- package/cl.core.js +503 -499
- package/cl.crypto.js +8 -8
- package/cl.dash.js +83 -82
- package/cl.externs.js +80 -72
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +80 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +2 -3
- package/cl.mse.js +304 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +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 +31 -29
- package/package.json +1 -1
- package/typings.d.ts +34 -65
- package/cjs/cl.sessions.js +0 -21
- package/cl.sessions.js +0 -10
package/cjs/cl.freewheel.js
CHANGED
|
@@ -1,29 +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
|
-
_.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(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
|
-
_.r.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.
|
|
7
|
-
_.
|
|
8
|
-
_.r.getTitle=function(){return""};_.r.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return 0};_.r.
|
|
9
|
-
_.r.
|
|
10
|
-
_.r.getPodIndex=function(){switch(this.Wa()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.r.
|
|
11
|
-
_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_.r.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{
|
|
17
|
-
_.v(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,
|
|
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.
|
|
19
|
-
_.r.resume=function(){this.f&&this.f.resume()};_.r.pause=function(){this.f&&this.f.pause()};_.r.skip=function(){this.f&&this.f.skipCurrentAd()};_.r.getVolume=function(){return this.a?this.a.getAdVolume():1};_.r.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.r.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.r.
|
|
20
|
-
_.r.
|
|
21
|
-
void 0));this.l.resolve()};_.r.
|
|
22
|
-
_.r.
|
|
23
|
-
_.
|
|
24
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.r.
|
|
25
|
-
_.r.
|
|
26
|
-
|
|
2
|
+
var f=function(window){var FU="clpp-freewheel",GU="clpp.freewheel.AdsManagerFactory",HU="freewheel",IU=function(){this.f=this.a=null},JU=function(){},KU=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""}},LU=function(a,b,c){this.h=a;this.f=b;this.a=c},MU=function(a){this.a=a},NU=function(a){this.g=new _.L("clpp.freewheel.AdsManager");this.m=a;this.h=new _.ti;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.am;this.j=null},OU=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.gg&&b.push("serverUrl");typeof a.profileId!==_.gg&&b.push("profileId");typeof a.videoAssetId!==_.gg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},PU=function(){var a,b,c,d;return _.I(function(e){if(1==e.a)return a=new _.xv,b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE,
|
|
4
|
+
_.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(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)})},SU=function(a){return _.I(function(b){if(a.B.length)return QU(a),a.f=a.B.shift(),a.f.play(),b.C(0);RU(a);return _.x(b,a.m.a.play(),0)})},TU=function(a){a.A.length?(QU(a),a.f=a.A.shift(),a.f.play()):RU(a)},QU=function(a){var b=a.m.de(HU).nd();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(FU),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},RU=function(a){var b=a.m.de(HU).nd();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},UU=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 LU(a.a,c,d)});a.m.trigger(new _.Q(b,d))},VU=function(){this.Ca=new _.L(GU)};_.w(IU,_.Tv);_.r=IU.prototype;
|
|
6
|
+
_.r.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Vi(_.Pd,{id:FU}),this.f=_.Vi(_.Mg,{"class":_.ld}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.N(1,9,12E3))};_.r.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.r.id=function(){return HU};_.r.nd=function(){return this.a};_.r.Pl=function(){return this.f};
|
|
7
|
+
_.K("clpp.freewheel.FreeWheelPlugin",IU);IU.prototype.getAdVideo=IU.prototype.Pl;IU.prototype.getAdContainer=IU.prototype.nd;IU.Id=HU;IU.AD_CONTAINER_ID=FU;JU.prototype.create=function(){return new IU};_.r=LU.prototype;_.r.vb=function(){return"FreeWheel AdManager SDK"};_.r.wb=function(){return tv.freewheel.SDK.version};_.r.Bb=function(){return 0};_.r.getId=function(){return this.a?this.a.getAdId():""};_.r.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.gg?a:""};_.r.Yb=function(){return""};_.r.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.r.getAdSystem=function(){return""};_.r.getAdvertiserName=function(){return""};
|
|
8
|
+
_.r.getTitle=function(){return""};_.r.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return 0};_.r.bc=function(){return!1};_.r.xb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.r.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
|
|
9
|
+
_.r.lb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.r.kb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.r.Va=function(){return 0};_.r.Wa=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
|
+
_.r.getPodIndex=function(){switch(this.Wa()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.r.Mb=function(){switch(this.Wa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.r.zb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.r.nb=function(){return this.f.getAdCount()};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};
|
|
11
|
+
_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.ac=function(){return null};LU.prototype.getVideoElement=LU.prototype.ac;LU.prototype.getWrapperCreativeIds=LU.prototype.getWrapperCreativeIds;LU.prototype.getWrapperAdSystems=LU.prototype.getWrapperAdSystems;LU.prototype.canSeek=LU.prototype.canSeek;LU.prototype.getWrapperAdIds=LU.prototype.getWrapperAdIds;LU.prototype.getSequenceLength=LU.prototype.nb;LU.prototype.getPositionInSequence=LU.prototype.zb;
|
|
12
|
+
LU.prototype.getPodTimeOffset=LU.prototype.Mb;LU.prototype.getPodIndex=LU.prototype.getPodIndex;LU.prototype.getPodType=LU.prototype.Wa;LU.prototype.getMediaBitrate=LU.prototype.Va;LU.prototype.getMediaHeight=LU.prototype.kb;LU.prototype.getMediaWidth=LU.prototype.lb;LU.prototype.getMediaUrl=LU.prototype.getMediaUrl;LU.prototype.getClickThroughUrl=LU.prototype.xb;LU.prototype.isBumper=LU.prototype.bc;LU.prototype.getSkipTimeOffset=LU.prototype.getSkipTimeOffset;LU.prototype.getPosition=LU.prototype.getPosition;
|
|
13
|
+
LU.prototype.getDuration=LU.prototype.getDuration;LU.prototype.getTitle=LU.prototype.getTitle;LU.prototype.getAdvertiserName=LU.prototype.getAdvertiserName;LU.prototype.getAdSystem=LU.prototype.getAdSystem;LU.prototype.getApiFramework=LU.prototype.getApiFramework;LU.prototype.getSourceId=LU.prototype.Yb;LU.prototype.getCreativeId=LU.prototype.getCreativeId;LU.prototype.getId=LU.prototype.getId;LU.prototype.getTechnology=LU.prototype.Bb;LU.prototype.getAdManagerVersion=LU.prototype.wb;
|
|
14
|
+
LU.prototype.getAdManagerName=LU.prototype.vb;MU.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()}})};MU.prototype.Ob=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};MU.prototype.Nb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
15
|
+
MU.prototype.hasPostroll=MU.prototype.Nb;MU.prototype.hasPreroll=MU.prototype.Ob;MU.prototype.getCuePoints=MU.prototype.getCuePoints;_.r=NU.prototype;
|
|
16
|
+
_.r.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{OU(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!==_.gg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,PU(),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
|
+
_.v(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,KU(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Se&&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=_.v(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.wn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.Bn.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.An.bind(a));a.h.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Rm.bind(a));a.h.on(a.m,_.ug,a.Ik.bind(a));a.h.on(a.m,_.dg,a.Hk.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.r.start=function(){var a=this;return _.I(function(b){return _.x(b,SU(a),0)})};_.r.gd=function(){};
|
|
19
|
+
_.r.resume=function(){this.f&&this.f.resume()};_.r.pause=function(){this.f&&this.f.pause()};_.r.skip=function(){this.f&&this.f.skipCurrentAd()};_.r.getVolume=function(){return this.a?this.a.getAdVolume():1};_.r.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.r.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.r.ed=function(){return!0};_.r.Dc=function(){var a=this;return _.I(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);RU(a);a.a&&(a.a.dispose(),a.a=null);_.z(b)})};
|
|
20
|
+
_.r.wn=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 _.Q(_.Ac,{adsTimeline:new MU(this.a)})),this.j=new _.vv(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.de(HU).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
|
|
21
|
+
void 0));this.l.resolve()};_.r.Bn=function(a){UU(this,_.fc,a);this.j.start()};_.r.An=function(a){this.f=null;a=a.slot;UU(this,_.gc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:SU(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:RU(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:TU(this)}};
|
|
22
|
+
_.r.Rm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:UU(this,_.wc,a);UU(this,_.pc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:UU(this,_.xc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:UU(this,_.kc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:UU(this,_.rc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:UU(this,_.yc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:UU(this,_.jc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:UU(this,
|
|
23
|
+
_.ic,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:UU(this,_.sc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:UU(this,_.uc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:UU(this,_.vc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:UU(this,_.hc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:UU(this,_.tc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.N(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
|
|
24
|
+
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.r.Ik=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();QU(this);this.f.play()}}};
|
|
25
|
+
_.r.Hk=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case 3:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case 4:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case 5:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);TU(this);break;case _.Wt:case _.zo:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};NU.prototype.getPosition=NU.prototype.getPosition;NU.prototype.setVolume=NU.prototype.setVolume;NU.prototype.getVolume=NU.prototype.getVolume;
|
|
26
|
+
NU.prototype.skip=NU.prototype.skip;NU.prototype.pause=NU.prototype.pause;NU.prototype.resume=NU.prototype.resume;VU.prototype.name=function(){return GU};VU.prototype.a=function(a,b){return a.namespace()!==_.qd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Ca.warn("FreeWheel SDK is not loaded."),!1):!1};VU.prototype.create=function(a){return new NU(a)};_.Zh(new VU);_.To(new JU);};
|
|
27
27
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
28
28
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
29
29
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hls.js
CHANGED
|
@@ -1,83 +1,82 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
null!=_.
|
|
4
|
-
b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.
|
|
5
|
-
if(
|
|
6
|
-
g,f)});b=
|
|
7
|
-
return new
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
d.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
_.r.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_.r.Xf=function(a){if(!this.G)throw new _.O(_.Q,7,7001);a=this.D.networkingEngine.fetch(a);_.kk(this.G,a);return a.T};_.w(ON,_.Wu);ON.prototype.f=function(){_.qv.m3u8=GM;_.pv[_.ym]=GM;_.pv[zL]=GM};ON.prototype.a=function(){_.oF("m3u8");_.pF(_.ym);_.pF(zL)};ON.prototype.id=function(){return"hls"};_.J("clpp.hls.HlsComponent",ON);};
|
|
2
|
+
var f=function(window){var aK="Could not parse MP4 segment start time.",bK="EXT-X-DATERANGE",cK="EXT-X-DISCONTINUITY",dK="EXT-X-KEY",eK="EXT-X-MAP",fK="EXT-X-MEDIA-SEQUENCE",gK="EXT-X-PROGRAM-DATE-TIME",hK="Failed to infer discontinuity number",iK="Guessing audio-only",jK="METHOD",kK="SAMPLE-AES-CTR",lK="Setting playlist start time to ",mK="_HLS_part",nK="application/vnd.apple.mpegurl",oK="manifestloaded",pK="sample",qK=function(a){if(1>a.a)throw _.Yp();--a.a},rK=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},
|
|
3
|
+
function(c,d){return d+b})},sK=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},tK=function(a){a=_.rn(a)||"";return null!=_.Ep.video[a]?_.Mg:null!=_.Ep.audio[a]?_.Nc:null},uK=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.N(_.O,4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.N(_.O,4,4043,"Media playlist must have at least one full segment!");
|
|
4
|
+
}this.a=a;this.verbatimUri="";this.type=b;this.Y=c;this.S=1===b?d:null},vK=function(a,b,c){c=void 0===c?[]:c;this.Y=b;this.a=a;this.f=c;this.qa=-1},wK=function(a){return a.some(function(b){return b.startsWith("#EXT-X-TARGETDURATION")})?1:0},xK=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},yK=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=xK(d.value,b)})})},
|
|
5
|
+
zK=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.T(e,_.fb),g=_.T(e,"QUERYPARAM");if(f)g=_.Hp(e,"VALUE"),c.set(f,g);else if(g){f=d.searchParams.get(g);if(null==f)throw new _.N(_.O,4,4044,"Query param '"+g+"' missing in playlist URI.");if(!f)throw new _.N(_.O,4,4044,"Query param '"+g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},AK=function(){this.h=0;this.a=new Map},DK=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&
|
|
6
|
+
!_.Y.rm(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.N(_.O,4,4015);b=b.slice(1);return 0===wK(b)?BK(a,b,c):CK(a,b,c)},CK=function(a,b,c){var d=EK(b);b=d.mo;var e=d.jm,f=FK(a,d.Qo,c);d=e.map(function(g){return GK(a,g,f)});b=HK(a,c,b,f);return new uK(c,1,d,b)},EK=function(a){var b=[],c=[],d=[];a=_.v(a);for(var e=a.next();!e.done;e=a.next())e=e.value,IK.test(e)?d.push(e):JK.test(e)?c.push(e):b.push(e);return{mo:b,jm:c,Qo:d}},BK=function(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=GK(a,b[e]);
|
|
7
|
+
d.push(f);if(f.name===_.Ka){var g=b[e+1];if(!g)throw new _.N(_.O,4,4044,"EXT-X-STREAM-INF is not followed by a URI.");f.attributes.push(new _.Ip(_.Mb,g));e++}}b=_.Y.oc(d,"EXT-X-DEFINE");_.Y.yj(b);b=zK(b,c);a.a=b;yK(d,a.a);return new uK(c,0,d)},KK=function(a,b,c){var d=[],e=[];e.push(new _.Ip(_.oa,"0"));e.push(new _.Ip(_.Mb,b));c.length&&e.push(new _.Ip(_.ta,c));d.push(new _.Gp(a.h++,_.Ka,e));return new uK(b,0,d)},HK=function(a,b,c,d){var e=[],f=[],g=[];c.forEach(function(h){_.Y.xm(h)?(h=GK(a,h,d),
|
|
8
|
+
"EXT-X-PART"===h.name||"EXT-X-PRELOAD-HINT"===h.name&&"PART"===_.T(h,_.Kb)?g.push(h):f.push(h)):(_.Y.Ic(f,"EXT-X-GAP")||(h=xK(h,d),h=_.qn(h,b),e.push(new vK(h,f,g))),f=[],g=[])});0<g.length&&e.push(new vK(null,f,g));return e},GK=function(a,b,c){a=_.Ps(a.h++,b);c&&yK([a],c);return a},FK=function(a,b,c){b=b.map(function(e){return GK(a,e)});_.Y.yj(b);var d=zK(b,c);b.map(function(e){return _.T(e,"IMPORT")}).filter(Boolean).forEach(function(e){var f=a.a.get(e);if(null==f)throw new _.N(_.O,4,4044,"Cannot import variable '"+
|
|
9
|
+
e+"' as it is not defined in the master playlist");d.set(e,f)});return d},LK=function(){this.a=new Map;this.f=new Map},MK=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 _.N(_.O,4,4030);}sK(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,
|
|
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}}sK(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},NK=function(a){for(;a.getPosition()<a.Ua()-1;){var b=a.getPosition();if(71===_.Zp(a))return qK(a),b}return-1},OK=function(a){function b(){d.seek(e+188);f=_.Zp(d);71!==f&&(d.seek(e+192),f=_.Zp(d));71!==f&&(d.seek(e+
|
|
11
|
+
204),f=_.Zp(d));71!==f&&c();qK(d)}function c(){throw new _.N(_.O,4,4030);}var d=new _.Wp(new DataView(a),!1),e=0,f=0;e=NK(d);0>e&&(_.Bw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Zp(d),71!==f&&c(),a=_.$p(d),8191===(a&8191))b();else if(a&16384)if(a=(_.Zp(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.Zp(d),d.skip(a)),1!==_.aq(d)>>8)b();else{d.skip(3);a=_.Zp(d)>>6;0!==a&&1!==a||c();0===_.Zp(d)&&c();a=_.Zp(d);var g=_.$p(d),h=_.$p(d);return(1073741824*((a&14)>>
|
|
12
|
+
1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},PK=function(a,b){var c=null,d=0;try{(new _.fq).M(_.Oe,_.gq).M(_.xg,_.gq).M(_.Je,_.gq).ba("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.aq(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Bw.error("Unable to find timescale in init segment!"),new _.N(_.O,4,4030,aK,c);var e=0,f=!1;try{(new _.fq).M("moof",_.gq).M("traf",_.gq).ba("tfdt",function(g){var h=d;if(0===g.version)h=_.aq(g.reader)/h;else{var l=_.aq(g.reader),m=_.aq(g.reader);
|
|
13
|
+
if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,4,4030,aK,c);return e},SK=function(a){var b=_.Hp(a,jK);if(!QK.includes(b))return RK.error("PlayReady in HLS is only supported with [",QK.join(", "),"], not",b),null;a=_.Hp(a,_.Mb);b=_.Hm(a);a=null;b=_.Mi(b.data);try{a=_.hC(_.Hr(b))}catch(c){a=b}return _.uC(_.Dd,
|
|
14
|
+
[{initDataType:_.fd,initData:a}],"")},TK=function(a){this.g=new _.L("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Ik()}},VK=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,t;return _.I(function(u){switch(u.a){case 1:a.g.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===_.Qc||d===_.Pc)return u["return"](0);g=f;if(d!==_.Oc){u.C(2);break}return _.x(u,UK(a,c,g),3);case 3:h=u.f;l=_.Mi(h.data);if(!sK(l))throw new _.N(_.O,4,4030,"AAC segment does not contain an ID3 tag.");return u["return"](MK(l));
|
|
15
|
+
case 2:if(d!==_.Og&&d!==_.Rc){u.C(4);break}m=[UK(a,c,g)];b&&m.push(UK(a,b,!0));return _.x(u,Promise.all(m),5);case 5:return n=u.f,p=n[0],q=n[1]||n[0],u["return"](PK(p.data,q.data));case 4:if(d!==_.Ng){u.C(6);break}return _.x(u,UK(a,c,g),7);case 7:return t=u.f,u["return"](OK(t.data));case 6:if(!_.Pu((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return u["return"](0);throw new _.N(_.O,4,4030);}})},UK=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=_.cD(b.Ka(),
|
|
16
|
+
b.la,b.la+2048-1,a.a.attemptParameters),e.type=2,f=_.cD(b.Ka(),b.la,b.ga,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.F(n,2),g=c?f:e,_.x(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]);_.F(n,5);return _.x(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.H(n),
|
|
17
|
+
a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.N(_.O,4,4030,"Failed to fetch the media segment.");}})},WK=function(a){this.streams=a},XK=function(a,b){a.streams.forEach(function(c){c.Uf=b})},YK=function(a,b){a.streams.forEach(function(c){c.width=b})},ZK=function(a,b){a.streams.forEach(function(c){c.height=b})},$K=function(a,b){a.streams.forEach(function(c){c.frameRate=b})},aL=function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},bL=function(a,b){var c=
|
|
18
|
+
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},cL=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},dL=function(a){this.a=a},eL=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},fL=function(a,b){var c=new Set(a.map(function(d){return d.qa}));return b.filter(function(d){return!c.has(d.qa)})},
|
|
19
|
+
hL=function(a,b){for(;a[0].qa<b[0].qa;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||gL(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&gL(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},mL=function(a,b,c,d,e){var f=b[0].length();f=rK(f).map(function(g){var h=eL(b,g)||[],l=cL(c,g)||[];g=cL(d,g)||[];var m=_.jh(iL(h)).concat(_.jh(l),_.jh(g)).filter(Boolean);jL(m);var n=m[0];m=n.qa;n=n.duration;return{configurationId:a,variants:h,
|
|
20
|
+
textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,qa:m}});e&&kL(f[0]);lL(f);return f},iL=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},kL=function(a){var b=iL(a.variants)[0].S[0].Fa;a.startTime+=b;a.endTime+=b},lL=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}},gL=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=
|
|
21
|
+
b.duration;nL(a.variants,b.variants);oL(_.Y.Hf(a),_.Y.Hf(b))},nL=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Nh(d),d]}));b.forEach(function(d){c.get(_.Y.Nh(d)).drmInfos=d.drmInfos})},oL=function(a,b){var c=new Map(a.map(function(d){return[d.zc,d]}));b.forEach(function(d){var e=c.get(d.zc);e.S=d.S;d.S.forEach(function(f){f.initSegment=e.initSegmentReference});e.segmentIndex.replace(d.S);e.rc=d.rc;e.jf=d.jf;e.duration=d.duration;e.Th=d.Th;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;e.keyId=
|
|
22
|
+
d.keyId})},jL=function(a){var b=pL(a);a.forEach(function(c){_.YC(c.segmentIndex,b);c.duration=b;c.jf=c.rc+b})},pL=function(a){var b=Infinity;_.Y.El(a).forEach(function(c){b=Math.min(b,c.duration)});return b},tL=function(a){if(!(2>a.length)&&qL(a)){a=a.map(function(e){return{playlist:e,Ph:rL(e.S[0])}});var b=a.map(function(e){return e.Ph}),c=Math.max.apply(Math,_.jh(b));b=Math.min.apply(Math,_.jh(b));if(!(1E3>c-b)){a.forEach(function(e){for(var f=e.playlist,g=e.Ph;0<f.S.length&&1E3<c-g;){e=f.S.shift();
|
|
23
|
+
var h=f.S[0];if(!h)break;sL(e,h);h=rL(h);null!=h?g=h:(e=_.Y.cj(e.Y).duration,g+=1E3*e)}});a=a.map(function(e){return e.playlist});if(a.some(function(e){return 0===e.S.length}))throw new _.N(_.O,4,4048,"Media playlists are completely out of sync.");var d=Math.min.apply(Math,_.jh(a.map(function(e){return e.S.length})));a.forEach(function(e){for(;e.S.length>d;)e.S.pop()})}}},qL=function(a){return a.every(function(b){return!!rL(b.S[0])})},rL=function(a){if(!a)return null;a=_.Y.Ta(a.Y,gK);if(!a)return null;
|
|
24
|
+
a=Date.parse(a.value);return isNaN(a)?null:a},sL=function(a,b){a&&b&&[eK,dK].forEach(function(c){if(!_.Y.Ic(b.Y,c)){var d=a.Y.filter(function(e){return e.name===c});0!==d.length&&d.forEach(function(e){b.Y.push(e)})}})},uL=function(){var a=this;this.a=this.D=null;this.h=1;this.j=new LK;this.o="";this.U=new AK;this.H=0;this.w=null;this.l=new _.dj(function(){a.dc()});this.A=_.Ub;this.f=null;this.G=new _.Yl;this.K=this.F=null;this.g=new _.L("clpp.hls.HlsParser");this.L=new Map;this.Z=new TK(this.dg.bind(this));
|
|
25
|
+
this.P=!1;this.I=null;this.O=!1;this.B=new Map;this.J=new Set},vL=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.zc})},wL=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=_.v(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.B.get(e.id);if(f&&f.Gf!==e.Gf)a.D.onError(new _.N(1,4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+e.id));var g=
|
|
26
|
+
{configurationId:a.D.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,Gf:e.Gf,endTime:e.endTime,id:e.id,type:_.qe,eventElement:null};f&&!_.M.Ci(f,g)||a.B.set(e.id,g)}return Array.from(a.B.values())},FL=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C,E,D;return _.I(function(J){switch(J.a){case 1:c=_.iu;d=xL(a,b,a.o,"");if(1===d.type){e=d.S[0].a;f=tK(e);if(!f)throw new _.N(_.O,4,4021,"Unknown file extension "+e);g="";f===c.VIDEO?g="avc1.42E01E":
|
|
27
|
+
f===c.AUDIO&&(g="mp4a.40.2");d=KK(a.U,a.o,a.a.hlsDefaultCodecs||g)}h=_.Y.On(d.Y);l=yL(h.Oc.ph);l.forEach(function(P){a.J.add(P.groupId)});return _.x(J,zL(a,h),4);case 4:m=J.f;J.C(3);break;case 5:m=J.f;case 3:n=m;p=n.Gm;q=n.periods;t=n.Zn;u=n.Fo;y=n.alternativeVariants;B=n.alternativeTextStreams;A=n.alternativeImageStreams;if(!a.D)throw new _.N(_.O,7,7001);AL(a,q);C=BL(a,p.delay,q,t);CL(a)||(a.H=p.Be,DL(a));EL(a,C,q);E=wL(a,u);D={presentationTimeline:C,periods:q,minBufferTime:0,cues:E,muxedAudioTracks:l};
|
|
28
|
+
y&&(D.alternativeVariants=y);B&&(D.alternativeTextStreams=B);A&&(D.alternativeImageStreams=A);a.g.debug("HLS playlist parsed",D);return J["return"](D)}})},yL=function(a){return a.filter(function(b){return b.name===_.Ja&&_.T(b,_.Kb)===_.ja&&!_.T(b,_.Mb)}).map(function(b){var c=_.Y.ci(b),d=_.T(b,_.Za)||_.Bg;return{groupId:_.Hp(b,_.Qa),id:_.$J++,label:_.Hp(b,_.fb),language:d,channelsCount:c,primary:"YES"===_.T(b,"DEFAULT")}})},IL=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a)return c=
|
|
29
|
+
_.Y,_.x(p,GL(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.Xh(q.audio,g),u=c.Xh(q.video,g);q=HL(a,t,u,q.bandwidth);if(!q)throw new _.N(_.O,4,4047,{message:"Video and audio are encrypted in an incompatible way.",Ip:u?u.$b():void 0,audio:t?t.$b():void 0});return q});m=a.D.configurationId;n=mL(m,l,e,f,!0);return p["return"](n)})},GL=function(a,b){var c,d,e,f,g,
|
|
30
|
+
h,l,m,n;return _.I(function(p){if(1==p.a)return c=_.iu,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 u=t.stream.streams[0];t=Object.assign({},{playlist:t.playlist},{language:u.language,channelsCount:u.channelsCount,spatialAudio:u.spatialAudio,closedCaptions:u.closedCaptions,primary:u.primary,kind:u.kind||null,groupId:u.groupId,type:u.type,codecs:u.codecs,name:u.originalId,uri:u.zc,Ee:{width:u.width,
|
|
31
|
+
height:u.height,frameRate:u.frameRate}});return JL(a,t)});return Promise.all(q)},_.x(p,g(e),2);if(3!=p.a)return h=p.f,_.x(p,g(f),3);l=p.f;KL(a,h.concat(l));m=l.filter(function(q){return q.a()===c.gh});n=l.filter(function(q){return q.a()===c.IMAGE});return p["return"]({textStreams:m,thumbStreams:n,Vj:h})})},KL=function(a,b){b.forEach(function(c){a.j.a.set(c.$b(),c)})},zL=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C;return _.I(function(E){switch(E.a){case 1:return c=_.Y,d=c.Hn(b.Oc.closedCaptions),
|
|
32
|
+
e=LL(a,b.De),_.x(E,ML(a,b),2);case 2:return f=E.f,g=Object.values(f).flat().map(function(D){return D.playlist}),h=g[0],l=c.dj(h.Y),a.A=l,NL(a,g),!CL(a)&&tL(g),a.K=c.ej(h.Y),m=c.Nn(h.Y,l,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay,a.a.liveRefreshPeriod),_.x(E,OL(a,f.qh,e),3);case 3:return n=E.f,_.x(E,PL(a,f.De,n,d),4);case 4:return p=E.f,_.x(E,QL(a,f.Bo,e),5);case 5:return q=E.f,_.x(E,RL(a,f.mg),6);case 6:return t=E.f,u=a.D.configurationId,y=mL(u,p,q,t,!CL(a)),a.D.filterAllPeriods(y),B=_.jh(f.De).concat(_.jh(f.qh)).map(function(D){return D.playlist}),
|
|
33
|
+
A=SL(a,B),C=TL(a,B,A),E["return"]({periods:y,Zn:A,Fo:C,Gm:m})}})},VL=function(a,b){var c,d,e,f,g;return _.I(function(h){if(1==h.a)return c=_.qn(b.verbatimUri,a.o),_.x(h,UL(a,c),2);d=h.f;e=d.response;f=d.text;g=e.uri;return h["return"](xL(a,f,g,b.verbatimUri))})},AL=function(a,b){CL(a)||2!==a.a.timeline.version||(a.I||(a.I=b[0].startTime),_.DE(b,-a.I))},TL=function(a,b,c){b=b.find(function(d){return null!==_.Y.Ta(d.Y,bK)});if(!b)return[];if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");
|
|
34
|
+
return b.Y.filter(function(d){return d.name===bK}).map(function(d){return _.Y.In(d,c,a.F,!CL(a))}).filter(Boolean)},SL=function(a,b){var c=b.flatMap(function(e){return e.S[0].Y});c=_.Y.Ta(c,gK);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},ML=function(a,b){var c,d,e,f,g,h;return _.I(function(l){if(1==l.a)return _.x(l,Promise.all([WL(a,b.Oc.ph),WL(a,b.Oc.Co),WL(a,b.De),WL(a,b.mg)]),
|
|
35
|
+
2);c=l.f;d=_.v(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({qh:e,Bo:f,De:g,mg:h})})},YL=function(a,b){return Promise.all(b.map(function(c){return XL(a,c)}))},LL=function(a,b){for(var c=_.Y.Ze,d=new Map,e=_.v(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.T(g,_.ja);f=_.T(g,_.Tb);var l=_.T(g,_.Bb);g=ZL(a,g);if(l){var m=_.Dp(_.tn,g);d.set(c(_.tn,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=$L(_.Nc,g),d.set(c(_.Nc,h),l));f&&(h=$L(_.Mg,g),d.set(c(_.Mg,
|
|
36
|
+
f),h))}return d},QL=function(a,b,c){return Promise.all(b.map(function(d){return aM(a,d,c)}))},RL=function(a,b){return Promise.all(b.map(function(c){return bM(a,c)}))},OL=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=[aM(a,b[0],c)];return _.x(f,d[0],2)}if(3!=f.a)return d=d.concat(b.slice(1).map(function(g){return aM(a,g,c)})),_.x(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.Go(e))})},PL=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,u;return _.I(function(y){if(1==
|
|
37
|
+
y.a){e=new Set;f=_.jh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.Hp(f[l].tag,_.oa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.x(y,cM(a,n,c,d,e),2)}if(3!=y.a)return p=y.f,q=f.map(function(B){return cM(a,B,c,d,e)}),_.x(y,Promise.all(q),3);t=y.f;t.splice(g,0,p);u=t.reduce(_.rC,[]);return y["return"](u)})},dM=function(a,b,c){var d;return _.I(function(e){if(1==e.a)return _.x(e,JL(a,{playlist:c,codecs:b.codecs,type:b.type,td:b.originalLanguage,xc:b.id,groupId:b.groupId,primary:b.primary,
|
|
38
|
+
kind:b.kind||null,name:b.label,channelsCount:b.channelsCount,spatialAudio:b.spatialAudio||!1,closedCaptions:b.closedCaptions,Ee:{width:b.width,height:b.height,frameRate:b.frameRate}}),2);d=e.f;b.bandwidth&&aL(d,b.bandwidth);return e["return"](d)})},cM=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(_.Hp(h,_.oa)),m=f.Qn(h),_.x(p,eM(a,b,m,c,d),2)):(n=p.f)?p["return"](fM(a,n,l,e)):p["return"]([])})},gM=function(a,b,c,d,e,f){var g=ZL(a,b);a.g.debug("Guessing stream type for",
|
|
39
|
+
b.toString());b=!1;var h=_.Dp(_.Mg,g),l=d+e;1!==g.length||c||h?!l&&1<g.length?(a.g.debug("Guessing multiplexed audio+video"),c=_.Mg,g=[g.join(",")]):d&&f?(a.g.debug(iK),c=_.Nc,b=!0):e?(a.g.debug(iK),c=_.Nc):(a.g.debug("Guessing video-only"),c=_.Mg):(c=_.Nc,a.g.debug(iK));return{type:c,Uj:g,nm:b}},eM=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,u,y,B,A,C,E,D,J;return _.I(function(P){if(1==P.a)return f=_.iu,g=_.Y.Ze,h=b,l=h.tag,m=h.playlist,n=_.T(l,_.ja),p=_.T(l,_.Tb),q=n?d.get(g(f.AUDIO,n))||[]:[],t=
|
|
40
|
+
p?d.get(g(f.VIDEO,p))||[]:[],u={audio:q,video:t},y=m.verbatimUri,B=u.audio.find(function(U){return U.$b()===y}),A=gM(a,l,c,u.audio.length,u.video.length,B),C=A.type,E=A.Uj,D=A.nm,J=null,D?P.C(2):_.x(P,hM(a,b,E,C,e,c),3);2!=P.a&&(J=P.f);if(null==J)return P["return"](null);u[C]=[J];C===f.AUDIO&&c&&u.video.forEach(function(U){YK(U,c.width);ZK(U,c.height);$K(U,c.frameRate)});return P["return"](u)})},fM=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.v(0<f.length?f:[null]);for(var g=
|
|
41
|
+
f.next();!g.done;g=f.next()){g=g.value;for(var h=_.v(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.vl(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):(m=HL(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},HL=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.Tl(l,m);if(!n)return null;var p=d;l={id:e?e:a.h++,language:l?l.language:
|
|
42
|
+
_.Bg,primary:!!l&&l.primary||!!m&&m.primary,audio:l,video:m,bandwidth:p,drmInfos:n,allowedByApplication:!0,allowedByKeySystem:!0};f.push(l)}return new dL(f)},aM=function(a,b,c){var d,e,f,g;return _.I(function(h){d=b;e=d.tag;f=d.playlist;g=f.verbatimUri;return h["return"](iM(a,g,function(){var l,m,n,p,q,t,u,y,B,A,C,E,D;return _.I(function(J){if(1==J.a){l=_.iu;m=_.Y.Ze;n=_.Hp(e,_.Qa);p=_.Y.Mh(_.Hp(e,_.Kb));q=_.Y.rl(e);t=c.get(m(p,n))||"";u=_.T(e,_.Za);y=_.T(e,_.fb);B=_.T(e,"DEFAULT");A=p===l.AUDIO?
|
|
43
|
+
_.Y.ci(e):null;var P=p===l.AUDIO?(P=_.T(e,"CHANNELS"))?P.includes("/JOC"):!1:!1;C=P;E="YES"===B;return _.x(J,JL(a,{playlist:f,codecs:t,type:p,td:u,primary:E,name:y,channelsCount:A,spatialAudio:C,groupId:n,kind:q,xc:null,closedCaptions:null,Ee:null}),2)}D=J.f;return J["return"](D)})}))})},bM=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"](iM(a,f,function(){var h,l,m,n,p;return _.I(function(q){if(1==q.a)return h=_.T(d,_.ta)||"jpg",l=_.T(d,
|
|
44
|
+
_.Za),m=_.T(d,_.fb),_.x(q,JL(a,{playlist:e,codecs:h,type:_.te,td:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,xc:null,groupId:null,Ee:null}),2);n=q.f;(p=_.T(d,_.oa))&&aL(n,Number(p));return q["return"](n)})}))})},ZL=function(a,b){var c=_.T(b,_.ta,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);c=_.Y.zl(c);var d=new Set,e=[];c=_.v(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.xC(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):
|
|
45
|
+
(e.push(f),d.add(g))}return e},hM=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=_.iu;n=l.verbatimUri;return p["return"](iM(a,n,function(){var q,t,u,y,B;return _.I(function(A){if(1==A.a){q=_.T(h,_.sa);t=null;d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q));var C=_.T(h,_.ja)||void 0;u=C&&a.J.has(C)?C:void 0;C=$L(d,c);if(u){var E=$L(_.Nc,c);C+=","+E}y=C;return _.x(A,JL(a,{playlist:l,codecs:y,type:d,closedCaptions:t,primary:!1,kind:null,td:null,name:null,channelsCount:null,
|
|
46
|
+
spatialAudio:!1,xc:null,groupId:null,muxedAudioId:u,Ee:f}),2)}B=A.f;return A["return"](B)})}))})},iM=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();a.j.set(b,c);return c},JL=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A,C,E,D,J,P,U,V,ra;return _.I(function(Da){if(1==Da.a){c=jM;d=kM;e=_.iu;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.td;n=f.xc;p=f.groupId;q=f.muxedAudioId;t=f.primary;u=f.kind;y=f.name;B=f.channelsCount;A=f.spatialAudio;
|
|
47
|
+
C=f.closedCaptions;E=f.Ee;D=_.Y.gi(m);if(1!==g.type)throw new _.N(_.O,4,4017);return _.x(Da,lM(a,g,l,h),2)}J=Da.f;P=a.a.lowLatencyMode?d.Gj:d.Ij;U=u;l!==e.TEXT||u||(U=_.jg);V=_.Y.dj(g.Y);ra=J.map(function(wa){var Ea=wa.S,Ma=wa.Bl,vb=wa.mimeType,ee=wa.qa,tf=Ea[0].startTime,wg=Ea[Ea.length-1].endTime,ru=wg-tf,hd=new _.HD(Ea),un=Ea[0].initSegment||null;return{id:null===n?_.$J++:n,originalId:y,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:hd.hd.bind(hd),getSegmentReference:hd.get.bind(hd),
|
|
48
|
+
adjustSegmentDurations:hd.Hd.bind(hd),getDuration:hd.getDuration.bind(hd),segmentIndex:hd,segmentLookupStrategy:P,initSegmentReference:un,mimeType:vb,codecs:h,kind:U,Th:Ma.type,encrypted:Ma.type===c.Lj,aesEncrypted:wa.aesEncrypted,keyId:Ma.keyId,language:D,originalLanguage:m||_.Bg,label:y,type:l,primary:t,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:E?E.frameRate:void 0,width:E?E.width:void 0,height:E?E.height:void 0,bandwidth:void 0,roles:[],channelsCount:B,spatialAudio:A,closedCaptions:C,
|
|
49
|
+
S:Ea,drmInfos:Ma.drmInfos,qa:ee,zc:g.verbatimUri,Uf:g.a,rc:tf,jf:wg,duration:ru,groupId:p,zp:V,muxedAudioId:q}});return Da["return"](new WK(ra))})},WL=function(a,b){var c;return _.I(function(d){if(1==d.a)return _.x(d,Promise.all(b.map(function(e){var f;return _.I(function(g){if(1==g.a)return _.x(g,mM(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))})},mM=function(a,b){var c,d,e,f,g,h,l,m,n;return _.I(function(p){if(1==p.a){c=_.Y.Am(b);
|
|
50
|
+
d=_.T(b,_.Mb,void 0,{required:c});if(!d)return p["return"](null);e=_.qn(d,a.o);f=Date.now();return _.x(p,UL(a,e),2)}g=p.f;h=g.response;l=g.text;m=Date.now();a.D.onEvent(new _.Q(oK,{detail:{duration:m-f,type:"media"}}));n=h.uri;return p["return"](xL(a,l,n,d))})},XL=function(a,b){var c,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){var p=new URL(b.streams[0].Uf);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,u=t.length-1;q={Jm:q.position,
|
|
51
|
+
Rn:t&&0<t.length?u:null}}else q=null;q&&(t=p.searchParams,u=q.Rn,t.set("_HLS_msn",q.Jm.toString()),null===u&&t.get(mK)&&t["delete"](mK),null!==u&&t.set(mK,u.toString()))}c=p.toString();return _.x(n,UL(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.$b();h=b.streams[0].Uf;l=e.uri;h!==l&&(h=l,XK(b,h));m=xL(a,f,h,g);return n["return"]({stream:b,playlist:m})})},xL=function(a,b,c,d){a=DK(a.U,b,c);a.verbatimUri=d;return a},nM=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.N(_.O,
|
|
52
|
+
4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},BL=function(a,b,c,d){var e=!0,f=null,g=0;CL(a)||(e=!1,f=0,g=b);b=a.a.timeline||{};b.type=void 0;a=new _.kD(b,f,g,!0,void 0,!!a.a.lowLatencyMode);_.nD(a,e);oM(a,c);d&&_.mD(a,d);return a},pM=function(a,b,c){a=_.Y.oc(a.Y,eK);if(1<a.length)throw new _.N(_.O,4,4020);a=a[0];if(!a)return null;var d=_.Hp(a,_.Mb),e=_.qn(d,b);b=_.Y.aj(a,null,!0);return new _.HC(function(){return[e]},b.la,b.ga,
|
|
53
|
+
c)},rM=function(a,b,c,d,e,f,g){var h=[],l={};b=_.v(qM(b.f));for(var m=b.next();!m.done;l={Mf:l.Mf},m=b.next()){var n=m.value;m=n.pi;n=n.item;var p=0===m,q=p?a:h[h.length-1],t=p?d:q.endTime,u=Number(_.T(n,_.Ha));u=t+u;p=_.Y.aj(n,p?null:q.ga,p);q=_.T(n,_.Mb);q=_.qn(q,g);l.Mf=q?[q]:[];t=new _.Kp(c,t,u,function(y){return function(){return y.Mf}}(l),p.la,p.ga,e,f,!1,null,null,null,null);if("YES"===_.T(n,"INDEPENDENT")||0===m)t.h=!0;h.push(t)}return h},sM=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.Y,q=c.a;
|
|
54
|
+
0<_.Y.oc(p,eK).length&&(n=pM(c,l,g));var t=null!=q,u=q?[q]:[];if(!t&&!a.a.lowLatencyMode)return null;a=0;q={la:0,ga:null};var y=null;t?(c=_.Y.cj(p).duration,a=e+c,q=_.Y.bj(p,b?b.ga:null)):(b=rM(b,c,d,e,f,g,l),a=b[b.length-1].endTime,y=b);h=h===_.te?_.Y.Pn(p):null;d=new _.Kp(d,e,a,function(){return u},q.la,q.ga,f,g,!1,null,h?h.ge:null,h?h.Ce:null,h?h.durationPerTile:null,y,n);d.qa=m;return d},lM=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,u,y,B;return _.I(function(A){switch(A.a){case 1:return e=_.Y,
|
|
55
|
+
f=tM,g=b.verbatimUri,h=b.S,l=e.Yl(b.Y,fK),m=[],_.x(A,uM(a,b.a,g,h,l,c,d),2);case 2:n=A.f,p=l,q=f.zo(h),t=0;case 3:if(!(t<q.length)){A.C(5);break}u=q[t];y=m[m.length-1]||null;return _.x(A,vM(a,b.a,u,p,n,c,d,y),6);case 6:B=A.f;m.push(B);p+=u.length;t++;A.C(3);break;case 5:return nM(m),A["return"](m)}})},uM=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,t,u,y,B,A;return _.I(function(C){if(1==C.a){h=d[0];if(null!=a.F)return C["return"](a.F);if(!CL(a)&&a.f)try{var E=a.j.get(c),D=E?bL(E,e)||null:null;if(!D)throw new _.N(_.O,
|
|
56
|
+
4,4030,"Segment not found in pervious playlist update.");l=D.startTime+D.Fa;a.g.debug(lK+l+".");a.F=l;return C["return"](l)}catch(J){if(m=a.j.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 _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.x(C,wM(a,f,g,h),2)}if(3!=C.a)return u=
|
|
57
|
+
C.f,y=xM.Yi(h.Y,a.o,e),B=pM(h,b,y),_.x(C,yM(a,B,h,y,u,g),3);A=C.f;a.g.debug(lK+A+".");a.F=A;return C["return"](A)})},vM=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,t,u,y,B,A,C,E,D,J,P,U,V,ra,Da,wa,Ea,Ma;return _.I(function(vb){switch(vb.a){case 1:return l=xM,m=c[0],n=null==h,_.x(vb,wM(a,f,g,m),2);case 2:p=vb.f;q=l.Kn(c,p,h?h.Em:null);t=q[q.length-1];u=xM.ua(q);y=h?h.Fm:null;B=zM(y,m.Y,a.o,d);A=pM(m,b,B)||(h?h.pm:null);C=m.qa;if(n){E=e;vb.C(3);break}return _.x(vb,AM(a,C,A,m,d,B,p,g),4);case 4:E=vb.f;case 3:D=
|
|
58
|
+
E;J=[];P=!1;for(U=0;U<c.length;U++)if(V=c[U],ra=J[J.length-1]||null,Da=0===U?0:ra.endTime,wa=d+U,(y=Ea=zM(y,V.Y,a.o,wa))&&(P=!0),Ma=sM(a,ra,V,wa,Da,D,Ea,f,b,C,A))A=Ma.initSegment,J.push(Ma);return vb["return"]({S:J,Bl:u,Em:t,aesEncrypted:P,mimeType:p,endTime:J[J.length-1].endTime,qa:C,pm:A,Fm:y})}})},zM=function(a,b,c,d){return b.some(function(e){return e.name===dK&&"NONE"===_.T(e,jK)})?null:(b=xM.Yi(b,c,d))?b:a&&a.generatedIv?Object.assign({},a,{iv:xM.bi(d)}):a},NL=function(a,b){b.forEach(function(c){var d=
|
|
59
|
+
a.j.get(c.verbatimUri);tM.Zj(c,d,!CL(a))});tM.wl(b)},AM=function(a,b,c,d,e,f,g,h){var l;return _.I(function(m){if(1==m.a)return a.L.has(b)?m["return"](a.L.get(b)):_.x(m,yM(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)})},yM=function(a,b,c,d,e,f){var g;return _.I(function(h){if(null==c.a)return h["return"](0);g=_.Y.tl(c,d);return h["return"](VK(a.Z,b,g,e,f,null!=d))})},$L=function(a,b){if(1===b.length)return b[0];var c=_.Dp(a,
|
|
60
|
+
b);if(null!=c)return c;throw new _.N(_.O,4,4025,{codecList:b});},wM=function(a,b,c,d){var e,f,g;return _.I(function(h){e=d.a;g=(f=_.Y.Ta(d.Y,eK))?_.Hp(f,_.Mb):null;return h["return"](BM(a,b,c,e,g))})},BM=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=_.Fp(f,b,c))return n["return"](g);h=_.Mk([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.x(n,a.dg(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.N(_.O,4,4021,"Unknown MIME type of: "+
|
|
61
|
+
f.join(", "));return n["return"](m.toLowerCase().split(";")[0])})},EL=function(a,b,c){c=_.Y.$l(c);"LIVE"===a.A||"EVENT"===a.A?(c=Math.max(c,b.K),isNaN(a.a.availabilityWindowOverride)||(c=a.a.availabilityWindowOverride),b.A=c):a.A===_.Ub&&(b.f=c)},DL=function(a){for(var b=0,c=_.v(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"),
|
|
62
|
+
b=_.v(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",d.type),d.segmentIndex.offset(c)):a.g.debug("Offset NOT applied to",d.type)},UL=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.Mk([b],a.a.attemptParameters),c.type=1,_.x(f,a.dg(c),2);d=f.f;e="";try{e=_.R.ea(d.data)}catch(g){throw new _.N(_.O,4,4042);}e=_.R.Ji(e);e=e.trim();return f["return"]({text:e,response:d})})},CL=function(a){return a.A===_.Ub},oM=function(a,
|
|
63
|
+
b){_.Y.Bm(b,function(c,d){_.rD(a,c.S,d.startTime)});_.jD(a.a,b[0].startTime,b[b.length-1].endTime)},CM=function(){},qM=function DM(a){var c,d,e,f,g,h;return _.Eh(DM,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.v(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.C(0):_.x(l,{pi:c,Xn:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.x(l,{pi:c,item:e,Xn:d,next:h},5):l.C(5)}c++;d=e;e=h;g=f.next();return l.C(2)})},kM={Gj:_.RB,Ij:_.QB},jM={Lj:pK,bp:"whole-segment",NONE:_.Re},IK=/^#EXT-X-DEFINE/,JK=/^#(EXT-X-DISCONTINUITY-SEQUENCE|EXT-X-ENDLIST|EXT-X-I-FRAMES-ONLY|EXT-X-MEDIA-SEQUENCE|EXT-X-PART-INF|EXT-X-PLAYLIST-TYPE|EXT-X-SERVER-CONTROL|EXT-X-TARGETDURATION|EXT-X-DATERANGE|EXT-X-VERSION)/;
|
|
64
|
+
_.r=LK.prototype;_.r.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)})};_.r.has=function(a){return this.a.has(a)};_.r.get=function(a){return this.a.get(a)||null};_.r.values=function(){return Array.from(this.a.values())};_.r.clear=function(){this.f.clear();this.a.clear()};
|
|
65
|
+
var tM={wl:function(a){var b=tM.Ml(a),c=tM.Dm(a);a.forEach(function(d){var e=d.S,f=e.findIndex(function(h){return h.qa===b}),g=e.findIndex(function(h){return h.qa===c+1});-1===g&&(g=e.length);d.S=e.slice(f,g)})},Zj:function(a,b,c){b=tM.Xl(a,b,c);a=_.v(a.S||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.Ic(c.Y,cK)&&b++,c.qa=b},Xl:function(a,b,c){var d=_.Y.Ta(a.Y,"EXT-X-DISCONTINUITY-SEQUENCE");if(d)return Number(d.value);d=tM.sm(b);if(c&&d)try{return tM.om(a,b)}catch(e){throw new _.N(_.O,4,4024,
|
|
66
|
+
"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");}return 0},sm:function(a){return 0<tM.Zl(a)},zo:function(a){if(0===a.length)return[];var b=[],c=[];a=_.v(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.Ic(d.Y,cK)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Zl:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].S;return a[a.length-1].qa},om:function(a,b){var c=_.Y.Ta(a.Y,fK);if(!c)throw tM.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),
|
|
67
|
+
Error(hK);c=Number(c.value);var d=bL(b,c);if(!d)throw tM.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(hK);return d.qa},Dm:function(a){a=a.map(function(b){return b.S[b.S.length-1].qa});return Math.min.apply(Math,_.jh(a))},Ml:function(a){a=a.map(function(b){return b.S[0].qa});return Math.max.apply(Math,_.jh(a))}};tM.g=new _.L("clpp.hls.DiscontinuityUtils");var EM={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Ng)throw new _.N(_.O,4,4041);if(_.Hp(a,jK)===kK)throw new _.N(_.O,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.uC(_.Bd,[{initDataType:_.$f,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":SK,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":SK,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.Hp(a,jK);if(!QK.includes(b))return RK.error("Widevine in HLS is only supported with [",
|
|
68
|
+
QK.join(", "),"], not",b),null;b=_.Hp(a,_.Mb);b=_.Hm(b);b=_.Mi(b.data);b=_.uC(_.Fd,[{initDataType:_.fd,initData:b}],"");if(a=_.T(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},QK=["SAMPLE-AES",kK],RK=new _.L("clpp.hls.DrmParser");var xM={Kn:function(a,b,c){if(_.Y.Ic(a[0].Y,dK)||null===c)return c=xM.Zi(a,b),0===c.length?[{type:_.Re,drmInfos:[],keyId:null}]:c;a=xM.Zi(a,b);return[c].concat(_.jh(a))},ua:function(a){if(0===a.length)return{type:_.Re,drmInfos:[],keyId:null};if(a.some(function(c){return"whole-segment"===c.type})||a.every(function(c){return c.type===_.Re}))return a[0];a=a.filter(function(c){return c.type===pK});var b=_.Hi(a.flatMap(function(c){return c.drmInfos}));return{keyId:a[a.length-1].keyId,type:pK,drmInfos:b}},
|
|
69
|
+
Zi:function(a,b){return xM.Fl(a).map(function(c){return xM.Mn(c.Y,b)}).filter(Boolean)},Fl:function(a){return a.filter(function(b){return _.Y.Ic(b.Y,dK)})},Mn:function(a,b){var c=_.Y.oc(a,dK).filter(function(e){return"AES-128"!==_.Hp(e,jK)});if(0===c.length)return null;var d=_.Hp(c[0],jK);if(1===c.length&&"NONE"===d)return{type:_.Re,drmInfos:[],keyId:null};d=c.map(function(e){return _.Hp(e,jK)});if(!d.every(function(e){return"SAMPLE-AES"===e})&&!d.every(function(e){return e===kK}))throw xM.g.warn("EXT-X-KEY methods "+
|
|
70
|
+
d.join(", ")+" are incompatible."),new _.N(_.O,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");c=c.map(function(e){var f=_.T(e,"KEYFORMAT","identity"),g=EM[f]||null;(e=g?g(e,b):null)||xM.g.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===c.length)throw new _.N(_.O,4,4026);return{keyId:c.map(function(e){return e.keyIds}).reduce(function(e,f){return e.concat(f)},[]).reverse()[0]||null,type:pK,drmInfos:c}},wp:function(){return{type:_.Re,drmInfos:[],keyId:null}},
|
|
71
|
+
Yi:function(a,b,c){a=_.Y.oc(a,dK)[0];if(!a||"AES-128"!==_.Hp(a,jK))return null;var d=xM.Rl(a,c);c=d.iv;d=d.generatedIv;return{method:"AES-128",url:_.qn(_.Hp(a,_.Mb),b),iv:c,generatedIv:d}},bi:function(a){return _.Gm(new Uint8Array(12),new Uint8Array([a>>24&255,a>>16&255,a>>8&255,a&255]))},Rl:function(a,b){var c=_.T(a,"IV","");if(c)return{iv:_.Dm((c||"0x").slice(2)),generatedIv:!1};c=_.T(a,"KEYFORMAT");return null==c||"identity"===c?{iv:xM.bi(b),generatedIv:!0}:{iv:null,generatedIv:!1}}};xM.g=new _.L("clpp.hls.EncryptionUtils");WK.prototype.length=function(){return this.streams.length};WK.prototype.f=function(){return this.streams[0].groupId};WK.prototype.a=function(){return this.streams[0].type};WK.prototype.$b=function(){return this.streams[0].zc};dL.prototype.length=function(){return this.a.length};_.r=uL.prototype;_.r.configure=function(a){this.a=a;this.Z.a=a};_.r.setCurrentVariant=function(a){this.w=a};_.r.start=function(a,b){var c=this,d,e,f,g,h,l,m;return _.I(function(n){if(1==n.a){if(c.P)throw Error("start() may be called only once!");c.P=!0;c.D=b;d=Date.now();return _.x(n,UL(c,a),2)}if(3!=n.a)return e=n.f,f=e.response,g=e.text,h=Date.now(),c.D.onEvent(new _.Q(oK,{detail:{duration:h-d,type:"master"}})),c.o=f.uri,_.x(n,FL(c,g),3);l=n.f;c.f=l;m=c.H;c.l&&0<m&&c.l.ha(m);return n["return"](l)})};
|
|
72
|
+
_.r.requestStop=function(){this.O=!0};_.r.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)};
|
|
73
|
+
_.r.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(CL(a)||!b)return p["return"]();c=b.presentationTimeline;"LIVE"===a.A&&(a.F=null);d=Array.from(a.j.values());a.a.lowLatencyMode&&null!==a.w&&(e=vL(a),d=d.filter(function(q){return e.includes(q.$b())}));return _.x(p,YL(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),NL(a,g),_.x(p,IL(a,f),3);case 3:h=p.f;fL(b.periods,h).forEach(function(q){a.D.filterNewPeriod(q)});AL(a,h);l=SL(a,
|
|
74
|
+
g);m=TL(a,g,l);b.cues=wL(a,m);hL(b.periods,h);oM(c,h);if(n=_.Y.lm(g))!0!==a.a.keepTimelineLive&&(a.A=_.Ub,_.nD(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.O){p.C(4);break}return _.x(p,a.stop(),4);case 4:return p["return"](b)}})};
|
|
75
|
+
_.r.loadVariant=function(a,b){var c=this,d,e,f,g,h,l,m,n,p,q,t,u,y,B,A;return _.I(function(C){if(1==C.a){d=a.id;if(e=c.f.periods.find(function(E){return E.id===b}))if(f=e.variants.find(function(E){return E.id===d}))return C["return"](f);g=c.f.alternativeVariants.find(function(E){return E.id===d});if(!g)throw new _.pi("No alternative variant with id: "+d);h=g;m=l=null;h.audio&&(n=h.audio,l=iM(c,n.verbatimUri,function(){var E;return _.I(function(D){if(1==D.a)return _.x(D,VL(c,n),2);E=D.f;return D["return"](dM(c,
|
|
76
|
+
n,E))})}));h.video&&(p=h.video,m=iM(c,p.verbatimUri,function(){var E;return _.I(function(D){if(1==D.a)return _.x(D,VL(c,p),2);E=D.f;return D["return"](dM(c,p,E))})}));return _.x(C,l,2)}if(3!=C.a)return q=C.f,_.x(C,m,3);t=C.f;if(u=HL(c,q,t,h.bandwidth,h.id))B=c.D.configurationId,A=mL(B,[u],[],[],!CL(c)),c.D.filterAllPeriods(A),A.forEach(function(E,D){c.f.periods[D].variants.push(E.variants[0]);b===c.f.periods[D].id&&(y=E.variants[0])});if(!y)throw new _.pi("Could load variant with id: "+d);return C["return"](y)})};
|
|
77
|
+
_.r.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.C(2);g=c.f.alternativeTextStreams.find(function(n){return n.id===a})||null;if(!g)throw new _.pi(_.xB+a);h=g;return _.x(m,iM(c,h.verbatimUri,function(){var n;return _.I(function(p){if(1==p.a)return _.x(p,VL(c,h),2);n=p.f;return p["return"](dM(c,h,n))})}),
|
|
78
|
+
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 _.pi(_.xB+a);return m["return"](d)})};_.r.dc=function(){var a=this,b,c;return _.I(function(d){if(1==d.a){a.g.debug(_.HB);if(!a.D)return d["return"]();_.F(d,2);return _.x(d,a.update(),4)}if(2!=d.a)return a.l&&0<a.H&&a.l.ha(a.H),_.G(d,0);b=_.H(d);if(!(b instanceof _.N))throw b;a.D&&(a.D.onError(b),c=b,1===c.severity&&a.l&&a.l.ha(.1));_.z(d)})};
|
|
79
|
+
_.r.dg=function(a){if(!this.G)throw new _.N(_.O,7,7001);a=this.D.networkingEngine.fetch(a);_.$l(this.G,a);return a.T};_.w(CM,_.Tu);CM.prototype.install=function(){_.Rv.m3u8=uL;_.Qv[_.Il]=uL;_.Qv[nK]=uL};CM.prototype.uninstall=function(){_.jE("m3u8");_.kE(_.Il);_.kE(nK)};CM.prototype.id=function(){return"hls"};_.K("clpp.hls.HlsComponent",CM);};
|
|
81
80
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
82
81
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
83
82
|
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().va())&&a.language&&a.language.toLowerCase()},
|
|
7
|
-
_.
|
|
2
|
+
var f=function(window){var uU=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.M.R(a)){a:{var b=a.info;if(_.M.ia(b)&&(b=b.toLowerCase().match(/lang:(\w+)/))&&b[1]){b=b[1].toLowerCase();break a}b=null}this.f=b;a=a.data;this.a=_.M.ia(a)?a:null}},wU=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.ti;this.h=(a=_.Av(_.Kc))?new a(this.m.getConfiguration()):null;this.g=new _.L("clpp.hlssmpte.ImageCueHandler");this.f=null;vU(this)},vU=function(a){a.a.one(a.m,_.De,function(){return xU(a)})},
|
|
3
|
+
xU=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.zc,function(d){return yU(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Le}).forEach(function(d){yU(a,{track:d})});!zU(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."),AU(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
|
+
zU=function(a){return a.some(function(b){return b.kind===_.Le})},AU=function(a,b){var c=a.m.getTrackManager(),d=c.na(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ga(d)};a.a.on(b.textTracks,_.zc,function(g){g.track.kind===_.Le&&(a.a.off(b.textTracks,_.zc,f),f())});c.Ga(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},yU=function(a,b){var c=b.track;c.kind===_.Le&&(a.g.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.pe,a.a.on(c,_.Ld,function(d){return BU(a,d)}))},BU=function(a,b){var c=CU(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 uU(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.R.eb(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)}}})},CU=function(a){return(a=
|
|
6
|
+
a.m.getTrackManager().va())&&a.language&&a.language.toLowerCase()},DU=function(){this.a=null;this.f=!1},EU=function(){};wU.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.w(DU,_.Tv);DU.prototype.onPlayerCreated=function(){};DU.prototype.onContentWillLoad=function(a){if(this.f=_.nj()){var b=a.getConfiguration();b=_.M.ib(b.hlssmpte||{});_.M.wi(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.M.xa(b.timestampOffset)||(b.timestampOffset=0);this.a=new wU(a,b.patchMetadataTrack,b.timestampOffset)}};DU.prototype.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.C(0);a.a=null;_.z(b)})};DU.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.K("clpp.hlssmpte.HlsSmptePlugin",DU);DU.Id="hlssmpte";EU.prototype.create=function(){return new DU};_.To(new EU);};
|
|
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));}
|