@castlabs/prestoplay 6.6.0 → 6.6.1
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 +17 -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 +406 -406
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +17 -6
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +49 -48
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +256 -257
- package/cjs/cl.muxdata.js +12 -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 +71 -70
- 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 +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- 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 +357 -356
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +17 -6
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +199 -200
- package/cl.muxdata.js +8 -8
- package/cl.onboard.js +2 -2
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +16 -16
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +12 -12
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +13 -13
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +15 -15
- package/package.json +5 -1
- package/typings.d.ts +100 -96
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.A=[];this.m=[];this.w=[];this.j=new _.
|
|
4
|
-
_.x(e,a.canPlay(!1),2);if(3!=e.a)return c=e.f,_.x(e,a.canPlay(!0),3);d=e.f;c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:d&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return e["return"](b)})},
|
|
5
|
-
a.a.registerVideoDisplayBase(
|
|
6
|
-
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.
|
|
7
|
-
_.
|
|
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.j.resolve()};_.t.
|
|
21
|
-
_.t.
|
|
22
|
-
_.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:
|
|
23
|
-
fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}};_.t.
|
|
24
|
-
_.t.
|
|
25
|
-
|
|
2
|
+
var f=function(window){var qK="clpp-freewheel",rK="clpp.freewheel.AdsManagerFactory",sK="freewheel",tK=function(){this.f=this.a=null},uK=function(){},vK=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""}},wK=function(a,b,c){this.g=a;this.f=b;this.a=c},xK=function(a){this.a=a},yK=function(a){this.B=new _.H("clpp.freewheel.AdsManager");this.l=a;this.g=new _.eg;this.o=new tv.freewheel.SDK.AdManager;
|
|
3
|
+
this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.Sh;this.h=null},zK=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(", ")});},AK=function(){var a,b,c,d;return _.A(function(e){if(1==e.a)return a=new _.Bp,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)})},DK=function(a){return _.A(function(b){if(a.A.length)return BK(a),a.f=a.A.shift(),a.f.play(),b.G(0);CK(a);return _.x(b,a.l.a.play(),0)})},EK=function(a){a.w.length?(BK(a),a.f=a.w.shift(),a.f.play()):CK(a)},BK=function(a){var b=a.l.$b(sK).Ec();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),
|
|
5
|
+
a.a.registerVideoDisplayBase(qK),a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},CK=function(a){var b=a.l.$b(sK).Ec();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},FK=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 wK(a.a,c,d)});a.l.trigger(new _.J(b,d))},GK=function(){this.a=new _.H(rK)};_.v(tK,_.mq);_.t=tK.prototype;
|
|
6
|
+
_.t.onPlayerCreated=function(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.Hn(_.Zc,{id:qK}),this.f=_.Hn(_.Re,{"class":_.Hc}),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 sK};_.t.Ec=function(){return this.a};_.t.fi=function(){return this.f};
|
|
7
|
+
_.D("clpp.freewheel.FreeWheelPlugin",tK);tK.prototype.getAdVideo=tK.prototype.fi;tK.prototype.getAdContainer=tK.prototype.Ec;tK.Id=sK;tK.AD_CONTAINER_ID=qK;uK.prototype.create=function(){return new tK};_.Eo(new uK);_.t=wK.prototype;_.t.rb=function(){return"FreeWheel AdManager SDK"};_.t.sb=function(){return tv.freewheel.SDK.version};_.t.xb=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.dc=function(){return!1};_.t.Jb=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.ub=function(){return this.a?this.a.getActiveCreativeRendition().getWidth():0};_.t.tb=function(){return this.a?this.a.getActiveCreativeRendition().getHeight():0};_.t.gb=function(){return 0};_.t.Ua=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.Ua()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1};_.t.Kb=function(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}};_.t.Lb=function(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1};_.t.wb=function(){return this.f.getAdCount()};_.t.getWrapperAdIds=function(){return[]};_.t.getWrapperAdSystems=function(){return[]};
|
|
11
|
+
_.t.getWrapperCreativeIds=function(){return[]};wK.prototype.getWrapperCreativeIds=wK.prototype.getWrapperCreativeIds;wK.prototype.getWrapperAdSystems=wK.prototype.getWrapperAdSystems;wK.prototype.getWrapperAdIds=wK.prototype.getWrapperAdIds;wK.prototype.getSequenceLength=wK.prototype.wb;wK.prototype.getPositionInSequence=wK.prototype.Lb;wK.prototype.getPodTimeOffset=wK.prototype.Kb;wK.prototype.getPodIndex=wK.prototype.getPodIndex;wK.prototype.getPodType=wK.prototype.Ua;
|
|
12
|
+
wK.prototype.getMediaBitrate=wK.prototype.gb;wK.prototype.getMediaHeight=wK.prototype.tb;wK.prototype.getMediaWidth=wK.prototype.ub;wK.prototype.getMediaUrl=wK.prototype.getMediaUrl;wK.prototype.getClickThroughUrl=wK.prototype.Jb;wK.prototype.isBumper=wK.prototype.dc;wK.prototype.getSkipTimeOffset=wK.prototype.getSkipTimeOffset;wK.prototype.getDuration=wK.prototype.getDuration;wK.prototype.getTitle=wK.prototype.getTitle;wK.prototype.getAdvertiserName=wK.prototype.getAdvertiserName;
|
|
13
|
+
wK.prototype.getAdSystem=wK.prototype.getAdSystem;wK.prototype.getApiFramework=wK.prototype.getApiFramework;wK.prototype.getCreativeId=wK.prototype.getCreativeId;wK.prototype.getId=wK.prototype.getId;wK.prototype.getTechnology=wK.prototype.xb;wK.prototype.getAdManagerVersion=wK.prototype.sb;wK.prototype.getAdManagerName=wK.prototype.rb;xK.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()}})};xK.prototype.Mb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length};xK.prototype.hb=function(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length};
|
|
14
|
+
xK.prototype.hasPostroll=xK.prototype.hb;xK.prototype.hasPreroll=xK.prototype.Mb;xK.prototype.getCuePoints=xK.prototype.getCuePoints;_.t=yK.prototype;
|
|
15
|
+
_.t.load=function(){var a=this,b,c,d,e,f,g,h,l;return _.A(function(m){if(1==m.a){b=a.l.getConfiguration().freewheel||{};try{zK(b)}catch(n){return a.l.onError(n),a.j.resolve(),m["return"](a.j)}a.o.setNetwork(b.networkId);a.o.setServer(b.serverUrl);a.a=a.o.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.ve&&typeof b.siteSectionId!==_.k||a.a.setSiteSection(b.siteSectionId);return _.x(m,AK(),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,vK(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.kj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.oj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_ENDED,a.nj.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.Gi.bind(a));a.g.on(a.l,_.Fe,a.nh.bind(a));a.g.on(a.l,_.se,a.mh.bind(a));a.a.submitRequest();return m["return"](a.j)})};_.t.start=function(){var a=this;return _.A(function(b){return _.x(b,DK(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 _.A(function(b){a.g.release();a.h&&(a.h.stop(),a.h=null);CK(a);a.a&&(a.a.dispose(),a.a=null);_.y(b)})};
|
|
19
|
+
_.t.kj=function(a){var b=this;if(a.success)this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.m=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.w=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.l.trigger(new _.J(_.Xb,{adsTimeline:new xK(this.a)})),this.h=new _.zp(this.l.getSurface(),function(c,d){return b.a.resize(c,d)},this.l.$b(sK).f);else this.l.onError(new _.L(1,9,10003,{errorType:0},
|
|
20
|
+
void 0));this.j.resolve()};_.t.oj=function(a){FK(this,_.Gb,a);this.h.start()};_.t.nj=function(a){this.f=null;a=a.slot;FK(this,_.Hb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:DK(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:CK(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:EK(this)}};
|
|
21
|
+
_.t.Gi=function(a){var b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:FK(this,_.Tb,a);FK(this,_.Mb,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:FK(this,_.Ub,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:FK(this,_.Lb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:FK(this,_.Ob,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:FK(this,_.Vb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:FK(this,_.Kb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:FK(this,
|
|
22
|
+
_.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:FK(this,_.Pb,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:FK(this,_.Rb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:FK(this,_.Sb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:FK(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:FK(this,_.Qb,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.nh=function(){var a=this;if(!this.f){var b=this.l.getPosition();if(this.f=this.m.find(function(d){return.5>Math.abs(b-d.getTimePosition())})||null){var c=this.m.findIndex(function(d){return d===a.f});this.m.splice(c,1);this.l.pause();BK(this);this.f.play()}}};
|
|
24
|
+
_.t.mh=function(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.ln:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.kn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.dn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);EK(this);break;case _.Xm:case _.hn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}};yK.prototype.getPosition=yK.prototype.getPosition;yK.prototype.setVolume=yK.prototype.setVolume;
|
|
25
|
+
yK.prototype.getVolume=yK.prototype.getVolume;yK.prototype.skip=yK.prototype.skip;yK.prototype.pause=yK.prototype.pause;yK.prototype.resume=yK.prototype.resume;yK.prototype.start=yK.prototype.start;GK.prototype.name=function(){return rK};GK.prototype.ca=function(a,b){return a.namespace()===_.Jc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)};GK.prototype.create=function(a){return new yK(a)};GK.prototype.create=GK.prototype.create;GK.prototype.isSupported=GK.prototype.ca;GK.prototype.name=GK.prototype.name;_.En(new GK);};
|
|
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,52 +1,53 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
4,4023,b);return c.value},
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
b
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
c
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
d
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
_.t.
|
|
46
|
-
_.t.
|
|
47
|
-
_.t.
|
|
48
|
-
var
|
|
49
|
-
"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":
|
|
2
|
+
var f=function(window){var VA="CLOSED-CAPTIONS",WA="Could not parse MP4 segment start time.",XA="EXT-X-BYTERANGE",YA="EXT-X-DISCONTINUITY",ZA="EXT-X-DISCONTINUITY-SEQUENCE",$A="EXT-X-ENDLIST",aB="EXT-X-MAP",bB="EXT-X-MEDIA-SEQUENCE",cB="EXT-X-PART-INF",dB="EXT-X-PLAYLIST-TYPE",eB="EXT-X-PRELOAD-HINT",fB="EXT-X-SERVER-CONTROL",gB="EXT-X-STREAM-INF",hB="EXT-X-TARGETDURATION",iB="EXTINF",jB="Guessing audio-only",kB="SAMPLE-AES-CTR",lB="SUBTITLES",mB="application/vnd.apple.mpegurl",nB=function(a,b){var c=a.getAttribute(b);
|
|
3
|
+
if(!c)throw new _.L(_.M,4,4023,b);return c.value},oB=function(a){if(1>a.a)throw _.Hk();--a.a},pB=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!");}this.a=a;this.f="";this.type=b;this.fa=c;this.X=1===b?d:null},qB=function(a,b,c){c=void 0===c?[]:c;this.fa=b;this.a=a;this.f=c},rB=function(a,b){return a.filter(function(c){return c.name==
|
|
4
|
+
b})},sB=function(a,b){return a.filter(function(c){return nB(c,"TYPE")===b})},tB=function(a,b){var c=rB(a,b);return c.length?c[0]:null},uB=function(a){var b=void 0===b?0:b;return(a=tB(a,bB))?Number(a.value):b},vB=function(a,b){return _.Kv([a],[b])[0]},wB=function(){this.a=0},zB=function(a,b,c){var d=[],e=[],f=[],g=[];c.forEach(function(h){/^(#EXT)/.test(h)?(h=_.jh(a.a++,h),xB.includes(h.name)?d.push(h):yB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===eB&&"PART"===_.dh(h,"TYPE")&&g.push(h):
|
|
5
|
+
f.push(h)):/^#(?!EXT)/m.test(h)||(h=vB(b,h.trim()),e.push(new qB(h,f,g)),f=[],g=[])});0<g.length&&e.push(new qB(null,f,g));return{X:e,fa:d}},AB=function(a,b){b=void 0===b?0:b;return b+10<=a.length&&73===a[b]&&68===a[b+1]&&51===a[b+2]&&255>a[b+3]&&255>a[b+4]&&128>a[b+6]&&128>a[b+7]&&128>a[b+8]&&128>a[b+9]?!0:!1},BB=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,
|
|
6
|
+
4,4030);}AB(a)||d();var e=10;a[5]&64&&(e=e+4+c(a.subarray(10,14)));do{var f=c(a.subarray(e+4,e+8));1>f&&d();var g=String.fromCharCode(a[e],a[e+1],a[e+2],a[e+3]);if("PRIV"===g){g=a.subarray(e+10,e+f+10);for(var h=0;h<g.byteLength;h++)if(0===g[h]){if("com.apple.streaming.transportStreamTimestamp"===unescape(b(g,0,h)))return a=g.subarray(h+1),f=(a[3]&1)<<30|a[4]<<22|a[5]<<14|a[6]<<6|a[7]>>>2,f*=4,f+=a[7]&3,Math.round(f/9E4);break}}AB(a,e)||d();e+=10;e+=f}while(e<a.byteLength);return d()},CB=function(a,
|
|
7
|
+
b){var c=null,d=0;try{(new _.Ok).L(_.Fd,_.Pk).L(_.Ge,_.Pk).L(_.Ad,_.Pk).V("mdhd",function(g){g.reader.skip(0==g.version?8:16);d=_.U(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Sq.error("Unable to find timescale in init segment!"),new _.L(_.M,4,4030,WA,c);var e=0,f=!1;try{(new _.Ok).L("moof",_.Pk).L("traf",_.Pk).V("tfdt",function(g){e=(0==g.version?_.U(g.reader):_.Mk(g.reader))/d;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.L(_.M,4,4030,WA,c);return e},
|
|
8
|
+
DB=function(a){for(;a.getPosition()<a.za()-1;){var b=a.getPosition();if(71===_.Ik(a))return oB(a),b}return-1},EB=function(a){function b(){d.seek(e+188);f=_.Ik(d);71!=f&&(d.seek(e+192),f=_.Ik(d));71!=f&&(d.seek(e+204),f=_.Ik(d));71!=f&&c();oB(d)}function c(){throw new _.L(_.M,4,4030);}var d=new _.Fk(new DataView(a),!1),e=0,f=0;e=DB(d);0>e&&(_.Sq.error("Unable to find sync byte in TS after scanning."),c());for(;;)if(e=d.getPosition(),f=_.Ik(d),71!=f&&c(),a=_.Jk(d),8191===(a&8191))b();else if(a&16384)if(a=
|
|
9
|
+
(_.Ik(d)&48)>>4,0!=a&&2!=a||c(),3==a&&(a=_.Ik(d),d.skip(a)),1!=_.U(d)>>8)b();else{d.skip(3);a=_.Ik(d)>>6;0!=a&&1!=a||c();0==_.Ik(d)&&c();a=_.Ik(d);var g=_.Jk(d),h=_.Jk(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}else b()},FB=function(a){this.f=new _.H("clpp.hls.MediaReader");this.g=a;this.a={attemptParameters:_.Kh()}},HB=function(a,b,c,d,e,f){var g,h,l,m,n,p,q;return _.A(function(r){switch(r.a){case 1:a.f.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===
|
|
10
|
+
_.pc||d===_.oc)return r["return"](0);if(d!==_.mc){r.G(2);break}return _.x(r,GB(a,c,f),3);case 3:return g=r.f,h=_.N(g.data),AB(h)?r["return"](BB(h)):r["return"](EB(g.data));case 2:if(d!==_.Te&&d!==_.qc){r.G(4);break}l=[GB(a,c,f)];b&&l.push(GB(a,b,!0));return _.x(r,Promise.all(l),5);case 5:return m=r.f,n=m[0],p=m[1]||m[0],r["return"](CB(n.data,p.data));case 4:if(d!==_.Se){r.G(6);break}return _.x(r,GB(a,c,f),7);case 7:return q=r.f,r["return"](EB(q.data));case 6:if(!MediaSource.isTypeSupported((d.split("/")[0]||
|
|
11
|
+
"")+'/mp4;codecs\x3d"'+e+'"'))return r["return"](0);throw new _.L(_.M,4,4030);}})},GB=function(a,b,c){var d,e,f,g,h,l,m;return _.A(function(n){switch(n.a){case 1:return d=b.f(),e=_.ew(b.Ga(),b.$a,b.$a+2048-1,a.a.attemptParameters),e.type=2,f=_.ew(b.Ga(),b.$a,b.Oa,a.a.attemptParameters),f.type=2,d&&(f.keyInfo=d),_.zf(n,2),g=c?f:e,_.x(n,a.g(g),4);case 4:return h=n.f,n["return"](h);case 2:l=_.Bf(n);if(7001===l.code||c)throw l;a.f.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.",
|
|
12
|
+
e.uris[0]);_.zf(n,5);return _.x(n,a.g(f),7);case 7:return n["return"](n.f);case 5:throw m=_.Bf(n),a.f.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.");}})},IB=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r){r=void 0===r?[]:r;_.gw.call(this,a,b,c,d,e,f,g,h,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},KB=function(){var a=this;this.g=this.C=null;this.da=1;this.U=0;this.m=
|
|
13
|
+
new Map;this.ba=new Set;this.a=new Map;this.h=null;this.w="";this.ga=new wB;this.aa=0;this.M=new Map;this.o=new _.Si(function(){a.Ab()});this.j=JB;this.S=null;this.D=0;this.F=Infinity;this.A=new _.Wh;this.$=[];this.J=new Map;this.P=!1;this.B=new Map;this.K=null;this.f=new _.H("clpp.hls.HlsParser");this.H=new Map;this.I=new Map;this.ua=new FB(this.ke.bind(this))},QB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,z;return _.A(function(C){if(1==C.a){c=LB;d=b.Eg;e=new _.Lg(d);if(a.g.hlsLowLatency){f=e.a;
|
|
14
|
+
if(b.Kg){var E=b.segmentIndex;if(E=E.a[E.a.length-1]){var F=E.a,B=F.length-1;E={Ai:E.position,uj:F&&0<F.length?B:null}}else E=null;g=E;h=g.Ai;l=g.uj;null!==h&&(f.add("_HLS_msn",h),null!==l&&f.add("_HLS_part",l))}_.Wg(f);f.g&&_.Og(e,f)}return _.x(C,MB(a,e.toString()),2)}if(3!=C.a){m=C.f;n=m.response;p=m.text;q=NB(a,p,n.uri,b.nd);if(1!==q.type)throw new _.L(_.M,4,4017);return _.x(C,OB(a,b.nd,q,b.type,b.mimeType,b.codecs,b.keyInfo||null,b.Xh),3)}r=C.f;b.X=r;b.segmentIndex.replace(r);w=r[r.length-1];
|
|
15
|
+
if(z=tB(q.fa,$A))PB(a,c.VOD),a.h.Sb(w.endTime);_.y(C)})},TB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w,z,C,E;return _.A(function(F){if(1==F.a){c=NB(a,b,a.w,"");if(1===c.type){a.H.set(a.w,c);d=c.X[0].a;e=_.wn;var B=_.Zg(d)||"";f=null!=_.$g.video[B]?_.Re:null!=_.$g.audio[B]?_.kc:null;g="";f===e.VIDEO?g="avc1.42E01E":f===e.AUDIO&&(g="mp4a.40.2");B=a.ga;var I=a.w,O=a.g.hlsDefaultCodecs||g,S=[],Ba=[];Ba.push(new _.eh(_.la,"0"));Ba.push(new _.eh(_.ub,I));O.length&&Ba.push(new _.eh(_.na,O));S.push(new _.ch(B.a++,
|
|
16
|
+
gB,Ba));c=new pB(I,0,S)}return _.x(F,RB(a,c.fa),2)}h=F.f;if(!a.C)throw new _.L(_.M,7,7001);a.C.filterAllPeriods([h]);m=l=Infinity;n=_.u(a.a.values());for(p=n.next();!p.done;p=n.next())q=p.value,l=Math.min(l,q.Ee),q.type!==_.Ce&&(m=Math.min(m,q.duration));a.j===JB?a.h=new _.hw(null,0,!0):(a.h=new _.hw(0,a.U,!1),_.lw(a.h,1));SB(a);if(a.j===JB)for(a.h.Sb(m),a.h.offset(-l),C=_.u(a.a.values()),p=C.next();!p.done;p=C.next())E=p.value,E.segmentIndex.offset(-l),_.yw(E.segmentIndex,m);else{a.aa=a.F;r=LB;a.j===
|
|
17
|
+
r.LIVE&&(w=a.h.Qe,z=Math.max(m,w),isNaN(a.g.availabilityWindowOverride)||(z=a.g.availabilityWindowOverride),a.h.gc=z);O=0;I=_.u(a.a.values());for(B=I.next();!B.done;B=I.next())O=Math.max(O,B.value.Ee);for(I=0;95443.7176888889<=O;)I+=95443.7176888889,O-=95443.7176888889;if(I)for(a.f.debug("Offsetting live streams by",I,"to compensate for rollover"),O=_.u(a.a.values()),B=O.next();!B.done;B=O.next())B=B.value,95443.7176888889>B.Ee?(a.f.debug("Offset applied to",B.type),B.segmentIndex.offset(I)):a.f.debug("Offset NOT applied to",
|
|
18
|
+
B.type)}return F["return"]({presentationTimeline:a.h,periods:[h],offlineSessionIds:[],minBufferTime:0})})},RB=function(a,b){var c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:c=rB(b,"EXT-X-MEDIA");d=rB(b,gB);e=rB(b,"EXT-X-IMAGE-STREAM-INF");for(var m=new Map,n=_.u(d),p=n.next();!p.done;p=n.next()){var q=p.value,r=_.dh(q,"AUDIO");p=_.dh(q,"VIDEO");var w=_.dh(q,lB);q=UB(a,q);if(w){var z=_.Yg(_.Ce,q);m.set(w,z);w=q.indexOf(z);-1<w&&q.splice(w,1)}r&&(w=VB(_.kc,q),m.set(r,w));p&&(r=VB(_.Re,q),m.set(p,
|
|
19
|
+
r))}a.B=m;return _.x(l,WB(a,c),2);case 2:m=sB(c,VA);m=_.u(m);for(n=m.next();!n.done;n=m.next())r=n.value,n=XB(r),p=nB(r,_.La),r=nB(r,"INSTREAM-ID"),a.J.get(p)||a.J.set(p,new Map),a.J.get(p).set(r,n);return _.x(l,YB(a,d),3);case 3:return f=l.f,_.x(l,ZB(a,c),4);case 4:return g=l.f,_.x(l,$B(a,e),5);case 5:return h=l.f,l["return"]({startTime:0,variants:f,textStreams:g,thumbStreams:h})}})},ZB=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r;return _.A(function(w){if(1==w.a)return c=sB(b,lB),d=c.map(function(z){var C;
|
|
20
|
+
return _.A(function(E){if(1==E.a)return _.zf(E,2),_.x(E,aC(a,z),4);if(2!=E.a)return E["return"](E.f);C=_.Bf(E);throw C;})}),_.x(w,Promise.all(d),2);e=w.f;f=_.u(c);for(g=f.next();!g.done;g=f.next())if(h=g.value,l=nB(h,_.La),m=a.B.get(l))if(n=a.m.get(l))for(p=_.u(n),q=p.next();!q.done;q=p.next())r=q.value,r.codecs=m;return w["return"](e.filter(function(z){return z}))})},$B=function(a,b){var c,d;return _.A(function(e){if(1==e.a)return c=b.map(function(f){return _.A(function(g){return g["return"](bC(a,
|
|
21
|
+
f))})}),_.x(e,Promise.all(c),2);d=e.f;return e["return"](d.filter(function(f){return f}))})},WB=function(a,b){var c;return _.A(function(d){if(1==d.a)return b=b.filter(function(e){var f=_.dh(e,_.ub)||"";return _.dh(e,"TYPE")!==lB&&""!==f}),b.length?_.x(d,aC(a,b[0]),2):d.G(2);c=b.slice(1).map(function(e){return aC(a,e)});return _.x(d,Promise.all(c),0)})},YB=function(a,b){var c,d,e,f,g,h,l,m,n,p;return _.A(function(q){if(1==q.a){c=function(r){var w,z,C,E,F,B,I;return _.A(function(O){return 1==O.a?(w=
|
|
22
|
+
_.dh(r,"FRAME-RATE"),z=Number(nB(r,_.la)),C=_.dh(r,_.ib),E=_.u(C?C.split("x"):[null,null]),F=E.next().value,B=E.next().value,_.x(O,cC(a,r,C,w),2)):(I=O.f)?O["return"](dC(a,I.audio,I.video,z,F,B,w)):O["return"]([])})};d=0;e=Infinity;for(f=0;f<b.length;++f)g=Number(nB(b[f],_.la)),g<e&&(e=g,d=f);h=b.splice(d,1).pop();return _.x(q,c(h),2)}if(3!=q.a)return l=q.f,m=b.map(c),_.x(q,Promise.all(m),3);n=q.f;n.splice(d,0,l);p=n.reduce(_.Iv,[]);return q["return"](p.filter(_.Kg))})},cC=function(a,b,c,d){var e,
|
|
23
|
+
f,g,h,l,m,n,p,q,r,w,z,C,E;return _.A(function(F){if(1==F.a)return e=_.wn,f=UB(a,b),g=_.dh(b,"AUDIO"),h=_.dh(b,"VIDEO"),m=(l=g||h)&&a.m.has(l)?a.m.get(l):[],n={audio:g?m:[],video:h?m:[]},a.f.debug("Guessing stream type for",b.toString()),q=!1,r=nB(b,_.ub),w=n.audio.find(function(B){return B.nd===r}),z=_.Yg(e.VIDEO,f),C=c||d||z,1!==f.length||C?!m.length&&1<f.length?(a.f.debug("Guessing multiplexed audio+video"),p=e.VIDEO,f=[f.join(",")]):n.audio.length&&w?(a.f.debug(jB),p=e.AUDIO,q=!0):n.video.length?
|
|
24
|
+
(a.f.debug(jB),p=e.AUDIO):(a.f.debug("Guessing video-only"),p=e.VIDEO):(p=e.AUDIO,a.f.debug(jB)),E=null,q?F.G(2):_.x(F,eC(a,b,f,p),3);2!=F.a&&(E=F.f);if(E)n[E.type]=[E];else if(null===E)return a.f.debug("stream is null"),F["return"](null);gC(n);return F["return"](n)})},gC=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.codecs.split(",");c=c.filter(function(d){return"mp4a.40.34"!==d});b.codecs=c.join(",")}},dC=function(a,b,c,d,e,f,g){c.forEach(function(z){z&&
|
|
25
|
+
(z.width=Number(e)||void 0,z.height=Number(f)||void 0,z.frameRate=Number(g)||void 0)});b.length||(b=[null]);c.length||(c=[null]);var h=[];b=_.u(b);for(var l=b.next();!l.done;l=b.next()){l=l.value;for(var m=_.u(c),n=m.next();!n.done;n=m.next()){var p=n.value,q=l?l.drmInfos:null,r=p?p.drmInfos:null;n=(p?p.nd:"")+" - "+(l?l.nd:"");var w=void 0;if(l&&p)if(q.length&&r.length?0<_.Uv(q,r).length:1)w=_.Uv(q,r);else{a.f.warn("Incompatible DRM info in HLS variant. Skipping.");continue}else l?w=q:p&&(w=r);
|
|
26
|
+
a.ba.has(n)?a.f.debug("Skipping variant which only differs in text streams."):(p=hC(a,l,p,d,w),h.push(p),a.ba.add(n))}}return h},hC=function(a,b,c,d,e){return{id:a.da++,language:b?b.language:_.Ie,primary:!!b&&b.primary||!!c&&c.primary,audio:b,video:c,bandwidth:d,drmInfos:e,allowedByApplication:!0,allowedByKeySystem:!0}},aC=function(a,b){var c,d,e,f,g,h,l,m,n,p,q,r,w;return _.A(function(z){if(1==z.a){c=nB(b,_.La);d="";e=nB(b,"TYPE").toLowerCase();f=_.wn;e===_.wv&&(e=f.TEXT);e!==f.TEXT&&c&&a.B.has(c)&&
|
|
27
|
+
(d=a.B.get(c));g=nB(b,_.ub);if(a.a.has(g))return z["return"](a.a.get(g));h=XB(b);l=_.dh(b,"NAME");m=b.getAttribute("DEFAULT");n=b.getAttribute("AUTOSELECT");p=_.dh(b,"CHANNELS");q=e==_.kc?p?parseInt(p.split("/")[0],10):null:null;r=!!m&&!!n;return _.x(z,DC(a,g,d,e,h,r,l,q,null),2)}w=z.f;a.m.has(c)?a.m.get(c).push(w):a.m.set(c,[w]);if(a.a.has(g))return z["return"](a.a.get(g));a.a.set(g,w);return z["return"](w)})},bC=function(a,b){var c,d,e,f,g,h;return _.A(function(l){if(1==l.a){c=nB(b,_.ub);if(a.a.has(c))return l["return"](a.a.get(c));
|
|
28
|
+
d=_.dh(b,_.na)||"jpg";e=XB(b);f=_.dh(b,"NAME");return _.x(l,DC(a,c,d,_.od,e,!1,f,null,null),2)}g=l.f;if(a.a.has(c))return l["return"](a.a.get(c));if(h=_.dh(b,_.la))g.bandwidth=Number(h);a.a.set(c,g);return l["return"](g)})},UB=function(a,b){var c=_.dh(b,_.na,a.g.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=_.Sv(f)[0];d.has(g)?a.f.debug("Ignoring duplicate codec"):(e.push(f),d.add(g))}return e},XB=function(a){a=
|
|
29
|
+
_.dh(a,"LANGUAGE")||_.Ie;return _.Ji(a)},eC=function(a,b,c,d){var e,f,g,h,l,m;return _.A(function(n){if(1==n.a){e=_.wn;f=nB(b,_.ub);if(a.a.has(f))return n["return"](a.a.get(f));g=_.dh(b,VA);h=null;d==e.VIDEO&&g&&"NONE"!==g&&(h=a.J.get(g));l=VB(d,c);return _.x(n,DC(a,f,l,d,_.Ie,!1,null,null,h),2)}m=n.f;if(a.a.has(f))return n["return"](a.a.get(f));a.a.set(f,m);return n["return"](m)})},DC=function(a,b,c,d,e,f,g,h,l){var m,n,p,q,r,w,z,C,E,F,B,I,O,S,Ba,ja,pa,Ca,Ga,qa,ta,Ma,Ja,Bb,Cb,Fb,Mi,Ni,Wf,ad,$b;return _.A(function(lc){switch(lc.a){case 1:m=
|
|
30
|
+
vB(a.w,b);p=null;if(a.j===JB&&a.H.has(m)){n=a.H.get(m);a.H["delete"](m);lc.G(2);break}return _.x(lc,MB(a,m),3);case 3:q=lc.f,r=q.response,w=q.text,m=r.uri,n=NB(a,w,m,b);case 2:if(1!==n.type)throw new _.L(_.M,4,4017);EC(a,n);return _.x(lc,FC(a,d,c,n),4);case 4:z=lc.f;C=[];n.X.forEach(function(Oi){Oi=rB(Oi.fa,"EXT-X-KEY");C.push.apply(C,Oi)});E=!1;F=[];B=null;I=_.u(C);for(O=I.next();!O.done;O=I.next())S=O.value,Ba=nB(S,"METHOD"),ja=_.dh(S,"KEYFORMAT","identity"),"NONE"!==Ba&&("AES-128"===Ba?(pa=_.dh(S,
|
|
31
|
+
"IV",""),Ca=vB(a.w,nB(S,_.ub)),p={method:"AES-128",url:Ca,iv:pa?_.mk((pa||"0x").slice(2)):null},a.P=!0):(E=!0,(qa=(Ga=GC[ja])?Ga(S,z):null)?(qa.keyIds.length&&(B=qa.keyIds[0]),F.push(qa)):a.f.warn("Unsupported HLS KEYFORMAT",ja)));if(E&&!F.length&&!a.P)throw new _.L(_.M,4,4026);ta=new Map;return _.x(lc,OB(a,b,n,d,z,c,p,ta),5);case 5:return Ma=lc.f,Ja=Ma[0].startTime,Bb=Ma[Ma.length-1].endTime,Cb=Bb-Ja,Fb=new _.uw(Ma),Mi=a.g.hlsLowLatency?_.qz:_.nv,Ni=HC(n,p),Wf=void 0,d==_.Ce&&(Wf=_.ye),$b=(ad=tB(n.fa,
|
|
32
|
+
fB))?"YES"===_.dh(ad,"CAN-BLOCK-RELOAD"):!1,lc["return"]({id:a.da++,originalId:g,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:Fb.zc.bind(Fb),getSegmentReference:Fb.get.bind(Fb),adjustSegmentDurations:Fb.Pc.bind(Fb),getDuration:Fb.getDuration.bind(Fb),segmentIndex:Fb,segmentLookupStrategy:Mi,initSegmentReference:Ni,mimeType:z,codecs:c,kind:Wf,encrypted:E,keyId:B,language:e,label:g,type:d,primary:f,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:void 0,width:void 0,height:void 0,
|
|
33
|
+
bandwidth:void 0,roles:[],channelsCount:h,closedCaptions:l,keyInfo:p,X:Ma,drmInfos:F,nd:b,Eg:m,Ee:Ja,uk:Bb,duration:Cb,Xh:ta,Kg:$b})}})},NB=function(a,b,c,d){a:{a=a.ga;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||/^#(?!EXT)/m.test(h)||f)f=!1;else if(h=_.jh(0,h),xB.includes(h.name)){e=1;break}else h.name===gB&&(f=!0);f=[];g=!0;h=_.u(_.UA(b));for(var l=h.next();!l.done;l=
|
|
34
|
+
h.next()){var m=l.value;l=m.Kd;var n=m.item;m=m.next;n=n.trim();if(!n.length||/^#(?!EXT)/m.test(n)||g)g=!1;else{n=_.jh(a.a++,n);if(IC.includes(n.name)){if(1!==e)throw new _.L(_.M,4,4017);b=b.splice(l,b.length-l);a=zB(a,c,b);c=new pB(c,e,f.concat(a.fa),a.X);break a}f.push(n);n.name===gB&&(n.attributes.push(new _.eh(_.ub,m)),g=!0)}}c=new pB(c,e,f)}c.f=d;return c},EC=function(a,b){var c=tB(b.fa,dB),d=tB(b.fa,$A);d=c&&"VOD"===c.value||d;c=c&&"EVENT"===c.value&&!d;c=!d&&!c;if(d)PB(a,JB);else{c?PB(a,JC):
|
|
35
|
+
PB(a,KC);d=tB(b.fa,hB);if(!d)throw new _.L(_.M,4,4024,{missingTag:hB});d=Number(d.value);c=tB(b.fa,cB);a.g.hlsLowLatency&&c?(d=Number(nB(c,"PART-TARGET")),a.F=Math.min(d,a.F),a.D=Math.max(d,a.D),d=tB(b.fa,fB),a.U=d?Number(nB(d,"PART-HOLD-BACK")):0):(a.D=Math.max(d,a.D),a.F=Math.min(d,a.F),a.U=3*a.D)}},HC=function(a,b){var c=rB(a.X[0].fa,aB);if(!c.length)return null;if(1<a.X.map(function(g){return rB(g.fa,aB)}).reduce(function(g,h){return g.concat(h)},[]).length)throw new _.L(_.M,4,4020);var d=c[0];
|
|
36
|
+
c=nB(d,_.ub);var e=vB(a.a,c);c=0;var f=null;if(d=_.dh(d,"BYTERANGE"))c=d.split("@"),d=Number(c[0]),c=Number(c[1]),f=c+d-1;return new _.fw(function(){return[e]},c,f,b)},MC=function(a,b,c,d,e,f,g){var h=[],l={};b=_.u(_.UA(b.f));for(var m=b.next();!m.done;l={Td:l.Td},m=b.next()){var n=m.value;m=n.Kd;n=n.item;var p=0==m?a:h[h.length-1],q=0==m?d:p.endTime,r=Number(_.dh(n,"DURATION"));r=q+r;var w=_.dh(n,"BYTERANGE");w=_.u(LC(p,w));p=w.next().value;w=w.next().value;var z=_.dh(n,_.ub);z=vB(g,z);l.Td=z?[z]:
|
|
37
|
+
[];q=new IB(c,q,r,function(C){return function(){return C.Td}}(l),p,w,e,f,!1,null,null,null,null);if("YES"===_.dh(n,"INDEPENDENT")||0===m)q.g=!0;h.push(q)}return h},NC=function(a,b,c,d,e,f,g,h,l){var m=c.fa,n=c.a,p=n?[n]:[];n=tB(m,iB);(g=g?Object.assign({},g):null)&&!g.iv&&(g.iv=_.pk(new Uint8Array(12),new Uint8Array([d>>24&255,d>>16&255,d>>8&255,d&255])));var q=null,r=null,w=null;h===_.od&&(r=tB(m,"EXT-X-TILES"),q="1x1",r&&(q=_.dh(r,"LAYOUT")||"1x1",w=(w=_.dh(r,"DURATION"))?Number(w):null),r=_.u(q.split("x").map(function(z){return parseInt(z,
|
|
38
|
+
10)})),q=r.next().value,r=r.next().value);if(0===c.f.length&&!n)throw new _.L(_.M,4,4024,{missingTag:iB});h=null;if(0<c.f.length)if(a.g.hlsLowLatency)h=MC(b,c,d,e,f,g,l);else return null;c=a=0;l=null;n?(a=e+Number(n.value.split(",")[0]),m=tB(m,XA),b=_.u(LC(b,m?m.value:null)),c=b.next().value,l=b.next().value):a=h[h.length-1].endTime;return new IB(d,e,a,function(){return p},c,l,f,g,!1,null,q,r,w,h)},LC=function(a,b){var c=0,d=null;b&&(c=b.split("@"),d=Number(c[0]),c=c[1]?Number(c[1]):a.Oa+1,d=c+d-
|
|
39
|
+
1);return[c,d]},SB=function(a){a.h&&(a.$.forEach(function(b){_.kw(a.h,b,0)}),a.$=[])},OB=function(a,b,c,d,e,f,g,h){var l,m,n,p,q,r,w,z,C,E,F,B,I,O,S,Ba,ja,pa,Ca,Ga,qa,ta,Ma;return _.A(function(Ja){switch(Ja.a){case 1:l=c.X;m=HC(c,g);n=uB(c.fa);if(null!==a.K){Ja.G(2);break}p=a;return _.x(Ja,OC(a,b,m,l[0],n,g,e,f,d),3);case 3:p.K=Ja.f;case 2:q=a.K;r=l[0].a;a.f.debug("First segment",r.split("/").pop(),"starts at",q);z=(w=tB(c.fa,ZA))?Number(w.value):0;h.has(z)||h.set(z,n);if(!w)for(;h.has(z+1)&&h.get(z+
|
|
40
|
+
1)<n;)z++;C=a.I.get(z)||0;E=[];F=function(Bb){return _.UA(Bb)};B=_.u(F(l));I=B.next();case 4:if(I.done){Ja.G(6);break}S=O=I.value;Ba=S.Kd;ja=S.item;pa=E[E.length-1];Ca=0==Ba?q:pa.endTime;Ga=n+Ba;qa=tB(ja.fa,YA);if(!qa){Ja.G(7);break}z++;h.set(z,Ga);return _.x(Ja,PC(a,z,b,m,ja,Ga,g,e,f,Ca,d),8);case 8:C=Ja.f;case 7:ta=NC(a,pa,ja,Ga,Ca,C,g,d,c.a);Ma=tB(ja.fa,iB);ta&&(a.g.hlsLowLatency||Ma)&&E.push(ta);I=B.next();Ja.G(4);break;case 6:return a.$.push(E),SB(a),Ja["return"](E)}})},PC=function(a,b,c,d,e,
|
|
41
|
+
f,g,h,l,m,n){var p,q;return _.A(function(r){if(1==r.a)return p=0,a.I.has(b)?(p=a.I.get(b),r.G(2)):_.x(r,OC(a,c,d,e,f,g,h,l,n,!0),3);2!=r.a&&(q=r.f,p=q-m,a.f.debug("Discontinuity segment offset",p),a.I.set(b,p));return r["return"](p)})},OC=function(a,b,c,d,e,f,g,h,l,m){var n,p;return _.A(function(q){n=NC(a,null,d,e,0,0,f,l,"");if(!n)return q["return"](0);if(a.S&&!m){var r=n.position;var w=a.a.get(b);r=w?(r=w.segmentIndex.get(r))?r.startTime:null:null;p=r;if(null!=p)return a.f.debug("Found segment start time in previous manifest"),
|
|
42
|
+
q["return"](p);a.f.debug("Unable to find segment start time in previous manifest!")}return q["return"](HB(a.ua,c,n,g,h,a.P))})},VB=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});},FC=function(a,b,c,d){var e,f,g,h;return _.A(function(l){e=d.X[0];f=e.a;h=(g=tB(e.fa,aB))?nB(g,_.ub):null;return l["return"](QC(a,b,c,f,h))})},QC=function(a,b,c,d,e){var f,g,h,l,m;return _.A(function(n){if(1==n.a){f=[d,e].filter(Boolean);if(g=_.ah(f,b,
|
|
43
|
+
c))return n["return"](g);h=_.Nh([d],a.g.attemptParameters);h.method="HEAD";h.type=2;return _.x(n,a.ke(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])})},MB=function(a,b){var c,d,e;return _.A(function(f){if(1==f.a)return c=_.Nh([b],a.g.attemptParameters),c.type=1,_.x(f,a.ke(c),2);d=f.f;e="";try{e=_.vh(d.data)}catch(g){throw new _.L(_.M,4,4042);}e=e.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");e=e.trim();return f["return"]({text:e,response:d})})},
|
|
44
|
+
RC=function(a){var b=nB(a,"METHOD"),c=["SAMPLE-AES",kB];if(!c.includes(b))return _.Tf("PlayReady in HLS is only supported with [",c.join(", "),"], not",b),null;a=nB(a,_.ub);b=_.$p(a);a=null;b=_.N(b.data);try{a=_.Bv(_.Ol(b))}catch(d){a=b}return _.Lv(_.Sc,[{initDataType:_.Cc,initData:a}],"")},PB=function(a,b){a.j=b;if(a.h){var c=a.h,d=a.j===JB;c.j=d;c.m=d}a.j===JB&&a.o.stop()},SC=function(){},IC=[iB,XA,"EXT-X-DATERANGE",YA,"EXT-X-KEY",aB,"EXT-X-PROGRAM-DATE-TIME"],xB=[ZA,$A,"EXT-X-I-FRAMES-ONLY",bB,
|
|
45
|
+
cB,dB,fB,hB],yB=["EXT-X-PART",eB];_.v(IB,_.gw);_.t=KB.prototype;_.t.configure=function(a){this.g=a;this.ua.a=a};_.t.setCurrentVariant=function(a){var b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.M.clear();for(var c=_.u(this.a.keys()),d=c.next();!d.done;d=c.next()){d=d.value;var e=this.a.get(d);e.id!==b&&e.id!==a||this.M.set(d,e)}};
|
|
46
|
+
_.t.start=function(a,b){var c=this,d,e,f,g,h;return _.A(function(l){if(1==l.a)return c.C=b,_.x(l,MB(c,a),2);if(3!=l.a)return d=l.f,e=d.response,f=d.text,c.w=e.uri,_.x(l,TB(c,f),3);g=l.f;c.S=g;h=c.aa;0<h&&c.o.Z(h);return l["return"](g)})};_.t.stop=function(){this.o&&(this.o.stop(),this.o=null);var a=[];this.A&&(a.push(this.A.destroy()),this.A=null);this.g=this.C=null;this.ba.clear();this.a.clear();this.H.clear();this.S=null;this.m.clear();this.B.clear();return Promise.all(a)};
|
|
47
|
+
_.t.update=function(){var a=this,b,c,d,e,f;return _.A(function(g){if(1==g.a){if(a.j===JB)return g["return"]();b=[];a.K=null;c=Array.from(a.a.values());d=Array.from(a.M.values());e=a.g.hlsLowLatency&&0<d.length?d:c;return _.x(g,QB(a,e[0]),2)}for(f=1;f<e.length;f++)b.push(QB(a,e[f]));return _.x(g,Promise.all(b),0)})};_.t.onExpirationUpdated=function(){};
|
|
48
|
+
_.t.Ab=function(){var a=this,b,c,d;return _.A(function(e){if(1==e.a){a.f.debug(_.gv);if(!a.C)return e["return"]();_.zf(e,2);return _.x(e,a.update(),4)}if(2!=e.a)return b=a.aa,a.o.Z(b),_.Af(e,0);c=_.Bf(e);a.C&&(a.C.onError(c),d=c,1===d.severity&&a.o.Z(.1));_.y(e)})};_.t.ke=function(a){if(!this.A)throw new _.L(_.M,7,7001);a=this.C.networkingEngine.fetch(a);_.Xh(this.A,a);return a.O};
|
|
49
|
+
var GC={"com.apple.streamingkeydelivery":function(a,b){if(b===_.Se)throw new _.L(_.M,4,4041);return _.Lv(_.Rc,[{initDataType:_.oe,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":RC,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":RC,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=nB(a,"METHOD"),c=["SAMPLE-AES",kB];if(!c.includes(b))return _.Tf("Widevine in HLS is only supported with [",c.join(", "),"], not",b),null;b=nB(a,_.ub);b=_.$p(b);b=_.N(b.data);b=_.Lv(_.Tc,[{initDataType:_.Cc,
|
|
50
|
+
initData:b}],"");if(a=_.dh(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},JB="VOD",KC="EVENT",JC="LIVE",LB={VOD:JB,Zj:KC,LIVE:JC};_.v(SC,_.Jo);SC.prototype.Ia=function(){_.Gp.m3u8=KB;_.Ep[_.Cj]=KB;_.Ep[mB]=KB};SC.prototype.Ca=function(){_.Dw("m3u8");_.Ew(_.Cj);_.Ew(mB)};SC.prototype.id=function(){return"hls"};_.D("clpp.hls.HlsComponent",SC);};
|
|
50
51
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
51
52
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
52
53
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.hlssmpte.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
c.mode=_.
|
|
6
|
-
a.l.getTrackManager().
|
|
7
|
-
_.
|
|
2
|
+
var f=function(window){var fK=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}},hK=function(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.eg;this.h=(a=_.aq[_.hc]||null)?new a(this.l.getConfiguration()):null;this.f=new _.H("clpp.hlssmpte.ImageCueHandler");this.g=null;gK(this)},gK=function(a){a.a.one(a.l,_.wd,function(){return iK(a)})},
|
|
3
|
+
iK=function(a){var b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Wb,function(d){return jK(a,d)});var c=Array.from(b.textTracks);c.filter(function(d){return d.kind===_.Cd}).forEach(function(d){jK(a,{track:d})});!kK(c)&&a.m&&(a.f.warn("The metadata track is not present. Changing an audio track in order to enforce the creation of the metadata track."),lK(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");else a.f.warn("A video element is not available. Skipping.")},
|
|
4
|
+
kK=function(a){return a.some(function(b){return b.kind===_.Cd})},lK=function(a,b){var c=a.l.getTrackManager(),d=c.na(),e=c.getAudioTracks().find(function(g){return g!==d});if(e){var f=function(){return c.sa(d)};a.a.on(b.textTracks,_.Wb,function(g){g.track.kind===_.Cd&&(a.a.off(b.textTracks,_.Wb,f),f())});c.sa(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},jK=function(a,b){var c=b.track;c.kind===_.Cd&&(a.f.info("The metadata track has been added."),
|
|
5
|
+
c.mode=_.nd,a.a.on(c,_.Wc,function(d){return mK(a,d)}))},mK=function(a,b){var c=nK(a);c&&Array.from(b.target.activeCues||[]).forEach(function(d){if(d!==a.g&&Number.isFinite(d.startTime)&&Number.isFinite(d.endTime)&&"org.id3"===d.type&&d.value&&"TXXX"===d.value.key){var e=new fK(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.zh(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)}}})},nK=function(a){return(a=
|
|
6
|
+
a.l.getTrackManager().oa())&&a.language&&a.language.toLowerCase()},oK=function(){this.a=null;this.f=!1},pK=function(){};hK.prototype.destroy=function(){this.a.release();this.g=null;return Promise.resolve()};_.v(oK,_.mq);oK.prototype.onPlayerCreated=function(){};oK.prototype.onContentWillLoad=function(a){if(this.f=_.Zi()){var b=a.getConfiguration();b=_.K.Ma(b.hlssmpte||{});_.K.Of(b.patchMetadataTrack)||(b.patchMetadataTrack=!1);_.K.la(b.timestampOffset)||(b.timestampOffset=0);this.a=new hK(a,b.patchMetadataTrack,b.timestampOffset)}};oK.prototype.onPlayerWillDestroy=function(){var a=this;return _.A(function(b){if(1==b.a)return a.a?_.x(b,a.a.destroy(),3):b.G(0);a.a=null;_.y(b)})};oK.prototype.id=function(){return"hlssmpte"};
|
|
7
|
+
_.D("clpp.hlssmpte.HlsSmptePlugin",oK);oK.Id="hlssmpte";pK.prototype.create=function(){return new oK};_.Eo(new pK);};
|
|
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));}
|