@castlabs/prestoplay 6.4.0 → 6.4.1
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 +22 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +103 -103
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +414 -398
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +53 -132
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +46 -48
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -32
- package/cjs/cl.ima.js +21 -21
- package/cjs/cl.mse.js +250 -250
- package/cjs/cl.muxdata.js +12 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +69 -69
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +15 -15
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +85 -85
- package/cl.conviva.js +27 -27
- package/cl.core.js +360 -351
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +48 -131
- package/cl.freewheel.js +17 -17
- package/cl.hls.js +39 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +15 -15
- package/cl.mse.js +228 -228
- package/cl.muxdata.js +8 -8
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -17
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/package.json +3 -1
package/cjs/cl.muxdata.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
f=d.
|
|
4
|
-
d.language);return g}}));a.f.debug("Mux SDK options",b);return b},
|
|
5
|
-
a.l.getPosition()})});a.a.on(a.l,_.
|
|
6
|
-
"adplay");
|
|
7
|
-
_.t.initialize=function(a,b){this.g=a;this.m=b;this.w=!1;if(!this.h){try{this.h=!0,mux.init(this.A,
|
|
8
|
-
_.t.destroy=function(){this.f.debug(_.
|
|
9
|
-
_.t.
|
|
10
|
-
_.t.
|
|
11
|
-
_.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.
|
|
12
|
-
{});try{d=[];typeof c===_.
|
|
13
|
-
_.
|
|
2
|
+
var f=function(window){var zu=function(a,b){this.l=a;this.m=this.g=null;this.A=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.cg;this.f=b;this.o=this.j=this.h=this.w=!1},Bu=function(a){var b={debug:!0,data:Au(a)};a.g&&a.g.muxOptionsOverride&&_.J.Gc(a.g.muxOptionsOverride)&&(b=_.J.Va(b,a.g.muxOptionsOverride,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.f.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),
|
|
3
|
+
f=d.ea(),g={player_is_paused:a.l.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.l.getDuration(),player_autoplay_on:!!a.l.getConfiguration().autoplay};if(c){var h=new _.mi(c.url);g.video_source_url=_.ni(h);g.video_source_mime_type=c.type;c.name&&(g.video_title=c.name)}if(c=e.getContainer())g.player_width=c.offsetWidth,g.player_height=c.offsetHeight;f&&f.height&&f.width&&(g.video_source_height=f.height,g.video_source_width=f.width);(d=d.ka())&&d.language&&(g.player_language_code=
|
|
4
|
+
d.language);return g}}));a.f.debug("Mux SDK options",b);return b},Au=function(a){var b={env_key:a.g.envKey,video_title:a.m&&a.m.name||"",player_name:_.ta,player_software_name:_.ta,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Cu=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},Du=function(a){a.a.on(a.l,_.De,function(){Cu(a,_.De,{player_playhead_time:1E3*
|
|
5
|
+
a.l.getPosition()})});a.a.on(a.l,_.Wd,function(){return Cu(a,_.Wd)});a.a.on(a.l,_.qc,a.wh.bind(a));a.a.on(a.l,_.pe,a.yh.bind(a));a.a.on(a.l,_.Le,function(){return Cu(a,_.je)});a.a.on(a.l,_.Ke,function(){return Cu(a,_.ie)});a.a.on(a.l,_.fd,a.xh.bind(a));a.a.on(a.l,_.Fb,function(){return Cu(a,"adbreakstart")});a.a.on(a.l,_.Gb,function(){return Cu(a,"adbreakend")});a.a.on(a.l,_.Sb,function(){Cu(a,"adplay");Cu(a,"adplaying")});a.a.on(a.l,_.Ob,function(){return Cu(a,"adpause")});a.a.on(a.l,_.Qb,function(){Cu(a,
|
|
6
|
+
"adplay");Cu(a,"adplaying")});a.a.on(a.l,_.Tb,function(){return Cu(a,"adended")});a.a.on(a.l,_.Kb,function(){return Cu(a,"adfirstquartile")});a.a.on(a.l,_.Nb,function(){return Cu(a,"admidpoint")});a.a.on(a.l,_.Ub,function(){return Cu(a,"adthirdquartile")})},Eu=function(){this.f=null;this.a=!1;this.g=new _.H("clpp.muxdata")},Fu=function(){};_.t=zu.prototype;
|
|
7
|
+
_.t.initialize=function(a,b){this.g=a;this.m=b;this.w=!1;if(!this.h){try{this.h=!0,mux.init(this.A,Bu(this))}catch(c){throw this.h=!1,_.fg(this.a),new _.L(1,9,9302,null,c);}Cu(this,"playerready")}this.j&&!this.o&&(Cu(this,"videochange",Au(this)),this.j=!1);Du(this)};_.t.release=function(){this.f.debug("release()");this.j?this.f.debug(_.la):(_.fg(this.a),this.j=!0,this.m=this.g=null)};
|
|
8
|
+
_.t.destroy=function(){this.f.debug(_.Tc);this.o?this.f.debug(_.ka):(this.o=!0,this.h&&this.w&&Cu(this,"viewend"),Cu(this,"destroy"))};_.t.wh=function(a){this.f.debug(_.Jd);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Fa())&&a.bandwidth&&(b+=a.bandwidth),Cu(this,"renditionchange",{video_source_bitrate:b}))};
|
|
9
|
+
_.t.yh=function(a){this.f.debug(_.Nd);switch(a.detail.currentState){case _.$m:this.l.getConfiguration().autoplay&&Cu(this,_.Wd);break;case _.bn:Cu(this,_.Xd);break;case _.an:Cu(this,_.Sd);break;case _.Vm:this.w=!0,Cu(this,_.ed)}};
|
|
10
|
+
_.t.xh=function(a){this.f.debug(_.Kd);if(this.h&&(a=a.detail||null))if(10003===a.code)Cu(this,"aderror");else if(a.severity===_.M){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);Cu(this,_.fd,{player_error_code:a.code,player_error_message:b})}};_.v(Eu,_.cq);_.t=Eu.prototype;_.t.onPlayerCreated=function(a){this.f=new zu(a,this.g)};
|
|
11
|
+
_.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.J.R(c.muxdata)&&typeof c.muxdata===_.Id){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.hd&&typeof c.emit===_.hd,window.mux=c,d=!d;d&&(this.g.warn("Mux SDK is not loaded. Will do nothing."),this.a=!1,c=new _.L(1,9,9301),this.T(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.J.Ma(c.muxdata||
|
|
12
|
+
{});try{d=[];typeof c===_.Id&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.L(1,9,9300,{missingKeys:d});this.f.initialize(c,b)}catch(e){this.a=!1,this.T(a,e)}}};_.t.onContentLoaded=function(){};_.t.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.t.onPlayerWillRelease=function(){this.a&&this.f.release()};_.t.id=function(){return"mux"};_.t.T=function(a,b){a.trigger(new _.I(_.fd,{detail:b}))};_.B("clpp.muxdata.MuxDataPlugin",Eu);Eu.Id="mux";Fu.prototype.create=function(){return new Eu};
|
|
13
|
+
_.uo(new Fu);};
|
|
14
14
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
15
15
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
16
16
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.onboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
licenseResponse:_.
|
|
4
|
-
_.t.Wb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),
|
|
2
|
+
var f=function(window){var xu=function(){this.l=null;this.a=new _.H("clpp.onboard")},yu=function(a,b){function c(l){return l&&(_.vh(l,"https://")||_.vh(l,"http://")||_.vh(l,"//"))?l:d+l}var d=b.baseUrl;_.wh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.rk(a);h.Ka(_.Pc,{licenseUrl:e,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.fl,
|
|
3
|
+
licenseResponse:_.kl}});h.Ka(_.Nc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.hl,licenseResponse:_.il,extractContentId:_.el,certificateRequest:_.jl}});h.Ka(_.Oc,{licenseUrl:f,modifiers:{licenseRequest:_.fl}});_.mk(h)};_.v(xu,_.zo);_.t=xu.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};
|
|
4
|
+
_.t.Wb=function(){var a=this.l.getConfiguration().drm,b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.a.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),yu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.B("clpp.onboard.OnboardComponent",xu);_.B("clpp.onboard.register",yu);};
|
|
5
5
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
6
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
7
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.persistent.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
f.a)return _.y(f,_.
|
|
4
|
-
label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.
|
|
5
|
-
serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},
|
|
6
|
-
f.length?q["return"]():_.y(q,d.get(f),2);case 2:if(g=q.f)return e.debug(
|
|
7
|
-
drmConfig:a},_.y(q,d.store(f,g),4);case 4:return
|
|
2
|
+
var f=function(window){var eu="A persistent DRM session already exists for: ",fu="No DRM configuration.",gu="clpp.persistent",hu=function(a){a.A=[a.g];a.m=0;a.j=0},iu=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Nf?a.a=a.m||a.j:void 0!=b.H&&a.j<b.H?(a.a=b.H,a.g=null):a.a=a.j:a.a=0},ju=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},ku=function(a){a=a.g.keys();a=ju(a,function(b){return b.sessionId});return Array.from(a)},lu=function(a,b){var c,d,e;return _.A(function(f){if(1==
|
|
3
|
+
f.a)return _.y(f,_.gm(a,b),2);c=f.f;if(!c)return a.a.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.g.get(c))&&a.C&&(e.nb=new _.Mh,d.push(e.nb));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},nu=function(a,b){a.K=mu;a.L=[];a.G=!0;return _.Ol(a,b)},pu=function(a,b,c,d,e,f){a.K=ou;var g=new Map,h=_.im(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Pd,persistentState:_.fe,sessionTypes:[_.Ud],
|
|
4
|
+
label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Ul(a,g)},qu=function(){},ru=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=JSON.parse(a.audioCapabilities),d=JSON.parse(a.videoCapabilities),e=JSON.parse(a.serverCertificate),f=JSON.parse(a.drmConfig);return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri),
|
|
5
|
+
serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},su=function(a,b){var c=_.ok(a),d=_.Rj({drm:a});d.drm=a;var e=new _.Kl({Ab:b,onError:function(){},Je:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Ec:function(){return null}});e.h=c;return e},vu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.A(function(q){switch(q.a){case 1:d=tu;e=uu;if(!a)return e.debug(fu),q["return"]();f=a.offlineId;return 0===
|
|
6
|
+
f.length?q["return"]():_.y(q,d.get(f),2);case 2:if(g=q.f)return e.debug(eu,f),q["return"]();h=su(a,c);_.xf(q,3,4);return _.y(q,nu(h,b),6);case 6:return _.y(q,_.$l(h),7);case 7:return _.y(q,_.am(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Ii(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=ku(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
|
|
7
|
+
drmConfig:a},_.y(q,d.store(f,g),4);case 4:return hu(q),_.y(q,h.destroy(),10);case 10:iu(q);break;case 3:throw p=_.zf(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},wu=function(){this.l=null;this.f=tu;this.a=new _.H(gu)},mu=1,ou=2;_.t=qu.prototype;
|
|
8
8
|
_.t.store=function(a,b){var c;return _.A(function(d){var e=JSON.stringify(b.sessionIds),f=b.serverCertificate?Array.from(b.serverCertificate):null;f=JSON.stringify(f);var g=JSON.stringify(b.audioCapabilities),h=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:h,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),
|
|
9
|
-
btoa(c));_.z(d)})};_.t.get=function(a){var b;return _.A(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](
|
|
10
|
-
_.
|
|
11
|
-
r=[];w=_.u(d);for(x=w.next();!x.done;x=w.next())
|
|
12
|
-
return _.y(
|
|
13
|
-
_.
|
|
14
|
-
6);case 6:return _.y(l,_
|
|
15
|
-
_.t.
|
|
9
|
+
btoa(c));_.z(d)})};_.t.get=function(a){var b;return _.A(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](ru(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.A(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.t.clear=function(){return _.A(function(a){window.localStorage.clear();_.z(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.B("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.J.R(a)||(_.J.jb(a.store)||c.push("store"),_.J.jb(a.get)||c.push("get"),_.J.jb(a["delete"])||c.push("delete"),_.J.jb(a.clear)||c.push("clear"),_.J.jb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw uu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});tu=a});
|
|
10
|
+
_.B("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,h,l,m,n,p,q,r,w,x,C,D,E,G,K,O,T,Da;return _.A(function(ea){switch(ea.a){case 1:f=tu;g=uu;h=function(fa,xa){return new _.L(1,6,6200,fa,xa)};l=_.fn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(fu);m=b.offlineId;if(typeof m!==_.te||!m.length)throw h("Missing offline id.");return _.y(ea,f.get(m),2);case 2:if(n=ea.f)return g.debug(eu,m),ea["return"]();p=_.Rj();q=new _.Yh;
|
|
11
|
+
r=[];w=_.u(d);for(x=w.next();!x.done;x=w.next())C=x.value,D=new C,_.Vj(D.id())||(D.Ja(null),_.Xj(D),r.push(D));E=null;_.xf(ea,3,4);return _.y(ea,_.tp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return E=ea.f,E.configure(p.manifest),_.y(ea,E.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:G=ea.f;if(!G.periods.length)throw h(null,new _.L(_.M,4,4014));K=_.mp(G.periods);
|
|
12
|
+
return _.y(ea,vu(b,K,q),4);case 4:for(hu(ea);r.length;)O=r.shift(),O.Ca(),_.Uj["delete"](O.id());T=[];E&&T.push(E.stop());T.push(q.destroy());return _.y(ea,Promise.all(T),9);case 9:iu(ea);break;case 3:Da=_.zf(ea);if(Da instanceof _.L&&6200===Da.code)throw Da;throw h(null,Da);}})});
|
|
13
|
+
_.B("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.A(function(l){switch(l.a){case 1:b=tu;c=uu;if(!_.J.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.xf(l,2,3);return _.y(l,b.get(a),5);case 5:f=l.f;if(!f)return c.debug("No persistent DRM session found"),l["return"]();f.drmConfig.delayLicenseRequestUntilPlayed=!0;e=new _.Yh;d=su(f.drmConfig,e);return _.y(l,pu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.y(l,_.$l(d),7);case 7:return _.y(l,Promise.all(f.sessionIds.map(function(m){return _.A(function(n){if(1==n.a)return _.y(n,lu(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.y(l,b["delete"](a),3);case 3:return hu(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.y(l,Promise.all(g),10);case 10:iu(l);break;case 2:throw h=_.zf(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var tu=new qu,uu=new _.H(gu);_.v(wu,_.zo);_.t=wu.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.release=function(){};_.t.Wb=function(){this.f=tu};_.t.id=function(){return _.Td};_.t.uj=function(a,b,c){var d=this,e;return _.A(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.xf(f,2);return _.y(f,vu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.I(_.Yc,{offlineId:a.offlineId})),_.yf(f,0);e=_.zf(f);d.l.onError(e);_.z(f)})};
|
|
15
|
+
_.t.hi=function(a){var b=this,c;return _.A(function(d){if(1==d.a)return _.xf(d,2),_.y(d,b.f.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.a.debug("No offline session found for "+a);return d["return"]([])}_.zf(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.B("clpp.persistent.PersistentLicenseComponent",wu);};
|
|
16
16
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
17
17
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
18
18
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.playlist.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
_.t.
|
|
4
|
-
_.t.next=function(){var a=this,b;return _.A(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.
|
|
5
|
-
_.t.append=function(a){this.a.push(a);
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var f=function(window){var bu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Jj.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.Zf.bind(this)},cu=function(a){a.trigger(new _.I(_.Zd))},du=function(a,b){return 0<=b&&b<a.a.length};_.v(bu,_.Jj);_.t=bu.prototype;_.t.on=function(a,b,c){return _.Jj.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.Jj.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.Jj.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
|
|
3
|
+
_.t.ji=function(){return this.a};_.t.qe=function(){return 0<this.a.length&&du(this,this.f)?this.a[this.f]:null};_.t.ki=function(){var a=this.f+1;return 0<this.a.length&&du(this,a)?this.a[a]:null};_.t.vi=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.ed,this.h),this.Fd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.ed,this.h)};_.t.Zf=function(){this.next()};
|
|
4
|
+
_.t.next=function(){var a=this,b;return _.A(function(c){b=Math.min(a.a.length-1,a.f+1);return _.y(c,a.Fd(b),0)})};_.t.xj=function(){var a=this,b;return _.A(function(c){b=Math.max(0,a.f-1);return _.y(c,a.Fd(b),0)})};_.t.Fd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.A(function(e){if(1==e.a){if(!(0<c.a.length&&du(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.qe())?_.y(e,c.j(d),3):e.H(0)}if(4!=e.a)return _.y(e,c.l.load(d.configuration),4);c.trigger(new _.I(_.Yd,{item:d}));_.z(e)})};
|
|
5
|
+
_.t.append=function(a){this.a.push(a);cu(this)};_.t.oi=function(a,b){if(0<=b&&b<=this.a.length){var c=this.qe();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));cu(this)}};_.t.remove=function(a){if(0<this.a.length&&du(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);cu(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;cu(this)};_.B("clpp.Playlist",bu);bu.prototype.clear=bu.prototype.clear;bu.prototype.remove=bu.prototype.remove;
|
|
6
|
+
bu.prototype.insert=bu.prototype.oi;bu.prototype.append=bu.prototype.append;bu.prototype.goTo=bu.prototype.Fd;bu.prototype.previous=bu.prototype.xj;bu.prototype.next=bu.prototype.next;bu.prototype.onEnded=bu.prototype.Zf;bu.prototype.stop=bu.prototype.stop;bu.prototype.start=bu.prototype.start;bu.prototype.isStarted=bu.prototype.vi;bu.prototype.getUpcoming=bu.prototype.ki;bu.prototype.getCurrent=bu.prototype.qe;bu.prototype.getQueue=bu.prototype.ji;bu.prototype.getPosition=bu.prototype.getPosition;
|
|
7
|
+
bu.prototype.off=bu.prototype.off;bu.prototype.one=bu.prototype.one;bu.prototype.on=bu.prototype.on;};
|
|
8
8
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
9
9
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
10
10
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.smooth.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b,a.g),a.a+=2}catch(c){_.
|
|
4
|
-
a,b,c);this.g=d;this.offset=e},
|
|
5
|
-
b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},
|
|
6
|
-
a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},
|
|
7
|
-
"":a;Y.call(this,"url ",0,1);this.location=a},
|
|
8
|
-
|
|
9
|
-
a;this.h=b;this.Bb=""},
|
|
10
|
-
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.
|
|
11
|
-
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.
|
|
12
|
-
Number(a[1]);var e=Number(a[2]),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
|
|
13
|
-
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))},
|
|
14
|
-
d=null}c=new X("xxxx");a.type===_.
|
|
15
|
-
m.entries=[new
|
|
16
|
-
g]);d=(new
|
|
17
|
-
0,m.flags||0);p.g=_.U(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.h=_.
|
|
18
|
-
_.U(m.F));if(0<n-m.F.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.U(m.F)),m.flags&512&&p.sampleSize.push(_.U(m.F)),m.flags&1024&&p.A.push(_.U(m.F)),m.flags&2048&&(0===m.version?p.h.push(_.U(m.F)):p.h.push(_.
|
|
19
|
-
0;p<n.h;p++){var q={
|
|
20
|
-
f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=
|
|
21
|
-
h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=["begin",_.
|
|
22
|
-
n=g.get("sdtp");e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Lc);else g=8;b.append([e,new
|
|
23
|
-
audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},
|
|
24
|
-
f.a)return c=_.
|
|
25
|
-
_.
|
|
26
|
-
new _.L(_.M,4,4036,a.o);p?(
|
|
27
|
-
new _.L(_.M,4,4034,a.o);for(var
|
|
28
|
-
dC=NaN,eC=NaN,fC=
|
|
29
|
-
hC[2*
|
|
30
|
-
"c"),
|
|
31
|
-
0;lC<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e.Fb.type+" track with bitrate "+(e.Fb.bitrate+". Skipping update."))},
|
|
36
|
-
E="avc1."+(G&&G[0]?E.substr(E.indexOf(G[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",E);break;case _.
|
|
37
|
-
width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:G,encrypted:a.
|
|
38
|
-
0,null,0,null,!0,g));e+=m});if(c.type===_.
|
|
39
|
-
0,null,null,!0)},
|
|
40
|
-
a.j.presentationTimeline;d.j=c;d.m=c}c&&null!=a.m&&(window.clearTimeout(a.m),a.m=null,a.C=null);a.O=b},
|
|
2
|
+
var f=function(window){var qG="Full MP4 box must have flags defined",rG="clpp.smooth.SmoothMP4Processor",sG="codecPrivateData",tG=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.S(a,c);_.S(a,d)},uG=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.uk()}},vG=function(a,b){uG(a,b>>16&255);uG(a,b>>8&255);uG(a,b&255)},wG=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.uk()}},xG=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.uk()}},yG=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.g),a.a+=2}catch(c){_.uk()}},zG=function(a,b){if(void 0!=b){for(var c=new Uint8Array(b),d=Math.min(a.length,b),e=0;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}c=new Uint8Array(a.length);for(d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c},X=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},AG=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},BG=function(a,b,c,d,e){Y.call(this,
|
|
4
|
+
a,b,c);this.g=d;this.offset=e},CG=function(a,b,c){X.call(this,"ftyp");this.h=a;this.Sf=b;this.g=c},DG=function(){X.call(this,_.Cd)},EG=function(){X.call(this,_.Ee)},FG=function(a,b,c){Y.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},GG=function(){X.call(this,"mvex")},HG=function(a){Y.call(this,"trex",0,0);this.g=a},IG=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.h=a;this.duration=
|
|
5
|
+
b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},JG=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},KG=function(a){Y.call(this,"hdlr",0,0);this.g=a},LG=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},MG=function(a){X.call(this,a);this.w=!0},NG=function(a){MG.call(this,a);this.height=this.width=0;this.depth=24},OG=function(a,b,c,d){MG.call(this,
|
|
6
|
+
a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},PG=function(a,b){NG.call(this,"avc1");this.width=a;this.height=b},QG=function(a,b){PG.call(this,a,b);this.type="encv"},RG=function(a,b,c){OG.call(this,"mp4a",a,b,c)},SG=function(a,b,c){RG.call(this,a,b,c);this.type="enca"},TG=function(a,b){X.call(this,"avcC");this.La=a;this.Ob=b;this.version=1;this.g=this.La[0][1];this.h=this.La[0][2];this.level=this.La[0][3]},UG=function(a){Y.call(this,"esds",0,0);this.Gb=a},VG=function(a){a=void 0===a?
|
|
7
|
+
"":a;Y.call(this,"url ",0,1);this.location=a},WG=function(){Y.call(this,"dref",0,0)},XG=function(){X.call(this,_.se)},YG=function(){Y.call(this,_.ue,0,0)},ZG=function(){Y.call(this,"stts",0,0)},$G=function(){Y.call(this,"stsc",0,0)},aH=function(){Y.call(this,"stco",0,0)},bH=function(){Y.call(this,"stsz",0,0)},cH=function(){Y.call(this,"smhd",0,0)},dH=function(){X.call(this,"dinf")},eH=function(){X.call(this,_.Bd)},fH=function(){X.call(this,_.xd)},gH=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
|
|
8
|
+
hH=function(){Y.call(this,"mfhd",0,0);this.g=0},iH=function(a,b){Y.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},jH=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},kH=function(){X.call(this,"traf")},lH=function(){X.call(this,"moof")},mH=function(){X.call(this,_.wd);this.g=new Uint8Array(0)},nH=function(){Y.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},oH=function(a,b){Y.call(this,"schm",0,0);this.g=
|
|
9
|
+
a;this.h=b;this.Bb=""},pH=function(a){X.call(this,"frma");this.g=a},qH=function(){Y.call(this,"saio",0,0);this.offset=[0]},rH=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},sH=function(a,b){Y.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},tH=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},uH=function(a,b,c,d){c=b.Hf[c];b=b.Rj;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",
|
|
10
|
+
String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.xv([a],[b])[0]},vH=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Pe?c=["maxWidth","maxHeight","bitrate",sG,"fourCC"]:a.type===_.ic&&(c=["bitrate",sG,"channels","bitsPerSample","samplingRate","fourCC"]);return _.J.va(a,b,c,["id","segmentIndex"])},wH=function(a,b,c){var d=c.vd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,La:null,Ob:null,width:NaN,height:NaN,Gb:null,jd:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Pe:a.La=[_.dk(d[1])];a.Ob=[_.dk(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.ic:a.Gb=_.dk(c.vd),a.sampleSize=c.Fg||16,a.jd=c.jd,a.channelCount=c.pf}return a},xH=function(a,b){return a.filter(function(c){return c.type===b})},yH=function(a,b){var c=a.exec(b);return null==c||""==c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},FH=function(a,b,c){var d=null;if(zH.test(a)){a=zH.exec(a);d=
|
|
12
|
+
Number(a[1]);var e=Number(a[2]),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 AH.test(a)?d=yH(AH,a):BH.test(a)?d=yH(BH,a):CH.test(a)?(a=CH.exec(a),d=Number(a[1])/c.frameRate):DH.test(a)?(a=DH.exec(a),d=Number(a[1])/c.a):EH.test(a)&&(d=yH(EH,a));d+=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},GH=function(a,
|
|
13
|
+
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))},IH=function(a){this.a=a;this.f=HH(this)},HH=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.tk(b)},JH=function(a,b,c){a:{var d=_.u([_.Pc,_.Oc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Cd(e.value))&&e.keyId){d=e.keyId;break a}_.F(rG,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new X("xxxx");a.type===_.Pe?c=new QG(a.width,a.height):c=new SG(a.channelCount,a.sampleSize,a.jd);a=new nH;a.g=1;a.h=8;a.m=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.le)).append([new pH(b),new oH(_.zc,65536),a]);c.append([b]);return c},KH=function(a,b){var c=b.Kd(),d=new FG(a.timescale,a.duration,a.id),e=(new GG).append([new HG(a.id)]),f=new IG(a.id,a.duration,a.timescale,a.width,a.height),g=new JG(a.timescale,a.duration),h=new KG(a.type),l=null,m=new WG;
|
|
15
|
+
m.entries=[new VG];var n=new YG;switch(a.type){case _.Pe:var p=new TG(a.La,a.Ob);c?(l=JH(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new PG(a.width,a.height)).append([p]),n.entries=[l]);l=new LG;break;case _.ic:p=new UG(a.Gb),c?(l=JH(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new RG(a.channelCount,a.sampleSize,a.jd)).append([p]),n.entries=[l]),l=new cH}n=(new XG).append([n,new ZG,new $G,new bH,new aH]);m=(new dH).append([m]);m=(new eH).append([l,m,n]);g=(new fH).append([g,h,m]);f=(new EG).append([f,
|
|
16
|
+
g]);d=(new DG).append([d,f,e]);e=new CG("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Cd(_.Oc),f=b.Cd(_.Pc),c&&d.append([new AG("pssh",c.initData,8)]),f&&d.append([new AG("pssh",f.initData,8)]),c||f||_.F(rG,"Could not get PSSH init data!"));c=new IH([e,d]);return _.N(c.write())},MH=function(a,b){var c,d,e,f,g,h;(new _.Fk).M("moof",_.Gk).V("mfhd",function(m){var n=new hH;n.g=_.U(m.F);c=n}).M("traf",_.Gk).V("tfhd",function(m){var n=m.F.ya();if(null===m.flags)throw new _.L(_.M,3,3019,qG);var p=new jH(m.version||
|
|
17
|
+
0,m.flags||0);p.g=_.U(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.h=_.Dk(m.F));0<n-m.F.getPosition()&&m.flags&2&&(p.A=_.U(m.F));0<n-m.F.getPosition()&&m.flags&8&&(p.j=_.U(m.F));0<n-m.F.getPosition()&&m.flags&16&&(p.o=_.U(m.F));0<n-m.F.getPosition()&&m.flags&32&&(p.m=_.U(m.F));d=p}).V("trun",function(m){var n=m.F.ya();if(null===m.flags)throw new _.L(_.M,3,3019,qG);var p=new iH(m.version||0,m.flags||0);p.g=_.U(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.j=_.Bk(m.F));0<n-m.F.getPosition()&&m.flags&4&&(p.m=
|
|
18
|
+
_.U(m.F));if(0<n-m.F.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.U(m.F)),m.flags&512&&p.sampleSize.push(_.U(m.F)),m.flags&1024&&p.A.push(_.U(m.F)),m.flags&2048&&(0===m.version?p.h.push(_.U(m.F)):p.h.push(_.Bk(m.F)));e=p}).V("sdtp",function(m){var n=_.Ek(m.F,m.F.ya());f=new BG("sdtp",m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.Ek(m.F,16);if(_.fk(n,LH)){n=_.U(m.F);m.version=n>>>24;m.flags=n&16777215;n=new sH(m.version,m.flags);n.h=_.U(m.F);m.flags&1&&(n.j=_.zk(m.F));for(var p=
|
|
19
|
+
0;p<n.h;p++){var q={Lf:_.Ek(m.F,8),Lc:0,Ze:[]};if(m.flags&2){q.Lc=_.Ak(m.F);for(var r=0;r<q.Lc;r++){var w={mf:0,nf:0};w.mf=_.Ak(m.F);w.nf=_.U(m.F);q.Ze.push(w)}}n.g.push(q)}g=n}}).M(_.wd,function(m){var n=new mH;0<m.F.ya()?n.g=_.Ek(m.F,m.F.ya()):(_.F(rG,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new kH).append([d,e]);f&&l.append([f]);b.Kd()&&g&&l.append([g]);l=(new lH).append([c,l]);return new IH([l,h])},NH=function(a,b,c){var d=c.Kd(),e=a.request.startTime,
|
|
20
|
+
f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=MH(b,c);if(null===g)return a.request.contentType===_.Ae?a.data:g;c=g.get(_.wd);if(a.request.contentType===_.Ae){d=c.g.buffer;if(e){d=_.rh(d);if((d=(new DOMParser).parseFromString(d,_.Ce))&&"tt"===d.documentElement.tagName.toLowerCase())var h=d.documentElement;if(h&&(c=new GH(h.getAttribute("ttp:frameRate"),h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=
|
|
21
|
+
h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=["begin",_.dd];for(var l=0,m=g.length;l<m;l++){b:{var n=f;var p=g[l],q=new RegExp("\\w+:"+p),r=0;if(n.hasAttribute(p))n=n.getAttribute(p);else{p=n.attributes;for(var w=p.length;r<w;r++){var x=p[r].name;if(x=x.match(q)){n=n.getAttribute(x[0]);break b}}n=null}}f.setAttribute(g[l],FH(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.sh(d).buffer}else e=d;return e}h=new lH;a=g.get("mfhd");b=new kH;l=g.get("tfhd");m=new gH(1,f);f=g.get("trun");
|
|
22
|
+
n=g.get("sdtp");e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Lc);else g=8;b.append([e,new qH,new rH(g,l,e.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;c=new IH([h,c]);h=c.write();d&&(d=c.get("saio"),c=c.f,d.offset[0]=e.start+16,c.seek(d.start),d.write(c),h=c.buffer);return h},OH=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
|
|
23
|
+
audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},PH=function(a,b,c){a=_.Fl(a);c&&a.version!==c&&(a=_.pv(a,c));return{initData:_.nv(a),initDataType:_.zc,keyId:b,periodId:null}},RH=function(){this.A=this.j=this.h=this.g=null;this.L=1;this.S=0;this.o="";this.B=this.a=null;this.f=new _.H("clpp.smooth.SmoothParser");this.J=!1;this.m=this.C=null;this.O=QH;this.G=0;this.D=this.I=Infinity;this.w=[];this.K=this.Dj.bind(this)},SH=function(a,b){var c,d,e;return _.A(function(f){if(1==
|
|
24
|
+
f.a)return c=_.Hh(b),c.timeout=a.h.attemptParameters.timeout,c.maxAttempts=Math.max(a.h.attemptParameters.maxAttempts,b.length),c.baseDelay=a.h.attemptParameters.baseDelay,c.backoffFactor=a.h.attemptParameters.backoffFactor,c.fuzzFactor=a.h.attemptParameters.fuzzFactor,c.type=1,d=a.g.networkingEngine.fetch(c),_.y(f,d.P,2);e=f.f;a.o=e.uri;return f["return"](e)})},ZH=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.rh(b);var f=d.parseFromString(e.trim(),_.Ce)}catch(YB){throw YB;}if(f&&f.documentElement.tagName==
|
|
25
|
+
_.tb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(YB){}if(!c)throw a.f.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.o);var h=+TH(a,c,"MajorVersion"),l=+TH(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+TH(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,w=_.rl(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.f.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),
|
|
26
|
+
new _.L(_.M,4,4036,a.o);p?(UH(a,VH),a.C=typeof a.h.liveRefreshPeriod===_.k?1E3*a.h.liveRefreshPeriod:Math.min(1E3*a.G,1E4),n=Infinity):UH(a,QH);a.a={startTime:0,delay:0,duration:n/m,me:r/m,dd:0};if(w){var x=a.h.playreadyVersion,C=[],D=_.rl(w,"ProtectionHeader")[0],E=_.ck(_.tl(D)||""),G=_.Fl(E).a;C.push(OH(_.Pc,{initData:_.nv(_.yl(G)),initDataType:_.zc,keyId:G,periodId:null},[G]));C.push(OH(_.Oc,PH(E,G,x),[G]));a.w=C}var K=[],O=_.rl(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
|
|
27
|
+
new _.L(_.M,4,4034,a.o);for(var T=0;T<O.length;T++){for(var Da,ea=a,fa=O[T],xa=TH(ea,fa,"Type"),ha=+fa.getAttribute("Chunks"),qa=fa.getAttribute("Subtype"),Ba=_.Fi(fa.getAttribute("Language")||_.Ge),$a=fa.getAttribute("Name")||"",La=+fa.getAttribute(_.Ua),ab=+fa.getAttribute(_.Ta),Eb=TH(ea,fa,"Url"),me=+fa.getAttribute("TimeScale")||null,fh=[],Mi=_.rl(fa,_.hb),gh=0;gh<Mi.length;gh++){var Zc=ea,qb=Mi[gh],Vf=xa,GL=+qb.getAttribute("Index"),HL=+TH(Zc,qb,"Bitrate"),aC=NaN,bC=NaN,ym=NaN,Yr=NaN,cC=NaN,
|
|
28
|
+
dC=NaN,eC=NaN,fC=qb.getAttribute("FourCC");switch(Vf){case _.Pe:aC=+TH(Zc,qb,_.Ta);bC=+TH(Zc,qb,_.Ua);break;case _.ic:Yr=+qb.getAttribute("Channels")||2,ym=+TH(Zc,qb,"SamplingRate"),dC=+TH(Zc,qb,"AudioTag"),cC=+TH(Zc,qb,"BitsPerSample"),eC=+TH(Zc,qb,"PacketSize")}var Zr=String(qb.getAttribute("CodecPrivateData"));if(Vf===_.ic&&!Zr){var gC=Yr,hC={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},zm=hC[ym];if("AACH"===fC){var mc=new Uint8Array(4);var iC=
|
|
29
|
+
hC[2*ym];mc[0]=40|zm>>1;mc[1]=zm<<7|gC<<3|iC>>1;mc[2]=iC<<7|8;mc[3]=0;var Yf=new Uint16Array(2);Yf[0]=(mc[0]<<8)+mc[1];Yf[1]=(mc[2]<<8)+mc[3];var jC=Yf[0].toString(16)+Yf[1].toString(16)}else mc=new Uint8Array(2),mc[0]=16|zm>>1,mc[1]=zm<<7|gC<<3,Yf=new Uint16Array(1),Yf[0]=(mc[0]<<8)+mc[1],jC=Yf[0].toString(16);Zr=jC.toUpperCase()}var IL={id:Zc.S++,type:Vf,index:GL,bitrate:HL,vd:Zr,maxHeight:aC,maxWidth:bC,jd:ym,pf:Yr,gk:dC,Fg:cC,rk:eC,bi:fC,segmentIndex:null};fh.push(IL)}Da=fh;for(var qe=[],kC=_.rl(fa,
|
|
30
|
+
"c"),dj=0;dj<kC.length;dj++){var $r=kC[dj],Fd=parseInt($r.getAttribute("t"),10),jh=parseInt($r.getAttribute("d"),10),as=parseInt($r.getAttribute("r"),10),ej=0;if(isNaN(Fd)&&isNaN(jh))throw ea.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.L(_.M,4,4037,ea.o);0===dj&&isNaN(Fd)&&(ej=Fd=0);if(0<dj){var Zf=qe[qe.length-1];ej=Zf.n+1;Zf.d||(Zf.d=Fd-Zf.t);Fd||(Fd=Zf.t+Zf.d);jh||(jh=Fd-Zf.t)}qe.push({n:ej,d:jh,t:Fd});if(as){as--;for(var lC=
|
|
31
|
+
0;lC<as;lC++){var Am=qe[qe.length-1];ej=Am.n+1;Fd=Am.t+Am.d;jh=Am.d;qe.push({n:ej,d:jh,t:Fd})}}}ea.Vc()||qe.length===ha||ea.f.warn("Number of fragments ("+ha+") differs from number of chunks ("+qe.length+").");K.push({type:xa,ik:ha,Lj:qa,language:Ba,name:$a,maxWidth:La,maxHeight:ab,Rj:Eb,tracks:Da,Hf:qe,timescale:me})}var jf={pk:h,Sf:l,timescale:m,duration:n,isLive:p,nk:q,me:r,ue:!1,streams:K};if(a.j&&a.A)return WH(a,jf),Promise.resolve();var bs=jf.timescale,cs=jf.duration,KL=xH(jf.streams,_.ic),
|
|
32
|
+
LL=xH(jf.streams,_.Pe),ML=xH(jf.streams,_.Ae),mC=[],Bm=XH(a,cs,bs,KL),Cm=XH(a,cs,bs,LL),NL=XH(a,cs,bs,ML);Bm.length||(Bm=[null]);Cm.length||(Cm=[null]);for(var es=0;es<Cm.length;es++)for(var fs=0;fs<Bm.length;fs++)mC.push(YH(a,Cm[es],Bm[fs]));var nC={startTime:0,variants:mC,textStreams:NL,thumbStreams:[]};var PL=jf.streams,gs=a.a.startTime,oC=a.a.delay,hs=a.I,pC=Math.min(a.a.duration||Infinity,hs),is=a.Vc(),QL=a.a.me,RL=a.a.dd,qC=a.G,rC=isFinite(a.D)?a.D:0;if(is)pC=Infinity,gs=Date.now()/1E3-RL,a.a.startTime=
|
|
33
|
+
gs,oC=3*qC;else for(var SL=isFinite(hs)?hs:a.a.duration,sC=_.u(PL),js=sC.next();!js.done;js=sC.next())for(var tC=_.u(js.value.tracks),ks=tC.next();!ks.done;ks=tC.next()){var uC=ks.value;uC.segmentIndex.offset(-rC);_.lw(uC.segmentIndex,SL)}a.B=new _.Vv(gs,oC,!is,!0);a.B.Rb(pC);_.Zv(a.B,qC);a.B.hc=QL;is||a.B.offset(-rC);a.g.filterAllPeriods([nC]);a.j={presentationTimeline:a.B,periods:[nC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.g.networkingEngine.be(a.K),a.J=!0);a.A=jf;return Promise.resolve()},
|
|
34
|
+
WH=function(a,b){for(var c=0;c<a.A.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.A.streams[c].tracks),g=f.next();!g.done;e={Fb:e.Fb},g=f.next())if(e.Fb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Fb.type&&m.bitrate===l.Fb.bitrate}}(e))){vH(e.Fb,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var h=$H(a,a.A.timescale,d,g);g=e.Fb.segmentIndex;g.Va(h);(h=a.a.me)&&_.jw(g,_.iw(g)-h)}else a.f.warn("Cannot find satisfying update for "+
|
|
35
|
+
e.Fb.type+" track with bitrate "+(e.Fb.bitrate+". Skipping update."))},XH=function(a,b,c,d){for(var e=[],f={rc:0};f.rc<d.length;f={rc:f.rc},f.rc++){var g=d[f.rc].tracks.map(function(h){return function(l){var m=d[h.rc],n=$H(a,c,m,l),p=new _.hw(n),q=null;m.type!==_.Ae&&(q=aI(a,b,c,m,l));l.segmentIndex=p;n=a.L++;var r=Promise.resolve.bind(Promise),w=p.zc.bind(p),x=p.get.bind(p),C=p.Oc.bind(p);p=p.getDuration.bind(p);var D=bI[m.type],E="";switch(m.type){case _.Pe:E=l.vd;var G=/00000001[0-9]7/.exec(E);
|
|
36
|
+
E="avc1."+(G&&G[0]?E.substr(E.indexOf(G[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",E);break;case _.ic:E=l.vd,G=2,"AACH"===l.bi?G=5:E&&(G=(parseInt(E.substr(0,2),16)&248)>>3),E="mp4a.40."+G,a.f.debug("AUDIO CODECS: ",E)}G=m.type===_.Ae?cI[m.Lj]:void 0;return{id:n,originalId:null,tk:null,createSegmentIndex:r,findSegmentPosition:w,getSegmentReference:x,adjustSegmentDurations:C,getDuration:p,segmentIndex:null,segmentLookupStrategy:_.av,initSegmentReference:q,mimeType:D,codecs:E,frameRate:void 0,bandwidth:l.bitrate,
|
|
37
|
+
width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:G,encrypted:a.we(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.pf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},$H=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Hf.forEach(function(h,l){var m=h.d/g;if(0===l){var n=h.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=uH(a.o,c,l,d);a.G=Math.max(a.G,m);f.push(new _.Uv(l,n,p,function(){return[q]},
|
|
38
|
+
0,null,0,null,!0,g));e+=m});if(c.type===_.Pe||c.type===_.ic)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.dd?a.a.dd=b.endTime:a.a.dd=Math.min(a.a.dd,b.endTime);return f},aI=function(a,b,c,d,e){b=wH(b,d.timescale||c,e);c={isLive:a.Vc.bind(a),Kd:a.we.bind(a),gi:function(){return 1},Cd:a.Jf.bind(a)};d=new Uint8Array(0);try{d=KH(b,c)}catch(g){throw a.f.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.bk(d);return new _.Tv(function(){return[f]},
|
|
39
|
+
0,null,null,!0)},YH=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ge;return c||b?{id:a.L++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},TH=function(a,b,c){if(b=b.getAttribute(c))return b;a.f.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.o,c);},dI=function(a,b){null!=a.C&&null!=b&&(a.m=window.setTimeout(a.Ah.bind(a),b))},UH=function(a,b){var c=b===QH;if(a.j&&a.j.presentationTimeline){var d=
|
|
40
|
+
a.j.presentationTimeline;d.j=c;d.m=c}c&&null!=a.m&&(window.clearTimeout(a.m),a.m=null,a.C=null);a.O=b},eI=function(){};X.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this};X.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};
|
|
41
41
|
X.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
|
|
42
|
-
X.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.
|
|
43
|
-
_.v(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_.v(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
_.v(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_.v(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_.t.update=function(){var a=this;if(this.
|
|
70
|
-
_.t.
|
|
71
|
-
_.t.
|
|
42
|
+
X.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.S(a,1):_.S(a,this.size);_.vk(a,zG(this.type));this.size>b&&tG(a,this.size);"uuid"===this.type&&_.vk(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.v(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);uG(a,this.version);vG(a,this.flags)};
|
|
43
|
+
_.v(AG,X);AG.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};AG.prototype.write=function(a){X.prototype.write.call(this,a);_.vk(a,this.g,this.offset);a.getPosition()};_.v(BG,Y);BG.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};BG.prototype.write=function(a){Y.prototype.write.call(this,a);_.vk(a,this.g,this.offset);a.getPosition()};_.v(CG,X);
|
|
44
|
+
CG.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};CG.prototype.write=function(a){X.prototype.write.call(this,a);_.vk(a,zG(this.h));_.S(a,this.Sf);_.vk(a,zG(this.g.join("")));a.getPosition()};_.v(DG,X);_.v(EG,X);_.v(FG,Y);FG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=Y.prototype.a.call(this)};
|
|
45
|
+
FG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(tG(a,0),tG(a,0),_.S(a,this.timescale),tG(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));_.S(a,65536);wG(a,this.volume);wG(a,0);_.S(a,0);_.S(a,0);for(var b=0;b<this.g.length;b++)uG(a,this.g[b]);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,0);_.S(a,this.h);a.getPosition()};_.v(GG,X);_.v(HG,Y);HG.prototype.a=function(){return 20+Y.prototype.a.call(this)};
|
|
46
|
+
HG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);_.S(a,1);_.S(a,0);_.S(a,0);_.S(a,0);a.getPosition()};_.v(IG,Y);IG.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+Y.prototype.a.call(this)};
|
|
47
|
+
IG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(tG(a,0),tG(a,0),_.S(a,this.h),_.S(a,0),tG(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.h),_.S(a,0),_.S(a,this.duration*this.timescale));_.S(a,0);_.S(a,0);wG(a,0);wG(a,0);wG(a,this.volume);wG(a,0);for(var b=0;b<this.g.length;b++)uG(a,this.g[b]);wG(a,this.width);wG(a,0);wG(a,this.height);wG(a,0);a.getPosition()};_.v(JG,Y);JG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
|
|
48
|
+
JG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(tG(a,0),tG(a,0),_.S(a,this.timescale),tG(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));wG(a,this.language);wG(a,0);a.getPosition()};_.v(KG,Y);KG.prototype.a=function(){return 33+Y.prototype.a.call(this)};
|
|
49
|
+
KG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);this.g===_.Pe?_.vk(a,zG("vide")):_.vk(a,zG("soun"));_.S(a,0);_.S(a,0);_.S(a,0);this.g===_.Pe?_.vk(a,zG("VideoHandler\x00")):_.vk(a,zG("SoundHandler\x00"));a.getPosition()};_.v(LG,Y);LG.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};LG.prototype.write=function(a){Y.prototype.write.call(this,a);wG(a,0);_.vk(a,this.g);a.getPosition()};_.v(MG,X);MG.prototype.a=function(){return 8+X.prototype.a.call(this)};
|
|
50
|
+
MG.prototype.write=function(a){X.prototype.write.call(this,a);_.S(a,0);wG(a,0);wG(a,1)};_.v(NG,MG);NG.prototype.a=function(){return 70+MG.prototype.a.call(this)};NG.prototype.write=function(a){MG.prototype.write.call(this,a);wG(a,0);wG(a,0);_.S(a,0);_.S(a,0);_.S(a,0);wG(a,this.width);wG(a,this.height);_.S(a,4718592);_.S(a,4718592);_.S(a,0);wG(a,1);uG(a,10);_.vk(a,zG("AVC Coding",31));wG(a,this.depth);yG(a,-1)};_.v(OG,MG);OG.prototype.a=function(){return 20+MG.prototype.a.call(this)};
|
|
51
|
+
OG.prototype.write=function(a){MG.prototype.write.call(this,a);_.S(a,0);_.S(a,0);wG(a,this.channelCount);wG(a,this.sampleSize);yG(a,0);wG(a,0);wG(a,this.sampleRate);wG(a,0)};_.v(PG,NG);PG.prototype.write=function(a){NG.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(QG,PG);_.v(RG,OG);RG.prototype.write=function(a){OG.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(SG,RG);_.v(TG,X);
|
|
52
|
+
TG.prototype.a=function(){for(var a=7,b=0;b<this.La.length;b++)a+=2,a+=this.La[b].byteLength;for(b=0;b<this.La.length;b++)a+=2,a+=this.Ob[b].byteLength;return a+X.prototype.a.call(this)};
|
|
53
|
+
TG.prototype.write=function(a){X.prototype.write.call(this,a);uG(a,this.version);uG(a,this.g);uG(a,this.h);uG(a,this.level);uG(a,255);uG(a,224|this.La.length);for(var b=0;b<this.La.length;b++)wG(a,this.La[b].length),_.vk(a,this.La[b]);uG(a,this.Ob.length);for(b=0;b<this.Ob.length;b++)wG(a,this.Ob[b].length),_.vk(a,this.Ob[b]);a.getPosition()};_.v(UG,Y);UG.prototype.a=function(){return 22+(this.Gb.byteLength+3)+Y.prototype.a.call(this)};
|
|
54
|
+
UG.prototype.write=function(a){Y.prototype.write.call(this,a);uG(a,3);uG(a,23+this.Gb.byteLength);wG(a,1);uG(a,0);uG(a,4);uG(a,15+this.Gb.byteLength);uG(a,64);uG(a,21);vG(a,0);_.S(a,0);_.S(a,0);uG(a,5);uG(a,this.Gb.byteLength);_.vk(a,this.Gb);_.vk(a,new Uint8Array([6,1,2]));a.getPosition()};_.v(VG,Y);VG.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};VG.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.vk(a,zG(this.location));a.getPosition()};
|
|
55
|
+
_.v(WG,Y);WG.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};WG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(XG,X);_.v(YG,Y);YG.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
|
|
56
|
+
YG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(ZG,Y);ZG.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};ZG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v($G,Y);
|
|
57
|
+
$G.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};$G.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(aH,Y);aH.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Y.prototype.a.call(this)};
|
|
58
|
+
aH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.v(bH,Y);bH.prototype.a=function(){return 8+Y.prototype.a.call(this)};bH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);_.S(a,0);a.getPosition()};_.v(cH,Y);cH.prototype.a=function(){return 4+Y.prototype.a.call(this)};cH.prototype.write=function(a){Y.prototype.write.call(this,a);yG(a,0);wG(a,0);a.getPosition()};
|
|
59
|
+
_.v(dH,X);_.v(eH,X);_.v(fH,X);_.v(gH,Y);gH.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};gH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?tG(a,this.g):_.S(a,this.g);a.getPosition()};_.v(hH,Y);hH.prototype.a=function(){return 4+Y.prototype.a.call(this)};hH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);a.getPosition()};_.v(iH,Y);
|
|
60
|
+
iH.prototype.a=function(){var a=4;this.flags&fI&&(a+=4);this.flags&gI&&(a+=4);for(var b=0;b<this.g;b++)this.flags&hI&&(a+=4),this.flags&iI&&(a+=4),this.flags&jI&&(a+=4),this.flags&kI&&(a+=4);return a+Y.prototype.a.call(this)};
|
|
61
|
+
iH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&fI&&(a.getPosition(),xG(a,this.j));this.flags&gI&&_.S(a,this.m);for(var b=0;b<this.g;b++)this.flags&hI&&_.S(a,this.o[b]),this.flags&iI&&_.S(a,this.sampleSize[b]),this.flags&jI&&_.S(a,this.A[b]),this.flags&kI&&(0===this.version?_.S(a,this.h[b]):xG(a,this.h[b]));a.getPosition()};var fI=1,gI=4,hI=256,iI=512,jI=1024,kI=2048;_.v(jH,Y);
|
|
62
|
+
jH.prototype.a=function(){var a=4;this.flags&lI&&(a+=8);this.flags&mI&&(a+=4);this.flags&nI&&(a+=4);this.flags&oI&&(a+=4);this.flags&pI&&(a+=4);return a+Y.prototype.a.call(this)};jH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&lI&&tG(a,this.h);this.flags&mI&&_.S(a,this.A);this.flags&nI&&_.S(a,this.j);this.flags&oI&&_.S(a,this.o);this.flags&pI&&_.S(a,this.m);a.getPosition()};var lI=1,mI=2,nI=8,oI=16,pI=32;_.v(kH,X);_.v(lH,X);_.v(mH,X);
|
|
63
|
+
mH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};mH.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.vk(a,this.g)};_.v(nH,Y);nH.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+Y.prototype.a.call(this)};
|
|
64
|
+
nH.prototype.write=function(a){Y.prototype.write.call(this,a);uG(a,0);0===this.version?uG(a,0):uG(a,0);uG(a,this.g);uG(a,this.h);_.vk(a,_.dk(this.m));if(1===this.g&&0===this.h){uG(a,0);for(var b=0;b<this.j.length;b++)uG(a,this.j[b])}a.getPosition()};_.v(oH,Y);oH.prototype.a=function(){var a=8;this.flags&1&&(a+=zG(this.Bb).byteLength);return a+Y.prototype.a.call(this)};oH.prototype.write=function(a){Y.prototype.write.call(this,a);_.vk(a,zG(this.g));_.S(a,this.h);this.flags&1&&_.vk(a,zG(this.Bb));a.getPosition()};
|
|
65
|
+
_.v(pH,X);pH.prototype.a=function(){return zG(this.g).byteLength+X.prototype.a.call(this)};pH.prototype.write=function(a){X.prototype.write.call(this,a);_.vk(a,zG(this.g));a.getPosition()};_.v(qH,Y);qH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=4;for(var b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+Y.prototype.a.call(this)};
|
|
66
|
+
qH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));_.S(a,1);for(var b=0;1>b;b++)0===this.version?_.S(a,this.offset[b]):tG(a,this.offset[b]);a.getPosition()};_.v(rH,Y);rH.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+Y.prototype.a.call(this)};
|
|
67
|
+
rH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));uG(a,this.g);_.S(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)uG(a,this.j[b]);a.getPosition()};_.v(sH,Y);sH.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Lf.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Lc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
|
|
68
|
+
sH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.h);this.flags&1&&uG(a,this.j);for(var b=0;b<this.h;b++)if(_.vk(a,this.g[b].Lf),this.flags&2){wG(a,this.g[b].Lc);for(var c=0;c<this.g[b].Lc;c++)wG(a,this.g[b].Ze[c].mf),_.S(a,this.g[b].Ze[c].nf)}a.getPosition()};var zH=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,AH=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,BH=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,CH=/^(\d*\.?\d*)f$/,DH=/^(\d*\.?\d*)t$/,EH=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;IH.prototype.get=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b].get(a);if(c)return c}return null};IH.prototype.write=function(){this.f=HH(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var LH=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=RH.prototype;_.t.configure=function(a){this.h=a};_.t.start=function(a,b){var c=this;this.g=b;var d=_.kf(new Set([a,tH(a)])).concat();return SH(this,d).then(function(e){return ZH(c,e.data).then(function(){dI(c,c.C);return c.j})})};_.t.stop=function(){this.g&&this.g.networkingEngine.Se(this.K);this.C=this.A=this.j=this.h=this.g=null;this.m&&(clearTimeout(this.m),this.m=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
|
|
69
|
+
_.t.update=function(){var a=this;if(this.Vc())return SH(this,[this.o]).then(function(b){return ZH(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.g)a.g.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Ah=function(){var a=this;this.f.debug(_.Uu);this.g&&(this.m=null,this.update().then(function(){dI(a,a.C)})["catch"](function(b){a.g&&(a.g.onError(b),1===b.severity&&dI(a,100))}))};_.t.Vc=function(){return this.O===VH};
|
|
70
|
+
_.t.we=function(){return 0<this.w.length};_.t.Jf=function(a){var b=null;if(this.w.length)for(var c=0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[c].initData[0];break}return b};
|
|
71
|
+
_.t.Dj=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.A.timescale,c={isLive:this.Vc.bind(this),Kd:this.we.bind(this),gi:function(){return 1},Cd:this.Jf.bind(this)},d=!1,e=new _.L(_.M,3,4035,null),f=null;try{f=NH(a,b,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)};var bI={video:_.Re,audio:_.nc,text:_.fc},QH="VOD",VH="LIVE",cI={Tj:"caption",$j:_.we};_.v(eI,_.zo);eI.prototype.Ja=function(){_.wp.ism=RH;_.up[_.gc]=RH};eI.prototype.Ca=function(){_.qw("ism");_.rw(_.gc)};eI.prototype.id=function(){return"smooth"};_.B("clpp.smooth.SmoothComponent",eI);};
|
|
72
72
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
73
73
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
74
74
|
else{_=this.clpp._;(f.call(g,this));}
|