@castlabs/prestoplay 6.14.0 → 6.15.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 +25 -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 +113 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +550 -529
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +74 -73
- package/cjs/cl.externs.js +191 -64
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -68
- 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 +290 -275
- package/cjs/cl.muxdata.js +15 -15
- 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 +72 -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 +89 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +457 -438
- package/cl.crypto.js +9 -9
- package/cl.dash.js +70 -68
- package/cl.externs.js +187 -64
- 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 +255 -240
- 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/clpp.styles.css +2 -0
- package/package.json +1 -1
- package/typings.d.ts +387 -90
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
|
-
{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.
|
|
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 _.
|
|
13
|
-
_.
|
|
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},$x=function(a){let b={debug:!0,data:Zx(a)};a.f&&a.f.muxOptionsOverride&&_.Og(a.f.muxOptionsOverride)&&(b=_.Kg(b,a.f.muxOptionsOverride));b=_.Kg(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 _.El(c.url);e.video_source_url=_.gj(k);e.video_source_mime_type=c.type;c.name&&(e.video_title=c.name)}if(c=f.getContainer())e.player_width=c.offsetWidth,e.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().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},ay=function(a){_.kh(a.a);a.j.Hd(a.F);a.j.Ef(a.C)},Zx=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},by=function(a){a.a.on(a.m,_.Sf,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.Sf,b)});a.a.on(a.m,_.Re,()=>a.emit(_.Re));a.a.on(a.m,_.Qc,a.G.bind(a));a.a.on(a.m,_.If,a.I.bind(a));a.a.on(a.m,_.fg,()=>a.emit(_.Bf));a.a.on(a.m,_.eg,()=>a.emit(_.Af));a.a.on(a.m,_.Vd,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,()=>
|
|
5
|
+
{a.emit("adplay");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,_.hc,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.kc,()=>a.emit("admidpoint"));a.a.on(a.m,_.rc,()=>a.emit("adthirdquartile"));a.j.Gc(a.F);a.j.Ne(a.C);a.a.on(a.m,_.Vd,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 _.El(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 _.El(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)}}}})},cy=function(a){return!_.z(a)&&typeof a.init===_.Yd&&typeof a.emit===_.Yd},Tx="manifest",Ux="media",Vx="encryption",Xx=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var dy=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 _.as;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,$x(this))}catch(d){throw this.g=!1,ay(this),new _.G(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=Zx(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);by(this)}release(){this.h.debug("release()");this.l?this.h.debug(_.ja):(ay(this),this.l=!0,this.o=this.f=null)}destroy(){this.h.debug(_.Ed);this.A?this.h.debug(_.ia):(this.A=!0,this.emit("destroy"))}emit(a,b){if(null===this.w)throw new _.G(1,9,9301);this.w.emit(this.B,a,b)}G(a){this.h.debug(_.Ee);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Ia())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.h.debug(_.Ie);
|
|
9
|
+
switch(a.detail.currentState){case _.Rn:this.m.getConfiguration().autoplay&&this.emit(_.Re);break;case _.Tn:this.emit(_.bf);break;case _.Sn:this.emit(_.Ne);break;case _.In:this.emit(_.Ud)}}H(a){this.h.debug(_.Fe);if(this.g&&(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(_.Vd,{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 _.El(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:_.gj(d)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}K(a){a.requestStartTimestamp=Date.now()}};var ey=class extends _.hu{constructor(){super();this.f=this.m=null;this.a=!1;this.h=new _.Q("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new dy(a,this.h)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.Lg(c.muxdata);try{var d=[];typeof c===_.De&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.G(1,9,9300,{missingKeys:d});{const f=a.getConfiguration();d=null;if(this.a=!_.z(f.muxdata)&&typeof f.muxdata===_.De){const g=f.muxdata;d=cy(g.muxLib)?g.muxLib:window.mux;if(!cy(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.G(1,9,9301);this.V(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.V(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.V(this.m,c),c;}}V(a,b){a.trigger(new _.C(_.Vd,{detail:b}))}};
|
|
13
|
+
_.x("clpp.muxdata.MuxDataPlugin",ey);ey.prototype.emit=ey.prototype.emit;ey.Id="mux";_.Vo(new class{create(){return new ey}});};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;_.ri(c,"/")||(c+="/");const d=g=>g&&(_.qi(g,"https://")||_.qi(g,"http://")||_.qi(g,"//"))?g:`${c}${g}`,e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");b=d(b.fairplayUrl||"fairplay");a=new _.Ss(a);a.La(_.yd,{licenseUrl:e,videoRobustness:[_.Eb,void 0],audioRobustness:[_.Db,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Wl,licenseResponse:_.Xl}});a.La(_.ud,{licenseUrl:b,
|
|
2
|
+
certificateUrl:b,modifiers:{licenseRequest:_.Zl,licenseResponse:_.$l,extractContentId:_.am,certificateRequest:_.bm}});a.La(_.wd,{licenseUrl:f,modifiers:{licenseRequest:_.Wl}});_.il(a)};
|
|
3
|
+
_.x("clpp.onboard.OnboardComponent",class extends _.Ft{constructor(){super();this.h=new _.Q("clpp.onboard");this.j=new Set}a(){for(const a of this.j)delete _.hl[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 _.
|
|
9
|
-
_.
|
|
10
|
-
new _.
|
|
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 _.Vm(a,b)},Kx=function(a,b,c,d,e,f){a.I=Jx;const g=new Map,h=_.Fm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Ke,persistentState:_.tf,sessionTypes:[_.Pe],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,
|
|
2
|
+
distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Um(a,g)},Lx=function(a,b){return _.w(function*(){const c=yield _.ln(a,b);if(c){var d=[],e=a.f.get(c);e&&a.A&&(e.pb=new _.Ym,d.push(e.pb));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=_.kl(a),d=_.Qk({drm:a});d.drm=a;a=new _.bo({nb:b,onError:()=>{},oe:()=>{},ne:()=>{},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 _.jn(g);yield _.mn(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.Ij(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 _.G(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Px.debug(Dx)})},Hx=1,Jx=2,Rx=class{constructor(){this.h=new _.Q(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)||(_.Pg(a.store)||c.push("store"),_.Pg(a.get)||c.push("get"),_.Pg(a.delete)||c.push("delete"),_.Pg(a.clear)||c.push("clear"),_.Pg(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw Px.warn("Invalid session storage implementation"),new _.G(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 _.G(1,6,6200,l,m);const f=_.Wn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Dx);var g=b.offlineId;if(typeof g!==_.Lf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Px.debug(Cx,g);else{var h=_.Qk();d=new _.So;g=[];for(var k of c){const l=new k;_.Tk(l.id())||(l.f(),_.Vk(l),g.push(l))}k=null;try{k=yield _.gr(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 _.G(_.E,4,4014));const m=_.er(l.periods);yield Qx(b,m,d)}catch(l){if(l instanceof _.G&&6200===l.code)throw l;throw e(null,l);}finally{for(;g.length;)e=g.shift(),e.a(),_.Sk.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(_.Rg(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.So,c=Nx(e.drmConfig,d),yield Kx(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.jn(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 _.G(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 _.Q(Ex);_.x("clpp.persistent.PersistentLicenseComponent",class extends _.Ft{constructor(){super();this.h=new _.Q(Ex)}id(){return _.Oe}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(_.Nd,{offlineId:d.offlineId}))}catch(f){a.onError(f)}}else c.h.debug("No DRM configuration found for loaded source.")})}j(a){const b=this;return _.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 zx=function(a,b){return 0<=b&&b<a.a.length},Ax=function(a){a.trigger(new _.C(_.df))},Bx=class extends _.Ns{on(a,b,c){return super.on(a,b,c)}one(a,b,c){return super.one(a,b,c)}off(a,b){return super.off(a,b)}constructor(a,b){b=void 0===b?()=>Promise.resolve():b;super();this.m=a;this.l=b;this.f=0;this.a=[];this.g=!1;this.j=this.ic.bind(this)}getPosition(){return this.f}Cg(){return this.a}Pc(){return 0<this.a.length&&zx(this,this.f)?this.a[this.f]:null}Dg(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&zx(this,a)?this.a[a]:null}Mg(){return this.g}start(){this.g||(this.g=!0,this.m.on(_.Ud,this.j),this.vd(this.f,!0))}stop(){this.g=!1;this.m.off(_.Ud,this.j)}ic(){this.next()}next(){const a=this;return _.w(function*(){yield a.vd(Math.min(a.a.length-1,a.f+1))})}dh(){const a=this;return _.w(function*(){yield a.vd(Math.max(0,a.f-1))})}vd(a,b){b=void 0===b?!1:b;const c=this;return _.w(function*(){if(0<c.a.length&&zx(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(_.cf,{item:d})))}})}append(a){this.a.push(a);Ax(this)}Lg(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&&zx(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.Lg;
|
|
4
|
+
Bx.prototype.append=Bx.prototype.append;Bx.prototype.goTo=Bx.prototype.vd;Bx.prototype.previous=Bx.prototype.dh;Bx.prototype.next=Bx.prototype.next;Bx.prototype.onEnded=Bx.prototype.ic;Bx.prototype.stop=Bx.prototype.stop;Bx.prototype.start=Bx.prototype.start;Bx.prototype.isStarted=Bx.prototype.Mg;Bx.prototype.getUpcoming=Bx.prototype.Dg;Bx.prototype.getCurrent=Bx.prototype.Pc;Bx.prototype.getQueue=Bx.prototype.Cg;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.
|
|
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 ix="No surface found. Can not attach frame!",jx="SIMID:Media:timeupdate",kx="Starting creative",lx=function(a,b,c){return{type:b,sessionId:a.g,messageId:a.l++,timestamp:Date.now(),args:c}},ox=function(a,b){return new Promise((c,d)=>{new mx(a.j,c,d,b);nx(a,b)})},px=function(a){const b=lx(a,"SIMID:Player:startCreative",void 0);ox(a,b).then(()=>{var c=a.f;c.h.info(kx);c.m.trigger(new _.C(_.Df));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.h.error("Error while starting creative",
|
|
2
|
+
c)})},rx=function(a,b){_.w(function*(){a.g=b.sessionId;qx(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=lx(a,"SIMID:Player:init",d);var e=ox(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()}})},qx=function(a,b){nx(a,lx(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},nx=function(a,b){a.g?(b.type!==jx&&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}'`)},sx=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=lx(d,"SIMID:Player:resize",e);nx(d,e)}})},tx=function(a,b){a.h.info("SIMID Session created");a.a=b},ux=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(_.Ef))},vx=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}%`}},wx=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=_.Ce;this.a.style.backgroundColor="transparent";this.a.style.transition="opacity .5s";this.a.style.transitionDelay=".5s";this.a.style.pointerEvents=
|
|
7
|
+
_.Ce;this.a.style.overflow=_.$d;this.a.classList.add(_.dd);this.o=b=>{if(b.source===this.a.contentWindow&&(b=(b=b.data)?typeof b===_.Lf?JSON.parse(b):b:null))if(b.type)switch(this.h.info(`Received message [${b.messageId}] '${b.type}':`,b.args),b.type){case "createSession":rx(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=vx(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=vx(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);qx(this,b)}else this.h.warn("WARNING: received message without 'type' property")};this.h=new _.Q("clpp.simid.SimidPlayer");tx(this.f,this)}load(a){window.addEventListener(_.ve,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(){ux(this.f);this.g=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.ve,
|
|
10
|
+
this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},mx=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 yx=class extends _.hu{constructor(){super();this.h=new _.Q("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 xx(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 wx(this.g);var c=b.getContainer();this.j=sx(this,c,b);this.j.observe(c);a.on(_.Sf,this.w)}else this.h.warn(ix)}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&&(px(this.a),this.o=!0,this.h.info(kx)),
|
|
12
|
+
c&&(c=this.a,nx(c,lx(c,jx,{currentTime:a-b}))))):((a=this.m.getSurface())||this.h.warn(ix),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(_.Sf,this.w),this.f&&(this.a.unload(),this.f=this.g.f=null))}},xx=class{constructor(a){this.m=a;this.a=null;this.h=new _.Q("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 _.G(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 _.G(1,10,10100,"No surface");return a}url(){return this.f?this.f.url:""}};_.Vo(new class{create(){return new yx}});};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=_.
|
|
11
|
-
2048&&(0===k.version?m.j.push(_.
|
|
12
|
-
|
|
13
|
-
g;d=g.get(_.
|
|
14
|
-
A;y++){b:{var k=h;var l=g[y],m=new RegExp("\\w+:"+l),n=0;if(k.hasAttribute(l)){k=k.getAttribute(l);break b}l=k.attributes;const D=l.length;for(;n<D;n++){var q=l[n].name;if(q=q.match(m)){k=k.getAttribute(q[0]);break b}}k=null}h.setAttribute(g[y],
|
|
15
|
-
m,f]);n&&b.append([n]);if(e){g=0;k=[];if(c.flags&2)for(k=[],m=0;m<c.j;m++)k.push(10+6*c.
|
|
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 _.
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
a.
|
|
28
|
-
{a.G.delete(k)})})}else a.
|
|
29
|
-
Math.min(a.a.
|
|
30
|
-
D);break;case _.p:D=h.
|
|
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.
|
|
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.
|
|
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)
|
|
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&&(_.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.
|
|
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 eM="Full MP4 box must have flags defined",fM="clpp.smooth.SmoothMP4Processor",gM="codecPrivateData",hM=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.N(a,c);_.N(a,b)},iM=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.nl()}},jM=function(a,b){iM(a,b>>16&255);iM(a,b>>8&255);iM(a,b&255)},kM=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.nl()}},lM=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.nl()}},mM=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.g),a.a+=2}catch(c){_.nl()}},nM=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},oM=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},pM=function(a,b,c,d){c=b.df[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 _.Zy([a],[b])[0]},qM=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.t?c=["maxWidth","maxHeight","bitrate",gM,"fourCC"]:a.type===_.p&&(c=["bitrate",gM,"channels","bitsPerSample","samplingRate","fourCC"]);return _.Tg(a,b,c,["id","segmentIndex"])},rM=function(a,b,c){const d=c.qd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ma:null,Qb:null,width:NaN,height:NaN,Ib:null,ed:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.t:a.Ma=[_.Ai(d[1])];a.Qb=[_.Ai(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.p:a.Ib=_.Ai(c.qd),a.sampleSize=c.dg||16,a.ed=c.ed,a.channelCount=c.We}return a},sM=function(a,b){return a.filter(c=>c.type===b)},tM=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)},AM=function(a,b,c){var d=null;if(uM.test(a)){{a=uM.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 vM.test(a)?d=tM(vM,a):wM.test(a)?d=tM(wM,a):xM.test(a)?(a=xM.exec(a),d=Number(a[1])/c.frameRate):yM.test(a)?(a=yM.exec(a),d=Number(a[1])/c.a):zM.test(a)&&(d=tM(zM,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},BM=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Il(b)},IM=function(a,b,c){a:{var d=[_.yd,_.wd];for(e of d)if((d=c.ud(e))&&d.keyId){var e=d.keyId;break a}_.B(fM,"Could not get default Key ID for DRM init data!");e=null}c=new CM("xxxx");a.type===_.t?c=new DM(a.width,a.height):c=new EM(a.channelCount,a.sampleSize,a.ed);a=new FM;a.g=1;a.j=8;a.o=e||"00000000000000000000000000000000";a=(new CM("schi")).append([a]);b=(new CM(_.Ff)).append([new GM(b),new HM(_.Zc,65536),a]);c.append([b]);return c},
|
|
7
|
+
kN=function(a,b){var c=b.wd(),d=new JM(a.timescale,a.duration,a.id),e=(new KM).append([new LM(a.id)]),f=new MM(a.id,a.duration,a.timescale,a.width,a.height),g=new NM(a.timescale,a.duration);const h=new OM(a.type);var k=null,l=new PM;l.entries=[new QM];var m=new RM;switch(a.type){case _.t:k=new SM(a.Ma,a.Qb);c?(a=IM(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new TM(a.width,a.height)).append([k]),m.entries=[a]);k=new UM;break;case _.p:k=new VM(a.Ib),c?(a=IM(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new WM(a.channelCount,a.sampleSize,a.ed)).append([k]),m.entries=[a]),k=new XM}m=(new YM).append([m,new ZM,new $M,new aN,new bN]);l=(new cN).append([l]);l=(new dN).append([k,l,m]);g=(new eN).append([g,h,l]);f=(new fN).append([f,g]);d=(new gN).append([d,f,e]);e=new hN("dash",0,["iso6","mp41","avc1"]);c&&(c=b.ud(_.wd),b=b.ud(_.yd),c&&d.append([new iN("pssh",c.initData,8)]),b&&d.append([new iN("pssh",b.initData,8)]),c||b||_.B(fM,"Could not get PSSH init data!"));b=new jN([e,d]);return _.I(b.write())},
|
|
9
|
+
uN=function(a,b){let c,d,e,f,g,h;(new _.Gl).M("moof",_.zl).ba("mfhd",k=>{{const l=new lN;l.g=_.O(k.reader);c=l}}).M("traf",_.zl).ba("tfhd",k=>{{const l=k.reader.Aa();if(null===k.flags)throw new _.G(_.E,3,3019,eM);const m=new mN(k.version||0,k.flags||0);m.g=_.O(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.ul(k.reader));0<l-k.reader.getPosition()&&k.flags&2&&(m.B=_.O(k.reader));0<l-k.reader.getPosition()&&k.flags&8&&(m.l=_.O(k.reader));0<l-k.reader.getPosition()&&k.flags&16&&(m.w=_.O(k.reader));
|
|
10
|
+
0<l-k.reader.getPosition()&&k.flags&32&&(m.o=_.O(k.reader));d=m}}).ba("trun",k=>{{var l=k.reader.Aa();if(null===k.flags)throw new _.G(_.E,3,3019,eM);const m=new nN(k.version||0,k.flags||0);m.g=_.O(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.l=_.tl(k.reader));0<l-k.reader.getPosition()&&k.flags&4&&(m.o=_.O(k.reader));if(0<l-k.reader.getPosition())for(l=0;l<m.g;l++)k.flags&256&&m.w.push(_.O(k.reader)),k.flags&512&&m.sampleSize.push(_.O(k.reader)),k.flags&1024&&m.B.push(_.O(k.reader)),k.flags&
|
|
11
|
+
2048&&(0===k.version?m.j.push(_.O(k.reader)):m.j.push(_.tl(k.reader)));e=m}}).ba("sdtp",k=>{{const l=_.wl(k.reader,k.reader.Aa());f=new oN("sdtp",k.version||0,k.flags||0,l,0)}}).M("uuid",k=>{var l=_.wl(k.reader,16);if(_.Ci(l,pN)){l=_.O(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new qN(k.version,k.flags);l.j=_.O(k.reader);k.flags&1&&(l.l=_.rl(k.reader));for(let m=0;m<l.j;m++){const n={qf:_.wl(k.reader,8),Fc:0,Ce:[]};if(k.flags&2){n.Fc=_.sl(k.reader);for(let q=0;q<n.Fc;q++){const u={Ue:0,Ve:0};
|
|
12
|
+
u.Ue=_.sl(k.reader);u.Ve=_.O(k.reader);n.Ce.push(u)}}l.g.push(n)}g=l}}).M(_.te,k=>{{const l=new rN;0<k.reader.Aa()?l.g=_.wl(k.reader,k.reader.Aa()):(_.B(fM,"mdat box is empty!"),l.g=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new sN).append([d,e]);f&&a.append([f]);b.wd()&&g&&a.append([g]);b=(new tN).append([c,a]);return new jN([b,h])},zN=function(a,b,c,d){var e=d.wd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=uN(b,d);if(null===g)return a.request.contentType===_.F?a.data:
|
|
13
|
+
g;d=g.get(_.te);if(a.request.contentType===_.F){e=d.g.buffer;if(c){e=_.mi(e);if((e=(new DOMParser).parseFromString(e,_.Rf))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new vN(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0])){f=h.getElementsByTagName("p");for(let u=0,v=f.length;u<v;u++){h=f[u];a=c;b=d;g=["begin",_.Td];for(let y=0,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],AM(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.ni(e).buffer}else c=e;return c}h=new tN;a=g.get("mfhd");b=new sN;k=g.get("tfhd");m=new wN(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");k.g=1;k.flags&=16777214;k.flags|=131072;b.append([k,
|
|
15
|
+
m,f]);n&&b.append([n]);if(e){g=0;k=[];if(c.flags&2)for(k=[],m=0;m<c.j;m++)k.push(10+6*c.g[m].Fc);else g=8;b.append([c,new xN,new yN(g,k,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new jN([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},AN=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},BN=function(a){return{initData:_.Ny(_.rm(a)),initDataType:_.Zc,keyId:a,periodId:null}},CN=function(a,b,c){a=_.zm(a);c&&a.version!==c&&(a=_.Py(a,c));return{initData:_.Ny(a),initDataType:_.Zc,keyId:b,periodId:null}},DN=function(a,b){return _.w(function*(){var c=_.Ni(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})},LN=function(a,b){let c=null;try{{const ea=new DOMParser;let $a,Na;try{const hb=_.mi(b);Na=ea.parseFromString(hb.trim(),_.Rf)}catch(hb){throw hb;}Na&&Na.documentElement.tagName===_.Ib&&($a=Na.documentElement);c=$a&&0<$a.getElementsByTagName("parsererror").length?null:$a}}catch(ea){}if(!c)throw a.h.error("Unable to parse manifest"),new _.G(_.E,4,4033,a.l);const d=+EN(a,c,"MajorVersion"),e=+EN(a,c,"MinorVersion"),f=+c.getAttribute("TimeScale")||
|
|
18
|
+
1E7;let g=+EN(a,c,"Duration");const h="TRUE"===c.getAttribute("IsLive"),k=+c.getAttribute("LookAheadCount"),l=+c.getAttribute("DVRWindowLength")||Infinity,m=_.lm(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+d+"."+e))throw a.h.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.G(_.E,4,4036,a.l);h?(FN(a,GN),a.A=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),g=Infinity):FN(a,HN);a.a={startTime:0,delay:0,duration:g/f,Ud:l/f,Yc:0};if(m){{var n=a.f.playreadyVersion;
|
|
19
|
+
const ea=[],$a=_.lm(m,"ProtectionHeader")[0],Na=_.zi(_.nm($a)||""),hb=_.zm(Na).a;ea.push(AN(_.yd,BN(hb),[hb]));ea.push(AN(_.wd,CN(Na,hb,n),[hb]));var q=ea}a.o=q}{const ea=[],$a=_.lm(c,"StreamIndex");if(!$a.length)throw a.h.error("No streams found!"),new _.G(_.E,4,4034,a.l);for(let Na=0;Na<$a.length;Na++){{var u=a,v=$a[Na];const hb=EN(u,v,"Type"),Ic=+v.getAttribute("Chunks"),vh=v.getAttribute("Subtype"),fe=v.getAttribute("Language")||_.Wf,ge=_.Xh(fe),wh=v.getAttribute("Name")||"",Yf=+v.getAttribute(_.gb),
|
|
20
|
+
Zf=+v.getAttribute(_.fb),Pl=EN(u,v,"Url"),UQ=+v.getAttribute("TimeScale")||null;{const Jc=[],cj=_.lm(v,_.zb);for(let he=0;he<cj.length;he++){{let Kc,Ja,Ad;var y=u,A=cj[he],D=hb;const dj=+A.getAttribute("Index"),$f=+EN(y,A,"Bitrate");let dc=NaN,ag=NaN,Ql=NaN,lr=NaN,QC=NaN,RC=NaN,SC=NaN;const TC=A.getAttribute("FourCC");switch(D){case _.t:dc=+EN(y,A,_.fb);ag=+EN(y,A,_.gb);break;case _.p:lr=+A.getAttribute("Channels")||2,Ql=+EN(y,A,"SamplingRate"),RC=+EN(y,A,"AudioTag"),QC=+EN(y,A,"BitsPerSample"),SC=
|
|
21
|
+
+EN(y,A,"PacketSize")}let mr=String(A.getAttribute("CodecPrivateData"));if(D===_.p&&!mr){{var M=lr;const UC={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},Rl=UC[Ql];if("AACH"===TC){Ja=new Uint8Array(4);const VC=UC[2*Ql];Ja[0]=40|Rl>>1;Ja[1]=Rl<<7|M<<3|VC>>1;Ja[2]=VC<<7|8;Ja[3]=0;Kc=new Uint16Array(2);Kc[0]=(Ja[0]<<8)+Ja[1];Kc[1]=(Ja[2]<<8)+Ja[3];Ad=Kc[0].toString(16)+Kc[1].toString(16)}else Ja=new Uint8Array(2),Ja[0]=16|Rl>>1,Ja[1]=Rl<<7|M<<3,Kc=
|
|
22
|
+
new Uint16Array(1),Kc[0]=(Ja[0]<<8)+Ja[1],Ad=Kc[0].toString(16);mr=Ad.toUpperCase()}}var da={id:y.W++,type:D,index:dj,bitrate:$f,qd:mr,maxHeight:dc,maxWidth:ag,ed:Ql,We:lr,Eh:RC,dg:QC,Qh:SC,ug:TC,segmentIndex:null}}Jc.push(da)}var sb=Jc}{const Jc=[],cj=_.lm(v,"c");for(let he=0;he<cj.length;he++){const Kc=cj[he];let Ja=parseInt(Kc.getAttribute("t"),10),Ad=parseInt(Kc.getAttribute("d"),10),dj=parseInt(Kc.getAttribute("r"),10),$f=0;if(isNaN(Ja)&&isNaN(Ad))throw u.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
23
|
+
new _.G(_.E,4,4037,u.l);0===he&&isNaN(Ja)&&($f=Ja=0);if(0<he){const dc=Jc[Jc.length-1];$f=dc.n+1;dc.d||(dc.d=Ja-dc.t);Ja||(Ja=dc.t+dc.d);Ad||(Ad=Ja-dc.t)}Jc.push({n:$f,d:Ad,t:Ja});if(dj){dj--;for(let dc=0;dc<dj;dc++){const ag=Jc[Jc.length-1];$f=ag.n+1;Ja=ag.t+ag.d;Ad=ag.d;Jc.push({n:$f,d:Ad,t:Ja})}}}u.C()||Jc.length===Ic||u.h.warn("Number of fragments ("+Ic+") differs from number of chunks ("+Jc.length+").");var Qb=Jc}var id={type:hb,Hh:Ic,ph:vh,language:ge,Xc:fe,name:wh,maxWidth:Yf,maxHeight:Zf,
|
|
24
|
+
yh:Pl,tracks:sb,df:Qb,timescale:UQ}}ea.push(id)}var Uf=ea}const Va={Ph:d,tf:e,timescale:f,duration:g,isLive:h,Oh:k,Ud:l,be:!1,streams:Uf};if(a.g&&a.w)return IN(a,Va),Promise.resolve();a.G.clear();{const ea=Va.timescale,$a=Va.duration,Na=sM(Va.streams,_.p),hb=sM(Va.streams,_.t),Ic=sM(Va.streams,_.F),vh=[];let fe=JN(a,$a,ea,Na),ge=JN(a,$a,ea,hb);const wh=JN(a,$a,ea,Ic);fe.length||(fe=[null]);ge.length||(ge=[null]);for(let Yf=0;Yf<ge.length;Yf++)for(let Zf=0;Zf<fe.length;Zf++)vh.push(KN(a,ge[Yf],fe[Zf]));
|
|
25
|
+
var ce={id:"ID",configurationId:void 0,startTime:0,endTime:$a,variants:vh,textStreams:wh,thumbStreams:[]}}{var Ec=Va.streams;let ea=a.a.startTime,$a=a.a.delay;const Na=a.I;let hb=Math.min(a.a.duration||Infinity,Na);const Ic=a.C(),vh=a.a.Ud,fe=a.a.Yc,ge=a.H,wh=isFinite(a.F)?a.F:0;if(Ic)hb=Infinity,ea=Date.now()/1E3-fe,a.a.startTime=ea,$a=3*ge;else{const Yf=isFinite(Na)?Na:a.a.duration;for(const Zf of Ec)for(const Pl of Zf.tracks)Pl.segmentIndex.offset(-wh),_.wz(Pl.segmentIndex,Yf)}a.B=new _.$E(a.f.timeline||
|
|
26
|
+
{},ea,$a,!Ic,!0);a.B.f=hb;_.Kz(a.B,ge);a.B.A=vh;Ic||a.B.offset(-wh)}a.D.filterAllPeriods([ce]);a.g={presentationTimeline:a.B,periods:[ce],minBufferTime:0};Promise.resolve();a.K||(a.D.networkingEngine.Gc(a.L),a.K=!0);a.w=Va;return Promise.resolve()},MN=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Ab.bind(a),b))},EN=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.G(_.E,4,4038,a.l,c);},FN=function(a,b){const c=b===HN;a.g&&a.g.presentationTimeline&&
|
|
27
|
+
_.Fz(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.N=b},IN=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){qM(g,c)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var d=NN(a,a.w.timescale,f,c);c=g.segmentIndex;_.Xz(c,d);(d=a.a.Ud)&&_.Yz(c,_.Vz(c)-d).forEach(h=>{h.Ja().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.`)}}},NN=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.df.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=pM(a.l,c,k,d);a.H=Math.max(a.H,l);f.push(new _.Wz(k,h,m,()=>[n],0,null,0,null,!0,g));a.G.set(n,h);e+=l});if(c.type===_.t||c.type===_.p)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Yc?a.a.Yc=b.endTime:a.a.Yc=
|
|
29
|
+
Math.min(a.a.Yc,b.endTime);return f},JN=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=NN(a,c,k,h);const da=new _.aF(l);var m=null;k.type!==_.F&&(m=ON(a,b,c,k,h));h.segmentIndex=da;l=_.eF++;var n=Promise.resolve.bind(Promise),q=da.f.bind(da),u=da.get.bind(da),v=da.g.bind(da),y=da.getDuration.bind(da),A=PN[k.type];var D="";switch(k.type){case _.t:D=h.qd;var M=/00000001[0-9]7/.exec(D);D="avc1."+(M&&M[0]?D.substr(D.indexOf(M[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",
|
|
30
|
+
D);break;case _.p:D=h.qd,M=2,"AACH"===h.ug?M=5:D&&(M=(parseInt(D.substr(0,2),16)&248)>>3),D="mp4a.40."+M,a.h.debug("AUDIO CODECS: ",D)}M=k.type===_.F?QN[k.ph]:void 0;h={id:l,originalId:null,Sh:null,createSegmentIndex:n,findSegmentPosition:q,getSegmentReference:u,adjustSegmentDurations:v,getDuration:y,segmentIndex:da,segmentLookupStrategy:_.zy,initSegmentReference:m,mimeType:A,codecs:D,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:M,encrypted:a.J(),keyId:null,
|
|
31
|
+
language:k.language,originalLanguage:k.Xc,label:k.name,type:k.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.We||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},KN=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Wf;return c||b?{id:a.T++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},ON=function(a,b,c,d,e){b=rM(b,d.timescale||c,e);c={isLive:a.C.bind(a),
|
|
32
|
+
wd:a.J.bind(a),Ag:()=>1,ud:a.R.bind(a)};d=new Uint8Array(0);try{d=kN(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.G(_.E,3,4035,g);}const f="data:text/plain;base64,"+_.yi(d);return new _.XE(()=>[f],0,null,null,!0)},CM=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);_.ol(a,nM(this.type));this.size>b&&hM(a,this.size);"uuid"===this.type&&_.ol(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()}},RN=class extends CM{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);iM(a,this.version);jM(a,this.flags)}},iN=class extends CM{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);_.ol(a,this.g,this.offset);a.getPosition()}},oN=class extends RN{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);_.ol(a,this.g,this.offset);a.getPosition()}},hN=class extends CM{constructor(a,b,c){super("ftyp");this.j=a;this.tf=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);_.ol(a,nM(this.j));_.N(a,this.tf);_.ol(a,nM(this.g.join("")));a.getPosition()}},gN=class extends CM{constructor(){super(_.ze)}},fN=class extends CM{constructor(){super(_.Tf)}},JM=class extends RN{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?(hM(a,0),hM(a,0),_.N(a,this.timescale),hM(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));_.N(a,65536);kM(a,this.volume);kM(a,0);_.N(a,0);_.N(a,0);for(let b=0;b<this.g.length;b++)iM(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()}},KM=class extends CM{constructor(){super("mvex")}},LM=class extends RN{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()}},MM=class extends RN{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?(hM(a,0),hM(a,0),_.N(a,this.j),_.N(a,0),hM(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);kM(a,0);kM(a,0);kM(a,this.volume);kM(a,0);for(let b=0;b<this.g.length;b++)iM(a,this.g[b]);kM(a,this.width);kM(a,0);kM(a,this.height);kM(a,0);a.getPosition()}},NM=class extends RN{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?(hM(a,0),hM(a,0),_.N(a,this.timescale),hM(a,this.duration*this.timescale)):(_.N(a,0),_.N(a,0),_.N(a,this.timescale),_.N(a,this.duration*this.timescale));kM(a,this.language);kM(a,0);a.getPosition()}},OM=class extends RN{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
|
+
_.t?_.ol(a,nM("vide")):_.ol(a,nM("soun"));_.N(a,0);_.N(a,0);_.N(a,0);this.g===_.t?_.ol(a,nM("VideoHandler\x00")):_.ol(a,nM("SoundHandler\x00"));a.getPosition()}},UM=class extends RN{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);kM(a,0);_.ol(a,this.g);a.getPosition()}},SN=class extends CM{constructor(a){super(a);this.A=!0}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);kM(a,0);kM(a,1)}},TN=class extends SN{constructor(a){super(a);
|
|
41
|
+
this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);kM(a,0);kM(a,0);_.N(a,0);_.N(a,0);_.N(a,0);kM(a,this.width);kM(a,this.height);_.N(a,4718592);_.N(a,4718592);_.N(a,0);kM(a,1);iM(a,10);_.ol(a,nM("AVC Coding",31));kM(a,this.depth);mM(a,-1)}},UN=class extends SN{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);kM(a,this.channelCount);kM(a,this.sampleSize);mM(a,0);
|
|
42
|
+
kM(a,0);kM(a,this.sampleRate);kM(a,0)}},TM=class extends TN{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()}},DM=class extends TM{constructor(a,b){super(a,b);this.type="encv"}},WM=class extends UN{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()}},EM=class extends WM{constructor(a,b,c){super(a,b,c);this.type="enca"}},
|
|
43
|
+
SM=class extends CM{constructor(a,b){super("avcC");this.Ma=a;this.Qb=b;this.version=1;this.g=this.Ma[0][1];this.j=this.Ma[0][2];this.level=this.Ma[0][3]}a(){let a=7;for(var b=0;b<this.Ma.length;b++)a+=2,a+=this.Ma[b].byteLength;for(b=0;b<this.Ma.length;b++)a+=2,a+=this.Qb[b].byteLength;return a+super.a()}write(a){super.write(a);iM(a,this.version);iM(a,this.g);iM(a,this.j);iM(a,this.level);iM(a,255);iM(a,224|this.Ma.length);for(var b=0;b<this.Ma.length;b++)kM(a,this.Ma[b].length),_.ol(a,this.Ma[b]);
|
|
44
|
+
iM(a,this.Qb.length);for(b=0;b<this.Qb.length;b++)kM(a,this.Qb[b].length),_.ol(a,this.Qb[b]);a.getPosition()}},VM=class extends RN{constructor(a){super("esds",0,0);this.Ib=a}a(){return 22+(this.Ib.byteLength+3)+super.a()}write(a){super.write(a);iM(a,3);iM(a,23+this.Ib.byteLength);kM(a,1);iM(a,0);iM(a,4);iM(a,15+this.Ib.byteLength);iM(a,64);iM(a,21);jM(a,0);_.N(a,0);_.N(a,0);iM(a,5);iM(a,this.Ib.byteLength);_.ol(a,this.Ib);_.ol(a,new Uint8Array([6,1,2]));a.getPosition()}},QM=class extends RN{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&&_.ol(a,nM(this.location));a.getPosition()}},PM=class extends RN{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()}},YM=class extends CM{constructor(){super(_.Kf)}},RM=class extends RN{constructor(){super(_.Mf,
|
|
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()}},ZM=class extends RN{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
|
+
$M=class extends RN{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()}},bN=class extends RN{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()}},aN=class extends RN{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.N(a,0);_.N(a,0);a.getPosition()}},XM=class extends RN{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);mM(a,0);kM(a,0);a.getPosition()}},cN=class extends CM{constructor(){super("dinf")}},dN=class extends CM{constructor(){super(_.ye)}},eN=class extends CM{constructor(){super(_.ue)}},wN=class extends RN{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?hM(a,this.baseMediaDecodeTime):_.N(a,this.baseMediaDecodeTime);a.getPosition()}},lN=class extends RN{constructor(){super("mfhd",0,0);this.g=0}a(){return 4+super.a()}write(a){super.write(a);_.N(a,this.g);a.getPosition()}},nN=class extends RN{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&VN&&(a+=4);this.flags&WN&&(a+=
|
|
50
|
+
4);for(let b=0;b<this.g;b++)this.flags&XN&&(a+=4),this.flags&YN&&(a+=4),this.flags&ZN&&(a+=4),this.flags&$N&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&VN&&(a.getPosition(),lM(a,this.l));this.flags&WN&&_.N(a,this.o);for(let b=0;b<this.g;b++)this.flags&XN&&_.N(a,this.w[b]),this.flags&YN&&_.N(a,this.sampleSize[b]),this.flags&ZN&&_.N(a,this.B[b]),this.flags&$N&&(0===this.version?_.N(a,this.j[b]):lM(a,this.j[b]));a.getPosition()}},VN=1,WN=4,XN=256,YN=512,ZN=1024,$N=2048,
|
|
51
|
+
mN=class extends RN{constructor(a,b){super("tfhd",a,b);this.g=255;this.o=this.w=this.l=this.B=this.j=0}a(){let a=4;this.flags&aO&&(a+=8);this.flags&bO&&(a+=4);this.flags&cO&&(a+=4);this.flags&dO&&(a+=4);this.flags&eO&&(a+=4);return a+super.a()}write(a){super.write(a);_.N(a,this.g);this.flags&aO&&hM(a,this.j);this.flags&bO&&_.N(a,this.B);this.flags&cO&&_.N(a,this.l);this.flags&dO&&_.N(a,this.w);this.flags&eO&&_.N(a,this.o);a.getPosition()}},aO=1,bO=2,cO=8,dO=16,eO=32,sN=class extends CM{constructor(){super("traf")}},
|
|
52
|
+
tN=class extends CM{constructor(){super("moof")}},rN=class extends CM{constructor(){super(_.te);this.g=new Uint8Array(0)}a(){return this.g.byteLength+super.a()}write(a){super.write(a);0<this.g.byteLength&&_.ol(a,this.g)}},FM=class extends RN{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);iM(a,0);0===this.version?iM(a,0):iM(a,0);iM(a,this.g);iM(a,this.j);_.ol(a,_.Ai(this.o));
|
|
53
|
+
if(1===this.g&&0===this.j){iM(a,0);for(let b=0;b<this.l.length;b++)iM(a,this.l[b])}a.getPosition()}},HM=class extends RN{constructor(a,b){super("schm",0,0);this.g=a;this.j=b;this.Cb=""}a(){let a=8;this.flags&1&&(a+=nM(this.Cb).byteLength);return a+super.a()}write(a){super.write(a);_.ol(a,nM(this.g));_.N(a,this.j);this.flags&1&&_.ol(a,nM(this.Cb));a.getPosition()}},GM=class extends CM{constructor(a){super("frma");this.g=a}a(){return nM(this.g).byteLength+super.a()}write(a){super.write(a);_.ol(a,nM(this.g));
|
|
54
|
+
a.getPosition()}},xN=class extends RN{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&&(_.N(a,0),_.N(a,0));_.N(a,1);for(let b=0;1>b;b++)0===this.version?_.N(a,this.offset[b]):hM(a,this.offset[b]);a.getPosition()}},yN=class extends RN{constructor(a,b,c){super("saiz",0,0);this.g=a;this.l=b;this.j=c}a(){let a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.l.length);
|
|
55
|
+
return a+super.a()}write(a){super.write(a);this.flags&1&&(_.N(a,0),_.N(a,0));iM(a,this.g);_.N(a,this.j);if(0===this.g)for(let b=0;b<this.j;b++)iM(a,this.l[b]);a.getPosition()}},qN=class extends RN{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].qf.byteLength,this.flags&2){a+=2;for(let c=0;c<this.g[b].Fc;c++)a+=2,a+=4}return a+super.a()}write(a){super.write(a);_.N(a,this.j);this.flags&1&&iM(a,this.l);for(let b=
|
|
56
|
+
0;b<this.j;b++)if(_.ol(a,this.g[b].qf),this.flags&2){kM(a,this.g[b].Fc);for(let c=0;c<this.g[b].Fc;c++)kM(a,this.g[b].Ce[c].Ue),_.N(a,this.g[b].Ce[c].Ve)}a.getPosition()}};var vN=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))}},uM=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,vM=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,wM=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,xM=/^(\d*\.?\d*)f$/,yM=/^(\d*\.?\d*)t$/,zM=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var jN=class{constructor(a){this.a=a;this.f=BM(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=BM(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var pN=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var fO=class{constructor(){this.w=this.g=this.f=this.D=null;this.T=1;this.W=0;this.l="";this.B=this.a=null;this.h=new _.Q("clpp.smooth.SmoothParser");this.K=!1;this.j=this.A=null;this.N=HN;this.H=0;this.F=this.I=Infinity;this.o=[];this.L=this.U.bind(this);this.G=new Map}configure(a){this.f=a}start(a,b){this.D=b;a=[...new Set([a,oM(a)])];return DN(this,a).then(c=>LN(this,c.data).then(()=>{MN(this,this.A);return this.g}))}requestStop(){}stop(){this.D&&this.D.networkingEngine.Hd(this.L);this.A=this.w=
|
|
57
|
+
this.g=this.f=this.D=null;this.j&&(clearTimeout(this.j),this.j=null);this.K=!1;this.I=this.F=Infinity;return Promise.resolve()}update(){if(this.C())return DN(this,[this.l]).then(a=>LN(this,a.data).then(()=>this.g)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Ab(){this.h.debug(_.ry);this.D&&(this.j=null,this.update().then(()=>{MN(this,this.A)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&MN(this,100))}))}C(){return this.N===GN}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}U(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),wd:this.J.bind(this),Ag:()=>1,ud:this.R.bind(this)};let d=!1;const e=new _.G(_.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.h.debug(`Using base media decode time ${g} instead of `+
|
|
59
|
+
`segment reference time ${a.request.startTime}`);f=zN(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)}},PN={video:_.kg,audio:_.Mc,text:_.Cc},HN=_.Tb,GN="LIVE",QN={zh:_.wy,Bh:_.Iy};_.x("clpp.smooth.SmoothComponent",class extends _.Ft{f(){_.jr.ism=fO;_.hr[_.Dc]=fO}a(){_.uA("ism");_.vA(_.Dc)}id(){return"smooth"}});};f.call(g, window);
|