@castlabs/prestoplay 6.4.1 → 6.5.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 +35 -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 +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +419 -416
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +47 -47
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +258 -255
- package/cjs/cl.muxdata.js +12 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- 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 +71 -71
- 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 +19 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +354 -351
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -39
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +230 -231
- 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 +15 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -16
- package/package.json +6 -2
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 Du=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 _.dg;this.f=b;this.o=this.j=this.h=this.w=!1},Fu=function(a){var b={debug:!0,data:Eu(a)};a.g&&a.g.muxOptionsOverride&&_.K.Ic(a.g.muxOptionsOverride)&&(b=_.K.Wa(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.ga(),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 _.ni(c.url);g.video_source_url=_.oi(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.ma())&&d.language&&(g.player_language_code=
|
|
4
|
+
d.language);return g}}));a.f.debug("Mux SDK options",b);return b},Eu=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:_.ea,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ea};(a=a.l.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},Gu=function(a,b,c){a.f.debug("Event: "+b);mux.emit(a.A,b,c)},Hu=function(a){a.a.on(a.l,_.Ee,function(){Gu(a,_.Ee,{player_playhead_time:1E3*
|
|
5
|
+
a.l.getPosition()})});a.a.on(a.l,_.Xd,function(){return Gu(a,_.Xd)});a.a.on(a.l,_.qc,a.zh.bind(a));a.a.on(a.l,_.re,a.Bh.bind(a));a.a.on(a.l,_.Me,function(){return Gu(a,_.ke)});a.a.on(a.l,_.Le,function(){return Gu(a,_.je)});a.a.on(a.l,_.gd,a.Ah.bind(a));a.a.on(a.l,_.Fb,function(){return Gu(a,"adbreakstart")});a.a.on(a.l,_.Gb,function(){return Gu(a,"adbreakend")});a.a.on(a.l,_.Sb,function(){Gu(a,"adplay");Gu(a,"adplaying")});a.a.on(a.l,_.Ob,function(){return Gu(a,"adpause")});a.a.on(a.l,_.Qb,function(){Gu(a,
|
|
6
|
+
"adplay");Gu(a,"adplaying")});a.a.on(a.l,_.Tb,function(){return Gu(a,"adended")});a.a.on(a.l,_.Kb,function(){return Gu(a,"adfirstquartile")});a.a.on(a.l,_.Nb,function(){return Gu(a,"admidpoint")});a.a.on(a.l,_.Ub,function(){return Gu(a,"adthirdquartile")})},Iu=function(){this.f=null;this.a=!1;this.g=new _.H("clpp.muxdata")},Ju=function(){};_.t=Du.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,Fu(this))}catch(c){throw this.h=!1,_.gg(this.a),new _.L(1,9,9302,null,c);}Gu(this,"playerready")}this.j&&!this.o&&(Gu(this,"videochange",Eu(this)),this.j=!1);Hu(this)};_.t.release=function(){this.f.debug("release()");this.j?this.f.debug(_.ja):(_.gg(this.a),this.j=!0,this.m=this.g=null)};
|
|
8
|
+
_.t.destroy=function(){this.f.debug(_.Uc);this.o?this.f.debug(_.ia):(this.o=!0,this.h&&this.w&&Gu(this,"viewend"),Gu(this,"destroy"))};_.t.zh=function(a){this.f.debug(_.Kd);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Fa())&&a.bandwidth&&(b+=a.bandwidth),Gu(this,"renditionchange",{video_source_bitrate:b}))};
|
|
9
|
+
_.t.Bh=function(a){this.f.debug(_.Od);switch(a.detail.currentState){case _.an:this.l.getConfiguration().autoplay&&Gu(this,_.Xd);break;case _.cn:Gu(this,_.Yd);break;case _.bn:Gu(this,_.Td);break;case _.Wm:this.w=!0,Gu(this,_.fd)}};
|
|
10
|
+
_.t.Ah=function(a){this.f.debug(_.Ld);if(this.h&&(a=a.detail||null))if(10003===a.code)Gu(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);Gu(this,_.gd,{player_error_code:a.code,player_error_message:b})}};_.v(Iu,_.eq);_.t=Iu.prototype;_.t.onPlayerCreated=function(a){this.f=new Du(a,this.g)};
|
|
11
|
+
_.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();if(this.a=!_.K.S(c.muxdata)&&typeof c.muxdata===_.Jd){c=c.muxdata;var d;if(d="undefined"===typeof window.mux)c=c.muxLib,d="undefined"!==typeof c&&typeof c.init===_.id&&typeof c.emit===_.id,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.U(a,c))}else this.g.warn("Mux plugin is loaded but not configured. Will do nothing.");if(this.a){c=a.getConfiguration();c=_.K.Na(c.muxdata||
|
|
12
|
+
{});try{d=[];typeof c===_.Jd&&(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.U(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.U=function(a,b){a.trigger(new _.J(_.gd,{detail:b}))};_.C("clpp.muxdata.MuxDataPlugin",Iu);Iu.Id="mux";Ju.prototype.create=function(){return new Iu};
|
|
13
|
+
_.wo(new Ju);};
|
|
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.
|
|
2
|
+
var f=function(window){var Bu=function(){this.l=null;this.a=new _.H("clpp.onboard")},Cu=function(a,b){function c(l){return l&&(_.wh(l,"https://")||_.wh(l,"http://")||_.wh(l,"//"))?l:d+l}var d=b.baseUrl;_.xh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.sk(a);h.Ka(_.Qc,{licenseUrl:e,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.gl,
|
|
3
|
+
licenseResponse:_.ll}});h.Ka(_.Oc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.il,licenseResponse:_.jl,extractContentId:_.fl,certificateRequest:_.kl}});h.Ka(_.Pc,{licenseUrl:f,modifiers:{licenseRequest:_.gl}});_.nk(h)};_.v(Bu,_.Bo);_.t=Bu.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};
|
|
4
|
+
_.t.Yb=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+"'"),Cu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.C("clpp.onboard.OnboardComponent",Bu);_.C("clpp.onboard.register",Cu);};
|
|
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 _.
|
|
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"]():_.
|
|
7
|
-
drmConfig:a},_.
|
|
8
|
-
_.t.store=function(a,b){var c;return _.
|
|
9
|
-
btoa(c));_.z(d)})};_.t.get=function(a){var b;return _.
|
|
10
|
-
_.
|
|
11
|
-
r=[];w=_.u(d);for(
|
|
12
|
-
return _.
|
|
13
|
-
_.
|
|
14
|
-
6);case 6:return _.
|
|
15
|
-
_.t.
|
|
2
|
+
var f=function(window){var iu="A persistent DRM session already exists for: ",ju="No DRM configuration.",ku="clpp.persistent",lu=function(a){a.A=[a.g];a.m=0;a.j=0},mu=function(a){var b=a.A.splice(0)[0];(b=a.g=a.g||b)?b.Pf?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},nu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},ou=function(a){a=a.g.keys();a=nu(a,function(b){return b.sessionId});return Array.from(a)},pu=function(a,b){var c,d,e;return _.B(function(f){if(1==
|
|
3
|
+
f.a)return _.x(f,_.hm(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.B&&(e.ob=new _.Nh,d.push(e.ob));a.a.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},ru=function(a,b){a.K=qu;a.L=[];a.F=!0;return _.Pl(a,b)},tu=function(a,b,c,d,e,f){a.K=su;var g=new Map,h=_.jm(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Qd,persistentState:_.ge,sessionTypes:[_.Vd],
|
|
4
|
+
label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Vl(a,g)},uu=function(){},vu=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}},wu=function(a,b){var c=_.pk(a),d=_.Sj({drm:a});d.drm=a;var e=new _.Ll({Ab:b,onError:function(){},Le:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Gc:function(){return null}});e.h=c;return e},zu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.B(function(q){switch(q.a){case 1:d=xu;e=yu;if(!a)return e.debug(ju),q["return"]();f=a.offlineId;return 0===
|
|
6
|
+
f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(iu,f),q["return"]();h=wu(a,c);_.yf(q,3,4);return _.x(q,ru(h,b),6);case 6:return _.x(q,_.am(h),7);case 7:return _.x(q,_.bm(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Ji(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=ou(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,
|
|
7
|
+
drmConfig:a},_.x(q,d.store(f,g),4);case 4:return lu(q),_.x(q,h.destroy(),10);case 10:mu(q);break;case 3:throw p=_.Af(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},Au=function(){this.l=null;this.f=xu;this.a=new _.H(ku)},qu=1,su=2;_.t=uu.prototype;
|
|
8
|
+
_.t.store=function(a,b){var c;return _.B(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 _.B(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](vu(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.B(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.z(b)})};_.t.clear=function(){return _.B(function(a){window.localStorage.clear();_.z(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.C("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.K.S(a)||(_.K.kb(a.store)||c.push("store"),_.K.kb(a.get)||c.push("get"),_.K.kb(a["delete"])||c.push("delete"),_.K.kb(a.clear)||c.push("clear"),_.K.kb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw yu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});xu=a});
|
|
10
|
+
_.C("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,y,A,E,F,D,I,O,T,Fa;return _.B(function(fa){switch(fa.a){case 1:f=xu;g=yu;h=function(ka,wa){return new _.L(1,6,6200,ka,wa)};l=_.gn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(ju);m=b.offlineId;if(typeof m!==_.ue||!m.length)throw h("Missing offline id.");return _.x(fa,f.get(m),2);case 2:if(n=fa.f)return g.debug(iu,m),fa["return"]();p=_.Sj();q=new _.Zh;
|
|
11
|
+
r=[];w=_.u(d);for(y=w.next();!y.done;y=w.next())A=y.value,E=new A,_.Wj(E.id())||(E.Ja(null),_.Yj(E),r.push(E));F=null;_.yf(fa,3,4);return _.x(fa,_.vp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=fa.f,F.configure(p.manifest),_.x(fa,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:D=fa.f;if(!D.periods.length)throw h(null,new _.L(_.M,4,4014));I=_.op(D.periods);
|
|
12
|
+
return _.x(fa,zu(b,I,q),4);case 4:for(lu(fa);r.length;)O=r.shift(),O.Ca(),_.Vj["delete"](O.id());T=[];F&&T.push(F.stop());T.push(q.destroy());return _.x(fa,Promise.all(T),9);case 9:mu(fa);break;case 3:Fa=_.Af(fa);if(Fa instanceof _.L&&6200===Fa.code)throw Fa;throw h(null,Fa);}})});
|
|
13
|
+
_.C("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.B(function(l){switch(l.a){case 1:b=xu;c=yu;if(!_.K.Y(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.yf(l,2,3);return _.x(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 _.Zh;d=wu(f.drmConfig,e);return _.x(l,tu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.x(l,_.am(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.B(function(n){if(1==n.a)return _.x(n,pu(d,m),2);c.debug("successfully removed session with id",m);_.z(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return lu(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:mu(l);break;case 2:throw h=_.Af(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var xu=new uu,yu=new _.H(ku);_.v(Au,_.Bo);_.t=Au.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.release=function(){};_.t.Yb=function(){this.f=xu};_.t.id=function(){return _.Ud};_.t.wj=function(a,b,c){var d=this,e;return _.B(function(f){if(1==f.a){if(!a)return d.a.debug("No DRM configuration found for loaded source."),f["return"]();_.yf(f,2);return _.x(f,zu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.J(_.Zc,{offlineId:a.offlineId})),_.zf(f,0);e=_.Af(f);d.l.onError(e);_.z(f)})};
|
|
15
|
+
_.t.ji=function(a){var b=this,c;return _.B(function(d){if(1==d.a)return _.yf(d,2),_.x(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"]([])}_.Af(d);b.a.warn("Error while loading session info from storage");return d["return"]([])})};_.C("clpp.persistent.PersistentLicenseComponent",Au);};
|
|
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 _.
|
|
5
|
-
_.t.append=function(a){this.a.push(a);
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var f=function(window){var fu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Kj.call(this);this.l=a;this.j=b;this.f=0;this.a=[];this.g=!1;this.h=this.bg.bind(this)},gu=function(a){a.trigger(new _.J(_.$d))},hu=function(a,b){return 0<=b&&b<a.a.length};_.v(fu,_.Kj);_.t=fu.prototype;_.t.on=function(a,b,c){return _.Kj.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.Kj.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.Kj.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
|
|
3
|
+
_.t.li=function(){return this.a};_.t.se=function(){return 0<this.a.length&&hu(this,this.f)?this.a[this.f]:null};_.t.mi=function(){var a=this.f+1;return 0<this.a.length&&hu(this,a)?this.a[a]:null};_.t.wi=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.fd,this.h),this.Hd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.fd,this.h)};_.t.bg=function(){this.next()};
|
|
4
|
+
_.t.next=function(){var a=this,b;return _.B(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Hd(b),0)})};_.t.zj=function(){var a=this,b;return _.B(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Hd(b),0)})};_.t.Hd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.B(function(e){if(1==e.a){if(!(0<c.a.length&&hu(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.se())?_.x(e,c.j(d),3):e.H(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.J(_.Zd,{item:d}));_.z(e)})};
|
|
5
|
+
_.t.append=function(a){this.a.push(a);gu(this)};_.t.ri=function(a,b){if(0<=b&&b<=this.a.length){var c=this.se();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));gu(this)}};_.t.remove=function(a){if(0<this.a.length&&hu(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);gu(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;gu(this)};_.C("clpp.Playlist",fu);fu.prototype.clear=fu.prototype.clear;fu.prototype.remove=fu.prototype.remove;
|
|
6
|
+
fu.prototype.insert=fu.prototype.ri;fu.prototype.append=fu.prototype.append;fu.prototype.goTo=fu.prototype.Hd;fu.prototype.previous=fu.prototype.zj;fu.prototype.next=fu.prototype.next;fu.prototype.onEnded=fu.prototype.bg;fu.prototype.stop=fu.prototype.stop;fu.prototype.start=fu.prototype.start;fu.prototype.isStarted=fu.prototype.wi;fu.prototype.getUpcoming=fu.prototype.mi;fu.prototype.getCurrent=fu.prototype.se;fu.prototype.getQueue=fu.prototype.li;fu.prototype.getPosition=fu.prototype.getPosition;
|
|
7
|
+
fu.prototype.off=fu.prototype.off;fu.prototype.one=fu.prototype.one;fu.prototype.on=fu.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.
|
|
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.
|
|
18
|
-
_.U(m.
|
|
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].
|
|
23
|
-
audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},
|
|
24
|
-
f.a)return c=_.
|
|
25
|
-
_.tb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(
|
|
26
|
-
new _.L(_.M,4,4036,a.
|
|
27
|
-
new _.L(_.M,4,4034,a.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"c"),
|
|
31
|
-
0;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e.
|
|
36
|
-
|
|
37
|
-
width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:
|
|
38
|
-
0,null,0,null,!0,g));e+=m});if(c.type===_.
|
|
39
|
-
0,null,null,!0)},
|
|
40
|
-
a.
|
|
2
|
+
var f=function(window){var vG="Full MP4 box must have flags defined",wG="clpp.smooth.SmoothMP4Processor",xG="codecPrivateData",yG=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)},zG=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.vk()}},AG=function(a,b){zG(a,b>>16&255);zG(a,b>>8&255);zG(a,b&255)},BG=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.vk()}},CG=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.vk()}},DG=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.g),a.a+=2}catch(c){_.vk()}},EG=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},FG=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},GG=function(a,b,c,d,e){Y.call(this,
|
|
4
|
+
a,b,c);this.g=d;this.offset=e},HG=function(a,b,c){X.call(this,"ftyp");this.h=a;this.Vf=b;this.g=c},IG=function(){X.call(this,_.Dd)},JG=function(){X.call(this,_.Fe)},KG=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]},LG=function(){X.call(this,"mvex")},MG=function(a){Y.call(this,"trex",0,0);this.g=a},NG=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]},OG=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},PG=function(a){Y.call(this,"hdlr",0,0);this.g=a},QG=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},RG=function(a){X.call(this,a);this.w=!0},SG=function(a){RG.call(this,a);this.height=this.width=0;this.depth=24},TG=function(a,b,c,d){RG.call(this,
|
|
6
|
+
a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},UG=function(a,b){SG.call(this,"avc1");this.width=a;this.height=b},VG=function(a,b){UG.call(this,a,b);this.type="encv"},WG=function(a,b,c){TG.call(this,"mp4a",a,b,c)},XG=function(a,b,c){WG.call(this,a,b,c);this.type="enca"},YG=function(a,b){X.call(this,"avcC");this.La=a;this.Qb=b;this.version=1;this.g=this.La[0][1];this.h=this.La[0][2];this.level=this.La[0][3]},ZG=function(a){Y.call(this,"esds",0,0);this.Ib=a},$G=function(a){a=void 0===a?
|
|
7
|
+
"":a;Y.call(this,"url ",0,1);this.location=a},aH=function(){Y.call(this,"dref",0,0)},bH=function(){X.call(this,_.te)},cH=function(){Y.call(this,_.ve,0,0)},dH=function(){Y.call(this,"stts",0,0)},eH=function(){Y.call(this,"stsc",0,0)},fH=function(){Y.call(this,"stco",0,0)},gH=function(){Y.call(this,"stsz",0,0)},hH=function(){Y.call(this,"smhd",0,0)},iH=function(){X.call(this,"dinf")},jH=function(){X.call(this,_.Cd)},kH=function(){X.call(this,_.yd)},lH=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
|
|
8
|
+
mH=function(){Y.call(this,"mfhd",0,0);this.g=0},nH=function(a,b){Y.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},oH=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},pH=function(){X.call(this,"traf")},qH=function(){X.call(this,"moof")},rH=function(){X.call(this,_.xd);this.g=new Uint8Array(0)},sH=function(){Y.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},tH=function(a,b){Y.call(this,"schm",0,0);this.g=
|
|
9
|
+
a;this.h=b;this.Db=""},uH=function(a){X.call(this,"frma");this.g=a},vH=function(){Y.call(this,"saio",0,0);this.offset=[0]},wH=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},xH=function(a,b){Y.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},yH=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},zH=function(a,b,c,d){c=b.Jf[c];b=b.Uj;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 _.Bv([a],[b])[0]},AH=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Qe?c=["maxWidth","maxHeight","bitrate",xG,"fourCC"]:a.type===_.ic&&(c=["bitrate",xG,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.va(a,b,c,["id","segmentIndex"])},BH=function(a,b,c){var d=c.xd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,La:null,Qb:null,width:NaN,height:NaN,Ib:null,ld:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Qe:a.La=[_.ek(d[1])];a.Qb=[_.ek(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.ic:a.Ib=_.ek(c.xd),a.sampleSize=c.Ig||16,a.ld=c.ld,a.channelCount=c.rf}return a},CH=function(a,b){return a.filter(function(c){return c.type===b})},DH=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)},KH=function(a,b,c){var d=null;if(EH.test(a)){a=EH.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 FH.test(a)?d=DH(FH,a):GH.test(a)?d=DH(GH,a):HH.test(a)?(a=HH.exec(a),d=Number(a[1])/c.frameRate):IH.test(a)?(a=IH.exec(a),d=Number(a[1])/c.a):JH.test(a)&&(d=DH(JH,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},LH=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))},NH=function(a){this.a=a;this.f=MH(this)},MH=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.uk(b)},OH=function(a,b,c){a:{var d=_.u([_.Qc,_.Pc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Ed(e.value))&&e.keyId){d=e.keyId;break a}_.G(wG,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new X("xxxx");a.type===_.Qe?c=new VG(a.width,a.height):c=new XG(a.channelCount,a.sampleSize,a.ld);a=new sH;a.g=1;a.h=8;a.m=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.ne)).append([new uH(b),new tH(_.zc,65536),a]);c.append([b]);return c},PH=function(a,b){var c=b.Md(),d=new KG(a.timescale,a.duration,a.id),e=(new LG).append([new MG(a.id)]),f=new NG(a.id,a.duration,a.timescale,a.width,a.height),g=new OG(a.timescale,a.duration),h=new PG(a.type),l=null,m=new aH;
|
|
15
|
+
m.entries=[new $G];var n=new cH;switch(a.type){case _.Qe:var p=new YG(a.La,a.Qb);c?(l=OH(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new UG(a.width,a.height)).append([p]),n.entries=[l]);l=new QG;break;case _.ic:p=new ZG(a.Ib),c?(l=OH(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new WG(a.channelCount,a.sampleSize,a.ld)).append([p]),n.entries=[l]),l=new hH}n=(new bH).append([n,new dH,new eH,new gH,new fH]);m=(new iH).append([m]);m=(new jH).append([l,m,n]);g=(new kH).append([g,h,m]);f=(new JG).append([f,
|
|
16
|
+
g]);d=(new IG).append([d,f,e]);e=new HG("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Ed(_.Pc),f=b.Ed(_.Qc),c&&d.append([new FG("pssh",c.initData,8)]),f&&d.append([new FG("pssh",f.initData,8)]),c||f||_.G(wG,"Could not get PSSH init data!"));c=new NH([e,d]);return _.N(c.write())},RH=function(a,b){var c,d,e,f,g,h;(new _.Gk).M("moof",_.Hk).W("mfhd",function(m){var n=new mH;n.g=_.U(m.G);c=n}).M("traf",_.Hk).W("tfhd",function(m){var n=m.G.ya();if(null===m.flags)throw new _.L(_.M,3,3019,vG);var p=new oH(m.version||
|
|
17
|
+
0,m.flags||0);p.g=_.U(m.G);0<n-m.G.getPosition()&&m.flags&1&&(p.h=_.Ek(m.G));0<n-m.G.getPosition()&&m.flags&2&&(p.A=_.U(m.G));0<n-m.G.getPosition()&&m.flags&8&&(p.j=_.U(m.G));0<n-m.G.getPosition()&&m.flags&16&&(p.o=_.U(m.G));0<n-m.G.getPosition()&&m.flags&32&&(p.m=_.U(m.G));d=p}).W("trun",function(m){var n=m.G.ya();if(null===m.flags)throw new _.L(_.M,3,3019,vG);var p=new nH(m.version||0,m.flags||0);p.g=_.U(m.G);0<n-m.G.getPosition()&&m.flags&1&&(p.j=_.Ck(m.G));0<n-m.G.getPosition()&&m.flags&4&&(p.m=
|
|
18
|
+
_.U(m.G));if(0<n-m.G.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.U(m.G)),m.flags&512&&p.sampleSize.push(_.U(m.G)),m.flags&1024&&p.A.push(_.U(m.G)),m.flags&2048&&(0===m.version?p.h.push(_.U(m.G)):p.h.push(_.Ck(m.G)));e=p}).W("sdtp",function(m){var n=_.Fk(m.G,m.G.ya());f=new GG("sdtp",m.version||0,m.flags||0,n,0)}).M("uuid",function(m){var n=_.Fk(m.G,16);if(_.gk(n,QH)){n=_.U(m.G);m.version=n>>>24;m.flags=n&16777215;n=new xH(m.version,m.flags);n.h=_.U(m.G);m.flags&1&&(n.j=_.Ak(m.G));for(var p=
|
|
19
|
+
0;p<n.h;p++){var q={Nf:_.Fk(m.G,8),Nc:0,af:[]};if(m.flags&2){q.Nc=_.Bk(m.G);for(var r=0;r<q.Nc;r++){var w={pf:0,qf:0};w.pf=_.Bk(m.G);w.qf=_.U(m.G);q.af.push(w)}}n.g.push(q)}g=n}}).M(_.xd,function(m){var n=new rH;0<m.G.ya()?n.g=_.Fk(m.G,m.G.ya()):(_.G(wG,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,!1);if(!h)return null;var l=(new pH).append([d,e]);f&&l.append([f]);b.Md()&&g&&l.append([g]);l=(new qH).append([c,l]);return new NH([l,h])},SH=function(a,b,c){var d=c.Md(),e=a.request.startTime,
|
|
20
|
+
f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=RH(b,c);if(null===g)return a.request.contentType===_.Be?a.data:g;c=g.get(_.xd);if(a.request.contentType===_.Be){d=c.g.buffer;if(e){d=_.sh(d);if((d=(new DOMParser).parseFromString(d,_.De))&&"tt"===d.documentElement.tagName.toLowerCase())var h=d.documentElement;if(h&&(c=new LH(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",_.ed];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 y=p[r].name;if(y=y.match(q)){n=n.getAttribute(y[0]);break b}}n=null}}f.setAttribute(g[l],KH(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.th(d).buffer}else e=d;return e}h=new qH;a=g.get("mfhd");b=new pH;l=g.get("tfhd");m=new lH(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].Nc);else g=8;b.append([e,new vH,new wH(g,l,e.h)])}h.append([a,b]);f.flags|=1;f.j=h.a()+8;c=new NH([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},TH=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,
|
|
23
|
+
audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},UH=function(a,b,c){a=_.Gl(a);c&&a.version!==c&&(a=_.uv(a,c));return{initData:_.rv(a),initDataType:_.zc,keyId:b,periodId:null}},WH=function(){this.w=this.h=this.g=this.C=null;this.L=1;this.R=0;this.m="";this.A=this.a=null;this.f=new _.H("clpp.smooth.SmoothParser");this.J=!1;this.j=this.B=null;this.N=VH;this.F=0;this.D=this.I=Infinity;this.o=[];this.K=this.Fj.bind(this)},XH=function(a,b){var c,d,e;return _.B(function(f){if(1==
|
|
24
|
+
f.a)return c=_.Ih(b),c.timeout=a.g.attemptParameters.timeout,c.maxAttempts=Math.max(a.g.attemptParameters.maxAttempts,b.length),c.baseDelay=a.g.attemptParameters.baseDelay,c.backoffFactor=a.g.attemptParameters.backoffFactor,c.fuzzFactor=a.g.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),_.x(f,d.P,2);e=f.f;a.m=e.uri;return f["return"](e)})},dI=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.sh(b);var f=d.parseFromString(e.trim(),_.De)}catch($B){throw $B;}if(f&&f.documentElement.tagName==
|
|
25
|
+
_.tb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch($B){}if(!c)throw a.f.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+YH(a,c,"MajorVersion"),l=+YH(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+YH(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,w=_.sl(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.m);p?(ZH(a,$H),a.B=typeof a.g.liveRefreshPeriod===_.k?1E3*a.g.liveRefreshPeriod:Math.min(1E3*a.F,1E4),n=Infinity):ZH(a,VH);a.a={startTime:0,delay:0,duration:n/m,oe:r/m,fd:0};if(w){var y=a.g.playreadyVersion,A=[],E=_.sl(w,"ProtectionHeader")[0],F=_.dk(_.ul(E)||""),D=_.Gl(F).a;A.push(TH(_.Qc,{initData:_.rv(_.zl(D)),initDataType:_.zc,keyId:D,periodId:null},[D]));A.push(TH(_.Pc,UH(F,D,y),[D]));a.o=A}var I=[],O=_.sl(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
|
|
27
|
+
new _.L(_.M,4,4034,a.m);for(var T=0;T<O.length;T++){for(var Fa,fa=a,ka=O[T],wa=YH(fa,ka,"Type"),Aa=+ka.getAttribute("Chunks"),la=ka.getAttribute("Subtype"),qa=_.Gi(ka.getAttribute("Language")||_.He),Ga=ka.getAttribute("Name")||"",Ma=+ka.getAttribute(_.Va),ab=+ka.getAttribute(_.Ua),Eb=YH(fa,ka,"Url"),me=+ka.getAttribute("TimeScale")||null,eh=[],Li=_.sl(ka,_.hb),fh=0;fh<Li.length;fh++){var $c=fa,rb=Li[fh],Vf=wa,KL=+rb.getAttribute("Index"),LL=+YH($c,rb,"Bitrate"),cC=NaN,dC=NaN,zm=NaN,$r=NaN,eC=NaN,
|
|
28
|
+
fC=NaN,gC=NaN,hC=rb.getAttribute("FourCC");switch(Vf){case _.Qe:cC=+YH($c,rb,_.Ua);dC=+YH($c,rb,_.Va);break;case _.ic:$r=+rb.getAttribute("Channels")||2,zm=+YH($c,rb,"SamplingRate"),fC=+YH($c,rb,"AudioTag"),eC=+YH($c,rb,"BitsPerSample"),gC=+YH($c,rb,"PacketSize")}var as=String(rb.getAttribute("CodecPrivateData"));if(Vf===_.ic&&!as){var iC=$r,jC={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},Am=jC[zm];if("AACH"===hC){var mc=new Uint8Array(4);var kC=
|
|
29
|
+
jC[2*zm];mc[0]=40|Am>>1;mc[1]=Am<<7|iC<<3|kC>>1;mc[2]=kC<<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 lC=Yf[0].toString(16)+Yf[1].toString(16)}else mc=new Uint8Array(2),mc[0]=16|Am>>1,mc[1]=Am<<7|iC<<3,Yf=new Uint16Array(1),Yf[0]=(mc[0]<<8)+mc[1],lC=Yf[0].toString(16);as=lC.toUpperCase()}var ML={id:$c.R++,type:Vf,index:KL,bitrate:LL,xd:as,maxHeight:cC,maxWidth:dC,ld:zm,rf:$r,jk:fC,Ig:eC,uk:gC,di:hC,segmentIndex:null};eh.push(ML)}Fa=eh;for(var qe=[],mC=_.sl(ka,
|
|
30
|
+
"c"),cj=0;cj<mC.length;cj++){var bs=mC[cj],Gd=parseInt(bs.getAttribute("t"),10),ih=parseInt(bs.getAttribute("d"),10),cs=parseInt(bs.getAttribute("r"),10),dj=0;if(isNaN(Gd)&&isNaN(ih))throw fa.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.L(_.M,4,4037,fa.m);0===cj&&isNaN(Gd)&&(dj=Gd=0);if(0<cj){var Zf=qe[qe.length-1];dj=Zf.n+1;Zf.d||(Zf.d=Gd-Zf.t);Gd||(Gd=Zf.t+Zf.d);ih||(ih=Gd-Zf.t)}qe.push({n:dj,d:ih,t:Gd});if(cs){cs--;for(var nC=
|
|
31
|
+
0;nC<cs;nC++){var Bm=qe[qe.length-1];dj=Bm.n+1;Gd=Bm.t+Bm.d;ih=Bm.d;qe.push({n:dj,d:ih,t:Gd})}}}fa.Xc()||qe.length===Aa||fa.f.warn("Number of fragments ("+Aa+") differs from number of chunks ("+qe.length+").");I.push({type:wa,lk:Aa,Nj:la,language:qa,name:Ga,maxWidth:Ma,maxHeight:ab,Uj:Eb,tracks:Fa,Jf:qe,timescale:me})}var jf={sk:h,Vf:l,timescale:m,duration:n,isLive:p,rk:q,oe:r,we:!1,streams:I};if(a.h&&a.w)return aI(a,jf),Promise.resolve();var ds=jf.timescale,es=jf.duration,OL=CH(jf.streams,_.ic),
|
|
32
|
+
PL=CH(jf.streams,_.Qe),QL=CH(jf.streams,_.Be),oC=[],Cm=bI(a,es,ds,OL),Dm=bI(a,es,ds,PL),RL=bI(a,es,ds,QL);Cm.length||(Cm=[null]);Dm.length||(Dm=[null]);for(var gs=0;gs<Dm.length;gs++)for(var hs=0;hs<Cm.length;hs++)oC.push(cI(a,Dm[gs],Cm[hs]));var pC={startTime:0,variants:oC,textStreams:RL,thumbStreams:[]};var TL=jf.streams,is=a.a.startTime,qC=a.a.delay,js=a.I,rC=Math.min(a.a.duration||Infinity,js),ks=a.Xc(),UL=a.a.oe,VL=a.a.fd,sC=a.F,tC=isFinite(a.D)?a.D:0;if(ks)rC=Infinity,is=Date.now()/1E3-VL,a.a.startTime=
|
|
33
|
+
is,qC=3*sC;else for(var WL=isFinite(js)?js:a.a.duration,uC=_.u(TL),ls=uC.next();!ls.done;ls=uC.next())for(var vC=_.u(ls.value.tracks),ms=vC.next();!ms.done;ms=vC.next()){var wC=ms.value;wC.segmentIndex.offset(-tC);_.pw(wC.segmentIndex,WL)}a.A=new _.Zv(is,qC,!ks,!0);a.A.Tb(rC);_.cw(a.A,sC);a.A.ic=UL;ks||a.A.offset(-tC);a.C.filterAllPeriods([pC]);a.h={presentationTimeline:a.A,periods:[pC],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.de(a.K),a.J=!0);a.w=jf;return Promise.resolve()},
|
|
34
|
+
aI=function(a,b){for(var c=0;c<a.w.streams.length;c++)for(var d=b.streams[c],e={},f=_.u(a.w.streams[c].tracks),g=f.next();!g.done;e={Hb:e.Hb},g=f.next())if(e.Hb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Hb.type&&m.bitrate===l.Hb.bitrate}}(e))){AH(e.Hb,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var h=eI(a,a.w.timescale,d,g);g=e.Hb.segmentIndex;g.Wa(h);(h=a.a.oe)&&_.nw(g,_.mw(g)-h)}else a.f.warn("Cannot find satisfying update for "+
|
|
35
|
+
e.Hb.type+" track with bitrate "+(e.Hb.bitrate+". Skipping update."))},bI=function(a,b,c,d){for(var e=[],f={sc:0};f.sc<d.length;f={sc:f.sc},f.sc++){var g=d[f.sc].tracks.map(function(h){return function(l){var m=d[h.sc],n=eI(a,c,m,l),p=new _.lw(n),q=null;m.type!==_.Be&&(q=fI(a,b,c,m,l));l.segmentIndex=p;n=a.L++;var r=Promise.resolve.bind(Promise),w=p.Bc.bind(p),y=p.get.bind(p),A=p.Qc.bind(p);p=p.getDuration.bind(p);var E=gI[m.type],F="";switch(m.type){case _.Qe:F=l.xd;var D=/00000001[0-9]7/.exec(F);
|
|
36
|
+
F="avc1."+(D&&D[0]?F.substr(F.indexOf(D[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",F);break;case _.ic:F=l.xd,D=2,"AACH"===l.di?D=5:F&&(D=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+D,a.f.debug("AUDIO CODECS: ",F)}D=m.type===_.Be?hI[m.Nj]:void 0;return{id:n,originalId:null,wk:null,createSegmentIndex:r,findSegmentPosition:w,getSegmentReference:y,adjustSegmentDurations:A,getDuration:p,segmentIndex:null,segmentLookupStrategy:_.ev,initSegmentReference:q,mimeType:E,codecs:F,frameRate:void 0,bandwidth:l.bitrate,
|
|
37
|
+
width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:D,encrypted:a.ye(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.rf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},eI=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.Jf.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=zH(a.m,c,l,d);a.F=Math.max(a.F,m);f.push(new _.Yv(l,n,p,function(){return[q]},
|
|
38
|
+
0,null,0,null,!0,g));e+=m});if(c.type===_.Qe||c.type===_.ic)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.fd?a.a.fd=b.endTime:a.a.fd=Math.min(a.a.fd,b.endTime);return f},fI=function(a,b,c,d,e){b=BH(b,d.timescale||c,e);c={isLive:a.Xc.bind(a),Md:a.ye.bind(a),ii:function(){return 1},Ed:a.Lf.bind(a)};d=new Uint8Array(0);try{d=PH(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,"+_.ck(d);return new _.Xv(function(){return[f]},
|
|
39
|
+
0,null,null,!0)},cI=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.He;return c||b?{id:a.L++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},YH=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.m,c);},iI=function(a,b){null!=a.B&&null!=b&&(a.j=window.setTimeout(a.Bb.bind(a),b))},ZH=function(a,b){var c=b===VH;if(a.h&&a.h.presentationTimeline){var d=
|
|
40
|
+
a.h.presentationTimeline;d.j=c;d.m=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.B=null);a.N=b},jI=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?_.S(a,1):_.S(a,this.size);_.
|
|
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);_.wk(a,EG(this.type));this.size>b&&yG(a,this.size);"uuid"===this.type&&_.wk(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);zG(a,this.version);AG(a,this.flags)};
|
|
43
|
+
_.v(FG,X);FG.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};FG.prototype.write=function(a){X.prototype.write.call(this,a);_.wk(a,this.g,this.offset);a.getPosition()};_.v(GG,Y);GG.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};GG.prototype.write=function(a){Y.prototype.write.call(this,a);_.wk(a,this.g,this.offset);a.getPosition()};_.v(HG,X);
|
|
44
|
+
HG.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};HG.prototype.write=function(a){X.prototype.write.call(this,a);_.wk(a,EG(this.h));_.S(a,this.Vf);_.wk(a,EG(this.g.join("")));a.getPosition()};_.v(IG,X);_.v(JG,X);_.v(KG,Y);KG.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
|
+
KG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(yG(a,0),yG(a,0),_.S(a,this.timescale),yG(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));_.S(a,65536);BG(a,this.volume);BG(a,0);_.S(a,0);_.S(a,0);for(var b=0;b<this.g.length;b++)zG(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(LG,X);_.v(MG,Y);MG.prototype.a=function(){return 20+Y.prototype.a.call(this)};
|
|
46
|
+
MG.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(NG,Y);NG.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
|
+
NG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(yG(a,0),yG(a,0),_.S(a,this.h),_.S(a,0),yG(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);BG(a,0);BG(a,0);BG(a,this.volume);BG(a,0);for(var b=0;b<this.g.length;b++)zG(a,this.g[b]);BG(a,this.width);BG(a,0);BG(a,this.height);BG(a,0);a.getPosition()};_.v(OG,Y);OG.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
|
|
48
|
+
OG.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(yG(a,0),yG(a,0),_.S(a,this.timescale),yG(a,this.duration*this.timescale)):(_.S(a,0),_.S(a,0),_.S(a,this.timescale),_.S(a,this.duration*this.timescale));BG(a,this.language);BG(a,0);a.getPosition()};_.v(PG,Y);PG.prototype.a=function(){return 33+Y.prototype.a.call(this)};
|
|
49
|
+
PG.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);this.g===_.Qe?_.wk(a,EG("vide")):_.wk(a,EG("soun"));_.S(a,0);_.S(a,0);_.S(a,0);this.g===_.Qe?_.wk(a,EG("VideoHandler\x00")):_.wk(a,EG("SoundHandler\x00"));a.getPosition()};_.v(QG,Y);QG.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};QG.prototype.write=function(a){Y.prototype.write.call(this,a);BG(a,0);_.wk(a,this.g);a.getPosition()};_.v(RG,X);RG.prototype.a=function(){return 8+X.prototype.a.call(this)};
|
|
50
|
+
RG.prototype.write=function(a){X.prototype.write.call(this,a);_.S(a,0);BG(a,0);BG(a,1)};_.v(SG,RG);SG.prototype.a=function(){return 70+RG.prototype.a.call(this)};SG.prototype.write=function(a){RG.prototype.write.call(this,a);BG(a,0);BG(a,0);_.S(a,0);_.S(a,0);_.S(a,0);BG(a,this.width);BG(a,this.height);_.S(a,4718592);_.S(a,4718592);_.S(a,0);BG(a,1);zG(a,10);_.wk(a,EG("AVC Coding",31));BG(a,this.depth);DG(a,-1)};_.v(TG,RG);TG.prototype.a=function(){return 20+RG.prototype.a.call(this)};
|
|
51
|
+
TG.prototype.write=function(a){RG.prototype.write.call(this,a);_.S(a,0);_.S(a,0);BG(a,this.channelCount);BG(a,this.sampleSize);DG(a,0);BG(a,0);BG(a,this.sampleRate);BG(a,0)};_.v(UG,SG);UG.prototype.write=function(a){SG.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(VG,UG);_.v(WG,TG);WG.prototype.write=function(a){TG.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.v(XG,WG);_.v(YG,X);
|
|
52
|
+
YG.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.Qb[b].byteLength;return a+X.prototype.a.call(this)};
|
|
53
|
+
YG.prototype.write=function(a){X.prototype.write.call(this,a);zG(a,this.version);zG(a,this.g);zG(a,this.h);zG(a,this.level);zG(a,255);zG(a,224|this.La.length);for(var b=0;b<this.La.length;b++)BG(a,this.La[b].length),_.wk(a,this.La[b]);zG(a,this.Qb.length);for(b=0;b<this.Qb.length;b++)BG(a,this.Qb[b].length),_.wk(a,this.Qb[b]);a.getPosition()};_.v(ZG,Y);ZG.prototype.a=function(){return 22+(this.Ib.byteLength+3)+Y.prototype.a.call(this)};
|
|
54
|
+
ZG.prototype.write=function(a){Y.prototype.write.call(this,a);zG(a,3);zG(a,23+this.Ib.byteLength);BG(a,1);zG(a,0);zG(a,4);zG(a,15+this.Ib.byteLength);zG(a,64);zG(a,21);AG(a,0);_.S(a,0);_.S(a,0);zG(a,5);zG(a,this.Ib.byteLength);_.wk(a,this.Ib);_.wk(a,new Uint8Array([6,1,2]));a.getPosition()};_.v($G,Y);$G.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};$G.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.wk(a,EG(this.location));a.getPosition()};
|
|
55
|
+
_.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)};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,X);_.v(cH,Y);cH.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
|
+
cH.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(dH,Y);dH.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)};dH.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(eH,Y);
|
|
57
|
+
eH.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)};eH.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(fH,Y);fH.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
|
+
fH.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(gH,Y);gH.prototype.a=function(){return 8+Y.prototype.a.call(this)};gH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,0);_.S(a,0);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);DG(a,0);BG(a,0);a.getPosition()};
|
|
59
|
+
_.v(iH,X);_.v(jH,X);_.v(kH,X);_.v(lH,Y);lH.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};lH.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?yG(a,this.g):_.S(a,this.g);a.getPosition()};_.v(mH,Y);mH.prototype.a=function(){return 4+Y.prototype.a.call(this)};mH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);a.getPosition()};_.v(nH,Y);
|
|
60
|
+
nH.prototype.a=function(){var a=4;this.flags&kI&&(a+=4);this.flags&lI&&(a+=4);for(var b=0;b<this.g;b++)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)};
|
|
61
|
+
nH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&kI&&(a.getPosition(),CG(a,this.j));this.flags&lI&&_.S(a,this.m);for(var b=0;b<this.g;b++)this.flags&mI&&_.S(a,this.o[b]),this.flags&nI&&_.S(a,this.sampleSize[b]),this.flags&oI&&_.S(a,this.A[b]),this.flags&pI&&(0===this.version?_.S(a,this.h[b]):CG(a,this.h[b]));a.getPosition()};var kI=1,lI=4,mI=256,nI=512,oI=1024,pI=2048;_.v(oH,Y);
|
|
62
|
+
oH.prototype.a=function(){var a=4;this.flags&qI&&(a+=8);this.flags&rI&&(a+=4);this.flags&sI&&(a+=4);this.flags&tI&&(a+=4);this.flags&uI&&(a+=4);return a+Y.prototype.a.call(this)};oH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.g);this.flags&qI&&yG(a,this.h);this.flags&rI&&_.S(a,this.A);this.flags&sI&&_.S(a,this.j);this.flags&tI&&_.S(a,this.o);this.flags&uI&&_.S(a,this.m);a.getPosition()};var qI=1,rI=2,sI=8,tI=16,uI=32;_.v(pH,X);_.v(qH,X);_.v(rH,X);
|
|
63
|
+
rH.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};rH.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.wk(a,this.g)};_.v(sH,Y);sH.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
|
+
sH.prototype.write=function(a){Y.prototype.write.call(this,a);zG(a,0);0===this.version?zG(a,0):zG(a,0);zG(a,this.g);zG(a,this.h);_.wk(a,_.ek(this.m));if(1===this.g&&0===this.h){zG(a,0);for(var b=0;b<this.j.length;b++)zG(a,this.j[b])}a.getPosition()};_.v(tH,Y);tH.prototype.a=function(){var a=8;this.flags&1&&(a+=EG(this.Db).byteLength);return a+Y.prototype.a.call(this)};tH.prototype.write=function(a){Y.prototype.write.call(this,a);_.wk(a,EG(this.g));_.S(a,this.h);this.flags&1&&_.wk(a,EG(this.Db));a.getPosition()};
|
|
65
|
+
_.v(uH,X);uH.prototype.a=function(){return EG(this.g).byteLength+X.prototype.a.call(this)};uH.prototype.write=function(a){X.prototype.write.call(this,a);_.wk(a,EG(this.g));a.getPosition()};_.v(vH,Y);vH.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
|
+
vH.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]):yG(a,this.offset[b]);a.getPosition()};_.v(wH,Y);wH.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
|
+
wH.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.S(a,0),_.S(a,0));zG(a,this.g);_.S(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)zG(a,this.j[b]);a.getPosition()};_.v(xH,Y);xH.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Nf.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Nc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
|
|
68
|
+
xH.prototype.write=function(a){Y.prototype.write.call(this,a);_.S(a,this.h);this.flags&1&&zG(a,this.j);for(var b=0;b<this.h;b++)if(_.wk(a,this.g[b].Nf),this.flags&2){BG(a,this.g[b].Nc);for(var c=0;c<this.g[b].Nc;c++)BG(a,this.g[b].af[c].pf),_.S(a,this.g[b].af[c].qf)}a.getPosition()};var EH=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,FH=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,GH=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,HH=/^(\d*\.?\d*)f$/,IH=/^(\d*\.?\d*)t$/,JH=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;NH.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};NH.prototype.write=function(){this.f=MH(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var QH=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=WH.prototype;_.t.configure=function(a){this.g=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.lf(new Set([a,yH(a)])).concat();return XH(this,d).then(function(e){return dI(c,e.data).then(function(){iI(c,c.B);return c.h})})};_.t.stop=function(){this.C&&this.C.networkingEngine.Ue(this.K);this.B=this.w=this.h=this.g=this.C=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
|
|
69
|
+
_.t.update=function(){var a=this;if(this.Xc())return XH(this,[this.m]).then(function(b){return dI(a,b.data).then(function(){return a.h})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Bb=function(){var a=this;this.f.debug(_.Yu);this.C&&(this.j=null,this.update().then(function(){iI(a,a.B)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&iI(a,100))}))};_.t.Xc=function(){return this.N===$H};
|
|
70
|
+
_.t.ye=function(){return 0<this.o.length};_.t.Lf=function(a){var b=null;if(this.o.length)for(var c=0;c<this.o.length;c++)if(this.o[c].keySystem===a){b=this.o[c].initData[0];break}return b};
|
|
71
|
+
_.t.Fj=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.w.timescale,c={isLive:this.Xc.bind(this),Md:this.ye.bind(this),ii:function(){return 1},Ed:this.Lf.bind(this)},d=!1,e=new _.L(_.M,3,4035,null),f=null;try{f=SH(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 gI={video:_.Se,audio:_.nc,text:_.fc},VH="VOD",$H="LIVE",hI={Wj:"caption",ck:_.xe};_.v(jI,_.Bo);jI.prototype.Ja=function(){_.yp.ism=WH;_.wp[_.gc]=WH};jI.prototype.Ca=function(){_.uw("ism");_.vw(_.gc)};jI.prototype.id=function(){return"smooth"};_.C("clpp.smooth.SmoothComponent",jI);};
|
|
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));}
|