@castlabs/prestoplay 6.25.2-beta.7 → 6.25.2
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 +4 -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 +105 -105
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +329 -329
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +88 -88
- package/cjs/cl.externs.js +31 -31
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +291 -289
- package/cjs/cl.muxdata.js +9 -9
- package/cjs/cl.persistent.js +10 -10
- package/cjs/cl.playlist.js +4 -4
- package/cjs/cl.sessions.js +8 -8
- package/cjs/cl.simid.js +4 -4
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +11 -11
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +3 -3
- package/cjs/cl.verimatrix.js +2 -2
- package/cjs/cl.vimond.js +8 -8
- package/cjs/cl.vr.js +7 -7
- package/cjs/cl.vtt.js +2 -2
- package/cjs/cl.yospace.js +2 -2
- package/cjs/cl.youbora.js +17 -17
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +84 -84
- package/cl.conviva.js +26 -26
- package/cl.core.js +178 -178
- package/cl.crypto.js +8 -8
- package/cl.dash.js +82 -82
- package/cl.externs.js +31 -31
- 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 -18
- package/cl.mediatailor.js +3 -3
- package/cl.mse.js +243 -243
- package/cl.muxdata.js +6 -6
- package/cl.persistent.js +2 -2
- package/cl.playlist.js +4 -4
- package/cl.sessions.js +2 -2
- package/cl.simid.js +1 -1
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +9 -9
- package/cl.tizen.js +54 -54
- package/cl.ttml.js +2 -2
- package/cl.verimatrix.js +1 -1
- package/cl.vimond.js +3 -3
- package/cl.vr.js +2 -2
- package/cl.vtt.js +2 -2
- package/cl.yospace.js +2 -2
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
- package/typings.d.ts +9 -0
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 _.kk;this.j=null},
|
|
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=_.er(_.Qd,{id:
|
|
7
|
-
_.I("clpp.freewheel.FreeWheelPlugin",
|
|
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.
|
|
2
|
+
var f=function(window){var CV="clpp-freewheel",DV="clpp.freewheel.AdsManagerFactory",EV="freewheel",FV=function(){this.f=this.a=null},GV=function(){},HV=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""}},IV=function(a,b,c){this.h=a;this.f=b;this.a=c},JV=function(a){this.a=a},KV=function(a){this.g=new _.J("clpp.freewheel.AdsManager");this.m=a;this.h=new _.gi;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.kk;this.j=null},LV=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.eg&&b.push("serverUrl");typeof a.profileId!==_.eg&&b.push("profileId");typeof a.videoAssetId!==_.eg&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.N(1,9,12001,{missingKeys:b.join(", ")});},MV=function(){var a,b,c,d;return _.H(function(e){if(1==e.a)return a=new _.Xu,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)})},PV=function(a){return _.H(function(b){if(a.B.length)return NV(a),a.f=a.B.shift(),a.f.play(),b.D(0);OV(a);return _.x(b,a.m.a.play(),0)})},QV=function(a){a.A.length?(NV(a),a.f=a.A.shift(),a.f.play()):OV(a)},NV=function(a){var b=a.m.he(EV).td();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(CV),a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},OV=function(a){var b=a.m.he(EV).td();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},RV=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 IV(a.a,c,d)});a.m.trigger(new _.K(b,d))},SV=function(){this.Ca=new _.J(DV)};_.w(FV,_.bw);_.r=FV.prototype;
|
|
6
|
+
_.r.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.er(_.Qd,{id:CV}),this.f=_.er(_.Jg,{"class":_.md}),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 EV};_.r.td=function(){return this.a};_.r.Ml=function(){return this.f};
|
|
7
|
+
_.I("clpp.freewheel.FreeWheelPlugin",FV);FV.prototype.getAdVideo=FV.prototype.Ml;FV.prototype.getAdContainer=FV.prototype.td;FV.Id=EV;FV.AD_CONTAINER_ID=CV;GV.prototype.create=function(){return new FV};_.Yt(new GV);_.r=IV.prototype;_.r.xb=function(){return"FreeWheel AdManager SDK"};_.r.yb=function(){return tv.freewheel.SDK.version};_.r.Cb=function(){return 0};_.r.getId=function(){return this.a?this.a.getAdId():""};_.r.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.eg?a:""};_.r.bc=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.fc=function(){return!1};_.r.zb=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
9
|
_.r.ob=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.r.nb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.r.Ua=function(){return 0};_.r.Va=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.Va()){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 _.H(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{
|
|
17
|
-
_.u(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
|
-
_.kc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:
|
|
24
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.r.
|
|
25
|
-
_.r.
|
|
26
|
-
|
|
10
|
+
_.r.getPodIndex=function(){switch(this.Va()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.r.Ob=function(){switch(this.Va()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.r.Bb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.r.pb=function(){return this.f.getAdCount()};_.r.getWrapperAdIds=function(){return[]};_.r.canSeek=function(){return!1};
|
|
11
|
+
_.r.getWrapperAdSystems=function(){return[]};_.r.getWrapperCreativeIds=function(){return[]};_.r.ec=function(){return null};IV.prototype.getVideoElement=IV.prototype.ec;IV.prototype.getWrapperCreativeIds=IV.prototype.getWrapperCreativeIds;IV.prototype.getWrapperAdSystems=IV.prototype.getWrapperAdSystems;IV.prototype.canSeek=IV.prototype.canSeek;IV.prototype.getWrapperAdIds=IV.prototype.getWrapperAdIds;IV.prototype.getSequenceLength=IV.prototype.pb;IV.prototype.getPositionInSequence=IV.prototype.Bb;
|
|
12
|
+
IV.prototype.getPodTimeOffset=IV.prototype.Ob;IV.prototype.getPodIndex=IV.prototype.getPodIndex;IV.prototype.getPodType=IV.prototype.Va;IV.prototype.getMediaBitrate=IV.prototype.Ua;IV.prototype.getMediaHeight=IV.prototype.nb;IV.prototype.getMediaWidth=IV.prototype.ob;IV.prototype.getMediaUrl=IV.prototype.getMediaUrl;IV.prototype.getClickThroughUrl=IV.prototype.zb;IV.prototype.isBumper=IV.prototype.fc;IV.prototype.getSkipTimeOffset=IV.prototype.getSkipTimeOffset;IV.prototype.getPosition=IV.prototype.getPosition;
|
|
13
|
+
IV.prototype.getDuration=IV.prototype.getDuration;IV.prototype.getTitle=IV.prototype.getTitle;IV.prototype.getAdvertiserName=IV.prototype.getAdvertiserName;IV.prototype.getAdSystem=IV.prototype.getAdSystem;IV.prototype.getApiFramework=IV.prototype.getApiFramework;IV.prototype.getSourceId=IV.prototype.bc;IV.prototype.getCreativeId=IV.prototype.getCreativeId;IV.prototype.getId=IV.prototype.getId;IV.prototype.getTechnology=IV.prototype.Cb;IV.prototype.getAdManagerVersion=IV.prototype.yb;
|
|
14
|
+
IV.prototype.getAdManagerName=IV.prototype.xb;JV.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()}})};JV.prototype.Rb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};JV.prototype.Qb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
15
|
+
JV.prototype.hasPostroll=JV.prototype.Qb;JV.prototype.hasPreroll=JV.prototype.Rb;JV.prototype.getCuePoints=JV.prototype.getCuePoints;_.r=KV.prototype;
|
|
16
|
+
_.r.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.H(function(m){if(1==m.a){b=a.m.getConfiguration().freewheel||{};try{LV(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!==_.eg&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,MV(),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
|
+
_.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,HV(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Re&&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=_.u(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.Qm.bind(a));a.h.on(a.m,_.rg,a.zk.bind(a));a.h.on(a.m,_.bg,a.yk.bind(a));a.a.submitRequest();return m["return"](a.l)})};_.r.start=function(){var a=this;return _.H(function(b){return _.x(b,PV(a),0)})};_.r.kd=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.gd=function(){return!0};_.r.Dc=function(){var a=this;return _.H(function(b){a.h.release();a.j&&(a.j.stop(),a.j=null);OV(a);a.a&&(a.a.dispose(),a.a=null);_.y(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 _.K(_.Cc,{adsTimeline:new JV(this.a)})),this.j=new _.Vu(this.m.getSurface(),function(c,d){return b.a.resize(c,d)},this.m.he(EV).f);else this.m.onError(new _.N(1,9,10003,{errorType:0},
|
|
21
|
+
void 0));this.l.resolve()};_.r.Bn=function(a){RV(this,_.hc,a);this.j.start()};_.r.An=function(a){this.f=null;a=a.slot;RV(this,_.ic);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:PV(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:OV(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:QV(this)}};
|
|
22
|
+
_.r.Qm=function(a){var b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:RV(this,_.xc,a);RV(this,_.qc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:RV(this,_.zc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:RV(this,_.mc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:RV(this,_.sc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:RV(this,_.Ac,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:RV(this,_.lc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:RV(this,
|
|
23
|
+
_.kc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:RV(this,_.tc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:RV(this,_.vc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:RV(this,_.wc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:RV(this,_.jc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:RV(this,_.uc,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.zk=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();NV(this);this.f.play()}}};
|
|
25
|
+
_.r.yk=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Hq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Gq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Aq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);QV(this);break;case _.tq:case _.Eq:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};KV.prototype.getPosition=KV.prototype.getPosition;KV.prototype.setVolume=KV.prototype.setVolume;
|
|
26
|
+
KV.prototype.getVolume=KV.prototype.getVolume;KV.prototype.skip=KV.prototype.skip;KV.prototype.pause=KV.prototype.pause;KV.prototype.resume=KV.prototype.resume;SV.prototype.name=function(){return DV};SV.prototype.a=function(a,b){return a.namespace()!==_.sd&&b&&b.freewheel?window.tv&&tv.freewheel&&tv.freewheel.SDK?!0:(this.Ca.warn("FreeWheel SDK is not loaded."),!1):!1};SV.prototype.create=function(a){return new KV(a)};_.$q(new SV);};
|
|
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,81 +1,81 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
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!");}this.a=a;this.verbatimUri="";this.type=b;this.fa=c;this.U=1===b?d:null},
|
|
4
|
-
function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},
|
|
5
|
-
g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},
|
|
6
|
-
1,d,b)},
|
|
7
|
-
b,c){var d=[],e=[];e.push(new _.yj(_.pa,"0"));e.push(new _.yj(_.Ob,b));c.length&&e.push(new _.yj(_.ua,c));d.push(new _.wj(a.h++,_.
|
|
8
|
-
b);c&&
|
|
9
|
-
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},
|
|
10
|
-
if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}
|
|
11
|
-
192),f=_.hn(d));71!==f&&(d.seek(e+204),f=_.hn(d));71!==f&&c();
|
|
12
|
-
h=_.jn(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},
|
|
13
|
-
h;else{var l=_.kn(g.reader),m=_.kn(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,4,4030,
|
|
14
|
-
try{a=_.wD(_.Yo(b))}catch(c){a=b}return _.KD(_.Ed,[{initDataType:_.hd,initData:a}],"")},
|
|
15
|
-
"AAC segment does not contain an ID3 tag.");return v["return"](
|
|
16
|
-
h,l,m;return _.H(function(n){switch(n.a){case 1:return d=b.f(),e=_.qE(b.cb(),b.Da,b.Da+2048-1,a.a.attemptParameters),e.type=2,f=_.qE(b.cb(),b.Da,b.oa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.C(n,2),g=c?f:e,_.x(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.
|
|
17
|
-
5);return _.x(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.
|
|
18
|
-
function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},
|
|
19
|
-
b){var c=new Set(a.map(function(d){return d.na}));return b.filter(function(d){return!c.has(d.na)})},
|
|
20
|
-
_.gh(g)).filter(Boolean);
|
|
21
|
-
c.startTime+c.duration}},
|
|
22
|
-
d.
|
|
23
|
-
this.C=null;this.g=new _.J("clpp.hls.HlsParser");this.L=new Map;this.Y=new
|
|
24
|
-
4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+e.id));var g={configurationId:a.
|
|
25
|
-
4,4021,"Unknown file extension "+e);g="";f===c.VIDEO?g="avc1.42E01E":f===c.AUDIO&&(g="mp4a.40.2");d=
|
|
26
|
-
{presentationTimeline:G,periods:q,minBufferTime:0,cues:B,muxedAudioTracks:l};z&&(F.alternativeVariants=z);A&&(F.alternativeTextStreams=A);
|
|
27
|
-
|
|
28
|
-
n=
|
|
29
|
-
type:v.type,codecs:v.codecs,name:v.originalId,uri:v.
|
|
30
|
-
_.Y,d=c.
|
|
31
|
-
A=_.gh(f.
|
|
32
|
-
if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.fa.filter(function(d){return d.name===
|
|
33
|
-
1E3},
|
|
34
|
-
g);if(l){var m=_.sj(_.pj,g);d.set(c(_.pj,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=
|
|
35
|
-
g,c)})),_.x(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.
|
|
36
|
-
e.a)return _.x(e,
|
|
37
|
-
_.x(p,
|
|
38
|
-
|
|
39
|
-
c.height);
|
|
40
|
-
[],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.
|
|
41
|
-
M.a){l=_.Rq;m=_.Y.
|
|
42
|
-
e=c.playlist;f=e.verbatimUri;return g["return"](
|
|
43
|
-
_.Y.
|
|
44
|
-
|
|
45
|
-
e=_.Rq;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.
|
|
46
|
-
null;return{id:null===n?_.
|
|
47
|
-
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:
|
|
48
|
-
null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},
|
|
49
|
-
if(a.a.lowLatencyMode&&a.K&&a.K.
|
|
50
|
-
return n["return"]({stream:b,playlist:m})})},
|
|
51
|
-
},
|
|
52
|
-
m.value;m=n.
|
|
53
|
-
oa:null};var z=null;t?(c=_.Y.
|
|
54
|
-
q.length)){
|
|
55
|
-
a.j.get(c))n=m.streams[0].U[0].position,G=m.streams[m.streams.length-1].U,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 _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.x(G,
|
|
56
|
-
b,c,d,e,f,g,h){var l,m,n,p,q,t,v,z,A,
|
|
57
|
-
a.o,Ca))&&(R=!0),
|
|
58
|
-
m.a)return a.L.has(b)?m["return"](a.L.get(b)):_.x(m,
|
|
59
|
-
d.a;g=(f=_.Y.bb(d.fa,
|
|
60
|
-
a.A?(c=Math.max(c,b.K),isNaN(a.a.availabilityWindowOverride)||(c=a.a.availabilityWindowOverride),b.A=c):a.A===_.Wb&&(b.f=c)},
|
|
61
|
-
d.type),d.segmentIndex.offset(c)):a.g.debug("Offset NOT applied to",d.type)},
|
|
62
|
-
|
|
63
|
-
item:e,
|
|
64
|
-
var
|
|
65
|
-
4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");}return 0},
|
|
66
|
-
Error(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
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=_.P(e,"KEYFORMAT","identity"),g=
|
|
70
|
-
|
|
71
|
-
_.r.requestStop=function(){this.N=!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.
|
|
72
|
-
_.r.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:b=a.f;if(
|
|
73
|
-
g);m=
|
|
74
|
-
_.r.loadVariant=function(a,b){var c=this,d,e,f,g,h,l,m,n,p,q,t,v,z,A,
|
|
75
|
-
n,B))})}));h.video&&(p=h.video,m=
|
|
76
|
-
_.r.loadTextStream=function(a,b){var c=this,d,e,f,g,h,l;return _.H(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.
|
|
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 _.Zi(_.PC+a);return m["return"](d)})};_.r.
|
|
78
|
-
_.r.
|
|
2
|
+
var f=function(window){var iL="Could not parse MP4 segment start time.",jL="EXT-X-DATERANGE",kL="EXT-X-DISCONTINUITY",lL="EXT-X-KEY",mL="EXT-X-MAP",nL="EXT-X-MEDIA-SEQUENCE",oL="Failed to infer discontinuity number",pL="Guessing audio-only",qL="METHOD",rL="SAMPLE-AES-CTR",sL="Setting playlist start time to ",tL="application/vnd.apple.mpegurl",uL="manifestloaded",vL="sample",wL=function(a){if(1>a.a)throw _.gn();--a.a},xL=function(a){a=_.tj(a)||"";return null!=_.uj.video[a]?_.Jg:null!=_.uj.audio[a]?_.Pc:null},yL=function(a,
|
|
3
|
+
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!");}this.a=a;this.verbatimUri="";this.type=b;this.fa=c;this.U=1===b?d:null},zL=function(a,b,c){c=void 0===c?[]:c;this.fa=b;this.a=a;this.f=c;this.na=-1},AL=function(a){return a.some(function(b){return b.startsWith("#EXT-X-TARGETDURATION")})?1:0},BL=function(a,b){return a.replace(/\{\$([a-zA-Z0-9_-]+)\}/g,
|
|
4
|
+
function(c,d){var e=b.get(d);if(null==e)throw new _.N(_.O,4,4044,"Undefined variable '"+d+"'");return e})},CL=function(a,b){a.forEach(function(c){c.attributes.forEach(function(d){d.value=BL(d.value,b)})})},DL=function(a,b){var c=new Map,d=new URL(b);a.forEach(function(e){var f=_.P(e,_.hb),g=_.P(e,"QUERYPARAM");if(f)g=_.xj(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 '"+
|
|
5
|
+
g+"' has no associated value in playlist URI.");c.set(g,decodeURIComponent(f))}});return c},EL=function(){this.h=0;this.a=new Map},HL=function(a,b,c){b=b.trim().split(/\n+/m).map(function(d){return d.trim()}).filter(function(d){return d.length&&!_.Y.qm(d)});if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.N(_.O,4,4015);b=b.slice(1);return 0===AL(b)?FL(a,b,c):GL(a,b,c)},GL=function(a,b,c){var d=IL(b);b=d.lo;var e=d.gm,f=JL(a,d.No,c);d=e.map(function(g){return KL(a,g,f)});b=LL(a,c,b,f);return new yL(c,
|
|
6
|
+
1,d,b)},IL=function(a){var b=[],c=[],d=[];a=_.u(a);for(var e=a.next();!e.done;e=a.next())e=e.value,ML.test(e)?d.push(e):NL.test(e)?c.push(e):b.push(e);return{lo:b,gm:c,No:d}},FL=function(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=KL(a,b[e]);d.push(f);if(f.name===_.Ma){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 _.yj(_.Ob,g));e++}}b=_.Y.pc(d,"EXT-X-DEFINE");_.Y.qj(b);b=DL(b,c);a.a=b;CL(d,a.a);return new yL(c,0,d)},OL=function(a,
|
|
7
|
+
b,c){var d=[],e=[];e.push(new _.yj(_.pa,"0"));e.push(new _.yj(_.Ob,b));c.length&&e.push(new _.yj(_.ua,c));d.push(new _.wj(a.h++,_.Ma,e));return new yL(b,0,d)},LL=function(a,b,c,d){var e=[],f=[],g=[];c.forEach(function(h){_.Y.wm(h)?(h=KL(a,h,d),"EXT-X-PART"===h.name||"EXT-X-PRELOAD-HINT"===h.name&&"PART"===_.P(h,_.Mb)?g.push(h):f.push(h)):(_.Y.wd(f,"EXT-X-GAP")||(h=BL(h,d),h=_.Y.nd(b,h),e.push(new zL(h,f,g))),f=[],g=[])});0<g.length&&e.push(new zL(null,f,g));return e},KL=function(a,b,c){a=_.Kj(a.h++,
|
|
8
|
+
b);c&&CL([a],c);return a},JL=function(a,b,c){b=b.map(function(e){return KL(a,e)});_.Y.qj(b);var d=DL(b,c);b.map(function(e){return _.P(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 '"+e+"' as it is not defined in the master playlist");d.set(e,f)});return d},PL=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},QL=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===
|
|
9
|
+
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},RL=function(){this.a=new Map;this.f=new Map},SL=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);}QL(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]);
|
|
10
|
+
if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}QL(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},TL=function(a){for(;a.getPosition()<a.Ta()-1;){var b=a.getPosition();if(71===_.hn(a))return wL(a),b}return-1},UL=function(a){function b(){d.seek(e+188);f=_.hn(d);71!==f&&(d.seek(e+
|
|
11
|
+
192),f=_.hn(d));71!==f&&(d.seek(e+204),f=_.hn(d));71!==f&&c();wL(d)}function c(){throw new _.N(_.O,4,4030);}var d=new _.en(new DataView(a),!1),e=0,f=0;e=TL(d);0>e&&(_.Lw.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.hn(d),71!==f&&c(),a=_.jn(d),8191===(a&8191))b();else if(a&16384)if(a=(_.hn(d)&48)>>4,0!==a&&2!==a||c(),3===a&&(a=_.hn(d),d.skip(a)),1!==_.kn(d)>>8)b();else{d.skip(3);a=_.hn(d)>>6;0!==a&&1!==a||c();0===_.hn(d)&&c();a=_.hn(d);var g=_.jn(d),
|
|
12
|
+
h=_.jn(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},VL=function(a,b){var c=null,d=0;try{(new _.pn).M(_.Ne,_.qn).M(_.tg,_.qn).M(_.He,_.qn).aa("mdhd",function(g){g.reader.skip(0===g.version?8:16);d=_.kn(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Lw.error("Unable to find timescale in init segment!"),new _.N(_.O,4,4030,iL,c);var e=0,f=!1;try{(new _.pn).M("moof",_.qn).M("traf",_.qn).aa("tfdt",function(g){var h=d;if(0===g.version)h=_.kn(g.reader)/
|
|
13
|
+
h;else{var l=_.kn(g.reader),m=_.kn(g.reader);if(!(2097151>=l||h>=Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=l/h*Math.pow(2,32)+m/h}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.N(_.O,4,4030,iL,c);return e},YL=function(a){var b=_.xj(a,qL);if(!WL.includes(b))return XL.error("PlayReady in HLS is only supported with [",WL.join(", "),"], not",b),null;a=_.xj(a,_.Ob);b=_.yv(a);a=null;b=_.Oj(b.data);
|
|
14
|
+
try{a=_.wD(_.Yo(b))}catch(c){a=b}return _.KD(_.Ed,[{initDataType:_.hd,initData:a}],"")},ZL=function(a){this.g=new _.J("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Yj()}},aM=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,t;return _.H(function(v){switch(v.a){case 1:a.g.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===_.Sc||d===_.Rc)return v["return"](0);g=f;if(d!==_.Qc){v.D(2);break}return _.x(v,$L(a,c,g),3);case 3:h=v.f;l=_.Oj(h.data);if(!QL(l))throw new _.N(_.O,4,4030,
|
|
15
|
+
"AAC segment does not contain an ID3 tag.");return v["return"](SL(l));case 2:if(d!==_.Lg&&d!==_.Tc){v.D(4);break}m=[$L(a,c,g)];b&&m.push($L(a,b,!0));return _.x(v,Promise.all(m),5);case 5:return n=v.f,p=n[0],q=n[1]||n[0],v["return"](VL(p.data,q.data));case 4:if(d!==_.Kg){v.D(6);break}return _.x(v,$L(a,c,g),7);case 7:return t=v.f,v["return"](UL(t.data));case 6:if(!_.xu((d.split("/")[0]||"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.N(_.O,4,4030);}})},$L=function(a,b,c){var d,e,f,g,
|
|
16
|
+
h,l,m;return _.H(function(n){switch(n.a){case 1:return d=b.f(),e=_.qE(b.cb(),b.Da,b.Da+2048-1,a.a.attemptParameters),e.type=2,f=_.qE(b.cb(),b.Da,b.oa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.C(n,2),g=c?f:e,_.x(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.E(n);if(7001===l.code||c)throw l;a.g.warn("Unable to fetch a partial HLS segment! Falling back to a full segment request, which is expensive! Your server should support Range requests and CORS pre-flights.",e.uris[0]);_.C(n,
|
|
17
|
+
5);return _.x(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.E(n),a.g.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.N(_.O,4,4030,"Failed to fetch the media segment.");}})},bM=function(a){this.streams=a},cM=function(a,b){a.streams.forEach(function(c){c.Sf=b})},dM=function(a,b){a.streams.forEach(function(c){c.width=b})},eM=function(a,b){a.streams.forEach(function(c){c.height=b})},fM=function(a,b){a.streams.forEach(function(c){c.frameRate=b})},gM=
|
|
18
|
+
function(a,b){a.streams.forEach(function(c){c.bandwidth=b})},hM=function(a,b){var c=a.streams.find(function(d){d=d.U;return d[0].position<=b&&b<=d[d.length-1].position});return null==c?null:c.U.find(function(d){return d.position===b})||null},iM=function(a,b){var c=a.map(function(d){return d.streams[b]});return c.some(function(d){return null==d})?null:c},jM=function(a){this.a=a},kM=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==d})?null:c},lM=function(a,
|
|
19
|
+
b){var c=new Set(a.map(function(d){return d.na}));return b.filter(function(d){return!c.has(d.na)})},nM=function(a,b){for(;a[0].na<b[0].na;)a.splice(0,1);var c=a[0],d=b[0];c.startTime===d.startTime&&c.endTime===d.endTime||mM(c,d);var e=a.length-1;c=a[e];d=b[e];0<e&&(c.startTime!==d.startTime||c.endTime!==d.endTime)&&mM(c,d);for(c=e+1;c<b.length;)a.push(b[c]),c++},sM=function(a,b,c,d,e){var f=b[0].length();f=PL(f).map(function(g){var h=kM(b,g)||[],l=iM(c,g)||[];g=iM(d,g)||[];var m=_.gh(oM(h)).concat(_.gh(l),
|
|
20
|
+
_.gh(g)).filter(Boolean);pM(m);var n=m[0];m=n.na;n=n.duration;return{configurationId:a,variants:h,textStreams:l,thumbStreams:g,startTime:0,id:"P"+m,endTime:n,duration:n,na:m}});e&&qM(f[0]);rM(f);return f},oM=function(a){a=new Set(a.flatMap(function(b){return[b.video,b.audio]}).filter(Boolean));return Array.from(a)},qM=function(a){var b=oM(a.variants)[0].U[0].Ha;a.startTime+=b;a.endTime+=b},rM=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=
|
|
21
|
+
c.startTime+c.duration}},mM=function(a,b){a.startTime=b.startTime;a.endTime=b.endTime;a.duration=b.duration;tM(a.variants,b.variants);uM(_.Y.Ef(a),_.Y.Ef(b))},tM=function(a,b){var c=new Map(a.map(function(d){return[_.Y.Kh(d),d]}));b.forEach(function(d){c.get(_.Y.Kh(d)).drmInfos=d.drmInfos})},uM=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.U=d.U;d.U.forEach(function(f){f.initSegment=e.initSegmentReference});e.segmentIndex.replace(d.U);e.rc=
|
|
22
|
+
d.rc;e.hf=d.hf;e.duration=d.duration;e.Ph=d.Ph;e.encrypted=d.encrypted;e.drmInfos=d.drmInfos;e.keyId=d.keyId})},pM=function(a){var b=vM(a);a.forEach(function(c){_.lE(c.segmentIndex,b);c.duration=b;c.hf=c.rc+b})},vM=function(a){var b=Infinity;_.Y.Bl(a).forEach(function(c){b=Math.min(b,c.duration)});return b},wM=function(){var a=this;this.a=this.F=null;this.h=1;this.j=new RL;this.o="";this.T=new EL;this.H=0;this.w=null;this.l=new _.Xh(function(){a.hc()});this.A=_.Wb;this.f=null;this.G=new _.nk;this.K=
|
|
23
|
+
this.C=null;this.g=new _.J("clpp.hls.HlsParser");this.L=new Map;this.Y=new ZL(this.ag.bind(this));this.P=!1;this.I=null;this.N=!1;this.B=new Map;this.J=new Set},xM=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})},yM=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=_.u(b),e=d.next();!e.done;e=d.next()){e=e.value;var f=a.B.get(e.id);if(f&&f.Df!==e.Df)a.F.onError(new _.N(1,
|
|
24
|
+
4,4044,"EXT-X-DATERANGE START-DATE has changed for ID\x3d"+e.id));var g={configurationId:a.F.configurationId,schemeIdUri:e.schemeIdUri,customAttributes:e.customAttributes,value:"",startTime:e.startTime,Df:e.Df,endTime:e.endTime,id:e.id,type:_.Bi,eventElement:null};f&&!_.L.yi(f,g)||a.B.set(e.id,g)}return Array.from(a.B.values())},HM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,D,G,B,F;return _.H(function(M){switch(M.a){case 1:c=_.Rq;d=zM(a,b,a.o,"");if(1===d.type){e=d.U[0].a;f=xL(e);if(!f)throw new _.N(_.O,
|
|
25
|
+
4,4021,"Unknown file extension "+e);g="";f===c.VIDEO?g="avc1.42E01E":f===c.AUDIO&&(g="mp4a.40.2");d=OL(a.T,a.o,a.a.hlsDefaultCodecs||g)}h=_.Y.Pn(d.fa);l=AM(h.Pc.nh);l.forEach(function(R){a.J.add(R.groupId)});return _.x(M,BM(a,h),4);case 4:m=M.f;M.D(3);break;case 5:m=M.f;case 3:n=m;p=n.Fm;q=n.periods;t=n.$n;v=n.Co;z=n.alternativeVariants;A=n.alternativeTextStreams;D=n.alternativeImageStreams;if(!a.F)throw new _.N(_.O,7,7001);CM(a,q);G=DM(a,p.delay,q,t);EM(a)||(a.H=p.Ee,FM(a));GM(a,G,q);B=yM(a,v);F=
|
|
26
|
+
{presentationTimeline:G,periods:q,minBufferTime:0,cues:B,muxedAudioTracks:l};z&&(F.alternativeVariants=z);A&&(F.alternativeTextStreams=A);D&&(F.alternativeImageStreams=D);a.g.debug("HLS playlist parsed",F);return M["return"](F)}})},AM=function(a){return a.filter(function(b){return b.name===_.La&&_.P(b,_.Mb)===_.ja&&!_.P(b,_.Ob)}).map(function(b){var c=_.Y.Zh(b),d=_.P(b,_.ab)||_.wg;return{groupId:_.xj(b,_.Sa),id:_.hL++,label:_.xj(b,_.hb),language:d,channelsCount:c,primary:"YES"===_.P(b,"DEFAULT")}})},
|
|
27
|
+
KM=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){if(1==p.a)return c=_.Y,_.x(p,IM(a,b),2);d=p.f;e=d.textStreams;f=d.thumbStreams;g=d.Mj;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.Th(q.audio,g),v=c.Th(q.video,g);q=JM(a,t,v,q.bandwidth);if(!q)throw new _.N(_.O,4,4047,{message:"Video and audio are encrypted in an incompatible way.",Dp:v?v.dc():void 0,audio:t?t.dc():void 0});return q});m=a.F.configurationId;
|
|
28
|
+
n=sM(m,l,e,f,!0);return p["return"](n)})},IM=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){if(1==p.a)return c=_.Rq,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=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,
|
|
29
|
+
type:v.type,codecs:v.codecs,name:v.originalId,uri:v.zc,He:{width:v.width,height:v.height,frameRate:v.frameRate}});return LM(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;MM(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,Mj:h})})},MM=function(a,b){b.forEach(function(c){a.j.a.set(c.dc(),c)})},BM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,D,G;return _.H(function(B){switch(B.a){case 1:return c=
|
|
30
|
+
_.Y,d=c.Hn(b.Pc.closedCaptions),e=NM(a,b.Ge),_.x(B,OM(a,b),2);case 2:return f=B.f,g=Object.values(f).flat().map(function(F){return F.playlist}),PM(a,g),h=g[0],l=c.Xi(h.fa),a.A=l,a.K=c.Yi(h.fa),m=c.On(h.fa,l,a.a.lowLatencyMode||!1,a.a.suggestedPresentationDelay,a.a.liveRefreshPeriod),_.x(B,QM(a,f.oh,e),3);case 3:return n=B.f,_.x(B,RM(a,f.Ge,n,d),4);case 4:return p=B.f,_.x(B,SM(a,f.yo,e),5);case 5:return q=B.f,_.x(B,TM(a,f.jg),6);case 6:return t=B.f,v=a.F.configurationId,z=sM(v,p,q,t,!EM(a)),a.F.filterAllPeriods(z),
|
|
31
|
+
A=_.gh(f.Ge).concat(_.gh(f.oh)).map(function(F){return F.playlist}),D=UM(a,A),G=VM(a,A,D),B["return"]({periods:z,$n:D,Co:G,Fm:m})}})},XM=function(a,b){var c,d,e,f,g;return _.H(function(h){if(1==h.a)return c=_.Y.nd(a.o,b.verbatimUri),_.x(h,WM(a,c),2);d=h.f;e=d.response;f=d.text;g=e.uri;return h["return"](zM(a,f,g,b.verbatimUri))})},CM=function(a,b){EM(a)||2!==a.a.timeline.version||(a.I||(a.I=b[0].startTime),_.VF(b,-a.I))},VM=function(a,b,c){b=b.find(function(d){return null!==_.Y.bb(d.fa,jL)});if(!b)return[];
|
|
32
|
+
if(null===c)throw new _.N(_.O,4,4024,"EXT-X-PROGRAM-DATE-TIME tag is required when EXT-X-DATERANGE tags are present");return b.fa.filter(function(d){return d.name===jL}).map(function(d){return _.Y.In(d,c,a.C,!EM(a))}).filter(Boolean)},UM=function(a,b){var c=b.flatMap(function(e){return e.U[0].fa});c=_.Y.bb(c,"EXT-X-PROGRAM-DATE-TIME");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/
|
|
33
|
+
1E3},OM=function(a,b){var c,d,e,f,g,h;return _.H(function(l){if(1==l.a)return _.x(l,Promise.all([YM(a,b.Pc.nh),YM(a,b.Pc.zo),YM(a,b.Ge),YM(a,b.jg)]),2);c=l.f;d=_.u(c);e=d.next().value;f=d.next().value;g=d.next().value;h=d.next().value;return l["return"]({oh:e,yo:f,Ge:g,jg:h})})},$M=function(a,b){return Promise.all(b.map(function(c){return ZM(a,c)}))},NM=function(a,b){for(var c=_.Y.We,d=new Map,e=_.u(b),f=e.next();!f.done;f=e.next()){var g=f.value,h=_.P(g,_.ja);f=_.P(g,_.Vb);var l=_.P(g,_.Db);g=aN(a,
|
|
34
|
+
g);if(l){var m=_.sj(_.pj,g);d.set(c(_.pj,l),m);l=g.indexOf(m);-1<l&&g.splice(l,1)}h&&(l=bN(_.Pc,g),d.set(c(_.Pc,h),l));f&&(h=bN(_.Jg,g),d.set(c(_.Jg,f),h))}return d},SM=function(a,b,c){return Promise.all(b.map(function(d){return cN(a,d,c)}))},TM=function(a,b){return Promise.all(b.map(function(c){return dN(a,c)}))},QM=function(a,b,c){var d,e;return _.H(function(f){if(1==f.a){if(0===b.length)return f["return"](new Map);d=[cN(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 cN(a,
|
|
35
|
+
g,c)})),_.x(f,Promise.all(d),3);e=f.f;return f["return"](_.Y.Do(e))})},RM=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v;return _.H(function(z){if(1==z.a){e=new Set;f=_.gh(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(_.xj(f[l].tag,_.pa)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.x(z,eN(a,n,c,d,e),2)}if(3!=z.a)return p=z.f,q=f.map(function(A){return eN(a,A,c,d,e)}),_.x(z,Promise.all(q),3);t=z.f;t.splice(g,0,p);v=t.reduce(_.HD,[]);return z["return"](v)})},fN=function(a,b,c){var d;return _.H(function(e){if(1==
|
|
36
|
+
e.a)return _.x(e,LM(a,{playlist:c,codecs:b.codecs,type:b.type,yd:b.originalLanguage,xc: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,He:{width:b.width,height:b.height,frameRate:b.frameRate}}),2);d=e.f;b.bandwidth&&gM(d,b.bandwidth);return e["return"](d)})},eN=function(a,b,c,d,e){var f,g,h,l,m,n;return _.H(function(p){return 1==p.a?(f=_.Y,g=b,h=g.tag,l=Number(_.xj(h,_.pa)),m=f.Rn(h),
|
|
37
|
+
_.x(p,gN(a,b,m,c,d),2)):(n=p.f)?p["return"](hN(a,n,l,e)):p["return"]([])})},iN=function(a,b,c,d,e,f){var g=aN(a,b);a.g.debug("Guessing stream type for",b.toString());b=!1;var h=_.sj(_.Jg,g),l=d+e;1!==g.length||c||h?!l&&1<g.length?(a.g.debug("Guessing multiplexed audio+video"),c=_.Jg,g=[g.join(",")]):d&&f?(a.g.debug(pL),c=_.Pc,b=!0):e?(a.g.debug(pL),c=_.Pc):(a.g.debug("Guessing video-only"),c=_.Jg):(c=_.Pc,a.g.debug(pL));return{type:c,Lj:g,mm:b}},gN=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,t,v,z,A,
|
|
38
|
+
D,G,B,F,M;return _.H(function(R){if(1==R.a)return f=_.Rq,g=_.Y.We,h=b,l=h.tag,m=h.playlist,n=_.P(l,_.ja),p=_.P(l,_.Vb),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(ka){return ka.dc()===z}),D=iN(a,l,c,v.audio.length,v.video.length,A),G=D.type,B=D.Lj,F=D.mm,M=null,F?R.D(2):_.x(R,jN(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(ka){dM(ka,c.width);eM(ka,
|
|
39
|
+
c.height);fM(ka,c.frameRate)});return R["return"](v)})},hN=function(a,b,c,d){var e=b.video,f=b.audio;e=0<e.length?e:[null];b=[];f=_.u(0<f.length?f:[null]);for(var g=f.next();!g.done;g=f.next()){g=g.value;for(var h=_.u(e),l=h.next();!l.done;l=h.next()){var m=l.value;l=_.Y.sl(g,m);d.has(l)?a.g.debug("Skipping variant which only differs in text streams."):(m=JM(a,g,m,c),null==m?a.g.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l)))}}return b},JM=function(a,b,c,d,e){for(var f=
|
|
40
|
+
[],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.Ql(l,m);if(!n)return null;var p=d;l={id:e?e:a.h++,language:l?l.language:_.wg,primary:!!l&&l.primary||!!m&&m.primary,audio:l,video:m,bandwidth:p,drmInfos:n,allowedByApplication:!0,allowedByKeySystem:!0};f.push(l)}return new jM(f)},cN=function(a,b,c){var d,e,f,g;return _.H(function(h){d=b;e=d.tag;f=d.playlist;g=f.verbatimUri;return h["return"](kN(a,g,function(){var l,m,n,p,q,t,v,z,A,D,G,B,F;return _.H(function(M){if(1==
|
|
41
|
+
M.a){l=_.Rq;m=_.Y.We;n=_.xj(e,_.Sa);p=_.Y.Jh(_.xj(e,_.Mb));q=_.Y.ol(e);t=c.get(m(p,n))||"";v=_.P(e,_.ab);z=_.P(e,_.hb);A=_.P(e,"DEFAULT");D=p===l.AUDIO?_.Y.Zh(e):null;var R=p===l.AUDIO?(R=_.P(e,"CHANNELS"))?R.includes("/JOC"):!1:!1;G=R;B="YES"===A;return _.x(M,LM(a,{playlist:f,codecs:t,type:p,yd:v,primary:B,name:z,channelsCount:D,spatialAudio:G,groupId:n,kind:q,xc:null,closedCaptions:null,He:null}),2)}F=M.f;return M["return"](F)})}))})},dN=function(a,b){var c,d,e,f;return _.H(function(g){c=b;d=c.tag;
|
|
42
|
+
e=c.playlist;f=e.verbatimUri;return g["return"](kN(a,f,function(){var h,l,m,n,p;return _.H(function(q){if(1==q.a)return h=_.P(d,_.ua)||"jpg",l=_.P(d,_.ab),m=_.P(d,_.hb),_.x(q,LM(a,{playlist:e,codecs:h,type:_.se,yd:l,name:m,primary:!1,kind:null,channelsCount:null,spatialAudio:!1,closedCaptions:null,xc:null,groupId:null,He:null}),2);n=q.f;(p=_.P(d,_.pa))&&gM(n,Number(p));return q["return"](n)})}))})},aN=function(a,b){var c=_.P(b,_.ua,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);c=
|
|
43
|
+
_.Y.wl(c);var d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.TD(f);d.has(g)?a.g.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},jN=function(a,b,c,d,e,f){var g,h,l,m,n;return _.H(function(p){g=b;h=g.tag;l=g.playlist;m=_.Rq;n=l.verbatimUri;return p["return"](kN(a,n,function(){var q,t,v,z,A;return _.H(function(D){if(1==D.a){q=_.P(h,_.ta);t=null;d===m.VIDEO&&q&&"NONE"!==q&&(t=e.get(q));var G=_.P(h,_.ja)||void 0;v=G&&a.J.has(G)?G:void 0;G=bN(d,c);if(v){var B=
|
|
44
|
+
bN(_.Pc,c);G+=","+B}z=G;return _.x(D,LM(a,{playlist:l,codecs:z,type:d,closedCaptions:t,primary:!1,kind:null,yd:null,name:null,channelsCount:null,spatialAudio:!1,xc:null,groupId:null,muxedAudioId:v,He:f}),2)}A=D.f;return D["return"](A)})}))})},kN=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},LM=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,t,v,z,A,D,G,B,F,M,R,ka,U,qa;return _.H(function(Ba){if(1==Ba.a){c=lN;d=mN;
|
|
45
|
+
e=_.Rq;f=b;g=f.playlist;h=f.codecs;l=f.type;m=f.yd;n=f.xc;p=f.groupId;q=f.muxedAudioId;t=f.primary;v=f.kind;z=f.name;A=f.channelsCount;D=f.spatialAudio;G=f.closedCaptions;B=f.He;F=_.Y.ci(m);if(1!==g.type)throw new _.N(_.O,4,4017);return _.x(Ba,nN(a,g,l,h),2)}M=Ba.f;R=a.a.lowLatencyMode?d.xj:d.zj;ka=v;l!==e.TEXT||v||(ka=_.hg);U=_.Y.Xi(g.fa);qa=M.map(function(Ca){var Da=Ca.U,Na=Ca.yl,zb=Ca.mimeType,me=Ca.na,Cf=Da[0].startTime,Fg=Da[Da.length-1].endTime,Pu=Fg-Cf,od=new _.PE(Da),Ln=Da[0].initSegment||
|
|
46
|
+
null;return{id:null===n?_.hL++:n,originalId:z,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:od.ld.bind(od),getSegmentReference:od.get.bind(od),adjustSegmentDurations:od.Nd.bind(od),getDuration:od.getDuration.bind(od),segmentIndex:od,segmentLookupStrategy:R,initSegmentReference:Ln,mimeType:zb,codecs:h,kind:ka,Ph:Na.type,encrypted:Na.type===c.Cj,aesEncrypted:Ca.aesEncrypted,keyId:Na.keyId,language:F,originalLanguage:m||_.wg,label:z,type:l,primary:t,trickModeVideo:null,emsgSchemeIdUris:null,
|
|
47
|
+
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:D,closedCaptions:G,U:Da,drmInfos:Na.drmInfos,na:me,zc:g.verbatimUri,Sf:g.a,rc:Cf,hf:Fg,duration:Pu,groupId:p,wp:U,muxedAudioId:q}});return Ba["return"](new bM(qa))})},YM=function(a,b){var c;return _.H(function(d){if(1==d.a)return _.x(d,Promise.all(b.map(function(e){var f;return _.H(function(g){if(1==g.a)return _.x(g,oN(a,e),2);f=g.f;return g["return"](f?{tag:e,playlist:f}:
|
|
48
|
+
null)})})),2);c=d.f;return d["return"](c.filter(Boolean))})},oN=function(a,b){var c,d,e,f,g,h,l,m,n;return _.H(function(p){if(1==p.a){c=_.Y.zm(b);d=_.P(b,_.Ob,void 0,{required:c});if(!d)return p["return"](null);e=_.Y.nd(a.o,d);f=Date.now();return _.x(p,WM(a,e),2)}g=p.f;h=g.response;l=g.text;m=Date.now();a.F.onEvent(new _.K(uL,{detail:{duration:m-f,type:"media"}}));n=h.uri;return p["return"](zM(a,l,n,d))})},ZM=function(a,b){var c,d,e,f,g,h,l,m;return _.H(function(n){if(1==n.a){var p=new _.dj(b.streams[0].Sf);
|
|
49
|
+
if(a.a.lowLatencyMode&&a.K&&a.K.sh){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={Im:q.position,Sn:t&&0<t.length?v:null}}else q=null;if(t=q)q=t.Im,t=t.Sn,v=_.Pk(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=_.Ok(v,!0),_.gj(p,new _.kj(q))}c=p.toString();return _.x(n,WM(a,c),2)}d=n.f;e=d.response;f=d.text;g=b.dc();h=b.streams[0].Sf;l=e.uri;h!==l&&(h=l,cM(b,h));m=zM(a,f,h,g);
|
|
50
|
+
return n["return"]({stream:b,playlist:m})})},zM=function(a,b,c,d){a=HL(a.T,b,c);a.verbatimUri=d;return a},pN=function(a){if(1<(new Set(a.map(function(b){return b.mimeType}))).size)throw new _.N(_.O,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},qN=function(a){a=a.map(function(b){return b.a?b.a:b.f.map(function(c){return _.P(c,_.Ob)})||null}).map(function(b){return _.tj(b)});if(1<(new Set(a)).size)throw new _.N(_.O,4,4044,"Unexpected change in file format.");
|
|
51
|
+
},DM=function(a,b,c,d){var e=!0,f=null,g=0;EM(a)||(e=!1,f=0,g=b);b=a.a.timeline||{};b.type=void 0;a=new _.tE(b,f,g,!0,void 0,!!a.a.lowLatencyMode);_.wE(a,e);rN(a,c);d&&_.vE(a,d);return a},sN=function(a,b,c){a=_.Y.pc(a.fa,mL);if(1<a.length)throw new _.N(_.O,4,4020);a=a[0];if(!a)return null;var d=_.xj(a,_.Ob),e=_.Y.nd(b,d);b=_.Y.Vi(a,null,!0);return new _.LD(function(){return[e]},b.Da,b.oa,c)},uN=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(tN(b.f));for(var m=b.next();!m.done;l={If:l.If},m=b.next()){var n=
|
|
52
|
+
m.value;m=n.li;n=n.item;var p=0===m,q=p?a:h[h.length-1],t=p?d:q.endTime,v=Number(_.P(n,_.Ja));v=t+v;p=_.Y.Vi(n,p?null:q.oa,p);q=_.P(n,_.Ob);q=_.Y.nd(g,q);l.If=q?[q]:[];t=new _.Aj(c,t,v,function(z){return function(){return z.If}}(l),p.Da,p.oa,e,f,!1,null,null,null,null);if("YES"===_.P(n,"INDEPENDENT")||0===m)t.h=!0;h.push(t)}return h},vN=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.fa,q=c.a;0<_.Y.pc(p,mL).length&&(n=sN(c,l,g));var t=null!=q,v=q?[q]:[];if(!t&&!a.a.lowLatencyMode)return null;a=0;q={Da:0,
|
|
53
|
+
oa:null};var z=null;t?(c=_.Y.Ln(p).duration,a=e+c,q=_.Y.Wi(p,b?b.oa:null)):(b=uN(b,c,d,e,f,g,l),a=b[b.length-1].endTime,z=b);h=h===_.se?_.Y.Qn(p):null;d=new _.Aj(d,e,a,function(){return v},q.Da,q.oa,f,g,!1,null,h?h.ke:null,h?h.Fe:null,h?h.durationPerTile:null,z,n);d.na=m;return d},nN=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,t,v,z,A;return _.H(function(D){switch(D.a){case 1:return e=_.Y,f=wN,g=b.verbatimUri,h=b.U,l=e.Vl(b.fa,nL),m=[],_.x(D,xN(a,b.a,g,h,l,c,d),2);case 2:n=D.f,p=l,q=f.wo(h),t=0;case 3:if(!(t<
|
|
54
|
+
q.length)){D.D(5);break}v=q[t];z=m[m.length-1]||null;return _.x(D,yN(a,b.a,v,p,n,c,d,z),6);case 6:A=D.f;m.push(A);p+=v.length;t++;D.D(3);break;case 5:return pN(m),D["return"](m)}})},xN=function(a,b,c,d,e,f,g){var h,l,m,n,p,q,t,v,z,A,D;return _.H(function(G){if(1==G.a){h=d[0];if(null!=a.C)return G["return"](a.C);if(!EM(a)&&a.f)try{var B=a.j.get(c),F=B?hM(B,e)||null:null;if(!F)throw new _.N(_.O,4,4030,"Segment not found in pervious playlist update.");l=F.startTime+F.Ha;a.g.debug(sL+l+".");a.C=l;return G["return"](l)}catch(M){if(m=
|
|
55
|
+
a.j.get(c))n=m.streams[0].U[0].position,G=m.streams[m.streams.length-1].U,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 _.N(_.O,4,4047,{message:"The updated playlist does not share any segments with the previous one.",uri:c});}return _.x(G,zN(a,f,g,h),2)}if(3!=G.a)return v=G.f,z=AN.Si(h.fa,a.o,e),A=sN(h,b,z),_.x(G,BN(a,A,h,z,v,g),3);D=G.f;a.g.debug(sL+D+".");a.C=D;return G["return"](D)})},yN=function(a,
|
|
56
|
+
b,c,d,e,f,g,h){var l,m,n,p,q,t,v,z,A,D,G,B,F,M,R,ka,U,qa,Ba,Ca,Da,Na;return _.H(function(zb){switch(zb.a){case 1:return l=AN,m=c[0],n=null==h,qN(c),_.x(zb,zN(a,f,g,m),2);case 2:p=zb.f;q=l.Kn(c,p,h?h.Dm:null);t=q[q.length-1];v=AN.ta(q);z=h?h.Em:null;A=CN(z,m.fa,a.o,d);D=sN(m,b,A)||(h?h.om:null);G=m.na;if(n){B=e;zb.D(3);break}return _.x(zb,DN(a,G,D,m,d,A,p,g),4);case 4:B=zb.f;case 3:F=B;M=[];R=!1;for(ka=0;ka<c.length;ka++)if(U=c[ka],qa=M[M.length-1]||null,Ba=0===ka?0:qa.endTime,Ca=d+ka,(z=Da=CN(z,U.fa,
|
|
57
|
+
a.o,Ca))&&(R=!0),Na=vN(a,qa,U,Ca,Ba,F,Da,f,b,G,D))D=Na.initSegment,M.push(Na);return zb["return"]({U:M,yl:v,Dm:t,aesEncrypted:R,mimeType:p,endTime:M[M.length-1].endTime,na:G,om:D,Em:z})}})},CN=function(a,b,c,d){return b.some(function(e){return e.name===lL&&"NONE"===_.P(e,qL)})?null:(b=AN.Si(b,c,d))?b:a&&a.generatedIv?Object.assign({},a,{iv:AN.Yh(d)}):a},PM=function(a,b){b.forEach(function(c){var d=a.j.get(c.verbatimUri);wN.Qj(c,d,!EM(a))});wN.tl(b)},DN=function(a,b,c,d,e,f,g,h){var l;return _.H(function(m){if(1==
|
|
58
|
+
m.a)return a.L.has(b)?m["return"](a.L.get(b)):_.x(m,BN(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)})},BN=function(a,b,c,d,e,f){var g;return _.H(function(h){if(null==c.a)return h["return"](0);g=_.Y.ql(c,d);return h["return"](aM(a.Y,b,g,e,f,null!=d))})},bN=function(a,b){if(1===b.length)return b[0];var c=_.sj(a,b);if(null!=c)return c;throw new _.N(_.O,4,4025,{codecList:b});},zN=function(a,b,c,d){var e,f,g;return _.H(function(h){e=
|
|
59
|
+
d.a;g=(f=_.Y.bb(d.fa,mL))?_.xj(f,_.Ob):null;return h["return"](EN(a,b,c,e,g))})},EN=function(a,b,c,d,e){var f,g,h,l,m;return _.H(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.vj(f,b,c))return n["return"](g);h=_.ck([d],a.a.attemptParameters);h.method="HEAD";h.type=2;return _.x(n,a.ag(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.N(_.O,4,4021,"Unknown MIME type of: "+f.join(", "));return n["return"](m.toLowerCase().split(";")[0])})},GM=function(a,b,c){c=_.Y.Xl(c);"LIVE"===a.A||"EVENT"===
|
|
60
|
+
a.A?(c=Math.max(c,b.K),isNaN(a.a.availabilityWindowOverride)||(c=a.a.availabilityWindowOverride),b.A=c):a.A===_.Wb&&(b.f=c)},FM=function(a){for(var b=0,c=_.u(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=_.u(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",
|
|
61
|
+
d.type),d.segmentIndex.offset(c)):a.g.debug("Offset NOT applied to",d.type)},WM=function(a,b){var c,d,e;return _.H(function(f){if(1==f.a)return c=_.ck([b],a.a.attemptParameters),c.type=1,_.x(f,a.ag(c),2);d=f.f;e="";try{e=_.Q.ea(d.data)}catch(g){throw new _.N(_.O,4,4042);}e=_.Q.Fi(e);e=e.trim();return f["return"]({text:e,response:d})})},EM=function(a){return a.A===_.Wb},rN=function(a,b){_.Y.Am(b,function(c,d){_.AE(a,c.U,d.startTime)});_.sE(a.a,b[0].startTime,b[b.length-1].endTime)},FN=function(){},
|
|
62
|
+
mN={xj:_.iD,zj:_.hD},lN={Cj:vL,Zo:"whole-segment",NONE:_.Qe},ML=/^#EXT-X-DEFINE/,NL=/^#(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)/,tN=function GN(a){var c,d,e,f,g,h;return _.Ch(GN,function(l){1==l.a&&(c=-1,e=d=void 0,f=_.u(a),g=f.next());if(5!=l.a){if(g.done)return-1===c?l.D(0):_.x(l,{li:c,Yn:d,item:e,next:void 0},0);h=g.value;return 0<=c?_.x(l,{li:c,
|
|
63
|
+
item:e,Yn:d,next:h},5):l.D(5)}c++;d=e;e=h;g=f.next();return l.D(2)})};_.r=RL.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()};
|
|
64
|
+
var wN={tl:function(a){var b=wN.Jl(a),c=wN.Cm(a);a.forEach(function(d){var e=d.U,f=e.findIndex(function(h){return h.na===b}),g=e.findIndex(function(h){return h.na===c+1});-1===g&&(g=e.length);d.U=e.slice(f,g)})},Qj:function(a,b,c){b=wN.Ul(a,b,c);a=_.u(a.U||[]);for(c=a.next();!c.done;c=a.next())c=c.value,_.Y.wd(c.fa,kL)&&b++,c.na=b},Ul:function(a,b,c){var d=_.Y.bb(a.fa,"EXT-X-DISCONTINUITY-SEQUENCE");if(d)return Number(d.value);d=wN.rm(b);if(c&&d)try{return wN.nm(a,b)}catch(e){throw new _.N(_.O,4,
|
|
65
|
+
4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");}return 0},rm:function(a){return 0<wN.Wl(a)},wo:function(a){if(0===a.length)return[];var b=[],c=[];a=_.u(a);for(var d=a.next();!d.done;d=a.next())d=d.value,_.Y.wd(d.fa,kL)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},Wl:function(a){if(!a)return 0;a=a.streams[a.streams.length-1].U;return a[a.length-1].na},nm:function(a,b){var c=_.Y.bb(a.fa,nL);if(!c)throw wN.g.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),
|
|
66
|
+
Error(oL);c=Number(c.value);var d=hM(b,c);if(!d)throw wN.g.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(oL);return d.na},Cm:function(a){a=a.map(function(b){return b.U[b.U.length-1].na});return Math.min.apply(Math,_.gh(a))},Jl:function(a){a=a.map(function(b){return b.U[0].na});return Math.max.apply(Math,_.gh(a))}};wN.g=new _.J("clpp.hls.DiscontinuityUtils");var HN={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Kg)throw new _.N(_.O,4,4041);if(_.xj(a,qL)===rL)throw new _.N(_.O,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.KD(_.Cd,[{initDataType:_.Yf,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":YL,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":YL,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=_.xj(a,qL);if(!WL.includes(b))return XL.error("Widevine in HLS is only supported with [",
|
|
67
|
+
WL.join(", "),"], not",b),null;b=_.xj(a,_.Ob);b=_.yv(b);b=_.Oj(b.data);b=_.KD(_.Gd,[{initDataType:_.hd,initData:b}],"");if(a=_.P(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},WL=["SAMPLE-AES",rL],XL=new _.J("clpp.hls.DrmParser");var AN={Kn:function(a,b,c){if(_.Y.wd(a[0].fa,lL)||null===c)return c=AN.Ti(a,b),0===c.length?[{type:_.Qe,drmInfos:[],keyId:null}]:c;a=AN.Ti(a,b);return[c].concat(_.gh(a))},ta:function(a){if(0===a.length)return{type:_.Qe,drmInfos:[],keyId:null};if(a.some(function(c){return"whole-segment"===c.type})||a.every(function(c){return c.type===_.Qe}))return a[0];a=a.filter(function(c){return c.type===vL});var b=_.Ki(a.flatMap(function(c){return c.drmInfos}));return{keyId:a[a.length-1].keyId,type:vL,drmInfos:b}},
|
|
68
|
+
Ti:function(a,b){return AN.Cl(a).map(function(c){return AN.Nn(c.fa,b)}).filter(Boolean)},Cl:function(a){return a.filter(function(b){return _.Y.wd(b.fa,lL)})},Nn:function(a,b){var c=_.Y.pc(a,lL).filter(function(e){return"AES-128"!==_.xj(e,qL)});if(0===c.length)return null;var d=_.xj(c[0],qL);if(1===c.length&&"NONE"===d)return{type:_.Qe,drmInfos:[],keyId:null};d=c.map(function(e){return _.xj(e,qL)});if(!d.every(function(e){return"SAMPLE-AES"===e})&&!d.every(function(e){return e===rL}))throw AN.g.warn("EXT-X-KEY methods "+
|
|
69
|
+
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=_.P(e,"KEYFORMAT","identity"),g=HN[f]||null;(e=g?g(e,b):null)||AN.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:vL,drmInfos:c}},tp:function(){return{type:_.Qe,drmInfos:[],keyId:null}},
|
|
70
|
+
Si:function(a,b,c){a=_.Y.pc(a,lL)[0];if(!a||"AES-128"!==_.xj(a,qL))return null;var d=AN.Ol(a,c);c=d.iv;d=d.generatedIv;return{method:"AES-128",url:_.Y.nd(b,_.xj(a,_.Ob)),iv:c,generatedIv:d}},Yh:function(a){return _.Rm(new Uint8Array(12),new Uint8Array([a>>24&255,a>>16&255,a>>8&255,a&255]))},Ol:function(a,b){var c=_.P(a,"IV","");if(c)return{iv:_.Om((c||"0x").slice(2)),generatedIv:!1};c=_.P(a,"KEYFORMAT");return null==c||"identity"===c?{iv:AN.Yh(b),generatedIv:!0}:{iv:null,generatedIv:!1}}};AN.g=new _.J("clpp.hls.EncryptionUtils");bM.prototype.length=function(){return this.streams.length};bM.prototype.f=function(){return this.streams[0].groupId};bM.prototype.a=function(){return this.streams[0].type};bM.prototype.dc=function(){return this.streams[0].zc};jM.prototype.length=function(){return this.a.length};_.r=wM.prototype;_.r.configure=function(a){this.a=a;this.Y.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 _.H(function(n){if(1==n.a){if(c.P)throw Error("start() may be called only once!");c.P=!0;c.F=b;d=Date.now();return _.x(n,WM(c,a),2)}if(3!=n.a)return e=n.f,f=e.response,g=e.text,h=Date.now(),c.F.onEvent(new _.K(uL,{detail:{duration:h-d,type:"master"}})),c.o=f.uri,_.x(n,HM(c,g),3);l=n.f;c.f=l;m=c.H;c.l&&0<m&&c.l.ga(m);return n["return"](l)})};
|
|
71
|
+
_.r.requestStop=function(){this.N=!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.F=this.w=null;this.B.clear();this.J.clear();return Promise.all(a)};
|
|
72
|
+
_.r.update=function(){var a=this,b,c,d,e,f,g,h,l,m,n;return _.H(function(p){switch(p.a){case 1:b=a.f;if(EM(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=xM(a),d=d.filter(function(q){return e.includes(q.dc())}));return _.x(p,$M(a,d),2);case 2:return f=p.f,g=f.map(function(q){return q.playlist}),PM(a,g),_.x(p,KM(a,f),3);case 3:h=p.f;lM(b.periods,h).forEach(function(q){a.F.filterNewPeriod(q)});CM(a,h);l=UM(a,
|
|
73
|
+
g);m=VM(a,g,l);b.cues=yM(a,m);nM(b.periods,h);rN(c,h);if(n=_.Y.km(g))!0!==a.a.keepTimelineLive&&(a.A=_.Wb,_.wE(c,!0),c.f=h[h.length-1].endTime),a.l.stop(),a.l=null;if(a.F.onUpdate)a.F.onUpdate(b);if(n&&a.F.onTurnedStatic)a.F.onTurnedStatic();if(!a.N){p.D(4);break}return _.x(p,a.stop(),4);case 4:return p["return"](b)}})};
|
|
74
|
+
_.r.loadVariant=function(a,b){var c=this,d,e,f,g,h,l,m,n,p,q,t,v,z,A,D;return _.H(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 _.Zi("No alternative variant with id: "+d);h=g;m=l=null;h.audio&&(n=h.audio,l=kN(c,n.verbatimUri,function(){var B;return _.H(function(F){if(1==F.a)return _.x(F,XM(c,n),2);B=F.f;return F["return"](fN(c,
|
|
75
|
+
n,B))})}));h.video&&(p=h.video,m=kN(c,p.verbatimUri,function(){var B;return _.H(function(F){if(1==F.a)return _.x(F,XM(c,p),2);B=F.f;return F["return"](fN(c,p,B))})}));return _.x(G,l,2)}if(3!=G.a)return q=G.f,_.x(G,m,3);t=G.f;if(v=JM(c,q,t,h.bandwidth,h.id))A=c.F.configurationId,D=sM(A,[v],[],[],!EM(c)),c.F.filterAllPeriods(D),D.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 _.Zi("Could load variant with id: "+d);return G["return"](z)})};
|
|
76
|
+
_.r.loadTextStream=function(a,b){var c=this,d,e,f,g,h,l;return _.H(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.D(2);g=c.f.alternativeTextStreams.find(function(n){return n.id===a})||null;if(!g)throw new _.Zi(_.PC+a);h=g;return _.x(m,kN(c,h.verbatimUri,function(){var n;return _.H(function(p){if(1==p.a)return _.x(p,XM(c,h),2);n=p.f;return p["return"](fN(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 _.Zi(_.PC+a);return m["return"](d)})};_.r.hc=function(){var a=this,b,c;return _.H(function(d){if(1==d.a){a.g.debug(_.ZC);if(!a.F)return d["return"]();_.C(d,2);return _.x(d,a.update(),4)}if(2!=d.a)return a.l&&0<a.H&&a.l.ga(a.H),_.uh(d,0);b=_.E(d);if(!(b instanceof _.N))throw b;a.F&&(a.F.onError(b),c=b,1===c.severity&&a.l&&a.l.ga(.1));_.y(d)})};
|
|
78
|
+
_.r.ag=function(a){if(!this.G)throw new _.N(_.O,7,7001);a=this.F.networkingEngine.fetch(a);_.ok(this.G,a);return a.S};_.w(FN,_.Bu);FN.prototype.f=function(){_.dv.m3u8=wM;_.bv[_.Zl]=wM;_.bv[tL]=wM};FN.prototype.a=function(){_.sF("m3u8");_.tF(_.Zl);_.tF(tL)};FN.prototype.id=function(){return"hls"};_.I("clpp.hls.HlsComponent",FN);};
|
|
79
79
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
80
80
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
81
81
|
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=_.qe,a.a.on(c,_.Ld,function(d){return
|
|
6
|
-
a.m.getTrackManager().Ba())&&a.language&&a.language.toLowerCase()},
|
|
7
|
-
_.I("clpp.hlssmpte.HlsSmptePlugin",
|
|
2
|
+
var f=function(window){var rV=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.L.R(a)){a:{var b=a.info;if(_.L.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=_.L.ia(a)?a:null}},tV=function(a,b,c){this.m=a;this.l=b;this.j=c;this.a=new _.gi;this.h=(a=_.Bv(_.Mc))?new a(this.m.getConfiguration()):null;this.g=new _.J("clpp.hlssmpte.ImageCueHandler");this.f=null;sV(this)},sV=function(a){a.a.one(a.m,_.Ce,function(){return uV(a)})},
|
|
3
|
+
uV=function(a){var b=a.m.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Bc,function(d){return vV(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Je}).forEach(function(d){vV(a,{track:d})});!wV(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."),xV(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
|
+
wV=function(a){return a.some(function(b){return b.kind===_.Je})},xV=function(a,b){var c=a.m.getTrackManager(),d=c.qa(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.Ia(d)};a.a.on(b.textTracks,_.Bc,function(g){g.track.kind===_.Je&&(a.a.off(b.textTracks,_.Bc,f),f())});c.Ia(e)}else a.g.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},vV=function(a,b){var c=b.track;c.kind===_.Je&&(a.g.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.qe,a.a.on(c,_.Ld,function(d){return yV(a,d)}))},yV=function(a,b){var c=zV(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 rV(d);if(e.f===c&&null!==e.a){a.f=d;d=a.h.parseMedia(_.Q.hb(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)}}})},zV=function(a){return(a=
|
|
6
|
+
a.m.getTrackManager().Ba())&&a.language&&a.language.toLowerCase()},AV=function(){this.a=null;this.f=!1},BV=function(){};tV.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.w(AV,_.bw);AV.prototype.onPlayerCreated=function(){};AV.prototype.onContentWillLoad=function(a){if(this.f=_.xl()){var b=a.getConfiguration();b=_.L.kb(b.hlssmpte||{});_.L.pi(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.L.wa(b.timestampOffset)||(b.timestampOffset=0);this.a=new tV(a,b.patchMetadataTrack,b.timestampOffset)}};AV.prototype.onPlayerWillDestroy=function(){var a=this;return _.H(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.D(0);a.a=null;_.y(b)})};AV.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.I("clpp.hlssmpte.HlsSmptePlugin",AV);AV.Id="hlssmpte";BV.prototype.create=function(){return new AV};_.Yt(new BV);};
|
|
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));}
|