@castlabs/prestoplay 6.14.1 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -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 +114 -112
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +553 -538
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +193 -58
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +368 -264
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +71 -71
- 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 +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +455 -443
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +189 -58
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +71 -71
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +318 -236
- package/cl.muxdata.js +13 -13
- 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 +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
- package/typings.d.ts +393 -57
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
|
|
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.
|
|
4
|
-
player_mux_plugin_version:_.
|
|
5
|
-
|
|
6
|
-
var d=new _.
|
|
7
|
-
a.
|
|
8
|
-
a),this.l=!1);
|
|
9
|
-
switch(a.detail.currentState){case _.
|
|
10
|
-
this.emit(_.
|
|
11
|
-
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.
|
|
12
|
-
this.a=!1;const h=new _.H(1,9,9301);this.
|
|
13
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Xx=function(a){switch(a.type){case 1:return Ux;case 2:return Vx;case 3:return Wx}},Zx=function(a){const b=Object.keys(a).find(c=>Yx.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},ay=function(a){let b={debug:!0,data:$x(a)};a.f&&a.f.muxOptionsOverride&&_.Pg(a.f.muxOptionsOverride)&&(b=_.Lg(b,a.f.muxOptionsOverride));b=_.Lg(b,{getPlayheadTime:()=>1E3*a.m.getPosition(),getStateData:()=>{{a.g.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 _.Fl(c.url);e.video_source_url=_.fj(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().oa(),
|
|
3
|
+
c={videoWidth:c.width,videoHeight:c.height});const {videoWidth:g,videoHeight:h}=c;a.g.debug(`Video dimensions: ${g}x${h}`);g&&h&&(e.video_source_height=g,e.video_source_width=h);(d=d.na())&&d.language&&(e.player_language_code=d.language)}return e}});a.g.debug("Mux SDK options",b);return b},by=function(a){_.lh(a.a);a.j.Ud(a.F);a.j.Qf(a.D)},$x=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},cy=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,_.Nc,a.G.bind(a));a.a.on(a.m,_.Jf,a.I.bind(a));a.a.on(a.m,_.bg,()=>a.emit(_.Bf));a.a.on(a.m,_.ag,()=>a.emit(_.Af));a.a.on(a.m,_.q,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.Sc(a.F);a.j.bf(a.D);a.a.on(a.m,_.q,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 _.Fl(b.uris[b.uriIndex]);b={request_start:c,request_type:Xx(b),request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.Fl(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:Xx(c),request_hostname:f.a,request_error:`${Xx(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},dy=function(a){return!_.A(a)&&typeof a.init===_.Xd&&typeof a.emit===_.Xd},Ux="manifest",Vx="media",Wx="encryption",Yx=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var ey=class{constructor(a,b){this.m=a;this.o=this.f=null;this.C=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.$r;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.F=this.J.bind(this);this.D=this.K.bind(this)}initialize(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.C,ay(this))}catch(d){throw this.h=!1,by(this),new _.H(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=$x(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);cy(this)}release(){this.g.debug("release()");this.l?this.g.debug(_.ja):(by(this),this.l=!0,this.o=this.f=null)}destroy(){this.g.debug(_.Dd);this.A?this.g.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.C,a,b)}G(a){this.g.debug(_.De);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Xa())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.g.debug(_.He);
|
|
9
|
+
switch(a.detail.currentState){case _.Sn:this.m.getConfiguration().autoplay&&this.emit(_.Qe);break;case _.Un:this.emit(_.af);break;case _.Tn:this.emit(_.Me);break;case _.Jn:this.emit(_.Ud)}}H(a){this.g.debug(_.Ee);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.E){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(_.q,{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 _.Fl(b.uris[b.uriIndex]);a={request_start:g,request_type:Xx(b),request_hostname:d.a,request_id:Zx(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.fj(d)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var fy=class extends _.iu{constructor(){super();this.f=this.m=null;this.a=!1;this.g=new _.S("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new ey(a,this.g)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.Mg(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=dy(g.muxLib)?g.muxLib:window.mux;if(!dy(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.H(1,9,9301);this.W(a,h)}}else this.g.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.W(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.W(this.m,c),c;}}W(a,b){a.trigger(new _.D(_.q,{detail:b}))}};
|
|
13
|
+
_.z("clpp.muxdata.MuxDataPlugin",fy);fy.prototype.emit=fy.prototype.emit;fy.Id="mux";_.Wo(new class{create(){return new fy}});};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 Tx=function(a,b){let c=b.baseUrl;_.si(c,"/")||(c+="/");const d=g=>g&&(_.ri(g,"https://")||_.ri(g,"http://")||_.ri(g,"//"))?g:`${c}${g}`,e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");b=d(b.fairplayUrl||"fairplay");a=new _.Ts(a);a.bb(_.yd,{licenseUrl:e,videoRobustness:[_.Eb,void 0],audioRobustness:[_.Db,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Ul,licenseResponse:_.Vl}});a.bb(_.ud,{licenseUrl:b,
|
|
2
|
+
certificateUrl:b,modifiers:{licenseRequest:_.Xl,licenseResponse:_.Yl,extractContentId:_.Zl,certificateRequest:_.$l}});a.bb(_.wd,{licenseUrl:f,modifiers:{licenseRequest:_.Ul}});_.kl(a)};
|
|
3
|
+
_.z("clpp.onboard.OnboardComponent",class extends _.Gt{constructor(){super();this.g=new _.S("clpp.onboard");this.j=new Set}a(){for(const a of this.j)delete _.jl[a];this.j.clear()}h(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.g.info(`Registering the DRMtoday Onboard environment, name='${b}'`),Tx(b,a),this.j.add(b))}id(){return"onboard"}});
|
|
4
|
+
_.z("clpp.onboard.register",Tx);};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
|
-
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw
|
|
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 _.
|
|
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.
|
|
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 Dx="A persistent DRM session already exists for: ",Ex="No DRM configuration.",Fx="clpp.persistent",Gx="clpp.persistent.SimpleSessionStorage",Hx=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},Jx=function(a,b){a.I=Ix;a.J=[];a.D=!0;return _.Wm(a,b)},Lx=function(a,b,c,d,e,f){a.I=Kx;const g=new Map,h=_.Gm(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 _.Vm(a,g)},Mx=function(a,b){return _.x(function*(){const c=yield _.mn(a,b);if(c){var d=[],e=a.f.get(c);e&&a.A&&(e.Db=new _.Zm,d.push(e.Db));a.g.debug("Attempting to remove session",b);d.push(c.remove());return Promise.all(d)}a.g.debug("Ignoring attempt to remove missing session",b)})},Nx=function(a){a=a.f.keys();a=Hx(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
Ox=function(a,b){const c=_.ml(a),d=_.Sk({drm:a});d.drm=a;a=new _.co({Za:b,onError:()=>{},xe:()=>{},ve:()=>{},onEvent:()=>{},getConfiguration:()=>d,Ic:()=>null});a.h=c;return a},Rx=function(a,b,c){return _.x(function*(){const d=Px;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)Qx.debug(Dx,e);else{var g=Ox(a,c);try{yield Jx(g,b);yield _.kn(g);yield _.nn(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.Jj(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:Nx(g),
|
|
4
|
+
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw Qx.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Qx.debug(Ex)})},Ix=1,Kx=2,Sx=class{constructor(){this.g=new _.S(Gx)}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
|
+
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.g.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 Gx}};_.z("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.A(a)||(_.Qg(a.store)||c.push("store"),_.Qg(a.get)||c.push("get"),_.Qg(a.delete)||c.push("delete"),_.Qg(a.clear)||c.push("clear"),_.Qg(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw Qx.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});Px=a});
|
|
7
|
+
_.z("clpp.persistent.fetchLicense",function(a,b,...c){return _.x(function*(){var d=Px,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.Xn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Ex);var g=b.offlineId;if(typeof g!==_.Mf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Qx.debug(Dx,g);else{var h=_.Sk();d=new _.To;g=[];for(var k of c){const l=new k;_.Vk(l.id())||(l.f(),_.Xk(l),g.push(l))}k=null;try{k=yield _.hr(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(_.E,4,4014));const m=_.fr(l.periods);yield Rx(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(),_.Uk.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=Px;if(_.Sg(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.To,c=Ox(e.drmConfig,d),yield Lx(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.kn(c),yield Promise.all(e.sessionIds.map(f=>_.x(function*(){yield Mx(c,f);Qx.debug("successfully removed session with id",f)}))),yield b.delete(a)):Qx.debug("No persistent DRM session found")}catch(e){throw Qx.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 Qx.warn("Invalid offlineId")})});var Px=new Sx,Qx=new _.S(Fx);_.z("clpp.persistent.PersistentLicenseComponent",class extends _.Gt{constructor(){super();this.g=new _.S(Fx)}id(){return _.Ne}l(a,b){const c=this;return _.x(function*(){const d=a.getConfiguration().drm;if(d){c.g.debug(`Persisting DRM session ID: ${d.offlineId}`);var e=a.getNetworkEngine();try{yield Rx(d,b,e),a.trigger(new _.D(_.Nd,{offlineId:d.offlineId}))}catch(f){a.onError(f)}}else c.g.debug("No DRM configuration found for loaded source.")})}j(a){const b=this;return _.x(function*(){b.g.debug(`Getting EME session IDs for ${a}`);
|
|
11
|
+
const c=Px;try{const d=yield c.get(a);if(d)return d.sessionIds||[];b.g.debug(`No offline session found for ${a}`);return[]}catch(d){return b.g.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 Ax=function(a,b){return 0<=b&&b<a.a.length},Bx=function(a){a.trigger(new _.D(_.cf))},Cx=class extends _.Os{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.h=!1;this.j=this.rc.bind(this)}getPosition(){return this.f}Fg(){return this.a}$c(){return 0<this.a.length&&Ax(this,this.f)?this.a[this.f]:null}Gg(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&Ax(this,a)?this.a[a]:null}Pg(){return this.h}start(){this.h||(this.h=!0,this.m.on(_.Ud,this.j),this.Gd(this.f,!0))}stop(){this.h=!1;this.m.off(_.Ud,this.j)}rc(){this.next()}next(){const a=this;return _.x(function*(){yield a.Gd(Math.min(a.a.length-1,a.f+1))})}dh(){const a=this;return _.x(function*(){yield a.Gd(Math.max(0,a.f-1))})}Gd(a,b){b=void 0===b?!1:b;const c=this;return _.x(function*(){if(0<c.a.length&&Ax(c,a)&&(b||c.f!==a)){c.f=a;var d=c.$c();d&&(yield c.l(d),yield c.m.load(d.configuration),
|
|
3
|
+
c.trigger(new _.D(_.bf,{item:d})))}})}append(a){this.a.push(a);Bx(this)}Og(a,b){if(0<=b&&b<=this.a.length){const c=this.$c();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Bx(this)}}remove(a){if(0<this.a.length&&Ax(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Bx(this)}}clear(){this.stop();this.f=0;this.a=[];this.h=!1;Bx(this)}};_.z("clpp.Playlist",Cx);Cx.prototype.clear=Cx.prototype.clear;Cx.prototype.remove=Cx.prototype.remove;Cx.prototype.insert=Cx.prototype.Og;
|
|
4
|
+
Cx.prototype.append=Cx.prototype.append;Cx.prototype.goTo=Cx.prototype.Gd;Cx.prototype.previous=Cx.prototype.dh;Cx.prototype.next=Cx.prototype.next;Cx.prototype.onEnded=Cx.prototype.rc;Cx.prototype.stop=Cx.prototype.stop;Cx.prototype.start=Cx.prototype.start;Cx.prototype.isStarted=Cx.prototype.Pg;Cx.prototype.getUpcoming=Cx.prototype.Gg;Cx.prototype.getCurrent=Cx.prototype.$c;Cx.prototype.getQueue=Cx.prototype.Fg;Cx.prototype.getPosition=Cx.prototype.getPosition;Cx.prototype.off=Cx.prototype.off;
|
|
5
|
+
Cx.prototype.one=Cx.prototype.one;Cx.prototype.on=Cx.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.
|
|
7
|
-
_.
|
|
8
|
-
d);if(c.m&&c.m.getSurface()&&c.m.getSurface().getMedia()&&d.mediaDimensions){c.
|
|
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.
|
|
12
|
-
c&&(c=this.a,
|
|
13
|
-
this.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var jx="No surface found. Can not attach frame!",kx="SIMID:Media:timeupdate",lx="Starting creative",mx=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},px=function(a,b){return new Promise((c,d)=>{new nx(a.j,c,d,b);ox(a,b)})},qx=function(a){const b=mx(a,"SIMID:Player:startCreative",void 0);px(a,b).then(()=>{var c=a.f;c.g.info(lx);c.m.trigger(new _.D(_.Df));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.g.error("Error while starting creative",
|
|
2
|
+
c)})},sx=function(a,b){_.x(function*(){a.h=b.sessionId;rx(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=mx(a,"SIMID:Player:init",d);var e=px(a,f)}yield e;a.g.info("Player Init acknowledged");a.f.g.info("SIMID Player initialized")}catch(f){a.g.error("Error while initializing",f),a.f.g.error("Error while initializing SIMID player: ",f),a.unload()}})},rx=function(a,b){ox(a,mx(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},ox=function(a,b){a.h?(b.type!==kx&&a.g.info(`Posting message [${b.messageId}] '${b.type}':`,b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn(`WARNING: no session available to send message '${b.type}'`)},tx=function(a,b,c){return new ResizeObserver(()=>{if(a.a.h){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=mx(d,"SIMID:Player:resize",e);ox(d,e)}})},ux=function(a,b){a.g.info("SIMID Session created");a.a=b},vx=function(a){a.g.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.h=!1;a.m.trigger(new _.D(_.Ef))},wx=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}%`}},xx=class{constructor(a){this.f=a;this.h="";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.g.info(`Received message [${b.messageId}] '${b.type}':`,b.args),b.type){case "createSession":sx(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.g.info("Creative requested resize",
|
|
8
|
+
d);if(c.m&&c.m.getSurface()&&c.m.getSurface().getMedia()&&d.mediaDimensions){c.h?c.m.getSurface().getMedia().style.transition="":(c.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",c.h=!0);const e=wx(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=wx(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);rx(this,b)}else this.g.warn("WARNING: received message without 'type' property")};this.g=new _.S("clpp.simid.SimidPlayer");ux(this.f,this)}load(a){window.addEventListener(_.ue,this.o);this.h="";this.l=0;const b=this.f.url();this.g.info(`Loading "${b}" as src of iFrame`);this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)}unload(){vx(this.f);this.h=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)}},nx=class{constructor(a,b,c,d,e){e=void 0===e?-1:e;this.f=a;this.l=b;this.j=c;this.h=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.h.messageId);this.l(a)}reject(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f.delete(this.h.messageId);this.j(a)}};var zx=class extends _.iu{constructor(){super();this.g=new _.S("clpp.simid.Plugin");this.h=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.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new yx(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.g.info(`Setting up SIMID plugin for ${this.l.length} creatives`),
|
|
11
|
+
b=this.m.getSurface()){this.g.info("Creating new session");this.a=new xx(this.h);var c=b.getContainer();this.j=tx(this,c,b);this.j.observe(c);a.on(_.Tf,this.w)}else this.g.warn(jx)}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&&(qx(this.a),this.o=!0,this.g.info(lx)),
|
|
12
|
+
c&&(c=this.a,ox(c,mx(c,kx,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(jx),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.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.h.f=null))}},yx=class{constructor(a){this.m=a;this.a=null;this.g=new _.S("clpp.simid.Loader");
|
|
13
|
+
this.h=!1;this.f=null}release(){this.g.info("Releasing loader")}getContainer(){const a=this.getSurface().getContainer();if(!a)throw this.g.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.g.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:""}};_.Wo(new class{create(){return new zx}});};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.
|
|
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}})
|
|
11
|
-
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.
|
|
12
|
-
|
|
13
|
-
g;d=g.get(_.
|
|
14
|
-
|
|
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.
|
|
16
|
-
periodId:null}},
|
|
17
|
-
c.type=1;c=yield a.
|
|
18
|
-
1E7;let g=+
|
|
19
|
-
const ea=[],
|
|
20
|
-
|
|
21
|
-
+
|
|
22
|
-
new Uint16Array(1),
|
|
23
|
-
new _.H(_.
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
_.
|
|
28
|
-
{a.G.delete(k)})})}else a.
|
|
29
|
-
Math.min(a.a.
|
|
30
|
-
|
|
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?_.
|
|
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.
|
|
37
|
-
_.
|
|
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.
|
|
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);_.
|
|
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.
|
|
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&&(_.
|
|
55
|
-
0),_.
|
|
56
|
-
for(let c=0;c<this.
|
|
57
|
-
this.
|
|
58
|
-
0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b}
|
|
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 NP="Full MP4 box must have flags defined",OP="clpp.smooth.SmoothMP4Processor",PP="codecPrivateData",QP=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.O(a,c);_.O(a,b)},RP=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.pl()}},SP=function(a,b){RP(a,b>>16&255);RP(a,b>>8&255);RP(a,b&255)},TP=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.pl()}},UP=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.pl()}},VP=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.h),a.a+=2}catch(c){_.pl()}},WP=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},XP=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},YP=function(a,b,c,d){c=b.uf[c];b=b.yh;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 _.EB([a],[b])[0]},ZP=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.w?c=["maxWidth","maxHeight","bitrate",PP,"fourCC"]:a.type===_.p&&(c=["bitrate",PP,"channels","bitsPerSample","samplingRate","fourCC"]);return _.Ug(a,b,c,["id","segmentIndex"])},$P=function(a,b,c){const d=c.Cd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,cb:null,ac:null,width:NaN,height:NaN,Tb:null,qd:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.w:a.cb=[_.Bi(d[1])];a.ac=[_.Bi(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Tb=_.Bi(c.Cd),a.sampleSize=c.gg||16,a.qd=c.qd,a.channelCount=c.lf}return a},aQ=function(a,b){return a.filter(c=>c.type===b)},bQ=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)},iQ=function(a,b,c){var d=null;if(cQ.test(a)){{a=cQ.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 dQ.test(a)?d=bQ(dQ,a):eQ.test(a)?d=bQ(eQ,a):fQ.test(a)?(a=fQ.exec(a),d=Number(a[1])/c.frameRate):gQ.test(a)?(a=gQ.exec(a),d=Number(a[1])/c.a):hQ.test(a)&&(d=bQ(hQ,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},jQ=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Jl(b)},qQ=function(a,b,c){a:{var d=[_.yd,_.wd];for(e of d)if((d=c.Fd(e))&&d.keyId){var e=d.keyId;break a}_.B(OP,"Could not get default Key ID for DRM init data!");e=null}c=new kQ("xxxx");a.type===_.w?c=new lQ(a.width,a.height):c=new mQ(a.channelCount,a.sampleSize,a.qd);a=new nQ;a.h=1;a.j=8;a.o=e||"00000000000000000000000000000000";a=(new kQ("schi")).append([a]);b=(new kQ(_.Ff)).append([new oQ(b),new pQ(_.Zc,65536),a]);c.append([b]);return c},
|
|
7
|
+
TQ=function(a,b){var c=b.Hd(),d=new rQ(a.timescale,a.duration,a.id),e=(new sQ).append([new tQ(a.id)]),f=new uQ(a.id,a.duration,a.timescale,a.width,a.height),g=new vQ(a.timescale,a.duration);const h=new wQ(a.type);var k=null,l=new xQ;l.entries=[new yQ];var m=new zQ;switch(a.type){case _.w:k=new AQ(a.cb,a.ac);c?(a=qQ(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new BQ(a.width,a.height)).append([k]),m.entries=[a]);k=new CQ;break;case _.p:k=new DQ(a.Tb),c?(a=qQ(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new EQ(a.channelCount,a.sampleSize,a.qd)).append([k]),m.entries=[a]),k=new FQ}m=(new GQ).append([m,new HQ,new IQ,new JQ,new KQ]);l=(new LQ).append([l]);l=(new MQ).append([k,l,m]);g=(new NQ).append([g,h,l]);f=(new OQ).append([f,g]);d=(new PQ).append([d,f,e]);e=new QQ("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Fd(_.wd),b=b.Fd(_.yd),c&&d.append([new RQ("pssh",c.initData,8)]),b&&d.append([new RQ("pssh",b.initData,8)]),c||b||_.B(OP,"Could not get PSSH init data!"));b=new SQ([e,d]);return _.J(b.write())},
|
|
9
|
+
cR=function(a,b){let c,d,e,f,g,h;(new _.Hl).L("moof",_.Q).ba("mfhd",k=>{{const l=new UQ;l.h=_.P(k.reader);c=l}}).L("traf",_.Q).ba("tfhd",k=>{{const l=k.reader.Ja();if(null===k.flags)throw new _.H(_.E,3,3019,NP);const m=new VQ(k.version||0,k.flags||0);m.h=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.wl(k.reader));0<l-k.reader.getPosition()&&k.flags&2&&(m.C=_.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.Ja();if(null===k.flags)throw new _.H(_.E,3,3019,NP);const m=new WQ(k.version||0,k.flags||0);m.h=_.P(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.l=_.vl(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.h;l++)k.flags&256&&m.w.push(_.P(k.reader)),k.flags&512&&m.sampleSize.push(_.P(k.reader)),k.flags&1024&&m.C.push(_.P(k.reader)),k.flags&
|
|
11
|
+
2048&&(0===k.version?m.j.push(_.P(k.reader)):m.j.push(_.vl(k.reader)));e=m}}).ba("sdtp",k=>{{const l=_.yl(k.reader,k.reader.Ja());f=new XQ("sdtp",k.version||0,k.flags||0,l,0)}}).L("uuid",k=>{var l=_.yl(k.reader,16);if(_.Di(l,YQ)){l=_.P(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new ZQ(k.version,k.flags);l.j=_.P(k.reader);k.flags&1&&(l.l=_.tl(k.reader));for(let m=0;m<l.j;m++){const n={Ff:_.yl(k.reader,8),Rc:0,Ke:[]};if(k.flags&2){n.Rc=_.ul(k.reader);for(let r=0;r<n.Rc;r++){const v={jf:0,kf:0};
|
|
12
|
+
v.jf=_.ul(k.reader);v.kf=_.P(k.reader);n.Ke.push(v)}}l.h.push(n)}g=l}}).L(_.pe,k=>{{const l=new $Q;0<k.reader.Ja()?l.h=_.yl(k.reader,k.reader.Ja()):(_.B(OP,"mdat box is empty!"),l.h=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new aR).append([d,e]);f&&a.append([f]);b.Hd()&&g&&a.append([g]);b=(new bR).append([c,a]);return new SQ([b,h])},hR=function(a,b,c,d){var e=d.Hd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=cR(b,d);if(null===g)return a.request.contentType===_.G?a.data:
|
|
13
|
+
g;d=g.get(_.pe);if(a.request.contentType===_.G){e=d.h.buffer;if(c){e=_.ni(e);if((e=(new DOMParser).parseFromString(e,_.Sf))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new dR(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 v=0,u=f.length;v<u;v++){h=f[v];a=c;b=d;g=["begin",_.Td];for(let y=0,C=g.length;y<
|
|
14
|
+
C;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 F=l.length;for(;n<F;n++){var r=l[n].name;if(r=r.match(m)){k=k.getAttribute(r[0]);break b}}k=null}h.setAttribute(g[y],iQ(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.oi(e).buffer}else c=e;return c}h=new bR;a=g.get("mfhd");b=new aR;k=g.get("tfhd");m=new eR(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");k.h=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.h[m].Rc);else g=8;b.append([c,new fR,new gR(g,k,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new SQ([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},iR=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},jR=function(a){return{initData:_.rB(_.pm(a)),initDataType:_.Zc,keyId:a,periodId:null}},kR=function(a,b,c){a=_.xm(a);c&&a.version!==c&&(a=_.tB(a,c));return{initData:_.rB(a),initDataType:_.Zc,keyId:b,periodId:null}},lR=function(a,b){return _.x(function*(){var c=_.Oi(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.B.networkingEngine.fetch(c).O;a.l=c.uri;return c})},tR=function(a,b){let c=null;try{{const ea=new DOMParser;let bb,Oa;try{const jb=_.ni(b);Oa=ea.parseFromString(jb.trim(),_.Sf)}catch(jb){throw jb;}Oa&&Oa.documentElement.tagName===_.Ib&&(bb=Oa.documentElement);c=bb&&0<bb.getElementsByTagName("parsererror").length?null:bb}}catch(ea){}if(!c)throw a.g.error("Unable to parse manifest"),new _.H(_.E,4,4033,a.l);const d=+mR(a,c,"MajorVersion"),e=+mR(a,c,"MinorVersion"),f=+c.getAttribute("TimeScale")||
|
|
18
|
+
1E7;let g=+mR(a,c,"Duration");const h="TRUE"===c.getAttribute("IsLive"),k=+c.getAttribute("LookAheadCount"),l=+c.getAttribute("DVRWindowLength")||Infinity,m=_.jm(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+d+"."+e))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.H(_.E,4,4036,a.l);h?(nR(a,oR),a.A=typeof a.f.liveRefreshPeriod===_.t?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),g=Infinity):nR(a,pR);a.a={startTime:0,delay:0,duration:g/f,de:l/f,jd:0};if(m){{var n=a.f.playreadyVersion;
|
|
19
|
+
const ea=[],bb=_.jm(m,"ProtectionHeader")[0],Oa=_.Ai(_.lm(bb)||""),jb=_.xm(Oa).a;ea.push(iR(_.yd,jR(jb),[jb]));ea.push(iR(_.wd,kR(Oa,jb,n),[jb]));var r=ea}a.o=r}{const ea=[],bb=_.jm(c,"StreamIndex");if(!bb.length)throw a.g.error("No streams found!"),new _.H(_.E,4,4034,a.l);for(let Oa=0;Oa<bb.length;Oa++){{var v=a,u=bb[Oa];const jb=mR(v,u,"Type"),Qc=+u.getAttribute("Chunks"),Oh=u.getAttribute("Subtype"),re=u.getAttribute("Language")||_.Wf,se=_.Yh(re),Ph=u.getAttribute("Name")||"",qg=+u.getAttribute(_.gb),
|
|
20
|
+
rg=+u.getAttribute(_.fb),Cm=mR(v,u,"Url"),EU=+u.getAttribute("TimeScale")||null;{const Rc=[],wj=_.jm(u,_.zb);for(let te=0;te<wj.length;te++){{let Sc,Ka,Ld;var y=v,C=wj[te],F=jb;const xj=+C.getAttribute("Index"),sg=+mR(y,C,"Bitrate");let kc=NaN,tg=NaN,Dm=NaN,fs=NaN,lG=NaN,mG=NaN,nG=NaN;const oG=C.getAttribute("FourCC");switch(F){case _.w:kc=+mR(y,C,_.fb);tg=+mR(y,C,_.gb);break;case _.p:fs=+C.getAttribute("Channels")||2,Dm=+mR(y,C,"SamplingRate"),mG=+mR(y,C,"AudioTag"),lG=+mR(y,C,"BitsPerSample"),nG=
|
|
21
|
+
+mR(y,C,"PacketSize")}let gs=String(C.getAttribute("CodecPrivateData"));if(F===_.p&&!gs){{var N=fs;const pG={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},Em=pG[Dm];if("AACH"===oG){Ka=new Uint8Array(4);const qG=pG[2*Dm];Ka[0]=40|Em>>1;Ka[1]=Em<<7|N<<3|qG>>1;Ka[2]=qG<<7|8;Ka[3]=0;Sc=new Uint16Array(2);Sc[0]=(Ka[0]<<8)+Ka[1];Sc[1]=(Ka[2]<<8)+Ka[3];Ld=Sc[0].toString(16)+Sc[1].toString(16)}else Ka=new Uint8Array(2),Ka[0]=16|Em>>1,Ka[1]=Em<<7|N<<3,Sc=
|
|
22
|
+
new Uint16Array(1),Sc[0]=(Ka[0]<<8)+Ka[1],Ld=Sc[0].toString(16);gs=Ld.toUpperCase()}}var da={id:y.X++,type:F,index:xj,bitrate:sg,Cd:gs,maxHeight:kc,maxWidth:tg,qd:Dm,lf:fs,Eh:mG,gg:lG,Qh:nG,xg:oG,segmentIndex:null}}Rc.push(da)}var vb=Rc}{const Rc=[],wj=_.jm(u,"c");for(let te=0;te<wj.length;te++){const Sc=wj[te];let Ka=parseInt(Sc.getAttribute("t"),10),Ld=parseInt(Sc.getAttribute("d"),10),xj=parseInt(Sc.getAttribute("r"),10),sg=0;if(isNaN(Ka)&&isNaN(Ld))throw v.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
23
|
+
new _.H(_.E,4,4037,v.l);0===te&&isNaN(Ka)&&(sg=Ka=0);if(0<te){const kc=Rc[Rc.length-1];sg=kc.n+1;kc.d||(kc.d=Ka-kc.t);Ka||(Ka=kc.t+kc.d);Ld||(Ld=Ka-kc.t)}Rc.push({n:sg,d:Ld,t:Ka});if(xj){xj--;for(let kc=0;kc<xj;kc++){const tg=Rc[Rc.length-1];sg=tg.n+1;Ka=tg.t+tg.d;Ld=tg.d;Rc.push({n:sg,d:Ld,t:Ka})}}}v.D()||Rc.length===Qc||v.g.warn("Number of fragments ("+Qc+") differs from number of chunks ("+Rc.length+").");var Xb=Rc}var pd={type:jb,Hh:Qc,ph:Oh,language:se,hd:re,name:Ph,maxWidth:qg,maxHeight:rg,
|
|
24
|
+
yh:Cm,tracks:vb,uf:Xb,timescale:EU}}ea.push(pd)}var mg=ea}const Wa={Ph:d,Hf:e,timescale:f,duration:g,isLive:h,Oh:k,de:l,le:!1,streams:mg};if(a.h&&a.w)return qR(a,Wa),Promise.resolve();a.G.clear();{const ea=Wa.timescale,bb=Wa.duration,Oa=aQ(Wa.streams,_.p),jb=aQ(Wa.streams,_.w),Qc=aQ(Wa.streams,_.G),Oh=[];let re=rR(a,bb,ea,Oa),se=rR(a,bb,ea,jb);const Ph=rR(a,bb,ea,Qc);re.length||(re=[null]);se.length||(se=[null]);for(let qg=0;qg<se.length;qg++)for(let rg=0;rg<re.length;rg++)Oh.push(sR(a,se[qg],re[rg]));
|
|
25
|
+
var oe={id:"ID",configurationId:void 0,startTime:0,endTime:bb,variants:Oh,textStreams:Ph,thumbStreams:[]}}{var Mc=Wa.streams;let ea=a.a.startTime,bb=a.a.delay;const Oa=a.I;let jb=Math.min(a.a.duration||Infinity,Oa);const Qc=a.D(),Oh=a.a.de,re=a.a.jd,se=a.H,Ph=isFinite(a.F)?a.F:0;if(Qc)jb=Infinity,ea=Date.now()/1E3-re,a.a.startTime=ea,bb=3*se;else{const qg=isFinite(Oa)?Oa:a.a.duration;for(const rg of Mc)for(const Cm of rg.tracks)Cm.segmentIndex.offset(-Ph),_.eC(Cm.segmentIndex,qg)}a.C=new _.HI(a.f.timeline||
|
|
26
|
+
{},ea,bb,!Qc,!0);a.C.h=jb;_.tC(a.C,se);a.C.A=Oh;Qc||a.C.offset(-Ph)}a.B.filterAllPeriods([oe]);a.h={presentationTimeline:a.C,periods:[oe],minBufferTime:0};Promise.resolve();a.K||(a.B.networkingEngine.Sc(a.M),a.K=!0);a.w=Wa;return Promise.resolve()},uR=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.ob.bind(a),b))},mR=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.H(_.E,4,4038,a.l,c);},nR=function(a,b){const c=b===pR;a.h&&a.h.presentationTimeline&&
|
|
27
|
+
_.oC(a.h.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.N=b},qR=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){ZP(g,c)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var d=vR(a,a.w.timescale,f,c);c=g.segmentIndex;_.GC(c,d);(d=a.a.de)&&_.HC(c,_.EC(c)-d).forEach(h=>{h.Qa().forEach(k=>
|
|
28
|
+
{a.G.delete(k)})})}else a.g.warn(`Cannot find satisfying update for ${g.type} `+`track with bitrate ${g.bitrate}. Skipping update.`)}}},vR=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.uf.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=YP(a.l,c,k,d);a.H=Math.max(a.H,l);f.push(new _.FC(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.jd?a.a.jd=b.endTime:a.a.jd=
|
|
29
|
+
Math.min(a.a.jd,b.endTime);return f},rR=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=vR(a,c,k,h);const da=new _.II(l);var m=null;k.type!==_.G&&(m=wR(a,b,c,k,h));h.segmentIndex=da;l=_.MI++;var n=Promise.resolve.bind(Promise),r=da.f.bind(da),v=da.get.bind(da),u=da.h.bind(da),y=da.getDuration.bind(da),C=xR[k.type];var F="";switch(k.type){case _.w:F=h.Cd;var N=/00000001[0-9]7/.exec(F);F="avc1."+(N&&N[0]?F.substr(F.indexOf(N[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",
|
|
30
|
+
F);break;case _.p:F=h.Cd,N=2,"AACH"===h.xg?N=5:F&&(N=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+N,a.g.debug("AUDIO CODECS: ",F)}N=k.type===_.G?yR[k.ph]:void 0;h={id:l,originalId:null,Sh:null,createSegmentIndex:n,findSegmentPosition:r,getSegmentReference:v,adjustSegmentDurations:u,getDuration:y,segmentIndex:da,segmentLookupStrategy:_.sA,initSegmentReference:m,mimeType:C,codecs:F,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:N,encrypted:a.J(),keyId:null,
|
|
31
|
+
language:k.language,originalLanguage:k.hd,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.lf||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},sR=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Wf;return c||b?{id:a.S++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},wR=function(a,b,c,d,e){b=$P(b,d.timescale||c,e);c={isLive:a.D.bind(a),
|
|
32
|
+
Hd:a.J.bind(a),Dg:()=>1,Fd:a.R.bind(a)};d=new Uint8Array(0);try{d=TQ(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.H(_.E,3,4035,g);}const f="data:text/plain;base64,"+_.zi(d);return new _.EI(()=>[f],0,null,null,!0)},kQ=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);_.ql(a,WP(this.type));this.size>b&&QP(a,this.size);"uuid"===this.type&&_.ql(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()}},zR=class extends kQ{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);RP(a,this.version);SP(a,this.flags)}},RQ=class extends kQ{constructor(a,b,c){super(a);this.h=b;this.offset=c}a(){return this.h.byteLength+super.a()-this.offset}write(a){super.write(a);_.ql(a,this.h,this.offset);a.getPosition()}},XQ=class extends zR{constructor(a,b,c,d,e){super(a,b,c);this.h=d;this.offset=e}a(){return this.h.byteLength+super.a()-
|
|
35
|
+
this.offset}write(a){super.write(a);_.ql(a,this.h,this.offset);a.getPosition()}},QQ=class extends kQ{constructor(a,b,c){super("ftyp");this.j=a;this.Hf=b;this.h=c}a(){let a=this.j.length;a=a+4+this.h.join("").length;return a+super.a()}write(a){super.write(a);_.ql(a,WP(this.j));_.O(a,this.Hf);_.ql(a,WP(this.h.join("")));a.getPosition()}},PQ=class extends kQ{constructor(){super(_.ye)}},OQ=class extends kQ{constructor(){super(_.Uf)}},rQ=class extends zR{constructor(a,b,c){super("mvhd",1,0);this.timescale=
|
|
36
|
+
a;this.duration=b;this.volume=256;this.j=c+1;this.h=[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.h.length;return a+=super.a()}write(a){super.write(a);1===this.version?(QP(a,0),QP(a,0),_.O(a,this.timescale),QP(a,this.duration*this.timescale)):(_.O(a,0),_.O(a,0),_.O(a,this.timescale),_.O(a,this.duration*this.timescale));_.O(a,65536);TP(a,this.volume);TP(a,0);_.O(a,0);_.O(a,0);for(let b=0;b<this.h.length;b++)RP(a,this.h[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()}},sQ=class extends kQ{constructor(){super("mvex")}},tQ=class extends zR{constructor(a){super("trex",0,0);this.h=a}a(){return 20+super.a()}write(a){super.write(a);_.O(a,this.h);_.O(a,1);_.O(a,0);_.O(a,0);_.O(a,0);a.getPosition()}},uQ=class extends zR{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.h=[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.h.length;return a+super.a()}write(a){super.write(a);1===this.version?(QP(a,0),QP(a,0),_.O(a,this.j),_.O(a,0),QP(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);TP(a,0);TP(a,0);TP(a,this.volume);TP(a,0);for(let b=0;b<this.h.length;b++)RP(a,this.h[b]);TP(a,this.width);TP(a,0);TP(a,this.height);TP(a,0);a.getPosition()}},vQ=class extends zR{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?(QP(a,0),QP(a,0),_.O(a,this.timescale),QP(a,this.duration*this.timescale)):(_.O(a,0),_.O(a,0),_.O(a,this.timescale),_.O(a,this.duration*this.timescale));TP(a,this.language);TP(a,0);a.getPosition()}},wQ=class extends zR{constructor(a){super("hdlr",0,0);this.h=a}a(){return 33+super.a()}write(a){super.write(a);_.O(a,0);this.h===
|
|
40
|
+
_.w?_.ql(a,WP("vide")):_.ql(a,WP("soun"));_.O(a,0);_.O(a,0);_.O(a,0);this.h===_.w?_.ql(a,WP("VideoHandler\x00")):_.ql(a,WP("SoundHandler\x00"));a.getPosition()}},CQ=class extends zR{constructor(){super("vmhd",0,1);this.h=new Uint8Array([0,0,0,0,0,0])}a(){return 2+this.h.byteLength+super.a()}write(a){super.write(a);TP(a,0);_.ql(a,this.h);a.getPosition()}},AR=class extends kQ{constructor(a){super(a);this.A=!0}a(){return 8+super.a()}write(a){super.write(a);_.O(a,0);TP(a,0);TP(a,1)}},BR=class extends AR{constructor(a){super(a);
|
|
41
|
+
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);TP(a,0);TP(a,0);_.O(a,0);_.O(a,0);_.O(a,0);TP(a,this.width);TP(a,this.height);_.O(a,4718592);_.O(a,4718592);_.O(a,0);TP(a,1);RP(a,10);_.ql(a,WP("AVC Coding",31));TP(a,this.depth);VP(a,-1)}},CR=class extends AR{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);TP(a,this.channelCount);TP(a,this.sampleSize);VP(a,0);
|
|
42
|
+
TP(a,0);TP(a,this.sampleRate);TP(a,0)}},BQ=class extends BR{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()}},lQ=class extends BQ{constructor(a,b){super(a,b);this.type=_.kA}},EQ=class extends CR{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()}},mQ=class extends EQ{constructor(a,b,c){super(a,b,c);this.type="enca"}},AQ=
|
|
43
|
+
class extends kQ{constructor(a,b){super("avcC");this.cb=a;this.ac=b;this.version=1;this.h=this.cb[0][1];this.j=this.cb[0][2];this.level=this.cb[0][3]}a(){let a=7;for(var b=0;b<this.cb.length;b++)a+=2,a+=this.cb[b].byteLength;for(b=0;b<this.cb.length;b++)a+=2,a+=this.ac[b].byteLength;return a+super.a()}write(a){super.write(a);RP(a,this.version);RP(a,this.h);RP(a,this.j);RP(a,this.level);RP(a,255);RP(a,224|this.cb.length);for(var b=0;b<this.cb.length;b++)TP(a,this.cb[b].length),_.ql(a,this.cb[b]);RP(a,
|
|
44
|
+
this.ac.length);for(b=0;b<this.ac.length;b++)TP(a,this.ac[b].length),_.ql(a,this.ac[b]);a.getPosition()}},DQ=class extends zR{constructor(a){super("esds",0,0);this.Tb=a}a(){return 22+(this.Tb.byteLength+3)+super.a()}write(a){super.write(a);RP(a,3);RP(a,23+this.Tb.byteLength);TP(a,1);RP(a,0);RP(a,4);RP(a,15+this.Tb.byteLength);RP(a,64);RP(a,21);SP(a,0);_.O(a,0);_.O(a,0);RP(a,5);RP(a,this.Tb.byteLength);_.ql(a,this.Tb);_.ql(a,new Uint8Array([6,1,2]));a.getPosition()}},yQ=class extends zR{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&&_.ql(a,WP(this.location));a.getPosition()}},xQ=class extends zR{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()}},GQ=class extends kQ{constructor(){super(_.Lf)}},zQ=class extends zR{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()}},HQ=class extends zR{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
|
+
IQ=class extends zR{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()}},KQ=class extends zR{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()}},JQ=class extends zR{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.O(a,0);_.O(a,0);a.getPosition()}},FQ=class extends zR{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);VP(a,0);TP(a,0);a.getPosition()}},LQ=class extends kQ{constructor(){super("dinf")}},MQ=class extends kQ{constructor(){super(_.xe)}},NQ=class extends kQ{constructor(){super(_.qe)}},eR=class extends zR{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?QP(a,this.baseMediaDecodeTime):_.O(a,this.baseMediaDecodeTime);a.getPosition()}},UQ=class extends zR{constructor(){super("mfhd",0,0);this.h=0}a(){return 4+super.a()}write(a){super.write(a);_.O(a,this.h);a.getPosition()}},WQ=class extends zR{constructor(a,b){super("trun",a,b);this.o=this.l=this.h=0;this.w=[];this.sampleSize=[];this.C=[];this.j=[]}a(){let a=4;this.flags&DR&&(a+=4);this.flags&ER&&(a+=
|
|
50
|
+
4);for(let b=0;b<this.h;b++)this.flags&FR&&(a+=4),this.flags&GR&&(a+=4),this.flags&HR&&(a+=4),this.flags&IR&&(a+=4);return a+super.a()}write(a){super.write(a);_.O(a,this.h);this.flags&DR&&(a.getPosition(),UP(a,this.l));this.flags&ER&&_.O(a,this.o);for(let b=0;b<this.h;b++)this.flags&FR&&_.O(a,this.w[b]),this.flags&GR&&_.O(a,this.sampleSize[b]),this.flags&HR&&_.O(a,this.C[b]),this.flags&IR&&(0===this.version?_.O(a,this.j[b]):UP(a,this.j[b]));a.getPosition()}},DR=1,ER=4,FR=256,GR=512,HR=1024,IR=2048,
|
|
51
|
+
VQ=class extends zR{constructor(a,b){super("tfhd",a,b);this.h=255;this.o=this.w=this.l=this.C=this.j=0}a(){let a=4;this.flags&JR&&(a+=8);this.flags&KR&&(a+=4);this.flags&LR&&(a+=4);this.flags&MR&&(a+=4);this.flags&NR&&(a+=4);return a+super.a()}write(a){super.write(a);_.O(a,this.h);this.flags&JR&&QP(a,this.j);this.flags&KR&&_.O(a,this.C);this.flags&LR&&_.O(a,this.l);this.flags&MR&&_.O(a,this.w);this.flags&NR&&_.O(a,this.o);a.getPosition()}},JR=1,KR=2,LR=8,MR=16,NR=32,aR=class extends kQ{constructor(){super("traf")}},
|
|
52
|
+
bR=class extends kQ{constructor(){super("moof")}},$Q=class extends kQ{constructor(){super(_.pe);this.h=new Uint8Array(0)}a(){return this.h.byteLength+super.a()}write(a){super.write(a);0<this.h.byteLength&&_.ql(a,this.h)}},nQ=class extends zR{constructor(){super("tenc",0,0);this.h=1;this.j=8;this.o="";this.l=[]}a(){let a;a=20;1===this.h&&0===this.j&&(a=a+1+this.l.length);return a+super.a()}write(a){super.write(a);RP(a,0);0===this.version?RP(a,0):RP(a,0);RP(a,this.h);RP(a,this.j);_.ql(a,_.Bi(this.o));
|
|
53
|
+
if(1===this.h&&0===this.j){RP(a,0);for(let b=0;b<this.l.length;b++)RP(a,this.l[b])}a.getPosition()}},pQ=class extends zR{constructor(a,b){super("schm",0,0);this.h=a;this.j=b;this.Nb=""}a(){let a=8;this.flags&1&&(a+=WP(this.Nb).byteLength);return a+super.a()}write(a){super.write(a);_.ql(a,WP(this.h));_.O(a,this.j);this.flags&1&&_.ql(a,WP(this.Nb));a.getPosition()}},oQ=class extends kQ{constructor(a){super("frma");this.h=a}a(){return WP(this.h).byteLength+super.a()}write(a){super.write(a);_.ql(a,WP(this.h));
|
|
54
|
+
a.getPosition()}},fR=class extends zR{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]):QP(a,this.offset[b]);a.getPosition()}},gR=class extends zR{constructor(a,b,c){super("saiz",0,0);this.h=a;this.l=b;this.j=c}a(){let a=0;this.flags&1&&(a+=8);a+=5;0===this.h&&(a+=this.l.length);
|
|
55
|
+
return a+super.a()}write(a){super.write(a);this.flags&1&&(_.O(a,0),_.O(a,0));RP(a,this.h);_.O(a,this.j);if(0===this.h)for(let b=0;b<this.j;b++)RP(a,this.l[b]);a.getPosition()}},ZQ=class extends zR{constructor(a,b){super("senc",a,b);this.j=0;this.l=8;this.h=[]}a(){let a=4;this.flags&1&&(a+=1);for(let b=0;b<this.j;b++)if(a+=this.h[b].Ff.byteLength,this.flags&2){a+=2;for(let c=0;c<this.h[b].Rc;c++)a+=2,a+=4}return a+super.a()}write(a){super.write(a);_.O(a,this.j);this.flags&1&&RP(a,this.l);for(let b=
|
|
56
|
+
0;b<this.j;b++)if(_.ql(a,this.h[b].Ff),this.flags&2){TP(a,this.h[b].Rc);for(let c=0;c<this.h[b].Rc;c++)TP(a,this.h[b].Ke[c].jf),_.O(a,this.h[b].Ke[c].kf)}a.getPosition()}};var dR=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))}},cQ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,dQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,eQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,fQ=/^(\d*\.?\d*)f$/,gQ=/^(\d*\.?\d*)t$/,hQ=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var SQ=class{constructor(a){this.a=a;this.f=jQ(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=jQ(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var YQ=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var OR=class{constructor(){this.w=this.h=this.f=this.B=null;this.S=1;this.X=0;this.l="";this.C=this.a=null;this.g=new _.S("clpp.smooth.SmoothParser");this.K=!1;this.j=this.A=null;this.N=pR;this.H=0;this.F=this.I=Infinity;this.o=[];this.M=this.T.bind(this);this.G=new Map}configure(a){this.f=a}start(a,b){this.B=b;a=[...new Set([a,XP(a)])];return lR(this,a).then(c=>tR(this,c.data).then(()=>{uR(this,this.A);return this.h}))}requestStop(){}stop(){this.B&&this.B.networkingEngine.Ud(this.M);this.A=this.w=
|
|
57
|
+
this.h=this.f=this.B=null;this.j&&(clearTimeout(this.j),this.j=null);this.K=!1;this.I=this.F=Infinity;return Promise.resolve()}update(){if(this.D())return lR(this,[this.l]).then(a=>tR(this,a.data).then(()=>this.h)).catch(a=>{if(this.B)this.B.onError(a)})}setCurrentVariant(){}ob(){this.g.debug(_.Cz);this.B&&(this.j=null,this.update().then(()=>{uR(this,this.A)}).catch(a=>{this.B&&(this.B.onError(a),1===a.severity&&uR(this,100))}))}D(){return this.N===oR}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.D.bind(this),Hd:this.J.bind(this),Dg:()=>1,Fd:this.R.bind(this)};let d=!1;const e=new _.H(_.E,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.g.debug(`Using base media decode time ${g} instead of `+
|
|
59
|
+
`segment reference time ${a.request.startTime}`);f=hR(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)}},xR={video:_.gg,audio:_.Ic,text:_.Cc},pR=_.Sb,oR="LIVE",yR={zh:_.Xz,Bh:_.dB};_.z("clpp.smooth.SmoothComponent",class extends _.Gt{f(){_.kr.ism=OR;_.ir[_.Dc]=OR}a(){_.dD("ism");_.eD(_.Dc)}id(){return _.Gf}});};f.call(g, window);
|