@castlabs/prestoplay 6.6.1-beta.2 → 6.7.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 +20 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +403 -403
- package/cjs/cl.crypto.js +10 -10
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +47 -41
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +68 -49
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mse.js +263 -260
- package/cjs/cl.muxdata.js +11 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +70 -69
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +13 -13
- package/cjs/cl.vtt.js +11 -11
- package/cjs/cl.youbora.js +19 -19
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +345 -343
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +47 -41
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +57 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -16
- package/cl.mse.js +227 -227
- package/cl.muxdata.js +9 -8
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/package.json +1 -1
- package/typings.d.ts +118 -12
package/cjs/cl.freewheel.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.f=this.a=null;this.
|
|
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
|
-
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.In(_
|
|
7
|
-
_.C("clpp.freewheel.FreeWheelPlugin",
|
|
8
|
-
_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.
|
|
9
|
-
_.t.
|
|
10
|
-
_.t.getPodIndex=function(){switch(this.
|
|
11
|
-
_.t.getWrapperCreativeIds=function(){return[]};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.
|
|
16
|
-
_.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,
|
|
17
|
-
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.
|
|
18
|
-
_.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.
|
|
19
|
-
_.t.
|
|
20
|
-
void 0));this.
|
|
21
|
-
_.t.
|
|
22
|
-
_.
|
|
23
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.
|
|
24
|
-
_.t.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var YK="clpp-freewheel",ZK="clpp.freewheel.AdsManagerFactory",$K="freewheel",aL=function(){this.f=this.a=null},bL=function(){},cL=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""}},dL=function(a,b,c){this.g=a;this.f=b;this.a=c},eL=function(a){this.a=a},fL=function(a){this.h=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.eg;this.w=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.m=new _.di;this.j=null},gL=function(a){var b=[];typeof a.networkId!==_.k&&b.push("networkId");typeof a.serverUrl!==_.ve&&b.push("serverUrl");typeof a.profileId!==_.ve&&b.push("profileId");typeof a.videoAssetId!==_.ve&&typeof a.videoAssetId!==_.k&&b.push("videoAssetId");if(b.length)throw new _.L(1,9,12001,{missingKeys:b.join(", ")});},hL=function(){var a,b,c,d;return _.B(function(e){if(1==e.a)return a=new _.Cp,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)})},kL=function(a){return _.B(function(b){if(a.B.length)return iL(a),a.f=a.B.shift(),a.f.play(),b.G(0);jL(a);return _.x(b,a.l.a.play(),0)})},lL=function(a){a.A.length?(iL(a),a.f=a.A.shift(),a.f.play()):jL(a)},iL=function(a){var b=a.l.cc($K).Jc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(YK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},jL=function(a){var b=a.l.cc($K).Jc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},mL=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 dL(a.a,c,d)});a.l.trigger(new _.I(b,d))},nL=function(){this.a=new _.H(ZK)};_.w(aL,_.nq);_.t=aL.prototype;
|
|
6
|
+
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.In(_.$c,{id:YK}),this.f=_.In(_.Re,{"class":_.Ic}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,!0),a.getSurface().hide(this.a);else a.onError(new _.L(1,9,12E3))};_.t.onPlayerWillDestroy=function(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)};_.t.id=function(){return $K};_.t.Jc=function(){return this.a};_.t.Yi=function(){return this.f};
|
|
7
|
+
_.C("clpp.freewheel.FreeWheelPlugin",aL);aL.prototype.getAdVideo=aL.prototype.Yi;aL.prototype.getAdContainer=aL.prototype.Jc;aL.Id=$K;aL.AD_CONTAINER_ID=YK;bL.prototype.create=function(){return new aL};_.Fo(new bL);_.t=dL.prototype;_.t.ub=function(){return"FreeWheel AdManager SDK"};_.t.vb=function(){return tv.freewheel.SDK.version};_.t.Ab=function(){return 0};_.t.getId=function(){return this.a?this.a.getAdId():""};_.t.getCreativeId=function(){var a=(this.a||{})._creativeId;return typeof a===_.ve?a:""};_.t.getApiFramework=function(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""};_.t.getAdSystem=function(){return""};_.t.getAdvertiserName=function(){return""};_.t.getTitle=function(){return""};
|
|
8
|
+
_.t.getDuration=function(){return this.a?this.a.getActiveCreativeRendition().getDuration():0};_.t.getSkipTimeOffset=function(){return 0};_.t.gc=function(){return!1};_.t.Nb=function(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""};_.t.getMediaUrl=function(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""};
|
|
9
|
+
_.t.xb=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.wb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.jb=function(){return 0};_.t.Ya=function(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}};
|
|
10
|
+
_.t.getPodIndex=function(){switch(this.Ya()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Ob=function(){switch(this.Ya()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Pb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.zb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
|
|
11
|
+
_.t.getWrapperCreativeIds=function(){return[]};dL.prototype.getWrapperCreativeIds=dL.prototype.getWrapperCreativeIds;dL.prototype.getWrapperAdSystems=dL.prototype.getWrapperAdSystems;dL.prototype.getWrapperAdIds=dL.prototype.getWrapperAdIds;dL.prototype.getSequenceLength=dL.prototype.zb;dL.prototype.getPositionInSequence=dL.prototype.Pb;dL.prototype.getPodTimeOffset=dL.prototype.Ob;dL.prototype.getPodIndex=dL.prototype.getPodIndex;dL.prototype.getPodType=dL.prototype.Ya;
|
|
12
|
+
dL.prototype.getMediaBitrate=dL.prototype.jb;dL.prototype.getMediaHeight=dL.prototype.wb;dL.prototype.getMediaWidth=dL.prototype.xb;dL.prototype.getMediaUrl=dL.prototype.getMediaUrl;dL.prototype.getClickThroughUrl=dL.prototype.Nb;dL.prototype.isBumper=dL.prototype.gc;dL.prototype.getSkipTimeOffset=dL.prototype.getSkipTimeOffset;dL.prototype.getDuration=dL.prototype.getDuration;dL.prototype.getTitle=dL.prototype.getTitle;dL.prototype.getAdvertiserName=dL.prototype.getAdvertiserName;
|
|
13
|
+
dL.prototype.getAdSystem=dL.prototype.getAdSystem;dL.prototype.getApiFramework=dL.prototype.getApiFramework;dL.prototype.getCreativeId=dL.prototype.getCreativeId;dL.prototype.getId=dL.prototype.getId;dL.prototype.getTechnology=dL.prototype.Ab;dL.prototype.getAdManagerVersion=dL.prototype.vb;dL.prototype.getAdManagerName=dL.prototype.ub;eL.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()}})};eL.prototype.Qb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};eL.prototype.kb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
14
|
+
eL.prototype.hasPostroll=eL.prototype.kb;eL.prototype.hasPreroll=eL.prototype.Qb;eL.prototype.getCuePoints=eL.prototype.getCuePoints;_.t=fL.prototype;
|
|
15
|
+
_.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.B(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{gL(b)}catch(n){return a.l.onError(n),a.m.resolve(),m["return"](a.m)}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.ve&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,hL(),2)}c=m.f;a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(d=
|
|
16
|
+
_.u(b.pods),e=d.next();!e.done;e=d.next())f=e.value,a.a.addTemporalSlot(f.id,cL(f.type),f.position,f.slotProfile,f.cuepointSequence,f.maxDuration,f.minDuration,f.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ld&&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=
|
|
17
|
+
g.next())l=h.value,a.a.setParameter(l.name,l.value,l.level);a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.pk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.tk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.sk.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Lj.bind(a));a.g.on(a.l,_.Fe,a.Xh.bind(a));a.g.on(a.l,_.se,a.Wh.bind(a));a.a.submitRequest();return m["return"](a.m)})};_.t.start=function(){var a=this;return _.B(function(b){return _.x(b,kL(a),0)})};
|
|
18
|
+
_.t.resume=function(){this.f&&this.f.resume()};_.t.pause=function(){this.f&&this.f.pause()};_.t.skip=function(){this.f&&this.f.skipCurrentAd()};_.t.getVolume=function(){return this.a?this.a.getAdVolume():1};_.t.setVolume=function(a){this.a&&this.a.setAdVolume(a)};_.t.getPosition=function(){return this.f?this.f.getPlayheadTime():-1};_.t.dispose=function(){var a=this;return _.B(function(b){a.g.release();a.j&&(a.j.stop(),a.j=null);jL(a);a.a&&(a.a.dispose(),a.a=null);_.z(b)})};
|
|
19
|
+
_.t.pk=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.l.trigger(new _.I(_.Zb,{adsTimeline:new eL(this.a)})),this.j=new _.Ap(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.cc($K).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
|
|
20
|
+
void 0));this.m.resolve()};_.t.tk=function(a){mL(this,_.Ib,a);this.j.start()};_.t.sk=function(a){this.f=null;a=a.slot;mL(this,_.Jb);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:kL(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:jL(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:lL(this)}};
|
|
21
|
+
_.t.Lj=function(a){var b=a.subType;this.h.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:mL(this,_.Vb,a);mL(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:mL(this,_.Wb,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:mL(this,_.Nb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:mL(this,_.Qb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:mL(this,_.Xb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:mL(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:mL(this,
|
|
22
|
+
_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:mL(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:mL(this,_.Tb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:mL(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:mL(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:mL(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.L(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],
|
|
23
|
+
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.Xh=function(){var a=this;if(!this.f){var b=this.l.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.l.pause();iL(this);this.f.play()}}};
|
|
24
|
+
_.t.Wh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.mn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.ln:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.en:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);lL(this);break;case _.Ym:case _.jn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};fL.prototype.getPosition=fL.prototype.getPosition;fL.prototype.setVolume=fL.prototype.setVolume;
|
|
25
|
+
fL.prototype.getVolume=fL.prototype.getVolume;fL.prototype.skip=fL.prototype.skip;fL.prototype.pause=fL.prototype.pause;fL.prototype.resume=fL.prototype.resume;fL.prototype.start=fL.prototype.start;nL.prototype.name=function(){return ZK};nL.prototype.$=function(a,b){return a.namespace()===_.Kc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};nL.prototype.create=function(a){return new fL(a)};nL.prototype.create=nL.prototype.create;nL.prototype.isSupported=nL.prototype.$;nL.prototype.name=nL.prototype.name;_.Fn(new nL);};
|
|
26
26
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
27
27
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
28
28
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hls.js
CHANGED
|
@@ -1,53 +1,72 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
a
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
d,e,f,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
a.a.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if(
|
|
40
|
-
|
|
41
|
-
_.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_.
|
|
47
|
-
|
|
48
|
-
_.
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
var f=function(window){var bB="CLOSED-CAPTIONS",cB="Could not parse MP4 segment start time.",dB="EXT-X-BYTERANGE",eB="EXT-X-DISCONTINUITY",fB="EXT-X-DISCONTINUITY-SEQUENCE",gB="EXT-X-ENDLIST",hB="EXT-X-KEY",iB="EXT-X-MAP",jB="EXT-X-MEDIA-SEQUENCE",kB="EXT-X-PART-INF",lB="EXT-X-PLAYLIST-TYPE",mB="EXT-X-PRELOAD-HINT",nB="EXT-X-SERVER-CONTROL",oB="EXT-X-STREAM-INF",pB="EXT-X-TARGETDURATION",qB="Failed to infer discontinuity number",rB="Guessing audio-only",sB="METHOD",tB="Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 in combination with another EXT-X-KEY tag, which is not supported.",
|
|
3
|
+
uB="Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist , which is not supported.",vB="SAMPLE-AES-CTR",wB="application/vnd.apple.mpegurl",xB="sample",yB="whole-segment",zB=function(a,b){return _.eh(a,b,void 0,{required:!0})},AB=function(a){if(1>a.a)throw _.Ik();--a.a},BB=function(a,b,c,d){if(1===b){if(!d||0===d.length)throw new _.L(_.M,4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.L(_.M,4,4043,"Media playlist must have at least one full segment!");
|
|
4
|
+
}this.f=a;this.a="";this.type=b;this.aa=c;this.U=1===b?d:null},CB=function(a,b,c){c=void 0===c?[]:c;this.aa=b;this.a=a;this.f=c},DB=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r){r=void 0===r?[]:r;_.Qv.call(this,a,b,c,d,e,f,g,void 0===h?null:h,void 0===l?!1:l,void 0===m?null:m,void 0===n?null:n,void 0===p?null:p,void 0===q?null:q,r);this.initSegment=void 0;this.Lb=0},EB=function(a){if(null!==a&&void 0!==a)return Number(a)},FB=function(){this.a=0},IB=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?
|
|
5
|
+
(h=_.Uh(a.a++,h),GB.includes(h.name)?d.push(h):HB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===mB&&"PART"===_.eh(h,"TYPE")&&g.push(h):f.push(h)):W.Le(h)||(h=W.dd(b,h.trim()),e.push(new CB(h,f,g)),f=[],g=[])});0<g.length&&e.push(new CB(null,f,g));return{U:e,aa:d}},JB=function(a){var b=void 0===b?0:b;return 0>a?[]:Array.from({length:a},function(c,d){return d+b})},KB=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
|
+
6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},LB=function(){this.f=new Map;this.a=new Map},MB=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 _.L(_.M,4,4030);}KB(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===
|
|
7
|
+
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}}KB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},NB=function(a,b){var c=null,d=0;try{(new _.Pk).L(_.Gd,_.Qk).L(_.Ge,_.Qk).L(_.Ad,_.Qk).W("mdhd",function(g){g.reader.skip(0==g.version?8:16);d=_.T(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Tq.error("Unable to find timescale in init segment!"),
|
|
8
|
+
new _.L(_.M,4,4030,cB,c);var e=0,f=!1;try{(new _.Pk).L("moof",_.Qk).L("traf",_.Qk).W("tfdt",function(g){e=(0==g.version?_.T(g.reader):_.Nk(g.reader))/d;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.L(_.M,4,4030,cB,c);return e},OB=function(a){for(;a.getPosition()<a.Ca()-1;){var b=a.getPosition();if(71===_.Jk(a))return AB(a),b}return-1},PB=function(a){function b(){d.seek(e+188);f=_.Jk(d);71!=f&&(d.seek(e+192),f=_.Jk(d));71!=f&&(d.seek(e+204),f=_.Jk(d));71!=f&&c();AB(d)}function c(){throw new _.L(_.M,
|
|
9
|
+
4,4030);}var d=new _.Gk(new DataView(a),!1),e=0,f=0;e=OB(d);0>e&&(_.Tq.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Jk(d),71!=f&&c(),a=_.Kk(d),8191===(a&8191))b();else if(a&16384)if(a=(_.Jk(d)&48)>>4,0!=a&&2!=a||c(),3==a&&(a=_.Jk(d),d.skip(a)),1!=_.T(d)>>8)b();else{d.skip(3);a=_.Jk(d)>>6;0!=a&&1!=a||c();0==_.Jk(d)&&c();a=_.Jk(d);var g=_.Kk(d),h=_.Kk(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},SB=function(a){var b=zB(a,
|
|
10
|
+
sB);if(!QB.includes(b))return RB.error("PlayReady in HLS is only supported with [",QB.join(", "),"], not",b),null;a=zB(a,_.wb);b=_.aq(a);a=null;b=_.N(b.data);try{a=_.Ev(_.Pl(b))}catch(c){a=b}return _.Ov(_.Tc,[{initDataType:_.Dc,initData:a}],"")},TB=function(a){this.h=new _.H("clpp.hls.MediaReader");this.f=a;this.a={attemptParameters:_.Wh()}},VB=function(a,b,c,d,e,f){var g,h,l,m,n,p,q,r;return _.B(function(v){switch(v.a){case 1:a.h.debug("Fetching segment to find start time");if("audio/mpeg"===d||
|
|
11
|
+
d===_.qc||d===_.pc)return v["return"](0);g=f;if(d!==_.nc){v.G(2);break}return _.x(v,UB(a,c,g),3);case 3:return h=v.f,l=_.N(h.data),KB(l)?v["return"](MB(l)):v["return"](PB(h.data));case 2:if(d!==_.Te&&d!==_.rc){v.G(4);break}m=[UB(a,c,g)];b&&m.push(UB(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"](NB(p.data,q.data));case 4:if(d!==_.Se){v.G(6);break}return _.x(v,UB(a,c,g),7);case 7:return r=v.f,v["return"](PB(r.data));case 6:if(!MediaSource.isTypeSupported((d.split("/")[0]||
|
|
12
|
+
"")+'/mp4;codecs\x3d"'+e+'"'))return v["return"](0);throw new _.L(_.M,4,4030);}})},UB=function(a,b,c){var d,e,f,g,h,l,m;return _.B(function(n){switch(n.a){case 1:return d=b.f(),e=_.kw(b.Ka(),b.sa,b.sa+2048-1,a.a.attemptParameters),e.type=2,f=_.kw(b.Ka(),b.sa,b.ea,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.Af(n,2),g=c?f:e,_.x(n,a.f(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.Cf(n);if(7001===l.code||c)throw l;a.h.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.",
|
|
13
|
+
e.uris[0]);_.Af(n,5);return _.x(n,a.f(f),7);case 7:return n["return"](n.f);case 5:throw m=_.Cf(n),a.h.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],m),new _.L(_.M,4,4030,"Failed to fetch the media segment.");}})},WB=function(a){this.ba=a},XB=function(a,b){a.ba.forEach(function(c){c.codecs=b.join(",")})},YB=function(a,b){a.ba.forEach(function(c){c.width=b})},ZB=function(a,b){a.ba.forEach(function(c){c.height=b})},$B=function(a,b){a.ba.forEach(function(c){c.frameRate=
|
|
14
|
+
b})},aC=function(a,b){a.ba.forEach(function(c){c.bandwidth=b})},bC=function(a,b){return a.ba.some(function(c){return c.id===b})},cC=function(a,b){var c=a.ba.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},dC=function(a,b){var c=a.map(function(d){return d.ba[b]});return c.some(function(d){return null==d})?null:c},eC=function(a){this.a=a},fC=function(a,b){var c=a.map(function(d){return d.a[b]});return c.some(function(d){return null==
|
|
15
|
+
d})?null:c},iC=function(a,b,c,d){var e=a[0].length();e=JB(e).map(function(f){var g=fC(a,f)||[],h=dC(b,f)||[],l=dC(c,f)||[];return gC({variants:g,textStreams:h,thumbStreams:l,zj:d&&0===f})});hC(e);return e},lC=function(a){if(1===a.length)return a[0];var b=a[0],c=a.reduce(function(e,f){return e+f.duration},0),d=new Map;a.forEach(function(e,f){var g=W.qf(e);0<f&&jC(g,e.startTime);g.forEach(function(h){var l=h.nc;d.has(l)?d.get(l).push(h):d.set(l,[h])})});W.Wd(b,function(e){var f=d.get(e.nc),g=f.flatMap(function(h){return h.U});
|
|
16
|
+
f=f.map(function(h){return{keyInfo:h.keyInfo,type:h.Vf,drmInfos:h.drmInfos,keyId:h.keyId}});f=kC.ya(f);e.keyInfo=f.keyInfo;e.Vf=f.type;e.encrypted=f.type===xB;e.drmInfos=f.drmInfos;e.keyId=f.keyId;e.U=g;e.segmentIndex.replace(g)});return Object.assign({},b,{duration:c,endTime:a[0].startTime+c})},gC=function(a){var b=a.variants,c=a.textStreams,d=a.thumbStreams,e=a.zj;a=_.nf(b.flatMap(function(g){return[g.video,g.audio]})).concat(_.nf(c),_.nf(d)).filter(Boolean);var f=a[0].Za;e=e?f:0;jC(a,0);mC(a);
|
|
17
|
+
0<e&&jC(a,e);a=a[0];f=a.Lb;return{variants:b,textStreams:c,thumbStreams:d,startTime:0,id:"P"+f,endTime:a.pd,duration:a.duration+e,Lb:f}},hC=function(a){for(var b=0;b<a.length;b++){var c=a[b],d=a[b-1];c.startTime=d?d.endTime:0;c.endTime=c.startTime+c.duration}},jC=function(a,b){a.forEach(function(c){var d=-c.Za+b;c.segmentIndex.offset(d);c.pd+=d;c.Za=b})},mC=function(a){var b=nC(a);a.forEach(function(c){_.Dw(c.segmentIndex,b);c.duration=b;c.pd=c.Za+b})},nC=function(a){var b=Infinity;W.Pi(a).forEach(function(c){b=
|
|
18
|
+
Math.min(b,c.duration)});return b},oC=function(){var a=this;this.a=this.C=null;this.I=1;this.f=new LB;this.m="";this.K=new FB;this.H=0;this.A=new Map;this.g=new _.aj(function(){a.Db()});this.j=_.jv;this.D=null;this.o=new _.hi;this.B=null;this.h=new _.H("clpp.hls.HlsParser");this.w=new Map;this.F=new Map;this.M=new TB(this.ue.bind(this));this.J=!1},xC=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,v;return _.B(function(y){if(1==y.a)return e=pC,f=b.ba[0],g=qC(a,f),_.x(y,rC(a,g.toString()),2);if(3!=y.a){h=
|
|
19
|
+
y.f;l=h.response;m=h.text;n=sC(a,m,l.uri,f.nc);tC(n,f.codecs,f.type);if(1!==n.type)throw new _.L(_.M,4,4017);return _.x(y,uC(a,n,f.type,f.codecs),3)}p=y.f;q=p.flatMap(function(A){return A.U});f.U=q;f.segmentIndex.replace(q);_.pw(c,q,d);r=q[q.length-1];if(v=W.Sa(n.aa,gB))a.j=e.VOD,vC(a)&&a.g.stop(),_.mw(c,!0),c.f=r.endTime;_.z(y)})},qC=function(a,b){var c=new _.Lg(b.kh);if(a.a.hlsLowLatency){var d=c.a;if(b.Dd){var e=b.segmentIndex;if(e=e.a[e.a.length-1]){var f=e.a,g=f.length-1;e={Ej:e.position,Gk:f&&
|
|
20
|
+
0<f.length?g:null}}else e=null;f=e;e=f.Ej;f=f.Gk;null!==e&&(d.add("_HLS_msn",e),null!==f&&d.add("_HLS_part",f))}_.Wg(d);d.g&&_.Og(c,d)}return c},WC=function(a,b){var c,d,e,f,g,h,l,m,n,p,q;return _.B(function(r){if(1==r.a){c=_.xn;d=W;e=sC(a,b,a.m,"");if(1===e.type){a.w.set(a.m,e);f=e.U[0].a;var v=_.Zg(f)||"";g=null!=_.$g.video[v]?_.Re:null!=_.$g.audio[v]?_.lc:null;h="";g===c.VIDEO?h="avc1.42E01E":g===c.AUDIO&&(h="mp4a.40.2");v=a.K;var y=a.m,A=a.a.hlsDefaultCodecs||h,E=[],F=[];F.push(new _.fh(_.la,
|
|
21
|
+
"0"));F.push(new _.fh(_.wb,y));A.length&&F.push(new _.fh(_.na,A));E.push(new _.dh(v.a++,oB,F));e=new BB(y,0,E)}l=W.Ck(e.aa);return _.x(r,yC(a,l),2)}m=r.f;if(!a.C)throw new _.L(_.M,7,7001);n=d.gj(m[0]);p=UC(a,n.delay,m);if(!vC(a)){a.H=n.vd;A=0;y=_.u(a.f.values());for(v=y.next();!v.done;v=y.next())A=Math.max(A,v.value.ba[0].Za);for(y=0;95443.7176888889<=A;)y+=95443.7176888889,A-=95443.7176888889;if(y)for(a.h.debug("Offsetting live streams by",y,"to compensate for rollover"),A=_.u(a.f.values()),v=A.next();!v.done;v=
|
|
22
|
+
A.next())v=v.value.ba[0],95443.7176888889>v.Za?(a.h.debug("Offset applied to",v.type),v.segmentIndex.offset(y)):a.h.debug("Offset NOT applied to",v.type)}v=W.ij(m);"LIVE"===a.j||"EVENT"===a.j?(v=Math.max(v,p.F),isNaN(a.a.availabilityWindowOverride)||(v=a.a.availabilityWindowOverride),p.m=v):a.j===_.jv&&VC(p,v,m);q={presentationTimeline:p,periods:m,offlineSessionIds:[],minBufferTime:0};a.h.debug("HLS playlist parsed",q);return r["return"](q)})},yC=function(a,b){var c,d,e,f,g,h,l;return _.B(function(m){switch(m.a){case 1:c=
|
|
23
|
+
W.yk(b.Nc.closedCaptions);for(var n=new Map,p=_.u(b.bh),q=p.next();!q.done;q=p.next()){var r=q.value,v=_.eh(r,"AUDIO");q=_.eh(r,_.Db);var y=_.eh(r,"SUBTITLES");r=XC(a,r);if(y){var A=_.Yg(_.Ce,r);n.set(y,A);y=r.indexOf(A);-1<y&&r.splice(y,1)}v&&(y=YC(_.lc,r),n.set(v,y));q&&(v=YC(_.Re,r),n.set(q,v))}d=n;return _.x(m,ZC(a,b.Nc.oh,d),2);case 2:return e=m.f,_.x(m,$C(a,b.bh,e,c),3);case 3:return f=m.f,_.x(m,aD(a,b.Nc.Zk,d),4);case 4:return g=m.f,_.x(m,bD(a,b.pj),5);case 5:return h=m.f,l=iC(f,g,h,!vC(a)),
|
|
24
|
+
l=[lC(l)],a.C.filterAllPeriods(l),m["return"](l)}})},aD=function(a,b,c){return Promise.all(b.map(function(d){return cD(a,d,c)}))},bD=function(a,b){return Promise.all(b.map(function(c){return dD(a,c)}))},ZC=function(a,b,c){var d,e,f;return _.B(function(g){if(1==g.a){d=b.filter(function(h){return""!==(_.eh(h,_.wb)||"")});if(0===d.length)return g["return"](new Map);e=[cD(a,d[0],c)];return _.x(g,e[0],2)}if(3!=g.a)return e=e.concat(d.slice(1).map(function(h){return cD(a,h,c)})),_.x(g,Promise.all(e),3);
|
|
25
|
+
f=g.f;return g["return"](W.al(f))})},$C=function(a,b,c,d){var e,f,g,h,l,m,n,p,q,r,v;return _.B(function(y){if(1==y.a){e=new Set;f=_.nf(b).concat();g=0;h=Infinity;for(l=0;l<f.length;++l)m=Number(zB(f[l],_.la)),m<h&&(h=m,g=l);n=f.splice(g,1).pop();return _.x(y,eD(a,n,c,d,e),2)}if(3!=y.a)return p=y.f,q=f.map(function(A){return eD(a,A,c,d,e)}),_.x(y,Promise.all(q),3);r=y.f;r.splice(g,0,p);v=r.reduce(_.Lv,[]);return y["return"](v)})},eD=function(a,b,c,d,e){var f,g,h,l;return _.B(function(m){return 1==
|
|
26
|
+
m.a?(f=W,g=Number(zB(b,_.la)),h=f.Fk(b),_.x(m,fD(a,b,h,c,d),2)):(l=m.f)?m["return"](gD(a,l,g,e)):m["return"]([])})},fD=function(a,b,c,d,e){var f,g,h,l,m,n,p,q,r,v,y,A,E,F;return _.B(function(D){if(1==D.a)return f=_.xn,g=XC(a,b),h=_.eh(b,"AUDIO"),l=_.eh(b,_.Db),n=(m=h||l)&&d.has(m)?d.get(m):[],p={audio:h?n:[],video:l?n:[]},a.h.debug("Guessing stream type for",b.toString()),r=!1,v=zB(b,_.wb),y=p.audio.find(function(J){return J.nc===v}),A=_.Yg(f.VIDEO,g),E=c||A,1!==g.length||E?!n.length&&1<g.length?
|
|
27
|
+
(a.h.debug("Guessing multiplexed audio+video"),q=f.VIDEO,g=[g.join(",")]):p.audio.length&&y?(a.h.debug(rB),q=f.AUDIO,r=!0):p.video.length?(a.h.debug(rB),q=f.AUDIO):(a.h.debug("Guessing video-only"),q=f.VIDEO):(q=f.AUDIO,a.h.debug(rB)),F=null,r?D.G(2):_.x(D,hD(a,b,g,q,e,c),3);2!=D.a&&(F=D.f);if(null==F)return D["return"](null);p[q]=[F];q===f.AUDIO&&c&&n.forEach(function(J){YB(J,c.width);ZB(J,c.height);$B(J,c.frameRate)});W.Ni(p);return D["return"](p)})},gD=function(a,b,c,d){var e=b.video,f=b.audio;
|
|
28
|
+
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=W.Li(g,m);if(d.has(l))a.h.debug("Skipping variant which only differs in text streams.");else{a:{for(var n=a,p=c,q=[],r=(m||g).length(),v=0;v<r;v++){var y=g?g.ba[v]||null:null,A=m?m.ba[v]||null:null,E=W.aj(y,A);if(!E){m=null;break a}var F=p;E={id:n.I++,language:y?y.language:_.Ie,primary:!!y&&y.primary||!!A&&A.primary,audio:y,video:A,
|
|
29
|
+
bandwidth:F,drmInfos:E,allowedByApplication:!0,allowedByKeySystem:!0};q.push(E)}m=new eC(q)}null==m?a.h.warn("Incompatible DRM info in HLS variant. Skipping."):(b.push(m),d.add(l))}}}return b},cD=function(a,b,c){var d;return _.B(function(e){d=zB(b,_.wb);return e["return"](iD(a,d,function(){var f,g,h,l,m,n,p,q,r,v,y,A;return _.B(function(E){if(1==E.a)return f=_.xn,g=zB(b,_.La),h=W.Hi(zB(b,"TYPE")),l=c.get(g)||"",m=W.Fe(b),n=_.eh(b,"NAME"),p=b.getAttribute("DEFAULT"),q=b.getAttribute("AUTOSELECT"),
|
|
30
|
+
r=_.eh(b,"CHANNELS"),v=h===f.AUDIO?r?parseInt(r.split("/")[0],10):null:null,y=!!p&&!!q,_.x(E,jD(a,{uri:d,codecs:l,type:h,language:m,primary:y,name:n,channelsCount:v,groupId:g,closedCaptions:null,xf:null}),2);A=E.f;return E["return"](A)})}))})},dD=function(a,b){var c;return _.B(function(d){c=zB(b,_.wb);return d["return"](iD(a,c,function(){var e,f,g,h,l;return _.B(function(m){if(1==m.a)return e=_.eh(b,_.na)||"jpg",f=W.Fe(b),g=_.eh(b,"NAME"),_.x(m,jD(a,{uri:c,codecs:e,type:_.od,language:f,name:g,primary:!1,
|
|
31
|
+
channelsCount:null,closedCaptions:null,groupId:null,xf:null}),2);h=m.f;(l=_.eh(b,_.la))&&aC(h,Number(l));return m["return"](h)})}))})},XC=function(a,b){var c=_.eh(b,_.na,a.a.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/),d=new Set,e=[];c=_.u(c);for(var f=c.next();!f.done;f=c.next()){f=f.value;var g=_.Zv(f)[0];d.has(g)?a.h.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},hD=function(a,b,c,d,e,f){var g,h;return _.B(function(l){g=_.xn;h=zB(b,_.wb);return l["return"](iD(a,
|
|
32
|
+
h,function(){var m,n,p,q;return _.B(function(r){if(1==r.a)return m=_.eh(b,bB),n=null,d===g.VIDEO&&m&&"NONE"!==m&&(n=e.get(m)),p=YC(d,c),_.x(r,jD(a,{uri:h,codecs:p,type:d,closedCaptions:n,primary:!1,language:null,name:null,channelsCount:null,groupId:null,xf:f}),2);q=r.f;return r["return"](q)})}))})},iD=function(a,b,c){if(a.f.has(b))return a=a.f.get(b),Promise.resolve(a);if(a.f.a.has(b))return a.f.a.get(b)||null;c=c();a.f.set(b,c);return c},jD=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,v,y,A,E,F,D,J,
|
|
33
|
+
ja,P,Na,pa,ta,Fa,Ka,wa,Aa;return _.B(function(Ba){switch(Ba.a){case 1:c=kD;d=_.aB;e=_.xn;f=W;g=b;h=g.uri;l=g.codecs;m=g.type;n=g.language;p=g.groupId;q=g.primary;r=g.name;v=g.channelsCount;y=g.closedCaptions;A=g.xf;E=W.dd(a.m,h);if(vC(a)&&a.w.has(E)){F=a.w.get(E);a.w["delete"](E);Ba.G(2);break}return _.x(Ba,rC(a,E),3);case 3:D=Ba.f,J=D.response,ja=D.text,E=J.uri,F=sC(a,ja,E,h),tC(F,l,m);case 2:if(1!==F.type)throw new _.L(_.M,4,4017);P=W.Dk(F.aa);a.j=P;vC(a)&&a.g.stop();Na=W.Bk(F.aa,P,a.a.hlsLowLatency||
|
|
34
|
+
!1);return _.x(Ba,uC(a,F,m,l),4);case 4:return pa=Ba.f,ta=a.a.hlsLowLatency?d.pl:d.ql,Fa=void 0,m===e.TEXT&&(Fa=_.ye),Ka=f.Mg(F.aa),wa=Ka.Dd,Aa=pa.map(function(gb){var Ab=gb.U,qb=gb.Oi,ff=gb.mimeType;gb=gb.Lb;var Ri=Ab[0].startTime,Si=Ab[Ab.length-1].endTime,Ti=Si-Ri,Eb=new _.zw(Ab),mc=Ab[0].initSegment||null;return{id:a.I++,originalId:r,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Eb.Dc.bind(Eb),getSegmentReference:Eb.get.bind(Eb),adjustSegmentDurations:Eb.Vc.bind(Eb),getDuration:Eb.getDuration.bind(Eb),
|
|
35
|
+
segmentIndex:Eb,segmentLookupStrategy:ta,initSegmentReference:mc,mimeType:ff,codecs:l,kind:Fa,Vf:qb.type,encrypted:qb.type===c.hh,keyId:qb.keyId,language:n||_.Ie,label:r,type:m,primary:q,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:A?A.frameRate:void 0,width:A?A.width:void 0,height:A?A.height:void 0,bandwidth:void 0,roles:[],channelsCount:v,closedCaptions:y,keyInfo:qb.keyInfo,U:Ab,drmInfos:qb.drmInfos,Lb:gb,nc:h,kh:E,Za:Ri,pd:Si,duration:Ti,Dd:wa,groupId:p,Bj:Na}}),Ba["return"](new WB(Aa))}})},
|
|
36
|
+
sC=function(a,b,c,d){a:{a=a.K;b=b.trim().split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.L(_.M,4,4015);var e=0;for(var f=!0,g=_.u(b),h=g.next();!h.done;h=g.next())if(h=h.value,h=h.trim(),!h.length||W.Le(h)||f)f=!1;else if(h=_.Uh(0,h),GB.includes(h.name)){e=1;break}else h.name===oB&&(f=!0);f=[];g=!0;h=_.u(_.$A(b));for(var l=h.next();!l.done;l=h.next()){var m=l.value;l=m.Je;var n=m.item;m=m.next;n=n.trim();if(!n.length||W.Le(n)||g)g=!1;else{n=_.Uh(a.a++,n);if(lD.includes(n.name)){if(1!==
|
|
37
|
+
e)throw new _.L(_.M,4,4017);b=b.splice(l,b.length-l);a=IB(a,c,b);c=new BB(c,e,f.concat(a.aa),a.U);break a}f.push(n);n.name===oB&&(n.attributes.push(new _.fh(_.wb,m)),g=!0)}}c=new BB(c,e,f)}c.a=d;mD(c);return c},mD=function(a){1===a.type&&a.U.slice(1).forEach(function(b){if(W.Ie(b.aa,iB))throw new _.L(_.M,4,4045,"Media playlist contains one or more EXT-X-MAP tags that are not located at the beginning of the playlist. This is valid, but not yet supported.");})},tC=function(a,b,c){if(1===a.type&&(a=
|
|
38
|
+
a.U.map(function(d){return d.a?d.a:d.f.map(function(e){return _.eh(e,_.wb)})||null}).map(function(d){return _.ah(d,c,b)}),1<(new Set(a)).size))throw new _.L(_.M,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");},UC=function(a,b,c){var d=!0,e=null,f=0;vC(a)||(d=!1,e=0,f=b);var g=new _.lw(e,f,!0);_.mw(g,d);W.Wd(c,function(h,l){_.pw(g,h.U,l.startTime)});return g},nD=function(a,b,c){a=W.Ic(a.aa,iB);if(1<a.length)throw new _.L(_.M,4,4020);
|
|
39
|
+
a=a[0];if(!a)return null;var d=zB(a,_.wb),e=W.dd(b,d);b=W.Jg(a,null,!0);return new _.Pv(function(){return[e]},b.sa,b.ea,c)},oD=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.$A(b.f));for(var m=b.next();!m.done;l={ce:l.ce},m=b.next()){var n=m.value;m=n.Je;n=n.item;var p=0===m,q=p?a:h[h.length-1],r=p?d:q.endTime,v=Number(_.eh(n,"DURATION"));v=r+v;p=W.Jg(n,p?null:q.ea,p);q=_.eh(n,_.wb);q=W.dd(g,q);l.ce=q?[q]:[];r=new DB(c,r,v,function(y){return function(){return y.ce}}(l),p.sa,p.ea,e,f,!1,null,null,null,
|
|
40
|
+
null);if("YES"===_.eh(n,"INDEPENDENT")||0===m)r.g=!0;h.push(r)}return h},pD=function(a,b,c,d,e,f,g,h,l,m,n){var p=c.aa,q=c.a,r=null!=q,v=q?[q]:[];if(!r&&!a.a.hlsLowLatency)return null;a=0;q={sa:0,ea:null};var y=null;r?(c=W.Ak(p).duration,a=e+c,q=W.Kg(p,b?b.ea:null)):(b=oD(b,c,d,e,f,g,l),a=b[b.length-1].endTime,y=b);h=h===_.od?W.Ek(p):null;d=new DB(d,e,a,function(){return v},q.sa,q.ea,f,g,!1,null,h?h.fg:null,h?h.ah:null,h?h.durationPerTile:null,y);d.Lb=m;d.initSegment=n||void 0;return d},uC=function(a,
|
|
41
|
+
b,c,d){var e,f,g,h,l,m,n,p,q,r,v,y,A,E;return _.B(function(F){switch(F.a){case 1:e=W;f=qD;g=b.a;h=b.U;l=e.ej(b.aa,jB);m=[];var D=a.f.get(b.a);n=qD.cj(b,D,!vC(a));return _.x(F,rD(a,b.f,g,h,l,c,d),2);case 2:p=F.f,q=l,r=f.Xk(h),v=0;case 3:if(!(v<r.length)){F.G(5);break}y=r[v];A=m[m.length-1]||null;return _.x(F,sD(a,g,b.f,y,n+v,q,p,c,d,A),6);case 6:E=F.f;m.push(E);p=E.endTime;q+=y.length;v++;F.G(3);break;case 5:return F["return"](m)}})},rD=function(a,b,c,d,e,f,g){var h,l,m,n,p,q;return _.B(function(r){if(1==
|
|
42
|
+
r.a)return h=d[0],null!=a.B?r["return"](a.B):_.x(r,tD(a,f,g,h),2);if(3!=r.a)return l=r.f,m=kC.Lg([h],a.m,l,null)[0],n=nD(h,b,m.keyInfo),p=W.De(m.keyInfo,e),_.x(r,uD(a,c,n,h,e,p,l,g),3);q=r.f;a.h.debug("Setting playlist start time to "+q+".");a.B=q;return r["return"](q)})},sD=function(a,b,c,d,e,f,g,h,l,m){var n,p,q,r,v,y,A,E,F,D,J,ja,P,Na,pa,ta,Fa,Ka,wa,Aa;return _.B(function(Ba){switch(Ba.a){case 1:return n=W,p=kC,q=d[0],r=null==m,_.x(Ba,tD(a,h,l,q),2);case 2:v=Ba.f;y=p.Lg(d,a.m,v,m?m.Aj:null);A=
|
|
43
|
+
y[y.length-1];E=kC.ya(y);F=nD(q,c,E.keyInfo)||(m?m.rj:null);D=W.De(E.keyInfo,f);if(r&&vC(a)){J=0;Ba.G(3);break}return _.x(Ba,vD(a,e,b,F,q,f,D,v,l,g),4);case 4:J=Ba.f;case 3:ja=J;P=[];for(Na=0;Na<d.length;Na++)pa=d[Na],ta=P[P.length-1]||null,Fa=0===Na?g:ta.endTime,Ka=f+Na,wa=n.De(E.keyInfo,Ka),(Aa=pD(a,ta,pa,Ka,Fa,ja,wa,h,c,e,F))&&P.push(Aa);return Ba["return"]({U:P,Oi:E,Aj:A,mimeType:v,endTime:P[P.length-1].endTime,Lb:e,rj:F})}})},vD=function(a,b,c,d,e,f,g,h,l,m){var n,p;return _.B(function(q){if(1==
|
|
44
|
+
q.a)return n=0,a.F.has(b)?(n=a.F.get(b),q.G(2)):_.x(q,uD(a,c,d,e,f,g,h,l),3);2!=q.a&&(p=q.f,n=p-m,a.h.debug("Segment #"+f+" has timestamp offset "+(n+" s")),a.F.set(b,n));return q["return"](n)})},uD=function(a,b,c,d,e,f,g,h){var l,m;return _.B(function(n){if(null==d.a)return n["return"](0);var p;p=(p=a.f.get(b))?(p=cC(p,e))?p.startTime:null:null;l=p;if(null!=l)return a.h.debug("Found segment start time in previous manifest"),n["return"](l);a.h.debug("Unable to find segment start time in previous manifest!");
|
|
45
|
+
m=W.Ki(d,f);return n["return"](VB(a.M,c,m,g,h,null!=f))})},YC=function(a,b){if(1===b.length)return b[0];var c=_.Yg(a,b);if(null!=c)return c;throw new _.L(_.M,4,4025,{codecList:b});},tD=function(a,b,c,d){var e,f,g;return _.B(function(h){e=d.a;g=(f=W.Sa(d.aa,iB))?zB(f,_.wb):null;return h["return"](wD(a,b,c,e,g))})},wD=function(a,b,c,d,e){var f,g,h,l,m;return _.B(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.bh(f,b,c))return n["return"](g);h=_.Zh([d],a.a.attemptParameters);h.method="HEAD";h.type=
|
|
46
|
+
2;return _.x(n,a.ue(h),2)}l=n.f;m=l.headers["content-type"];if(!m)throw new _.L(_.M,4,4021,f.join(", "));return n["return"](m.split(";")[0])})},VC=function(a,b,c){a.f=b;b=c[0];var d=W.dg(b);a.offset(-d.Za);W.Wd(b,function(e){e.segmentIndex.offset(-d.Za);_.Dw(e.segmentIndex,d.duration)})},rC=function(a,b){var c,d,e;return _.B(function(f){if(1==f.a)return c=_.Zh([b],a.a.attemptParameters),c.type=1,_.x(f,a.ue(c),2);d=f.f;e="";try{e=_.wh(d.data)}catch(g){throw new _.L(_.M,4,4042);}e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,
|
|
47
|
+
"\n");e=e.trim();return f["return"]({text:e,response:d})})},vC=function(a){return a.j===_.jv},xD=function(){};_.w(DB,_.Qv);
|
|
48
|
+
var kD={hh:xB,vl:yB,NONE:_.Kd},pC={VOD:_.jv,ml:"EVENT",LIVE:"LIVE"},W={Ic:function(a,b){return a.filter(function(c){return c.name===b})},Ae:function(a,b){var c=Array.isArray(b)?b:[b];return a.filter(function(d){d=zB(d,"TYPE");return c.includes(d)})},Ie:function(a,b){return a.some(function(c){return c.name===b})},Sa:function(a,b,c){c=void 0===c?{}:c;a=a.find(function(d){return d.name===b})||null;if(!a&&c.required)throw new _.L(_.M,4,4024,{missingTag:b});return a},eg:function(a,b){return W.Sa(a,b,{required:!0})},
|
|
49
|
+
ej:function(a,b,c){c=void 0===c?0:c;return(a=W.Sa(a,b))?Number(a.value):c},Hl:function(a,b,c){return a.filter(function(d){var e=d.getAttribute("TYPE");d=d.getAttribute(_.La);return e.value==b&&d.value==c})},Ek:function(a){a=W.Sa(a,"EXT-X-TILES");if(!a)return{fg:1,ah:1,durationPerTile:null};var b=_.eh(a,"LAYOUT")||"1x1";a=(a=_.eh(a,"DURATION"))?Number(a):null;var c=_.u(b.split("x").map(function(d){return parseInt(d,10)}));b=c.next().value;c=c.next().value;return{fg:b,ah:c,durationPerTile:a}},dd:function(a,
|
|
50
|
+
b){return _.Nv([a],[b])[0]},Le:function(a){return/^#(?!EXT)/m.test(a)},Wd:function(a,b){Array.isArray(a)||(a=[a]);a.forEach(function(c){for(var d=_.u(W.qf(c)),e=d.next();!e.done;e=d.next())b(e.value,c)})},qf:function(a){var b=new Set;a.variants.forEach(function(c){c.audio&&b.add(c.audio);c.video&&b.add(c.video)});a.textStreams.forEach(function(c){return b.add(c)});a.thumbStreams.forEach(function(c){return b.add(c)});return Array.from(b)},ph:function(a){return W.qf(a).filter(W.jg)},Dk:function(a){var b=
|
|
51
|
+
W.Sa(a,lB);if(W.Sa(a,gB))return _.jv;if(!b)return"LIVE";if(b.value===_.jv)return _.jv;if("EVENT"===b.value)return"EVENT";throw new _.L(_.M,4,4044,"Invalid EXT-X-PLAYLIST-TYPE value: "+b.value);},Hi:function(a){a={AUDIO:_.lc,VIDEO:_.Re,SUBTITLES:_.Ce,"CLOSED-CAPTIONS":_.Ce}[a.toUpperCase()];if(!a)throw new _.L(_.M,4,4044,"EXT-X-MEDIA tag has an invalid TYPE attribute.");return a},Ig:function(a,b,c){c=void 0===c?!1:c;var d=0,e=null;if(a){d=a.split("@");a=Number(d[0]);if(0>=a)throw new _.L(_.M,4,4044,
|
|
52
|
+
"Byte range length must be positive.");if(d[1]){if(d=Number(d[1]),0>d)throw new _.L(_.M,4,4044,"Byte range start byte must not be negative.");}else{if(c)throw new _.L(_.M,4,4044,"Invalid byte range, offset is required but missing.");if(null==b)throw new _.L(_.M,4,4044,"Invalid byte range, cannot calculate offset based on previous byte ranges.");d=b+1}e=d+a-1}return{sa:d,ea:e}},Kg:function(a,b){var c=W.Sa(a,dB);return W.Ig(c?c.value:null,b)},Ak:function(a){a=W.eg(a,"EXTINF").value.split(",");return{duration:Number(a[0]),
|
|
53
|
+
title:a[1]||null}},Mg:function(a,b){function c(f){return null==f?null:Number(f)}b=void 0===b?{}:b;var d={Dd:!1,sh:!1,th:null,oj:null,Ng:null},e=W.Sa(a,nB,{required:b.Sg});if(!e)return d;d.Dd="YES"===_.eh(e,"CAN-BLOCK-RELOAD");d.sh="YES"===_.eh(e,"CAN-SKIP-DATERANGES");d.th=c(_.eh(e,"CAN-SKIP-UNTIL"));d.oj=c(_.eh(e,"HOLD-BACK"));d.Ng=c(_.eh(e,"PART-HOLD-BACK",void 0,{required:b.Sg}));return d},Jg:function(a,b,c){c=void 0===c?!1:c;a=_.eh(a,"BYTERANGE");return W.Ig(a,b,c)},Ck:function(a){var b=W.Ic(a,
|
|
54
|
+
"EXT-X-MEDIA"),c=W.Ic(a,oB);a=W.Ic(a,"EXT-X-IMAGE-STREAM-INF");return{Nc:{oh:W.Ae(b,["AUDIO",_.Db]),closedCaptions:W.Ae(b,bB),Zk:W.Ae(b,"SUBTITLES")},bh:c,pj:a}},Ki:function(a,b){var c=W.Kg(a.aa,null);return new DB(0,0,0,function(){return[a.a]},c.sa,c.ea,0,b)},De:function(a,b){if(null==a)return null;var c=Object.assign({},a);null==c.iv&&(c.iv=_.Rh(new Uint8Array(12),new Uint8Array([b>>24&255,b>>16&255,b>>8&255,b&255])));return c},kj:function(a){var b=a.U;a=b[0].startTime;b=b[b.length-1].endTime;return{Za:a,
|
|
55
|
+
pd:b,duration:b-a}},dg:function(a){var b=Infinity,c=Infinity;W.ph(a).forEach(function(d){d=W.kj(d);b=Math.min(b,d.Za);c=Math.min(c,d.duration)});return{Za:b,duration:c}},jg:function(a){return a.type===_.lc||a.type===_.Re},Pi:function(a){return a.filter(W.jg)},ij:function(a){return a.map(function(b){return W.dg(b).duration}).reduce(function(b,c){return b+c},0)},aj:function(a,b){return a&&b?_.Wv(a.drmInfos,b.drmInfos)?_.Vv(a.drmInfos,b.drmInfos):null:a?a.drmInfos:b?b.drmInfos:null},Li:function(a,b){return(b?
|
|
56
|
+
b.ba[0].nc:"")+" - "+(a?a.ba[0].nc:"")},Bk:function(a,b,c){if(b===_.jv)return{delay:0,vd:0};b=W.Sa(a,kB);if(c&&b)return c=Number(zB(b,"PART-TARGET")),{delay:W.Mg(a,{Sg:!0}).Ng,vd:c};a=W.eg(a,pB);a=Number(a.value);return{delay:3*a,vd:a}},gj:function(a){var b=[];W.Wd(a,function(c){b.push(c.Bj)});return{delay:Math.max.apply(Math,_.nf(b.map(function(c){return c.delay}))),vd:Math.min.apply(Math,_.nf(b.map(function(c){return c.vd})))}},al:function(a){var b=new Map;a.forEach(function(c){var d=c.ba[0].groupId;
|
|
57
|
+
b.has(d)?(d=b.get(d),d.includes(c)||d.push(c)):b.set(d,[c])});return b},Fe:function(a){a=_.eh(a,"LANGUAGE")||_.Ie;return _.gh(a)},yk:function(a){var b=new Map;a=_.u(a);for(var c=a.next();!c.done;c=a.next()){var d=c.value;c=W.Fe(d);var e=zB(d,_.La);d=zB(d,"INSTREAM-ID");b.has(e)||b.set(e,new Map);b.get(e).set(d,c)}return b},Ni:function(a){a=_.u(a.audio.concat(a.video));for(var b=a.next();!b.done;b=a.next()){b=b.value;var c=b.ba[0].codecs.split(",").filter(function(d){return"mp4a.40.34"!==d});XB(b,
|
|
58
|
+
c)}},Fk:function(a){if(null==a.getAttribute("FRAME-RATE")&&null==a.getAttribute(_.jb))return null;var b=_.eh(a,"FRAME-RATE");a=_.eh(a,_.jb);var c=_.u(a?a.split("x"):[null,null]);a=c.next().value;c=c.next().value;return{frameRate:EB(b),width:EB(a),height:EB(c)}}},lD=["EXTINF",dB,"EXT-X-DATERANGE",eB,hB,iB,"EXT-X-PROGRAM-DATE-TIME"],GB=[fB,gB,"EXT-X-I-FRAMES-ONLY",jB,kB,lB,nB,pB],HB=["EXT-X-PART",mB];_.t=LB.prototype;
|
|
59
|
+
_.t.set=function(a,b){var c=this;this.a.set(a,b);return b.then(function(d){return c.f.set(a,d)})["catch"](function(){}).then(function(){return c.a["delete"](a)})};_.t.has=function(a){return this.f.has(a)};_.t.get=function(a){return this.f.get(a)||null};_.t.values=function(){return Array.from(this.f.values())};_.t.clear=function(){this.a.clear();this.f.clear()};
|
|
60
|
+
var qD={cj:function(a,b,c){var d=W.Sa(a.aa,fB);if(d)return Number(d.value);d=qD.tj(b);if(c&&d)try{return qD.qj(a,b)}catch(e){throw new _.L(_.M,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");}return 0},tj:function(a){return 0<qD.fj(a)},Xk: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,W.Ie(d.aa,eB)&&0<c.length&&(b.push(c),c=[]),c.push(d);b.push(c);return b},fj:function(a){if(!a)return 0;a=a.ba[a.ba.length-
|
|
61
|
+
1].U;return a[a.length-1].Lb},qj:function(a,b){var c=W.Sa(a.aa,jB);if(!c)throw qD.h.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(qB);c=Number(c.value);var d=cC(b,c);if(!d)throw qD.h.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist (segment position \x3d "+(c+")")),Error(qB);return d.Lb}};qD.h=new _.H("clpp.hls.DiscontinuityUtils");var yD={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Se)throw new _.L(_.M,4,4041);if(zB(a,sB)===vB)throw new _.L(_.M,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.Ov(_.Sc,[{initDataType:_.oe,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":SB,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":SB,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=zB(a,sB);if(!QB.includes(b))return RB.error("Widevine in HLS is only supported with [",
|
|
62
|
+
QB.join(", "),"], not",b),null;b=zB(a,_.wb);b=_.aq(b);b=_.N(b.data);b=_.Ov(_.Uc,[{initDataType:_.Dc,initData:b}],"");if(a=_.eh(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},QB=["SAMPLE-AES",vB],RB=new _.H("clpp.hls.DrmParser");var kC={Lg:function(a,b,c,d){if(null===d){if(a.slice(1).some(kC.gg))throw new _.L(_.M,4,4046,uB);if((d=kC.df(a[0].aa,b,c))&&d.type===yB){if(0<kC.Nd(a.slice(1)).length)throw new _.L(_.M,4,4046,tB);return[d]}a=kC.Nd(a).map(function(e){return kC.df(e.aa,b,c)});return 0===a.length?[{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null}]:a}if(a.some(kC.gg))throw new _.L(_.M,4,4046,uB);if(d.type===yB){if(0<kC.Nd(a).length)throw new _.L(_.M,4,4046,tB);return[d]}d=d.type===xB?[d]:[];a=kC.Nd(a).map(function(e){return kC.df(e.aa,
|
|
63
|
+
b,c)});return d.concat(a)},ya:function(a){if(0===a.length)return{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null};if(a.some(function(c){return c.type===yB})||a.every(function(c){return c.type===_.Kd}))return a[0];a=a.filter(function(c){return c.type===xB});var b=Array.from((new Set(a.flatMap(function(c){return c.drmInfos}))).values());return{keyInfo:null,keyId:a[a.length-1].keyId,type:xB,drmInfos:b}},gg:function(a){return W.Ic(a.aa,hB).some(function(b){return"AES-128"===_.eh(b,sB)})},Nd:function(a){return a.filter(function(b){return W.Ie(b.aa,
|
|
64
|
+
hB)})},df:function(a,b,c){a=W.Ic(a,hB);if(0===a.length)return null;var d=zB(a[0],sB);if(1===a.length){if("NONE"===d)return{type:_.Kd,keyInfo:null,drmInfos:[],keyId:null};if("AES-128"===d)return a=a[0],d=_.eh(a,"IV",""),{type:yB,keyInfo:{method:"AES-128",url:W.dd(b,zB(a,_.wb)),iv:d?_.Oh((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(function(e){return zB(e,sB)});if(!b.every(function(e){return"SAMPLE-AES"===e})&&!b.every(function(e){return e===vB}))throw kC.h.warn("EXT-X-KEY methods "+b.join(", ")+
|
|
65
|
+
" are incompatible."),new _.L(_.M,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(function(e){var f=_.eh(e,"KEYFORMAT","identity"),g=yD[f]||null;(e=g?g(e,c):null)||kC.h.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.L(_.M,4,4026);return{keyInfo:null,keyId:b.map(function(e){return e.keyIds}).reduce(function(e,f){return e.concat(f)},[]).reverse()[0]||null,type:xB,drmInfos:b}},Ll:function(){return{type:_.Kd,keyInfo:null,drmInfos:[],
|
|
66
|
+
keyId:null}}};kC.h=new _.H("clpp.hls.EncryptionUtils");WB.prototype.length=function(){return this.ba.length};eC.prototype.length=function(){return this.a.length};_.t=oC.prototype;_.t.configure=function(a){this.a=a;this.M.a=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.A.clear();for(var c=_.u(this.f.values()),d=c.next();!d.done;d=c.next())d=d.value,(null!=b&&bC(d,b)||null!=a&&bC(d,a))&&this.A.set(d.ba[0].nc,d)};
|
|
67
|
+
_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.B(function(l){if(1==l.a){if(c.J)throw Error("start() may be called only once!");c.J=!0;c.C=b;return _.x(l,rC(c,a),2)}if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.m=e.uri,_.x(l,WC(c,f),3);g=l.f;c.D=g;h=c.H;0<h&&c.g.Z(h);return l["return"](g)})};_.t.stop=function(){this.g&&(this.g.stop(),this.g=null);var a=[];this.o&&(a.push(this.o.destroy()),this.o=null);this.f.clear();this.A.clear();this.a=this.C=null;this.w.clear();this.D=null;return Promise.all(a)};
|
|
68
|
+
_.t.onExpirationUpdated=function(){};_.t.update=function(){var a=this,b,c,d,e,f,g,h,l;return _.B(function(m){if(1==m.a){b=a.D;if(vC(a)||!b)return m["return"]();c=b.presentationTimeline;d=b.periods[0].startTime;e=[];"LIVE"===a.j&&(a.B=null);f=Array.from(a.f.values());g=Array.from(a.A.values());h=a.a.hlsLowLatency&&0<g.length?g:f;return _.x(m,xC(a,h[0],c,d),2)}for(l=1;l<h.length;l++)e.push(xC(a,h[l],c,d));return _.x(m,Promise.all(e),0)})};
|
|
69
|
+
_.t.Db=function(){var a=this,b,c,d;return _.B(function(e){if(1==e.a){a.h.debug(_.iv);if(!a.C)return e["return"]();_.Af(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.H,a.g.Z(b),_.Bf(e,0);c=_.Cf(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.g.Z(.1));_.z(e)})};_.t.ue=function(a){if(!this.o)throw new _.L(_.M,7,7001);a=this.C.networkingEngine.fetch(a);_.ii(this.o,a);return a.O};_.w(xD,_.Ko);xD.prototype.Ma=function(){_.Hp.m3u8=oC;_.Fp[_.Lj]=oC;_.Fp[wB]=oC};xD.prototype.Fa=function(){_.Iw("m3u8");_.Jw(_.Lj);_.Jw(wB)};xD.prototype.id=function(){return"hls"};_.C("clpp.hls.HlsComponent",xD);};
|
|
51
70
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
52
71
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
53
72
|
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=_.nd,a.a.on(c,_.
|
|
6
|
-
a.l.getTrackManager().
|
|
7
|
-
_.C("clpp.hlssmpte.HlsSmptePlugin",
|
|
2
|
+
var f=function(window){var NK=function(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.K.R(a)){a:{var b=a.info;if(_.K.Y(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=_.K.Y(a)?a:null}},PK=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.eg;this.g=(a=_.bq[_.ic]||null)?new a(this.l.getConfiguration()):null;this.h=new _.H("clpp.hlssmpte.ImageCueHandler");this.f=null;OK(this)},OK=function(a){a.a.one(a.l,_.wd,function(){return QK(a)})},
|
|
3
|
+
QK=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.g){a.a.on(b.textTracks,_.Yb,function(d){return RK(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Cd}).forEach(function(d){RK(a,{track:d})});!SK(c)&&a.m&&(a.h.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),TK(a,b))}else a.h.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.h.warn("A video element is not available. Skipping.")},
|
|
4
|
+
SK=function(a){return a.some(function(b){return b.kind===_.Cd})},TK=function(a,b){var c=a.l.getTrackManager(),d=c.pa(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.va(d)};a.a.on(b.textTracks,_.Yb,function(g){g.track.kind===_.Cd&&(a.a.off(b.textTracks,_.Yb,f),f())});c.va(e)}else a.h.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},RK=function(a,b){var c=b.track;c.kind===_.Cd&&(a.h.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.nd,a.a.on(c,_.Xc,function(d){return UK(a,d)}))},UK=function(a,b){var c=VK(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 NK(d);if(e.f===c&&null!==e.a){a.f=d;d=a.g.parseMedia(_.Ah(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});var f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},VK=function(a){return(a=
|
|
6
|
+
a.l.getTrackManager().qa())&&a.language&&a.language.toLowerCase()},WK=function(){this.a=null;this.f=!1},XK=function(){};PK.prototype.destroy=function(){this.a.release();this.f=null;return Promise.resolve()};_.w(WK,_.nq);WK.prototype.onPlayerCreated=function(){};WK.prototype.onContentWillLoad=function(a){if(this.f=_.hj()){var b=a.getConfiguration();b=_.K.Qa(b.hlssmpte||{});_.K.kg(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.la(b.timestampOffset)||(b.timestampOffset=0);this.a=new PK(a,b.patchMetadataTrack,b.timestampOffset)}};WK.prototype.onPlayerWillDestroy=function(){var a=this;return _.B(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.G(0);a.a=null;_.z(b)})};WK.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.C("clpp.hlssmpte.HlsSmptePlugin",WK);WK.Id="hlssmpte";XK.prototype.create=function(){return new WK};_.Fo(new XK);};
|
|
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));}
|