@castlabs/prestoplay 6.28.0 → 6.30.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 +37 -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 +128 -116
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +619 -614
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +92 -89
- package/cjs/cl.externs.js +154 -60
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +25 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -349
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +15 -15
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +57 -58
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +60 -60
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +38 -38
- package/cjs/polyfill.min.js +2 -2
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -6
- package/cl.cast.js +101 -92
- package/cl.conviva.js +27 -27
- package/cl.core.js +500 -496
- package/cl.crypto.js +9 -9
- package/cl.dash.js +84 -83
- package/cl.externs.js +150 -60
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +82 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +19 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +304 -305
- 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 +14 -14
- package/cl.smooth.js +60 -60
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +1 -1
- package/typings.d.ts +198 -88
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.g.debug(`Video dimensions: ${g}x${h}`);g&&h&&(e.video_source_height=g,e.video_source_width=h);(d=d.
|
|
4
|
-
player_mux_plugin_version:_.ea};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b}
|
|
5
|
-
{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.
|
|
6
|
-
var d=new _.
|
|
7
|
-
a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},
|
|
8
|
-
a),this.l=!1)
|
|
9
|
-
switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.
|
|
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 Zz=function(a){switch(a.type){case 1:return Wz;case 2:return Xz;case 3:return Yz}},aA=function(a){const b=Object.keys(a).find(c=>$z.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},cA=function(a){let b={debug:!0,data:bA(a)};a.f&&a.f.muxOptionsOverride&&_.gh(a.f.muxOptionsOverride)&&(b=_.ch(b,a.f.muxOptionsOverride));b=_.ch(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 _.gp(c.url);e.video_source_url=_.Nm(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().ra(),
|
|
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.pa())&&d.language&&(e.player_language_code=d.language)}return e}});a.g.debug("Mux SDK options",b);return b},dA=function(a){_.Xh(a.a);a.j.we(a.F);a.j.Rg(a.C)},bA=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:_.ea,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",
|
|
4
|
+
player_mux_plugin_version:_.ea};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},eA=function(a){a.a.on(a.m,_.fg,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.fg,b)});a.a.on(a.m,_.We,()=>a.emit(_.We));a.a.on(a.m,_.Mc,a.G.bind(a));a.a.on(a.m,_.Qf,a.I.bind(a));a.a.on(a.m,_.tg,()=>a.emit(_.If));a.a.on(a.m,_.sg,()=>a.emit(_.Hf));a.a.on(a.m,_.Xd,a.H.bind(a));a.a.on(a.m,_.Tb,()=>a.emit("adbreakstart"));a.a.on(a.m,_.Ub,()=>a.emit("adbreakend"));a.a.on(a.m,_.lc,()=>
|
|
5
|
+
{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.hc,()=>a.emit("adpause"));a.a.on(a.m,_.jc,()=>{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.mc,()=>a.emit("adended"));a.a.on(a.m,_.Yb,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.gc,()=>a.emit("admidpoint"));a.a.on(a.m,_.nc,()=>a.emit("adthirdquartile"));a.j.bd(a.F);a.j.Lf(a.C);a.a.on(a.m,_.Xd,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 _.gp(b.uris[b.uriIndex]);b={request_start:c,request_type:Zz(b),request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.gp(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:Zz(c),request_hostname:f.a,request_error:`${Zz(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},fA=function(a,b){a.trigger(new _.H(_.Xd,{detail:b}))},gA=function(a){return!_.z(a)&&typeof a.init===_.ae&&typeof a.emit===_.ae},Wz="manifest",Xz="media",Yz="encryption",$z=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var hA=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 _.Kt;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.F=this.K.bind(this);this.C=this.J.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.B,cA(this))}catch(d){throw this.h=!1,dA(this),new _.I(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=bA(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);eA(this)}release(){this.g.debug("release()");this.l?this.g.debug(_.ja):(dA(this),this.l=!0,this.o=this.f=null)}destroy(){this.g.debug(_.Dd);this.A?this.g.debug(_.ha):(this.A=!0,this.emit("destroy"))}emit(a,b){if(null===this.w)throw new _.I(1,9,9301);this.w.emit(this.B,a,b)}G(a){this.g.debug(_.Ie);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Na())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.g.debug(_.Ne);
|
|
9
|
+
switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.We);break;case 3:this.emit(_.gf);break;case 4:this.emit(_.Se);break;case 5:this.emit(_.Wd)}}H(a){this.g.debug(_.Ke);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.D){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(_.Xd,{player_error_code:a.code,player_error_message:b})}}K(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 _.gp(b.uris[b.uriIndex]);a={request_start:g,request_type:Zz(b),request_hostname:d.a,request_id:aA(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.Nm(d)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}J(a){a.requestStartTimestamp=Date.now()}};var iA=class extends _.Ov{constructor(){super();this.f=this.m=null;this.a=!1;this.g=new _.T("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new hA(a,this.g)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.dh(c.muxdata);try{var d=[];typeof c===_.He&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.I(1,9,9300,{missingKeys:d});{const f=a.getConfiguration();d=null;if(this.a=!_.z(f.muxdata)&&typeof f.muxdata===_.He){const g=f.muxdata;d=gA(g.muxLib)?g.muxLib:window.mux;if(!gA(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.I(1,9,9301);fA(a,h)}}else this.g.debug("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,fA(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&&fA(this.m,c),c;}}};_.x("clpp.muxdata.MuxDataPlugin",iA);iA.prototype.emit=iA.prototype.emit;
|
|
13
|
+
iA.Id="mux";_.Qn(new class{create(){return new iA}});};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
|
-
licenseResponse:_.
|
|
3
|
-
_.x("clpp.onboard.OnboardComponent",class extends _.
|
|
4
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Vz=function(a,b){let c=b.baseUrl;_.vi(c,"/")||(c+="/");var d=h=>h&&(_.ui(h,_.fe)||_.ui(h,"http://")||_.ui(h,"//"))?h:`${c}${h}`;const e=d(b.widevineUrl||"widevine"),f=d(b.playreadyUrl||"playready");d=d(b.fairplayUrl||"fairplay");b=b.serverCertificate;const g=_.Oo("V2");a=new _.yu(a);a.Ya(_.wd,{licenseUrl:e,videoRobustness:[_.pb,void 0],audioRobustness:[_.ob,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:_.Po(b,g),modifiers:{licenseRequest:_.vp,
|
|
2
|
+
licenseResponse:_.wp}});a.Ya(_.sd,{licenseUrl:d,certificateUrl:d,modifiers:{licenseRequest:_.yp,licenseResponse:_.zp,extractContentId:_.Ap,certificateRequest:_.Bp}});a.Ya(_.ud,{licenseUrl:f,modifiers:{licenseRequest:_.vp}});_.kn(a)};
|
|
3
|
+
_.x("clpp.onboard.OnboardComponent",class extends _.yv{constructor(){super();this.g=new _.T("clpp.onboard");this.a=new Set}uninstall(){for(const a of this.a)delete _.jn[a];this.a.clear()}beforeLoad(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,serverCertificate:a.serverCertificate,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info(`Registering the DRMtoday Onboard environment, name='${b}'`),
|
|
4
|
+
Vz(b,a),this.a.add(b))}id(){return"onboard"}});_.x("clpp.onboard.register",Vz);};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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
_.x("clpp.persistent.fetchLicense",function(a,b,...c){return _.w(function*(){var d=
|
|
8
|
-
const l=yield k.start(f.url,{configurationId:"",networkingEngine:d,onContentSteeringInfoFound:()=>null,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.
|
|
9
|
-
_.x("clpp.persistent.removeLicense",function(a){return _.w(function*(){var b=
|
|
10
|
-
new _.
|
|
11
|
-
const c=
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Gz="A persistent DRM session already exists for: ",Hz="No DRM configuration.",Iz="clpp.persistent",Jz="clpp.persistent.SimpleSessionStorage",Lz=function(a,b,c,d,e,f){a.K=Kz;const g=new Map,h=_.kq(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Pe,persistentState:_.zf,sessionTypes:[_.Ue],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,
|
|
2
|
+
initData:null,keyIds:null}]});return _.Cq(a,g)},Nz=function(a,b){a.K=Mz;a.L=[];a.G=!0;return _.Dq(a,b)},Oz=function(a,b){return _.w(function*(){const c=yield _.Uq(a,b);if(c){var d=[],e=a.h.get(c);e&&a.C&&(e.mc=new _.Hl,d.push(e.mc));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)})},Pz=function(a){const b=[];for(const c of a.h.keys())b.push(c.sessionId);return b},Qz=function(a,b){const c=_.mn(a),d=_.bn([{drm:a}]);
|
|
3
|
+
d.drm=a;a=new _.Cs({vb:b,onError:()=>{},af:()=>{},$e:()=>{},onEvent:()=>{},getConfiguration:()=>d,Qc:()=>null});a.f=c;return a},Tz=function(a,b,c){return _.w(function*(){const d=Rz;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)Sz.debug(Gz,e);else{var g=Qz(a,c);try{yield Nz(g,b);yield _.Sq(g);yield _.Vq(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.Um(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:Pz(g),keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,
|
|
4
|
+
serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw Sz.error(`Error while persisting DRM session ${e}`),new _.I(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Sz.debug(Hz)})},Mz=1,Kz=2,Uz=class{constructor(){this.g=new _.T(Jz)}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);const e=JSON.stringify(b.audioCapabilities),
|
|
5
|
+
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),g=e.audioCapabilities||[],
|
|
6
|
+
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 _.w(function*(){window.localStorage.removeItem(encodeURIComponent(a))})}clear(){return _.w(function*(){window.localStorage.clear()})}getName(){return Jz}};_.x("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.z(a)||(_.hh(a.store)||c.push("store"),_.hh(a.get)||c.push("get"),_.hh(a.delete)||c.push("delete"),_.hh(a.clear)||c.push("clear"),_.hh(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw Sz.warn("Invalid session storage implementation"),new _.I(1,6,6202,{missingMethods:b});Rz=a});
|
|
7
|
+
_.x("clpp.persistent.fetchLicense",function(a,b,...c){return _.w(function*(){var d=Rz,e=(l,m)=>new _.I(1,6,6200,l,m);const f=_.fn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Hz);var g=b.offlineId;if(typeof g!==_.Tf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Sz.debug(Gz,g);else{var h=_.$m();d=new _.En;g=[];for(var k of c){const l=new k;_.Kh(l.id())||(l.install(),_.Mh(l),g.push(l))}k=null;try{k=yield _.Ct(f.url,d,h.manifest.attemptParameters,f.type||null);k.configure(h.manifest);
|
|
8
|
+
const l=yield k.start(f.url,{configurationId:"",networkingEngine:d,onContentSteeringInfoFound:()=>null,filterAllPeriods:()=>{},filterNewPeriod:()=>{},onEvent:()=>{},onError:()=>{}});if(!l.periods.length)throw e(null,new _.I(_.D,4,4014));const m=_.rt(l.periods);yield Tz(b,m,d)}catch(l){if(l instanceof _.I&&6200===l.code)throw l;throw e(null,l);}finally{for(;g.length;)e=g.shift(),e.uninstall(),_.Jh.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=Rz;if(_.jh(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.En,c=Qz(e.drmConfig,d),yield Lz(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.Sq(c),yield Promise.all(e.sessionIds.map(f=>_.w(function*(){yield Oz(c,f);Sz.debug("successfully removed session with id",f)}))),yield b.delete(a)):Sz.debug("No persistent DRM session found")}catch(e){throw Sz.error("Failed to remove session"),
|
|
10
|
+
new _.I(1,6,6201,null,e);}finally{b=[],c&&b.push(c.destroy()),d&&b.push(d.destroy()),yield Promise.all(b)}}else Sz.warn("Invalid offlineId")})});_.x("clpp.persistent.getSessionStorage",function(){return Rz});var Rz=new Uz,Sz=new _.T(Iz);_.x("clpp.persistent.PersistentLicenseComponent",class extends _.yv{constructor(){super();this.g=new _.T(Iz)}id(){return _.Te}f(a,b){const c=this;return _.w(function*(){const d=a.getConfiguration().drm;if(d){c.g.debug(`Persisting DRM session ID: ${d.offlineId}`);var e=a.getNetworkEngine();try{yield Tz(d,b,e),a.trigger(new _.H(_.Pd,{offlineId:d.offlineId}))}catch(f){a.onError(f)}}else c.g.debug("No DRM configuration found for loaded source.")})}a(a){const b=this;return _.w(function*(){b.g.debug(`Getting EME session IDs for ${a}`);
|
|
11
|
+
const c=Rz;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 Dz=function(a,b){return 0<=b&&b<a.a.length},Ez=function(a){a.trigger(new _.H(_.kf))},Fz=class extends _.Nt{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.Ba.bind(this)}getPosition(){return this.f}nd(){return this.a}Eb(){return 0<this.a.length&&Dz(this,this.f)?this.a[this.f]:null}qg(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&Dz(this,a)?this.a[a]:null}hi(){return this.h}start(){this.h||(this.h=!0,this.m.on(_.Wd,this.j),this.Sc(this.f,!0))}stop(){this.h=!1;this.m.off(_.Wd,this.j)}Ba(){this.next()}next(){const a=this;return _.w(function*(){yield a.Sc(Math.min(a.a.length-1,a.f+1))})}Fd(){const a=this;return _.w(function*(){yield a.Sc(Math.max(0,a.f-1))})}Sc(a,b){b=void 0===b?!1:b;const c=this;return _.w(function*(){if(0<c.a.length&&Dz(c,a)&&(b||c.f!==a)){c.f=a;var d=c.Eb();d&&!1===d.skippable||!d||(yield c.l(d),
|
|
3
|
+
yield c.m.load(d.configuration),c.trigger(new _.H(_.hf,{item:d})))}})}append(a){this.a.push(a);Ez(this)}ug(a,b){if(0<=b&&b<=this.a.length){const c=this.Eb();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Ez(this)}}remove(a){if(0<this.a.length&&Dz(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Ez(this)}}clear(){this.stop();this.f=0;this.a=[];this.h=!1;Ez(this)}};_.x("clpp.Playlist",Fz);Fz.prototype.clear=Fz.prototype.clear;Fz.prototype.remove=Fz.prototype.remove;
|
|
4
|
+
Fz.prototype.insert=Fz.prototype.ug;Fz.prototype.append=Fz.prototype.append;Fz.prototype.goTo=Fz.prototype.Sc;Fz.prototype.previous=Fz.prototype.Fd;Fz.prototype.next=Fz.prototype.next;Fz.prototype.onEnded=Fz.prototype.Ba;Fz.prototype.stop=Fz.prototype.stop;Fz.prototype.start=Fz.prototype.start;Fz.prototype.isStarted=Fz.prototype.hi;Fz.prototype.getUpcoming=Fz.prototype.qg;Fz.prototype.getCurrent=Fz.prototype.Eb;Fz.prototype.getQueue=Fz.prototype.nd;Fz.prototype.getPosition=Fz.prototype.getPosition;
|
|
5
|
+
Fz.prototype.off=Fz.prototype.off;Fz.prototype.one=Fz.prototype.one;Fz.prototype.on=Fz.prototype.on;};f.call(g, window);
|
package/cl.simid.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.h=!1;a.m.trigger(new _.
|
|
7
|
-
"opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.
|
|
8
|
-
break;case "SIMID:Creative:requestResize":d=this.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition="":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);const f=
|
|
9
|
-
f.height}e.creativeDimensions&&(e=
|
|
10
|
-
this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.
|
|
11
|
-
this.j(a)}};var
|
|
12
|
-
var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new
|
|
13
|
-
c&&(c=this.a,
|
|
14
|
-
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 _.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var mz="No surface found. Can not attach frame!",nz="SIMID:Media:timeupdate",oz="Starting creative",pz=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},sz=function(a,b){return new Promise((c,d)=>{new qz(a.j,c,d,b);rz(a,b)})},tz=function(a){const b=pz(a,"SIMID:Player:startCreative",void 0);sz(a,b).then(()=>{var c=a.f;c.g.info(oz);c.m.trigger(new _.H(_.Kf));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.g.error("Error while starting creative",
|
|
2
|
+
c)})},vz=function(a,b){_.w(function*(){a.h=b.sessionId;uz(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=pz(a,"SIMID:Player:init",d);var e=sz(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()}})},uz=function(a,b){rz(a,pz(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},rz=function(a,b){a.h?(b.type!==nz&&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}'`)},wz=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=pz(d,"SIMID:Player:resize",e);rz(d,e)}})},xz=function(a,b){a.g.info("SIMID Session created");a.a=b},yz=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 _.H(_.Lf))},zz=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}%`}},Az=class{constructor(a,b){this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";a=this.w.style;a.className?this.a.classList.add(a.className):(this.a.style.border=_.Ge,this.a.style.backgroundColor="transparent",this.a.style.transition=
|
|
7
|
+
"opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Ge,this.a.style.overflow=_.ce);this.a.classList.add(_.cd);this.o=c=>{if(c.source===this.a.contentWindow&&(c=(c=c.data)?typeof c===_.Tf?JSON.parse(c):c:null))if(c.type)switch(this.g.info(`Received message [${c.messageId}] '${c.type}':`,c.args),c.type){case "createSession":vz(this,c);break;case "resolve":c=c.args;var d=this.j.get(c.messageId);d&&d.resolve(c);break;case "reject":c=c.args;(d=this.j.get(c.messageId))&&d.reject(c);
|
|
8
|
+
break;case "SIMID:Creative:requestResize":d=this.f;var e=c.args;d.g.info("Creative requested resize",e);if(d.m&&d.m.getSurface()&&d.m.getSurface().getMedia()&&e.mediaDimensions){d.h?d.m.getSurface().getMedia().style.transition="":(d.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",d.h=!0);const f=zz(d,e.mediaDimensions);d.m.getSurface().getMedia().style.left=f.left;d.m.getSurface().getMedia().style.top=f.top;d.m.getSurface().getMedia().style.width=f.width;d.m.getSurface().getMedia().style.height=
|
|
9
|
+
f.height}e.creativeDimensions&&(e=zz(d,e.creativeDimensions),d.a.a.style.left=e.left,d.a.a.style.top=e.top,d.a.a.style.width=e.width,d.a.a.style.height=e.height);uz(this,c)}else this.g.warn("WARNING: received message without 'type' property")};this.g=new _.T("clpp.simid.SimidPlayer");xz(this.f,this)}load(a){window.addEventListener(_.ze,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(){yz(this.f);
|
|
10
|
+
this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.ze,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},qz=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);
|
|
11
|
+
this.j(a)}};var Cz=class extends _.Ov{constructor(){super();this.g=new _.T("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 Bz(a)}onContentWillLoad(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info(`Setting up SIMID plugin for ${this.l.length} creatives`);
|
|
12
|
+
var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new Az(this.h,b.simid),b=c.getContainer(),this.j=wz(this,b,c),this.j.observe(b),a.on(_.fg,this.w)):this.g.warn(mz)}}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&&(tz(this.a),this.o=!0,this.g.info(oz)),
|
|
13
|
+
c&&(c=this.a,rz(c,pz(c,nz,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(mz),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(_.fg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))}},Bz=class{constructor(a){this.m=a;this.a=null;this.g=new _.T("clpp.simid.Loader");
|
|
14
|
+
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 _.I(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 _.I(1,10,10100,"No surface");return a}og(){return this.a}url(){return this.f?this.f.url:""}};_.Qn(new class{create(){return new Cz}});};f.call(g, window);
|
package/cl.smooth.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
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.h),a.a+=2}catch(c){_.
|
|
3
|
-
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.
|
|
4
|
-
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.t:a.
|
|
5
|
-
Number(a[2]);let f=Number(a[3]),g=Number(a[4]);g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}}else
|
|
6
|
-
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.
|
|
7
|
-
|
|
8
|
-
(a=(new
|
|
9
|
-
|
|
10
|
-
0<l-k.reader.getPosition()&&k.flags&32&&(m.l=_.
|
|
11
|
-
2048&&(0===k.version?m.h.push(_.
|
|
12
|
-
u.
|
|
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
|
|
15
|
-
m,f]);n&&b.append([n]);if(e){g=0;k=[];if(c.flags&2)for(k=[],m=0;m<c.h;m++)k.push(10+6*c.f[m]
|
|
16
|
-
periodId:null}},
|
|
17
|
-
c.type=1;c=yield a.D.networkingEngine.fetch(c).U;a.o=c.uri;return c})},
|
|
18
|
-
if(!1===/^[2].[0-2]$/.test(""+e+"."+f))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.
|
|
19
|
-
u}{const
|
|
20
|
-
|
|
21
|
-
32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},
|
|
22
|
-
maxWidth:
|
|
23
|
-
1];
|
|
24
|
-
duration:h,isLive:k,
|
|
25
|
-
thumbStreams:[]}}{var
|
|
26
|
-
a.C.offset(-
|
|
27
|
-
c);c&&null!=a.l&&(window.clearTimeout(a.l),a.l=null,a.B=null);a.P=b},
|
|
28
|
-
`track with bitrate ${g.bitrate}. Skipping update.`)}}},
|
|
29
|
-
d.length;f++){const g=d[f].tracks.map(h=>{{var k=d[f],l=
|
|
30
|
-
2),16)&248)>>3),
|
|
31
|
-
primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.
|
|
32
|
-
try{d=
|
|
33
|
-
a)return this.children[b];{const c=this.children[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.children.length)for(let c=0;c<this.children.length;c++)b+=this.children[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.w)for(b=0;b<this.children.length;b++)this.children[b].write(a),this.children[b].a(),a.getPosition()}},
|
|
35
|
-
b,c);this.f=d;this.offset=e}a(){return this.f.byteLength+super.a()-this.offset}write(a){super.write(a);_.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
d;this.height=e;this.volume=1;this.f=[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+32:a+20;a=a+24+this.f.length;return a+super.a()}write(a){super.write(a);1===this.version?(
|
|
39
|
-
this.width);
|
|
40
|
-
0,0);this.f=a}a(){return 33+super.a()}write(a){super.write(a);_.
|
|
41
|
-
super.a()}write(a){super.write(a);_.
|
|
42
|
-
super.a()}write(a){super.write(a);_.
|
|
43
|
-
a.getPosition()}},
|
|
44
|
-
for(var b=0;b<this.
|
|
45
|
-
_.
|
|
46
|
-
a.getPosition()}},
|
|
47
|
-
_.
|
|
48
|
-
return a+super.a()}write(a){super.write(a);_.
|
|
49
|
-
|
|
50
|
-
b);this.l=this.j=this.f=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]}a(){let a=4;this.flags
|
|
51
|
-
this.flags&
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.j=this.f=this.D=null;this.l&&(clearTimeout(this.l),this.l=null);this.L=!1;this.J=this.G=Infinity;return Promise.resolve()}update(){if(this.F())return
|
|
58
|
-
0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[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.A.timescale,c={isLive:this.F.bind(this),
|
|
59
|
-
`segment reference time ${a.request.startTime}`);f=
|
|
60
|
-
"LIVE"
|
|
1
|
+
import {clpp} from "./cl.core.js";import './cl.mse.js';let g={};const _ = clpp._;var f=function(window){'use strict';var nQ="Full MP4 box must have flags defined",oQ="clpp.smooth.SmoothMP4Processor",pQ="codecPrivateData",qQ=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.M(a,c);_.M(a,b)},rQ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Qo()}},sQ=function(a,b){rQ(a,b>>16&255);rQ(a,b>>8&255);rQ(a,b&255)},tQ=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.Qo()}},uQ=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.Qo()}},vQ=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.h),a.a+=2}catch(c){_.Qo()}},wQ=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},xQ=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},yQ=function(a,b,c,d){c=b.hg[c];b=b.hj;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 _.mB([a],[b])[0]},zQ=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.t?c=["maxWidth","maxHeight","bitrate",pQ,"fourCC"]:a.type===_.q&&(c=["bitrate",pQ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.lh(a,b,c,["id","segmentIndex"])},AQ=function(a,b,c){const d=c.Wd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Za:null,hc:null,width:NaN,height:NaN,cc:null,Gd:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.t:a.Za=[_.cm(d[1])];a.hc=[_.cm(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.q:a.cc=_.cm(c.Wd),a.sampleSize=c.wh||16,a.Gd=c.Gd,a.channelCount=c.Yf}return a},BQ=function(a,b){return a.filter(c=>c.type===b)},CQ=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)},JQ=function(a,b,c){var d=null;if(DQ.test(a)){{a=DQ.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 EQ.test(a)?d=CQ(EQ,a):FQ.test(a)?d=CQ(FQ,a):GQ.test(a)?(a=GQ.exec(a),d=Number(a[1])/c.frameRate):HQ.test(a)?(a=HQ.exec(a),d=Number(a[1])/c.a):IQ.test(a)&&(d=CQ(IQ,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},KQ=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.kp(b)},RQ=function(a,b,c){a:{var d=[_.wd,_.ud];for(e of d)if((d=c.be(e))&&d.keyId){var e=d.keyId;break a}_.C(oQ,"Could not get default Key ID for DRM init data!");e=null}c=new LQ("xxxx");a.type===_.t?c=new MQ(a.width,a.height):c=new NQ(a.channelCount,a.sampleSize,a.Gd);a=new OQ;a.f=1;a.h=8;a.l=e||"00000000000000000000000000000000";a=(new LQ("schi")).append([a]);b=(new LQ(_.Mf)).append([new PQ(b),new QQ(_.Wc,65536),a]);c.append([b]);return c},
|
|
7
|
+
tR=function(a,b){var c=b.ce(),d=new SQ(a.timescale,a.duration,a.id),e=(new TQ).append([new UQ(a.id)]),f=new VQ(a.id,a.duration,a.timescale,a.width,a.height),g=new WQ(a.timescale,a.duration);const h=new XQ(a.type);var k=null,l=new YQ;l.entries=[new ZQ];var m=new $Q;switch(a.type){case _.t:k=new aR(a.Za,a.hc);c?(a=RQ(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new bR(a.width,a.height)).append([k]),m.entries=[a]);k=new cR;break;case _.q:k=new dR(a.cc),c?(a=RQ(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new eR(a.channelCount,a.sampleSize,a.Gd)).append([k]),m.entries=[a]),k=new fR}m=(new gR).append([m,new hR,new iR,new jR,new kR]);l=(new lR).append([l]);l=(new mR).append([k,l,m]);g=(new nR).append([g,h,l]);f=(new oR).append([f,g]);d=(new pR).append([d,f,e]);e=new qR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.be(_.ud),b=b.be(_.wd),c&&d.append([new rR("pssh",c.initData,8)]),b&&d.append([new rR("pssh",b.initData,8)]),c||b||_.C(oQ,"Could not get PSSH init data!"));b=new sR([e,d]);return _.G(b.write())},
|
|
9
|
+
DR=function(a,b){let c,d,e,f,g,h;(new _.ip).N("moof",_.bp).ea("mfhd",k=>{{const l=new uR;l.f=_.N(k.reader);c=l}}).N("traf",_.bp).ea("tfhd",k=>{{const l=k.reader.Oa();if(null===k.flags)throw new _.I(_.D,3,3019,nQ);const m=new vR(k.version||0,k.flags||0);m.f=_.N(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.h=_.Xo(k.reader));0<l-k.reader.getPosition()&&k.flags&2&&(m.A=_.N(k.reader));0<l-k.reader.getPosition()&&k.flags&8&&(m.j=_.N(k.reader));0<l-k.reader.getPosition()&&k.flags&16&&(m.o=_.N(k.reader));
|
|
10
|
+
0<l-k.reader.getPosition()&&k.flags&32&&(m.l=_.N(k.reader));d=m}}).ea("trun",k=>{{var l=k.reader.Oa();if(null===k.flags)throw new _.I(_.D,3,3019,nQ);const m=new wR(k.version||0,k.flags||0);m.f=_.N(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.Wo(k.reader));0<l-k.reader.getPosition()&&k.flags&4&&(m.l=_.N(k.reader));if(0<l-k.reader.getPosition())for(l=0;l<m.f;l++)k.flags&256&&m.o.push(_.N(k.reader)),k.flags&512&&m.sampleSize.push(_.N(k.reader)),k.flags&1024&&m.A.push(_.N(k.reader)),k.flags&
|
|
11
|
+
2048&&(0===k.version?m.h.push(_.N(k.reader)):m.h.push(_.Wo(k.reader)));e=m}}).ea("sdtp",k=>{{const l=_.Zo(k.reader,k.reader.Oa());f=new xR("sdtp",k.version||0,k.flags||0,l,0)}}).N("uuid",k=>{var l=_.Zo(k.reader,16);if(_.em(l,yR)){l=_.N(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new zR(k.version,k.flags);l.h=_.N(k.reader);k.flags&1&&(l.j=_.Uo(k.reader));for(let m=0;m<l.h;m++){const n={tg:_.Zo(k.reader,8),$c:0,wf:[]};if(k.flags&2){n.$c=_.Vo(k.reader);for(let p=0;p<n.$c;p++){const u={Uf:0,Vf:0};
|
|
12
|
+
u.Uf=_.Vo(k.reader);u.Vf=_.N(k.reader);n.wf.push(u)}}l.f.push(n)}g=l}}).N(_.xe,k=>{{const l=new AR;0<k.reader.Oa()?l.f=_.Zo(k.reader,k.reader.Oa()):(_.C(oQ,"mdat box is empty!"),l.f=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new BR).append([d,e]);f&&a.append([f]);b.ce()&&g&&a.append([g]);b=(new CR).append([c,a]);return new sR([b,h])},IR=function(a,b,c,d){var e=d.ce(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=DR(b,d);if(null===g)return a.request.contentType===_.K?a.data:
|
|
13
|
+
g;d=g.get(_.xe);if(a.request.contentType===_.K){e=d.f.buffer;if(c){e=_.qi(e);if((e=(new DOMParser).parseFromString(e,_.$f))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new ER(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",_.Vd];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 E=l.length;for(;n<E;n++){var p=l[n].name;if(p=p.match(m)){k=k.getAttribute(p[0]);break b}}k=null}h.setAttribute(g[y],JQ(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.ri(e).buffer}else c=e;return c}h=new CR;a=g.get("mfhd");b=new BR;k=g.get("tfhd");m=new FR(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");k.f=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.h;m++)k.push(10+6*c.f[m].$c);else g=8;b.append([c,new GR,new HR(g,k,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=new sR([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},JR=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},KR=function(a){return{initData:_.$A(_.$p(a)),initDataType:_.Wc,keyId:a,periodId:null}},LR=function(a,b,c){a=_.hq(a);c&&a.version!==c&&(a=_.bB(a,c));return{initData:_.$A(a),initDataType:_.Wc,keyId:b,periodId:null}},MR=function(a,b){return _.w(function*(){var c=_.wk(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).U;a.o=c.uri;return c})},UR=function(a,b){const c=_.O;let d=null;try{const ib=_.qi(b);d=c.j(ib,_.sb)}catch(ib){}if(!d)throw a.g.error("Unable to parse manifest"),new _.I(_.D,4,4033,a.o);const e=+NR(a,d,"MajorVersion"),f=+NR(a,d,"MinorVersion"),g=+d.getAttribute("TimeScale")||1E7;let h=+NR(a,d,"Duration");const k="TRUE"===d.getAttribute("IsLive"),l=+d.getAttribute("LookAheadCount"),m=+d.getAttribute("DVRWindowLength")||Infinity,n=c.a(d,"Protection")[0];
|
|
18
|
+
if(!1===/^[2].[0-2]$/.test(""+e+"."+f))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.I(_.D,4,4036,a.o);k?(OR(a,PR),a.B=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),h=Infinity):OR(a,QR);a.a={startTime:0,delay:0,duration:h/g,Ke:m/g,yd:0};if(n){{var p=a.f.playreadyVersion;const ib=_.O,wa=[],wb=ib.a(n,"ProtectionHeader")[0],uc=_.bm(ib.f(wb)||""),fc=_.hq(uc).a;wa.push(JR(_.wd,KR(fc),[fc]));wa.push(JR(_.ud,LR(uc,fc,p),[fc]));var u=wa}a.w=
|
|
19
|
+
u}{const ib=[],wa=_.O.a(d,"StreamIndex");if(!wa.length)throw a.g.error("No streams found!"),new _.I(_.D,4,4034,a.o);for(let wb=0;wb<wa.length;wb++){{var v=a,y=wa[wb];const uc=NR(v,y,"Type"),fc=+y.getAttribute("Chunks"),Gh=y.getAttribute("Subtype")||"",qe=y.getAttribute("Language")||_.kg,re=_.Hn(qe),Hh=y.getAttribute("Name")||"",jf=+y.getAttribute(_.Qa),mg=+y.getAttribute(_.Pa),ws=NR(v,y,"Url"),Em=+y.getAttribute("TimeScale")||null;{const ad=[],qj=_.O.a(y,_.lb);for(let se=0;se<qj.length;se++){{let bd,
|
|
20
|
+
Ma,Od;var A=v,E=qj[se],B=uc;const rj=+E.getAttribute("Index"),ng=+NR(A,E,"Bitrate");let vc=NaN,og=NaN,Fm=NaN,xs=NaN,IF=NaN,JF=NaN,KF=NaN;const LF=E.getAttribute("FourCC")||"";switch(B){case _.t:vc=+NR(A,E,_.Pa);og=+NR(A,E,_.Qa);break;case _.q:xs=+E.getAttribute("Channels")||2,Fm=+NR(A,E,"SamplingRate"),JF=+NR(A,E,"AudioTag"),IF=+NR(A,E,"BitsPerSample"),KF=+NR(A,E,"PacketSize")}let ys=String(E.getAttribute("CodecPrivateData"));if(B===_.q&&!ys){{var F=xs;const MF={96E3:0,88200:1,64E3:2,48E3:3,44100:4,
|
|
21
|
+
32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},Gm=MF[Fm];if("AACH"===LF){Ma=new Uint8Array(4);const NF=MF[2*Fm];Ma[0]=40|Gm>>1;Ma[1]=Gm<<7|F<<3|NF>>1;Ma[2]=NF<<7|8;Ma[3]=0;bd=new Uint16Array(2);bd[0]=(Ma[0]<<8)+Ma[1];bd[1]=(Ma[2]<<8)+Ma[3];Od=bd[0].toString(16)+bd[1].toString(16)}else Ma=new Uint8Array(2),Ma[0]=16|Gm>>1,Ma[1]=Gm<<7|F<<3,bd=new Uint16Array(1),bd[0]=(Ma[0]<<8)+Ma[1],Od=bd[0].toString(16);ys=Od.toUpperCase()}}var ia={id:A.V++,type:B,index:rj,bitrate:ng,Wd:ys,maxHeight:vc,
|
|
22
|
+
maxWidth:og,Gd:Fm,Yf:xs,nj:JF,wh:IF,Aj:KF,Oh:LF,segmentIndex:null}}ad.push(ia)}var Xa=ad}{const ad=[],qj=_.O.a(y,"c");for(let se=0;se<qj.length;se++){const bd=qj[se];let Ma=parseInt(bd.getAttribute("t"),10),Od=parseInt(bd.getAttribute("d"),10),rj=parseInt(bd.getAttribute("r"),10),ng=0;if(isNaN(Ma)&&isNaN(Od))throw v.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.I(_.D,4,4037,v.o);0===se&&isNaN(Ma)&&(ng=Ma=0);if(0<se){const vc=ad[ad.length-
|
|
23
|
+
1];ng=vc.n+1;vc.d||(vc.d=Ma-vc.t);Ma||(Ma=vc.t+vc.d);Od||(Od=Ma-vc.t)}ad.push({n:ng,d:Od,t:Ma});if(rj){rj--;for(let vc=0;vc<rj;vc++){const og=ad[ad.length-1];ng=og.n+1;Ma=og.t+og.d;Od=og.d;ad.push({n:ng,d:Od,t:Ma})}}}v.F()||ad.length===fc||v.g.warn("Number of fragments ("+fc+") differs from number of chunks ("+ad.length+").");var cb=ad}var rc={type:uc,rj:fc,Wi:Gh,language:re,Uc:qe,name:Hh,maxWidth:jf,maxHeight:mg,hj:ws,tracks:Xa,hg:cb,timescale:Em}}ib.push(rc)}var Ob=ib}const cc={zj:e,Ag:f,timescale:g,
|
|
24
|
+
duration:h,isLive:k,yj:l,Ke:m,Se:!1,streams:Ob};if(a.j&&a.A)return RR(a,cc),Promise.resolve();a.H.clear();{const ib=cc.timescale,wa=cc.duration,wb=BQ(cc.streams,_.q),uc=BQ(cc.streams,_.t),fc=BQ(cc.streams,_.K),Gh=[];let qe=SR(a,wa,ib,wb),re=SR(a,wa,ib,uc);const Hh=SR(a,wa,ib,fc);qe.length||(qe=[null]);re.length||(re=[null]);for(let jf=0;jf<re.length;jf++)for(let mg=0;mg<qe.length;mg++)Gh.push(TR(a,re[jf],qe[mg]));var dc={id:"ID",configurationId:void 0,startTime:0,endTime:wa,variants:Gh,textStreams:Hh,
|
|
25
|
+
thumbStreams:[]}}{var Eb=cc.streams;let ib=a.a.startTime,wa=a.a.delay;const wb=a.J;let uc=Math.min(a.a.duration||Infinity,wb);const fc=a.F(),Gh=a.a.Ke,qe=a.a.yd,re=a.I,Hh=isFinite(a.G)?a.G:0;if(fc)uc=Infinity,ib=Date.now()/1E3-qe,a.a.startTime=ib,wa=3*re;else{const mg=isFinite(wb)?wb:a.a.duration;for(const ws of Eb)for(const Em of ws.tracks)Em.segmentIndex.offset(-Hh),_.RB(Em.segmentIndex,mg)}const jf=a.f.timeline||{};jf.type=void 0;a.C=new _.sI(jf,ib,wa,!fc,!0);a.C.f=uc;_.iC(a.C,re);a.C.A=Gh;fc||
|
|
26
|
+
a.C.offset(-Hh)}a.D.filterAllPeriods([dc]);a.j={presentationTimeline:a.C,periods:[dc],minBufferTime:0,cues:[]};Promise.resolve();a.L||(a.D.networkingEngine.bd(a.M),a.L=!0);a.A=cc;return Promise.resolve()},VR=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.Wb.bind(a),b))},NR=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.I(_.D,4,4038,a.o,c);},OR=function(a,b){const c=b===QR;a.j&&a.j.presentationTimeline&&_.dC(a.j.presentationTimeline,
|
|
27
|
+
c);c&&null!=a.l&&(window.clearTimeout(a.l),a.l=null,a.B=null);a.P=b},RR=function(a,b){for(let e=0;e<a.A.streams.length;e++){const f=b.streams[e];for(const g of a.A.streams[e].tracks){var c=f.tracks.find(h=>h.type===g.type&&h.bitrate===g.bitrate);if(c){zQ(g,c)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var d=WR(a,a.A.timescale,f,c);c=g.segmentIndex;_.vC(c,d);(d=a.a.Ke)&&_.wC(c,_.tC(c)-d).forEach(h=>{h.Ea().forEach(k=>{a.H.delete(k)})})}else a.g.warn(`Cannot find satisfying update for ${g.type} `+
|
|
28
|
+
`track with bitrate ${g.bitrate}. Skipping update.`)}}},WR=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.hg.forEach((h,k)=>{const l=h.d/g;0===k?(h=h.t/g,a.G=Math.min(a.G,h)):h=f[k-1].endTime;const m=h+l,n=yQ(a.o,c,k,d);a.I=Math.max(a.I,l);f.push(new _.uC(k,h,m,()=>[n],0,null,0,null,!0,g));a.H.set(n,h);e+=l});if(c.type===_.t||c.type===_.q)b=f[f.length-1],a.J=Math.min(a.J,e),0===a.a.yd?a.a.yd=b.endTime:a.a.yd=Math.min(a.a.yd,b.endTime);return f},SR=function(a,b,c,d){let e=[];for(let f=0;f<
|
|
29
|
+
d.length;f++){const g=d[f].tracks.map(h=>{{var k=d[f],l=WR(a,c,k,h);const F=new _.tI(l);var m=null;k.type!==_.K&&(m=YR(a,b,c,k,h));h.segmentIndex=F;l=_.oI++;var n=Promise.resolve.bind(Promise),p=F.f.bind(F),u=F.get.bind(F),v=F.h.bind(F),y=F.getDuration.bind(F),A=ZR[k.type];var E="";switch(k.type){case _.t:E=h.Wd;var B=/00000001[0-9]7/.exec(E);E="avc1."+(B&&B[0]?E.substr(E.indexOf(B[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",E);break;case _.q:E=h.Wd,B=2,"AACH"===h.Oh?B=5:E&&(B=(parseInt(E.substr(0,
|
|
30
|
+
2),16)&248)>>3),E="mp4a.40."+B,a.g.debug("AUDIO CODECS: ",E)}B=k.type===_.K?$R[k.Wi]:void 0;h={id:l,originalId:null,Dj:null,createSegmentIndex:n,findSegmentPosition:p,getSegmentReference:u,adjustSegmentDurations:v,getDuration:y,segmentIndex:F,segmentLookupStrategy:_.HA,initSegmentReference:m,mimeType:A,codecs:E,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:B,encrypted:a.K(),keyId:null,language:k.language,originalLanguage:k.Uc,label:k.name,type:k.type,
|
|
31
|
+
primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Yf||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},TR=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.kg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},YR=function(a,b,c,d,e){b=AQ(b,d.timescale||c,e);c={isLive:a.F.bind(a),ce:a.K.bind(a),Wh:()=>1,be:a.R.bind(a)};d=new Uint8Array(0);
|
|
32
|
+
try{d=tR(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.I(_.D,3,4035,g);}const f="data:text/plain;base64,"+_.am(d);return new _.pI(()=>[f],0,null,null,!0)},LQ=class{constructor(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.children=[]}append(a=[]){for(let b=0;b<a.length;b++)this.children.push(a[b]),a[b].parent=this;return this}get(a){if(this.type===a)return this;for(let b=0;b<this.children.length;b++){if(this.children[b].type===
|
|
33
|
+
a)return this.children[b];{const c=this.children[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.children.length)for(let c=0;c<this.children.length;c++)b+=this.children[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?_.M(a,1):_.M(a,this.size);_.Ro(a,wQ(this.type));this.size>b&&qQ(a,this.size);"uuid"===this.type&&_.Ro(a,null);if(0<this.children.length&&
|
|
34
|
+
!this.w)for(b=0;b<this.children.length;b++)this.children[b].write(a),this.children[b].a(),a.getPosition()}},aS=class extends LQ{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);rQ(a,this.version);sQ(a,this.flags)}},rR=class extends LQ{constructor(a,b,c){super(a);this.f=b;this.offset=c}a(){return this.f.byteLength+super.a()-this.offset}write(a){super.write(a);_.Ro(a,this.f,this.offset);a.getPosition()}},xR=class extends aS{constructor(a,b,c,d,e){super(a,
|
|
35
|
+
b,c);this.f=d;this.offset=e}a(){return this.f.byteLength+super.a()-this.offset}write(a){super.write(a);_.Ro(a,this.f,this.offset);a.getPosition()}},qR=class extends LQ{constructor(a,b,c){super("ftyp");this.h=a;this.Ag=b;this.f=c}a(){let a=this.h.length;a=a+4+this.f.join("").length;return a+super.a()}write(a){super.write(a);_.Ro(a,wQ(this.h));_.M(a,this.Ag);_.Ro(a,wQ(this.f.join("")));a.getPosition()}},pR=class extends LQ{constructor(){super(_.De)}},oR=class extends LQ{constructor(){super(_.hg)}},
|
|
36
|
+
SQ=class extends aS{constructor(a,b,c){super("mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.f=[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.f.length;return a+=super.a()}write(a){super.write(a);1===this.version?(qQ(a,0),qQ(a,0),_.M(a,this.timescale),qQ(a,this.duration*this.timescale)):(_.M(a,0),_.M(a,0),_.M(a,this.timescale),_.M(a,this.duration*this.timescale));_.M(a,65536);tQ(a,this.volume);
|
|
37
|
+
tQ(a,0);_.M(a,0);_.M(a,0);for(let b=0;b<this.f.length;b++)rQ(a,this.f[b]);_.M(a,0);_.M(a,0);_.M(a,0);_.M(a,0);_.M(a,0);_.M(a,0);_.M(a,this.h);a.getPosition()}},TQ=class extends LQ{constructor(){super("mvex")}},UQ=class extends aS{constructor(a){super("trex",0,0);this.f=a}a(){return 20+super.a()}write(a){super.write(a);_.M(a,this.f);_.M(a,1);_.M(a,0);_.M(a,0);_.M(a,0);a.getPosition()}},VQ=class extends aS{constructor(a,b,c,d,e){super("tkhd",1,7);this.h=a;this.duration=b;this.timescale=c;this.width=
|
|
38
|
+
d;this.height=e;this.volume=1;this.f=[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+32:a+20;a=a+24+this.f.length;return a+super.a()}write(a){super.write(a);1===this.version?(qQ(a,0),qQ(a,0),_.M(a,this.h),_.M(a,0),qQ(a,this.duration*this.timescale)):(_.M(a,0),_.M(a,0),_.M(a,this.h),_.M(a,0),_.M(a,this.duration*this.timescale));_.M(a,0);_.M(a,0);tQ(a,0);tQ(a,0);tQ(a,this.volume);tQ(a,0);for(let b=0;b<this.f.length;b++)rQ(a,this.f[b]);tQ(a,
|
|
39
|
+
this.width);tQ(a,0);tQ(a,this.height);tQ(a,0);a.getPosition()}},WQ=class extends aS{constructor(a,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?(qQ(a,0),qQ(a,0),_.M(a,this.timescale),qQ(a,this.duration*this.timescale)):(_.M(a,0),_.M(a,0),_.M(a,this.timescale),_.M(a,this.duration*this.timescale));tQ(a,this.language);tQ(a,0);a.getPosition()}},XQ=class extends aS{constructor(a){super("hdlr",
|
|
40
|
+
0,0);this.f=a}a(){return 33+super.a()}write(a){super.write(a);_.M(a,0);this.f===_.t?_.Ro(a,wQ("vide")):_.Ro(a,wQ("soun"));_.M(a,0);_.M(a,0);_.M(a,0);this.f===_.t?_.Ro(a,wQ("VideoHandler\x00")):_.Ro(a,wQ("SoundHandler\x00"));a.getPosition()}},cR=class extends aS{constructor(){super("vmhd",0,1);this.f=new Uint8Array([0,0,0,0,0,0])}a(){return 2+this.f.byteLength+super.a()}write(a){super.write(a);tQ(a,0);_.Ro(a,this.f);a.getPosition()}},bS=class extends LQ{constructor(a){super(a);this.w=!0}a(){return 8+
|
|
41
|
+
super.a()}write(a){super.write(a);_.M(a,0);tQ(a,0);tQ(a,1)}},cS=class extends bS{constructor(a){super(a);this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);tQ(a,0);tQ(a,0);_.M(a,0);_.M(a,0);_.M(a,0);tQ(a,this.width);tQ(a,this.height);_.M(a,4718592);_.M(a,4718592);_.M(a,0);tQ(a,1);rQ(a,10);_.Ro(a,wQ("AVC Coding",31));tQ(a,this.depth);vQ(a,-1)}},dS=class extends bS{constructor(a,b,c,d){super(a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d}a(){return 20+
|
|
42
|
+
super.a()}write(a){super.write(a);_.M(a,0);_.M(a,0);tQ(a,this.channelCount);tQ(a,this.sampleSize);vQ(a,0);tQ(a,0);tQ(a,this.sampleRate);tQ(a,0)}},bR=class extends cS{constructor(a,b){super("avc1");this.width=a;this.height=b}write(a){super.write(a);for(let b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()}},MQ=class extends bR{constructor(a,b){super(a,b);this.type="encv"}},eR=class extends dS{constructor(a,b,c){super("mp4a",a,b,c)}write(a){super.write(a);for(let b=0;b<this.children.length;b++)this.children[b].write(a);
|
|
43
|
+
a.getPosition()}},NQ=class extends eR{constructor(a,b,c){super(a,b,c);this.type="enca"}},aR=class extends LQ{constructor(a,b){super("avcC");this.Za=a;this.hc=b;this.version=1;this.f=this.Za[0][1];this.h=this.Za[0][2];this.level=this.Za[0][3]}a(){let a=7;for(var b=0;b<this.Za.length;b++)a+=2,a+=this.Za[b].byteLength;for(b=0;b<this.Za.length;b++)a+=2,a+=this.hc[b].byteLength;return a+super.a()}write(a){super.write(a);rQ(a,this.version);rQ(a,this.f);rQ(a,this.h);rQ(a,this.level);rQ(a,255);rQ(a,224|this.Za.length);
|
|
44
|
+
for(var b=0;b<this.Za.length;b++)tQ(a,this.Za[b].length),_.Ro(a,this.Za[b]);rQ(a,this.hc.length);for(b=0;b<this.hc.length;b++)tQ(a,this.hc[b].length),_.Ro(a,this.hc[b]);a.getPosition()}},dR=class extends aS{constructor(a){super("esds",0,0);this.cc=a}a(){return 22+(this.cc.byteLength+3)+super.a()}write(a){super.write(a);rQ(a,3);rQ(a,23+this.cc.byteLength);tQ(a,1);rQ(a,0);rQ(a,4);rQ(a,15+this.cc.byteLength);rQ(a,64);rQ(a,21);sQ(a,0);_.M(a,0);_.M(a,0);rQ(a,5);rQ(a,this.cc.byteLength);_.Ro(a,this.cc);
|
|
45
|
+
_.Ro(a,new Uint8Array([6,1,2]));a.getPosition()}},ZQ=class extends aS{constructor(a=""){super("url ",0,1);this.location=a}a(){return this.location.length+super.a()}write(a){super.write(a);0<this.location.length&&_.Ro(a,wQ(this.location));a.getPosition()}},YQ=class extends aS{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);_.M(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);
|
|
46
|
+
a.getPosition()}},gR=class extends LQ{constructor(){super(_.Sf)}},$Q=class extends aS{constructor(){super(_.Uf,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);_.M(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},hR=class extends aS{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);
|
|
47
|
+
_.M(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},iR=class extends aS{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);_.M(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},kR=class extends aS{constructor(){super("stco",0,0)}a(){let a=4;for(let b=0;b<this.entries.length;b++)a+=this.entries[b].a();
|
|
48
|
+
return a+super.a()}write(a){super.write(a);_.M(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},jR=class extends aS{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.M(a,0);_.M(a,0);a.getPosition()}},fR=class extends aS{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);vQ(a,0);tQ(a,0);a.getPosition()}},lR=class extends LQ{constructor(){super("dinf")}},mR=class extends LQ{constructor(){super(_.Ce)}},
|
|
49
|
+
nR=class extends LQ{constructor(){super(_.ye)}},FR=class extends aS{constructor(a,b){super("tfdt",a,0);this.baseMediaDecodeTime=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?qQ(a,this.baseMediaDecodeTime):_.M(a,this.baseMediaDecodeTime);a.getPosition()}},uR=class extends aS{constructor(){super("mfhd",0,0);this.f=0}a(){return 4+super.a()}write(a){super.write(a);_.M(a,this.f);a.getPosition()}},wR=class extends aS{constructor(a,b){super("trun",a,
|
|
50
|
+
b);this.l=this.j=this.f=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]}a(){let a=4;this.flags&1&&(a+=4);this.flags&4&&(a+=4);for(let b=0;b<this.f;b++)this.flags&256&&(a+=4),this.flags&512&&(a+=4),this.flags&1024&&(a+=4),this.flags&2048&&(a+=4);return a+super.a()}write(a){super.write(a);_.M(a,this.f);this.flags&1&&(a.getPosition(),uQ(a,this.j));this.flags&4&&_.M(a,this.l);for(let b=0;b<this.f;b++)this.flags&256&&_.M(a,this.o[b]),this.flags&512&&_.M(a,this.sampleSize[b]),this.flags&1024&&_.M(a,
|
|
51
|
+
this.A[b]),this.flags&2048&&(0===this.version?_.M(a,this.h[b]):uQ(a,this.h[b]));a.getPosition()}},vR=class extends aS{constructor(a,b){super("tfhd",a,b);this.f=255;this.l=this.o=this.j=this.A=this.h=0}a(){let a=4;this.flags&1&&(a+=8);this.flags&2&&(a+=4);this.flags&8&&(a+=4);this.flags&16&&(a+=4);this.flags&32&&(a+=4);return a+super.a()}write(a){super.write(a);_.M(a,this.f);this.flags&1&&qQ(a,this.h);this.flags&2&&_.M(a,this.A);this.flags&8&&_.M(a,this.j);this.flags&16&&_.M(a,this.o);this.flags&32&&
|
|
52
|
+
_.M(a,this.l);a.getPosition()}},BR=class extends LQ{constructor(){super("traf")}},CR=class extends LQ{constructor(){super("moof")}},AR=class extends LQ{constructor(){super(_.xe);this.f=new Uint8Array(0)}a(){return this.f.byteLength+super.a()}write(a){super.write(a);0<this.f.byteLength&&_.Ro(a,this.f)}},OQ=class extends aS{constructor(){super("tenc",0,0);this.f=1;this.h=8;this.l="";this.j=[]}a(){let a;a=20;1===this.f&&0===this.h&&(a=a+1+this.j.length);return a+super.a()}write(a){super.write(a);rQ(a,
|
|
53
|
+
0);0===this.version?rQ(a,0):rQ(a,0);rQ(a,this.f);rQ(a,this.h);_.Ro(a,_.cm(this.l));if(1===this.f&&0===this.h){rQ(a,0);for(let b=0;b<this.j.length;b++)rQ(a,this.j[b])}a.getPosition()}},QQ=class extends aS{constructor(a,b){super("schm",0,0);this.f=a;this.h=b;this.Yb=""}a(){let a=8;this.flags&1&&(a+=wQ(this.Yb).byteLength);return a+super.a()}write(a){super.write(a);_.Ro(a,wQ(this.f));_.M(a,this.h);this.flags&1&&_.Ro(a,wQ(this.Yb));a.getPosition()}},PQ=class extends LQ{constructor(a){super("frma");this.f=
|
|
54
|
+
a}a(){return wQ(this.f).byteLength+super.a()}write(a){super.write(a);_.Ro(a,wQ(this.f));a.getPosition()}},GR=class extends aS{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&&(_.M(a,0),_.M(a,0));_.M(a,1);for(let b=0;1>b;b++)0===this.version?_.M(a,this.offset[b]):qQ(a,this.offset[b]);a.getPosition()}},HR=class extends aS{constructor(a,b,c){super("saiz",0,0);this.f=
|
|
55
|
+
a;this.j=b;this.h=c}a(){let a=0;this.flags&1&&(a+=8);a+=5;0===this.f&&(a+=this.j.length);return a+super.a()}write(a){super.write(a);this.flags&1&&(_.M(a,0),_.M(a,0));rQ(a,this.f);_.M(a,this.h);if(0===this.f)for(let b=0;b<this.h;b++)rQ(a,this.j[b]);a.getPosition()}},zR=class extends aS{constructor(a,b){super("senc",a,b);this.h=0;this.j=8;this.f=[]}a(){let a=4;this.flags&1&&(a+=1);for(let b=0;b<this.h;b++)if(a+=this.f[b].tg.byteLength,this.flags&2){a+=2;for(let c=0;c<this.f[b].$c;c++)a+=2,a+=4}return a+
|
|
56
|
+
super.a()}write(a){super.write(a);_.M(a,this.h);this.flags&1&&rQ(a,this.j);for(let b=0;b<this.h;b++)if(_.Ro(a,this.f[b].tg),this.flags&2){tQ(a,this.f[b].$c);for(let c=0;c<this.f[b].$c;c++)tQ(a,this.f[b].wf[c].Uf),_.M(a,this.f[b].wf[c].Vf)}a.getPosition()}};var ER=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))}},DQ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,EQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,FQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,GQ=/^(\d*\.?\d*)f$/,HQ=/^(\d*\.?\d*)t$/,IQ=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var sR=class{constructor(a){this.a=a;this.f=KQ(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=KQ(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var yR=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var eS=class{constructor(){this.A=this.j=this.f=this.D=null;this.h=1;this.V=0;this.o="";this.C=this.a=null;this.g=new _.T("clpp.smooth.SmoothParser");this.L=!1;this.l=this.B=null;this.P=QR;this.I=0;this.G=this.J=Infinity;this.w=[];this.M=this.T.bind(this);this.H=new Map}configure(a){this.f=a}start(a,b){this.D=b;a=[...new Set([a,xQ(a)])];return MR(this,a).then(c=>UR(this,c.data).then(()=>{VR(this,this.B);return this.j}))}requestStop(){}stop(){this.D&&this.D.networkingEngine.we(this.M);this.B=this.A=
|
|
57
|
+
this.j=this.f=this.D=null;this.l&&(clearTimeout(this.l),this.l=null);this.L=!1;this.J=this.G=Infinity;return Promise.resolve()}update(){if(this.F())return MR(this,[this.o]).then(a=>UR(this,a.data).then(()=>this.j)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Wb(){this.g.debug(_.xA);this.D&&(this.l=null,this.update().then(()=>{VR(this,this.B)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&VR(this,100))}))}F(){return this.P===PR}K(){return 0<this.w.length}R(a){let b=null;if(this.w.length)for(let c=
|
|
58
|
+
0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[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.A.timescale,c={isLive:this.F.bind(this),ce:this.K.bind(this),Wh:()=>1,be:this.R.bind(this)};let d=!1;const e=new _.I(_.D,3,4035,null);let f=null;try{const g=this.H.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=IR(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)}loadVariant(a){return _.w(function*(){return a})}loadTextStream(a,b){const c=this;return _.w(function*(){let d;const e=c.j.periods.find(f=>f.id===b);e&&(d=e.textStreams.find(f=>f.id===a)||null);if(!d)throw new _.ql(`Could not load text stream with id: ${a}`);return d})}},ZR={video:_.zg,audio:_.Hc,text:_.Bc},QR=_.Fb,PR=
|
|
60
|
+
"LIVE",$R={jj:_.CA,kj:_.RA};_.x("clpp.smooth.SmoothComponent",class extends _.yv{install(){_.Et.ism=eS;_.Dt[_.Cc]=eS}uninstall(){_.QC("ism");_.RC(_.Cc)}id(){return _.Nf}});};f.call(g, window);
|