@castlabs/prestoplay 6.27.0 → 6.28.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 +19 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +113 -112
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +625 -624
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +89 -89
- package/cjs/cl.externs.js +80 -72
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +78 -79
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +23 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +347 -347
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +4 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -17
- package/cjs/cl.smooth.js +72 -72
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- 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/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +6 -5
- package/cl.cast.js +91 -90
- package/cl.conviva.js +27 -27
- package/cl.core.js +503 -499
- package/cl.crypto.js +8 -8
- package/cl.dash.js +83 -82
- package/cl.externs.js +80 -72
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +80 -80
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +2 -3
- package/cl.mse.js +304 -305
- 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 +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -29
- package/package.json +1 -1
- package/typings.d.ts +34 -65
- package/cjs/cl.sessions.js +0 -21
- package/cl.sessions.js +0 -10
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.oa())&&d.language&&(e.player_language_code=d.language)}return e}});a.g.debug("Mux SDK options",b);return b},
|
|
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
|
|
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 Uz=function(a){switch(a.type){case 1:return Rz;case 2:return Sz;case 3:return Tz}},Wz=function(a){const b=Object.keys(a).find(c=>Vz.includes(c.toLowerCase()));return void 0!==b?a[b]:void 0},Yz=function(a){let b={debug:!0,data:Xz(a)};a.f&&a.f.muxOptionsOverride&&_.fh(a.f.muxOptionsOverride)&&(b=_.bh(b,a.f.muxOptionsOverride));b=_.bh(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 _.bp(c.url);e.video_source_url=_.Im(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().qa(),
|
|
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.oa())&&d.language&&(e.player_language_code=d.language)}return e}});a.g.debug("Mux SDK options",b);return b},Zz=function(a){_.Wh(a.a);a.j.le(a.F);a.j.Dg(a.C)},Xz=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},$z=function(a){a.a.on(a.m,_.eg,()=>{const b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.eg,b)});a.a.on(a.m,_.Ve,()=>a.emit(_.Ve));a.a.on(a.m,_.Kc,a.G.bind(a));a.a.on(a.m,_.Pf,a.I.bind(a));a.a.on(a.m,_.sg,()=>a.emit(_.Hf));a.a.on(a.m,_.rg,()=>a.emit(_.Gf));a.a.on(a.m,_.Wd,a.H.bind(a));a.a.on(a.m,_.Rb,()=>a.emit("adbreakstart"));a.a.on(a.m,_.Sb,()=>a.emit("adbreakend"));a.a.on(a.m,_.kc,()=>
|
|
5
|
+
{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.gc,()=>a.emit("adpause"));a.a.on(a.m,_.ic,()=>{a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.lc,()=>a.emit("adended"));a.a.on(a.m,_.Wb,()=>a.emit("adfirstquartile"));a.a.on(a.m,_.fc,()=>a.emit("admidpoint"));a.a.on(a.m,_.mc,()=>a.emit("adthirdquartile"));a.j.Tc(a.F);a.j.zf(a.C);a.a.on(a.m,_.Wd,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 _.bp(b.uris[b.uriIndex]);b={request_start:c,request_type:Uz(b),request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{{d=c.requestStartTimestamp;const f=new _.bp(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:Uz(c),request_hostname:f.a,request_error:`${Uz(c)}${"LoadError"}`,request_error_code:e,request_error_text:b.toString()};
|
|
7
|
+
a.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",b)}}}})},aA=function(a,b){a.trigger(new _.G(_.Wd,{detail:b}))},bA=function(a){return!_.z(a)&&typeof a.init===_.$d&&typeof a.emit===_.$d},Rz="manifest",Sz="media",Tz="encryption",Vz=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];var cA=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 _.Gt;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,Yz(this))}catch(d){throw this.h=!1,Zz(this),new _.H(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=Xz(this),this.emit("videochange",
|
|
8
|
+
a),this.l=!1);$z(this)}release(){this.g.debug("release()");this.l?this.g.debug(_.ja):(Zz(this),this.l=!0,this.o=this.f=null)}destroy(){this.g.debug(_.Bd);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(_.He);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.La())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))}I(a){this.g.debug(_.Me);
|
|
9
|
+
switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.Ve);break;case 3:this.emit(_.ff);break;case 4:this.emit(_.Re);break;case 5:this.emit(_.Vd)}}H(a){this.g.debug(_.Je);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(_.Wd,{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 _.bp(b.uris[b.uriIndex]);a={request_start:g,request_type:Uz(b),request_hostname:d.a,request_id:Wz(e),request_bytes_loaded:f,request_response_start:h,
|
|
11
|
+
request_response_end:a,request_response_headers:e,request_media_duration:c,request_url:_.Im(d)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}}}J(a){a.requestStartTimestamp=Date.now()}};var dA=class extends _.Iv{constructor(){super();this.f=this.m=null;this.a=!1;this.g=new _.S("clpp.muxdata")}onPlayerCreated(a){this.m=a;this.f=new cA(a,this.g)}onContentWillLoad(a,b){var c=a.getConfiguration();c=_.ch(c.muxdata);try{var d=[];typeof c===_.Ge&&(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===_.Ge){const g=f.muxdata;d=bA(g.muxLib)?g.muxLib:window.mux;if(!bA(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");
|
|
12
|
+
this.a=!1;const h=new _.H(1,9,9301);aA(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,aA(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&&aA(this.m,c),c;}}};_.x("clpp.muxdata.MuxDataPlugin",dA);dA.prototype.emit=dA.prototype.emit;
|
|
13
|
+
dA.Id="mux";_.Ln(new class{create(){return new dA}});};f.call(g, window);
|
package/cl.onboard.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
certificateUrl:
|
|
3
|
-
_.x("clpp.onboard.OnboardComponent",class extends _.
|
|
4
|
-
_.x("clpp.onboard.register",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var Qz=function(a,b){let c=b.baseUrl;_.wi(c,"/")||(c+="/");var d=h=>h&&(_.vi(h,_.ee)||_.vi(h,"http://")||_.vi(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=_.Jo("V2");a=new _.tu(a);a.Xa(_.ud,{licenseUrl:e,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:_.Ko(b,g),modifiers:{licenseRequest:_.qp,
|
|
2
|
+
licenseResponse:_.rp}});a.Xa(_.qd,{licenseUrl:d,certificateUrl:d,modifiers:{licenseRequest:_.tp,licenseResponse:_.up,extractContentId:_.vp,certificateRequest:_.wp}});a.Xa(_.sd,{licenseUrl:f,modifiers:{licenseRequest:_.qp}});_.en(a)};
|
|
3
|
+
_.x("clpp.onboard.OnboardComponent",class extends _.rv{constructor(){super();this.g=new _.S("clpp.onboard");this.a=new Set}uninstall(){for(const a of this.a)delete _.dn[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
|
+
Qz(b,a),this.a.add(b))}id(){return"onboard"}});_.x("clpp.onboard.register",Qz);};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 Az="A persistent DRM session already exists for: ",Bz="No DRM configuration.",Cz="clpp.persistent",Dz="clpp.persistent.SimpleSessionStorage",Ez=function(a,b){const c=[];for(const d of a)c.push(b(d));return c},Gz=function(a,b,c,d,e,f){a.K=Fz;const g=new Map,h=_.fq(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Oe,persistentState:_.yf,sessionTypes:[_.Te],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,
|
|
2
|
+
audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.xq(a,g)},Iz=function(a,b){a.K=Hz;a.L=[];a.G=!0;return _.yq(a,b)},Jz=function(a,b){return _.w(function*(){const c=yield _.Pq(a,b);if(c){var d=[],e=a.h.get(c);e&&a.C&&(e.hc=new _.Tl,d.push(e.hc));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)})},Kz=function(a){a=a.h.keys();a=Ez(a,b=>b.sessionId);return Array.from(a)},
|
|
3
|
+
Lz=function(a,b){const c=_.gn(a),d=_.Xm([{drm:a}]);d.drm=a;a=new _.ws({ub:b,onError:()=>{},Re:()=>{},Qe:()=>{},onEvent:()=>{},getConfiguration:()=>d,Kc:()=>null});a.f=c;return a},Oz=function(a,b,c){return _.w(function*(){const d=Mz;if(a){var e=a.offlineId;if(0!==e.length){var f=yield d.get(e);if(f)Nz.debug(Az,e);else{var g=Lz(a,c);try{yield Iz(g,b);yield _.Nq(g);yield _.Qq(g);const h=g.getDrmInfo(),k=b.map(l=>({contentType:_.Pm(l.video.mimeType,l.video.codecs),robustness:h.videoRobustness}));f={sessionIds:Kz(g),
|
|
4
|
+
keySystem:h.keySystem,licenseServerUri:h.licenseServerUri,serverCertificate:h.serverCertificate,audioCapabilities:[],videoCapabilities:k,drmConfig:a};yield d.store(e,f)}catch(h){throw Nz.error(`Error while persisting DRM session ${e}`),new _.H(1,6,6200,null,h);}finally{yield g.destroy()}}}}else Nz.debug(Bz)})},Hz=1,Fz=2,Pz=class{constructor(){this.g=new _.S(Dz)}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 _.
|
|
9
|
-
_.x("clpp.persistent.removeLicense",function(a){return _.w(function*(){var b=
|
|
10
|
-
new _.
|
|
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 Dz}};_.x("clpp.persistent.useStorage",function(a){{var b=["store","get","delete","clear","getName"];const c=[];_.z(a)||(_.gh(a.store)||c.push("store"),_.gh(a.get)||c.push("get"),_.gh(a.delete)||c.push("delete"),_.gh(a.clear)||c.push("clear"),_.gh(a.getName)||c.push("getName"),b=c)}if(0<b.length)throw Nz.warn("Invalid session storage implementation"),new _.H(1,6,6202,{missingMethods:b});Mz=a});
|
|
7
|
+
_.x("clpp.persistent.fetchLicense",function(a,b,...c){return _.w(function*(){var d=Mz,e=(l,m)=>new _.H(1,6,6200,l,m);const f=_.an(a).shift();if(!f)throw e("No source specified.");if(!b)throw e(Bz);var g=b.offlineId;if(typeof g!==_.Sf||!g.length)throw e("Missing offline id.");if(yield d.get(g))Nz.debug(Az,g);else{var h=_.Vm();d=new _.zn;g=[];for(var k of c){const l=new k;_.Hh(l.id())||(l.install(),_.Lh(l),g.push(l))}k=null;try{k=yield _.wt(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=_.lt(l.periods);yield Oz(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(),_.Gh.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=Mz;if(_.ih(a)&&0!==a.length){var c=null,d=null;try{const e=yield b.get(a);e?(e.drmConfig.delayLicenseRequestUntilPlayed=!0,d=new _.zn,c=Lz(e.drmConfig,d),yield Gz(c,e.keySystem,e.licenseServerUri,e.serverCertificate,e.audioCapabilities,e.videoCapabilities),yield _.Nq(c),yield Promise.all(e.sessionIds.map(f=>_.w(function*(){yield Jz(c,f);Nz.debug("successfully removed session with id",f)}))),yield b.delete(a)):Nz.debug("No persistent DRM session found")}catch(e){throw Nz.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 Nz.warn("Invalid offlineId")})});_.x("clpp.persistent.getSessionStorage",function(){return Mz});var Mz=new Pz,Nz=new _.S(Cz);_.x("clpp.persistent.PersistentLicenseComponent",class extends _.rv{constructor(){super();this.g=new _.S(Cz)}id(){return _.Se}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 Oz(d,b,e),a.trigger(new _.G(_.Md,{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=Mz;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 xz=function(a,b){return 0<=b&&b<a.a.length},yz=function(a){a.trigger(new _.G(_.jf))},zz=class extends _.Ht{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.za.bind(this)}getPosition(){return this.f}Kh(){return this.a}dd(){return 0<this.a.length&&xz(this,this.f)?this.a[this.f]:null}Lh(){const a=this.f+1;return 0<
|
|
2
|
+
this.a.length&&xz(this,a)?this.a[a]:null}Vh(){return this.h}start(){this.h||(this.h=!0,this.m.on(_.Vd,this.j),this.Td(this.f,!0))}stop(){this.h=!1;this.m.off(_.Vd,this.j)}za(){this.next()}next(){const a=this;return _.w(function*(){yield a.Td(Math.min(a.a.length-1,a.f+1))})}ni(){const a=this;return _.w(function*(){yield a.Td(Math.max(0,a.f-1))})}Td(a,b){b=void 0===b?!1:b;const c=this;return _.w(function*(){if(0<c.a.length&&xz(c,a)&&(b||c.f!==a)){c.f=a;var d=c.dd();d&&(yield c.l(d),yield c.m.load(d.configuration),
|
|
3
|
+
c.trigger(new _.G(_.hf,{item:d})))}})}append(a){this.a.push(a);yz(this)}Th(a,b){if(0<=b&&b<=this.a.length){const c=this.dd();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));yz(this)}}remove(a){if(0<this.a.length&&xz(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);yz(this)}}clear(){this.stop();this.f=0;this.a=[];this.h=!1;yz(this)}};_.x("clpp.Playlist",zz);zz.prototype.clear=zz.prototype.clear;zz.prototype.remove=zz.prototype.remove;zz.prototype.insert=zz.prototype.Th;
|
|
4
|
+
zz.prototype.append=zz.prototype.append;zz.prototype.goTo=zz.prototype.Td;zz.prototype.previous=zz.prototype.ni;zz.prototype.next=zz.prototype.next;zz.prototype.onEnded=zz.prototype.za;zz.prototype.stop=zz.prototype.stop;zz.prototype.start=zz.prototype.start;zz.prototype.isStarted=zz.prototype.Vh;zz.prototype.getUpcoming=zz.prototype.Lh;zz.prototype.getCurrent=zz.prototype.dd;zz.prototype.getQueue=zz.prototype.Kh;zz.prototype.getPosition=zz.prototype.getPosition;zz.prototype.off=zz.prototype.off;
|
|
5
|
+
zz.prototype.one=zz.prototype.one;zz.prototype.on=zz.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 gz="No surface found. Can not attach frame!",hz="SIMID:Media:timeupdate",iz="Starting creative",jz=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),args:c}},mz=function(a,b){return new Promise((c,d)=>{new kz(a.j,c,d,b);lz(a,b)})},nz=function(a){const b=jz(a,"SIMID:Player:startCreative",void 0);mz(a,b).then(()=>{var c=a.f;c.g.info(iz);c.m.trigger(new _.G(_.Jf));a.a.style.opacity="1"}).catch(c=>{a.unload();a.f.g.error("Error while starting creative",
|
|
2
|
+
c)})},pz=function(a,b){_.w(function*(){a.h=b.sessionId;oz(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=jz(a,"SIMID:Player:init",d);var e=mz(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()}})},oz=function(a,b){lz(a,jz(a,"resolve",{messageId:b.messageId,
|
|
4
|
+
value:void 0}))},lz=function(a,b){a.h?(b.type!==hz&&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}'`)},qz=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=jz(d,"SIMID:Player:resize",e);lz(d,e)}})},rz=function(a,b){a.g.info("SIMID Session created");a.a=b},sz=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(_.Kf))},tz=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}%`}},uz=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=_.Fe,this.a.style.backgroundColor="transparent",this.a.style.transition=
|
|
7
|
+
"opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Fe,this.a.style.overflow=_.be);this.a.classList.add(_.ad);this.o=c=>{if(c.source===this.a.contentWindow&&(c=(c=c.data)?typeof c===_.Sf?JSON.parse(c):c:null))if(c.type)switch(this.g.info(`Received message [${c.messageId}] '${c.type}':`,c.args),c.type){case "createSession":pz(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=tz(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=tz(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);oz(this,c)}else this.g.warn("WARNING: received message without 'type' property")};this.g=new _.S("clpp.simid.SimidPlayer");rz(this.f,this)}load(a){window.addEventListener(_.ye,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(){sz(this.f);
|
|
10
|
+
this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.ye,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)}},kz=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 wz=class extends _.Iv{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 vz(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 uz(this.h,b.simid),b=c.getContainer(),this.j=qz(this,b,c),this.j.observe(b),a.on(_.eg,this.w)):this.g.warn(gz)}}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&&(nz(this.a),this.o=!0,this.g.info(iz)),
|
|
13
|
+
c&&(c=this.a,lz(c,jz(c,hz,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(gz),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(_.eg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))}},vz=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}dg(){return this.a}url(){return this.f?this.f.url:""}};_.Ln(new class{create(){return new wz}});};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=_.
|
|
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 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 _.
|
|
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===_.
|
|
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.Ya.length;b++)
|
|
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
|
-
return a+super.a()}write(a){super.write(a);
|
|
54
|
-
class extends
|
|
55
|
-
b,c){super("saiz",0,0);this.f=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&&(_.
|
|
56
|
-
2,a+=4}return a+super.a()}write(a){super.write(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
|
|
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 iQ="Full MP4 box must have flags defined",jQ="clpp.smooth.SmoothMP4Processor",kQ="codecPrivateData",lQ=function(a,b){const c=Math.floor(b/Math.pow(2,32));b-=c*Math.pow(2,32);_.L(a,c);_.L(a,b)},mQ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Lo()}},nQ=function(a,b){mQ(a,b>>16&255);mQ(a,b>>8&255);mQ(a,b&255)},oQ=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.Lo()}},pQ=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.Lo()}},qQ=function(a,b){try{a.f.setInt16(a.a,
|
|
2
|
+
b,a.h),a.a+=2}catch(c){_.Lo()}},rQ=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},sQ=function(a){const b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:`${a}/Manifest`},tQ=function(a,b,c,d){c=b.Xf[c];b=b.Vi;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 _.hB([a],[b])[0]},uQ=function(a,b){if(a.type!==b.type)return!1;let c=[];a.type===_.t?c=["maxWidth","maxHeight","bitrate",kQ,"fourCC"]:a.type===_.q&&(c=["bitrate",kQ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.kh(a,b,c,["id","segmentIndex"])},vQ=function(a,b,c){const d=c.Nd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ya:null,cc:null,width:NaN,height:NaN,Zb:null,wd:NaN,
|
|
4
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.t:a.Ya=[_.Yl(d[1])];a.cc=[_.Yl(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.q:a.Zb=_.Yl(c.Nd),a.sampleSize=c.ih||16,a.wd=c.wd,a.channelCount=c.Nf}return a},wQ=function(a,b){return a.filter(c=>c.type===b)},xQ=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)},EQ=function(a,b,c){var d=null;if(yQ.test(a)){{a=yQ.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 zQ.test(a)?d=xQ(zQ,a):AQ.test(a)?d=xQ(AQ,a):BQ.test(a)?(a=BQ.exec(a),d=Number(a[1])/c.frameRate):CQ.test(a)?(a=CQ.exec(a),d=Number(a[1])/c.a):DQ.test(a)&&(d=xQ(DQ,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},FQ=function(a){let b=
|
|
6
|
+
0;for(let c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.fp(b)},MQ=function(a,b,c){a:{var d=[_.ud,_.sd];for(e of d)if((d=c.Sd(e))&&d.keyId){var e=d.keyId;break a}_.B(jQ,"Could not get default Key ID for DRM init data!");e=null}c=new GQ("xxxx");a.type===_.t?c=new HQ(a.width,a.height):c=new IQ(a.channelCount,a.sampleSize,a.wd);a=new JQ;a.f=1;a.h=8;a.l=e||"00000000000000000000000000000000";a=(new GQ("schi")).append([a]);b=(new GQ(_.Lf)).append([new KQ(b),new LQ(_.Tc,65536),a]);c.append([b]);return c},
|
|
7
|
+
oR=function(a,b){var c=b.Ud(),d=new NQ(a.timescale,a.duration,a.id),e=(new OQ).append([new PQ(a.id)]),f=new QQ(a.id,a.duration,a.timescale,a.width,a.height),g=new RQ(a.timescale,a.duration);const h=new SQ(a.type);var k=null,l=new TQ;l.entries=[new UQ];var m=new VQ;switch(a.type){case _.t:k=new WQ(a.Ya,a.cc);c?(a=MQ(a,"avc1",b),a.append([k]),m.entries=[a]):(a=(new XQ(a.width,a.height)).append([k]),m.entries=[a]);k=new YQ;break;case _.q:k=new ZQ(a.Zb),c?(a=MQ(a,"mp4a",b),a.append([k]),m.entries=[a]):
|
|
8
|
+
(a=(new $Q(a.channelCount,a.sampleSize,a.wd)).append([k]),m.entries=[a]),k=new aR}m=(new bR).append([m,new cR,new dR,new eR,new fR]);l=(new gR).append([l]);l=(new hR).append([k,l,m]);g=(new iR).append([g,h,l]);f=(new jR).append([f,g]);d=(new kR).append([d,f,e]);e=new lR("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Sd(_.sd),b=b.Sd(_.ud),c&&d.append([new mR("pssh",c.initData,8)]),b&&d.append([new mR("pssh",b.initData,8)]),c||b||_.B(jQ,"Could not get PSSH init data!"));b=new nR([e,d]);return _.F(b.write())},
|
|
9
|
+
yR=function(a,b){let c,d,e,f,g,h;(new _.dp).N("moof",_.Xo).ea("mfhd",k=>{{const l=new pR;l.f=_.M(k.reader);c=l}}).N("traf",_.Xo).ea("tfhd",k=>{{const l=k.reader.Ma();if(null===k.flags)throw new _.H(_.C,3,3019,iQ);const m=new qR(k.version||0,k.flags||0);m.f=_.M(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.h=_.So(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.Ma();if(null===k.flags)throw new _.H(_.C,3,3019,iQ);const m=new rR(k.version||0,k.flags||0);m.f=_.M(k.reader);0<l-k.reader.getPosition()&&k.flags&1&&(m.j=_.Ro(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(_.Ro(k.reader)));e=m}}).ea("sdtp",k=>{{const l=_.Uo(k.reader,k.reader.Ma());f=new sR("sdtp",k.version||0,k.flags||0,l,0)}}).N("uuid",k=>{var l=_.Uo(k.reader,16);if(_.$l(l,tR)){l=_.M(k.reader);k.version=l>>>24;k.flags=l&16777215;l=new uR(k.version,k.flags);l.h=_.M(k.reader);k.flags&1&&(l.j=_.Po(k.reader));for(let m=0;m<l.h;m++){const n={ig:_.Uo(k.reader,8),Sc:0,hf:[]};if(k.flags&2){n.Sc=_.Qo(k.reader);for(let p=0;p<n.Sc;p++){const u={Jf:0,Kf:0};
|
|
12
|
+
u.Jf=_.Qo(k.reader);u.Kf=_.M(k.reader);n.hf.push(u)}}l.f.push(n)}g=l}}).N(_.we,k=>{{const l=new vR;0<k.reader.Ma()?l.f=_.Uo(k.reader,k.reader.Ma()):(_.B(jQ,"mdat box is empty!"),l.f=new Uint8Array(0));h=l}}).parse(a,!1);if(!h)return null;a=(new wR).append([d,e]);f&&a.append([f]);b.Ud()&&g&&a.append([g]);b=(new xR).append([c,a]);return new nR([b,h])},DR=function(a,b,c,d){var e=d.Ud(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=yR(b,d);if(null===g)return a.request.contentType===_.J?a.data:
|
|
13
|
+
g;d=g.get(_.we);if(a.request.contentType===_.J){e=d.f.buffer;if(c){e=_.ri(e);if((e=(new DOMParser).parseFromString(e,_.Zf))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new zR(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",_.Ud];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],EQ(k||"",a,b))}}}e=(new XMLSerializer).serializeToString(e);c=_.si(e).buffer}else c=e;return c}h=new xR;a=g.get("mfhd");b=new wR;k=g.get("tfhd");m=new AR(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].Sc);else g=8;b.append([c,new BR,new CR(g,k,c.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;d=new nR([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},ER=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
|
|
16
|
+
periodId:null}},FR=function(a){return{initData:_.VA(_.Vp(a)),initDataType:_.Tc,keyId:a,periodId:null}},GR=function(a,b,c){a=_.cq(a);c&&a.version!==c&&(a=_.XA(a,c));return{initData:_.VA(a),initDataType:_.Tc,keyId:b,periodId:null}},HR=function(a,b){return _.w(function*(){var c=_.nk(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})},PR=function(a,b){const c=_.N;let d=null;try{const db=_.ri(b);d=c.j(db,_.rb)}catch(db){}if(!d)throw a.g.error("Unable to parse manifest"),new _.H(_.C,4,4033,a.o);const e=+IR(a,d,"MajorVersion"),f=+IR(a,d,"MinorVersion"),g=+d.getAttribute("TimeScale")||1E7;let h=+IR(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?(JR(a,KR),a.B=typeof a.f.liveRefreshPeriod===_.r?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),h=Infinity):JR(a,LR);a.a={startTime:0,delay:0,duration:h/g,Ce:m/g,qd:0};if(n){{var p=a.f.playreadyVersion;const db=_.N,ua=[],qb=db.a(n,"ProtectionHeader")[0],rc=_.Xl(db.f(qb)||""),dc=_.cq(rc).a;ua.push(ER(_.ud,FR(dc),[dc]));ua.push(ER(_.sd,GR(rc,dc,p),[dc]));var u=ua}a.w=
|
|
19
|
+
u}{const db=[],ua=_.N.a(d,"StreamIndex");if(!ua.length)throw a.g.error("No streams found!"),new _.H(_.C,4,4034,a.o);for(let qb=0;qb<ua.length;qb++){{var v=a,y=ua[qb];const rc=IR(v,y,"Type"),dc=+y.getAttribute("Chunks"),Jh=y.getAttribute("Subtype")||"",ne=y.getAttribute("Language")||_.jg,oe=_.Cn(ne),Kh=y.getAttribute("Name")||"",gf=+y.getAttribute(_.Qa),kg=+y.getAttribute(_.Pa),ls=IR(v,y,"Url"),vm=+y.getAttribute("TimeScale")||null;{const Zc=[],mj=_.N.a(y,_.jb);for(let pe=0;pe<mj.length;pe++){{let $c,
|
|
20
|
+
Ja,Od;var A=v,D=mj[pe],E=rc;const nj=+D.getAttribute("Index"),lg=+IR(A,D,"Bitrate");let sc=NaN,mg=NaN,wm=NaN,ms=NaN,oF=NaN,pF=NaN,qF=NaN;const rF=D.getAttribute("FourCC")||"";switch(E){case _.t:sc=+IR(A,D,_.Pa);mg=+IR(A,D,_.Qa);break;case _.q:ms=+D.getAttribute("Channels")||2,wm=+IR(A,D,"SamplingRate"),pF=+IR(A,D,"AudioTag"),oF=+IR(A,D,"BitsPerSample"),qF=+IR(A,D,"PacketSize")}let ns=String(D.getAttribute("CodecPrivateData"));if(E===_.q&&!ns){{var fa=ms;const sF={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},xm=sF[wm];if("AACH"===rF){Ja=new Uint8Array(4);const tF=sF[2*wm];Ja[0]=40|xm>>1;Ja[1]=xm<<7|fa<<3|tF>>1;Ja[2]=tF<<7|8;Ja[3]=0;$c=new Uint16Array(2);$c[0]=(Ja[0]<<8)+Ja[1];$c[1]=(Ja[2]<<8)+Ja[3];Od=$c[0].toString(16)+$c[1].toString(16)}else Ja=new Uint8Array(2),Ja[0]=16|xm>>1,Ja[1]=xm<<7|fa<<3,$c=new Uint16Array(1),$c[0]=(Ja[0]<<8)+Ja[1],Od=$c[0].toString(16);ns=Od.toUpperCase()}}var Uc={id:A.V++,type:E,index:nj,bitrate:lg,Nd:ns,maxHeight:sc,
|
|
22
|
+
maxWidth:mg,wd:wm,Nf:ms,aj:pF,ih:oF,nj:qF,Ah:rF,segmentIndex:null}}Zc.push(Uc)}var $b=Zc}{const Zc=[],mj=_.N.a(y,"c");for(let pe=0;pe<mj.length;pe++){const $c=mj[pe];let Ja=parseInt($c.getAttribute("t"),10),Od=parseInt($c.getAttribute("d"),10),nj=parseInt($c.getAttribute("r"),10),lg=0;if(isNaN(Ja)&&isNaN(Od))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===pe&&isNaN(Ja)&&(lg=Ja=0);if(0<pe){const sc=Zc[Zc.length-
|
|
23
|
+
1];lg=sc.n+1;sc.d||(sc.d=Ja-sc.t);Ja||(Ja=sc.t+sc.d);Od||(Od=Ja-sc.t)}Zc.push({n:lg,d:Od,t:Ja});if(nj){nj--;for(let sc=0;sc<nj;sc++){const mg=Zc[Zc.length-1];lg=mg.n+1;Ja=mg.t+mg.d;Od=mg.d;Zc.push({n:lg,d:Od,t:Ja})}}}v.F()||Zc.length===dc||v.g.warn("Number of fragments ("+dc+") differs from number of chunks ("+Zc.length+").");var Ib=Zc}var Nd={type:rc,ej:dc,Li:Jh,language:oe,Nc:ne,name:Kh,maxWidth:gf,maxHeight:kg,Vi:ls,tracks:$b,Xf:Ib,timescale:vm}}db.push(Nd)}var Jb=db}const ac={mj:e,og:f,timescale:g,
|
|
24
|
+
duration:h,isLive:k,lj:l,Ce:m,Ie:!1,streams:Jb};if(a.j&&a.A)return MR(a,ac),Promise.resolve();a.H.clear();{const db=ac.timescale,ua=ac.duration,qb=wQ(ac.streams,_.q),rc=wQ(ac.streams,_.t),dc=wQ(ac.streams,_.J),Jh=[];let ne=NR(a,ua,db,qb),oe=NR(a,ua,db,rc);const Kh=NR(a,ua,db,dc);ne.length||(ne=[null]);oe.length||(oe=[null]);for(let gf=0;gf<oe.length;gf++)for(let kg=0;kg<ne.length;kg++)Jh.push(OR(a,oe[gf],ne[kg]));var bc={id:"ID",configurationId:void 0,startTime:0,endTime:ua,variants:Jh,textStreams:Kh,
|
|
25
|
+
thumbStreams:[]}}{var zb=ac.streams;let db=a.a.startTime,ua=a.a.delay;const qb=a.J;let rc=Math.min(a.a.duration||Infinity,qb);const dc=a.F(),Jh=a.a.Ce,ne=a.a.qd,oe=a.I,Kh=isFinite(a.G)?a.G:0;if(dc)rc=Infinity,db=Date.now()/1E3-ne,a.a.startTime=db,ua=3*oe;else{const kg=isFinite(qb)?qb:a.a.duration;for(const ls of zb)for(const vm of ls.tracks)vm.segmentIndex.offset(-Kh),_.MB(vm.segmentIndex,kg)}const gf=a.f.timeline||{};gf.type=void 0;a.C=new _.pI(gf,db,ua,!dc,!0);a.C.f=rc;_.dC(a.C,oe);a.C.A=Jh;dc||
|
|
26
|
+
a.C.offset(-Kh)}a.D.filterAllPeriods([bc]);a.j={presentationTimeline:a.C,periods:[bc],minBufferTime:0,cues:[]};Promise.resolve();a.L||(a.D.networkingEngine.Tc(a.M),a.L=!0);a.A=ac;return Promise.resolve()},QR=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.Sb.bind(a),b))},IR=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);},JR=function(a,b){const c=b===LR;a.j&&a.j.presentationTimeline&&_.ZB(a.j.presentationTimeline,
|
|
27
|
+
c);c&&null!=a.l&&(window.clearTimeout(a.l),a.l=null,a.B=null);a.P=b},MR=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){uQ(g,c)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var d=RR(a,a.A.timescale,f,c);c=g.segmentIndex;_.qC(c,d);(d=a.a.Ce)&&_.rC(c,_.oC(c)-d).forEach(h=>{h.Da().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.`)}}},RR=function(a,b,c,d){let e=0;const f=[],g=c.timescale||b;c.Xf.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=tQ(a.o,c,k,d);a.I=Math.max(a.I,l);f.push(new _.pC(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.qd?a.a.qd=b.endTime:a.a.qd=Math.min(a.a.qd,b.endTime);return f},NR=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=RR(a,c,k,h);const fa=new _.qI(l);var m=null;k.type!==_.J&&(m=SR(a,b,c,k,h));h.segmentIndex=fa;l=_.lI++;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=TR[k.type];var D="";switch(k.type){case _.t:D=h.Nd;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.Nd,E=2,"AACH"===h.Ah?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?UR[k.Li]:void 0;h={id:l,originalId:null,qj:null,createSegmentIndex:n,findSegmentPosition:p,getSegmentReference:u,adjustSegmentDurations:v,getDuration:y,segmentIndex:fa,segmentLookupStrategy:_.CA,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.Nc,label:k.name,type:k.type,
|
|
31
|
+
primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:h.Nf||null,spatialAudio:!1,closedCaptions:null}}return h});e=e.concat(g)}return e},OR=function(a,b,c){const d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.jg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},SR=function(a,b,c,d,e){b=vQ(b,d.timescale||c,e);c={isLive:a.F.bind(a),Ud:a.K.bind(a),Hh:()=>1,Sd:a.R.bind(a)};d=new Uint8Array(0);
|
|
32
|
+
try{d=oR(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,"+_.Wl(d);return new _.mI(()=>[f],0,null,null,!0)},GQ=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);_.Mo(a,rQ(this.type));this.size>b&&lQ(a,this.size);"uuid"===this.type&&_.Mo(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()}},VR=class extends GQ{constructor(a,b,c){super(a);this.version=b;this.flags=c}a(){return 4+super.a()}write(a){super.write(a);mQ(a,this.version);nQ(a,this.flags)}},mR=class extends GQ{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);_.Mo(a,this.f,this.offset);a.getPosition()}},sR=class extends VR{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);_.Mo(a,this.f,this.offset);a.getPosition()}},lR=class extends GQ{constructor(a,b,c){super("ftyp");this.h=a;this.og=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);_.Mo(a,rQ(this.h));_.L(a,this.og);_.Mo(a,rQ(this.f.join("")));a.getPosition()}},kR=class extends GQ{constructor(){super(_.Ce)}},jR=class extends GQ{constructor(){super(_.gg)}},
|
|
36
|
+
NQ=class extends VR{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?(lQ(a,0),lQ(a,0),_.L(a,this.timescale),lQ(a,this.duration*this.timescale)):(_.L(a,0),_.L(a,0),_.L(a,this.timescale),_.L(a,this.duration*this.timescale));_.L(a,65536);oQ(a,this.volume);
|
|
37
|
+
oQ(a,0);_.L(a,0);_.L(a,0);for(let b=0;b<this.f.length;b++)mQ(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()}},OQ=class extends GQ{constructor(){super("mvex")}},PQ=class extends VR{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()}},QQ=class extends VR{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?(lQ(a,0),lQ(a,0),_.L(a,this.h),_.L(a,0),lQ(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);oQ(a,0);oQ(a,0);oQ(a,this.volume);oQ(a,0);for(let b=0;b<this.f.length;b++)mQ(a,this.f[b]);oQ(a,
|
|
39
|
+
this.width);oQ(a,0);oQ(a,this.height);oQ(a,0);a.getPosition()}},RQ=class extends VR{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?(lQ(a,0),lQ(a,0),_.L(a,this.timescale),lQ(a,this.duration*this.timescale)):(_.L(a,0),_.L(a,0),_.L(a,this.timescale),_.L(a,this.duration*this.timescale));oQ(a,this.language);oQ(a,0);a.getPosition()}},SQ=class extends VR{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?_.Mo(a,rQ("vide")):_.Mo(a,rQ("soun"));_.L(a,0);_.L(a,0);_.L(a,0);this.f===_.t?_.Mo(a,rQ("VideoHandler\x00")):_.Mo(a,rQ("SoundHandler\x00"));a.getPosition()}},YQ=class extends VR{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);oQ(a,0);_.Mo(a,this.f);a.getPosition()}},WR=class extends GQ{constructor(a){super(a);this.w=!0}a(){return 8+
|
|
41
|
+
super.a()}write(a){super.write(a);_.L(a,0);oQ(a,0);oQ(a,1)}},YR=class extends WR{constructor(a){super(a);this.height=this.width=0;this.depth=24}a(){return 70+super.a()}write(a){super.write(a);oQ(a,0);oQ(a,0);_.L(a,0);_.L(a,0);_.L(a,0);oQ(a,this.width);oQ(a,this.height);_.L(a,4718592);_.L(a,4718592);_.L(a,0);oQ(a,1);mQ(a,10);_.Mo(a,rQ("AVC Coding",31));oQ(a,this.depth);qQ(a,-1)}},ZR=class extends WR{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);oQ(a,this.channelCount);oQ(a,this.sampleSize);qQ(a,0);oQ(a,0);oQ(a,this.sampleRate);oQ(a,0)}},XQ=class extends YR{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()}},HQ=class extends XQ{constructor(a,b){super(a,b);this.type="encv"}},$Q=class extends ZR{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()}},IQ=class extends $Q{constructor(a,b,c){super(a,b,c);this.type="enca"}},WQ=class extends GQ{constructor(a,b){super("avcC");this.Ya=a;this.cc=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.cc[b].byteLength;return a+super.a()}write(a){super.write(a);mQ(a,this.version);mQ(a,this.f);mQ(a,this.h);mQ(a,this.level);mQ(a,255);mQ(a,224|this.Ya.length);
|
|
44
|
+
for(var b=0;b<this.Ya.length;b++)oQ(a,this.Ya[b].length),_.Mo(a,this.Ya[b]);mQ(a,this.cc.length);for(b=0;b<this.cc.length;b++)oQ(a,this.cc[b].length),_.Mo(a,this.cc[b]);a.getPosition()}},ZQ=class extends VR{constructor(a){super("esds",0,0);this.Zb=a}a(){return 22+(this.Zb.byteLength+3)+super.a()}write(a){super.write(a);mQ(a,3);mQ(a,23+this.Zb.byteLength);oQ(a,1);mQ(a,0);mQ(a,4);mQ(a,15+this.Zb.byteLength);mQ(a,64);mQ(a,21);nQ(a,0);_.L(a,0);_.L(a,0);mQ(a,5);mQ(a,this.Zb.byteLength);_.Mo(a,this.Zb);
|
|
45
|
+
_.Mo(a,new Uint8Array([6,1,2]));a.getPosition()}},UQ=class extends VR{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&&_.Mo(a,rQ(this.location));a.getPosition()}},TQ=class extends VR{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()}},bR=class extends GQ{constructor(){super(_.Rf)}},VQ=class extends VR{constructor(){super(_.Tf,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()}},cR=class extends VR{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()}},dR=class extends VR{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()}},fR=class extends VR{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()}},eR=class extends VR{constructor(){super("stsz",0,0)}a(){return 8+super.a()}write(a){super.write(a);_.L(a,0);_.L(a,0);a.getPosition()}},aR=class extends VR{constructor(){super("smhd",0,0)}a(){return 4+super.a()}write(a){super.write(a);qQ(a,0);oQ(a,0);a.getPosition()}},gR=class extends GQ{constructor(){super("dinf")}},hR=class extends GQ{constructor(){super(_.Be)}},
|
|
49
|
+
iR=class extends GQ{constructor(){super(_.xe)}},AR=class extends VR{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?lQ(a,this.baseMediaDecodeTime):_.L(a,this.baseMediaDecodeTime);a.getPosition()}},pR=class extends VR{constructor(){super("mfhd",0,0);this.f=0}a(){return 4+super.a()}write(a){super.write(a);_.L(a,this.f);a.getPosition()}},rR=class extends VR{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&$R&&(a+=4);this.flags&aS&&(a+=4);for(let b=0;b<this.f;b++)this.flags&bS&&(a+=4),this.flags&cS&&(a+=4),this.flags&dS&&(a+=4),this.flags&eS&&(a+=4);return a+super.a()}write(a){super.write(a);_.L(a,this.f);this.flags&$R&&(a.getPosition(),pQ(a,this.j));this.flags&aS&&_.L(a,this.l);for(let b=0;b<this.f;b++)this.flags&bS&&_.L(a,this.o[b]),this.flags&cS&&_.L(a,this.sampleSize[b]),this.flags&dS&&_.L(a,this.A[b]),
|
|
51
|
+
this.flags&eS&&(0===this.version?_.L(a,this.h[b]):pQ(a,this.h[b]));a.getPosition()}},$R=1,aS=4,bS=256,cS=512,dS=1024,eS=2048,qR=class extends VR{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&fS&&(a+=8);this.flags&gS&&(a+=4);this.flags&hS&&(a+=4);this.flags&iS&&(a+=4);this.flags&jS&&(a+=4);return a+super.a()}write(a){super.write(a);_.L(a,this.f);this.flags&fS&&lQ(a,this.h);this.flags&gS&&_.L(a,this.A);this.flags&hS&&_.L(a,this.j);this.flags&
|
|
52
|
+
iS&&_.L(a,this.o);this.flags&jS&&_.L(a,this.l);a.getPosition()}},fS=1,gS=2,hS=8,iS=16,jS=32,wR=class extends GQ{constructor(){super("traf")}},xR=class extends GQ{constructor(){super("moof")}},vR=class extends GQ{constructor(){super(_.we);this.f=new Uint8Array(0)}a(){return this.f.byteLength+super.a()}write(a){super.write(a);0<this.f.byteLength&&_.Mo(a,this.f)}},JQ=class extends VR{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);
|
|
53
|
+
return a+super.a()}write(a){super.write(a);mQ(a,0);0===this.version?mQ(a,0):mQ(a,0);mQ(a,this.f);mQ(a,this.h);_.Mo(a,_.Yl(this.l));if(1===this.f&&0===this.h){mQ(a,0);for(let b=0;b<this.j.length;b++)mQ(a,this.j[b])}a.getPosition()}},LQ=class extends VR{constructor(a,b){super("schm",0,0);this.f=a;this.h=b;this.Ub=""}a(){let a=8;this.flags&1&&(a+=rQ(this.Ub).byteLength);return a+super.a()}write(a){super.write(a);_.Mo(a,rQ(this.f));_.L(a,this.h);this.flags&1&&_.Mo(a,rQ(this.Ub));a.getPosition()}},KQ=
|
|
54
|
+
class extends GQ{constructor(a){super("frma");this.f=a}a(){return rQ(this.f).byteLength+super.a()}write(a){super.write(a);_.Mo(a,rQ(this.f));a.getPosition()}},BR=class extends VR{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]):lQ(a,this.offset[b]);a.getPosition()}},CR=class extends VR{constructor(a,
|
|
55
|
+
b,c){super("saiz",0,0);this.f=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));mQ(a,this.f);_.L(a,this.h);if(0===this.f)for(let b=0;b<this.h;b++)mQ(a,this.j[b]);a.getPosition()}},uR=class extends VR{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].ig.byteLength,this.flags&2){a+=2;for(let c=0;c<this.f[b].Sc;c++)a+=
|
|
56
|
+
2,a+=4}return a+super.a()}write(a){super.write(a);_.L(a,this.h);this.flags&1&&mQ(a,this.j);for(let b=0;b<this.h;b++)if(_.Mo(a,this.f[b].ig),this.flags&2){oQ(a,this.f[b].Sc);for(let c=0;c<this.f[b].Sc;c++)oQ(a,this.f[b].hf[c].Jf),_.L(a,this.f[b].hf[c].Kf)}a.getPosition()}};var zR=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))}},yQ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,zQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,AQ=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,BQ=/^(\d*\.?\d*)f$/,CQ=/^(\d*\.?\d*)t$/,DQ=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;var nR=class{constructor(a){this.a=a;this.f=FQ(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=FQ(this);for(let a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer}};var tR=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);var kS=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=LR;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,sQ(a)])];return HR(this,a).then(c=>PR(this,c.data).then(()=>{QR(this,this.B);return this.j}))}requestStop(){}stop(){this.D&&this.D.networkingEngine.le(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 HR(this,[this.o]).then(a=>PR(this,a.data).then(()=>this.j)).catch(a=>{if(this.D)this.D.onError(a)})}setCurrentVariant(){}Sb(){this.g.debug(_.sA);this.D&&(this.l=null,this.update().then(()=>{QR(this,this.B)}).catch(a=>{this.D&&(this.D.onError(a),1===a.severity&&QR(this,100))}))}F(){return this.P===KR}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),Ud:this.K.bind(this),Hh:()=>1,Sd: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=DR(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 _.kl(`Could not load text stream with id: ${a}`);return d})}},TR={video:_.yg,audio:_.Fc,text:_.zc},LR=_.Db,KR=
|
|
60
|
+
"LIVE",UR={Xi:_.xA,Yi:_.MA};_.x("clpp.smooth.SmoothComponent",class extends _.rv{install(){_.yt.ism=kS;_.xt[_.Ac]=kS}uninstall(){_.NC("ism");_.OC(_.Ac)}id(){return _.Mf}});};f.call(g, window);
|