@castlabs/prestoplay 6.7.0 → 6.9.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 +50 -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 +419 -420
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +72 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +272 -261
- package/cjs/cl.muxdata.js +15 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -71
- 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 +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +358 -363
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +61 -57
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +238 -228
- package/cl.muxdata.js +12 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- 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 +15 -15
- package/package.json +1 -1
- package/typings.d.ts +74 -20
package/cl.freewheel.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
if(b.length)throw new _.H(1,9,12001,{missingKeys:b.join(", ")});},
|
|
3
|
-
tv.freewheel.SDK.EVENT_SLOT_ENDED,a.I.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.G.bind(a));a.g.on(a.l,_.
|
|
4
|
-
a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},
|
|
5
|
-
!0),a.getSurface().hide(this.a);else a.onError(new _.H(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return
|
|
6
|
-
0}getSkipTimeOffset(){return 0}
|
|
7
|
-
case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
_.r||a.a.setSiteSection(b.siteSectionId);const c=yield
|
|
13
|
-
if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);
|
|
14
|
-
a.h&&(a.h.stop(),a.h=null);
|
|
15
|
-
9,10003,{errorType:0},void 0));this.j.resolve()}J(a){
|
|
16
|
-
_.
|
|
17
|
-
_.
|
|
18
|
-
.5>Math.abs(a-b.getTimePosition()))||null){const b=this.m.findIndex(c=>c===this.f);this.m.splice(b,1);this.l.pause();
|
|
19
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var tK="clpp-freewheel",uK="clpp.freewheel.AdsManagerFactory",vK="freewheel",wK=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""}},xK=function(a){const b=[];typeof a.networkId!==_.r&&b.push("networkId");typeof a.serverUrl!==_.me&&b.push("serverUrl");typeof a.profileId!==_.me&&b.push("profileId");typeof a.videoAssetId!==_.me&&typeof a.videoAssetId!==_.r&&b.push("videoAssetId");
|
|
2
|
+
if(b.length)throw new _.H(1,9,12001,{missingKeys:b.join(", ")});},yK=function(){return _.y(function*(){var a=new _.Up;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},zK=function(a){a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.H.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.J.bind(a));a.g.on(a.a,
|
|
3
|
+
tv.freewheel.SDK.EVENT_SLOT_ENDED,a.I.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.G.bind(a));a.g.on(a.l,_.ue,a.F.bind(a));a.g.on(a.l,_.je,a.C.bind(a))},CK=function(a){return _.y(function*(){a.A.length?(AK(a),a.f=a.A.shift(),a.f.play()):(BK(a),yield a.l.a.play())})},BK=function(a){const b=a.l.Wb(vK).rc();b&&a.l.getSurface().hide(b);a.l.getSurface().showMediaElement()},AK=function(a){const b=a.l.Wb(vK).rc();b&&(a.l.getSurface().show(b),a.l.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(tK),
|
|
4
|
+
a.l.isMuted()?a.setVolume(0):a.setVolume(a.l.getVolume()||1))},DK=function(a){a.w.length?(AK(a),a.f=a.w.shift(),a.f.play()):BK(a)},EK=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 X(a.a,c,d)});a.l.trigger(new _.F(b,d))},FK=class extends _.$p{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.am(_.Oc,{id:tK}),this.f=_.am(_.w,{"class":_.wc}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
|
|
5
|
+
!0),a.getSurface().hide(this.a);else a.onError(new _.H(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return vK}rc(){return this.a}Gf(){return this.f}};_.z("clpp.freewheel.FreeWheelPlugin",FK);FK.prototype.getAdVideo=FK.prototype.Gf;FK.prototype.getAdContainer=FK.prototype.rc;FK.Id=vK;FK.AD_CONTAINER_ID=tK;_.Hm(new class{create(){return new FK}});var X=class{constructor(a,b,c){this.g=a;this.f=b;this.a=c}pb(){return"FreeWheel AdManager SDK"}qb(){return tv.freewheel.SDK.version}vb(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.me?a:""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
|
|
6
|
+
0}getSkipTimeOffset(){return 0}$b(){return!1}Hb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}sb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}rb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}gb(){return 0}Sa(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
|
|
7
|
+
case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Sa()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Ib(){switch(this.Sa()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}Jb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}ub(){return this.f.getAdCount()}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
|
|
8
|
+
X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.ub;X.prototype.getPositionInSequence=X.prototype.Jb;X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Sa;X.prototype.getMediaBitrate=X.prototype.gb;X.prototype.getMediaHeight=X.prototype.rb;
|
|
9
|
+
X.prototype.getMediaWidth=X.prototype.sb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Hb;X.prototype.isBumper=X.prototype.$b;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;
|
|
10
|
+
X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.vb;X.prototype.getAdManagerVersion=X.prototype.qb;X.prototype.getAdManagerName=X.prototype.pb;var GK=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(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()}})}Kb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}hb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
|
|
11
|
+
GK.prototype.hasPostroll=GK.prototype.hb;GK.prototype.hasPreroll=GK.prototype.Kb;GK.prototype.getCuePoints=GK.prototype.getCuePoints;var HK=class{constructor(a){this.B=new _.O("clpp.freewheel.AdsManager");this.l=a;this.g=new _.jo;this.o=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.A=[];this.m=[];this.w=[];this.j=new _.Mk;this.h=null}load(){const a=this;return _.y(function*(){const b=a.l.getConfiguration().freewheel||{};try{xK(b)}catch(d){return a.l.onError(d),a.j.resolve(),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!==_.me&&typeof b.siteSectionId!==
|
|
12
|
+
_.r||a.a.setSiteSection(b.siteSectionId);const c=yield yK();a.a.setVideoAsset(b.videoAssetId,a.l.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,wK(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Bd&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
|
|
13
|
+
if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);zK(a);a.a.submitRequest();return a.j})}start(){const a=this;return _.y(function*(){yield CK(a)})}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}dispose(){const a=this;return _.y(function*(){a.g.release();
|
|
14
|
+
a.h&&(a.h.stop(),a.h=null);BK(a);a.a&&(a.a.dispose(),a.a=null)})}H(a){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 _.F(_.Lb,{adsTimeline:new GK(this.a)})),this.h=new _.Sp(this.l.getSurface(),(b,c)=>this.a.resize(b,c),this.l.Wb(vK).f);else this.l.onError(new _.H(1,
|
|
15
|
+
9,10003,{errorType:0},void 0));this.j.resolve()}J(a){EK(this,_.ub,a);this.h.start()}I(a){this.f=null;a=a.slot;EK(this,_.vb);this.h.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:CK(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:BK(this);this.l.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:DK(this)}}G(a){const b=a.subType;this.B.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:EK(this,_.Hb,a);EK(this,
|
|
16
|
+
_.Ab,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:EK(this,_.Ib,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:EK(this,_.zb,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:EK(this,_.Cb,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:EK(this,_.Jb,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:EK(this,_.yb,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:EK(this,_.xb,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:EK(this,_.Db,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:EK(this,
|
|
17
|
+
_.Fb,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:EK(this,_.Gb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:EK(this,_.wb,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:EK(this,_.Eb,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.l.onError(new _.H(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}F(){if(!this.f){var a=this.l.getPosition();if(this.f=this.m.find(b=>
|
|
18
|
+
.5>Math.abs(a-b.getTimePosition()))||null){const b=this.m.findIndex(c=>c===this.f);this.m.splice(b,1);this.l.pause();AK(this);this.f.play()}}}C(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Hl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Gl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.wl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);DK(this);break;case _.El:case _.Dl:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
|
|
19
|
+
HK.prototype.getPosition=HK.prototype.getPosition;HK.prototype.setVolume=HK.prototype.setVolume;HK.prototype.getVolume=HK.prototype.getVolume;HK.prototype.skip=HK.prototype.skip;HK.prototype.pause=HK.prototype.pause;HK.prototype.resume=HK.prototype.resume;HK.prototype.start=HK.prototype.start;var IK=class{constructor(){this.a=new _.O(uK)}name(){return uK}ea(a,b){return a.namespace()===_.yc?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)}create(a){return new HK(a)}};IK.prototype.create=IK.prototype.create;IK.prototype.isSupported=IK.prototype.ea;IK.prototype.name=IK.prototype.name;_.Yl(new IK);};f.call(g, window);
|
package/cl.hls.js
CHANGED
|
@@ -1,57 +1,61 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
a
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
c();a=_.
|
|
15
|
-
|
|
16
|
-
return
|
|
17
|
-
d)return
|
|
18
|
-
f);return e}).filter(Boolean);if(0===b.length)throw new _.H(_.G,4,4026);return{keyInfo:null,keyId:b.map(e=>e.keyIds).reduce((e,f)=>e.concat(f),[]).reverse()[0]||null,type:
|
|
19
|
-
g.code||c)throw g;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.",
|
|
20
|
-
d||d===_.
|
|
21
|
-
|
|
22
|
-
b,c,d){var e=a[0].length();e=
|
|
23
|
-
keyId:h.keyId}));f=
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"0"));k.push(new _.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
g)g
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var f=[...b];let g=0;var h=Infinity;for(let k=0;k<f.length;++k){const l=Number(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var n=
|
|
42
|
-
|
|
43
|
-
k
|
|
44
|
-
1
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var eA="CLOSED-CAPTIONS",fA="Could not parse MP4 segment start time.",gA="EXT-X-BYTERANGE",hA="EXT-X-DISCONTINUITY",iA="EXT-X-DISCONTINUITY-SEQUENCE",jA="EXT-X-ENDLIST",kA="EXT-X-KEY",lA="EXT-X-MAP",mA="EXT-X-MEDIA-SEQUENCE",nA="EXT-X-PART-INF",oA="EXT-X-PLAYLIST-TYPE",pA="EXT-X-PRELOAD-HINT",qA="EXT-X-SERVER-CONTROL",rA="EXT-X-STREAM-INF",sA="EXT-X-TARGETDURATION",tA="Failed to infer discontinuity number",uA="Guessing audio-only",vA="METHOD",wA="SAMPLE-AES-CTR",xA="SUBTITLES",yA="Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one ",
|
|
2
|
+
zA="application/vnd.apple.mpegurl",AA="sample",BA="whole-segment",CA=function(a,b){return _.pg(a,b,void 0,{required:!0})},DA=function(a){if(1>a.a)throw _.vj();--a.a},EA=function(a){if(null!==a&&void 0!==a)return Number(a)},FA=function(a,b){return a.filter(c=>c.name===b)},GA=function(a,b){const c=Array.isArray(b)?b:[b];return a.filter(d=>{d=CA(d,"TYPE");return c.includes(d)})},HA=function(a,b){return a.some(c=>c.name===b)},IA=function(a,b,c){c=void 0===c?{}:c;a=a.find(d=>d.name===b)||null;if(!a&&c.required)throw new _.H(_.G,
|
|
3
|
+
4,4024,{missingTag:b});return a},JA=function(a){var b=IA(a,"EXT-X-TILES");if(!b)return{Be:1,cf:1,durationPerTile:null};a=_.pg(b,"LAYOUT")||"1x1";b=(b=_.pg(b,"DURATION"))?Number(b):null;const [c,d]=a.split("x").map(e=>parseInt(e,10));return{Be:c,cf:d,durationPerTile:b}},KA=function(a,b){return _.tu([a],[b])[0]},LA=function(a){const b=new Set;a.variants.forEach(c=>{c.audio&&b.add(c.audio);c.video&&b.add(c.video)});a.textStreams.forEach(c=>b.add(c));a.thumbStreams.forEach(c=>b.add(c));return Array.from(b)},
|
|
4
|
+
MA=function(a,b){Array.isArray(a)||(a=[a]);a.forEach(c=>{for(const d of LA(c))b(d,c)})},NA=function(a){return a.type===_.p||a.type===_.w},OA=function(a){const b=IA(a,oA);if(IA(a,jA))return _.Qt;if(!b)return"LIVE";if(b.value===_.Qt)return _.Qt;if("EVENT"===b.value)return"EVENT";throw new _.H(_.G,4,4044,`Invalid EXT-X-PLAYLIST-TYPE value: ${b.value}`);},PA=function(a,b,c){c=void 0===c?!1:c;var d=0;let e=null;if(a){d=a.split("@");a=Number(d[0]);if(0>=a)throw new _.H(_.G,4,4044,"Byte range length must be positive.");
|
|
5
|
+
if(d[1]){if(d=Number(d[1]),0>d)throw new _.H(_.G,4,4044,"Byte range start byte must not be negative.");}else{if(c)throw new _.H(_.G,4,4044,"Invalid byte range, offset is required but missing.");if(null==b)throw new _.H(_.G,4,4044,"Invalid byte range, cannot calculate offset based on previous byte ranges.");d=b+1}e=d+a-1}return{ua:d,ha:e}},QA=function(a,b){a=IA(a,gA);return PA(a?a.value:null,b)},RA=function(a){a=IA(a,"EXTINF",{required:!0}).value.split(",");return{duration:Number(a[0]),title:a[1]||
|
|
6
|
+
null}},SA=function(a,b){b=void 0===b?{}:b;const c={Tc:!1,rf:!1,sf:null,Pf:null,Pe:null};a=IA(a,qA,{required:b.Ue});if(!a)return c;const d=e=>null==e?null:Number(e);c.Tc="YES"===_.pg(a,"CAN-BLOCK-RELOAD");c.rf="YES"===_.pg(a,"CAN-SKIP-DATERANGES");c.sf=d(_.pg(a,"CAN-SKIP-UNTIL"));c.Pf=d(_.pg(a,"HOLD-BACK"));c.Pe=d(_.pg(a,"PART-HOLD-BACK",void 0,{required:b.Ue}));return c},TA=function(a,b,c){c=void 0===c?!1:c;a=_.pg(a,"BYTERANGE");return PA(a,b,c)},VA=function(a,b){const c=QA(a.$,null);return new UA(0,
|
|
7
|
+
0,0,()=>[a.a],c.ua,c.ha,0,b)},WA=function(a,b){if(null==a)return null;a=Object.assign({},a);null==a.iv&&(a.iv=_.$g(new Uint8Array(12),new Uint8Array([b>>24&255,b>>16&255,b>>8&255,b&255])));return a},XA=function(a){let b=Infinity,c=Infinity;LA(a).filter(NA).forEach(d=>{{d=d.S;var e=d[0].startTime;const f=d[d.length-1].endTime;d=e;e=f-e}b=Math.min(b,d);c=Math.min(c,e)});return{vc:b,duration:c}},YA=function(a){return a.map(b=>{({duration:b}=XA(b));return b}).reduce((b,c)=>b+c,0)},ZA=function(a,b,c){if(b===
|
|
8
|
+
_.Qt)return{delay:0,Qc:0};b=IA(a,nA);if(c&&b)return c=Number(CA(b,"PART-TARGET")),{Pe:a}=SA(a,{Ue:!0}),{delay:a,Qc:c};a=IA(a,sA,{required:!0});a=Number(a.value);return{delay:3*a,Qc:a}},$A=function(a){const b=[];MA(a,c=>{b.push(c.Wf)});return{delay:Math.max(...b.map(c=>c.delay)),Qc:Math.min(...b.map(c=>c.Qc))}},aB=function(a){const b=new Map;a.forEach(c=>{var d=c.ca[0].groupId;b.has(d)?(d=b.get(d),d.includes(c)||d.push(c)):b.set(d,[c])});return b},bB=function(a){a=_.pg(a,"LANGUAGE")||_.xe;return _.rg(a)},
|
|
9
|
+
cB=function(a){const b=new Map;for(const c of a){a=bB(c);const d=CA(c,_.Ba),e=CA(c,"INSTREAM-ID");b.has(d)||b.set(d,new Map);b.get(d).set(e,a)}return b},eB=function(a){a=a.audio.concat(a.video);for(const b of a)a=b.ca[0].codecs.split(",").filter(c=>"mp4a.40.34"!==c),dB(b,a)},iB=function(a,b,c){const d=[],e=[];let f=[],g=[];c.forEach(h=>{/^(#EXT)/.test(h)?(h=_.eh(a.a++,h),fB.includes(h.name)?d.push(h):gB.includes(h.name)?"EXT-X-PART"===h.name?g.push(h):h.name===pA&&"PART"===_.pg(h,"TYPE")&&g.push(h):
|
|
10
|
+
f.push(h)):/^#(?!EXT)/m.test(h)||(h=KA(b,h.trim()),e.push(new hB(h,f,g)),f=[],g=[])});0<g.length&&e.push(new hB(null,f,g));return{S:e,$:d}},jB=function(a){return 0>a?[]:Array.from({length:a},(b,c)=>c)},kB=function(a,b=0){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},lB=function(a){function b(h,k,l){let m="";for(;k<l;k++)m+="%"+("00"+h[k].toString(16)).slice(-2);return m}function c(h){return h[0]<<21|h[1]<<
|
|
11
|
+
14|h[2]<<7|h[3]}function d(){throw new _.H(_.G,4,4030);}kB(a)||d();let 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(let 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}}kB(a,e)||d();e+=10;e+=
|
|
12
|
+
f}while(e<a.byteLength);return d()},mB=function(a,b){let c=null,d=0;try{(new _.Lj).L(_.wd,_.Ej).L(_.ve,_.Ej).L(_.rd,_.Ej).Z("mdhd",g=>{g.reader.skip(0==g.version?8:16);d=_.N(g.reader);g.parser.stop()}).parse(b,!0)}catch(g){c=g}if(c||!d)throw _.Vp.error("Unable to find timescale in init segment!"),new _.H(_.G,4,4030,fA,c);let e=0,f=!1;try{(new _.Lj).L("moof",_.Ej).L("traf",_.Ej).Z("tfdt",g=>{var h=d;if(0===g.version)h=_.N(g.reader)/h;else{{const k=_.N(g.reader),l=_.N(g.reader);if(!(2097151>=k||h>=
|
|
13
|
+
Math.pow(2,12)))throw Error("Cannot accurately parse MP4 timestamp, base time is too high and timescale is \x3c\x3d 2^12");h=k/h*Math.pow(2,32)+l/h}}e=h;f=!0;g.parser.stop()}).parse(a,!0)}catch(g){c=g}if(c||!f)throw new _.H(_.G,4,4030,fA,c);return e},nB=function(a){for(;a.getPosition()<a.Ba()-1;){const b=a.getPosition();if(71===_.wj(a))return DA(a),b}return-1},oB=function(a){function b(){d.seek(e+188);f=_.wj(d);71!=f&&(d.seek(e+192),f=_.wj(d));71!=f&&(d.seek(e+204),f=_.wj(d));71!=f&&c();DA(d)}function c(){throw new _.H(_.G,
|
|
14
|
+
4,4030);}const d=new _.qk(new DataView(a),!1);let e=0,f=0;e=nB(d);0>e&&(_.Vp.error("Unable to find sync byte in TS after scanning."),c());for(;;){e=d.getPosition();f=_.wj(d);71!=f&&c();a=_.xj(d);if(8191===(a&8191)){b();continue}if(!(a&16384)){b();continue}a=(_.wj(d)&48)>>4;0!=a&&2!=a||c();3==a&&(a=_.wj(d),d.skip(a));if(1!=_.N(d)>>8){b();continue}d.skip(3);a=_.wj(d)>>6;0!=a&&1!=a||c();0==_.wj(d)&&c();a=_.wj(d);const g=_.xj(d),h=_.xj(d);return(1073741824*((a&14)>>1)+((g&65534)<<14|(h&65534)>>1))/9E4}},
|
|
15
|
+
rB=function(a){const b=pB(a),c=qB(a);a.forEach(d=>{const e=d.S,f=e.findIndex(h=>h.xa===b);let g=e.findIndex(h=>h.xa===c+1);-1===g&&(g=e.length);d.S=e.slice(f,g)})},qB=function(a){a=a.map(b=>b.S[b.S.length-1].xa);return Math.min(...a)},pB=function(a){a=a.map(b=>b.S[0].xa);return Math.max(...a)},uB=function(a){var b=CA(a,vA);if(!sB.includes(b))return tB.error("PlayReady in HLS is only supported with [",sB.join(", "),"], not",b),null;a=CA(a,_.kb);b=_.Vn(a);a=null;b=_.I(b.data);try{a=_.mu(_.Wu(b))}catch(c){a=
|
|
16
|
+
b}return _.uu(_.Hc,[{initDataType:_.rc,initData:a}],"")},wB=function(a){if(0===a.length)return vB();if(a.some(c=>c.type===BA)||a.every(c=>c.type===_.Ad))return a[0];a=a.filter(c=>c.type===AA);const b=Array.from((new Set(a.flatMap(c=>c.drmInfos))).values());return{keyInfo:null,keyId:a[a.length-1].keyId,type:AA,drmInfos:b}},zB=function(a){a=xB(a);if(a.some(b=>yB(b))&&1<a.length)throw new _.H(_.G,4,4046,"Two EXT-X-KEY tags, one with METHOD\x3dAES-128 are applied to one playlist.");},yB=function(a){return FA(a.$,
|
|
17
|
+
kA).some(b=>"AES-128"===_.pg(b,vA))},BB=function(a,b,c){return xB(a).map(d=>AB(d.$,b,c))},CB=function(a){return a.filter(b=>HA(b.$,kA)).length},xB=function(a){return a.filter(b=>HA(b.$,kA))},AB=function(a,b,c){a=FA(a,kA);if(0===a.length)return null;var d=CA(a[0],vA);if(1===a.length){if("NONE"===d)return vB();if("AES-128"===d)return a=a[0],d=_.pg(a,"IV",""),{type:BA,keyInfo:{method:"AES-128",url:KA(b,CA(a,_.kb)),iv:d?_.Vg((d||"0x").slice(2)):null},drmInfos:[],keyId:null}}b=a.map(e=>CA(e,vA));if(!b.every(e=>
|
|
18
|
+
"SAMPLE-AES"===e)&&!b.every(e=>e===wA))throw DB.warn(`EXT-X-KEY methods ${b.join(", ")} are incompatible.`),new _.H(_.G,4,4044,"Multiple EXT-X-KEY tags with incompatible METHOD values.");b=a.map(e=>{const f=_.pg(e,"KEYFORMAT","identity");{const g=EB[f]||null;e=g?g(e,c):null}e||DB.warn("Unsupported HLS KEYFORMAT",f);return e}).filter(Boolean);if(0===b.length)throw new _.H(_.G,4,4026);return{keyInfo:null,keyId:b.map(e=>e.keyIds).reduce((e,f)=>e.concat(f),[]).reverse()[0]||null,type:AA,drmInfos:b}},
|
|
19
|
+
vB=function(){return{type:_.Ad,keyInfo:null,drmInfos:[],keyId:null}},FB=function(a,b,c){return _.y(function*(){const d=b.f(),e=_.iv(b.Ha(),b.ua,b.ua+2048-1,a.a.attemptParameters);e.type=2;const f=_.iv(b.Ha(),b.ua,b.ha,a.a.attemptParameters);f.type=2;d&&(f.keyInfo=d);try{return yield a.g(c?f:e)}catch(g){if(7001===g.code||c)throw g;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.",
|
|
20
|
+
e.uris[0]);try{return yield a.g(f)}catch(h){throw a.f.error("Failed to fetch media segment to parse its start timestamp.",f.uris[0],h),new _.H(_.G,4,4030,"Failed to fetch the media segment.");}}})},GB=function(a,b,c,d,e,f){return _.y(function*(){a.f.debug("Fetching segment to find start time");if("audio/mpeg"===d||d===_.ac||d===_.$b)return 0;if(d===_.Zb){var g=yield FB(a,c,f);const h=_.I(g.data);return kB(h)?lB(h):oB(g.data)}if(d===_.Je||d===_.bc)return g=[FB(a,c,f)],b&&g.push(FB(a,b,!0)),g=yield Promise.all(g),
|
|
21
|
+
mB(g[0].data,(g[1]||g[0]).data);if(d===_.He)return g=yield FB(a,c,f),oB(g.data);if(!_.Du(`${d.split("/")[0]||""}/mp4;codecs="${e}"`))return 0;throw new _.H(_.G,4,4030);})},HB=function(a,b){a=a.map(c=>c.Eb(b));return a.some(c=>null==c)?null:a},dB=function(a,b){a.ca.forEach(c=>{c.codecs=b.join(",")})},IB=function(a,b){a=a.ca.find(c=>{c=c.S;return c[0].position<=b&&b<=c[c.length-1].position});return null==a?null:a.S.find(c=>c.position===b)||null},JB=function(a,b){a.ca.forEach(c=>{c.nd=b})},KB=function(a,
|
|
22
|
+
b){a.ca.forEach(c=>{c.width=b})},LB=function(a,b){a.ca.forEach(c=>{c.height=b})},MB=function(a,b){a.ca.forEach(c=>{c.frameRate=b})},NB=function(a,b){a.ca.forEach(c=>{c.bandwidth=b})},OB=function(a,b){return a.ca.some(c=>c.id===b)},PB=function(a,b){a=a.map(c=>c.Eb(b));return a.some(c=>null==c)?null:a},SB=function(a,b,c,d){var e=a[0].length();e=jB(e).map(f=>{const g=PB(a,f)||[],h=HB(b,f)||[],k=HB(c,f)||[];return QB({variants:g,textStreams:h,thumbStreams:k,Uf:d&&0===f})});RB(e);return e},UB=function(a){if(1===
|
|
23
|
+
a.length)return a[0];const b=a[0],c=a.reduce((e,f)=>e+f.duration,0),d=new Map;a.forEach((e,f)=>{const g=LA(e);0<f&&TB(g,e.startTime);g.forEach(h=>{const k=h.fc;d.has(k)?d.get(k).push(h):d.set(k,[h])})});MA(b,e=>{var f=d.get(e.fc);const g=f.flatMap(h=>h.S);f=f.map(h=>({keyInfo:h.keyInfo,type:h.we,drmInfos:h.drmInfos,keyId:h.keyId}));f=wB(f);e.keyInfo=f.keyInfo;e.we=f.type;e.encrypted=f.type===AA;e.drmInfos=f.drmInfos;e.keyId=f.keyId;e.S=g;e.segmentIndex.replace(g)});return Object.assign({},b,{duration:c,
|
|
24
|
+
endTime:a[0].startTime+c})},VB=function(a,b){a.forEach(c=>{c.startTime+=b;c.endTime+=b;c.sa-=b})},QB=function(a){const b=a.variants,c=a.textStreams,d=a.thumbStreams;a=a.Uf;const e=[...b.flatMap(l=>[l.video,l.audio]),...c,...d].filter(Boolean);WB(e);const f=a?e[0].S[0].sa:0;a&&TB(e,f);const {xa:g,ed:h,duration:k}=e[0];return{variants:b,textStreams:c,thumbStreams:d,startTime:0,id:`P${g}`,endTime:h,duration:k+f,xa:g}},RB=function(a){for(let b=0;b<a.length;b++){const c=a[b],d=a[b-1];c.startTime=d?d.endTime:
|
|
25
|
+
0;c.endTime=c.startTime+c.duration}},TB=function(a,b){a.forEach(c=>{const d=-c.vc+b;c.segmentIndex.offset(d);c.ed+=d;c.vc=b})},WB=function(a){const b=XB(a);a.forEach(c=>{_.ev(c.segmentIndex,b);c.duration=b;c.ed=c.vc+b})},XB=function(a){let b=Infinity;a.filter(NA).forEach(c=>{b=Math.min(b,c.duration)});return b},YB=function(a,b){return _.y(function*(){var c=_.jh([b],a.f.attemptParameters);c.type=1;c=yield a.C(c);let d="";try{d=_.Eg(c.data)}catch(e){throw new _.H(_.G,4,4042);}d=d.replace(/\r\n|\r(?=[^\n]|$)/gm,
|
|
26
|
+
"\n");d=d.trim();return{text:d,response:c}})},dC=function(a,b){return _.y(function*(){var c=ZB(a,b,a.m,"");if(1===c.type){c=_.Fo(c.S[0].a)||"";c=null!=_.Eo.video[c]?_.w:null!=_.Eo.audio[c]?_.p:null;var d="";c===_.w?d="avc1.42E01E":c===_.p&&(d="mp4a.40.2");{c=a.J;var e=a.m;d=a.f.hlsDefaultCodecs||d;const h=[],k=[];k.push(new _.ch(_.ja,"0"));k.push(new _.ch(_.kb,e));d.length&&k.push(new _.ch(_.ka,d));h.push(new _.dh(c.a++,rA,k));c=new $B(e,0,h)}}d=c.$;c=FA(d,"EXT-X-MEDIA");e=FA(d,rA);d=FA(d,"EXT-X-IMAGE-STREAM-INF");
|
|
27
|
+
c={uc:{lf:GA(c,["AUDIO",_.qb]),closedCaptions:GA(c,eA),og:GA(c,xA)},ld:e,Fd:d};c=yield aC(a,c);if(!a.D)throw new _.H(_.G,7,7001);d=$A(c[0]);e=bC(a,d.delay,c);if(!cC(a)){a.G=d.Qc;d=0;for(var f of a.g.values())d=Math.max(d,f.Eb(0).vc);for(f=0;95443.7176888889<=d;)f+=95443.7176888889,d-=95443.7176888889;if(f){a.a.debug("Offsetting live streams by",f,"to compensate for rollover");for(var g of a.g.values())d=g.Eb(0),95443.7176888889>d.vc?(a.a.debug("Offset applied to",d.type),d.segmentIndex.offset(f)):
|
|
28
|
+
a.a.debug("Offset NOT applied to",d.type)}}g=YA(c);"LIVE"===a.j||"EVENT"===a.j?(g=Math.max(g,e.F),isNaN(a.f.availabilityWindowOverride)||(g=a.f.availabilityWindowOverride),e.j=g):a.j===_.Qt&&(e.f=g);g={presentationTimeline:e,periods:c,offlineSessionIds:[],minBufferTime:0};a.a.debug("HLS playlist parsed",g);return g})},fC=function(a,b){return Promise.all(b.map(c=>eC(a,c)))},hC=function(a,b){b.forEach(c=>{a:{var d=a.g.get(c.a),e=!cC(a),f=IA(c.$,iA);if(f)var g=Number(f.value);else{d?(f=d.ca[d.ca.length-
|
|
29
|
+
1].S,f=f[f.length-1].xa):f=0;if(e&&0<f)try{{const k=IA(c.$,mA);if(!k)throw gC.error("Failed to infer discontinuity number, because EXT-X-MEDIA-SEQUENCE tag is missing."),Error(tA);const l=Number(k.value),m=IB(d,l);if(!m)throw gC.error("Failed to infer discontinuity number, could not find the appropriate segment in the previous playlist"+` (segment position = ${l})`),Error(tA);var h=m.xa}g=h;break a}catch(k){throw new _.H(_.G,4,4024,"EXT-X-DISCONTINUITY-SEQUENCE tag is required for discontinuous HLS live streams.");
|
|
30
|
+
}g=0}}c=c.S||[];for(const k of c)HA(k.$,hA)&&g++,k.xa=g});rB(b)},lC=function(a,b,c,d){return _.y(function*(){const e=b.Oa;var f=b.stream.Eb(0);if(1!==e.type)throw new _.H(_.G,4,4017);var g=yield iC(a,e,f.type,f.codecs);g=jC(a,e.a,g);f.S=g;f.segmentIndex.replace(g);_.mv(c,g,d);f=g[g.length-1];IA(e.$,jA)&&(kC(a,_.Qt),_.jv(c,!0),c.f=f.endTime)})},iC=function(a,b,c,d){return _.y(function*(){var e=b.a,f=b.S;var g=void 0===g?0:g;var h=(h=IA(b.$,mA))?Number(h.value):g;g=[];!cC(a)&&zB(f);e=yield mC(a,b.f,
|
|
31
|
+
e,f,h,c,d);if(0===f.length)f=[];else{var k=[],l=[];for(var m of f)HA(m.$,hA)&&0<l.length&&(k.push(l),l=[]),l.push(m);k.push(l);f=k}for(m=0;m<f.length;m++)k=f[m],l=yield nC(a,b.f,k,h,e,c,d,g[g.length-1]||null,f.length),g.push(l),h+=k.length;oC(g);return g})},jC=function(a,b,c){var d=c[0].S;a=pC(a,b,d[0].position);VB(d,a?a.startTime:0);for(d=1;d<c.length;d++)a=c[d-1].S,VB(c[d].S,a[a.length-1].endTime);return c.flatMap(e=>e.S)},kC=function(a,b){a.j=b;cC(a)&&a.h.stop()},ZB=function(a,b,c,d){a:{a=a.J;
|
|
32
|
+
b=b.trim().split(/\n+/m);if(!/^#EXTM3U($|[ \t\n])/m.test(b[0]))throw new _.H(_.G,4,4015);var e=b,f=0,g=!0;for(h of e){var h=h.trim();if(!h.length||/^#(?!EXT)/m.test(h)||g)g=!1;else if(e=_.eh(0,h),fB.includes(e.name)){f=1;break}else e.name===rA&&(g=!0)}h=f;f=[];g=!0;for(var k of _.yu(b)){let {Dd:l,item:m,next:n}=k;m=m.trim();if(!m.length||/^#(?!EXT)/m.test(m)||g)g=!1;else{e=m;e=_.eh(a.a++,e);if(qC.includes(e.name)){if(1!==h)throw new _.H(_.G,4,4017);k=b.splice(l,b.length-l);a=iB(a,c,k);c=new $B(c,
|
|
33
|
+
h,f.concat(a.$),a.S);break a}f.push(e);e.name===rA&&(e.attributes.push(new _.ch(_.kb,n)),g=!0)}}c=new $B(c,h,f)}c.a=d;rC(c);return c},aC=function(a,b){return _.y(function*(){var c=cB(b.uc.closedCaptions),d=sC(a,b.ld),e=yield tC(a,b),f=Object.values(e).flat().map(g=>g.Oa);hC(a,f);f=yield uC(a,e.mf,d);c=yield vC(a,e.ld,f,c);d=yield wC(a,e.ng,d);e=yield xC(a,e.Fd);e=SB(c,d,e,!cC(a));!cC(a)&&(e=[UB(e)]);a.D.filterAllPeriods(e);return e})},bC=function(a,b,c){let d=!0,e=null,f=0;cC(a)||(d=!1,e=0,f=b);const g=
|
|
34
|
+
new _.Vz(e,f,!0);_.jv(g,d);MA(c,(h,k)=>{_.mv(g,h.S,k.startTime)});return g},sC=function(a,b){const c=new Map;for(const f of b){var d=_.pg(f,"AUDIO");b=_.pg(f,_.qb);var e=_.pg(f,xA);const g=yC(a,f);if(e){const h=_.Nh(_.v,g);c.set(e,h);e=g.indexOf(h);-1<e&&g.splice(e,1)}d&&(e=zC(_.p,g),c.set(d,e));b&&(d=zC(_.w,g),c.set(b,d))}return c},tC=function(a,b){return _.y(function*(){const c=yield Promise.all([AC(a,b.uc.lf),AC(a,b.uc.og),AC(a,b.ld),AC(a,b.Fd)]),[d,e,f,g]=c;return{mf:d,ng:e,ld:f,Fd:g}})},uC=function(a,
|
|
35
|
+
b,c){return _.y(function*(){if(0===b.length)return new Map;var d=[BC(a,b[0],c)];yield d[0];d=d.concat(b.slice(1).map(e=>BC(a,e,c)));d=yield Promise.all(d);return aB(d)})},vC=function(a,b,c,d){return _.y(function*(){const e=new Set;var f=[...b];let g=0;var h=Infinity;for(let k=0;k<f.length;++k){const l=Number(CA(f[k].tag,_.ja));l<h&&(h=l,g=k)}h=f.splice(g,1).pop();h=yield CC(a,h,c,d,e);f=f.map(k=>CC(a,k,c,d,e));f=yield Promise.all(f);f.splice(g,0,h);return f.reduce(_.ru,[])})},wC=function(a,b,c){return Promise.all(b.map(d=>
|
|
36
|
+
BC(a,d,c)))},xC=function(a,b){return Promise.all(b.map(c=>DC(a,c)))},AC=function(a,b){return _.y(function*(){return(yield Promise.all(b.map(c=>_.y(function*(){const d=yield EC(a,c);return d?{tag:c,Oa:d}:null})))).filter(Boolean)})},eC=function(a,b){return _.y(function*(){var c=new _.cg(b.ca[0].nd);if(a.f.hlsLowLatency){var d=c.a;if(b.ca[0].Tc){var e=b.ca[b.ca.length-1].segmentIndex;if(e=e.a[e.a.length-1]){var f=e.a,g=f.length-1;e={Xf:e.position,Qe:f&&0<f.length?g:null}}else e=null;e&&(d.add("_HLS_msn",
|
|
37
|
+
e.Xf),null!==e.Qe&&d.add("_HLS_part",e.Qe))}e=d;_.ng(e);e.g&&_.fg(c,d)}const {response:h,text:k}=yield YB(a,c.toString());c=b.ca[0].fc;d=b.ca[0].nd;e=h.uri;d!==e&&(d=e,JB(b,d));c=ZB(a,k,d,c);return{stream:b,Oa:c}})},yC=function(a,b){var c=_.pg(b,_.ka,a.f.hlsDefaultCodecs||"avc1.42E01E,mp4a.40.2").split(/\s*,\s*/);b=new Set;const d=[];for(const e of c)c=_.Ju(e)[0],b.has(c)?a.a.debug("Ignoring duplicate codec"):(d.push(e),b.add(c));return d},zC=function(a,b){if(1===b.length)return b[0];a=_.Nh(a,b);
|
|
38
|
+
if(null!=a)return a;throw new _.H(_.G,4,4025,{codecList:b});},BC=function(a,b,c){return _.y(function*(){const d=b.tag,e=b.Oa;return FC(a,e.a,()=>_.y(function*(){const f=CA(d,_.Ba);var g={AUDIO:_.p,VIDEO:_.w,SUBTITLES:_.v,"CLOSED-CAPTIONS":_.v}[CA(d,"TYPE").toUpperCase()];if(!g)throw new _.H(_.G,4,4044,"EXT-X-MEDIA tag has an invalid TYPE attribute.");const h=c.get(f)||"",k=bB(d),l=_.pg(d,"NAME"),m=d.getAttribute("DEFAULT"),n=d.getAttribute("AUTOSELECT"),q=_.pg(d,"CHANNELS");return yield GC(a,{Oa:e,
|
|
39
|
+
codecs:h,type:g,language:k,primary:!!m&&!!n,name:l,channelsCount:g===_.p?q?parseInt(q.split("/")[0],10):null:null,groupId:f,closedCaptions:null,ke:null})}))})},DC=function(a,b){return _.y(function*(){const c=b.tag,d=b.Oa;return FC(a,d.a,()=>_.y(function*(){var e=_.pg(c,_.ka)||"jpg",f=bB(c);const g=_.pg(c,"NAME");e=yield GC(a,{Oa:d,codecs:e,type:_.cd,language:f,name:g,primary:!1,channelsCount:null,closedCaptions:null,groupId:null,ke:null});(f=_.pg(c,_.ja))&&NB(e,Number(f));return e}))})},CC=function(a,
|
|
40
|
+
b,c,d,e){return _.y(function*(){var f=b.tag,g=Number(CA(f,_.ja));if(null!=f.getAttribute("FRAME-RATE")||null!=f.getAttribute(_.Ya)){var h=_.pg(f,"FRAME-RATE");f=_.pg(f,_.Ya);var [k,l]=f?f.split("x"):[null,null];h={frameRate:EA(h),width:EA(k),height:EA(l)}}else h=null;if(f=yield HC(a,b,h,c,d)){h=f.video;f=f.audio;var m=0<f.length?f:[null];h=0<h.length?h:[null];f=[];for(const T of m)for(const Ha of h)if(m=(Ha?Ha.ca[0].fc:"")+" - "+(T?T.ca[0].fc:""),e.has(m))a.a.debug("Skipping variant which only differs in text streams.");
|
|
41
|
+
else{a:{var n=a;var q=T,t=Ha,u=g;const Nb=[],gd=(t||q).length();for(let gc=0;gc<gd;gc++){var x=q?q.Eb(gc)||null:null,A=t?t.Eb(gc)||null:null,E=x,B=A;E=E&&B?_.Bu(E.drmInfos,B.drmInfos)?_.Au(E.drmInfos,B.drmInfos):null:E?E.drmInfos:B?B.drmInfos:null;if(!E){n=null;break a}B=u;x={id:n.H++,language:x?x.language:_.xe,primary:!!x&&x.primary||!!A&&A.primary,audio:x,video:A,bandwidth:B,drmInfos:E,allowedByApplication:!0,allowedByKeySystem:!0};Nb.push(x)}n=new IC(Nb)}null==n?a.a.warn("Incompatible DRM info in HLS variant. Skipping."):
|
|
42
|
+
(f.push(n),e.add(m))}g=f}else g=[];return g})},pC=function(a,b,c){return(a=a.g.get(b))?IB(a,c)||null:null},HC=function(a,b,c,d,e){return _.y(function*(){var f=b.tag,g=b.Oa;let h=yC(a,f);var k=_.pg(f,"AUDIO"),l=_.pg(f,_.qb),m=k||l;m=m&&d.has(m)?d.get(m):[];k={audio:k?m:[],video:l?m:[]};a.a.debug("Guessing stream type for",f.toString());f=!1;const n=g.a;g=k.audio.find(q=>q.fc===n);l=_.Nh(_.w,h);l=c||l;1!==h.length||l?!m.length&&1<h.length?(a.a.debug("Guessing multiplexed audio+video"),g=_.w,h=[h.join(",")]):
|
|
43
|
+
k.audio.length&&g?(a.a.debug(uA),g=_.p,f=!0):k.video.length?(a.a.debug(uA),g=_.p):(a.a.debug("Guessing video-only"),g=_.w):(g=_.p,a.a.debug(uA));l=null;f||(l=yield JC(a,b,h,g,e,c));if(null==l)return null;k[g]=[l];g===_.p&&c&&m.forEach(q=>{KB(q,c.width);LB(q,c.height);MB(q,c.frameRate)});eB(k);return k})},JC=function(a,b,c,d,e,f){return _.y(function*(){const g=b.tag,h=b.Oa;return FC(a,h.a,()=>_.y(function*(){var k=_.pg(g,eA);let l=null;d===_.w&&k&&"NONE"!==k&&(l=e.get(k));k=zC(d,c);return yield GC(a,
|
|
44
|
+
{Oa:h,codecs:k,type:d,closedCaptions:l,primary:!1,language:null,name:null,channelsCount:null,groupId:null,ke:f})}))})},FC=function(a,b,c){if(a.g.has(b))return a=a.g.get(b),Promise.resolve(a);if(a.g.a.has(b))return a.g.a.get(b)||null;c=c();a.g.set(b,c);return c},GC=function(a,b){return _.y(function*(){const c=b.Oa,d=b.codecs,e=b.type,f=b.language,g=b.groupId,h=b.primary,k=b.name,l=b.channelsCount,m=b.closedCaptions,n=b.ke;if(1!==c.type)throw new _.H(_.G,4,4017);var q=OA(c.$);kC(a,q);const t=ZA(c.$,
|
|
45
|
+
q,a.f.hlsLowLatency||!1);q=yield iC(a,c,e,d);const u=a.f.hlsLowLatency?_.Wx:_.Xt;let x=void 0;e===_.v&&(x=_.eu);const {Tc:A}=SA(c.$);q=q.map(E=>{const B=E.S,T=E.xf,Ha=E.mimeType;E=E.xa;const Nb=B[0].startTime,gd=B[B.length-1].endTime,gc=gd-Nb,sa=new _.Wz(B),Ge=B[0].initSegment||null;return{id:a.H++,originalId:k,createSegmentIndex:Promise.resolve.bind(Promise),findSegmentPosition:sa.f.bind(sa),getSegmentReference:sa.get.bind(sa),adjustSegmentDurations:sa.g.bind(sa),getDuration:sa.getDuration.bind(sa),
|
|
46
|
+
segmentIndex:sa,segmentLookupStrategy:u,initSegmentReference:Ge,mimeType:Ha,codecs:d,kind:x,we:T.type,encrypted:T.type===AA,keyId:T.keyId,language:f||_.xe,label:k,type:e,primary:h,trickModeVideo:null,emsgSchemeIdUris:null,frameRate:n?n.frameRate:void 0,width:n?n.width:void 0,height:n?n.height:void 0,bandwidth:void 0,roles:[],channelsCount:l,closedCaptions:m,keyInfo:T.keyInfo,S:B,drmInfos:T.drmInfos,xa:E,fc:c.a,nd:c.f,vc:Nb,ed:gd,duration:gc,Tc:A,groupId:g,Wf:t}});return new KC(q)})},EC=function(a,
|
|
47
|
+
b){return _.y(function*(){var c="EXT-X-MEDIA"!==b.name?!0:_.pg(b,"TYPE")===xA;c=_.pg(b,_.kb,void 0,{required:c});if(!c)return null;const d=KA(a.m,c),{response:e,text:f}=yield YB(a,d);return ZB(a,f,e.uri,c)})},rC=function(a){1===a.type&&a.S.forEach((b,c)=>{if(HA(b.$,lA)&&!HA(b.$,hA)&&0<c)throw new _.H(_.G,4,4046,"Media playlist contains an EXT-X-MAP tag not accompanied by an EXT-X-DISCONTINUITY tag.");})},oC=function(a){if(1<(new Set(a.map(b=>b.mimeType))).size)throw new _.H(_.G,4,4045,"Media playlist contains discontinuities with different MIME types. This is valid, but not yet supported.");
|
|
48
|
+
},LC=function(a){a=a.map(b=>b.a?b.a:b.f.map(c=>_.pg(c,_.kb))||null).map(b=>_.Fo(b));if(1<(new Set(a)).size)throw new _.H(_.G,4,4044,"Unexpected change in file format.");},MC=function(a,b,c){a=FA(a.$,lA);if(1<a.length)throw new _.H(_.G,4,4020);a=a[0];if(!a)return null;const d=CA(a,_.kb),e=KA(b,d);b=TA(a,null,!0);return new _.Sz(()=>[e],b.ua,b.ha,c)},NC=function(a,b,c,d,e,f,g){const h=[];for(const q of _.yu(b.f)){b=q.Dd;const t=q.item;{var k=0===b,l=k?a:h[h.length-1],m=k?d:l.endTime,n=Number(_.pg(t,
|
|
49
|
+
"DURATION"));n=m+n;k=TA(t,k?null:l.ha,k);l=_.pg(t,_.kb);const u=(l=KA(g,l))?[l]:[];m=new UA(c,m,n,()=>u,k.ua,k.ha,e,f,!1,null,null,null,null);if("YES"===_.pg(t,"INDEPENDENT")||0===b)m.g=!0;h.push(m)}}return h},OC=function(a,b,c,d,e,f,g,h,k,l,m){const n=c.$;var q=c.a;const t=null!=q,u=q?[q]:[];if(!t&&!a.f.hlsLowLatency)return null;a=0;q={ua:0,ha:null};let x=null;t?({duration:c}=RA(n),a=e+c,q=QA(n,b?b.ha:null)):(b=NC(b,c,d,e,f,g,k),a=b[b.length-1].endTime,x=b);h=h===_.cd?JA(n):null;d=new UA(d,e,a,()=>
|
|
50
|
+
u,q.ua,q.ha,f,g,!1,null,h?h.Be:null,h?h.cf:null,h?h.durationPerTile:null,x);d.xa=l;d.initSegment=m||void 0;return d},mC=function(a,b,c,d,e,f,g){return _.y(function*(){var h=d[0];if(null!=a.w)return a.w;if(!cC(a)&&a.B){h=pC(a,c,e);if(!h)throw new _.H(_.G,4,4030,"Segment not found in pervious playlist update.");h=h.startTime+h.sa;a.a.debug(`Setting playlist start time to ${h}.`);return a.w=h}const k=yield PC(a,f,g,h);var l=AB(h.$,a.m,k)||vB();const m=MC(h,b,l.keyInfo);l=WA(l.keyInfo,e);h=yield QC(a,
|
|
51
|
+
m,h,l,k,g);a.a.debug(`Setting playlist start time to ${h}.`);return a.w=h})},nC=function(a,b,c,d,e,f,g,h,k){return _.y(function*(){var l=c[0],m=null==h;LC(c);const n=yield PC(a,f,g,l);var q=a.m,t=h?h.Vf:null;var u=1===k;if(c.slice(1).some(yB))throw new _.H(_.G,4,4046,u?"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not at the beginning of the playlist.":"Media playlist contains an EXT-X-KEY tag with METHOD\x3dAES-128 which is not marked by an EXT-X-DISCONTINUITY tag and is not at the beginning of the playlist.");
|
|
52
|
+
if(HA(c[0].$,kA)||null===t)if((t=AB(c[0].$,q,n))&&t.type===BA){if(1<CB(c))throw new _.H(_.G,4,4046,yA+`${u?"playlist":"discontinuity"}.`);u=[t]}else u=BB(c,q,n),u=0===u.length?[vB()]:u;else if(q=BB(c,q,n),t.type===_.Ad||t.type===AA)u=[t,...q];else{if(0<CB(c))throw new _.H(_.G,4,4046,yA+`${u?"playlist":"discontinuity"}.`);u=[t]}q=u;u=q[q.length-1];q=wB(q);t=MC(l,b,q.keyInfo)||(h?h.Qf:null);var x=WA(q.keyInfo,d);const A=l.xa;l=m?e:yield RC(a,A,t,l,d,x,n,g);m=[];for(x=0;x<c.length;x++){var E=c[x];const B=
|
|
53
|
+
m[m.length-1]||null,T=0===x?0:B.endTime,Ha=d+x,Nb=WA(q.keyInfo,Ha);(E=OC(a,B,E,Ha,T,l,Nb,f,b,A,t))&&m.push(E)}return{S:m,xf:q,Vf:u,mimeType:n,endTime:m[m.length-1].endTime,xa:A,Qf:t}})},PC=function(a,b,c,d){return _.y(function*(){const e=d.a;var f=IA(d.$,lA);f=f?CA(f,_.kb):null;return SC(a,b,c,e,f)})},QC=function(a,b,c,d,e,f){return _.y(function*(){if(null==c.a)return 0;const g=VA(c,d);return GB(a.K,b,g,e,f,null!=d)})},RC=function(a,b,c,d,e,f,g,h){return _.y(function*(){if(a.F.has(b))return a.F.get(b);
|
|
54
|
+
const k=yield QC(a,c,d,f,g,h);a.a.debug(`Segment #${e} has raw media timestamp `+`${k} s.`);a.F.set(b,k);return k})},SC=function(a,b,c,d,e){return _.y(function*(){const f=[d,e].filter(Boolean);var g=_.Qh(f,b,c);if(g)return g;g=_.jh([d],a.f.attemptParameters);g.method="HEAD";g.type=2;g=(yield a.C(g)).headers["content-type"];if(!g)throw new _.H(_.G,4,4021,"Unknown MIME type of: "+f.join(", "));return g.split(";")[0]})},cC=function(a){return a.j===_.Qt},$B=class{constructor(a,b,c,d){if(1===b){if(!d||
|
|
55
|
+
0===d.length)throw new _.H(_.G,4,4043,"Media playlist must have at least one segment!");if(null==d[0].a)throw new _.H(_.G,4,4043,"Media playlist must have at least one full segment!");}this.f=a;this.a="";this.type=b;this.$=c;this.S=1===b?d:null}},hB=class{constructor(a,b,c){c=void 0===c?[]:c;this.$=b;this.a=a;this.f=c;this.xa=-1}},UA=class extends _.wv{constructor(a,b,c,d,e,f,g,h,k,l,m,n,q,t){t=void 0===t?[]:t;super(a,b,c,d,e,f,g,void 0===h?null:h,void 0===k?!1:k,void 0===l?null:l,void 0===m?null:
|
|
56
|
+
m,void 0===n?null:n,void 0===q?null:q,t);this.initSegment=void 0;this.xa=0}},fB=[iA,jA,"EXT-X-I-FRAMES-ONLY",mA,nA,oA,qA,sA],qC=["EXTINF",gA,"EXT-X-DATERANGE",hA,kA,lA,"EXT-X-PROGRAM-DATE-TIME"],gB=["EXT-X-PART",pA],TC=class{constructor(){this.a=0}},UC=class{constructor(){this.f=new Map;this.a=new Map}set(a,b){this.a.set(a,b);return b.then(c=>this.f.set(a,c)).catch(()=>{}).then(()=>this.a.delete(a))}has(a){return this.f.has(a)}get(a){return this.f.get(a)||null}values(){return Array.from(this.f.values())}clear(){this.a.clear();
|
|
57
|
+
this.f.clear()}},gC=new _.O("clpp.hls.DiscontinuityUtils");var EB={"com.apple.streamingkeydelivery":function(a,b){if(b===_.He)throw new _.H(_.G,4,4041);if(CA(a,vA)===wA)throw new _.H(_.G,4,4044,"EXT-X-KEY:METHOD SAMPLE-AES-CTR is not supported in FairPlay.");return _.uu(_.Gc,[{initDataType:_.ge,initData:new Uint8Array(0)}],"")},"com.microsoft.playready":uB,"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":uB,"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":function(a){var b=CA(a,vA);if(!sB.includes(b))return tB.error("Widevine in HLS is only supported with [",
|
|
58
|
+
sB.join(", "),"], not",b),null;b=CA(a,_.kb);b=_.Vn(b);b=_.I(b.data);b=_.uu(_.Ic,[{initDataType:_.rc,initData:b}],"");if(a=_.pg(a,"KEYID"))b.keyIds=[a.substr(2).toLowerCase()];return b}},sB=["SAMPLE-AES",wA],tB=new _.O("clpp.hls.DrmParser");var DB=new _.O("clpp.hls.EncryptionUtils");var VC=class{constructor(a){this.f=new _.O("clpp.hls.MediaReader");this.g=a;this.a={attemptParameters:_.gh()}}};var KC=class{constructor(a){this.ca=a}length(){return this.ca.length}Eb(a){return this.ca[a]}};var IC=class{constructor(a){this.a=a}length(){return this.a.length}Eb(a){return this.a[a]}};var WC=class{constructor(){this.f=this.D=null;this.H=1;this.g=new UC;this.m="";this.J=new TC;this.G=0;this.A=new Map;this.h=new _.Yh(()=>{this.yb()});this.j=_.Qt;this.B=null;this.o=new _.Io;this.w=null;this.a=new _.O("clpp.hls.HlsParser");this.F=new Map;this.K=new VC(this.C.bind(this));this.I=!1}configure(a){this.f=a;this.K.a=a}setCurrentVariant(a){const b=a.video?a.video.id:null;a=a.audio?a.audio.id:null;this.A.clear();for(const c of this.g.values())(null!=b&&OB(c,b)||null!=a&&OB(c,a))&&this.A.set(c.ca[0].fc,
|
|
59
|
+
c)}start(a,b){const c=this;return _.y(function*(){if(c.I)throw Error("start() may be called only once!");c.I=!0;c.D=b;const {response:d,text:e}=yield YB(c,a);c.m=d.uri;const f=yield dC(c,e);c.B=f;const g=c.G;0<g&&c.h.da(g);return f})}stop(){this.h&&(this.h.stop(),this.h=null);const a=[];this.o&&(a.push(this.o.destroy()),this.o=null);this.g.clear();this.A.clear();this.B=this.f=this.D=null;return Promise.all(a)}onExpirationUpdated(){}update(){const a=this;return _.y(function*(){var b=a.B;if(!cC(a)&&
|
|
60
|
+
b){var c=b.presentationTimeline;b=b.periods[0].startTime;var d=[];"LIVE"===a.j&&(a.w=null);var e=Array.from(a.A.values());e=a.f.hlsLowLatency&&0<e.length?e:Array.from(a.g.values());e=yield fC(a,e);var f=e.map(g=>g.Oa);hC(a,f);yield lC(a,e[0],c,b);for(f=1;f<e.length;f++)d.push(lC(a,e[f],c,b));yield Promise.all(d)}})}yb(){const a=this;return _.y(function*(){a.a.debug(_.Pt);if(a.D)try{yield a.update(),a.h.da(a.G)}catch(b){a.D&&(a.D.onError(b),1===b.severity&&a.h.da(.1))}})}C(a){if(!this.o)throw new _.H(_.G,
|
|
61
|
+
7,7001);a=this.D.networkingEngine.fetch(a);_.qh(this.o,a);return a.P}};_.z("clpp.hls.HlsComponent",class extends _.zp{constructor(){super()}f(){_.zn.m3u8=WC;_.xn[_.Ui]=WC;_.xn[zA]=WC}a(){_.Dv("m3u8");_.Ev(_.Ui);_.Ev(zA)}id(){return"hls"}});};f.call(g, window);
|
package/cl.hlssmpte.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
else a.f.warn("A video element is not available. Skipping.")},
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kK=function(a){a.a.one(a.l,_.nd,()=>jK(a))},jK=function(a){const b=a.l.getSurface().getMedia();if(b)if(a.h){a.a.on(b.textTracks,_.Kb,d=>lK(a,d));var c=Array.from(b.textTracks);c.filter(d=>d.kind===_.td).forEach(d=>{lK(a,{track:d})});!mK(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."),nK(a,b))}else a.f.warn("The clpp.ttml.TextParser class is not available. Please register the ttml component first.");
|
|
2
|
+
else a.f.warn("A video element is not available. Skipping.")},lK=function(a,b){b=b.track;b.kind===_.td&&(a.f.info("The metadata track has been added."),b.mode=_.bd,a.a.on(b,_.Lc,c=>oK(a,c)))},mK=function(a){return a.some(b=>b.kind===_.td)},nK=function(a,b){const c=a.l.getTrackManager(),d=c.na(),e=c.getAudioTracks().find(g=>g!==d);if(e){var f=()=>c.ta(d);a.a.on(b.textTracks,_.Kb,g=>{g.track.kind===_.td&&(a.a.off(b.textTracks,_.Kb,f),c.ta(d))});c.ta(e)}else a.f.warn("Can't enforce the creation of the metadata track if single audio track. Skipping.")},
|
|
3
|
+
oK=function(a,b){const c=pK(a);c&&Array.from(b.target.activeCues||[]).forEach(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 qK(d);if(e.f===c&&null!==e.a){a.g=d;d=a.h.parseMedia(_.Ig(e.a),{periodStart:a.j,segmentStart:e.startTime,segmentEnd:e.endTime});const f=a.l.getTextDisplayer();f.remove(0,e.startTime);f.append(d.cues,d.styles)}}})},pK=function(a){return(a=a.l.getTrackManager().oa())&&a.language&&a.language.toLowerCase()},
|
|
4
|
+
qK=class{constructor(a){this.startTime=a.startTime;this.endTime=a.endTime;this.a=this.f=null;a=a.value;if(!_.C(a)){a:{var b=a.info;if(_.pf(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=a=_.pf(a)?a:null}}};var rK=class{constructor(a,b,c){this.l=a;this.m=b;this.j=c;this.a=new _.jo;this.h=(a=_.Xn[_.Wb]||null)?new a(this.l.getConfiguration()):null;this.f=new _.O("clpp.hlssmpte.ImageCueHandler");this.g=null;kK(this)}destroy(){this.a.release();this.g=null;return Promise.resolve()}};var sK=class extends _.$p{constructor(){super();this.a=null;this.f=!1}onPlayerCreated(){}onContentWillLoad(a){if(this.f=_.li()){var b=a.getConfiguration();b=_.kf(b.hlssmpte||{});typeof b.patchMetadataTrack!==_.fc&&(b.patchMetadataTrack=!1);_.qf(b.timestampOffset)||(b.timestampOffset=0);this.a=new rK(a,b.patchMetadataTrack,b.timestampOffset)}}onPlayerWillDestroy(){const a=this;return _.y(function*(){a.a&&(yield a.a.destroy(),a.a=null)})}id(){return"hlssmpte"}};_.z("clpp.hlssmpte.HlsSmptePlugin",sK);
|
|
5
|
+
sK.Id="hlssmpte";_.Hm(new class{create(){return new sK}});};f.call(g, window);
|