@castlabs/prestoplay 6.17.0 → 6.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +98 -98
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +372 -369
- package/cjs/cl.crypto.js +8 -8
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +1 -1
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +67 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +302 -302
- 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.sessions.js +15 -15
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +64 -64
- package/cjs/cl.ttml.js +28 -28
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +9 -9
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +14 -14
- 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 +26 -26
- package/cl.core.js +324 -323
- package/cl.crypto.js +8 -8
- package/cl.dash.js +69 -69
- package/cl.externs.js +1 -1
- package/cl.freewheel.js +15 -15
- package/cl.hls.js +72 -72
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +15 -15
- package/cl.mse.js +267 -268
- package/cl.muxdata.js +11 -11
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +54 -54
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +6 -6
- package/cl.vr.js +14 -14
- package/cl.vtt.js +11 -11
- package/cl.youbora.js +12 -12
- package/package.json +1 -1
- package/typings.d.ts +3 -2
package/cl.muxdata.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var jz=function(a){switch(a.type){case 1:return gz;case 2:return hz;case 3:return iz}},lz=function(a){const b=Object.keys(a).find(c=>kz.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},nz=function(a){let b={debug:!0,data:mz(a)};a.f&&a.f.muxOptionsOverride&&_.Qg(a.f.muxOptionsOverride)&&(b=_.Mg(b,a.f.muxOptionsOverride));b=_.Mg(b,{getPlayheadTime:()=>1E3*a.m.getPosition(),getStateData:()=>{{a.h.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager();const f=
|
|
2
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 _.Hl(c.url);e.video_source_url=_.gj(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().ma(),
|
|
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.la())&&d.language&&(e.player_language_code=d.language)}return e}});a.h.debug("Mux SDK options",b);return b},
|
|
4
|
-
player_mux_plugin_version:_.fa};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},
|
|
5
|
-
a.emit("adplaying")});a.a.on(a.m,_.
|
|
6
|
-
var d=new _.Hl(b.uris[b.uriIndex]);b={request_start:c,request_type:
|
|
7
|
-
a.h.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},
|
|
8
|
-
a),this.l=!1);
|
|
9
|
-
switch(a.detail.currentState){case _.Un:this.m.getConfiguration().autoplay&&this.emit(_.
|
|
10
|
-
this.emit(_.r,{player_error_code:a.code,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 _.Hl(b.uris[b.uriIndex]);a={request_start:g,request_type:
|
|
11
|
-
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.gj(d)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var
|
|
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.la())&&d.language&&(e.player_language_code=d.language)}return e}});a.h.debug("Mux SDK options",b);return b},oz=function(a){_.mh(a.a);a.j.ed(a.F);a.j.we(a.C)},mz=function(a){const b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.ra,player_software_name:_.ra,player_software_version:_.fa,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",
|
|
4
|
+
player_mux_plugin_version:_.fa};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},pz=function(a){a.a.on(a.m,_.Tf,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.Tf,b)});a.a.on(a.m,_.Qe,()=>a.emit(_.Qe));a.a.on(a.m,_.Mc,a.G.bind(a));a.a.on(a.m,_.Jf,a.I.bind(a));a.a.on(a.m,_.cg,()=>a.emit(_.Bf));a.a.on(a.m,_.bg,()=>a.emit(_.Af));a.a.on(a.m,_.r,a.H.bind(a));a.a.on(a.m,_.bc,()=>a.emit("adbreakstart"));a.a.on(a.m,_.cc,()=>a.emit("adbreakend"));a.a.on(a.m,_.pc,()=>{a.emit("adplay");
|
|
5
|
+
a.emit("adplaying")});a.a.on(a.m,_.lc,()=>a.emit("adpause"));a.a.on(a.m,_.nc,()=>{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.qc,()=>a.emit("adended"));a.a.on(a.m,_.gc,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.jc,()=>a.emit("admidpoint"));a.a.on(a.m,_.rc,()=>a.emit("adthirdquartile"));a.j.qc(a.F);a.j.Od(a.C);a.a.on(a.m,_.r,b=>{if((b=b.detail)&&1===b.category){var c=b.data;c=c&&c.request;if(void 0!==c&&!0===(1===c.type||2===c.type||3===c.type))if(7001===b.code){b=c;c=b.requestStartTimestamp;
|
|
6
|
+
var d=new _.Hl(b.uris[b.uriIndex]);b={request_start:c,request_type:jz(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.Hl(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:jz(c),request_hostname:f.a,request_error:`${jz(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.h.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},qz=function(a){return!_.A(a)&&typeof a.init===_.Xd&&typeof a.emit===_.Xd},gz="manifest",hz="media",iz="encryption",kz=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var rz=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 _.ks;this.h=b;this.A=this.l=this.g=!1;this.w=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.w=c;if(!this.g){try{this.g=!0,this.w.init(this.B,nz(this))}catch(d){throw this.g=!1,oz(this),new _.H(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=mz(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);pz(this)}release(){this.h.debug("release()");this.l?this.h.debug(_.ja):(oz(this),this.l=!0,this.o=this.f=null)}destroy(){this.h.debug(_.Dd);this.A?this.h.debug(_.ia):(this.A=!0,this.emit("destroy"))}emit(a,b){if(null===this.w)throw new _.H(1,9,9301);this.w.emit(this.B,a,b)}G(a){this.h.debug(_.De);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Na())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.h.debug(_.He);
|
|
9
|
+
switch(a.detail.currentState){case _.Un:this.m.getConfiguration().autoplay&&this.emit(_.Qe);break;case _.Wn:this.emit(_.af);break;case _.Vn:this.emit(_.Me);break;case _.Ln:this.emit(_.Ud)}}H(a){this.h.debug(_.Ee);if(this.g&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.F){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)}`;
|
|
10
|
+
this.emit(_.r,{player_error_code:a.code,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 _.Hl(b.uris[b.uriIndex]);a={request_start:g,request_type:jz(b),request_hostname:d.a,request_id:lz(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.gj(d)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var sz=class extends _.ru{constructor(){super();this.f=this.m=null;this.a=!1;this.h=new _.R("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new rz(a,this.h)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.Ng(c.muxdata);try{var d=[];typeof c===_.Ce&&(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=!_.A(f.muxdata)&&typeof f.muxdata===_.Ce){const g=f.muxdata;d=qz(g.muxLib)?g.muxLib:window.mux;if(!qz(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
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.m=this.f=null)}onPlayerWillRelease(){this.a&&this.f.release()}id(){return"mux"}emit(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&this.U(this.m,c),c;}}U(a,b){a.trigger(new _.E(_.r,{detail:b}))}};
|
|
13
|
-
_.z("clpp.muxdata.MuxDataPlugin",
|
|
13
|
+
_.z("clpp.muxdata.MuxDataPlugin",sz);sz.prototype.emit=sz.prototype.emit;sz.Id="mux";_.ap(new class{create(){return new sz}});};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:_.Zl,licenseResponse:_.$l,extractContentId:_.am,certificateRequest:_.bm}});a.Qa(_.
|
|
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 fz=function(a,b){let c=b.baseUrl;_.ti(c,"/")||(c+="/");const d=g=>g&&(_.si(g,"https://")||_.si(g,"http://")||_.si(g,"//"))?g:`${c}${g}`,e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");b=d(b.fairplayUrl||"fairplay");a=new _.bt(a);a.Qa(_.yd,{licenseUrl:e,videoRobustness:[_.Fb,void 0],audioRobustness:[_.Eb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Wl,licenseResponse:_.Xl}});a.Qa(_.ud,{licenseUrl:b,
|
|
2
|
+
certificateUrl:b,modifiers:{licenseRequest:_.Zl,licenseResponse:_.$l,extractContentId:_.am,certificateRequest:_.bm}});a.Qa(_.wd,{licenseUrl:f,modifiers:{licenseRequest:_.Wl}});_.ll(a)};
|
|
3
|
+
_.z("clpp.onboard.OnboardComponent",class extends _.Pt{constructor(){super();this.h=new _.R("clpp.onboard");this.j=new Set}a(){for(const a of this.j)delete _.kl[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}'`),fz(b,a),this.j.add(b))}id(){return"onboard"}});
|
|
4
|
+
_.z("clpp.onboard.register",fz);};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 _.Xm(a,g)},
|
|
3
|
-
|
|
4
|
-
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Qy="A persistent DRM session already exists for: ",Ry="No DRM configuration.",Sy="clpp.persistent",Ty="clpp.persistent.SimpleSessionStorage",Uy=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},Wy=function(a,b){a.I=Vy;a.J=[];a.C=!0;return _.Ym(a,b)},Yy=function(a,b,c,d,e,f){a.I=Xy;const g=new Map,h=_.Im(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Je,persistentState:_.tf,sessionTypes:[_.Oe],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,
|
|
2
|
+
distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Xm(a,g)},Zy=function(a,b){return _.x(function*(){const c=yield _.on(a,b);if(c){var d=[],e=a.f.get(c);e&&a.A&&(e.ub=new _.an,d.push(e.ub));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)})},$y=function(a){a=a.f.keys();a=Uy(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
az=function(a,b){const c=_.nl(a),d=_.Tk({drm:a});d.drm=a;a=new _.fo({sb:b,onError:()=>{},pe:()=>{},oe:()=>{},onEvent:()=>{},getConfiguration:()=>d,yc:()=>null});a.g=c;return a},dz=function(a,b,c){return _.x(function*(){const d=bz;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)cz.debug(Qy,e);else{var g=az(a,c);try{yield Wy(g,b);yield _.mn(g);yield _.pn(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.Kj(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:$y(g),
|
|
4
|
+
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw cz.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else cz.debug(Ry)})},Vy=1,Xy=2,ez=class{constructor(){this.h=new _.R(Ty)}store(a,b){return _.x(function*(){{var c=JSON.stringify(b.sessionIds);var d=b.serverCertificate?Array.from(b.serverCertificate):null;d=JSON.stringify(d);
|
|
5
5
|
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)),f=JSON.parse(e.sessionIds),
|
|
6
|
-
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,{configurationId:"",networkingEngine:d,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onTimelineCueAdded:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.H(_.F,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
|
+
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 Ty}};_.z("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.A(a)||(_.Rg(a.store)||c.push("store"),_.Rg(a.get)||c.push("get"),_.Rg(a.delete)||c.push("delete"),_.Rg(a.clear)||c.push("clear"),_.Rg(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw cz.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});bz=a});
|
|
7
|
+
_.z("clpp.persistent.fetchLicense",function(a,b,...c){return _.x(function*(){var d=bz,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.Zn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Ry);var g=b.offlineId;if(typeof g!==_.Mf||!g.length)throw e("Missing offline id.");if(yield d.get(g))cz.debug(Qy,g);else{var h=_.Tk();d=new _.Yo;g=[];for(var k of c){const l=new k;_.Wk(l.id())||(l.f(),_.Yk(l),g.push(l))}k=null;try{k=yield _.qr(f.url,d,h.manifest.attemptParameters,f.type||null);k.configure(h.manifest);
|
|
8
|
+
const l=yield k.start(f.url,{configurationId:"",networkingEngine:d,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onTimelineCueAdded:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.H(_.F,4,4014));const m=_.or(l.periods);yield dz(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(),_.Vk.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=bz;if(_.Tg(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.Yo,c=az(e.drmConfig,d),yield Yy(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.mn(c),yield Promise.all(e.sessionIds.map(f=>_.x(function*(){yield Zy(c,f);cz.debug("successfully removed session with id",f)}))),yield b.delete(a)):cz.debug("No persistent DRM session found")}catch(e){throw cz.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 cz.warn("Invalid offlineId")})});var bz=new ez,cz=new _.R(Sy);_.z("clpp.persistent.PersistentLicenseComponent",class extends _.Pt{constructor(){super();this.h=new _.R(Sy)}id(){return _.Ne}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 dz(d,b,e),a.trigger(new _.E(_.Nd,{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=bz;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 _.E(_.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Ny=function(a,b){return 0<=b&&b<a.a.length},Oy=function(a){a.trigger(new _.E(_.cf))},Py=class extends _.Xs{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.ic.bind(this)}getPosition(){return this.f}Cg(){return this.a}Pc(){return 0<this.a.length&&Ny(this,this.f)?this.a[this.f]:null}Dg(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&Ny(this,a)?this.a[a]:null}Ng(){return this.g}start(){this.g||(this.g=!0,this.m.on(_.Ud,this.j),this.xd(this.f,!0))}stop(){this.g=!1;this.m.off(_.Ud,this.j)}ic(){this.next()}next(){const a=this;return _.x(function*(){yield a.xd(Math.min(a.a.length-1,a.f+1))})}eh(){const a=this;return _.x(function*(){yield a.xd(Math.max(0,a.f-1))})}xd(a,b){b=void 0===b?!1:b;const c=this;return _.x(function*(){if(0<c.a.length&&Ny(c,a)&&(b||c.f!==a)){c.f=a;var d=c.Pc();d&&(yield c.l(d),yield c.m.load(d.configuration),
|
|
3
|
+
c.trigger(new _.E(_.bf,{item:d})))}})}append(a){this.a.push(a);Oy(this)}Mg(a,b){if(0<=b&&b<=this.a.length){const c=this.Pc();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Oy(this)}}remove(a){if(0<this.a.length&&Ny(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Oy(this)}}clear(){this.stop();this.f=0;this.a=[];this.g=!1;Oy(this)}};_.z("clpp.Playlist",Py);Py.prototype.clear=Py.prototype.clear;Py.prototype.remove=Py.prototype.remove;Py.prototype.insert=Py.prototype.Mg;
|
|
4
|
+
Py.prototype.append=Py.prototype.append;Py.prototype.goTo=Py.prototype.xd;Py.prototype.previous=Py.prototype.eh;Py.prototype.next=Py.prototype.next;Py.prototype.onEnded=Py.prototype.ic;Py.prototype.stop=Py.prototype.stop;Py.prototype.start=Py.prototype.start;Py.prototype.isStarted=Py.prototype.Ng;Py.prototype.getUpcoming=Py.prototype.Dg;Py.prototype.getCurrent=Py.prototype.Pc;Py.prototype.getQueue=Py.prototype.Cg;Py.prototype.getPosition=Py.prototype.getPosition;Py.prototype.off=Py.prototype.off;
|
|
5
|
+
Py.prototype.one=Py.prototype.one;Py.prototype.on=Py.prototype.on;};f.call(g, window);
|
package/cl.sessions.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
b<<3|0),d(a,c)},
|
|
3
|
-
0;e<c.length;e++){
|
|
4
|
-
128),d.a.push(g&63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},
|
|
5
|
-
{};a.f=new Promise(c=>{b=c});try{const c=new
|
|
6
|
-
c),new
|
|
7
|
-
a.g&&(yield a.g.dispose(),a.g=null)})},
|
|
8
|
-
a=_.sk(),this.g=new
|
|
9
|
-
c=new
|
|
10
|
-
const c=new zy(
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Jx="apiUrl config is missing",Kx=function(a,b){a.j=a.j.filter(c=>c!==b)},Lx=function(a){let b=0>a;a=Math.abs(a);let c=a>>>0;a=Math.floor((a-c)/4294967296);a>>>=0;b&&(a=~a>>>0,c=(~c>>>0)+1,4294967295<c&&(c=0,a++,4294967295<a&&(a=0)));return[c,a]},Qx=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.t&&0===c||typeof c===_.Mf&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c)){Mx(a,b<<3|2);b=new Nx;for(let e=0;e<c.length;e++)d(b,c[e]);Ox(a,b.length());Px(a,b.end())}else Mx(a,
|
|
2
|
+
b<<3|0),d(a,c)},Ox=function(a,b){if(0<=b)Mx(a,b);else{for(let c=0;9>c;c++)a.a.push(b&127|128),b>>=7;a.a.push(1)}},Rx=function(a,b,c){Qx(a,b,c,(d,e)=>{Ox(d,e)})},Mx=function(a,b){for(;127<b;)a.a.push(b&127|128),b>>>=7;a.a.push(b)},Tx=function(a,b,c){Qx(a,b,c,(d,e)=>{if(0<=e){{const [f,g]=Lx(e);Sx(d,f,g)}}else{{const [f,g]=Lx(e);Sx(d,f,g)}}})},Ux=function(a,b,c,d){if(!(null===c||void 0===c||typeof c===_.t&&0===c||typeof c===_.Mf&&0===c.length||Array.isArray(c)&&0===c.length))if(Array.isArray(c))for(let e=
|
|
3
|
+
0;e<c.length;e++){Mx(a,b<<3|2);const f=new Nx;d(f,c[e]);Ox(a,f.length());Px(a,f.end())}else Mx(a,b<<3|2),b=new Nx,d(b,c),Ox(a,b.length()),Px(a,b.end())},Vx=function(a,b,c){Ux(a,b,c,(d,e)=>{for(let f=0;f<e.length;f++){let g=e.charCodeAt(f);if(128>g)d.a.push(g);else if(2048>g)d.a.push(g>>6|192),d.a.push(g&63|128);else if(65536>g)if(55296<=g&&56319>=g&&f+1<e.length){let h=e.charCodeAt(f+1);56320<=h&&57343>=h&&(g=1024*(g-55296)+h-56320+65536,d.a.push(g>>18|240),d.a.push(g>>12&63|128),d.a.push(g>>6&63|
|
|
4
|
+
128),d.a.push(g&63|128),f++)}else d.a.push(g>>12|224),d.a.push(g>>6&63|128),d.a.push(g&63|128)}})},Px=function(a,b){a.a.push.apply(a.a,b)},Wx=function(a,b,c){Ux(a,b,c,(d,e)=>{Px(d,e.a())})},Xx=function(a,b,c){Ux(a,b,c,(d,e)=>{Px(d,e)})},Sx=function(a,b,c){for(;0<c||127<b;)a.a.push(b&127|128),b=(b>>>7|c<<25)>>>0,c>>>=7;a.a.push(b)},Zx=function(a){const b=new Yx;b.g=Math.floor(a/1E3);b.f=a%1E3*1E6;return b},cy=function(a){return _.x(function*(){if(!a.j&&!a.f){0===a.a.length&&$x(a,new ay);var b=()=>
|
|
5
|
+
{};a.f=new Promise(c=>{b=c});try{const c=new by;c.f=a.o;c.events.push(...a.a);const d=[...a.a],e=yield fetch(a.l,{method:"POST",headers:{"Content-Type":"application/proto"},body:new Uint8Array(c.a())});if(e.ok)a.a=a.a.filter(f=>!d.includes(f));else throw Error("An error occurred while sending telemetry events to the API, "+`status='${e.status}' statusText='${e.statusText}'`);}finally{b(),a.f=null}}})},fy=function(a,b,c,d,e,f,g){const h=new dy;h.headers=[new ey("CL-BROWSER-NAME",b),new ey("CL-BROWSER-VERSION",
|
|
6
|
+
c),new ey("CL-OS-FAMILY",d),new ey("CL-OS-VERSION",e),new ey("CL-SDK-NAME",f),new ey("CL-SDK-NAME",f),new ey("CL-SDK-VERSION",g)];$x(a,h)},$x=function(a,b){if(!a.j){var c=new gy(a.w);c.sessionId=a.A;{var d=Date.now();const e=new hy;e.g=Math.floor(d/1E3);e.f=d%1E3*1E6;d=e}c.time=d;c.g=b.getId();c.f=new Uint8Array(b.a());a.a.push(c)}},iy=function(a){_.x(function*(){a.h.info("Destroy the session and stop sending events.");_.mh(a.f);a.a=!1;const b=a.m.getNetworkEngine();b.we(a.o);b.ed(a.j);Kx(b,a.j);
|
|
7
|
+
a.g&&(yield a.g.dispose(),a.g=null)})},qy=function(a){switch(a){case _.Tn:return jy;case _.Un:return ky;case _.On:return ly;case _.Wn:return my;case _.Vn:return ny;case _.Ln:return oy;case _.Sn:return py;default:return null}},ry=function(a,b){a.h.debug("Sending event",b);$x(a.g,b)},zy=function(a,b){switch(a){case 1:return sy;case 2:return b===_.w?ty:b===_.p?uy:b===_.G?vy:b===_.ae?wy:xy;case 3:return yy;default:return xy}};var Nx=class{constructor(){this.a=[]}length(){return this.a.length}end(){const a=this.a;this.a=[];return a}};var Ay=class{constructor(a,b,c,d){this.downloadId=a;this.g=b;this.duration=c;this.j=d;this.f=[]}a(){const a=new Nx;Wx(a,1,this.downloadId);Rx(a,2,this.g);Wx(a,3,this.duration);Rx(a,4,this.j);Wx(a,5,this.f);return a.end()}getId(){return 4}};var By=class{constructor(a,b){this.f=a;this.url=b;this.downloadId=null;this.headers=[];this.size=this.duration=null}a(){const a=new Nx;Rx(a,1,this.f);Wx(a,2,this.downloadId);Vx(a,3,this.url);Wx(a,4,this.headers);Vx(a,5,null);Wx(a,6,null);Wx(a,7,this.duration);Tx(a,8,this.size);return a.end()}getId(){return 2}};var Cy=class{constructor(a,b){this.g=a;this.f=b}a(){const a=new Nx;Rx(a,1,this.g);Xx(a,2,this.f);return a.end()}};var Dy=class{constructor(a){this.cause=a;this.f=this.message=this.severity=this.errorCode=null}a(){const a=new Nx;Rx(a,1,this.errorCode);Rx(a,2,this.severity);Vx(a,3,this.message);Vx(a,4,this.f);Wx(a,5,this.cause);return a.end()}getId(){return 7}};var ey=class{constructor(a,b){this.key=a;this.value=b}a(){const a=new Nx;Vx(a,1,this.key);Vx(a,2,this.value);return a.end()}};var Ey=class{constructor(){this.cause=this.severity=this.code=null}a(){const a=new Nx;Rx(a,1,this.code);Rx(a,2,this.severity);Wx(a,3,this.cause);return a.end()}getId(){return 12}};var Fy=class{constructor(){this.data=null}a(){const a=new Nx;Xx(a,1,this.data);return a.end()}};var Gy=class extends Fy{constructor(){super();var a=new Uint8Array(16);crypto.getRandomValues(a);a[6]=a[6]&15|64;a[8]=a[8]&63|128;this.data=a}toString(){const a=[];for(let b=0;256>b;++b)a.push((b+256).toString(16).slice(1));return a[this.data[0]]+a[this.data[1]]+a[this.data[2]]+a[this.data[3]]+"-"+a[this.data[4]]+a[this.data[5]]+"-"+a[this.data[6]]+a[this.data[7]]+"-"+a[this.data[8]]+a[this.data[9]]+"-"+a[this.data[10]]+a[this.data[11]]+a[this.data[12]]+a[this.data[13]]+a[this.data[14]]+a[this.data[15]]}};var dy=class{constructor(){this.headers=[]}a(){const a=new Nx;Wx(a,1,this.headers);return a.end()}getId(){return 1}};var ay=class{constructor(){}a(){return(new Nx).end()}getId(){return 6}};var gy=class{constructor(a){this.j=a;this.f=this.g=this.time=this.sessionId=null}a(){const a=new Nx;Wx(a,1,this.j);Wx(a,2,this.sessionId);Wx(a,3,this.time);Tx(a,4,null);Vx(a,5,null);Rx(a,6,this.g);Xx(a,7,this.f);return a.end()}};var by=class{constructor(){this.f=null;this.events=[]}a(){const a=new Nx;Xx(a,1,this.f);Wx(a,2,this.events);return a.end()}};var hy=class{constructor(){this.f=this.g=null}a(){const a=new Nx;Tx(a,1,this.g);Rx(a,2,this.f);return a.end()}};var Yx=class{constructor(){this.f=this.g=null}a(){const a=new Nx;Tx(a,1,this.g);Rx(a,2,this.f);return a.end()}};var Hy=class{constructor(a,b,c,d,e,f,g,h,k){k=void 0===k?2500:k;this.o=a;this.l=h;this.w=new Gy;this.A=new Gy;this.a=[];this.g=setInterval(()=>cy(this),k);this.f=null;this.j=!1;fy(this,b,c,d,e,f,g)}dispose(){const a=this;return _.x(function*(){a.g&&(clearInterval(a.g),a.g=null);a.f&&(yield a.f);0<a.a.length&&(yield cy(a),a.a=[]);a.j=!0})}};var Iy=class{constructor(){this.reason=this.currentState=this.previousState=null}a(){const a=new Nx;Rx(a,1,this.previousState);Rx(a,2,this.currentState);Rx(a,3,this.reason);Wx(a,4,null);Wx(a,5,null);Wx(a,6,null);return a.end()}getId(){return 5}};var My=class extends _.ru{constructor(){super();this.m=null;this.a=this.l=!1;this.f=new _.ks;this.g=null;this.h=new _.R("clpp.sessions.SessionsPlugin");this.o=this.F.bind(this);this.j=this.C.bind(this)}onPlayerCreated(a){this.m=a}onContentWillLoad(a){var b=a.getConfiguration().sessions;(b=!(!b||typeof b!==_.Ce))||this.h.warn("Sessions plugin is loaded but not configured. Will do nothing.");if(this.l=b)b=a.getConfiguration().sessions,b.apiUrl?(this.h.debug(_.sa),this.h.info("Create a session and start sending events."),
|
|
8
|
+
a=_.sk(),this.g=new Hy(new Uint8Array([]),a.browser,a.browserVersion.name,a.os,a.osVersion.name,"prestoplay-web",_.fa,b.apiUrl),this.f.on(this.m,_.Jf,this.B.bind(this)),this.f.on(this.m,_.Bf,this.A.bind(this)),this.f.on(this.m,_.Af,this.w.bind(this)),this.f.on(this.m,_.r,this.U.bind(this)),a=this.m.getNetworkEngine(),a.Od(this.o),a.qc(this.j),a.j.push(this.j)):(this.h.warn(Jx),a.onError(new _.H(1,9,15E3,Jx)))}onPlayerWillRelease(){iy(this)}id(){return"sessions"}B(a){if(!this.a){a=a.detail;var b=a.currentState,
|
|
9
|
+
c=new Iy;c.previousState=qy(a.previousState);c.currentState=qy(b);ry(this,c)}}A(){if(!this.a){var a=new Iy;a.previousState=qy(this.m.getState());a.currentState=Jy;ry(this,a);this.a=!0}}w(){if(this.a){var a=new Iy;a.previousState=Jy;a.currentState=qy(this.m.getState());ry(this,a);this.a=!1}}U(a){a=a.detail;var b=new Ey;b=new Dy(new Cy(b.getId(),new Uint8Array(b.a())));b.errorCode=a.code;b.message=a.message;b.f=a.stack;b.severity=a.severity===_.F?Ky:Ly;ry(this,b)}F(a){const b=new Gy;a.downloadId=b;
|
|
10
|
+
const c=new By(zy(a.type,a.contentType),a.uris[0]);c.downloadId=b;c.headers=Object.keys(a.headers).map(d=>new ey(d,a.headers[d]));ry(this,c)}C(a){var b=a.request.downloadId;b?(b=new Ay(b,a.data.byteLength,Zx(a.timeMs||0),a.status||-1),b.f=Object.keys(a.headers).map(c=>new ey(c,a.headers[c])),ry(this,b)):this.h.warn("Download ID is missing on download completed event.")}};_.ap(new class{create(){return new My}});var Ly=1,Ky=2;var jy=0,ky=2,py=3,Jy=5,ly=6,my=8,ny=10,oy=11;var sy=0,ty=1,uy=2,vy=3,wy=4,yy=5,xy=9;};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 _.E(_.
|
|
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 sx="No surface found. Can not attach frame!",tx="SIMID:Media:timeupdate",ux="Starting creative",vx=function(a,b,c){return{type:b,sessionId:a.g,messageId:a.l++,timestamp:Date.now(),args:c}},yx=function(a,b){return new Promise((c,d)=>{new wx(a.j,c,d,b);xx(a,b)})},zx=function(a){const b=vx(a,"SIMID:Player:startCreative",void 0);yx(a,b).then(()=>{var c=a.f;c.h.info(ux);c.m.trigger(new _.E(_.Df));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.h.error("Error while starting creative",
|
|
2
|
+
c)})},Bx=function(a,b){_.x(function*(){a.g=b.sessionId;Ax(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=vx(a,"SIMID:Player:init",d);var e=yx(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()}})},Ax=function(a,b){xx(a,vx(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},xx=function(a,b){a.g?(b.type!==tx&&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}'`)},Cx=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=vx(d,"SIMID:Player:resize",e);xx(d,e)}})},Dx=function(a,b){a.h.info("SIMID Session created");a.a=b},Ex=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 _.E(_.Ef))},Fx=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}%`}},Gx=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=_.Be;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=
|
|
7
|
+
_.Be;this.a.style.overflow=_.Zd;this.a.classList.add(_.dd);this.o=b=>{if(b.source===this.a.contentWindow&&(b=(b=b.data)?typeof b===_.Mf?JSON.parse(b):b:null))if(b.type)switch(this.h.info(`Received message [${b.messageId}] '${b.type}':`,b.args),b.type){case "createSession":Bx(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=Fx(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=Fx(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);Ax(this,b)}else this.h.warn("WARNING: received message without 'type' property")};this.h=new _.R("clpp.simid.SimidPlayer");Dx(this.f,this)}load(a){window.addEventListener(_.ue,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(){Ex(this.f);this.g=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.ue,
|
|
10
|
+
this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},wx=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 Ix=class extends _.ru{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 Hx(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 Gx(this.g);var c=b.getContainer();this.j=Cx(this,c,b);this.j.observe(c);a.on(_.Tf,this.w)}else this.h.warn(sx)}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&&(zx(this.a),this.o=!0,this.h.info(ux)),
|
|
12
|
+
c&&(c=this.a,xx(c,vx(c,tx,{currentTime:a-b}))))):((a=this.m.getSurface())||this.h.warn(sx),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(_.Tf,this.w),this.f&&(this.a.unload(),this.f=this.g.f=null))}},Hx=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:""}};_.ap(new class{create(){return new Ix}});};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){_.ql()}},
|
|
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.Ra=[_.Ci(d[1])];a.Rb=[_.Ci(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Jb=_.Ci(c.rd),a.sampleSize=c.dg||16,a.fd=c.fd,a.channelCount=c.Xe}return 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 _.Ll(b)},
|
|
7
|
-
|
|
8
|
-
(a=(new
|
|
9
|
-
|
|
10
|
-
0<l-k.reader.getPosition()&&k.flags&32&&(m.o=_.P(k.reader));d=m}}).ba("trun",k=>{{var l=k.reader.Da();if(null===k.flags)throw new _.H(_.F,3,3019,
|
|
11
|
-
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.wl(k.reader)));e=m}}).ba("sdtp",k=>{{const l=_.zl(k.reader,k.reader.Da());f=new
|
|
12
|
-
u.Ve=_.vl(k.reader);u.We=_.P(k.reader);n.Ee.push(u)}}l.g.push(n)}g=l}}).M(_.
|
|
13
|
-
g;d=g.get(_.
|
|
14
|
-
B;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].Gc);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=[],$a=_.lm(m,"ProtectionHeader")[0],Pa=_.Bi(_.qm($a)||""),ib=_.Cm(Pa).a;ea.push(
|
|
20
|
-
|
|
21
|
-
+
|
|
22
|
-
new Uint16Array(1),Tc[0]=(Ka[0]<<8)+Ka[1],Jd=Tc[0].toString(16);Sr=Jd.toUpperCase()}}var da={id:y.W++,type:D,index:rj,bitrate:
|
|
23
|
-
new _.H(_.F,4,4037,u.l);0===pe&&isNaN(Ka)&&(
|
|
24
|
-
zh:mm,tracks:ub,ef:Ub,timescale
|
|
25
|
-
var ke={id:"ID",configurationId:void 0,startTime:0,endTime:$a,variants:Jh,textStreams:Kh,thumbStreams:[]}}{var Oc=Wa.streams;let ea=a.a.startTime,$a=a.a.delay;const Pa=a.I;let ib=Math.min(a.a.duration||Infinity,Pa);const Rc=a.C(),Jh=a.a.
|
|
26
|
-
{},ea,$a,!Rc,!0);a.B.f=ib;_.
|
|
27
|
-
_.
|
|
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.Yc,b.endTime);return f},
|
|
30
|
-
D);break;case _.p:D=h.rd,M=2,"AACH"===h.ug?M=5:D&&(M=(parseInt(D.substr(0,2),16)&248)>>3),D="mp4a.40."+M,a.h.debug("AUDIO CODECS: ",D)}M=k.type===_.G?
|
|
31
|
-
language:k.language,originalLanguage:k.Xc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Xe||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},
|
|
32
|
-
|
|
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?_.O(a,1):_.O(a,this.size);_.rl(a,
|
|
34
|
-
this.f[b].a(),a.getPosition()}},
|
|
35
|
-
this.offset}write(a){super.write(a);_.rl(a,this.g,this.offset);a.getPosition()}},
|
|
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
|
-
_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(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?_.rl(a,
|
|
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&&_.rl(a,
|
|
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);_.O(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
|
-
b}a(){let a=0;a=1===this.version?a+8:a+4;return a+super.a()}write(a){super.write(a);1===this.version?
|
|
50
|
-
4);for(let b=0;b<this.g;b++)this.flags&
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if(1===this.g&&0===this.j){
|
|
54
|
-
a.getPosition()}},
|
|
55
|
-
return a+super.a()}write(a){super.write(a);this.flags&1&&(_.O(a,0),_.O(a,0));
|
|
56
|
-
0;b<this.j;b++)if(_.rl(a,this.g[b].rf),this.flags&2){
|
|
57
|
-
this.g=this.f=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
|
-
0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b}T(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),
|
|
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 iO="Full MP4 box must have flags defined",jO="clpp.smooth.SmoothMP4Processor",kO="codecPrivateData",lO=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.O(a,c);_.O(a,b)},mO=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.ql()}},nO=function(a,b){mO(a,b>>16&255);mO(a,b>>8&255);mO(a,b&255)},oO=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.ql()}},pO=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.ql()}},qO=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.g),a.a+=2}catch(c){_.ql()}},rO=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},sO=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},tO=function(a,b,c,d){c=b.ef[c];b=b.zh;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 _.UA([a],[b])[0]},uO=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.w?c=["maxWidth","maxHeight","bitrate",kO,"fourCC"]:a.type===_.p&&(c=["bitrate",kO,"channels","bitsPerSample","samplingRate","fourCC"]);return _.Vg(a,b,c,["id","segmentIndex"])},vO=function(a,b,c){const d=c.rd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ra:null,Rb:null,width:NaN,height:NaN,Jb:null,fd:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.w:a.Ra=[_.Ci(d[1])];a.Rb=[_.Ci(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Jb=_.Ci(c.rd),a.sampleSize=c.dg||16,a.fd=c.fd,a.channelCount=c.Xe}return a},wO=function(a,b){return a.filter(c=>c.type===b)},xO=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)},EO=function(a,b,c){var d=null;if(yO.test(a)){{a=yO.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 zO.test(a)?d=xO(zO,a):AO.test(a)?d=xO(AO,a):BO.test(a)?(a=BO.exec(a),d=Number(a[1])/c.frameRate):CO.test(a)?(a=CO.exec(a),d=Number(a[1])/c.a):DO.test(a)&&(d=xO(DO,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},FO=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Ll(b)},MO=function(a,b,c){a:{var d=[_.yd,_.wd];for(e of d)if((d=c.wd(e))&&d.keyId){var e=d.keyId;break a}_.C(jO,"Could not get default Key ID for DRM init data!");e=null}c=new GO("xxxx");a.type===_.w?c=new HO(a.width,a.height):c=new IO(a.channelCount,a.sampleSize,a.fd);a=new JO;a.g=1;a.j=8;a.o=e||"00000000000000000000000000000000";a=(new GO("schi")).append([a]);b=(new GO(_.Ff)).append([new KO(b),new LO(_.Zc,65536),a]);c.append([b]);return c},
|
|
7
|
+
oP=function(a,b){var c=b.yd(),d=new NO(a.timescale,a.duration,a.id),e=(new OO).append([new PO(a.id)]),f=new QO(a.id,a.duration,a.timescale,a.width,a.height),g=new RO(a.timescale,a.duration);const h=new SO(a.type);var k=null,l=new TO;l.entries=[new UO];var m=new VO;switch(a.type){case _.w:k=new WO(a.Ra,a.Rb);c?(a=MO(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new XO(a.width,a.height)).append([k]),m.entries=[a]);k=new YO;break;case _.p:k=new ZO(a.Jb),c?(a=MO(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new $O(a.channelCount,a.sampleSize,a.fd)).append([k]),m.entries=[a]),k=new aP}m=(new bP).append([m,new cP,new dP,new eP,new fP]);l=(new gP).append([l]);l=(new hP).append([k,l,m]);g=(new iP).append([g,h,l]);f=(new jP).append([f,g]);d=(new kP).append([d,f,e]);e=new lP("dash",0,["iso6","mp41","avc1"]);c&&(c=b.wd(_.wd),b=b.wd(_.yd),c&&d.append([new mP("pssh",c.initData,8)]),b&&d.append([new mP("pssh",b.initData,8)]),c||b||_.C(jO,"Could not get PSSH init data!"));b=new nP([e,d]);return _.J(b.write())},
|
|
9
|
+
yP=function(a,b){let c,d,e,f,g,h;(new _.Jl).M("moof",_.Cl).ba("mfhd",k=>{{const l=new pP;l.g=_.P(k.reader);c=l}}).M("traf",_.Cl).ba("tfhd",k=>{{const l=k.reader.Da();if(null===k.flags)throw new _.H(_.F,3,3019,iO);const m=new qP(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.xl(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}}).ba("trun",k=>{{var l=k.reader.Da();if(null===k.flags)throw new _.H(_.F,3,3019,iO);const m=new rP(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.l=_.wl(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(_.wl(k.reader)));e=m}}).ba("sdtp",k=>{{const l=_.zl(k.reader,k.reader.Da());f=new sP("sdtp",k.version||0,k.flags||0,l,0)}}).M("uuid",k=>{var l=_.zl(k.reader,16);if(_.Ei(l,tP)){l=_.P(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new uP(k.version,k.flags);l.j=_.P(k.reader);k.flags&1&&(l.l=_.ul(k.reader));for(let m=0;m<l.j;m++){const n={rf:_.zl(k.reader,8),Gc:0,Ee:[]};if(k.flags&2){n.Gc=_.vl(k.reader);for(let q=0;q<n.Gc;q++){const u={Ve:0,We:0};
|
|
12
|
+
u.Ve=_.vl(k.reader);u.We=_.P(k.reader);n.Ee.push(u)}}l.g.push(n)}g=l}}).M(_.se,k=>{{const l=new vP;0<k.reader.Da()?l.g=_.zl(k.reader,k.reader.Da()):(_.C(jO,"mdat box is empty!"),l.g=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new wP).append([d,e]);f&&a.append([f]);b.yd()&&g&&a.append([g]);b=(new xP).append([c,a]);return new nP([b,h])},DP=function(a,b,c,d){var e=d.yd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=yP(b,d);if(null===g)return a.request.contentType===_.G?a.data:
|
|
13
|
+
g;d=g.get(_.se);if(a.request.contentType===_.G){e=d.g.buffer;if(c){e=_.oi(e);if((e=(new DOMParser).parseFromString(e,_.Sf))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new zP(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 u=0,v=f.length;u<v;u++){h=f[u];a=c;b=d;g=["begin",_.Td];for(let y=0,B=g.length;y<
|
|
14
|
+
B;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],EO(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.pi(e).buffer}else c=e;return c}h=new xP;a=g.get("mfhd");b=new wP;k=g.get("tfhd");m=new AP(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].Gc);else g=8;b.append([c,new BP,new CP(g,k,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new nP([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},EP=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},FP=function(a){return{initData:_.IA(_.um(a)),initDataType:_.Zc,keyId:a,periodId:null}},GP=function(a,b,c){a=_.Cm(a);c&&a.version!==c&&(a=_.KA(a,c));return{initData:_.IA(a),initDataType:_.Zc,keyId:b,periodId:null}},HP=function(a,b){return _.x(function*(){var c=_.Pi(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})},PP=function(a,b){let c=null;try{{const ea=new DOMParser;let $a,Pa;try{const ib=_.oi(b);Pa=ea.parseFromString(ib.trim(),_.Sf)}catch(ib){throw ib;}Pa&&Pa.documentElement.tagName===_.Ib&&($a=Pa.documentElement);c=$a&&0<$a.getElementsByTagName("parsererror").length?null:$a}}catch(ea){}if(!c)throw a.h.error("Unable to parse manifest"),new _.H(_.F,4,4033,a.l);const d=+IP(a,c,"MajorVersion"),e=+IP(a,c,"MinorVersion"),f=+c.getAttribute("TimeScale")||
|
|
18
|
+
1E7;let g=+IP(a,c,"Duration");const h="TRUE"===c.getAttribute("IsLive"),k=+c.getAttribute("LookAheadCount"),l=+c.getAttribute("DVRWindowLength")||Infinity,m=_.lm(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(_.F,4,4036,a.l);h?(JP(a,KP),a.A=typeof a.f.liveRefreshPeriod===_.t?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),g=Infinity):JP(a,LP);a.a={startTime:0,delay:0,duration:g/f,Wd:l/f,Yc:0};if(m){{var n=a.f.playreadyVersion;
|
|
19
|
+
const ea=[],$a=_.lm(m,"ProtectionHeader")[0],Pa=_.Bi(_.qm($a)||""),ib=_.Cm(Pa).a;ea.push(EP(_.yd,FP(ib),[ib]));ea.push(EP(_.wd,GP(Pa,ib,n),[ib]));var q=ea}a.o=q}{const ea=[],$a=_.lm(c,"StreamIndex");if(!$a.length)throw a.h.error("No streams found!"),new _.H(_.F,4,4034,a.l);for(let Pa=0;Pa<$a.length;Pa++){{var u=a,v=$a[Pa];const ib=IP(u,v,"Type"),Rc=+v.getAttribute("Chunks"),Jh=v.getAttribute("Subtype"),ne=v.getAttribute("Language")||_.Xf,oe=_.Zh(ne),Kh=v.getAttribute("Name")||"",kg=+v.getAttribute(_.hb),
|
|
20
|
+
lg=+v.getAttribute(_.gb),mm=IP(u,v,"Url"),$S=+v.getAttribute("TimeScale")||null;{const Sc=[],qj=_.lm(v,_.Ab);for(let pe=0;pe<qj.length;pe++){{let Tc,Ka,Jd;var y=u,B=qj[pe],D=ib;const rj=+B.getAttribute("Index"),mg=+IP(y,B,"Bitrate");let kc=NaN,ng=NaN,nm=NaN,Rr=NaN,xE=NaN,yE=NaN,zE=NaN;const AE=B.getAttribute("FourCC");switch(D){case _.w:kc=+IP(y,B,_.gb);ng=+IP(y,B,_.hb);break;case _.p:Rr=+B.getAttribute("Channels")||2,nm=+IP(y,B,"SamplingRate"),yE=+IP(y,B,"AudioTag"),xE=+IP(y,B,"BitsPerSample"),zE=
|
|
21
|
+
+IP(y,B,"PacketSize")}let Sr=String(B.getAttribute("CodecPrivateData"));if(D===_.p&&!Sr){{var M=Rr;const BE={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},om=BE[nm];if("AACH"===AE){Ka=new Uint8Array(4);const CE=BE[2*nm];Ka[0]=40|om>>1;Ka[1]=om<<7|M<<3|CE>>1;Ka[2]=CE<<7|8;Ka[3]=0;Tc=new Uint16Array(2);Tc[0]=(Ka[0]<<8)+Ka[1];Tc[1]=(Ka[2]<<8)+Ka[3];Jd=Tc[0].toString(16)+Tc[1].toString(16)}else Ka=new Uint8Array(2),Ka[0]=16|om>>1,Ka[1]=om<<7|M<<3,Tc=
|
|
22
|
+
new Uint16Array(1),Tc[0]=(Ka[0]<<8)+Ka[1],Jd=Tc[0].toString(16);Sr=Jd.toUpperCase()}}var da={id:y.W++,type:D,index:rj,bitrate:mg,rd:Sr,maxHeight:kc,maxWidth:ng,fd:nm,Xe:Rr,Fh:yE,dg:xE,Rh:zE,ug:AE,segmentIndex:null}}Sc.push(da)}var ub=Sc}{const Sc=[],qj=_.lm(v,"c");for(let pe=0;pe<qj.length;pe++){const Tc=qj[pe];let Ka=parseInt(Tc.getAttribute("t"),10),Jd=parseInt(Tc.getAttribute("d"),10),rj=parseInt(Tc.getAttribute("r"),10),mg=0;if(isNaN(Ka)&&isNaN(Jd))throw u.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
23
|
+
new _.H(_.F,4,4037,u.l);0===pe&&isNaN(Ka)&&(mg=Ka=0);if(0<pe){const kc=Sc[Sc.length-1];mg=kc.n+1;kc.d||(kc.d=Ka-kc.t);Ka||(Ka=kc.t+kc.d);Jd||(Jd=Ka-kc.t)}Sc.push({n:mg,d:Jd,t:Ka});if(rj){rj--;for(let kc=0;kc<rj;kc++){const ng=Sc[Sc.length-1];mg=ng.n+1;Ka=ng.t+ng.d;Jd=ng.d;Sc.push({n:mg,d:Jd,t:Ka})}}}u.C()||Sc.length===Rc||u.h.warn("Number of fragments ("+Rc+") differs from number of chunks ("+Sc.length+").");var Ub=Sc}var pd={type:ib,Ih:Rc,qh:Jh,language:oe,Xc:ne,name:Kh,maxWidth:kg,maxHeight:lg,
|
|
24
|
+
zh:mm,tracks:ub,ef:Ub,timescale:$S}}ea.push(pd)}var gg=ea}const Wa={Qh:d,uf:e,timescale:f,duration:g,isLive:h,Ph:k,Wd:l,ce:!1,streams:gg};if(a.g&&a.w)return MP(a,Wa),Promise.resolve();a.G.clear();{const ea=Wa.timescale,$a=Wa.duration,Pa=wO(Wa.streams,_.p),ib=wO(Wa.streams,_.w),Rc=wO(Wa.streams,_.G),Jh=[];let ne=NP(a,$a,ea,Pa),oe=NP(a,$a,ea,ib);const Kh=NP(a,$a,ea,Rc);ne.length||(ne=[null]);oe.length||(oe=[null]);for(let kg=0;kg<oe.length;kg++)for(let lg=0;lg<ne.length;lg++)Jh.push(OP(a,oe[kg],ne[lg]));
|
|
25
|
+
var ke={id:"ID",configurationId:void 0,startTime:0,endTime:$a,variants:Jh,textStreams:Kh,thumbStreams:[]}}{var Oc=Wa.streams;let ea=a.a.startTime,$a=a.a.delay;const Pa=a.I;let ib=Math.min(a.a.duration||Infinity,Pa);const Rc=a.C(),Jh=a.a.Wd,ne=a.a.Yc,oe=a.H,Kh=isFinite(a.F)?a.F:0;if(Rc)ib=Infinity,ea=Date.now()/1E3-ne,a.a.startTime=ea,$a=3*oe;else{const kg=isFinite(Pa)?Pa:a.a.duration;for(const lg of Oc)for(const mm of lg.tracks)mm.segmentIndex.offset(-Kh),_.uB(mm.segmentIndex,kg)}a.B=new _.bH(a.f.timeline||
|
|
26
|
+
{},ea,$a,!Rc,!0);a.B.f=ib;_.IB(a.B,oe);a.B.A=Jh;Rc||a.B.offset(-Kh)}a.D.filterAllPeriods([ke]);a.g={presentationTimeline:a.B,periods:[ke],minBufferTime:0};Promise.resolve();a.K||(a.D.networkingEngine.qc(a.L),a.K=!0);a.w=Wa;return Promise.resolve()},QP=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Eb.bind(a),b))},IP=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.H(_.F,4,4038,a.l,c);},JP=function(a,b){const c=b===LP;a.g&&a.g.presentationTimeline&&
|
|
27
|
+
_.DB(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.N=b},MP=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){uO(g,c)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var d=RP(a,a.w.timescale,f,c);c=g.segmentIndex;_.VB(c,d);(d=a.a.Wd)&&_.WB(c,_.TB(c)-d).forEach(h=>{h.Oa().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.`)}}},RP=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.ef.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=tO(a.l,c,k,d);a.H=Math.max(a.H,l);f.push(new _.UB(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.Yc?a.a.Yc=b.endTime:a.a.Yc=
|
|
29
|
+
Math.min(a.a.Yc,b.endTime);return f},NP=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=RP(a,c,k,h);const da=new _.cH(l);var m=null;k.type!==_.G&&(m=SP(a,b,c,k,h));h.segmentIndex=da;l=_.gH++;var n=Promise.resolve.bind(Promise),q=da.find.bind(da),u=da.get.bind(da),v=da.f.bind(da),y=da.getDuration.bind(da),B=TP[k.type];var D="";switch(k.type){case _.w:D=h.rd;var M=/00000001[0-9]7/.exec(D);D="avc1."+(M&&M[0]?D.substr(D.indexOf(M[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",
|
|
30
|
+
D);break;case _.p:D=h.rd,M=2,"AACH"===h.ug?M=5:D&&(M=(parseInt(D.substr(0,2),16)&248)>>3),D="mp4a.40."+M,a.h.debug("AUDIO CODECS: ",D)}M=k.type===_.G?UP[k.qh]:void 0;h={id:l,originalId:null,Th:null,createSegmentIndex:n,findSegmentPosition:q,getSegmentReference:u,adjustSegmentDurations:v,getDuration:y,segmentIndex:da,segmentLookupStrategy:_.rA,initSegmentReference:m,mimeType:B,codecs:D,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:M,encrypted:a.J(),keyId:null,
|
|
31
|
+
language:k.language,originalLanguage:k.Xc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Xe||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},OP=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Xf;return c||b?{id:a.S++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},SP=function(a,b,c,d,e){b=vO(b,d.timescale||c,e);c={isLive:a.C.bind(a),
|
|
32
|
+
yd:a.J.bind(a),Ag:()=>1,wd:a.R.bind(a)};d=new Uint8Array(0);try{d=oP(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.H(_.F,3,4035,g);}const f="data:text/plain;base64,"+_.Ai(d);return new _.ZG(()=>[f],0,null,null,!0)},GO=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?_.O(a,1):_.O(a,this.size);_.rl(a,rO(this.type));this.size>b&&lO(a,this.size);"uuid"===this.type&&_.rl(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()}},VP=class extends GO{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);mO(a,this.version);nO(a,this.flags)}},mP=class extends GO{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);_.rl(a,this.g,this.offset);a.getPosition()}},sP=class extends VP{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);_.rl(a,this.g,this.offset);a.getPosition()}},lP=class extends GO{constructor(a,b,c){super("ftyp");this.j=a;this.uf=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);_.rl(a,rO(this.j));_.O(a,this.uf);_.rl(a,rO(this.g.join("")));a.getPosition()}},kP=class extends GO{constructor(){super(_.ye)}},jP=class extends GO{constructor(){super(_.Uf)}},NO=class extends VP{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?(lO(a,0),lO(a,0),_.O(a,this.timescale),lO(a,this.duration*this.timescale)):(_.O(a,0),_.O(a,0),_.O(a,this.timescale),_.O(a,this.duration*this.timescale));_.O(a,65536);oO(a,this.volume);oO(a,0);_.O(a,0);_.O(a,0);for(let b=0;b<this.g.length;b++)mO(a,this.g[b]);
|
|
37
|
+
_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,0);_.O(a,this.j);a.getPosition()}},OO=class extends GO{constructor(){super("mvex")}},PO=class extends VP{constructor(a){super("trex",0,0);this.g=a}a(){return 20+super.a()}write(a){super.write(a);_.O(a,this.g);_.O(a,1);_.O(a,0);_.O(a,0);_.O(a,0);a.getPosition()}},QO=class extends VP{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?(lO(a,0),lO(a,0),_.O(a,this.j),_.O(a,0),lO(a,this.duration*this.timescale)):(_.O(a,0),_.O(a,0),_.O(a,this.j),_.O(a,0),_.O(a,this.duration*this.timescale));_.O(a,0);_.O(a,0);oO(a,0);oO(a,0);oO(a,this.volume);oO(a,0);for(let b=0;b<this.g.length;b++)mO(a,this.g[b]);oO(a,this.width);oO(a,0);oO(a,this.height);oO(a,0);a.getPosition()}},RO=class extends VP{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?(lO(a,0),lO(a,0),_.O(a,this.timescale),lO(a,this.duration*this.timescale)):(_.O(a,0),_.O(a,0),_.O(a,this.timescale),_.O(a,this.duration*this.timescale));oO(a,this.language);oO(a,0);a.getPosition()}},SO=class extends VP{constructor(a){super("hdlr",0,0);this.g=a}a(){return 33+super.a()}write(a){super.write(a);_.O(a,0);this.g===
|
|
40
|
+
_.w?_.rl(a,rO("vide")):_.rl(a,rO("soun"));_.O(a,0);_.O(a,0);_.O(a,0);this.g===_.w?_.rl(a,rO("VideoHandler\x00")):_.rl(a,rO("SoundHandler\x00"));a.getPosition()}},YO=class extends VP{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);oO(a,0);_.rl(a,this.g);a.getPosition()}},WP=class extends GO{constructor(a){super(a);this.A=!0}a(){return 8+super.a()}write(a){super.write(a);_.O(a,0);oO(a,0);oO(a,1)}},XP=class extends WP{constructor(a){super(a);
|
|
41
|
+
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);oO(a,0);oO(a,0);_.O(a,0);_.O(a,0);_.O(a,0);oO(a,this.width);oO(a,this.height);_.O(a,4718592);_.O(a,4718592);_.O(a,0);oO(a,1);mO(a,10);_.rl(a,rO("AVC Coding",31));oO(a,this.depth);qO(a,-1)}},YP=class extends WP{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);_.O(a,0);_.O(a,0);oO(a,this.channelCount);oO(a,this.sampleSize);qO(a,0);
|
|
42
|
+
oO(a,0);oO(a,this.sampleRate);oO(a,0)}},XO=class extends XP{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()}},HO=class extends XO{constructor(a,b){super(a,b);this.type="encv"}},$O=class extends YP{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()}},IO=class extends $O{constructor(a,b,c){super(a,b,c);this.type="enca"}},
|
|
43
|
+
WO=class extends GO{constructor(a,b){super("avcC");this.Ra=a;this.Rb=b;this.version=1;this.g=this.Ra[0][1];this.j=this.Ra[0][2];this.level=this.Ra[0][3]}a(){let a=7;for(var b=0;b<this.Ra.length;b++)a+=2,a+=this.Ra[b].byteLength;for(b=0;b<this.Ra.length;b++)a+=2,a+=this.Rb[b].byteLength;return a+super.a()}write(a){super.write(a);mO(a,this.version);mO(a,this.g);mO(a,this.j);mO(a,this.level);mO(a,255);mO(a,224|this.Ra.length);for(var b=0;b<this.Ra.length;b++)oO(a,this.Ra[b].length),_.rl(a,this.Ra[b]);
|
|
44
|
+
mO(a,this.Rb.length);for(b=0;b<this.Rb.length;b++)oO(a,this.Rb[b].length),_.rl(a,this.Rb[b]);a.getPosition()}},ZO=class extends VP{constructor(a){super("esds",0,0);this.Jb=a}a(){return 22+(this.Jb.byteLength+3)+super.a()}write(a){super.write(a);mO(a,3);mO(a,23+this.Jb.byteLength);oO(a,1);mO(a,0);mO(a,4);mO(a,15+this.Jb.byteLength);mO(a,64);mO(a,21);nO(a,0);_.O(a,0);_.O(a,0);mO(a,5);mO(a,this.Jb.byteLength);_.rl(a,this.Jb);_.rl(a,new Uint8Array([6,1,2]));a.getPosition()}},UO=class extends VP{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&&_.rl(a,rO(this.location));a.getPosition()}},TO=class extends VP{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);_.O(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},bP=class extends GO{constructor(){super(_.Lf)}},VO=class extends VP{constructor(){super(_.Nf,
|
|
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);_.O(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},cP=class extends VP{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);_.O(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},
|
|
47
|
+
dP=class extends VP{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);_.O(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},fP=class extends VP{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);_.O(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);
|
|
48
|
+
a.getPosition()}},eP=class extends VP{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.O(a,0);_.O(a,0);a.getPosition()}},aP=class extends VP{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);qO(a,0);oO(a,0);a.getPosition()}},gP=class extends GO{constructor(){super("dinf")}},hP=class extends GO{constructor(){super(_.xe)}},iP=class extends GO{constructor(){super(_.te)}},AP=class extends VP{constructor(a,b){super("tfdt",a,0);this.baseMediaDecodeTime=
|
|
49
|
+
b}a(){let a=0;a=1===this.version?a+8:a+4;return a+super.a()}write(a){super.write(a);1===this.version?lO(a,this.baseMediaDecodeTime):_.O(a,this.baseMediaDecodeTime);a.getPosition()}},pP=class extends VP{constructor(){super("mfhd",0,0);this.g=0}a(){return 4+super.a()}write(a){super.write(a);_.O(a,this.g);a.getPosition()}},rP=class extends VP{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&ZP&&(a+=4);this.flags&$P&&(a+=
|
|
50
|
+
4);for(let b=0;b<this.g;b++)this.flags&aQ&&(a+=4),this.flags&bQ&&(a+=4),this.flags&cQ&&(a+=4),this.flags&dQ&&(a+=4);return a+super.a()}write(a){super.write(a);_.O(a,this.g);this.flags&ZP&&(a.getPosition(),pO(a,this.l));this.flags&$P&&_.O(a,this.o);for(let b=0;b<this.g;b++)this.flags&aQ&&_.O(a,this.w[b]),this.flags&bQ&&_.O(a,this.sampleSize[b]),this.flags&cQ&&_.O(a,this.B[b]),this.flags&dQ&&(0===this.version?_.O(a,this.j[b]):pO(a,this.j[b]));a.getPosition()}},ZP=1,$P=4,aQ=256,bQ=512,cQ=1024,dQ=2048,
|
|
51
|
+
qP=class extends VP{constructor(a,b){super("tfhd",a,b);this.g=255;this.o=this.w=this.l=this.B=this.j=0}a(){let a=4;this.flags&eQ&&(a+=8);this.flags&fQ&&(a+=4);this.flags&gQ&&(a+=4);this.flags&hQ&&(a+=4);this.flags&iQ&&(a+=4);return a+super.a()}write(a){super.write(a);_.O(a,this.g);this.flags&eQ&&lO(a,this.j);this.flags&fQ&&_.O(a,this.B);this.flags&gQ&&_.O(a,this.l);this.flags&hQ&&_.O(a,this.w);this.flags&iQ&&_.O(a,this.o);a.getPosition()}},eQ=1,fQ=2,gQ=8,hQ=16,iQ=32,wP=class extends GO{constructor(){super("traf")}},
|
|
52
|
+
xP=class extends GO{constructor(){super("moof")}},vP=class extends GO{constructor(){super(_.se);this.g=new Uint8Array(0)}a(){return this.g.byteLength+super.a()}write(a){super.write(a);0<this.g.byteLength&&_.rl(a,this.g)}},JO=class extends VP{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);mO(a,0);0===this.version?mO(a,0):mO(a,0);mO(a,this.g);mO(a,this.j);_.rl(a,_.Ci(this.o));
|
|
53
|
+
if(1===this.g&&0===this.j){mO(a,0);for(let b=0;b<this.l.length;b++)mO(a,this.l[b])}a.getPosition()}},LO=class extends VP{constructor(a,b){super("schm",0,0);this.g=a;this.j=b;this.Gb=""}a(){let a=8;this.flags&1&&(a+=rO(this.Gb).byteLength);return a+super.a()}write(a){super.write(a);_.rl(a,rO(this.g));_.O(a,this.j);this.flags&1&&_.rl(a,rO(this.Gb));a.getPosition()}},KO=class extends GO{constructor(a){super("frma");this.g=a}a(){return rO(this.g).byteLength+super.a()}write(a){super.write(a);_.rl(a,rO(this.g));
|
|
54
|
+
a.getPosition()}},BP=class extends VP{constructor(){super("saio",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&&(_.O(a,0),_.O(a,0));_.O(a,1);for(let b=0;1>b;b++)0===this.version?_.O(a,this.offset[b]):lO(a,this.offset[b]);a.getPosition()}},CP=class extends VP{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);
|
|
55
|
+
return a+super.a()}write(a){super.write(a);this.flags&1&&(_.O(a,0),_.O(a,0));mO(a,this.g);_.O(a,this.j);if(0===this.g)for(let b=0;b<this.j;b++)mO(a,this.l[b]);a.getPosition()}},uP=class extends VP{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].rf.byteLength,this.flags&2){a+=2;for(let c=0;c<this.g[b].Gc;c++)a+=2,a+=4}return a+super.a()}write(a){super.write(a);_.O(a,this.j);this.flags&1&&mO(a,this.l);for(let b=
|
|
56
|
+
0;b<this.j;b++)if(_.rl(a,this.g[b].rf),this.flags&2){oO(a,this.g[b].Gc);for(let c=0;c<this.g[b].Gc;c++)oO(a,this.g[b].Ee[c].Ve),_.O(a,this.g[b].Ee[c].We)}a.getPosition()}};var zP=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))}},yO=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,zO=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,AO=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,BO=/^(\d*\.?\d*)f$/,CO=/^(\d*\.?\d*)t$/,DO=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var nP=class{constructor(a){this.a=a;this.f=FO(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=FO(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var tP=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var jQ=class{constructor(){this.w=this.g=this.f=this.D=null;this.S=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.N=LP;this.H=0;this.F=this.I=Infinity;this.o=[];this.L=this.T.bind(this);this.G=new Map}configure(a){this.f=a}start(a,b){this.D=b;a=[...new Set([a,sO(a)])];return HP(this,a).then(c=>PP(this,c.data).then(()=>{QP(this,this.A);return this.g}))}requestStop(){}stop(){this.D&&this.D.networkingEngine.ed(this.L);this.A=this.w=
|
|
57
|
+
this.g=this.f=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 HP(this,[this.l]).then(a=>PP(this,a.data).then(()=>this.g)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Eb(){this.h.debug(_.iA);this.D&&(this.j=null,this.update().then(()=>{QP(this,this.A)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&QP(this,100))}))}C(){return this.N===KP}J(){return 0<this.o.length}R(a){let b=null;if(this.o.length)for(let c=
|
|
58
|
+
0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b}T(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),yd:this.J.bind(this),Ag:()=>1,wd:this.R.bind(this)};let d=!1;const e=new _.H(_.F,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=DP(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)}},TP={video:_.ig,audio:_.Ic,text:_.Cc},LP=_.Sb,KP="LIVE",UP={Ah:_.nA,Ch:_.DA};_.z("clpp.smooth.SmoothComponent",class extends _.Pt{f(){_.tr.ism=jQ;_.rr[_.Dc]=jQ}a(){_.sC("ism");_.tC(_.Dc)}id(){return _.Gf}});};f.call(g, window);
|