@castlabs/prestoplay 6.13.0 → 6.14.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 +42 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -6
- package/cjs/cl.cast.js +111 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +528 -518
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +60 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -30
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +265 -274
- package/cjs/cl.muxdata.js +15 -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 -26
- package/cjs/cl.tizen.js +70 -70
- 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 +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +441 -431
- package/cl.crypto.js +8 -8
- package/cl.dash.js +68 -68
- package/cl.externs.js +60 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -69
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +236 -239
- package/cl.muxdata.js +13 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- 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 +15 -15
- package/clpp.styles.css +2 -0
- package/package.json +4 -4
- package/typings.d.ts +93 -50
package/cl.muxdata.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
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.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var wx=function(a){switch(a.type){case 1:return tx;case 2:return ux;case 3:return vx}},yx=function(a){const b=Object.keys(a).find(c=>xx.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},Ax=function(a){let b={debug:!0,data:zx(a)};a.f&&a.f.muxOptionsOverride&&_.Bg(a.f.muxOptionsOverride)&&(b=_.xg(b,a.f.muxOptionsOverride));b=_.xg(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 _.ql(c.url);e.video_source_url=_.Ri(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().ka(),
|
|
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.ja())&&d.language&&(e.player_language_code=d.language)}return e}});a.h.debug("Mux SDK options",b);return b},Bx=function(a){_.Xg(a.a);a.j.yd(a.F);a.j.tf(a.C)},zx=function(a){const b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.pa,player_software_name:_.pa,player_software_version:_.da,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",
|
|
4
|
+
player_mux_plugin_version:_.da};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Cx=function(a){a.a.on(a.m,_.Ff,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.Ff,b)});a.a.on(a.m,_.Me,()=>a.emit(_.Me));a.a.on(a.m,_.Lc,a.G.bind(a));a.a.on(a.m,_.vf,a.I.bind(a));a.a.on(a.m,_.Pf,()=>a.emit(_.of));a.a.on(a.m,_.Of,()=>a.emit(_.nf));a.a.on(a.m,_.Qd,a.H.bind(a));a.a.on(a.m,_.Xb,()=>a.emit("adbreakstart"));a.a.on(a.m,_.Zb,()=>a.emit("adbreakend"));a.a.on(a.m,_.kc,()=>
|
|
5
|
+
{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.gc,()=>a.emit("adpause"));a.a.on(a.m,_.ic,()=>{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.lc,()=>a.emit("adended"));a.a.on(a.m,_.cc,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.fc,()=>a.emit("admidpoint"));a.a.on(a.m,_.mc,()=>a.emit("adthirdquartile"));a.j.Hc(a.F);a.j.Be(a.C);a.a.on(a.m,_.Qd,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 _.ql(b.uris[b.uriIndex]);b={request_start:c,request_type:wx(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.ql(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:wx(c),request_hostname:f.a,request_error:`${wx(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.h.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},Dx=function(a){return!_.z(a)&&typeof a.init===_.Td&&typeof a.emit===_.Td},tx="manifest",ux="media",vx="encryption",xx=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var Ex=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 _.Er;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,Ax(this))}catch(d){throw this.g=!1,Bx(this),new _.H(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=zx(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);Cx(this)}release(){this.h.debug("release()");this.l?this.h.debug(_.ia):(Bx(this),this.l=!0,this.o=this.f=null)}destroy(){this.h.debug(_.zd);this.A?this.h.debug(_.ha):(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(_.ze);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ka())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.h.debug(_.De);
|
|
9
|
+
switch(a.detail.currentState){case _.Dn:this.m.getConfiguration().autoplay&&this.emit(_.Me);break;case _.Fn:this.emit(_.Te);break;case _.En:this.emit(_.Ie);break;case _.un:this.emit(_.Pd)}}H(a){this.h.debug(_.Ae);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(_.Qd,{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 _.ql(b.uris[b.uriIndex]);a={request_start:g,request_type:wx(b),request_hostname:d.a,request_id:yx(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.Ri(d)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var Fx=class extends _.It{constructor(){super();this.f=this.m=null;this.a=!1;this.h=new _.R("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new Ex(a,this.h)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.yg(c.muxdata);try{var d=[];typeof c===_.ye&&(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=!_.z(f.muxdata)&&typeof f.muxdata===_.ye){const g=f.muxdata;d=Dx(g.muxLib)?g.muxLib:window.mux;if(!Dx(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.H(1,9,9301);this.T(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.T(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.T(this.m,c),c;}}T(a,b){a.trigger(new _.C(_.Qd,{detail:b}))}};
|
|
13
|
+
_.x("clpp.muxdata.MuxDataPlugin",Fx);Fx.prototype.emit=Fx.prototype.emit;Fx.Id="mux";_.Ho(new class{create(){return new Fx}});};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
|
-
_.
|
|
4
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var sx=function(a,b){let c=b.baseUrl;_.di(c,"/")||(c+="/");const d=g=>g&&(_.ci(g,"https://")||_.ci(g,"http://")||_.ci(g,"//"))?g:`${c}${g}`,e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");b=d(b.fairplayUrl||"fairplay");a=new _.vs(a);a.Ma(_.ud,{licenseUrl:e,videoRobustness:[_.Ab,void 0],audioRobustness:[_.zb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Il,licenseResponse:_.Jl}});a.Ma(_.pd,{licenseUrl:b,
|
|
2
|
+
certificateUrl:b,modifiers:{licenseRequest:_.Ll,licenseResponse:_.Ml,extractContentId:_.Nl,certificateRequest:_.Ol}});a.Ma(_.sd,{licenseUrl:f,modifiers:{licenseRequest:_.Il}});_.Uk(a)};
|
|
3
|
+
_.x("clpp.onboard.OnboardComponent",class extends _.ht{constructor(){super();this.h=new _.R("clpp.onboard");this.j=new Set}a(){for(const a of this.j)delete _.Tk[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}'`),sx(b,a),this.j.add(b))}id(){return"onboard"}});
|
|
4
|
+
_.x("clpp.onboard.register",sx);};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
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
_.
|
|
8
|
-
const l=yield k.start(f.url,{networkingEngine:d,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onTimelineCueAdded:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.H(_.
|
|
9
|
-
_.
|
|
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=
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cx="A persistent DRM session already exists for: ",dx="No DRM configuration.",ex="clpp.persistent",fx="clpp.persistent.SimpleSessionStorage",gx=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},ix=function(a,b){a.I=hx;a.J=[];a.C=!0;return _.Hm(a,b)},kx=function(a,b,c,d,e,f){a.I=jx;const g=new Map,h=_.rm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Fe,persistentState:_.kf,sessionTypes:[_.Ke],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,
|
|
2
|
+
distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Gm(a,g)},lx=function(a,b){return _.w(function*(){const c=yield _.Xm(a,b);if(c){var d=[],e=a.f.get(c);e&&a.A&&(e.ob=new _.Km,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)})},mx=function(a){a=a.f.keys();a=gx(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
nx=function(a,b){const c=_.Wk(a),d=_.Ck({drm:a});d.drm=a;a=new _.On({mb:b,onError:()=>{},ke:()=>{},je:()=>{},onEvent:()=>{},getConfiguration:()=>d,xc:()=>null});a.g=c;return a},qx=function(a,b,c){return _.w(function*(){const d=ox;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)px.debug(cx,e);else{var g=nx(a,c);try{yield ix(g,b);yield _.Vm(g);yield _.Ym(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.uj(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:mx(g),
|
|
4
|
+
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw px.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else px.debug(dx)})},hx=1,jx=2,rx=class{constructor(){this.h=new _.R(fx)}store(a,b){return _.w(function*(){{var c=JSON.stringify(b.sessionIds);var d=b.serverCertificate?Array.from(b.serverCertificate):null;d=JSON.stringify(d);
|
|
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 _.w(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 _.w(function*(){window.localStorage.removeItem(encodeURIComponent(a))})}clear(){return _.w(function*(){window.localStorage.clear()})}getName(){return fx}};_.x("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.z(a)||(_.Cg(a.store)||c.push("store"),_.Cg(a.get)||c.push("get"),_.Cg(a.delete)||c.push("delete"),_.Cg(a.clear)||c.push("clear"),_.Cg(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw px.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});ox=a});
|
|
7
|
+
_.x("clpp.persistent.fetchLicense",function(a,b,...c){return _.w(function*(){var d=ox,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.In(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(dx);var g=b.offlineId;if(typeof g!==_.yf||!g.length)throw e("Missing offline id.");if(yield d.get(g))px.debug(cx,g);else{var h=_.Ck();d=new _.Eo;g=[];for(var k of c){const l=new k;_.Fk(l.id())||(l.f(),_.Hk(l),g.push(l))}k=null;try{k=yield _.Kq(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(_.F,4,4014));const m=_.Iq(l.periods);yield qx(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(),_.Ek.delete(e.id());e=[];k&&e.push(k.stop());e.push(d.destroy());yield Promise.all(e)}}})});
|
|
9
|
+
_.x("clpp.persistent.removeLicense",function(a){return _.w(function*(){var b=ox;if(_.Eg(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.Eo,c=nx(e.drmConfig,d),yield kx(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.Vm(c),yield Promise.all(e.sessionIds.map(f=>_.w(function*(){yield lx(c,f);px.debug("successfully removed session with id",f)}))),yield b.delete(a)):px.debug("No persistent DRM session found")}catch(e){throw px.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 px.warn("Invalid offlineId")})});var ox=new rx,px=new _.R(ex);_.x("clpp.persistent.PersistentLicenseComponent",class extends _.ht{constructor(){super();this.h=new _.R(ex)}id(){return _.Je}l(a,b){const c=this;return _.w(function*(){const d=a.getConfiguration().drm;if(d){c.h.debug(`Persisting DRM session ID: ${d.offlineId}`);var e=a.getNetworkEngine();try{yield qx(d,b,e),a.trigger(new _.C(_.Id,{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 _.w(function*(){b.h.debug(`Getting EME session IDs for ${a}`);
|
|
11
|
+
const c=ox;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 _.
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var $w=function(a,b){return 0<=b&&b<a.a.length},ax=function(a){a.trigger(new _.C(_.Ve))},bx=class extends _.qs{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.fc.bind(this)}getPosition(){return this.f}ng(){return this.a}Pc(){return 0<this.a.length&&$w(this,this.f)?this.a[this.f]:null}og(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&$w(this,a)?this.a[a]:null}ug(){return this.g}start(){this.g||(this.g=!0,this.m.on(_.Pd,this.j),this.rd(this.f,!0))}stop(){this.g=!1;this.m.off(_.Pd,this.j)}fc(){this.next()}next(){const a=this;return _.w(function*(){yield a.rd(Math.min(a.a.length-1,a.f+1))})}Lg(){const a=this;return _.w(function*(){yield a.rd(Math.max(0,a.f-1))})}rd(a,b){b=void 0===b?!1:b;const c=this;return _.w(function*(){if(0<c.a.length&&$w(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 _.C(_.Ue,{item:d})))}})}append(a){this.a.push(a);ax(this)}tg(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));ax(this)}}remove(a){if(0<this.a.length&&$w(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);ax(this)}}clear(){this.stop();this.f=0;this.a=[];this.g=!1;ax(this)}};_.x("clpp.Playlist",bx);bx.prototype.clear=bx.prototype.clear;bx.prototype.remove=bx.prototype.remove;bx.prototype.insert=bx.prototype.tg;
|
|
4
|
+
bx.prototype.append=bx.prototype.append;bx.prototype.goTo=bx.prototype.rd;bx.prototype.previous=bx.prototype.Lg;bx.prototype.next=bx.prototype.next;bx.prototype.onEnded=bx.prototype.fc;bx.prototype.stop=bx.prototype.stop;bx.prototype.start=bx.prototype.start;bx.prototype.isStarted=bx.prototype.ug;bx.prototype.getUpcoming=bx.prototype.og;bx.prototype.getCurrent=bx.prototype.Pc;bx.prototype.getQueue=bx.prototype.ng;bx.prototype.getPosition=bx.prototype.getPosition;bx.prototype.off=bx.prototype.off;
|
|
5
|
+
bx.prototype.one=bx.prototype.one;bx.prototype.on=bx.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 _.
|
|
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 Jw="No surface found. Can not attach frame!",Kw="SIMID:Media:timeupdate",Lw="Starting creative",Mw=function(a,b,c){return{type:b,sessionId:a.g,messageId:a.l++,timestamp:Date.now(),args:c}},Pw=function(a,b){return new Promise((c,d)=>{new Nw(a.j,c,d,b);Ow(a,b)})},Qw=function(a){const b=Mw(a,"SIMID:Player:startCreative",void 0);Pw(a,b).then(()=>{var c=a.f;c.h.info(Lw);c.m.trigger(new _.C(_.qf));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.h.error("Error while starting creative",
|
|
2
|
+
c)})},Sw=function(a,b){_.w(function*(){a.g=b.sessionId;Rw(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=Mw(a,"SIMID:Player:init",d);var e=Pw(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()}})},Rw=function(a,b){Ow(a,Mw(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},Ow=function(a,b){a.g?(b.type!==Kw&&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}'`)},Tw=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=Mw(d,"SIMID:Player:resize",e);Ow(d,e)}})},Uw=function(a,b){a.h.info("SIMID Session created");a.a=b},Vw=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 _.C(_.rf))},Ww=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}%`}},Xw=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=_.xe;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=
|
|
7
|
+
_.xe;this.a.style.overflow=_.Vd;this.a.classList.add(_.Zc);this.o=b=>{if(b.source===this.a.contentWindow&&(b=(b=b.data)?typeof b===_.yf?JSON.parse(b):b:null))if(b.type)switch(this.h.info(`Received message [${b.messageId}] '${b.type}':`,b.args),b.type){case "createSession":Sw(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=Ww(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=Ww(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);Rw(this,b)}else this.h.warn("WARNING: received message without 'type' property")};this.h=new _.R("clpp.simid.SimidPlayer");Uw(this.f,this)}load(a){window.addEventListener(_.qe,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(){Vw(this.f);this.g=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.qe,
|
|
10
|
+
this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},Nw=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 Zw=class extends _.It{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 Yw(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 Xw(this.g);var c=b.getContainer();this.j=Tw(this,c,b);this.j.observe(c);a.on(_.Ff,this.w)}else this.h.warn(Jw)}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&&(Qw(this.a),this.o=!0,this.h.info(Lw)),
|
|
12
|
+
c&&(c=this.a,Ow(c,Mw(c,Kw,{currentTime:a-b}))))):((a=this.m.getSurface())||this.h.warn(Jw),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(_.Ff,this.w),this.f&&(this.a.unload(),this.f=this.g.f=null))}},Yw=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:""}};_.Ho(new class{create(){return new Zw}});};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 _.
|
|
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(_.
|
|
11
|
-
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.
|
|
12
|
-
t.
|
|
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].
|
|
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=[],
|
|
20
|
-
|
|
21
|
-
+
|
|
22
|
-
new Uint16Array(1),
|
|
23
|
-
new _.H(_.
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
a.g.presentationTimeline
|
|
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.
|
|
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===_.
|
|
31
|
-
language:k.language,originalLanguage:k.
|
|
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?_.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
|
-
_.
|
|
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].
|
|
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
|
-
|
|
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 UK="Full MP4 box must have flags defined",VK="clpp.smooth.SmoothMP4Processor",WK="codecPrivateData",XK=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.N(a,c);_.N(a,b)},YK=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Zk()}},ZK=function(a,b){YK(a,b>>16&255);YK(a,b>>8&255);YK(a,b&255)},$K=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Zk()}},aL=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Zk()}},bL=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.g),a.a+=2}catch(c){_.Zk()}},cL=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},dL=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},eL=function(a,b,c,d){c=b.Se[c];b=b.eh;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 _.zy([a],[b])[0]},fL=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.u?c=["maxWidth","maxHeight","bitrate",WK,"fourCC"]:a.type===_.p&&(c=["bitrate",WK,"channels","bitsPerSample","samplingRate","fourCC"]);return _.Gg(a,b,c,["id","segmentIndex"])},gL=function(a,b,c){const d=c.kd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Na:null,Nb:null,width:NaN,height:NaN,Gb:null,Zc:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.u:a.Na=[_.mi(d[1])];a.Nb=[_.mi(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Gb=_.mi(c.kd),a.sampleSize=c.Rf||16,a.Zc=c.Zc,a.channelCount=c.Ke}return a},hL=function(a,b){return a.filter(c=>c.type===b)},iL=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)},pL=function(a,b,c){var d=null;if(jL.test(a)){{a=jL.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 kL.test(a)?d=iL(kL,a):lL.test(a)?d=iL(lL,a):mL.test(a)?(a=mL.exec(a),d=Number(a[1])/c.frameRate):nL.test(a)?(a=nL.exec(a),d=Number(a[1])/c.a):oL.test(a)&&(d=iL(oL,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},qL=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.ul(b)},xL=function(a,b,c){a:{var d=[_.ud,_.sd];for(e of d)if((d=c.qd(e))&&d.keyId){var e=d.keyId;break a}_.B(VK,"Could not get default Key ID for DRM init data!");e=null}c=new rL("xxxx");a.type===_.u?c=new sL(a.width,a.height):c=new tL(a.channelCount,a.sampleSize,a.Zc);a=new uL;a.g=1;a.j=8;a.o=e||"00000000000000000000000000000000";a=(new rL("schi")).append([a]);b=(new rL(_.sf)).append([new vL(b),new wL(_.Uc,65536),a]);c.append([b]);return c},
|
|
7
|
+
$L=function(a,b){var c=b.ud(),d=new yL(a.timescale,a.duration,a.id),e=(new zL).append([new AL(a.id)]),f=new BL(a.id,a.duration,a.timescale,a.width,a.height),g=new CL(a.timescale,a.duration);const h=new DL(a.type);var k=null,l=new EL;l.entries=[new FL];var m=new GL;switch(a.type){case _.u:k=new HL(a.Na,a.Nb);c?(a=xL(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new IL(a.width,a.height)).append([k]),m.entries=[a]);k=new JL;break;case _.p:k=new KL(a.Gb),c?(a=xL(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new LL(a.channelCount,a.sampleSize,a.Zc)).append([k]),m.entries=[a]),k=new ML}m=(new NL).append([m,new OL,new PL,new QL,new RL]);l=(new SL).append([l]);l=(new TL).append([k,l,m]);g=(new UL).append([g,h,l]);f=(new VL).append([f,g]);d=(new WL).append([d,f,e]);e=new XL("dash",0,["iso6","mp41","avc1"]);c&&(c=b.qd(_.sd),b=b.qd(_.ud),c&&d.append([new YL("pssh",c.initData,8)]),b&&d.append([new YL("pssh",b.initData,8)]),c||b||_.B(VK,"Could not get PSSH init data!"));b=new ZL([e,d]);return _.J(b.write())},
|
|
9
|
+
jM=function(a,b){let c,d,e,f,g,h;(new _.sl).L("moof",_.ll).$("mfhd",k=>{{const l=new aM;l.g=_.P(k.reader);c=l}}).L("traf",_.ll).$("tfhd",k=>{{const l=k.reader.Ca();if(null===k.flags)throw new _.H(_.F,3,3019,UK);const m=new bM(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.gl(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(_.F,3,3019,UK);const m=new cM(k.version||0,k.flags||0);m.g=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.l=_.fl(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(_.fl(k.reader)));e=m}}).$("sdtp",k=>{{const l=_.il(k.reader,k.reader.Ca());f=new dM("sdtp",k.version||0,k.flags||0,l,0)}}).L("uuid",k=>{var l=_.il(k.reader,16);if(_.oi(l,eM)){l=_.P(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new fM(k.version,k.flags);l.j=_.P(k.reader);k.flags&1&&(l.l=_.dl(k.reader));for(let m=0;m<l.j;m++){const n={cf:_.il(k.reader,8),Gc:0,ue:[]};if(k.flags&2){n.Gc=_.el(k.reader);for(let q=0;q<n.Gc;q++){const t={Ie:0,Je:0};
|
|
12
|
+
t.Ie=_.el(k.reader);t.Je=_.P(k.reader);n.ue.push(t)}}l.g.push(n)}g=l}}).L(_.oe,k=>{{const l=new gM;0<k.reader.Ca()?l.g=_.il(k.reader,k.reader.Ca()):(_.B(VK,"mdat box is empty!"),l.g=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new hM).append([d,e]);f&&a.append([f]);b.ud()&&g&&a.append([g]);b=(new iM).append([c,a]);return new ZL([b,h])},oM=function(a,b,c,d){var e=d.ud(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=jM(b,d);if(null===g)return a.request.contentType===_.G?a.data:
|
|
13
|
+
g;d=g.get(_.oe);if(a.request.contentType===_.G){e=d.g.buffer;if(c){e=_.Zh(e);if((e=(new DOMParser).parseFromString(e,_.Ef))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new kM(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",_.Od];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],pL(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.$h(e).buffer}else c=e;return c}h=new iM;a=g.get("mfhd");b=new hM;k=g.get("tfhd");m=new lM(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 mM,new nM(g,k,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new ZL([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},pM=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},qM=function(a){return{initData:_.py(_.dm(a)),initDataType:_.Uc,keyId:a,periodId:null}},rM=function(a,b,c){a=_.lm(a);c&&a.version!==c&&(a=_.ry(a,c));return{initData:_.py(a),initDataType:_.Uc,keyId:b,periodId:null}},sM=function(a,b){return _.w(function*(){var c=_.zi(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})},AM=function(a,b){let c=null;try{{const ea=new DOMParser;let Za,Ma;try{const hb=_.Zh(b);Ma=ea.parseFromString(hb.trim(),_.Ef)}catch(hb){throw hb;}Ma&&Ma.documentElement.tagName==_.Eb&&(Za=Ma.documentElement);c=Za&&0<Za.getElementsByTagName("parsererror").length?null:Za}}catch(ea){}if(!c)throw a.h.error("Unable to parse manifest"),new _.H(_.F,4,4033,a.l);const d=+tM(a,c,"MajorVersion"),e=+tM(a,c,"MinorVersion"),f=+c.getAttribute("TimeScale")||
|
|
18
|
+
1E7;let g=+tM(a,c,"Duration");const h="TRUE"===c.getAttribute("IsLive"),k=+c.getAttribute("LookAheadCount"),l=+c.getAttribute("DVRWindowLength")||Infinity,m=_.Yl(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?(uM(a,vM),a.A=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),g=Infinity):uM(a,wM);a.a={startTime:0,delay:0,duration:g/f,Md:l/f,Tc:0};if(m){{var n=a.f.playreadyVersion;
|
|
19
|
+
const ea=[],Za=_.Yl(m,"ProtectionHeader")[0],Ma=_.li(_.$l(Za)||""),hb=_.lm(Ma).a;ea.push(pM(_.ud,qM(hb),[hb]));ea.push(pM(_.sd,rM(Ma,hb,n),[hb]));var q=ea}a.o=q}{const ea=[],Za=_.Yl(c,"StreamIndex");if(!Za.length)throw a.h.error("No streams found!"),new _.H(_.F,4,4034,a.l);for(let Ma=0;Ma<Za.length;Ma++){{var t=a,v=Za[Ma];const hb=tM(t,v,"Type"),Bc=+v.getAttribute("Chunks"),mh=v.getAttribute("Subtype"),$d=v.getAttribute("Language")||_.If,ae=_.Jh($d),nh=v.getAttribute("Name")||"",Rf=+v.getAttribute(_.eb),
|
|
20
|
+
Sf=+v.getAttribute(_.db),Dl=tM(t,v,"Url"),KP=+v.getAttribute("TimeScale")||null;{const Cc=[],Ui=_.Yl(v,_.ub);for(let be=0;be<Ui.length;be++){{let Dc,Ia,rd;var y=t,A=Ui[be],D=hb;const Vi=+A.getAttribute("Index"),Tf=+tM(y,A,"Bitrate");let Yb=NaN,Uf=NaN,El=NaN,Yq=NaN,dC=NaN,eC=NaN,fC=NaN;const gC=A.getAttribute("FourCC");switch(D){case _.u:Yb=+tM(y,A,_.db);Uf=+tM(y,A,_.eb);break;case _.p:Yq=+A.getAttribute("Channels")||2,El=+tM(y,A,"SamplingRate"),eC=+tM(y,A,"AudioTag"),dC=+tM(y,A,"BitsPerSample"),fC=
|
|
21
|
+
+tM(y,A,"PacketSize")}let Zq=String(A.getAttribute("CodecPrivateData"));if(D===_.p&&!Zq){{var E=Yq;const hC={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},Fl=hC[El];if("AACH"===gC){Ia=new Uint8Array(4);const iC=hC[2*El];Ia[0]=40|Fl>>1;Ia[1]=Fl<<7|E<<3|iC>>1;Ia[2]=iC<<7|8;Ia[3]=0;Dc=new Uint16Array(2);Dc[0]=(Ia[0]<<8)+Ia[1];Dc[1]=(Ia[2]<<8)+Ia[3];rd=Dc[0].toString(16)+Dc[1].toString(16)}else Ia=new Uint8Array(2),Ia[0]=16|Fl>>1,Ia[1]=Fl<<7|E<<3,Dc=
|
|
22
|
+
new Uint16Array(1),Dc[0]=(Ia[0]<<8)+Ia[1],rd=Dc[0].toString(16);Zq=rd.toUpperCase()}}var O={id:y.W++,type:D,index:Vi,bitrate:Tf,kd:Zq,maxHeight:Yb,maxWidth:Uf,Zc:El,Ke:Yq,mh:eC,Rf:dC,yh:fC,hg:gC,segmentIndex:null}}Cc.push(O)}var bb=Cc}{const Cc=[],Ui=_.Yl(v,"c");for(let be=0;be<Ui.length;be++){const Dc=Ui[be];let Ia=parseInt(Dc.getAttribute("t"),10),rd=parseInt(Dc.getAttribute("d"),10),Vi=parseInt(Dc.getAttribute("r"),10),Tf=0;if(isNaN(Ia)&&isNaN(rd))throw t.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
23
|
+
new _.H(_.F,4,4037,t.l);0===be&&isNaN(Ia)&&(Tf=Ia=0);if(0<be){const Yb=Cc[Cc.length-1];Tf=Yb.n+1;Yb.d||(Yb.d=Ia-Yb.t);Ia||(Ia=Yb.t+Yb.d);rd||(rd=Ia-Yb.t)}Cc.push({n:Tf,d:rd,t:Ia});if(Vi){Vi--;for(let Yb=0;Yb<Vi;Yb++){const Uf=Cc[Cc.length-1];Tf=Uf.n+1;Ia=Uf.t+Uf.d;rd=Uf.d;Cc.push({n:Tf,d:rd,t:Ia})}}}t.C()||Cc.length===Bc||t.h.warn("Number of fragments ("+Bc+") differs from number of chunks ("+Cc.length+").");var Lb=Cc}var bd={type:hb,ph:Bc,Xg:mh,language:ae,Sc:$d,name:nh,maxWidth:Rf,maxHeight:Sf,
|
|
24
|
+
eh:Dl,tracks:bb,Se:Lb,timescale:KP}}ea.push(bd)}var Nf=ea}const Ua={xh:d,ef:e,timescale:f,duration:g,isLive:h,wh:k,Md:l,Td:!1,streams:Nf};if(a.g&&a.w)return xM(a,Ua),Promise.resolve();a.G.clear();{const ea=Ua.timescale,Za=Ua.duration,Ma=hL(Ua.streams,_.p),hb=hL(Ua.streams,_.u),Bc=hL(Ua.streams,_.G),mh=[];let $d=yM(a,Za,ea,Ma),ae=yM(a,Za,ea,hb);const nh=yM(a,Za,ea,Bc);$d.length||($d=[null]);ae.length||(ae=[null]);for(let Rf=0;Rf<ae.length;Rf++)for(let Sf=0;Sf<$d.length;Sf++)mh.push(zM(a,ae[Rf],$d[Sf]));
|
|
25
|
+
var Xd={startTime:0,endTime:Za,variants:mh,textStreams:nh,thumbStreams:[]}}{var xc=Ua.streams;let ea=a.a.startTime,Za=a.a.delay;const Ma=a.I;let hb=Math.min(a.a.duration||Infinity,Ma);const Bc=a.C(),mh=a.a.Md,$d=a.a.Tc,ae=a.H,nh=isFinite(a.F)?a.F:0;if(Bc)hb=Infinity,ea=Date.now()/1E3-$d,a.a.startTime=ea,Za=3*ae;else{const Rf=isFinite(Ma)?Ma:a.a.duration;for(const Sf of xc)for(const Dl of Sf.tracks)Dl.segmentIndex.offset(-nh),_.Vy(Dl.segmentIndex,Rf)}a.B=new _.UD(a.f.timeline||{},ea,Za,!Bc,!0);a.B.g=
|
|
26
|
+
hb;_.hz(a.B,ae);a.B.w=mh;Bc||a.B.offset(-nh)}a.D.filterAllPeriods([Xd]);a.g={presentationTimeline:a.B,periods:[Xd],minBufferTime:0};Promise.resolve();a.K||(a.D.networkingEngine.Hc(a.M),a.K=!0);a.w=Ua;return Promise.resolve()},BM=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Bb.bind(a),b))},tM=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);},uM=function(a,b){const c=b===wM;a.g&&a.g.presentationTimeline&&
|
|
27
|
+
_.cz(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.O=b},xM=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){fL(g,c)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var d=CM(a,a.w.timescale,f,c);c=g.segmentIndex;_.qz(c,d);(d=a.a.Md)&&_.rz(c,_.oz(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.`)}}},CM=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.Se.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=eL(a.l,c,k,d);a.H=Math.max(a.H,l);f.push(new _.pz(k,h,m,()=>[n],0,null,0,null,!0,g));a.G.set(n,h);e+=l});if(c.type===_.u||c.type===_.p)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Tc?a.a.Tc=b.endTime:a.a.Tc=
|
|
29
|
+
Math.min(a.a.Tc,b.endTime);return f},yM=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=CM(a,c,k,h);const O=new _.VD(l);var m=null;k.type!==_.G&&(m=DM(a,b,c,k,h));h.segmentIndex=O;l=_.WD++;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=EM[k.type];var D="";switch(k.type){case _.u: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===_.G?FM[k.Xg]:void 0;h={id:l,originalId:null,Ah:null,createSegmentIndex:n,findSegmentPosition:q,getSegmentReference:t,adjustSegmentDurations:v,getDuration:y,segmentIndex:O,segmentLookupStrategy:_.ay,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.Sc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Ke||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},zM=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.If;return c||b?{id:a.U++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},DM=function(a,b,c,d,e){b=gL(b,d.timescale||c,e);c={isLive:a.C.bind(a),
|
|
32
|
+
ud:a.J.bind(a),mg:()=>1,qd:a.R.bind(a)};d=new Uint8Array(0);try{d=$L(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,"+_.ki(d);return new _.RD(()=>[f],0,null,null,!0)},rL=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);_.$k(a,cL(this.type));this.size>b&&XK(a,this.size);"uuid"===this.type&&_.$k(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()}},GM=class extends rL{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);YK(a,this.version);ZK(a,this.flags)}},YL=class extends rL{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);_.$k(a,this.g,this.offset);a.getPosition()}},dM=class extends GM{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);_.$k(a,this.g,this.offset);a.getPosition()}},XL=class extends rL{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);_.$k(a,cL(this.j));_.N(a,this.ef);_.$k(a,cL(this.g.join("")));a.getPosition()}},WL=class extends rL{constructor(){super(_.ue)}},VL=class extends rL{constructor(){super(_.Gf)}},yL=class extends GM{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?(XK(a,0),XK(a,0),_.N(a,this.timescale),XK(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));_.N(a,65536);$K(a,this.volume);$K(a,0);_.N(a,0);_.N(a,0);for(let b=0;b<this.g.length;b++)YK(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()}},zL=class extends rL{constructor(){super("mvex")}},AL=class extends GM{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()}},BL=class extends GM{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?(XK(a,0),XK(a,0),_.N(a,this.j),_.N(a,0),XK(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);$K(a,0);$K(a,0);$K(a,this.volume);$K(a,0);for(let b=0;b<this.g.length;b++)YK(a,this.g[b]);$K(a,this.width);$K(a,0);$K(a,this.height);$K(a,0);a.getPosition()}},CL=class extends GM{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?(XK(a,0),XK(a,0),_.N(a,this.timescale),XK(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));$K(a,this.language);$K(a,0);a.getPosition()}},DL=class extends GM{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
|
+
_.u?_.$k(a,cL("vide")):_.$k(a,cL("soun"));_.N(a,0);_.N(a,0);_.N(a,0);this.g===_.u?_.$k(a,cL("VideoHandler\x00")):_.$k(a,cL("SoundHandler\x00"));a.getPosition()}},JL=class extends GM{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);$K(a,0);_.$k(a,this.g);a.getPosition()}},HM=class extends rL{constructor(a){super(a);this.A=!0}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);$K(a,0);$K(a,1)}},IM=class extends HM{constructor(a){super(a);
|
|
41
|
+
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);$K(a,0);$K(a,0);_.N(a,0);_.N(a,0);_.N(a,0);$K(a,this.width);$K(a,this.height);_.N(a,4718592);_.N(a,4718592);_.N(a,0);$K(a,1);YK(a,10);_.$k(a,cL("AVC Coding",31));$K(a,this.depth);bL(a,-1)}},JM=class extends HM{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);$K(a,this.channelCount);$K(a,this.sampleSize);bL(a,0);
|
|
42
|
+
$K(a,0);$K(a,this.sampleRate);$K(a,0)}},IL=class extends IM{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()}},sL=class extends IL{constructor(a,b){super(a,b);this.type="encv"}},LL=class extends JM{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()}},tL=class extends LL{constructor(a,b,c){super(a,b,c);this.type="enca"}},
|
|
43
|
+
HL=class extends rL{constructor(a,b){super("avcC");this.Na=a;this.Nb=b;this.version=1;this.g=this.Na[0][1];this.j=this.Na[0][2];this.level=this.Na[0][3]}a(){let a=7;for(var b=0;b<this.Na.length;b++)a+=2,a+=this.Na[b].byteLength;for(b=0;b<this.Na.length;b++)a+=2,a+=this.Nb[b].byteLength;return a+super.a()}write(a){super.write(a);YK(a,this.version);YK(a,this.g);YK(a,this.j);YK(a,this.level);YK(a,255);YK(a,224|this.Na.length);for(var b=0;b<this.Na.length;b++)$K(a,this.Na[b].length),_.$k(a,this.Na[b]);
|
|
44
|
+
YK(a,this.Nb.length);for(b=0;b<this.Nb.length;b++)$K(a,this.Nb[b].length),_.$k(a,this.Nb[b]);a.getPosition()}},KL=class extends GM{constructor(a){super("esds",0,0);this.Gb=a}a(){return 22+(this.Gb.byteLength+3)+super.a()}write(a){super.write(a);YK(a,3);YK(a,23+this.Gb.byteLength);$K(a,1);YK(a,0);YK(a,4);YK(a,15+this.Gb.byteLength);YK(a,64);YK(a,21);ZK(a,0);_.N(a,0);_.N(a,0);YK(a,5);YK(a,this.Gb.byteLength);_.$k(a,this.Gb);_.$k(a,new Uint8Array([6,1,2]));a.getPosition()}},FL=class extends GM{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&&_.$k(a,cL(this.location));a.getPosition()}},EL=class extends GM{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()}},NL=class extends rL{constructor(){super(_.xf)}},GL=class extends GM{constructor(){super(_.zf,
|
|
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()}},OL=class extends GM{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
|
+
PL=class extends GM{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()}},RL=class extends GM{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()}},QL=class extends GM{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);_.N(a,0);a.getPosition()}},ML=class extends GM{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);bL(a,0);$K(a,0);a.getPosition()}},SL=class extends rL{constructor(){super("dinf")}},TL=class extends rL{constructor(){super(_.te)}},UL=class extends rL{constructor(){super(_.pe)}},lM=class extends GM{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?XK(a,this.g):_.N(a,this.g);a.getPosition()}},aM=class extends GM{constructor(){super("mfhd",0,0);this.g=0}a(){return 4+super.a()}write(a){super.write(a);_.N(a,this.g);a.getPosition()}},cM=class extends GM{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&KM&&(a+=4);this.flags&LM&&(a+=4);for(let b=0;b<this.g;b++)this.flags&MM&&(a+=
|
|
50
|
+
4),this.flags&NM&&(a+=4),this.flags&OM&&(a+=4),this.flags&PM&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&KM&&(a.getPosition(),aL(a,this.l));this.flags&LM&&_.N(a,this.o);for(let b=0;b<this.g;b++)this.flags&MM&&_.N(a,this.w[b]),this.flags&NM&&_.N(a,this.sampleSize[b]),this.flags&OM&&_.N(a,this.B[b]),this.flags&PM&&(0===this.version?_.N(a,this.j[b]):aL(a,this.j[b]));a.getPosition()}},KM=1,LM=4,MM=256,NM=512,OM=1024,PM=2048,bM=class extends GM{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&QM&&(a+=8);this.flags&RM&&(a+=4);this.flags&SM&&(a+=4);this.flags&TM&&(a+=4);this.flags&UM&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&QM&&XK(a,this.j);this.flags&RM&&_.N(a,this.B);this.flags&SM&&_.N(a,this.l);this.flags&TM&&_.N(a,this.w);this.flags&UM&&_.N(a,this.o);a.getPosition()}},QM=1,RM=2,SM=8,TM=16,UM=32,hM=class extends rL{constructor(){super("traf")}},iM=class extends rL{constructor(){super("moof")}},
|
|
52
|
+
gM=class extends rL{constructor(){super(_.oe);this.g=new Uint8Array(0)}a(){return this.g.byteLength+super.a()}write(a){super.write(a);0<this.g.byteLength&&_.$k(a,this.g)}},uL=class extends GM{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);YK(a,0);0===this.version?YK(a,0):YK(a,0);YK(a,this.g);YK(a,this.j);_.$k(a,_.mi(this.o));if(1===this.g&&0===this.j){YK(a,0);for(let b=0;b<
|
|
53
|
+
this.l.length;b++)YK(a,this.l[b])}a.getPosition()}},wL=class extends GM{constructor(a,b){super("schm",0,0);this.g=a;this.j=b;this.Db=""}a(){let a=8;this.flags&1&&(a+=cL(this.Db).byteLength);return a+super.a()}write(a){super.write(a);_.$k(a,cL(this.g));_.N(a,this.j);this.flags&1&&_.$k(a,cL(this.Db));a.getPosition()}},vL=class extends rL{constructor(a){super("frma");this.g=a}a(){return cL(this.g).byteLength+super.a()}write(a){super.write(a);_.$k(a,cL(this.g));a.getPosition()}},mM=class extends GM{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]):XK(a,this.offset[b]);a.getPosition()}},nM=class extends GM{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));YK(a,this.g);_.N(a,this.j);if(0===this.g)for(let b=0;b<this.j;b++)YK(a,this.l[b]);a.getPosition()}},fM=class extends GM{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].Gc;c++)a+=2,a+=4}return a+super.a()}write(a){super.write(a);_.N(a,this.j);this.flags&1&&YK(a,this.l);for(let b=0;b<this.j;b++)if(_.$k(a,this.g[b].cf),this.flags&2){$K(a,this.g[b].Gc);
|
|
56
|
+
for(let c=0;c<this.g[b].Gc;c++)$K(a,this.g[b].ue[c].Ie),_.N(a,this.g[b].ue[c].Je)}a.getPosition()}};var kM=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))}},jL=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,kL=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,lL=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,mL=/^(\d*\.?\d*)f$/,nL=/^(\d*\.?\d*)t$/,oL=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var ZL=class{constructor(a){this.a=a;this.f=qL(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=qL(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var eM=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var VM=class{constructor(){this.w=this.g=this.f=this.D=null;this.U=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.O=wM;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,dL(a)])];return sM(this,a).then(c=>AM(this,c.data).then(()=>{BM(this,this.A);return this.g}))}stop(){this.D&&this.D.networkingEngine.yd(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 sM(this,[this.l]).then(a=>AM(this,a.data).then(()=>this.g)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Bb(){this.h.debug(_.Sx);this.D&&(this.j=null,this.update().then(()=>{BM(this,this.A)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&BM(this,100))}))}C(){return this.O===vM}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}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),ud:this.J.bind(this),mg:()=>1,qd: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=oM(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)}},EM={video:_.Yf,audio:_.Hc,text:_.yc},wM=_.Tx,vM="LIVE",FM={hh:_.Yx,jh:_.ky};_.x("clpp.smooth.SmoothComponent",class extends _.ht{f(){_.Nq.ism=VM;_.Lq[_.zc]=VM}a(){_.wz("ism");_.xz(_.zc)}id(){return"smooth"}});};f.call(g, window);
|