@castlabs/prestoplay 6.12.0 → 6.13.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 +22 -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 +106 -106
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +504 -505
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +53 -50
- package/cjs/cl.freewheel.js +22 -22
- package/cjs/cl.hls.js +66 -66
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +21 -21
- package/cjs/cl.mse.js +269 -267
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -24
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +28 -28
- 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 +16 -16
- package/cjs/polyfill.min.js +26 -23
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +83 -83
- package/cl.conviva.js +27 -27
- package/cl.core.js +416 -416
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +53 -50
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +69 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +15 -15
- package/cl.mse.js +232 -231
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +13 -13
- package/package.json +1 -1
- package/typings.d.ts +82 -13
package/cl.muxdata.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a.m.getSurface();var e={player_is_paused:a.m.isPaused(),player_is_fullscreen:f.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){const k=new _.
|
|
3
|
-
c={videoWidth:c.width,videoHeight:c.height});const {videoWidth:g,videoHeight:h}=c;a.h.debug(`Video dimensions: ${g}x${h}`);g&&h&&(e.video_source_height=g,e.video_source_width=h);(d=d.oa())&&d.language&&(e.player_language_code=d.language)}return e}});a.h.debug("Mux SDK options",b);return b},
|
|
4
|
-
player_software_version:_.da,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.da};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},
|
|
5
|
-
"adbreakstart"));a.a.on(a.m,_.Xb,()=>
|
|
6
|
-
c.type||2===c.type||3===c.type))if(7001===b.code){b=c;c=b.requestStartTimestamp;var d=new _.
|
|
7
|
-
request_error_code:e,request_error_text:b.toString()};a.h.debug("onRequestFailed()","Track event: requestfailed",b);
|
|
8
|
-
a),this.l=!1);
|
|
9
|
-
|
|
10
|
-
player_error_message:b})}}J(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){{b=a.request;const e=a.headers,f=b.bytesLoaded,g=b.requestStartTimestamp;var c=b.startTime,d=b.endTime;const h=g+a.responseStartMs;a=g+a.timeMs;c=c&&d?d-c:void 0;d=new _.
|
|
11
|
-
request_media_duration:c,request_url:_.
|
|
12
|
-
this.a=!1;const h=new _.H(1,9,9301);this.U(a,h)}}else this.h.warn("Mux plugin is loaded but not configured. Will do nothing.");var e=d}null!==e&&this.f.initialize(c,b,e)}catch(f){this.a=!1,this.U(a,f)}}onContentLoaded(){}onPlayerWillDestroy(){this.a&&(this.f.destroy(),this.f=null)}onPlayerWillRelease(){this.a&&this.f.release()}id(){return"mux"}U(a,b){a.trigger(new _.F(_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Yw=function(a){switch(a.type){case 1:return Vw;case 2:return Ww;case 3:return Xw}},$w=function(a){const b=Object.keys(a).find(c=>Zw.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},bx=function(a){let b={debug:!0,data:ax(a)};a.f&&a.f.muxOptionsOverride&&_.xg(a.f.muxOptionsOverride)&&(b=_.tg(b,a.f.muxOptionsOverride));b=_.tg(b,{getPlayheadTime:()=>1E3*a.m.getPosition(),getStateData:()=>{{a.h.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager();const f=
|
|
2
|
+
a.m.getSurface();var e={player_is_paused:a.m.isPaused(),player_is_fullscreen:f.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){const k=new _.bl(c.url);e.video_source_url=_.Li(k);e.video_source_mime_type=c.type;c.name&&(e.video_title=c.name)}if(c=f.getContainer())e.player_width=c.offsetWidth,e.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().ia(),
|
|
3
|
+
c={videoWidth:c.width,videoHeight:c.height});const {videoWidth:g,videoHeight:h}=c;a.h.debug(`Video dimensions: ${g}x${h}`);g&&h&&(e.video_source_height=g,e.video_source_width=h);(d=d.oa())&&d.language&&(e.player_language_code=d.language)}return e}});a.h.debug("Mux SDK options",b);return b},cx=function(a){_.Tg(a.a);a.j.Bd(a.F);a.j.rf(a.C)},dx=function(a,b,c){a.h.debug(`Event: ${b}`);a.A.emit(a.B,b,c)},ax=function(a){const b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.pa,player_software_name:_.pa,
|
|
4
|
+
player_software_version:_.da,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.da};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},ex=function(a){a.a.on(a.m,_.Bf,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};dx(a,_.Bf,b)});a.a.on(a.m,_.Ie,()=>dx(a,_.Ie));a.a.on(a.m,_.Jc,a.G.bind(a));a.a.on(a.m,_.rf,a.I.bind(a));a.a.on(a.m,_.Kf,()=>dx(a,_.kf));a.a.on(a.m,_.Jf,()=>dx(a,_.jf));a.a.on(a.m,_.Nd,a.H.bind(a));a.a.on(a.m,_.Wb,()=>dx(a,
|
|
5
|
+
"adbreakstart"));a.a.on(a.m,_.Xb,()=>dx(a,"adbreakend"));a.a.on(a.m,_.jc,()=>{dx(a,"adplay");dx(a,"adplaying")});a.a.on(a.m,_.fc,()=>dx(a,"adpause"));a.a.on(a.m,_.hc,()=>{dx(a,"adplay");dx(a,"adplaying")});a.a.on(a.m,_.kc,()=>dx(a,"adended"));a.a.on(a.m,_.bc,()=>dx(a,"adfirstquartile"));a.a.on(a.m,_.ec,()=>dx(a,"admidpoint"));a.a.on(a.m,_.lc,()=>dx(a,"adthirdquartile"));a.j.Gc(a.F);a.j.Ce(a.C);a.a.on(a.m,_.Nd,b=>{if((b=b.detail)&&1===b.category){var c=b.data;c=c&&c.request;if(void 0!==c&&!0===(1===
|
|
6
|
+
c.type||2===c.type||3===c.type))if(7001===b.code){b=c;c=b.requestStartTimestamp;var d=new _.bl(b.uris[b.uriIndex]);b={request_start:c,request_type:Yw(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);dx(a,"requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.bl(c.uris[c.uriIndex]);var e=b.data;e=void 0===e?-1:void 0!==e.response?e.response.status:void 0!==e.status?e.status:-1;b={request_start:d,request_type:Yw(c),request_hostname:f.a,request_error:`${Yw(c)}${"LoadError"}`,
|
|
7
|
+
request_error_code:e,request_error_text:b.toString()};a.h.debug("onRequestFailed()","Track event: requestfailed",b);dx(a,"requestfailed",b)}}}})},fx=function(a){return!_.B(a)&&typeof a.init===_.Pd&&typeof a.emit===_.Pd},Vw="manifest",Ww="media",Xw="encryption",Zw=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var gx=class{constructor(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.hr;this.h=b;this.w=this.l=this.g=!1;this.A=null;this.j=a.getNetworkEngine();this.F=this.J.bind(this);this.C=this.K.bind(this)}initialize(a,b,c){this.f=a;this.o=b;this.A=c;if(!this.g){try{this.g=!0,this.A.init(this.B,bx(this))}catch(d){throw this.g=!1,cx(this),new _.H(1,9,9302,null,d);}dx(this,"playerready")}this.l&&!this.w&&(a=ax(this),dx(this,"videochange",
|
|
8
|
+
a),this.l=!1);ex(this)}release(){this.h.debug("release()");this.l?this.h.debug(_.ia):(cx(this),this.l=!0,this.o=this.f=null)}destroy(){this.h.debug(_.xd);this.w?this.h.debug(_.ha):(this.w=!0,dx(this,"destroy"))}G(a){this.h.debug(_.ve);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ja())&&a.bandwidth&&(b+=a.bandwidth),dx(this,"renditionchange",{video_source_bitrate:b}))}I(a){this.h.debug(_.ze);switch(a.detail.currentState){case _.on:this.m.getConfiguration().autoplay&&
|
|
9
|
+
dx(this,_.Ie);break;case _.qn:dx(this,_.Pe);break;case _.pn:dx(this,_.Ee);break;case _.en:dx(this,_.Md)}}H(a){this.h.debug(_.we);if(this.g&&(a=a.detail||null))if(10003===a.code)dx(this,"aderror");else if(a.severity===_.G){var b=a.message||"Player error";if(1===a.category||6100===a.code||6007===a.code)b="Download error",6100===a.code?b="Certificate request error":6007===a.code&&(b="License request error"),b=`${b} castlabs-error-data:${JSON.stringify(a.data)}`;dx(this,_.Nd,{player_error_code:a.code,
|
|
10
|
+
player_error_message:b})}}J(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){{b=a.request;const e=a.headers,f=b.bytesLoaded,g=b.requestStartTimestamp;var c=b.startTime,d=b.endTime;const h=g+a.responseStartMs;a=g+a.timeMs;c=c&&d?d-c:void 0;d=new _.bl(b.uris[b.uriIndex]);a={request_start:g,request_type:Yw(b),request_hostname:d.a,request_id:$w(e),request_bytes_loaded:f,request_response_start:h,request_response_end:a,request_response_headers:e,
|
|
11
|
+
request_media_duration:c,request_url:_.Li(d)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);dx(this,"requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var hx=class extends _.jt{constructor(){super();this.f=null;this.a=!1;this.h=new _.R("clpp.muxdata")}onPlayerCreated(a){this.f=new gx(a,this.h)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.ug(c.muxdata);try{var d=[];typeof c===_.ue&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.H(1,9,9300,{missingKeys:d});{const f=a.getConfiguration();d=null;if(this.a=!_.B(f.muxdata)&&typeof f.muxdata===_.ue){const g=f.muxdata;d=fx(g.muxLib)?g.muxLib:window.mux;if(!fx(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.H(1,9,9301);this.U(a,h)}}else this.h.warn("Mux plugin is loaded but not configured. Will do nothing.");var e=d}null!==e&&this.f.initialize(c,b,e)}catch(f){this.a=!1,this.U(a,f)}}onContentLoaded(){}onPlayerWillDestroy(){this.a&&(this.f.destroy(),this.f=null)}onPlayerWillRelease(){this.a&&this.f.release()}id(){return"mux"}U(a,b){a.trigger(new _.F(_.Nd,{detail:b}))}};_.z("clpp.muxdata.MuxDataPlugin",hx);hx.Id="mux";_.ro(new class{create(){return new hx}});};f.call(g, window);
|
package/cl.onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
certificateUrl:b,modifiers:{licenseRequest:_.
|
|
3
|
-
_.z("clpp.onboard.OnboardComponent",class extends _.
|
|
4
|
-
_.z("clpp.onboard.register",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Uw=function(a,b){let c=b.baseUrl;_.Yh(c,"/")||(c+="/");const d=g=>g&&(_.Xh(g,"https://")||_.Xh(g,"http://")||_.Xh(g,"//"))?g:`${c}${g}`,e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");b=d(b.fairplayUrl||"fairplay");a=new _.$r(a);a.Na(_.rd,{licenseUrl:e,videoRobustness:[_.zb,void 0],audioRobustness:[_.yb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.rl,licenseResponse:_.sl}});a.Na(_.nd,{licenseUrl:b,
|
|
2
|
+
certificateUrl:b,modifiers:{licenseRequest:_.ul,licenseResponse:_.vl,extractContentId:_.wl,certificateRequest:_.Al}});a.Na(_.pd,{licenseUrl:f,modifiers:{licenseRequest:_.rl}});_.Gk(a)};
|
|
3
|
+
_.z("clpp.onboard.OnboardComponent",class extends _.Js{constructor(){super();this.h=new _.R("clpp.onboard");this.j=new Set}a(){for(const a of this.j)delete _.Fk[a];this.j.clear()}g(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.h.info(`Registering the DRMtoday Onboard environment, name='${b}'`),Uw(b,a),this.j.add(b))}id(){return"onboard"}});
|
|
4
|
+
_.z("clpp.onboard.register",Uw);};f.call(g, window);
|
package/cl.persistent.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.
|
|
3
|
-
|
|
4
|
-
f={sessionIds:
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ew="A persistent DRM session already exists for: ",Fw="No DRM configuration.",Gw="clpp.persistent",Hw="clpp.persistent.SimpleSessionStorage",Iw=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},Kw=function(a,b){a.H=Jw;a.I=[];a.C=!0;return _.sm(a,b)},Mw=function(a,b,c,d,e,f){a.H=Lw;const g=new Map,h=_.dm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Be,persistentState:_.ff,sessionTypes:[_.Ge],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,
|
|
2
|
+
distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.rm(a,g)},Nw=function(a,b){return _.x(function*(){const c=yield _.Im(a,b);if(c){var d=[],e=a.f.get(c);e&&a.A&&(e.ob=new _.vm,d.push(e.ob));a.h.debug("Attempting to remove session",b);d.push(c.remove());return Promise.all(d)}a.h.debug("Ignoring attempt to remove missing session",b)})},Ow=function(a){a=a.f.keys();a=Iw(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
Pw=function(a,b){const c=_.Ik(a),d=_.ok({drm:a});d.drm=a;a=new _.zn({Ab:b,onError:()=>{},ke:()=>{},onExpirationUpdated:()=>{},onEvent:()=>{},getConfiguration:()=>d,wc:()=>null});a.g=c;return a},Sw=function(a,b,c){return _.x(function*(){const d=Qw;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)Rw.debug(Ew,e);else{var g=Pw(a,c);try{yield Kw(g,b);yield _.Gm(g);yield _.Jm(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.hj(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));
|
|
4
|
+
f={sessionIds:Ow(g),keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw Rw.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Rw.debug(Fw)})},Jw=1,Lw=2,Tw=class{constructor(){this.h=new _.R(Hw)}store(a,b){return _.x(function*(){{var c=JSON.stringify(b.sessionIds);var d=b.serverCertificate?Array.from(b.serverCertificate):
|
|
5
5
|
null;d=JSON.stringify(d);const e=JSON.stringify(b.audioCapabilities),f=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:c,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:d,audioCapabilities:e,videoCapabilities:f,drmConfig:JSON.stringify(b.drmConfig)})}window.localStorage.setItem(encodeURIComponent(a),btoa(c))})}get(a){const b=this;return _.x(function*(){const c=window.localStorage.getItem(encodeURIComponent(a));if(c)try{{const e=JSON.parse(atob(c)),
|
|
6
|
-
f=JSON.parse(e.sessionIds),g=e.audioCapabilities||[],h=e.videoCapabilities||[],k=e.serverCertificate||[],l=e.drmConfig||{};var d={sessionIds:f,keySystem:e.keySystem,licenseServerUri:decodeURIComponent(e.licenseServerUri||""),serverCertificate:k?new Uint8Array(k):null,audioCapabilities:g,videoCapabilities:h,drmConfig:l}}return d}catch(e){b.h.warn(`Error while loading offline items for ${a} from storage: `,e)}return null})}delete(a){return _.x(function*(){window.localStorage.removeItem(encodeURIComponent(a))})}clear(){return _.x(function*(){window.localStorage.clear()})}getName(){return
|
|
7
|
-
_.z("clpp.persistent.fetchLicense",function(a,b,...c){return _.x(function*(){var d=
|
|
8
|
-
const l=yield k.start(f.url,{networkingEngine:d,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onTimelineCueAdded:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.H(_.G,4,4014));const m=_.
|
|
9
|
-
_.z("clpp.persistent.removeLicense",function(a){return _.x(function*(){var b=
|
|
10
|
-
new _.H(1,6,6201,null,e);}finally{b=[],c&&b.push(c.destroy()),d&&b.push(d.destroy()),yield Promise.all(b)}}else
|
|
11
|
-
const c=
|
|
6
|
+
f=JSON.parse(e.sessionIds),g=e.audioCapabilities||[],h=e.videoCapabilities||[],k=e.serverCertificate||[],l=e.drmConfig||{};var d={sessionIds:f,keySystem:e.keySystem,licenseServerUri:decodeURIComponent(e.licenseServerUri||""),serverCertificate:k?new Uint8Array(k):null,audioCapabilities:g,videoCapabilities:h,drmConfig:l}}return d}catch(e){b.h.warn(`Error while loading offline items for ${a} from storage: `,e)}return null})}delete(a){return _.x(function*(){window.localStorage.removeItem(encodeURIComponent(a))})}clear(){return _.x(function*(){window.localStorage.clear()})}getName(){return Hw}};_.z("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.B(a)||(_.yg(a.store)||c.push("store"),_.yg(a.get)||c.push("get"),_.yg(a.delete)||c.push("delete"),_.yg(a.clear)||c.push("clear"),_.yg(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw Rw.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});Qw=a});
|
|
7
|
+
_.z("clpp.persistent.fetchLicense",function(a,b,...c){return _.x(function*(){var d=Qw,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.tn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Fw);var g=b.offlineId;if(typeof g!==_.uf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Rw.debug(Ew,g);else{var h=_.ok();d=new _.oo;g=[];for(var k of c){const l=new k;_.rk(l.id())||(l.f(),_.tk(l),g.push(l))}k=null;try{k=yield _.pq(f.url,d,h.manifest.attemptParameters,f.type||null);k.configure(h.manifest);
|
|
8
|
+
const l=yield k.start(f.url,{networkingEngine:d,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onTimelineCueAdded:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.H(_.G,4,4014));const m=_.nq(l.periods);yield Sw(b,m,d)}catch(l){if(l instanceof _.H&&6200===l.code)throw l;throw e(null,l);}finally{for(;g.length;)e=g.shift(),e.a(),_.qk.delete(e.id());e=[];k&&e.push(k.stop());e.push(d.destroy());yield Promise.all(e)}}})});
|
|
9
|
+
_.z("clpp.persistent.removeLicense",function(a){return _.x(function*(){var b=Qw;if(_.Ag(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.oo,c=Pw(e.drmConfig,d),yield Mw(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.Gm(c),yield Promise.all(e.sessionIds.map(f=>_.x(function*(){yield Nw(c,f);Rw.debug("successfully removed session with id",f)}))),yield b.delete(a)):Rw.debug("No persistent DRM session found")}catch(e){throw Rw.error("Failed to remove session"),
|
|
10
|
+
new _.H(1,6,6201,null,e);}finally{b=[],c&&b.push(c.destroy()),d&&b.push(d.destroy()),yield Promise.all(b)}}else Rw.warn("Invalid offlineId")})});var Qw=new Tw,Rw=new _.R(Gw);_.z("clpp.persistent.PersistentLicenseComponent",class extends _.Js{constructor(){super();this.h=new _.R(Gw)}id(){return _.Fe}l(a,b){const c=this;return _.x(function*(){const d=a.getConfiguration().drm;if(d){c.h.debug(`Persisting DRM session ID: ${d.offlineId}`);var e=a.getNetworkEngine();try{yield Sw(d,b,e),a.trigger(new _.F(_.Gd,{offlineId:d.offlineId}))}catch(f){a.onError(f)}}else c.h.debug("No DRM configuration found for loaded source.")})}j(a){const b=this;return _.x(function*(){b.h.debug(`Getting EME session IDs for ${a}`);
|
|
11
|
+
const c=Qw;try{const d=yield c.get(a);if(d)return d.sessionIds||[];b.h.debug(`No offline session found for ${a}`);return[]}catch(d){return b.h.warn("Error while loading session info from storage"),[]}})}});};f.call(g, window);
|
package/cl.playlist.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
|
-
this.a.length&&
|
|
3
|
-
c.trigger(new _.F(_.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Bw=function(a,b){return 0<=b&&b<a.a.length},Cw=function(a){a.trigger(new _.F(_.Re))},Dw=class extends _.Vr{on(a,b,c){return super.on(a,b,c)}one(a,b,c){return super.one(a,b,c)}off(a,b){return super.off(a,b)}constructor(a,b){b=void 0===b?()=>Promise.resolve():b;super();this.m=a;this.l=b;this.f=0;this.a=[];this.g=!1;this.j=this.gc.bind(this)}getPosition(){return this.f}og(){return this.a}Oc(){return 0<this.a.length&&Bw(this,this.f)?this.a[this.f]:null}pg(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&Bw(this,a)?this.a[a]:null}vg(){return this.g}start(){this.g||(this.g=!0,this.m.on(_.Md,this.j),this.sd(this.f,!0))}stop(){this.g=!1;this.m.off(_.Md,this.j)}gc(){this.next()}next(){const a=this;return _.x(function*(){yield a.sd(Math.min(a.a.length-1,a.f+1))})}Mg(){const a=this;return _.x(function*(){yield a.sd(Math.max(0,a.f-1))})}sd(a,b){b=void 0===b?!1:b;const c=this;return _.x(function*(){if(0<c.a.length&&Bw(c,a)&&(b||c.f!==a)){c.f=a;var d=c.Oc();d&&(yield c.l(d),yield c.m.load(d.configuration),
|
|
3
|
+
c.trigger(new _.F(_.Qe,{item:d})))}})}append(a){this.a.push(a);Cw(this)}ug(a,b){if(0<=b&&b<=this.a.length){const c=this.Oc();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Cw(this)}}remove(a){if(0<this.a.length&&Bw(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Cw(this)}}clear(){this.stop();this.f=0;this.a=[];this.g=!1;Cw(this)}};_.z("clpp.Playlist",Dw);Dw.prototype.clear=Dw.prototype.clear;Dw.prototype.remove=Dw.prototype.remove;Dw.prototype.insert=Dw.prototype.ug;
|
|
4
|
+
Dw.prototype.append=Dw.prototype.append;Dw.prototype.goTo=Dw.prototype.sd;Dw.prototype.previous=Dw.prototype.Mg;Dw.prototype.next=Dw.prototype.next;Dw.prototype.onEnded=Dw.prototype.gc;Dw.prototype.stop=Dw.prototype.stop;Dw.prototype.start=Dw.prototype.start;Dw.prototype.isStarted=Dw.prototype.vg;Dw.prototype.getUpcoming=Dw.prototype.pg;Dw.prototype.getCurrent=Dw.prototype.Oc;Dw.prototype.getQueue=Dw.prototype.og;Dw.prototype.getPosition=Dw.prototype.getPosition;Dw.prototype.off=Dw.prototype.off;
|
|
5
|
+
Dw.prototype.one=Dw.prototype.one;Dw.prototype.on=Dw.prototype.on;};f.call(g, window);
|
package/cl.simid.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
c)})},
|
|
3
|
-
!1,volume:c.m.getVolume()||0,navigationSupport:"adHandles",closeButtonSupport:"adHandles",nonlinearDuration:c.f.duration},creativeData:{adParameters:c.f.adParameters||"",clickThruUri:"",clickThruUrl:""}}}{const f=
|
|
4
|
-
value:void 0}))},
|
|
5
|
-
e=
|
|
6
|
-
"";a.g=!1;a.m.trigger(new _.F(_.
|
|
7
|
-
_.
|
|
8
|
-
d);if(c.m&&c.m.getSurface()&&c.m.getSurface().getMedia()&&d.mediaDimensions){c.g?c.m.getSurface().getMedia().style.transition="":(c.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",c.g=!0);const e=
|
|
9
|
-
d.left,c.a.a.style.top=d.top,c.a.a.style.width=d.width,c.a.a.style.height=d.height);
|
|
10
|
-
this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},
|
|
11
|
-
b=this.m.getSurface()){this.h.info("Creating new session");this.a=new
|
|
12
|
-
c&&(c=this.a,
|
|
13
|
-
this.g=!1;this.f=null}release(){this.h.info("Releasing loader")}getContainer(){const a=this.getSurface().getContainer();if(!a)throw this.h.error("No player container found. Can not create SIMID init data"),new _.H(1,10,10100,"No player container found");return a}getSurface(){const a=this.m.getSurface();if(!a)throw this.h.error("No player surface found. Can not create SIMID init data"),new _.H(1,10,10100,"No surface");return a}url(){return this.f?this.f.url:""}};_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kw="No surface found. Can not attach frame!",lw="SIMID:Media:timeupdate",mw="Starting creative",nw=function(a,b,c){return{type:b,sessionId:a.g,messageId:a.l++,timestamp:Date.now(),args:c}},qw=function(a,b){return new Promise((c,d)=>{new ow(a.j,c,d,b);pw(a,b)})},rw=function(a){const b=nw(a,"SIMID:Player:startCreative",void 0);qw(a,b).then(()=>{var c=a.f;c.h.info(mw);c.m.trigger(new _.F(_.mf));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.h.error("Error while starting creative",
|
|
2
|
+
c)})},tw=function(a,b){_.x(function*(){a.g=b.sessionId;sw(a,b);try{{var c=a.f;const f=c.getSurface(),g=c.getContainer();var d={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:c.m.isMuted()||
|
|
3
|
+
!1,volume:c.m.getVolume()||0,navigationSupport:"adHandles",closeButtonSupport:"adHandles",nonlinearDuration:c.f.duration},creativeData:{adParameters:c.f.adParameters||"",clickThruUri:"",clickThruUrl:""}}}{const f=nw(a,"SIMID:Player:init",d);var e=qw(a,f)}yield e;a.h.info("Player Init acknowledged");a.f.h.info("SIMID Player initialized")}catch(f){a.h.error("Error while initializing",f),a.f.h.error("Error while initializing SIMID player: ",f),a.unload()}})},sw=function(a,b){pw(a,nw(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},pw=function(a,b){a.g?(b.type!==lw&&a.h.info(`Posting message [${b.messageId}] '${b.type}':`,b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.h.warn(`WARNING: no session available to send message '${b.type}'`)},uw=function(a,b,c){return new ResizeObserver(()=>{if(a.a.g){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};
|
|
5
|
+
e=nw(d,"SIMID:Player:resize",e);pw(d,e)}})},vw=function(a,b){a.h.info("SIMID Session created");a.a=b},ww=function(a){a.h.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(()=>{a.m.getSurface().getMedia().style.transition=""},500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height=
|
|
6
|
+
"";a.g=!1;a.m.trigger(new _.F(_.nf))},xw=function(a,b){var c=a.getContainer();a=c.clientWidth;c=c.clientHeight;return{top:`${b.y/c*100}%`,left:`${b.x/a*100}%`,width:`${b.width/a*100}%`,height:`${b.height/c*100}%`}},yw=class{constructor(a){this.f=a;this.g="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";this.a.style.border=_.te;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=
|
|
7
|
+
_.te;this.a.style.overflow=_.Rd;this.a.classList.add(_.Xc);this.o=b=>{if(b.source===this.a.contentWindow&&(b=(b=b.data)?typeof b===_.uf?JSON.parse(b):b:null))if(b.type)switch(this.h.info(`Received message [${b.messageId}] '${b.type}':`,b.args),b.type){case "createSession":tw(this,b);break;case "resolve":b=b.args;var c=this.j.get(b.messageId);c&&c.resolve(b);break;case "reject":b=b.args;(c=this.j.get(b.messageId))&&c.reject(b);break;case "SIMID:Creative:requestResize":c=this.f;var d=b.args;c.h.info("Creative requested resize",
|
|
8
|
+
d);if(c.m&&c.m.getSurface()&&c.m.getSurface().getMedia()&&d.mediaDimensions){c.g?c.m.getSurface().getMedia().style.transition="":(c.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",c.g=!0);const e=xw(c,d.mediaDimensions);c.m.getSurface().getMedia().style.left=e.left;c.m.getSurface().getMedia().style.top=e.top;c.m.getSurface().getMedia().style.width=e.width;c.m.getSurface().getMedia().style.height=e.height}d.creativeDimensions&&(d=xw(c,d.creativeDimensions),c.a.a.style.left=
|
|
9
|
+
d.left,c.a.a.style.top=d.top,c.a.a.style.width=d.width,c.a.a.style.height=d.height);sw(this,b)}else this.h.warn("WARNING: received message without 'type' property")};this.h=new _.R("clpp.simid.SimidPlayer");vw(this.f,this)}load(a){window.addEventListener(_.le,this.o);this.g="";this.l=0;const b=this.f.url();this.h.info(`Loading "${b}" as src of iFrame`);this.a.src=b;this.h.info("Attaching iFrame");a.appendChild(this.a)}unload(){ww(this.f);this.g=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.le,
|
|
10
|
+
this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},ow=class{constructor(a,b,c,d,e){e=void 0===e?-1:e;this.f=a;this.l=b;this.j=c;this.g=d;this.a=null;this.f.set(d.messageId,this);0<=e&&(this.a=setTimeout(()=>{this.resolve()},e))}resolve(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f.delete(this.g.messageId);this.l(a)}reject(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f.delete(this.g.messageId);this.j(a)}};var Aw=class extends _.jt{constructor(){super();this.h=new _.R("clpp.simid.Plugin");this.g=this.a=this.m=null;this.l=[];this.j=null;this.w=this.A.bind(this);this.f=null;this.o=!1}id(){return"simid"}onPlayerCreated(a){this.h.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.g&&this.g.release();this.g=new zw(a)}onContentWillLoad(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length)if(this.l=b.simid.creatives,this.h.info(`Setting up SIMID plugin for ${this.l.length} creatives`),
|
|
11
|
+
b=this.m.getSurface()){this.h.info("Creating new session");this.a=new yw(this.g);var c=b.getContainer();this.j=uw(this,c,b);this.j.observe(c);a.on(_.Bf,this.w)}else this.h.warn(kw)}A(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b];const d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(rw(this.a),this.o=!0,this.h.info(mw)),
|
|
12
|
+
c&&(c=this.a,pw(c,nw(c,lw,{currentTime:a-b}))))):((a=this.m.getSurface())||this.h.warn(kw),a=a.getContainer(),this.f=b,this.o=!1,this.h.info("Loading session"),this.g.f=b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)}onPlayerWillRelease(a){super.onPlayerWillRelease(a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.Bf,this.w),this.f&&(this.a.unload(),this.f=this.g.f=null))}},zw=class{constructor(a){this.m=a;this.a=null;this.h=new _.R("clpp.simid.Loader");
|
|
13
|
+
this.g=!1;this.f=null}release(){this.h.info("Releasing loader")}getContainer(){const a=this.getSurface().getContainer();if(!a)throw this.h.error("No player container found. Can not create SIMID init data"),new _.H(1,10,10100,"No player container found");return a}getSurface(){const a=this.m.getSurface();if(!a)throw this.h.error("No player surface found. Can not create SIMID init data"),new _.H(1,10,10100,"No surface");return a}url(){return this.f?this.f.url:""}};_.ro(new class{create(){return new Aw}});};f.call(g, window);
|
package/cl.smooth.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
b,a.g),a.a+=2}catch(c){_.
|
|
3
|
-
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.
|
|
4
|
-
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.w:a.
|
|
5
|
-
Number(a[2]);let f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}}else
|
|
6
|
-
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.
|
|
7
|
-
|
|
8
|
-
(a=(new
|
|
9
|
-
|
|
10
|
-
0<l-k.reader.getPosition()&&k.flags&32&&(m.o=_.P(k.reader));d=m}}).$("trun",k=>{{var l=k.reader.Ca();if(null===k.flags)throw new _.H(_.G,3,3019,
|
|
11
|
-
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.
|
|
12
|
-
|
|
13
|
-
g;d=g.get(_.
|
|
14
|
-
A;y++){b:{var k=h;var l=g[y],m=new RegExp("\\w+:"+l),n=0;if(k.hasAttribute(l)){k=k.getAttribute(l);break b}l=k.attributes;const D=l.length;for(;n<D;n++){var q=l[n].name;if(q=q.match(m)){k=k.getAttribute(q[0]);break b}}k=null}h.setAttribute(g[y],
|
|
15
|
-
m,f]);n&&b.append([n]);if(e){g=0;k=[];if(c.flags&2)for(k=[],m=0;m<c.j;m++)k.push(10+6*c.g[m].Fc);else g=8;b.append([c,new
|
|
16
|
-
periodId:null}},
|
|
17
|
-
c.type=1;c=yield a.D.networkingEngine.fetch(c).P;a.l=c.uri;return c})},
|
|
18
|
-
1E7;let g=+
|
|
19
|
-
const ea=[],bb=_.
|
|
20
|
-
|
|
21
|
-
+
|
|
22
|
-
new Uint16Array(1),
|
|
23
|
-
new _.H(_.G,4,4037,
|
|
24
|
-
fh:
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
a.g.presentationTimeline;d.j=c;d.l=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.R=b},
|
|
28
|
-
{a.G.delete(k)})})}else a.h.warn(`Cannot find satisfying update for ${g.type} `+`track with bitrate ${g.bitrate}. Skipping update.`)}}},
|
|
29
|
-
Math.min(a.a.Sc,b.endTime);return f}
|
|
30
|
-
D);break;case _.p:D=h.kd,E=2,"AACH"===h.
|
|
31
|
-
language:k.language,originalLanguage:k.Rc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.
|
|
32
|
-
vd:a.J.bind(a),
|
|
33
|
-
a)return this.f[b];{const c=this.f[b].get(a);if(c)return c}}return null}a(){const a=Math.pow(2,32)-1;let b;b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(let c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b}write(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.N(a,1):_.N(a,this.size);_.
|
|
34
|
-
this.f[b].a(),a.getPosition()}},
|
|
35
|
-
this.offset}write(a){super.write(a);_.
|
|
36
|
-
a;this.duration=b;this.volume=256;this.j=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]}a(){let a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=super.a()}write(a){super.write(a);1===this.version?(
|
|
37
|
-
_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,this.j);a.getPosition()}},
|
|
38
|
-
0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]}a(){let a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+super.a()}write(a){super.write(a);1===this.version?(
|
|
39
|
-
b){super("mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956}a(){let a=0;a=1===this.version?a+28:a+16;return a+4+super.a()}write(a){super.write(a);1===this.version?(
|
|
40
|
-
_.w?_.
|
|
41
|
-
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
""){super("url ",0,1);this.location=a}a(){return this.location.length+super.a()}write(a){super.write(a);0<this.location.length&&_.
|
|
46
|
-
0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},
|
|
47
|
-
|
|
48
|
-
a.getPosition()}},
|
|
49
|
-
0;a=1===this.version?a+8:a+4;return a+super.a()}write(a){super.write(a);1===this.version?
|
|
50
|
-
4),this.flags&
|
|
51
|
-
a,b);this.g=255;this.o=this.w=this.l=this.B=this.j=0}a(){let a=4;this.flags&
|
|
52
|
-
|
|
53
|
-
this.l.length;b++)
|
|
54
|
-
0,0);this.offset=[0]}a(){let a=0;this.flags&1&&(a+=8);a+=4;for(let b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+super.a()}write(a){super.write(a);this.flags&1&&(_.N(a,0),_.N(a,0));_.N(a,1);for(let b=0;1>b;b++)0===this.version?_.N(a,this.offset[b]):
|
|
55
|
-
0),_.N(a,0));
|
|
56
|
-
for(let c=0;c<this.g[b].Fc;c++)
|
|
57
|
-
this.D=null;this.j&&(clearTimeout(this.j),this.j=null);this.K=!1;this.I=this.F=Infinity;return Promise.resolve()}update(){if(this.C())return
|
|
58
|
-
null;if(this.o.length)for(let c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b}V(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);const b=a.request.timescale||this.w.timescale,c={isLive:this.C.bind(this),vd:this.J.bind(this),
|
|
59
|
-
`segment reference time ${a.request.startTime}`);f=
|
|
1
|
+
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var vK="Full MP4 box must have flags defined",wK="clpp.smooth.SmoothMP4Processor",xK="codecPrivateData",yK=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.N(a,c);_.N(a,b)},zK=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Lk()}},AK=function(a,b){zK(a,b>>16&255);zK(a,b>>8&255);zK(a,b&255)},BK=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Lk()}},CK=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Lk()}},DK=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.g),a.a+=2}catch(c){_.Lk()}},EK=function(a,b){if(void 0!=b){var c=new Uint8Array(b);const d=Math.min(a.length,b);let e=0;for(;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}b=new Uint8Array(a.length);for(c=0;c<a.length;++c)b[c]=a.charCodeAt(c);return b},FK=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},GK=function(a,b,c,d){c=b.Te[c];b=b.fh;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",
|
|
3
|
+
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.by([a],[b])[0]},HK=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.w?c=["maxWidth","maxHeight","bitrate",xK,"fourCC"]:a.type===_.p&&(c=["bitrate",xK,"channels","bitsPerSample","samplingRate","fourCC"]);return _.Cg(a,b,c,["id","segmentIndex"])},IK=function(a,b,c){const d=c.kd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Oa:null,Qb:null,width:NaN,height:NaN,Jb:null,Yc:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.w:a.Oa=[_.gi(d[1])];a.Qb=[_.gi(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Jb=_.gi(c.kd),a.sampleSize=c.Rf||16,a.Yc=c.Yc,a.channelCount=c.Le}return a},JK=function(a,b){return a.filter(c=>c.type===b)},KK=function(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)},RK=function(a,b,c){var d=null;if(LK.test(a)){{a=LK.exec(a);d=Number(a[1]);const e=
|
|
5
|
+
Number(a[2]);let f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}}else MK.test(a)?d=KK(MK,a):NK.test(a)?d=KK(NK,a):OK.test(a)?(a=OK.exec(a),d=Number(a[1])/c.frameRate):PK.test(a)?(a=PK.exec(a),d=Number(a[1])/c.a):QK.test(a)&&(d=KK(QK,a));c=d;d=c+b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-3600*b-60*c);d-=a;10>b&&(b="0"+b);10>c&&(c="0"+c);10>a&&(a="0"+a);0===d?d="000":d=Math.round(1E3*d);return b+":"+c+":"+a+"."+d},SK=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.gl(b)},ZK=function(a,b,c){a:{var d=[_.rd,_.pd];for(e of d)if((d=c.qd(e))&&d.keyId){var e=d.keyId;break a}_.C(wK,"Could not get default Key ID for DRM init data!");e=null}c=new TK("xxxx");a.type===_.w?c=new UK(a.width,a.height):c=new VK(a.channelCount,a.sampleSize,a.Yc);a=new WK;a.g=1;a.j=8;a.o=e||"00000000000000000000000000000000";a=(new TK("schi")).append([a]);b=(new TK(_.of)).append([new XK(b),new YK(_.Sc,65536),a]);c.append([b]);return c},
|
|
7
|
+
BL=function(a,b){var c=b.vd(),d=new $K(a.timescale,a.duration,a.id),e=(new aL).append([new bL(a.id)]),f=new cL(a.id,a.duration,a.timescale,a.width,a.height),g=new dL(a.timescale,a.duration);const h=new eL(a.type);var k=null,l=new fL;l.entries=[new gL];var m=new hL;switch(a.type){case _.w:k=new iL(a.Oa,a.Qb);c?(a=ZK(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new jL(a.width,a.height)).append([k]),m.entries=[a]);k=new kL;break;case _.p:k=new lL(a.Jb),c?(a=ZK(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new mL(a.channelCount,a.sampleSize,a.Yc)).append([k]),m.entries=[a]),k=new nL}m=(new oL).append([m,new pL,new qL,new rL,new sL]);l=(new tL).append([l]);l=(new uL).append([k,l,m]);g=(new vL).append([g,h,l]);f=(new wL).append([f,g]);d=(new xL).append([d,f,e]);e=new yL("dash",0,["iso6","mp41","avc1"]);c&&(c=b.qd(_.pd),b=b.qd(_.rd),c&&d.append([new zL("pssh",c.initData,8)]),b&&d.append([new zL("pssh",b.initData,8)]),c||b||_.C(wK,"Could not get PSSH init data!"));b=new AL([e,d]);return _.J(b.write())},
|
|
9
|
+
LL=function(a,b){let c,d,e,f,g,h;(new _.el).L("moof",_.Xk).$("mfhd",k=>{{const l=new CL;l.g=_.P(k.reader);c=l}}).L("traf",_.Xk).$("tfhd",k=>{{const l=k.reader.Ca();if(null===k.flags)throw new _.H(_.G,3,3019,vK);const m=new DL(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.Sk(k.reader));0<l-k.reader.getPosition()&&k.flags&2&&(m.B=_.P(k.reader));0<l-k.reader.getPosition()&&k.flags&8&&(m.l=_.P(k.reader));0<l-k.reader.getPosition()&&k.flags&16&&(m.w=_.P(k.reader));
|
|
10
|
+
0<l-k.reader.getPosition()&&k.flags&32&&(m.o=_.P(k.reader));d=m}}).$("trun",k=>{{var l=k.reader.Ca();if(null===k.flags)throw new _.H(_.G,3,3019,vK);const m=new EL(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.l=_.Rk(k.reader));0<l-k.reader.getPosition()&&k.flags&4&&(m.o=_.P(k.reader));if(0<l-k.reader.getPosition())for(l=0;l<m.g;l++)k.flags&256&&m.w.push(_.P(k.reader)),k.flags&512&&m.sampleSize.push(_.P(k.reader)),k.flags&1024&&m.B.push(_.P(k.reader)),k.flags&
|
|
11
|
+
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.Rk(k.reader)));e=m}}).$("sdtp",k=>{{const l=_.Uk(k.reader,k.reader.Ca());f=new FL("sdtp",k.version||0,k.flags||0,l,0)}}).L("uuid",k=>{var l=_.Uk(k.reader,16);if(_.ii(l,GL)){l=_.P(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new HL(k.version,k.flags);l.j=_.P(k.reader);k.flags&1&&(l.l=_.Pk(k.reader));for(let m=0;m<l.j;m++){const n={cf:_.Uk(k.reader,8),Fc:0,ve:[]};if(k.flags&2){n.Fc=_.Qk(k.reader);for(let q=0;q<n.Fc;q++){const t={Je:0,Ke:0};
|
|
12
|
+
t.Je=_.Qk(k.reader);t.Ke=_.P(k.reader);n.ve.push(t)}}l.g.push(n)}g=l}}).L(_.je,k=>{{const l=new IL;0<k.reader.Ca()?l.g=_.Uk(k.reader,k.reader.Ca()):(_.C(wK,"mdat box is empty!"),l.g=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new JL).append([d,e]);f&&a.append([f]);b.vd()&&g&&a.append([g]);b=(new KL).append([c,a]);return new AL([b,h])},QL=function(a,b,c,d){var e=d.vd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=LL(b,d);if(null===g)return a.request.contentType===_.u?a.data:
|
|
13
|
+
g;d=g.get(_.je);if(a.request.contentType===_.u){e=d.g.buffer;if(c){e=_.Th(e);if((e=(new DOMParser).parseFromString(e,_.Af))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new ML(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0])){f=h.getElementsByTagName("p");for(let t=0,v=f.length;t<v;t++){h=f[t];a=c;b=d;g=["begin",_.Ld];for(let y=0,A=g.length;y<
|
|
14
|
+
A;y++){b:{var k=h;var l=g[y],m=new RegExp("\\w+:"+l),n=0;if(k.hasAttribute(l)){k=k.getAttribute(l);break b}l=k.attributes;const D=l.length;for(;n<D;n++){var q=l[n].name;if(q=q.match(m)){k=k.getAttribute(q[0]);break b}}k=null}h.setAttribute(g[y],RK(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.Uh(e).buffer}else c=e;return c}h=new KL;a=g.get("mfhd");b=new JL;k=g.get("tfhd");m=new NL(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");k.g=1;k.flags&=16777214;k.flags|=131072;b.append([k,
|
|
15
|
+
m,f]);n&&b.append([n]);if(e){g=0;k=[];if(c.flags&2)for(k=[],m=0;m<c.j;m++)k.push(10+6*c.g[m].Fc);else g=8;b.append([c,new OL,new PL(g,k,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new AL([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+16,d.seek(e.start),e.write(d),h=d.buffer);return h},RL=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},SL=function(a){return{initData:_.Sx(_.Ql(a)),initDataType:_.Sc,keyId:a,periodId:null}},TL=function(a,b,c){a=_.Yl(a);c&&a.version!==c&&(a=_.Ux(a,c));return{initData:_.Sx(a),initDataType:_.Sc,keyId:b,periodId:null}},UL=function(a,b){return _.x(function*(){var c=_.ti(b);c.timeout=a.f.attemptParameters.timeout;c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length);c.baseDelay=a.f.attemptParameters.baseDelay;c.backoffFactor=a.f.attemptParameters.backoffFactor;c.fuzzFactor=a.f.attemptParameters.fuzzFactor;
|
|
17
|
+
c.type=1;c=yield a.D.networkingEngine.fetch(c).P;a.l=c.uri;return c})},bM=function(a,b){let c=null;try{{const ea=new DOMParser;let bb,Oa;try{const hb=_.Th(b);Oa=ea.parseFromString(hb.trim(),_.Af)}catch(hb){throw hb;}Oa&&Oa.documentElement.tagName==_.Db&&(bb=Oa.documentElement);c=bb&&0<bb.getElementsByTagName("parsererror").length?null:bb}}catch(ea){}if(!c)throw a.h.error("Unable to parse manifest"),new _.H(_.G,4,4033,a.l);const d=+VL(a,c,"MajorVersion"),e=+VL(a,c,"MinorVersion"),f=+c.getAttribute("TimeScale")||
|
|
18
|
+
1E7;let g=+VL(a,c,"Duration");const h="TRUE"===c.getAttribute("IsLive"),k=+c.getAttribute("LookAheadCount"),l=+c.getAttribute("DVRWindowLength")||Infinity,m=_.Kl(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+d+"."+e))throw a.h.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.H(_.G,4,4036,a.l);h?(WL(a,XL),a.A=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),g=Infinity):WL(a,YL);a.a={startTime:0,delay:0,duration:g/f,Od:l/f,Sc:0};if(m){{var n=a.f.playreadyVersion;
|
|
19
|
+
const ea=[],bb=_.Kl(m,"ProtectionHeader")[0],Oa=_.fi(_.Ml(bb)||""),hb=_.Yl(Oa).a;ea.push(RL(_.rd,SL(hb),[hb]));ea.push(RL(_.pd,TL(Oa,hb,n),[hb]));var q=ea}a.o=q}{const ea=[],bb=_.Kl(c,"StreamIndex");if(!bb.length)throw a.h.error("No streams found!"),new _.H(_.G,4,4034,a.l);for(let Oa=0;Oa<bb.length;Oa++){{var t=a,v=bb[Oa];const hb=VL(t,v,"Type"),xc=+v.getAttribute("Chunks"),mh=v.getAttribute("Subtype"),ae=v.getAttribute("Language")||_.Ef,be=_.Dh(ae),nh=v.getAttribute("Name")||"",Uf=+v.getAttribute(_.db),
|
|
20
|
+
Vf=+v.getAttribute(_.cb),xl=VL(t,v,"Url"),lP=+v.getAttribute("TimeScale")||null;{const yc=[],Ri=_.Kl(v,_.sb);for(let ce=0;ce<Ri.length;ce++){{let zc,La,sd;var y=t,A=Ri[ce],D=hb;const Si=+A.getAttribute("Index"),Wf=+VL(y,A,"Bitrate");let Zb=NaN,Xf=NaN,yl=NaN,Rq=NaN,OB=NaN,PB=NaN,QB=NaN;const RB=A.getAttribute("FourCC");switch(D){case _.w:Zb=+VL(y,A,_.cb);Xf=+VL(y,A,_.db);break;case _.p:Rq=+A.getAttribute("Channels")||2,yl=+VL(y,A,"SamplingRate"),PB=+VL(y,A,"AudioTag"),OB=+VL(y,A,"BitsPerSample"),QB=
|
|
21
|
+
+VL(y,A,"PacketSize")}let Sq=String(A.getAttribute("CodecPrivateData"));if(D===_.p&&!Sq){{var E=Rq;const SB={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},zl=SB[yl];if("AACH"===RB){La=new Uint8Array(4);const TB=SB[2*yl];La[0]=40|zl>>1;La[1]=zl<<7|E<<3|TB>>1;La[2]=TB<<7|8;La[3]=0;zc=new Uint16Array(2);zc[0]=(La[0]<<8)+La[1];zc[1]=(La[2]<<8)+La[3];sd=zc[0].toString(16)+zc[1].toString(16)}else La=new Uint8Array(2),La[0]=16|zl>>1,La[1]=zl<<7|E<<3,zc=
|
|
22
|
+
new Uint16Array(1),zc[0]=(La[0]<<8)+La[1],sd=zc[0].toString(16);Sq=sd.toUpperCase()}}var O={id:y.W++,type:D,index:Si,bitrate:Wf,kd:Sq,maxHeight:Zb,maxWidth:Xf,Yc:yl,Le:Rq,nh:PB,Rf:OB,zh:QB,hg:RB,segmentIndex:null}}yc.push(O)}var tb=yc}{const yc=[],Ri=_.Kl(v,"c");for(let ce=0;ce<Ri.length;ce++){const zc=Ri[ce];let La=parseInt(zc.getAttribute("t"),10),sd=parseInt(zc.getAttribute("d"),10),Si=parseInt(zc.getAttribute("r"),10),Wf=0;if(isNaN(La)&&isNaN(sd))throw t.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
23
|
+
new _.H(_.G,4,4037,t.l);0===ce&&isNaN(La)&&(Wf=La=0);if(0<ce){const Zb=yc[yc.length-1];Wf=Zb.n+1;Zb.d||(Zb.d=La-Zb.t);La||(La=Zb.t+Zb.d);sd||(sd=La-Zb.t)}yc.push({n:Wf,d:sd,t:La});if(Si){Si--;for(let Zb=0;Zb<Si;Zb++){const Xf=yc[yc.length-1];Wf=Xf.n+1;La=Xf.t+Xf.d;sd=Xf.d;yc.push({n:Wf,d:sd,t:La})}}}t.C()||yc.length===xc||t.h.warn("Number of fragments ("+xc+") differs from number of chunks ("+yc.length+").");var Nb=yc}var Zc={type:hb,qh:xc,Yg:mh,language:be,Rc:ae,name:nh,maxWidth:Uf,maxHeight:Vf,
|
|
24
|
+
fh:xl,tracks:tb,Te:Nb,timescale:lP}}ea.push(Zc)}var Qf=ea}const Va={yh:d,ef:e,timescale:f,duration:g,isLive:h,xh:k,Od:l,Vd:!1,streams:Qf};if(a.g&&a.w)return ZL(a,Va),Promise.resolve();a.G.clear();{const ea=Va.timescale,bb=Va.duration,Oa=JK(Va.streams,_.p),hb=JK(Va.streams,_.w),xc=JK(Va.streams,_.u),mh=[];let ae=$L(a,bb,ea,Oa),be=$L(a,bb,ea,hb);const nh=$L(a,bb,ea,xc);ae.length||(ae=[null]);be.length||(be=[null]);for(let Uf=0;Uf<be.length;Uf++)for(let Vf=0;Vf<ae.length;Vf++)mh.push(aM(a,be[Uf],ae[Vf]));
|
|
25
|
+
var Yd={startTime:0,variants:mh,textStreams:nh,thumbStreams:[]}}{var uc=Va.streams;let ea=a.a.startTime,bb=a.a.delay;const Oa=a.I;let hb=Math.min(a.a.duration||Infinity,Oa);const xc=a.C(),mh=a.a.Od,ae=a.a.Sc,be=a.H,nh=isFinite(a.F)?a.F:0;if(xc)hb=Infinity,ea=Date.now()/1E3-ae,a.a.startTime=ea,bb=3*be;else{const Uf=isFinite(Oa)?Oa:a.a.duration;for(const Vf of uc)for(const xl of Vf.tracks)xl.segmentIndex.offset(-nh),_.By(xl.segmentIndex,Uf)}a.B=new _.wD(ea,bb,!xc,!0);a.B.f=hb;_.Ky(a.B,be);a.B.w=mh;
|
|
26
|
+
xc||a.B.offset(-nh)}a.D.filterAllPeriods([Yd]);a.g={presentationTimeline:a.B,periods:[Yd],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.K||(a.D.networkingEngine.Gc(a.M),a.K=!0);a.w=Va;return Promise.resolve()},cM=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Bb.bind(a),b))},VL=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.H(_.G,4,4038,a.l,c);},WL=function(a,b){const c=b===YL;if(a.g&&a.g.presentationTimeline){var d=
|
|
27
|
+
a.g.presentationTimeline;d.j=c;d.l=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.R=b},ZL=function(a,b){for(let e=0;e<a.w.streams.length;e++){const f=b.streams[e];for(const g of a.w.streams[e].tracks){var c=f.tracks.find(h=>h.type===g.type&&h.bitrate===g.bitrate);if(c){HK(g,c)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var d=dM(a,a.w.timescale,f,c);c=g.segmentIndex;_.Uy(c,d);(d=a.a.Od)&&_.Vy(c,_.Sy(c)-d).forEach(h=>{h.La().forEach(k=>
|
|
28
|
+
{a.G.delete(k)})})}else a.h.warn(`Cannot find satisfying update for ${g.type} `+`track with bitrate ${g.bitrate}. Skipping update.`)}}},dM=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.Te.forEach((h,k)=>{const l=h.d/g;0===k?(h=h.t/g,a.F=Math.min(a.F,h)):h=f[k-1].endTime;const m=h+l,n=GK(a.l,c,k,d);a.H=Math.max(a.H,l);f.push(new _.Ty(k,h,m,()=>[n],0,null,0,null,!0,g));a.G.set(n,h);e+=l});if(c.type===_.w||c.type===_.p)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Sc?a.a.Sc=b.endTime:a.a.Sc=
|
|
29
|
+
Math.min(a.a.Sc,b.endTime);return f},$L=function(a,b,c,d){let e=[];for(let f=0;f<d.length;f++){const g=d[f].tracks.map(h=>{{var k=d[f],l=dM(a,c,k,h);const O=new _.xD(l);var m=null;k.type!==_.u&&(m=eM(a,b,c,k,h));h.segmentIndex=O;l=a.N++;var n=Promise.resolve.bind(Promise),q=O.f.bind(O),t=O.get.bind(O),v=O.g.bind(O),y=O.getDuration.bind(O),A=fM[k.type];var D="";switch(k.type){case _.w:D=h.kd;var E=/00000001[0-9]7/.exec(D);D="avc1."+(E&&E[0]?D.substr(D.indexOf(E[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",
|
|
30
|
+
D);break;case _.p:D=h.kd,E=2,"AACH"===h.hg?E=5:D&&(E=(parseInt(D.substr(0,2),16)&248)>>3),D="mp4a.40."+E,a.h.debug("AUDIO CODECS: ",D)}E=k.type===_.u?gM[k.Yg]:void 0;h={id:l,originalId:null,Bh:null,createSegmentIndex:n,findSegmentPosition:q,getSegmentReference:t,adjustSegmentDurations:v,getDuration:y,segmentIndex:O,segmentLookupStrategy:_.Dx,initSegmentReference:m,mimeType:A,codecs:D,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:E,encrypted:a.J(),keyId:null,
|
|
31
|
+
language:k.language,originalLanguage:k.Rc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Le||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},aM=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ef;return c||b?{id:a.N++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},eM=function(a,b,c,d,e){b=IK(b,d.timescale||c,e);c={isLive:a.C.bind(a),
|
|
32
|
+
vd:a.J.bind(a),mg:()=>1,qd:a.T.bind(a)};d=new Uint8Array(0);try{d=BL(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.H(_.G,3,4035,g);}const f="data:text/plain;base64,"+_.ei(d);return new _.tD(()=>[f],0,null,null,!0)},TK=class{constructor(a){this.type=a;this.size=this.start=0;this.parent=null;this.A=!1;this.entries=[];this.f=[]}append(a=[]){for(let b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this}get(a){if(this.type===a)return this;for(let b=0;b<this.f.length;b++){if(this.f[b].type===
|
|
33
|
+
a)return this.f[b];{const c=this.f[b].get(a);if(c)return c}}return null}a(){const a=Math.pow(2,32)-1;let b;b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(let c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b}write(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.N(a,1):_.N(a,this.size);_.Mk(a,EK(this.type));this.size>b&&yK(a,this.size);"uuid"===this.type&&_.Mk(a,null);if(0<this.f.length&&!this.A)for(b=0;b<this.f.length;b++)this.f[b].write(a),
|
|
34
|
+
this.f[b].a(),a.getPosition()}},hM=class extends TK{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);zK(a,this.version);AK(a,this.flags)}},zL=class extends TK{constructor(a,b,c){super(a);this.g=b;this.offset=c}a(){return this.g.byteLength+super.a()-this.offset}write(a){super.write(a);_.Mk(a,this.g,this.offset);a.getPosition()}},FL=class extends hM{constructor(a,b,c,d,e){super(a,b,c);this.g=d;this.offset=e}a(){return this.g.byteLength+super.a()-
|
|
35
|
+
this.offset}write(a){super.write(a);_.Mk(a,this.g,this.offset);a.getPosition()}},yL=class extends TK{constructor(a,b,c){super("ftyp");this.j=a;this.ef=b;this.g=c}a(){let a=this.j.length;a=a+4+this.g.join("").length;return a+super.a()}write(a){super.write(a);_.Mk(a,EK(this.j));_.N(a,this.ef);_.Mk(a,EK(this.g.join("")));a.getPosition()}},xL=class extends TK{constructor(){super(_.pe)}},wL=class extends TK{constructor(){super(_.Cf)}},$K=class extends hM{constructor(a,b,c){super("mvhd",1,0);this.timescale=
|
|
36
|
+
a;this.duration=b;this.volume=256;this.j=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]}a(){let a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=super.a()}write(a){super.write(a);1===this.version?(yK(a,0),yK(a,0),_.N(a,this.timescale),yK(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));_.N(a,65536);BK(a,this.volume);BK(a,0);_.N(a,0);_.N(a,0);for(let b=0;b<this.g.length;b++)zK(a,this.g[b]);
|
|
37
|
+
_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,0);_.N(a,this.j);a.getPosition()}},aL=class extends TK{constructor(){super("mvex")}},bL=class extends hM{constructor(a){super("trex",0,0);this.g=a}a(){return 20+super.a()}write(a){super.write(a);_.N(a,this.g);_.N(a,1);_.N(a,0);_.N(a,0);_.N(a,0);a.getPosition()}},cL=class extends hM{constructor(a,b,c,d,e){super("tkhd",1,7);this.j=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
|
|
38
|
+
0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]}a(){let a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+super.a()}write(a){super.write(a);1===this.version?(yK(a,0),yK(a,0),_.N(a,this.j),_.N(a,0),yK(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.j),_.N(a,0),_.N(a,this.duration*this.timescale));_.N(a,0);_.N(a,0);BK(a,0);BK(a,0);BK(a,this.volume);BK(a,0);for(let b=0;b<this.g.length;b++)zK(a,this.g[b]);BK(a,this.width);BK(a,0);BK(a,this.height);BK(a,0);a.getPosition()}},dL=class extends hM{constructor(a,
|
|
39
|
+
b){super("mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956}a(){let a=0;a=1===this.version?a+28:a+16;return a+4+super.a()}write(a){super.write(a);1===this.version?(yK(a,0),yK(a,0),_.N(a,this.timescale),yK(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));BK(a,this.language);BK(a,0);a.getPosition()}},eL=class extends hM{constructor(a){super("hdlr",0,0);this.g=a}a(){return 33+super.a()}write(a){super.write(a);_.N(a,0);this.g===
|
|
40
|
+
_.w?_.Mk(a,EK("vide")):_.Mk(a,EK("soun"));_.N(a,0);_.N(a,0);_.N(a,0);this.g===_.w?_.Mk(a,EK("VideoHandler\x00")):_.Mk(a,EK("SoundHandler\x00"));a.getPosition()}},kL=class extends hM{constructor(){super("vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])}a(){return 2+this.g.byteLength+super.a()}write(a){super.write(a);BK(a,0);_.Mk(a,this.g);a.getPosition()}},iM=class extends TK{constructor(a){super(a);this.A=!0}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);BK(a,0);BK(a,1)}},jM=class extends iM{constructor(a){super(a);
|
|
41
|
+
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);BK(a,0);BK(a,0);_.N(a,0);_.N(a,0);_.N(a,0);BK(a,this.width);BK(a,this.height);_.N(a,4718592);_.N(a,4718592);_.N(a,0);BK(a,1);zK(a,10);_.Mk(a,EK("AVC Coding",31));BK(a,this.depth);DK(a,-1)}},kM=class extends iM{constructor(a,b,c,d){super(a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d}a(){return 20+super.a()}write(a){super.write(a);_.N(a,0);_.N(a,0);BK(a,this.channelCount);BK(a,this.sampleSize);DK(a,0);
|
|
42
|
+
BK(a,0);BK(a,this.sampleRate);BK(a,0)}},jL=class extends jM{constructor(a,b){super("avc1");this.width=a;this.height=b}write(a){super.write(a);for(let b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()}},UK=class extends jL{constructor(a,b){super(a,b);this.type="encv"}},mL=class extends kM{constructor(a,b,c){super("mp4a",a,b,c)}write(a){super.write(a);for(let b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()}},VK=class extends mL{constructor(a,b,c){super(a,b,c);this.type="enca"}},
|
|
43
|
+
iL=class extends TK{constructor(a,b){super("avcC");this.Oa=a;this.Qb=b;this.version=1;this.g=this.Oa[0][1];this.j=this.Oa[0][2];this.level=this.Oa[0][3]}a(){let a=7;for(var b=0;b<this.Oa.length;b++)a+=2,a+=this.Oa[b].byteLength;for(b=0;b<this.Oa.length;b++)a+=2,a+=this.Qb[b].byteLength;return a+super.a()}write(a){super.write(a);zK(a,this.version);zK(a,this.g);zK(a,this.j);zK(a,this.level);zK(a,255);zK(a,224|this.Oa.length);for(var b=0;b<this.Oa.length;b++)BK(a,this.Oa[b].length),_.Mk(a,this.Oa[b]);
|
|
44
|
+
zK(a,this.Qb.length);for(b=0;b<this.Qb.length;b++)BK(a,this.Qb[b].length),_.Mk(a,this.Qb[b]);a.getPosition()}},lL=class extends hM{constructor(a){super("esds",0,0);this.Jb=a}a(){return 22+(this.Jb.byteLength+3)+super.a()}write(a){super.write(a);zK(a,3);zK(a,23+this.Jb.byteLength);BK(a,1);zK(a,0);zK(a,4);zK(a,15+this.Jb.byteLength);zK(a,64);zK(a,21);AK(a,0);_.N(a,0);_.N(a,0);zK(a,5);zK(a,this.Jb.byteLength);_.Mk(a,this.Jb);_.Mk(a,new Uint8Array([6,1,2]));a.getPosition()}},gL=class extends hM{constructor(a=
|
|
45
|
+
""){super("url ",0,1);this.location=a}a(){return this.location.length+super.a()}write(a){super.write(a);0<this.location.length&&_.Mk(a,EK(this.location));a.getPosition()}},fL=class extends hM{constructor(){super("dref",0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},oL=class extends TK{constructor(){super(_.tf)}},hL=class extends hM{constructor(){super(_.vf,
|
|
46
|
+
0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},pL=class extends hM{constructor(){super("stts",0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},
|
|
47
|
+
qL=class extends hM{constructor(){super("stsc",0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},sL=class extends hM{constructor(){super("stco",0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+super.a()}write(a){super.write(a);_.N(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);
|
|
48
|
+
a.getPosition()}},rL=class extends hM{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);_.N(a,0);a.getPosition()}},nL=class extends hM{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);DK(a,0);BK(a,0);a.getPosition()}},tL=class extends TK{constructor(){super("dinf")}},uL=class extends TK{constructor(){super(_.oe)}},vL=class extends TK{constructor(){super(_.ke)}},NL=class extends hM{constructor(a,b){super("tfdt",a,0);this.g=b}a(){let a=
|
|
49
|
+
0;a=1===this.version?a+8:a+4;return a+super.a()}write(a){super.write(a);1===this.version?yK(a,this.g):_.N(a,this.g);a.getPosition()}},CL=class extends hM{constructor(){super("mfhd",0,0);this.g=0}a(){return 4+super.a()}write(a){super.write(a);_.N(a,this.g);a.getPosition()}},EL=class extends hM{constructor(a,b){super("trun",a,b);this.o=this.l=this.g=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]}a(){let a=4;this.flags&lM&&(a+=4);this.flags&mM&&(a+=4);for(let b=0;b<this.g;b++)this.flags&nM&&(a+=
|
|
50
|
+
4),this.flags&oM&&(a+=4),this.flags&pM&&(a+=4),this.flags&qM&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&lM&&(a.getPosition(),CK(a,this.l));this.flags&mM&&_.N(a,this.o);for(let b=0;b<this.g;b++)this.flags&nM&&_.N(a,this.w[b]),this.flags&oM&&_.N(a,this.sampleSize[b]),this.flags&pM&&_.N(a,this.B[b]),this.flags&qM&&(0===this.version?_.N(a,this.j[b]):CK(a,this.j[b]));a.getPosition()}},lM=1,mM=4,nM=256,oM=512,pM=1024,qM=2048,DL=class extends hM{constructor(a,b){super("tfhd",
|
|
51
|
+
a,b);this.g=255;this.o=this.w=this.l=this.B=this.j=0}a(){let a=4;this.flags&rM&&(a+=8);this.flags&sM&&(a+=4);this.flags&tM&&(a+=4);this.flags&uM&&(a+=4);this.flags&vM&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&rM&&yK(a,this.j);this.flags&sM&&_.N(a,this.B);this.flags&tM&&_.N(a,this.l);this.flags&uM&&_.N(a,this.w);this.flags&vM&&_.N(a,this.o);a.getPosition()}},rM=1,sM=2,tM=8,uM=16,vM=32,JL=class extends TK{constructor(){super("traf")}},KL=class extends TK{constructor(){super("moof")}},
|
|
52
|
+
IL=class extends TK{constructor(){super(_.je);this.g=new Uint8Array(0)}a(){return this.g.byteLength+super.a()}write(a){super.write(a);0<this.g.byteLength&&_.Mk(a,this.g)}},WK=class extends hM{constructor(){super("tenc",0,0);this.g=1;this.j=8;this.o="";this.l=[]}a(){let a;a=20;1===this.g&&0===this.j&&(a=a+1+this.l.length);return a+super.a()}write(a){super.write(a);zK(a,0);0===this.version?zK(a,0):zK(a,0);zK(a,this.g);zK(a,this.j);_.Mk(a,_.gi(this.o));if(1===this.g&&0===this.j){zK(a,0);for(let b=0;b<
|
|
53
|
+
this.l.length;b++)zK(a,this.l[b])}a.getPosition()}},YK=class extends hM{constructor(a,b){super("schm",0,0);this.g=a;this.j=b;this.Db=""}a(){let a=8;this.flags&1&&(a+=EK(this.Db).byteLength);return a+super.a()}write(a){super.write(a);_.Mk(a,EK(this.g));_.N(a,this.j);this.flags&1&&_.Mk(a,EK(this.Db));a.getPosition()}},XK=class extends TK{constructor(a){super("frma");this.g=a}a(){return EK(this.g).byteLength+super.a()}write(a){super.write(a);_.Mk(a,EK(this.g));a.getPosition()}},OL=class extends hM{constructor(){super("saio",
|
|
54
|
+
0,0);this.offset=[0]}a(){let a=0;this.flags&1&&(a+=8);a+=4;for(let b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+super.a()}write(a){super.write(a);this.flags&1&&(_.N(a,0),_.N(a,0));_.N(a,1);for(let b=0;1>b;b++)0===this.version?_.N(a,this.offset[b]):yK(a,this.offset[b]);a.getPosition()}},PL=class extends hM{constructor(a,b,c){super("saiz",0,0);this.g=a;this.l=b;this.j=c}a(){let a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.l.length);return a+super.a()}write(a){super.write(a);this.flags&1&&(_.N(a,
|
|
55
|
+
0),_.N(a,0));zK(a,this.g);_.N(a,this.j);if(0===this.g)for(let b=0;b<this.j;b++)zK(a,this.l[b]);a.getPosition()}},HL=class extends hM{constructor(a,b){super("senc",a,b);this.j=0;this.l=8;this.g=[]}a(){let a=4;this.flags&1&&(a+=1);for(let b=0;b<this.j;b++)if(a+=this.g[b].cf.byteLength,this.flags&2){a+=2;for(let c=0;c<this.g[b].Fc;c++)a+=2,a+=4}return a+super.a()}write(a){super.write(a);_.N(a,this.j);this.flags&1&&zK(a,this.l);for(let b=0;b<this.j;b++)if(_.Mk(a,this.g[b].cf),this.flags&2){BK(a,this.g[b].Fc);
|
|
56
|
+
for(let c=0;c<this.g[b].Fc;c++)BK(a,this.g[b].ve[c].Je),_.N(a,this.g[b].ve[c].Ke)}a.getPosition()}};var ML=class{constructor(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0==this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))}},LK=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,MK=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,NK=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,OK=/^(\d*\.?\d*)f$/,PK=/^(\d*\.?\d*)t$/,QK=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var AL=class{constructor(a){this.a=a;this.f=SK(this)}get(a){for(let b=0;b<this.a.length;b++){const c=this.a[b].get(a);if(c)return c}return null}write(){this.f=SK(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var GL=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var wM=class{constructor(){this.w=this.g=this.f=this.D=null;this.N=1;this.W=0;this.l="";this.B=this.a=null;this.h=new _.R("clpp.smooth.SmoothParser");this.K=!1;this.j=this.A=null;this.R=YL;this.H=0;this.F=this.I=Infinity;this.o=[];this.M=this.V.bind(this);this.G=new Map}configure(a){this.f=a}start(a,b){this.D=b;a=[...new Set([a,FK(a)])];return UL(this,a).then(c=>bM(this,c.data).then(()=>{cM(this,this.A);return this.g}))}stop(){this.D&&this.D.networkingEngine.Bd(this.M);this.A=this.w=this.g=this.f=
|
|
57
|
+
this.D=null;this.j&&(clearTimeout(this.j),this.j=null);this.K=!1;this.I=this.F=Infinity;return Promise.resolve()}update(){if(this.C())return UL(this,[this.l]).then(a=>bM(this,a.data).then(()=>this.g)).catch(a=>{if(this.D)this.D.onError(a)})}onExpirationUpdated(){}setCurrentVariant(){}Bb(){this.h.debug(_.ux);this.D&&(this.j=null,this.update().then(()=>{cM(this,this.A)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&cM(this,100))}))}C(){return this.R===XL}J(){return 0<this.o.length}T(a){let b=
|
|
58
|
+
null;if(this.o.length)for(let c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b}V(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);const b=a.request.timescale||this.w.timescale,c={isLive:this.C.bind(this),vd:this.J.bind(this),mg:()=>1,qd:this.T.bind(this)};let d=!1;const e=new _.H(_.G,3,4035,null);let f=null;try{const g=this.G.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.h.debug(`Using base media decode time ${g} instead of `+
|
|
59
|
+
`segment reference time ${a.request.startTime}`);f=QL(a,b,g,c)}catch(g){d=!0,e.data=g,3E3===g.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)}},fM={video:_.Pf,audio:_.Gc,text:_.Ac},YL=_.vx,XL="LIVE",gM={hh:_.Ax,kh:_.Nx};_.z("clpp.smooth.SmoothComponent",class extends _.Js{f(){_.sq.ism=wM;_.qq[_.Bc]=wM}a(){_.$y("ism");_.az(_.Bc)}id(){return"smooth"}});};f.call(g, window);
|