@castlabs/prestoplay 6.28.0 → 6.29.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 +15 -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 +123 -113
- package/cjs/cl.conviva.js +28 -28
- package/cjs/cl.core.js +616 -609
- package/cjs/cl.crypto.js +7 -7
- package/cjs/cl.dash.js +89 -89
- package/cjs/cl.externs.js +127 -34
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +79 -78
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +24 -24
- package/cjs/cl.ima.js +24 -23
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +350 -350
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +70 -70
- 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 +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -6
- package/cl.cast.js +98 -91
- package/cl.conviva.js +27 -27
- package/cl.core.js +492 -488
- package/cl.crypto.js +8 -8
- package/cl.dash.js +82 -82
- package/cl.externs.js +123 -34
- 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 +16 -15
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +303 -304
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- 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 +187 -87
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 _.H(1,9,9301);
|
|
13
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var fA=function(a){switch(a.type){case 1:return cA;case 2:return dA;case 3:return eA}},hA=function(a){const b=Object.keys(a).find(c=>gA.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},jA=function(a){let b={debug:!0,data:iA(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 _.mp(c.url);e.video_source_url=_.Tm(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},kA=function(a){_.Xh(a.a);a.j.se(a.F);a.j.Kg(a.C)},iA=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},lA=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,_.Lc,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,_.Sb,()=>a.emit("adbreakstart"));a.a.on(a.m,_.Tb,()=>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,_.Xb,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.gc,()=>a.emit("admidpoint"));a.a.on(a.m,_.nc,()=>a.emit("adthirdquartile"));a.j.Yc(a.F);a.j.Df(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 _.mp(b.uris[b.uriIndex]);b={request_start:c,request_type:fA(b),request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.mp(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:fA(c),request_hostname:f.a,request_error:`${fA(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},mA=function(a,b){a.trigger(new _.G(_.Xd,{detail:b}))},nA=function(a){return!_.z(a)&&typeof a.init===_.ae&&typeof a.emit===_.ae},cA="manifest",dA="media",eA="encryption",gA=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var oA=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 _.Qt;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,jA(this))}catch(d){throw this.h=!1,kA(this),new _.H(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=iA(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);lA(this)}release(){this.g.debug("release()");this.l?this.g.debug(_.ja):(kA(this),this.l=!0,this.o=this.f=null)}destroy(){this.g.debug(_.Cd);this.A?this.g.debug(_.ia):(this.A=!0,this.emit("destroy"))}emit(a,b){if(null===this.w)throw new _.H(1,9,9301);this.w.emit(this.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.Ma())&&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===_.C){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 _.mp(b.uris[b.uriIndex]);a={request_start:g,request_type:fA(b),request_hostname:d.a,request_id:hA(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.Tm(d)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}J(a){a.requestStartTimestamp=Date.now()}};var pA=class extends _.Uv{constructor(){super();this.f=this.m=null;this.a=!1;this.g=new _.S("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new oA(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 _.H(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=nA(g.muxLib)?g.muxLib:window.mux;if(!nA(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.H(1,9,9301);mA(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,mA(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&&mA(this.m,c),c;}}};_.x("clpp.muxdata.MuxDataPlugin",pA);pA.prototype.emit=pA.prototype.emit;
|
|
13
|
+
pA.Id="mux";_.Wn(new class{create(){return new pA}});};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 bA=function(a,b){let c=b.baseUrl;_.xi(c,"/")||(c+="/");var d=h=>h&&(_.wi(h,_.fe)||_.wi(h,"http://")||_.wi(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=_.Uo("V2");a=new _.Fu(a);a.Xa(_.vd,{licenseUrl:e,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:_.Vo(b,g),modifiers:{licenseRequest:_.Bp,
|
|
2
|
+
licenseResponse:_.Cp}});a.Xa(_.rd,{licenseUrl:d,certificateUrl:d,modifiers:{licenseRequest:_.Ep,licenseResponse:_.Fp,extractContentId:_.Gp,certificateRequest:_.Hp}});a.Xa(_.td,{licenseUrl:f,modifiers:{licenseRequest:_.Bp}});_.qn(a)};
|
|
3
|
+
_.x("clpp.onboard.OnboardComponent",class extends _.Ev{constructor(){super();this.g=new _.S("clpp.onboard");this.a=new Set}uninstall(){for(const a of this.a)delete _.pn[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
|
+
bA(b,a),this.a.add(b))}id(){return"onboard"}});_.x("clpp.onboard.register",bA);};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
|
-
audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.
|
|
3
|
-
|
|
4
|
-
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Mz="A persistent DRM session already exists for: ",Nz="No DRM configuration.",Oz="clpp.persistent",Pz="clpp.persistent.SimpleSessionStorage",Qz=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},Sz=function(a,b,c,d,e,f){a.K=Rz;const g=new Map,h=_.qq(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,
|
|
2
|
+
audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Iq(a,g)},Uz=function(a,b){a.K=Tz;a.L=[];a.G=!0;return _.Jq(a,b)},Vz=function(a,b){return _.w(function*(){const c=yield _.$q(a,b);if(c){var d=[],e=a.h.get(c);e&&a.C&&(e.ic=new _.Jl,d.push(e.ic));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)})},Wz=function(a){a=a.h.keys();a=Qz(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
Xz=function(a,b){const c=_.sn(a),d=_.hn([{drm:a}]);d.drm=a;a=new _.Is({ub:b,onError:()=>{},Ue:()=>{},Te:()=>{},onEvent:()=>{},getConfiguration:()=>d,Nc:()=>null});a.f=c;return a},$z=function(a,b,c){return _.w(function*(){const d=Yz;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)Zz.debug(Mz,e);else{var g=Xz(a,c);try{yield Uz(g,b);yield _.Yq(g);yield _.ar(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.$m(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:Wz(g),
|
|
4
|
+
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw Zz.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Zz.debug(Nz)})},Tz=1,Rz=2,aA=class{constructor(){this.g=new _.S(Pz)}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
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.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
|
|
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 _.H(_.C,4,4014));const m=_.
|
|
9
|
-
_.x("clpp.persistent.removeLicense",function(a){return _.w(function*(){var b=
|
|
10
|
-
new _.H(1,6,6201,null,e);}finally{b=[],c&&b.push(c.destroy()),d&&b.push(d.destroy()),yield Promise.all(b)}}else
|
|
11
|
-
const c=
|
|
6
|
+
g=e.audioCapabilities||[],h=e.videoCapabilities||[],k=e.serverCertificate||[],l=e.drmConfig||{};var d={sessionIds:f,keySystem:e.keySystem,licenseServerUri:decodeURIComponent(e.licenseServerUri||""),serverCertificate:k?new Uint8Array(k):null,audioCapabilities:g,videoCapabilities:h,drmConfig:l}}return d}catch(e){b.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 Pz}};_.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 Zz.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});Yz=a});
|
|
7
|
+
_.x("clpp.persistent.fetchLicense",function(a,b,...c){return _.w(function*(){var d=Yz,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.mn(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Nz);var g=b.offlineId;if(typeof g!==_.Tf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Zz.debug(Mz,g);else{var h=_.fn();d=new _.Kn;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 _.It(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 _.H(_.C,4,4014));const m=_.xt(l.periods);yield $z(b,m,d)}catch(l){if(l instanceof _.H&&6200===l.code)throw l;throw e(null,l);}finally{for(;g.length;)e=g.shift(),e.uninstall(),_.Hh.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=Yz;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 _.Kn,c=Xz(e.drmConfig,d),yield Sz(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.Yq(c),yield Promise.all(e.sessionIds.map(f=>_.w(function*(){yield Vz(c,f);Zz.debug("successfully removed session with id",f)}))),yield b.delete(a)):Zz.debug("No persistent DRM session found")}catch(e){throw Zz.error("Failed to remove session"),
|
|
10
|
+
new _.H(1,6,6201,null,e);}finally{b=[],c&&b.push(c.destroy()),d&&b.push(d.destroy()),yield Promise.all(b)}}else Zz.warn("Invalid offlineId")})});_.x("clpp.persistent.getSessionStorage",function(){return Yz});var Yz=new aA,Zz=new _.S(Oz);_.x("clpp.persistent.PersistentLicenseComponent",class extends _.Ev{constructor(){super();this.g=new _.S(Oz)}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 $z(d,b,e),a.trigger(new _.G(_.Nd,{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=Yz;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 _.G(_.hf,{item:d})))}})}append(a){this.a.push(a);
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Jz=function(a,b){return 0<=b&&b<a.a.length},Kz=function(a){a.trigger(new _.G(_.jf))},Lz=class extends _.Tt{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.Aa.bind(this)}getPosition(){return this.f}kd(){return this.a}Db(){return 0<this.a.length&&Jz(this,this.f)?this.a[this.f]:null}ig(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&Jz(this,a)?this.a[a]:null}ai(){return this.h}start(){this.h||(this.h=!0,this.m.on(_.Wd,this.j),this.Pc(this.f,!0))}stop(){this.h=!1;this.m.off(_.Wd,this.j)}Aa(){this.next()}next(){const a=this;return _.w(function*(){yield a.Pc(Math.min(a.a.length-1,a.f+1))})}Dd(){const a=this;return _.w(function*(){yield a.Pc(Math.max(0,a.f-1))})}Pc(a,b){b=void 0===b?!1:b;const c=this;return _.w(function*(){if(0<c.a.length&&Jz(c,a)&&(b||c.f!==a)){c.f=a;var d=c.Db();d&&!1===d.skippable||!d||(yield c.l(d),
|
|
3
|
+
yield c.m.load(d.configuration),c.trigger(new _.G(_.hf,{item:d})))}})}append(a){this.a.push(a);Kz(this)}ng(a,b){if(0<=b&&b<=this.a.length){const c=this.Db();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Kz(this)}}remove(a){if(0<this.a.length&&Jz(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Kz(this)}}clear(){this.stop();this.f=0;this.a=[];this.h=!1;Kz(this)}};_.x("clpp.Playlist",Lz);Lz.prototype.clear=Lz.prototype.clear;Lz.prototype.remove=Lz.prototype.remove;
|
|
4
|
+
Lz.prototype.insert=Lz.prototype.ng;Lz.prototype.append=Lz.prototype.append;Lz.prototype.goTo=Lz.prototype.Pc;Lz.prototype.previous=Lz.prototype.Dd;Lz.prototype.next=Lz.prototype.next;Lz.prototype.onEnded=Lz.prototype.Aa;Lz.prototype.stop=Lz.prototype.stop;Lz.prototype.start=Lz.prototype.start;Lz.prototype.isStarted=Lz.prototype.ai;Lz.prototype.getUpcoming=Lz.prototype.ig;Lz.prototype.getCurrent=Lz.prototype.Db;Lz.prototype.getQueue=Lz.prototype.kd;Lz.prototype.getPosition=Lz.prototype.getPosition;
|
|
5
|
+
Lz.prototype.off=Lz.prototype.off;Lz.prototype.one=Lz.prototype.one;Lz.prototype.on=Lz.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 _.G(_.
|
|
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 _.H(1,10,10100,"No player container found");return a}getSurface(){const a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.H(1,10,10100,"No surface");return a}
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var sz="No surface found. Can not attach frame!",tz="SIMID:Media:timeupdate",uz="Starting creative",vz=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},yz=function(a,b){return new Promise((c,d)=>{new wz(a.j,c,d,b);xz(a,b)})},zz=function(a){const b=vz(a,"SIMID:Player:startCreative",void 0);yz(a,b).then(()=>{var c=a.f;c.g.info(uz);c.m.trigger(new _.G(_.Kf));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.g.error("Error while starting creative",
|
|
2
|
+
c)})},Bz=function(a,b){_.w(function*(){a.h=b.sessionId;Az(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=vz(a,"SIMID:Player:init",d);var e=yz(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()}})},Az=function(a,b){xz(a,vz(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},xz=function(a,b){a.h?(b.type!==tz&&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}'`)},Cz=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=vz(d,"SIMID:Player:resize",e);xz(d,e)}})},Dz=function(a,b){a.g.info("SIMID Session created");a.a=b},Ez=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 _.G(_.Lf))},Fz=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}%`}},Gz=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(_.bd);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":Bz(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=Fz(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=Fz(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);Az(this,c)}else this.g.warn("WARNING: received message without 'type' property")};this.g=new _.S("clpp.simid.SimidPlayer");Dz(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(){Ez(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)}},wz=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 Iz=class extends _.Uv{constructor(){super();this.g=new _.S("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.A.bind(this);this.f=null;this.o=!1}id(){return"simid"}onPlayerCreated(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new Hz(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 Gz(this.h,b.simid),b=c.getContainer(),this.j=Cz(this,b,c),this.j.observe(b),a.on(_.fg,this.w)):this.g.warn(sz)}}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&&(zz(this.a),this.o=!0,this.g.info(uz)),
|
|
13
|
+
c&&(c=this.a,xz(c,vz(c,tz,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(sz),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))}},Hz=class{constructor(a){this.m=a;this.a=null;this.g=new _.S("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 _.H(1,10,10100,"No player container found");return a}getSurface(){const a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.H(1,10,10100,"No surface");return a}gg(){return this.a}url(){return this.f?this.f.url:""}};_.Wn(new class{create(){return new Iz}});};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.Ya=[_.
|
|
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=_.M(k.reader));d=m}}).ea("trun",k=>{{var l=k.reader.
|
|
11
|
-
2048&&(0===k.version?m.h.push(_.M(k.reader)):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 D=l.length;for(;n<D;n++){var p=l[n].name;if(p=p.match(m)){k=k.getAttribute(p[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.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 _.H(_.C,4,4036,a.o);k?(
|
|
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),D="mp4a.40."+E,a.g.debug("AUDIO CODECS: ",D)}E=k.type===_.J?
|
|
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?_.L(a,1):_.L(a,this.size);_.
|
|
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);_.L(a,0);this.f===_.t?_.
|
|
41
|
-
super.a()}write(a){super.write(a);_.L(a,0);
|
|
42
|
-
super.a()}write(a){super.write(a);_.L(a,0);_.L(a,0);
|
|
43
|
-
a.getPosition()}},
|
|
44
|
-
for(var b=0;b<this.Ya.length;b++)
|
|
45
|
-
_.
|
|
46
|
-
a.getPosition()}},
|
|
47
|
-
_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},
|
|
48
|
-
return a+super.a()}write(a){super.write(a);_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},
|
|
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 uQ="Full MP4 box must have flags defined",vQ="clpp.smooth.SmoothMP4Processor",wQ="codecPrivateData",xQ=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.L(a,c);_.L(a,b)},yQ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Wo()}},zQ=function(a,b){yQ(a,b>>16&255);yQ(a,b>>8&255);yQ(a,b&255)},AQ=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.Wo()}},BQ=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.Wo()}},CQ=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.h),a.a+=2}catch(c){_.Wo()}},DQ=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},EQ=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},FQ=function(a,b,c,d){c=b.$f[c];b=b.aj;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 _.tB([a],[b])[0]},GQ=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.t?c=["maxWidth","maxHeight","bitrate",wQ,"fourCC"]:a.type===_.q&&(c=["bitrate",wQ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.lh(a,b,c,["id","segmentIndex"])},HQ=function(a,b,c){const d=c.Ud.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ya:null,dc:null,width:NaN,height:NaN,$b:null,Ed:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.t:a.Ya=[_.im(d[1])];a.dc=[_.im(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.q:a.$b=_.im(c.Ud),a.sampleSize=c.ph||16,a.Ed=c.Ed,a.channelCount=c.Qf}return a},IQ=function(a,b){return a.filter(c=>c.type===b)},JQ=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)},QQ=function(a,b,c){var d=null;if(KQ.test(a)){{a=KQ.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 LQ.test(a)?d=JQ(LQ,a):MQ.test(a)?d=JQ(MQ,a):NQ.test(a)?(a=NQ.exec(a),d=Number(a[1])/c.frameRate):OQ.test(a)?(a=OQ.exec(a),d=Number(a[1])/c.a):PQ.test(a)&&(d=JQ(PQ,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},RQ=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.qp(b)},YQ=function(a,b,c){a:{var d=[_.vd,_.td];for(e of d)if((d=c.$d(e))&&d.keyId){var e=d.keyId;break a}_.B(vQ,"Could not get default Key ID for DRM init data!");e=null}c=new SQ("xxxx");a.type===_.t?c=new TQ(a.width,a.height):c=new UQ(a.channelCount,a.sampleSize,a.Ed);a=new VQ;a.f=1;a.h=8;a.l=e||"00000000000000000000000000000000";a=(new SQ("schi")).append([a]);b=(new SQ(_.Mf)).append([new WQ(b),new XQ(_.Uc,65536),a]);c.append([b]);return c},
|
|
7
|
+
AR=function(a,b){var c=b.ae(),d=new ZQ(a.timescale,a.duration,a.id),e=(new $Q).append([new aR(a.id)]),f=new bR(a.id,a.duration,a.timescale,a.width,a.height),g=new cR(a.timescale,a.duration);const h=new dR(a.type);var k=null,l=new eR;l.entries=[new fR];var m=new gR;switch(a.type){case _.t:k=new hR(a.Ya,a.dc);c?(a=YQ(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new iR(a.width,a.height)).append([k]),m.entries=[a]);k=new jR;break;case _.q:k=new kR(a.$b),c?(a=YQ(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new lR(a.channelCount,a.sampleSize,a.Ed)).append([k]),m.entries=[a]),k=new mR}m=(new nR).append([m,new oR,new pR,new qR,new rR]);l=(new sR).append([l]);l=(new tR).append([k,l,m]);g=(new uR).append([g,h,l]);f=(new vR).append([f,g]);d=(new wR).append([d,f,e]);e=new xR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.$d(_.td),b=b.$d(_.vd),c&&d.append([new yR("pssh",c.initData,8)]),b&&d.append([new yR("pssh",b.initData,8)]),c||b||_.B(vQ,"Could not get PSSH init data!"));b=new zR([e,d]);return _.F(b.write())},
|
|
9
|
+
KR=function(a,b){let c,d,e,f,g,h;(new _.op).N("moof",_.hp).ea("mfhd",k=>{{const l=new BR;l.f=_.M(k.reader);c=l}}).N("traf",_.hp).ea("tfhd",k=>{{const l=k.reader.Na();if(null===k.flags)throw new _.H(_.C,3,3019,uQ);const m=new CR(k.version||0,k.flags||0);m.f=_.M(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.h=_.cp(k.reader));0<l-k.reader.getPosition()&&k.flags&2&&(m.A=_.M(k.reader));0<l-k.reader.getPosition()&&k.flags&8&&(m.j=_.M(k.reader));0<l-k.reader.getPosition()&&k.flags&16&&(m.o=_.M(k.reader));
|
|
10
|
+
0<l-k.reader.getPosition()&&k.flags&32&&(m.l=_.M(k.reader));d=m}}).ea("trun",k=>{{var l=k.reader.Na();if(null===k.flags)throw new _.H(_.C,3,3019,uQ);const m=new DR(k.version||0,k.flags||0);m.f=_.M(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.bp(k.reader));0<l-k.reader.getPosition()&&k.flags&4&&(m.l=_.M(k.reader));if(0<l-k.reader.getPosition())for(l=0;l<m.f;l++)k.flags&256&&m.o.push(_.M(k.reader)),k.flags&512&&m.sampleSize.push(_.M(k.reader)),k.flags&1024&&m.A.push(_.M(k.reader)),k.flags&
|
|
11
|
+
2048&&(0===k.version?m.h.push(_.M(k.reader)):m.h.push(_.bp(k.reader)));e=m}}).ea("sdtp",k=>{{const l=_.ep(k.reader,k.reader.Na());f=new ER("sdtp",k.version||0,k.flags||0,l,0)}}).N("uuid",k=>{var l=_.ep(k.reader,16);if(_.km(l,FR)){l=_.M(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new GR(k.version,k.flags);l.h=_.M(k.reader);k.flags&1&&(l.j=_.$o(k.reader));for(let m=0;m<l.h;m++){const n={mg:_.ep(k.reader,8),Xc:0,mf:[]};if(k.flags&2){n.Xc=_.ap(k.reader);for(let p=0;p<n.Xc;p++){const u={Mf:0,Nf:0};
|
|
12
|
+
u.Mf=_.ap(k.reader);u.Nf=_.M(k.reader);n.mf.push(u)}}l.f.push(n)}g=l}}).N(_.xe,k=>{{const l=new HR;0<k.reader.Na()?l.f=_.ep(k.reader,k.reader.Na()):(_.B(vQ,"mdat box is empty!"),l.f=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new IR).append([d,e]);f&&a.append([f]);b.ae()&&g&&a.append([g]);b=(new JR).append([c,a]);return new zR([b,h])},PR=function(a,b,c,d){var e=d.ae(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=KR(b,d);if(null===g)return a.request.contentType===_.J?a.data:
|
|
13
|
+
g;d=g.get(_.xe);if(a.request.contentType===_.J){e=d.f.buffer;if(c){e=_.si(e);if((e=(new DOMParser).parseFromString(e,_.$f))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new LR(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 D=l.length;for(;n<D;n++){var p=l[n].name;if(p=p.match(m)){k=k.getAttribute(p[0]);break b}}k=null}h.setAttribute(g[y],QQ(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.ti(e).buffer}else c=e;return c}h=new JR;a=g.get("mfhd");b=new IR;k=g.get("tfhd");m=new MR(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].Xc);else g=8;b.append([c,new NR,new OR(g,k,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=new zR([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},QR=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},RR=function(a){return{initData:_.gB(_.fq(a)),initDataType:_.Uc,keyId:a,periodId:null}},SR=function(a,b,c){a=_.nq(a);c&&a.version!==c&&(a=_.iB(a,c));return{initData:_.gB(a),initDataType:_.Uc,keyId:b,periodId:null}},TR=function(a,b){return _.w(function*(){var c=_.yk(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})},bS=function(a,b){const c=_.N;let d=null;try{const fb=_.si(b);d=c.j(fb,_.qb)}catch(fb){}if(!d)throw a.g.error("Unable to parse manifest"),new _.H(_.C,4,4033,a.o);const e=+UR(a,d,"MajorVersion"),f=+UR(a,d,"MinorVersion"),g=+d.getAttribute("TimeScale")||1E7;let h=+UR(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 _.H(_.C,4,4036,a.o);k?(VR(a,WR),a.B=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),h=Infinity):VR(a,YR);a.a={startTime:0,delay:0,duration:h/g,Ge:m/g,xd:0};if(n){{var p=a.f.playreadyVersion;const fb=_.N,ua=[],rb=fb.a(n,"ProtectionHeader")[0],sc=_.hm(fb.f(rb)||""),ec=_.nq(sc).a;ua.push(QR(_.vd,RR(ec),[ec]));ua.push(QR(_.td,SR(sc,ec,p),[ec]));var u=ua}a.w=
|
|
19
|
+
u}{const fb=[],ua=_.N.a(d,"StreamIndex");if(!ua.length)throw a.g.error("No streams found!"),new _.H(_.C,4,4034,a.o);for(let rb=0;rb<ua.length;rb++){{var v=a,y=ua[rb];const sc=UR(v,y,"Type"),ec=+y.getAttribute("Chunks"),Ih=y.getAttribute("Subtype")||"",pe=y.getAttribute("Language")||_.kg,qe=_.Nn(pe),Jh=y.getAttribute("Name")||"",kf=+y.getAttribute(_.Qa),lg=+y.getAttribute(_.Pa),us=UR(v,y,"Url"),Cm=+y.getAttribute("TimeScale")||null;{const $c=[],pj=_.N.a(y,_.jb);for(let re=0;re<pj.length;re++){{let ad,
|
|
20
|
+
La,Pd;var A=v,D=pj[re],E=sc;const qj=+D.getAttribute("Index"),mg=+UR(A,D,"Bitrate");let tc=NaN,ng=NaN,Dm=NaN,vs=NaN,AF=NaN,BF=NaN,CF=NaN;const DF=D.getAttribute("FourCC")||"";switch(E){case _.t:tc=+UR(A,D,_.Pa);ng=+UR(A,D,_.Qa);break;case _.q:vs=+D.getAttribute("Channels")||2,Dm=+UR(A,D,"SamplingRate"),BF=+UR(A,D,"AudioTag"),AF=+UR(A,D,"BitsPerSample"),CF=+UR(A,D,"PacketSize")}let ws=String(D.getAttribute("CodecPrivateData"));if(E===_.q&&!ws){{var fa=vs;const EF={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},Em=EF[Dm];if("AACH"===DF){La=new Uint8Array(4);const FF=EF[2*Dm];La[0]=40|Em>>1;La[1]=Em<<7|fa<<3|FF>>1;La[2]=FF<<7|8;La[3]=0;ad=new Uint16Array(2);ad[0]=(La[0]<<8)+La[1];ad[1]=(La[2]<<8)+La[3];Pd=ad[0].toString(16)+ad[1].toString(16)}else La=new Uint8Array(2),La[0]=16|Em>>1,La[1]=Em<<7|fa<<3,ad=new Uint16Array(1),ad[0]=(La[0]<<8)+La[1],Pd=ad[0].toString(16);ws=Pd.toUpperCase()}}var Vc={id:A.V++,type:E,index:qj,bitrate:mg,Ud:ws,maxHeight:tc,
|
|
22
|
+
maxWidth:ng,Ed:Dm,Qf:vs,gj:BF,ph:AF,tj:CF,Hh:DF,segmentIndex:null}}$c.push(Vc)}var ac=$c}{const $c=[],pj=_.N.a(y,"c");for(let re=0;re<pj.length;re++){const ad=pj[re];let La=parseInt(ad.getAttribute("t"),10),Pd=parseInt(ad.getAttribute("d"),10),qj=parseInt(ad.getAttribute("r"),10),mg=0;if(isNaN(La)&&isNaN(Pd))throw v.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.H(_.C,4,4037,v.o);0===re&&isNaN(La)&&(mg=La=0);if(0<re){const tc=$c[$c.length-
|
|
23
|
+
1];mg=tc.n+1;tc.d||(tc.d=La-tc.t);La||(La=tc.t+tc.d);Pd||(Pd=La-tc.t)}$c.push({n:mg,d:Pd,t:La});if(qj){qj--;for(let tc=0;tc<qj;tc++){const ng=$c[$c.length-1];mg=ng.n+1;La=ng.t+ng.d;Pd=ng.d;$c.push({n:mg,d:Pd,t:La})}}}v.F()||$c.length===ec||v.g.warn("Number of fragments ("+ec+") differs from number of chunks ("+$c.length+").");var Lb=$c}var Od={type:sc,kj:ec,Qi:Ih,language:qe,Rc:pe,name:Jh,maxWidth:kf,maxHeight:lg,aj:us,tracks:ac,$f:Lb,timescale:Cm}}fb.push(Od)}var Mb=fb}const bc={sj:e,tg:f,timescale:g,
|
|
24
|
+
duration:h,isLive:k,rj:l,Ge:m,Le:!1,streams:Mb};if(a.j&&a.A)return ZR(a,bc),Promise.resolve();a.H.clear();{const fb=bc.timescale,ua=bc.duration,rb=IQ(bc.streams,_.q),sc=IQ(bc.streams,_.t),ec=IQ(bc.streams,_.J),Ih=[];let pe=$R(a,ua,fb,rb),qe=$R(a,ua,fb,sc);const Jh=$R(a,ua,fb,ec);pe.length||(pe=[null]);qe.length||(qe=[null]);for(let kf=0;kf<qe.length;kf++)for(let lg=0;lg<pe.length;lg++)Ih.push(aS(a,qe[kf],pe[lg]));var cc={id:"ID",configurationId:void 0,startTime:0,endTime:ua,variants:Ih,textStreams:Jh,
|
|
25
|
+
thumbStreams:[]}}{var Bb=bc.streams;let fb=a.a.startTime,ua=a.a.delay;const rb=a.J;let sc=Math.min(a.a.duration||Infinity,rb);const ec=a.F(),Ih=a.a.Ge,pe=a.a.xd,qe=a.I,Jh=isFinite(a.G)?a.G:0;if(ec)sc=Infinity,fb=Date.now()/1E3-pe,a.a.startTime=fb,ua=3*qe;else{const lg=isFinite(rb)?rb:a.a.duration;for(const us of Bb)for(const Cm of us.tracks)Cm.segmentIndex.offset(-Jh),_.YB(Cm.segmentIndex,lg)}const kf=a.f.timeline||{};kf.type=void 0;a.C=new _.zI(kf,fb,ua,!ec,!0);a.C.f=sc;_.pC(a.C,qe);a.C.A=Ih;ec||
|
|
26
|
+
a.C.offset(-Jh)}a.D.filterAllPeriods([cc]);a.j={presentationTimeline:a.C,periods:[cc],minBufferTime:0,cues:[]};Promise.resolve();a.L||(a.D.networkingEngine.Yc(a.M),a.L=!0);a.A=bc;return Promise.resolve()},cS=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.Tb.bind(a),b))},UR=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.H(_.C,4,4038,a.o,c);},VR=function(a,b){const c=b===YR;a.j&&a.j.presentationTimeline&&_.kC(a.j.presentationTimeline,
|
|
27
|
+
c);c&&null!=a.l&&(window.clearTimeout(a.l),a.l=null,a.B=null);a.P=b},ZR=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){GQ(g,c)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var d=dS(a,a.A.timescale,f,c);c=g.segmentIndex;_.CC(c,d);(d=a.a.Ge)&&_.DC(c,_.AC(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.`)}}},dS=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.$f.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=FQ(a.o,c,k,d);a.I=Math.max(a.I,l);f.push(new _.BC(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.xd?a.a.xd=b.endTime:a.a.xd=Math.min(a.a.xd,b.endTime);return f},$R=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=dS(a,c,k,h);const fa=new _.AI(l);var m=null;k.type!==_.J&&(m=eS(a,b,c,k,h));h.segmentIndex=fa;l=_.vI++;var n=Promise.resolve.bind(Promise),p=fa.f.bind(fa),u=fa.get.bind(fa),v=fa.h.bind(fa),y=fa.getDuration.bind(fa),A=fS[k.type];var D="";switch(k.type){case _.t:D=h.Ud;var E=/00000001[0-9]7/.exec(D);D="avc1."+(E&&E[0]?D.substr(D.indexOf(E[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",D);break;case _.q:D=h.Ud,E=2,"AACH"===h.Hh?E=5:D&&(E=(parseInt(D.substr(0,
|
|
30
|
+
2),16)&248)>>3),D="mp4a.40."+E,a.g.debug("AUDIO CODECS: ",D)}E=k.type===_.J?gS[k.Qi]:void 0;h={id:l,originalId:null,wj:null,createSegmentIndex:n,findSegmentPosition:p,getSegmentReference:u,adjustSegmentDurations:v,getDuration:y,segmentIndex:fa,segmentLookupStrategy:_.OA,initSegmentReference:m,mimeType:A,codecs:D,frameRate:void 0,bandwidth:h.bitrate,width:h.maxWidth||void 0,height:h.maxHeight||void 0,kind:E,encrypted:a.K(),keyId:null,language:k.language,originalLanguage:k.Rc,label:k.name,type:k.type,
|
|
31
|
+
primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Qf||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},aS=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},eS=function(a,b,c,d,e){b=HQ(b,d.timescale||c,e);c={isLive:a.F.bind(a),ae:a.K.bind(a),Ph:()=>1,$d:a.R.bind(a)};d=new Uint8Array(0);
|
|
32
|
+
try{d=AR(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.H(_.C,3,4035,g);}const f="data:text/plain;base64,"+_.gm(d);return new _.wI(()=>[f],0,null,null,!0)},SQ=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?_.L(a,1):_.L(a,this.size);_.Xo(a,DQ(this.type));this.size>b&&xQ(a,this.size);"uuid"===this.type&&_.Xo(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()}},hS=class extends SQ{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);yQ(a,this.version);zQ(a,this.flags)}},yR=class extends SQ{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);_.Xo(a,this.f,this.offset);a.getPosition()}},ER=class extends hS{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);_.Xo(a,this.f,this.offset);a.getPosition()}},xR=class extends SQ{constructor(a,b,c){super("ftyp");this.h=a;this.tg=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);_.Xo(a,DQ(this.h));_.L(a,this.tg);_.Xo(a,DQ(this.f.join("")));a.getPosition()}},wR=class extends SQ{constructor(){super(_.De)}},vR=class extends SQ{constructor(){super(_.hg)}},
|
|
36
|
+
ZQ=class extends hS{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?(xQ(a,0),xQ(a,0),_.L(a,this.timescale),xQ(a,this.duration*this.timescale)):(_.L(a,0),_.L(a,0),_.L(a,this.timescale),_.L(a,this.duration*this.timescale));_.L(a,65536);AQ(a,this.volume);
|
|
37
|
+
AQ(a,0);_.L(a,0);_.L(a,0);for(let b=0;b<this.f.length;b++)yQ(a,this.f[b]);_.L(a,0);_.L(a,0);_.L(a,0);_.L(a,0);_.L(a,0);_.L(a,0);_.L(a,this.h);a.getPosition()}},$Q=class extends SQ{constructor(){super("mvex")}},aR=class extends hS{constructor(a){super("trex",0,0);this.f=a}a(){return 20+super.a()}write(a){super.write(a);_.L(a,this.f);_.L(a,1);_.L(a,0);_.L(a,0);_.L(a,0);a.getPosition()}},bR=class extends hS{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?(xQ(a,0),xQ(a,0),_.L(a,this.h),_.L(a,0),xQ(a,this.duration*this.timescale)):(_.L(a,0),_.L(a,0),_.L(a,this.h),_.L(a,0),_.L(a,this.duration*this.timescale));_.L(a,0);_.L(a,0);AQ(a,0);AQ(a,0);AQ(a,this.volume);AQ(a,0);for(let b=0;b<this.f.length;b++)yQ(a,this.f[b]);AQ(a,
|
|
39
|
+
this.width);AQ(a,0);AQ(a,this.height);AQ(a,0);a.getPosition()}},cR=class extends hS{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?(xQ(a,0),xQ(a,0),_.L(a,this.timescale),xQ(a,this.duration*this.timescale)):(_.L(a,0),_.L(a,0),_.L(a,this.timescale),_.L(a,this.duration*this.timescale));AQ(a,this.language);AQ(a,0);a.getPosition()}},dR=class extends hS{constructor(a){super("hdlr",
|
|
40
|
+
0,0);this.f=a}a(){return 33+super.a()}write(a){super.write(a);_.L(a,0);this.f===_.t?_.Xo(a,DQ("vide")):_.Xo(a,DQ("soun"));_.L(a,0);_.L(a,0);_.L(a,0);this.f===_.t?_.Xo(a,DQ("VideoHandler\x00")):_.Xo(a,DQ("SoundHandler\x00"));a.getPosition()}},jR=class extends hS{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);AQ(a,0);_.Xo(a,this.f);a.getPosition()}},iS=class extends SQ{constructor(a){super(a);this.w=!0}a(){return 8+
|
|
41
|
+
super.a()}write(a){super.write(a);_.L(a,0);AQ(a,0);AQ(a,1)}},jS=class extends iS{constructor(a){super(a);this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);AQ(a,0);AQ(a,0);_.L(a,0);_.L(a,0);_.L(a,0);AQ(a,this.width);AQ(a,this.height);_.L(a,4718592);_.L(a,4718592);_.L(a,0);AQ(a,1);yQ(a,10);_.Xo(a,DQ("AVC Coding",31));AQ(a,this.depth);CQ(a,-1)}},kS=class extends iS{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);_.L(a,0);_.L(a,0);AQ(a,this.channelCount);AQ(a,this.sampleSize);CQ(a,0);AQ(a,0);AQ(a,this.sampleRate);AQ(a,0)}},iR=class extends jS{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()}},TQ=class extends iR{constructor(a,b){super(a,b);this.type="encv"}},lR=class extends kS{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()}},UQ=class extends lR{constructor(a,b,c){super(a,b,c);this.type="enca"}},hR=class extends SQ{constructor(a,b){super("avcC");this.Ya=a;this.dc=b;this.version=1;this.f=this.Ya[0][1];this.h=this.Ya[0][2];this.level=this.Ya[0][3]}a(){let a=7;for(var b=0;b<this.Ya.length;b++)a+=2,a+=this.Ya[b].byteLength;for(b=0;b<this.Ya.length;b++)a+=2,a+=this.dc[b].byteLength;return a+super.a()}write(a){super.write(a);yQ(a,this.version);yQ(a,this.f);yQ(a,this.h);yQ(a,this.level);yQ(a,255);yQ(a,224|this.Ya.length);
|
|
44
|
+
for(var b=0;b<this.Ya.length;b++)AQ(a,this.Ya[b].length),_.Xo(a,this.Ya[b]);yQ(a,this.dc.length);for(b=0;b<this.dc.length;b++)AQ(a,this.dc[b].length),_.Xo(a,this.dc[b]);a.getPosition()}},kR=class extends hS{constructor(a){super("esds",0,0);this.$b=a}a(){return 22+(this.$b.byteLength+3)+super.a()}write(a){super.write(a);yQ(a,3);yQ(a,23+this.$b.byteLength);AQ(a,1);yQ(a,0);yQ(a,4);yQ(a,15+this.$b.byteLength);yQ(a,64);yQ(a,21);zQ(a,0);_.L(a,0);_.L(a,0);yQ(a,5);yQ(a,this.$b.byteLength);_.Xo(a,this.$b);
|
|
45
|
+
_.Xo(a,new Uint8Array([6,1,2]));a.getPosition()}},fR=class extends hS{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&&_.Xo(a,DQ(this.location));a.getPosition()}},eR=class extends hS{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);_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);
|
|
46
|
+
a.getPosition()}},nR=class extends SQ{constructor(){super(_.Sf)}},gR=class extends hS{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);_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},oR=class extends hS{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
|
+
_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},pR=class extends hS{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);_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},rR=class extends hS{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);_.L(a,this.entries.length);for(let b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()}},qR=class extends hS{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.L(a,0);_.L(a,0);a.getPosition()}},mR=class extends hS{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);CQ(a,0);AQ(a,0);a.getPosition()}},sR=class extends SQ{constructor(){super("dinf")}},tR=class extends SQ{constructor(){super(_.Ce)}},
|
|
49
|
+
uR=class extends SQ{constructor(){super(_.ye)}},MR=class extends hS{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?xQ(a,this.baseMediaDecodeTime):_.L(a,this.baseMediaDecodeTime);a.getPosition()}},BR=class extends hS{constructor(){super("mfhd",0,0);this.f=0}a(){return 4+super.a()}write(a){super.write(a);_.L(a,this.f);a.getPosition()}},DR=class extends hS{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);_.L(a,this.f);this.flags&1&&(a.getPosition(),BQ(a,this.j));this.flags&4&&_.L(a,this.l);for(let b=0;b<this.f;b++)this.flags&256&&_.L(a,this.o[b]),this.flags&512&&_.L(a,this.sampleSize[b]),this.flags&1024&&_.L(a,
|
|
51
|
+
this.A[b]),this.flags&2048&&(0===this.version?_.L(a,this.h[b]):BQ(a,this.h[b]));a.getPosition()}},CR=class extends hS{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);_.L(a,this.f);this.flags&1&&xQ(a,this.h);this.flags&2&&_.L(a,this.A);this.flags&8&&_.L(a,this.j);this.flags&16&&_.L(a,this.o);this.flags&32&&
|
|
52
|
+
_.L(a,this.l);a.getPosition()}},IR=class extends SQ{constructor(){super("traf")}},JR=class extends SQ{constructor(){super("moof")}},HR=class extends SQ{constructor(){super(_.xe);this.f=new Uint8Array(0)}a(){return this.f.byteLength+super.a()}write(a){super.write(a);0<this.f.byteLength&&_.Xo(a,this.f)}},VQ=class extends hS{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);yQ(a,
|
|
53
|
+
0);0===this.version?yQ(a,0):yQ(a,0);yQ(a,this.f);yQ(a,this.h);_.Xo(a,_.im(this.l));if(1===this.f&&0===this.h){yQ(a,0);for(let b=0;b<this.j.length;b++)yQ(a,this.j[b])}a.getPosition()}},XQ=class extends hS{constructor(a,b){super("schm",0,0);this.f=a;this.h=b;this.Vb=""}a(){let a=8;this.flags&1&&(a+=DQ(this.Vb).byteLength);return a+super.a()}write(a){super.write(a);_.Xo(a,DQ(this.f));_.L(a,this.h);this.flags&1&&_.Xo(a,DQ(this.Vb));a.getPosition()}},WQ=class extends SQ{constructor(a){super("frma");this.f=
|
|
54
|
+
a}a(){return DQ(this.f).byteLength+super.a()}write(a){super.write(a);_.Xo(a,DQ(this.f));a.getPosition()}},NR=class extends hS{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&&(_.L(a,0),_.L(a,0));_.L(a,1);for(let b=0;1>b;b++)0===this.version?_.L(a,this.offset[b]):xQ(a,this.offset[b]);a.getPosition()}},OR=class extends hS{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&&(_.L(a,0),_.L(a,0));yQ(a,this.f);_.L(a,this.h);if(0===this.f)for(let b=0;b<this.h;b++)yQ(a,this.j[b]);a.getPosition()}},GR=class extends hS{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].mg.byteLength,this.flags&2){a+=2;for(let c=0;c<this.f[b].Xc;c++)a+=2,a+=4}return a+
|
|
56
|
+
super.a()}write(a){super.write(a);_.L(a,this.h);this.flags&1&&yQ(a,this.j);for(let b=0;b<this.h;b++)if(_.Xo(a,this.f[b].mg),this.flags&2){AQ(a,this.f[b].Xc);for(let c=0;c<this.f[b].Xc;c++)AQ(a,this.f[b].mf[c].Mf),_.L(a,this.f[b].mf[c].Nf)}a.getPosition()}};var LR=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))}},KQ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,LQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,MQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,NQ=/^(\d*\.?\d*)f$/,OQ=/^(\d*\.?\d*)t$/,PQ=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var zR=class{constructor(a){this.a=a;this.f=RQ(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=RQ(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var FR=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var lS=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 _.S("clpp.smooth.SmoothParser");this.L=!1;this.l=this.B=null;this.P=YR;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,EQ(a)])];return TR(this,a).then(c=>bS(this,c.data).then(()=>{cS(this,this.B);return this.j}))}requestStop(){}stop(){this.D&&this.D.networkingEngine.se(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 TR(this,[this.o]).then(a=>bS(this,a.data).then(()=>this.j)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Tb(){this.g.debug(_.EA);this.D&&(this.l=null,this.update().then(()=>{cS(this,this.B)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&cS(this,100))}))}F(){return this.P===WR}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),ae:this.K.bind(this),Ph:()=>1,$d:this.R.bind(this)};let d=!1;const e=new _.H(_.C,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=PR(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 _.sl(`Could not load text stream with id: ${a}`);return d})}},fS={video:_.zg,audio:_.Gc,text:_.Ac},YR=_.Db,WR=
|
|
60
|
+
"LIVE",gS={cj:_.JA,dj:_.YA};_.x("clpp.smooth.SmoothComponent",class extends _.Ev{install(){_.Kt.ism=lS;_.Jt[_.Bc]=lS}uninstall(){_.XC("ism");_.YC(_.Bc)}id(){return _.Nf}});};f.call(g, window);
|