@castlabs/prestoplay 6.9.0 → 6.11.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 +66 -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 +112 -111
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +467 -432
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +143 -45
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +78 -73
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mse.js +276 -275
- package/cjs/cl.muxdata.js +14 -15
- 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 +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- package/cjs/cl.ttml.js +29 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- 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 +396 -365
- package/cl.crypto.js +9 -9
- package/cl.dash.js +68 -67
- package/cl.externs.js +139 -45
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +64 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +240 -242
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +11 -11
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +59 -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 +15 -15
- package/clpp.styles.css +15 -0
- package/package.json +1 -1
- package/typings.d.ts +249 -21
package/cjs/cl.muxdata.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
data:
|
|
4
|
-
f.video_source_url=_.
|
|
5
|
-
d.language);return f}});a.h.debug("Mux SDK options",b);return b},
|
|
6
|
-
a.
|
|
7
|
-
_.
|
|
8
|
-
b={request_start:c,request_type:
|
|
9
|
-
b);
|
|
10
|
-
_.
|
|
11
|
-
_.
|
|
12
|
-
_.
|
|
13
|
-
_.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_.Jd&&(c.envKey||e.push("envKey"));if(0<e.length)throw new _.L(1,9,9300,{missingKeys:e});this.f.initialize(c,b,d)}catch(f){this.a=!1,this.U(a,f)}}};_.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(_.hd,{detail:b}))};_.C("clpp.muxdata.MuxDataPlugin",Ou);Ou.Id="mux";Pu.prototype.create=function(){return new Ou};_.qo(new Pu);};
|
|
2
|
+
var f=function(window){var bw=function(a){switch(a.type){case 1:return Zv;case 2:return $v;case 3:return aw}},dw=function(a){var b=Object.keys(a).find(function(c){return cw.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},ew=function(a,b){this.m=a;this.o=this.f=null;this.D=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.Eg;this.h=b;this.w=this.l=this.g=!1;this.A=null;this.j=a.getNetworkEngine();this.B=this.Gi.bind(this);this.F=this.sl.bind(this)},gw=function(a){var b={debug:!0,
|
|
3
|
+
data:fw(a)};a.f&&a.f.muxOptionsOverride&&_.M.Mc(a.f.muxOptionsOverride)&&(b=_.M.va(b,a.f.muxOptionsOverride));b=_.M.va(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.h.debug("getStateData()");var c=a.m.getLoadedSource(),d=a.m.getTrackManager(),e=a.m.getSurface(),f={player_is_paused:a.m.isPaused(),player_is_fullscreen:e.isFullscreen(),video_source_duration:1E3*a.m.getDuration(),player_autoplay_on:!!a.m.getConfiguration().autoplay};if(c){var g=new _.cj(c.url);
|
|
4
|
+
f.video_source_url=_.dj(g);f.video_source_mime_type=c.type;c.name&&(f.video_title=c.name)}if(c=e.getContainer())f.player_width=c.offsetWidth,f.player_height=c.offsetHeight;(c=a.m.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.m.getTrackManager().ga(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.h.debug("Video dimensions: "+c+"x"+e);c&&e&&(f.video_source_height=c,f.video_source_width=e);(d=d.qa())&&d.language&&(f.player_language_code=
|
|
5
|
+
d.language);return f}});a.h.debug("Mux SDK options",b);return b},fw=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.sa,player_software_name:_.sa,player_software_version:_.fa,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.fa};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},hw=function(a,b,c){a.h.debug("Event: "+b);a.A.emit(a.D,b,c)},iw=function(a){a.a.on(a.m,_.cf,function(){var b={player_playhead_time:1E3*
|
|
6
|
+
a.m.getPosition()};hw(a,_.cf,b)});a.a.on(a.m,_.oe,function(){return hw(a,_.oe)});a.a.on(a.m,_.yc,a.Di.bind(a));a.a.on(a.m,_.Re,a.Fi.bind(a));a.a.on(a.m,_.mf,function(){return hw(a,_.Me)});a.a.on(a.m,_.lf,function(){return hw(a,_.Le)});a.a.on(a.m,_.yd,a.Ei.bind(a));a.a.on(a.m,_.Mb,function(){return hw(a,"adbreakstart")});a.a.on(a.m,_.Nb,function(){return hw(a,"adbreakend")});a.a.on(a.m,_.$b,function(){hw(a,"adplay");hw(a,"adplaying")});a.a.on(a.m,_.Vb,function(){return hw(a,"adpause")});a.a.on(a.m,
|
|
7
|
+
_.Yb,function(){hw(a,"adplay");hw(a,"adplaying")});a.a.on(a.m,_.ac,function(){return hw(a,"adended")});a.a.on(a.m,_.Rb,function(){return hw(a,"adfirstquartile")});a.a.on(a.m,_.Ub,function(){return hw(a,"admidpoint")});a.a.on(a.m,_.bc,function(){return hw(a,"adthirdquartile")});a.j.Vc(a.B);a.j.Df(a.F);a.a.on(a.m,_.yd,function(b){var c=b.detail;if(c&&1===c.category&&(b=(b=c.data)&&b.request,void 0!==b&&!0===(1===b.type||2===b.type||3===b.type)))if(7001===c.code){c=b.requestStartTimestamp;var d=new _.cj(b.uris[b.uriIndex]);
|
|
8
|
+
b={request_start:c,request_type:bw(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);hw(a,"requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.cj(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:bw(b),request_hostname:e.a,request_error:""+bw(b)+"LoadError",request_error_code:void 0===f?-1:void 0!==f.response?f.response.status:void 0!==f.status?f.status:-1,request_error_text:c.toString()};a.h.debug("onRequestFailed()","Track event: requestfailed",
|
|
9
|
+
b);hw(a,"requestfailed",b)}})},jw=function(a){_.Hg(a.a);a.j.fe(a.B);a.j.fh(a.F)},kw=function(){this.f=null;this.a=!1;this.h=new _.K("clpp.muxdata")},lw=function(a){return!_.M.R(a)&&typeof a.init===_.Ad&&typeof a.emit===_.Ad},mw=function(){},Zv="manifest",$v="media",aw="encryption",cw=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=ew.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.A=c;if(!this.g){try{this.g=!0,this.A.init(this.D,gw(this))}catch(d){throw this.g=!1,jw(this),new _.N(1,9,9302,null,d);}hw(this,"playerready")}this.l&&!this.w&&(a=fw(this),hw(this,"videochange",a),this.l=!1);iw(this)};_.r.release=function(){this.h.debug("release()");this.l?this.h.debug(_.ja):(jw(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.h.debug(_.ed);this.w?this.h.debug(_.ia):(this.w=!0,hw(this,"destroy"))};
|
|
10
|
+
_.r.Di=function(a){this.h.debug(_.be);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.La())&&a.bandwidth&&(b+=a.bandwidth),hw(this,"renditionchange",{video_source_bitrate:b}))};_.r.Fi=function(a){this.h.debug(_.fe);switch(a.detail.currentState){case _.Vn:this.m.getConfiguration().autoplay&&hw(this,_.oe);break;case _.Xn:hw(this,_.ve);break;case _.Wn:hw(this,_.ke);break;case _.Qn:hw(this,_.xd)}};
|
|
11
|
+
_.r.Ei=function(a){this.h.debug(_.ce);if(this.g&&(a=a.detail||null))if(10003===a.code)hw(this,"aderror");else if(a.severity===_.O){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);hw(this,_.yd,{player_error_code:a.code,player_error_message:b})}};
|
|
12
|
+
_.r.Gi=function(a){var b=a.request;if(b=void 0!==b&&!0===(1===b.type||2===b.type||3===b.type))b=a.status,b=void 0!==b&&200<=b&&299>=b;if(b){b=a.request;var c=a.headers,d=b.bytesLoaded,e=b.requestStartTimestamp,f=b.startTime,g=b.endTime,h=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.cj(b.uris[b.uriIndex]);a={request_start:e,request_type:bw(b),request_hostname:g.a,request_id:dw(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
|
|
13
|
+
request_url:_.dj(g)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);hw(this,"requestcompleted",a)}};_.r.sl=function(a){a.requestStartTimestamp=Date.now()};_.w(kw,_.rr);_.r=kw.prototype;_.r.onPlayerCreated=function(a){this.f=new ew(a,this.h)};
|
|
14
|
+
_.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.M.Sa(c.muxdata);try{var d=[];typeof c===_.ae&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.N(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.M.R(e.muxdata)&&typeof e.muxdata===_.ae){var f=e.muxdata;d=lw(f.muxLib)?f.muxLib:window.mux;if(!lw(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.N(1,9,9301);this.U(a,g)}}else this.h.warn("Mux plugin is loaded but not configured. Will do nothing.");
|
|
15
|
+
var h=d;null!==h&&this.f.initialize(c,b,h)}catch(l){this.a=!1,this.U(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.U=function(a,b){a.trigger(new _.L(_.yd,{detail:b}))};_.I("clpp.muxdata.MuxDataPlugin",kw);kw.Id="mux";mw.prototype.create=function(){return new kw};_.qp(new mw);};
|
|
17
16
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
18
17
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
19
18
|
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
|
-
|
|
2
|
+
var f=function(window){var Xv=function(){this.h=new _.K("clpp.onboard");this.j=new Set},Yv=function(a,b){function c(l){return l&&(_.ei(l,"https://")||_.ei(l,"http://")||_.ei(l,"//"))?l:d+l}var d=b.baseUrl;_.fi(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.hl(a);h.Pa(_.ad,{licenseUrl:e,videoRobustness:[_.sb,void 0],audioRobustness:[_.rb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.Vl,
|
|
3
|
+
licenseResponse:_.$l}});h.Pa(_.Yc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Xl,licenseResponse:_.Yl,extractContentId:_.Tl,certificateRequest:_.Zl}});h.Pa(_.Zc,{licenseUrl:f,modifiers:{licenseRequest:_.Vl}});_.bl(h)};_.w(Xv,_.Mp);Xv.prototype.a=function(){for(var a=_.u(this.j),b=a.next();!b.done;b=a.next())delete _.al[b.value];this.j.clear()};
|
|
4
|
+
Xv.prototype.g=function(a){a=a.getConfiguration().drm;var b;if(b=!(!a||!a.env))b=a&&a.customData,b=!(!b||!b.baseUrl);b&&(b=a.env,a=a.customData,a={baseUrl:a.baseUrl,widevineUrl:a.widevineUrl,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.h.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Yv(b,a),this.j.add(b))};Xv.prototype.id=function(){return"onboard"};_.I("clpp.onboard.OnboardComponent",Xv);_.I("clpp.onboard.register",Yv);};
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_.
|
|
9
|
-
btoa(c));_.y(d)})};_.
|
|
10
|
-
_.
|
|
11
|
-
|
|
12
|
-
return _.x(
|
|
13
|
-
_.
|
|
14
|
-
6);case 6:return _.x(l,_.
|
|
15
|
-
|
|
2
|
+
var f=function(window){var Fv="A persistent DRM session already exists for: ",Gv="No DRM configuration.",Hv="clpp.persistent",Iv="clpp.persistent.SimpleSessionStorage",Jv=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},Kv=function(a){a=a.f.keys();a=Jv(a,function(b){return b.sessionId});return Array.from(a)},Lv=function(a,b){var c,d,e;return _.G(function(f){if(1==f.a)return _.x(f,_.Ym(a,b),2);c=f.f;if(!c)return a.h.debug("Ignoring attempt to remove missing session",b),f["return"]();
|
|
3
|
+
d=[];(e=a.f.get(c))&&a.B&&(e.qb=new _.Fi,d.push(e.qb));a.h.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},Nv=function(a,b){a.J=Mv;a.K=[];a.F=!0;return _.Fm(a,b)},Pv=function(a,b,c,d,e,f){a.J=Ov;var g=new Map,h=_.bn(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.he,persistentState:_.Ie,sessionTypes:[_.me],label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",
|
|
4
|
+
videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Lm(a,g)},Qv=function(){this.h=new _.K(Iv)},Rv=function(a){a=JSON.parse(a);var b=JSON.parse(a.sessionIds),c=a.audioCapabilities||[],d=a.videoCapabilities||[],e=a.serverCertificate||[],f=a.drmConfig||{};return{sessionIds:b,keySystem:a.keySystem,licenseServerUri:decodeURIComponent(a.licenseServerUri||""),serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},Sv=function(a,b){var c=
|
|
5
|
+
_.el(a),d=_.Ik({drm:a});d.drm=a;var e=new _.Bm({Cb:b,onError:function(){},ef:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Jc:function(){return null}});e.g=c;return e},Vv=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.G(function(q){switch(q.a){case 1:d=Tv;e=Uv;if(!a)return e.debug(Gv),q["return"]();f=a.offlineId;return 0===f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(Fv,f),q["return"]();h=Sv(a,c);_.B(q,3,4);return _.x(q,
|
|
6
|
+
Nv(h,b),6);case 6:return _.x(q,_.Rm(h),7);case 7:return _.x(q,_.Sm(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(t){return{contentType:_.wj(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=Kv(h),g={sessionIds:n,keySystem:l.keySystem,licenseServerUri:l.licenseServerUri,serverCertificate:l.serverCertificate,audioCapabilities:[],videoCapabilities:m,drmConfig:a},_.x(q,d.store(f,g),4);case 4:return _.bg(q),_.x(q,h.destroy(),10);case 10:_.cg(q);break;case 3:throw p=_.D(q),e.error("Error while persisting DRM session "+
|
|
7
|
+
f),new _.N(1,6,6200,null,p);}})},Wv=function(){this.h=new _.K(Hv)},Mv=1,Ov=2;_.r=Qv.prototype;
|
|
8
|
+
_.r.store=function(a,b){var c;return _.G(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));_.y(d)})};_.r.get=function(a){var b=this,c;return _.G(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](Rv(atob(c)))}catch(e){b.h.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.G(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.r.clear=function(){return _.G(function(a){window.localStorage.clear();_.y(a)})};_.r.getName=function(){return Iv};_.I("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.M.R(a)||(_.M.mb(a.store)||c.push("store"),_.M.mb(a.get)||c.push("get"),_.M.mb(a["delete"])||c.push("delete"),_.M.mb(a.clear)||c.push("clear"),_.M.mb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Uv.warn("Invalid session storage implementation"),new _.N(1,6,6202,{missingMethods:b});Tv=a});
|
|
10
|
+
_.I("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,t,v,z,A,C,F,E,H,Q,P,Ba;return _.G(function(ta){switch(ta.a){case 1:f=Tv;g=Uv;h=function(ya,Ja){return new _.N(1,6,6200,ya,Ja)};l=_.ao(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(Gv);m=b.offlineId;if(typeof m!==_.Ue||!m.length)throw h("Missing offline id.");return _.x(ta,f.get(m),2);case 2:if(n=ta.f)return g.debug(Fv,m),ta["return"]();p=_.Ik();q=new _.Ri;
|
|
11
|
+
t=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,C=new A,_.Mk(C.id())||(C.f(),_.Ok(C),t.push(C));F=null;_.B(ta,3,4);return _.x(ta,_.Gq(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=ta.f,F.configure(p.manifest),_.x(ta,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=ta.f;if(!E.periods.length)throw h(null,new _.N(_.O,4,4014));H=_.zq(E.periods);
|
|
12
|
+
return _.x(ta,Vv(b,H,q),4);case 4:for(_.bg(ta);t.length;)Q=t.shift(),Q.a(),_.Lk["delete"](Q.id());P=[];F&&P.push(F.stop());P.push(q.destroy());return _.x(ta,Promise.all(P),9);case 9:_.cg(ta);break;case 3:Ba=_.D(ta);if(Ba instanceof _.N&&6200===Ba.code)throw Ba;throw h(null,Ba);}})});
|
|
13
|
+
_.I("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,h;return _.G(function(l){switch(l.a){case 1:b=Tv;c=Uv;if(!_.M.Z(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.B(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 _.Ri;d=Sv(f.drmConfig,e);return _.x(l,Pv(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.x(l,_.Rm(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.G(function(n){if(1==n.a)return _.x(n,Lv(d,m),2);c.debug("successfully removed session with id",m);_.y(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.bg(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.cg(l);break;case 2:throw h=_.D(l),c.error("Failed to remove session"),new _.N(1,6,6201,null,h);}})});var Tv=new Qv,Uv=new _.K(Hv);_.w(Wv,_.Mp);Wv.prototype.id=function(){return _.le};Wv.prototype.l=function(a,b){var c=this,d,e,f;return _.G(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.h.debug("No DRM configuration found for loaded source."),g["return"]();c.h.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.B(g,2);return _.x(g,Vv(d,b,e),4)}if(2!=g.a)return a.trigger(new _.L(_.rd,{offlineId:d.offlineId})),_.ag(g,0);f=_.D(g);a.onError(f);_.y(g)})};
|
|
15
|
+
Wv.prototype.j=function(a){var b=this,c,d;return _.G(function(e){if(1==e.a)return b.h.debug("Getting EME session IDs for "+a),c=Tv,_.B(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.h.debug("No offline session found for "+a);return e["return"]([])}_.D(e);b.h.warn("Error while loading session info from storage");return e["return"]([])})};_.I("clpp.persistent.PersistentLicenseComponent",Wv);};
|
|
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
|
-
_.
|
|
4
|
-
_.
|
|
5
|
-
_.
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var f=function(window){var Cv=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Ak.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.g=!1;this.j=this.Og.bind(this)},Dv=function(a){a.trigger(new _.L(_.xe))},Ev=function(a,b){return 0<=b&&b<a.a.length};_.w(Cv,_.Ak);_.r=Cv.prototype;_.r.on=function(a,b,c){return _.Ak.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Ak.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Ak.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
|
|
3
|
+
_.r.Fj=function(){return this.a};_.r.ld=function(){return 0<this.a.length&&Ev(this,this.f)?this.a[this.f]:null};_.r.Hj=function(){var a=this.f+1;return 0<this.a.length&&Ev(this,a)?this.a[a]:null};_.r.Tj=function(){return this.g};_.r.start=function(){this.g||(this.g=!0,this.m.on(_.xd,this.j),this.Ud(this.f,!0))};_.r.stop=function(){this.g=!1;this.m.off(_.xd,this.j)};_.r.Og=function(){this.next()};
|
|
4
|
+
_.r.next=function(){var a=this,b;return _.G(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Ud(b),0)})};_.r.ml=function(){var a=this,b;return _.G(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Ud(b),0)})};_.r.Ud=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.G(function(e){if(1==e.a){if(!(0<c.a.length&&Ev(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.ld())?_.x(e,c.l(d),3):e.G(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.L(_.we,{item:d}));_.y(e)})};
|
|
5
|
+
_.r.append=function(a){this.a.push(a);Dv(this)};_.r.Pj=function(a,b){if(0<=b&&b<=this.a.length){var c=this.ld();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));Dv(this)}};_.r.remove=function(a){if(0<this.a.length&&Ev(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);Dv(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;Dv(this)};_.I("clpp.Playlist",Cv);Cv.prototype.clear=Cv.prototype.clear;Cv.prototype.remove=Cv.prototype.remove;
|
|
6
|
+
Cv.prototype.insert=Cv.prototype.Pj;Cv.prototype.append=Cv.prototype.append;Cv.prototype.goTo=Cv.prototype.Ud;Cv.prototype.previous=Cv.prototype.ml;Cv.prototype.next=Cv.prototype.next;Cv.prototype.onEnded=Cv.prototype.Og;Cv.prototype.stop=Cv.prototype.stop;Cv.prototype.start=Cv.prototype.start;Cv.prototype.isStarted=Cv.prototype.Tj;Cv.prototype.getUpcoming=Cv.prototype.Hj;Cv.prototype.getCurrent=Cv.prototype.ld;Cv.prototype.getQueue=Cv.prototype.Fj;Cv.prototype.getPosition=Cv.prototype.getPosition;
|
|
7
|
+
Cv.prototype.off=Cv.prototype.off;Cv.prototype.one=Cv.prototype.one;Cv.prototype.on=Cv.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,75 +1,75 @@
|
|
|
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;
|
|
8
|
-
|
|
9
|
-
a;this.j=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
|
|
15
|
-
m.entries=[new
|
|
16
|
-
g]);d=(new
|
|
17
|
-
new
|
|
18
|
-
m.reader.getPosition()&&m.flags&1&&(p.
|
|
19
|
-
16);if(_.
|
|
20
|
-
!1);if(!h)return null;var l=(new
|
|
21
|
-
h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.
|
|
22
|
-
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.
|
|
23
|
-
16,d.seek(e.start),e.write(d),h=d.buffer);return h},
|
|
24
|
-
this.J=!1;this.j=this.A=null;this.
|
|
25
|
-
e=f.f;a.
|
|
26
|
-
c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if(
|
|
30
|
-
|
|
31
|
-
4,4037,
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
a.C.filterAllPeriods([
|
|
35
|
-
var h=
|
|
36
|
-
n;var q=a.M++,
|
|
37
|
-
findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:
|
|
38
|
-
0,f=[],g=c.timescale||b;c.
|
|
39
|
-
Rd:a.
|
|
40
|
-
a.h.error("required attribute not provided: "+c);throw new _.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_.w(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
_.w(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
_.w(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
_.w(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_.
|
|
70
|
-
_.
|
|
71
|
-
_.
|
|
72
|
-
!0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var
|
|
2
|
+
var f=function(window){var jJ="Full MP4 box must have flags defined",kJ="clpp.smooth.SmoothMP4Processor",lJ="codecPrivateData",mJ=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.V(a,c);_.V(a,d)},nJ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.jl()}},oJ=function(a,b){nJ(a,b>>16&255);nJ(a,b>>8&255);nJ(a,b&255)},pJ=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.jl()}},qJ=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.jl()}},rJ=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.g),a.a+=2}catch(c){_.jl()}},sJ=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},tJ=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.A=!1;this.entries=[];this.f=[]},Z=function(a,b,c){tJ.call(this,a);this.version=b;this.flags=c},uJ=function(a,b,c){tJ.call(this,a);this.g=b;this.offset=c},vJ=function(a,b,c,
|
|
4
|
+
d,e){Z.call(this,a,b,c);this.g=d;this.offset=e},wJ=function(a,b,c){tJ.call(this,"ftyp");this.j=a;this.Jg=b;this.g=c},xJ=function(){tJ.call(this,_.Wd)},yJ=function(){tJ.call(this,_.df)},zJ=function(a,b,c){Z.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.j=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]},AJ=function(){tJ.call(this,"mvex")},BJ=function(a){Z.call(this,"trex",0,0);this.g=a},CJ=function(a,b,c,d,e){Z.call(this,"tkhd",1,7);
|
|
5
|
+
this.j=a;this.duration=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]},DJ=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},EJ=function(a){Z.call(this,"hdlr",0,0);this.g=a},FJ=function(){Z.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},GJ=function(a){tJ.call(this,a);this.A=!0},HJ=function(a){GJ.call(this,a);this.height=this.width=0;this.depth=24},IJ=
|
|
6
|
+
function(a,b,c,d){GJ.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},JJ=function(a,b){HJ.call(this,"avc1");this.width=a;this.height=b},KJ=function(a,b){JJ.call(this,a,b);this.type="encv"},LJ=function(a,b,c){IJ.call(this,"mp4a",a,b,c)},MJ=function(a,b,c){LJ.call(this,a,b,c);this.type="enca"},NJ=function(a,b){tJ.call(this,"avcC");this.Qa=a;this.Tb=b;this.version=1;this.g=this.Qa[0][1];this.j=this.Qa[0][2];this.level=this.Qa[0][3]},OJ=function(a){Z.call(this,"esds",0,0);this.Jb=
|
|
7
|
+
a},PJ=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},QJ=function(){Z.call(this,"dref",0,0)},RJ=function(){tJ.call(this,_.Te)},SJ=function(){Z.call(this,_.Ve,0,0)},TJ=function(){Z.call(this,"stts",0,0)},UJ=function(){Z.call(this,"stsc",0,0)},VJ=function(){Z.call(this,"stco",0,0)},WJ=function(){Z.call(this,"stsz",0,0)},XJ=function(){Z.call(this,"smhd",0,0)},YJ=function(){tJ.call(this,"dinf")},ZJ=function(){tJ.call(this,_.Vd)},$J=function(){tJ.call(this,_.Rd)},aK=function(a,b){Z.call(this,
|
|
8
|
+
"tfdt",a,0);this.g=b},bK=function(){Z.call(this,"mfhd",0,0);this.g=0},cK=function(a,b){Z.call(this,"trun",a,b);this.o=this.l=this.g=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},dK=function(a,b){Z.call(this,"tfhd",a,b);this.g=255;this.o=this.w=this.l=this.B=this.j=0},eK=function(){tJ.call(this,"traf")},fK=function(){tJ.call(this,"moof")},gK=function(){tJ.call(this,_.Qd);this.g=new Uint8Array(0)},hK=function(){Z.call(this,"tenc",0,0);this.g=1;this.j=8;this.o="";this.l=[]},iK=function(a,b){Z.call(this,
|
|
9
|
+
"schm",0,0);this.g=a;this.j=b;this.Fb=""},jK=function(a){tJ.call(this,"frma");this.g=a},kK=function(){Z.call(this,"saio",0,0);this.offset=[0]},lK=function(a,b,c){Z.call(this,"saiz",0,0);this.g=a;this.l=b;this.j=c},mK=function(a,b){Z.call(this,"senc",a,b);this.j=0;this.l=8;this.g=[]},nK=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},oK=function(a,b,c,d){c=b.ng[c];b=b.Ml;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 _.ix([a],[b])[0]},pK=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.uf?c=["maxWidth","maxHeight","bitrate",lJ,"fourCC"]:a.type===_.rc&&(c=["bitrate",lJ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.M.pa(a,b,c,["id","segmentIndex"])},qK=function(a,b,c){var d=c.Md.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Qa:null,Tb:null,width:NaN,height:NaN,Jb:null,ud:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.uf:a.Qa=[_.pi(d[1])];a.Tb=[_.pi(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.rc:a.Jb=_.pi(c.Md),a.sampleSize=c.Ih||16,a.ud=c.ud,a.channelCount=c.Nf}return a},rK=function(a,b){return a.filter(function(c){return c.type===b})},sK=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)},zK=function(a,b,c){var d=null;if(tK.test(a)){a=tK.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 uK.test(a)?d=sK(uK,a):vK.test(a)?d=sK(vK,a):wK.test(a)?(a=wK.exec(a),d=Number(a[1])/c.frameRate):xK.test(a)?(a=xK.exec(a),d=Number(a[1])/c.a):yK.test(a)&&(d=sK(yK,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},AK=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))},CK=function(a){this.a=a;this.f=BK(this)},BK=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.il(b)},DK=function(a,b,c){a:{var d=_.u([_.ad,_.Zc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Rd(e.value))&&e.keyId){d=e.keyId;break a}_.J(kJ,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new tJ("xxxx");a.type===_.uf?c=new KJ(a.width,a.height):c=new MJ(a.channelCount,a.sampleSize,a.ud);a=new hK;a.g=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new tJ("schi")).append([a]);b=(new tJ(_.Oe)).append([new jK(b),new iK(_.Hc,65536),a]);c.append([b]);return c},EK=function(a,b){var c=b.Yd(),d=new zJ(a.timescale,a.duration,a.id),e=(new AJ).append([new BJ(a.id)]),f=new CJ(a.id,a.duration,a.timescale,a.width,a.height),g=new DJ(a.timescale,a.duration),h=new EJ(a.type),l=null,m=new QJ;
|
|
15
|
+
m.entries=[new PJ];var n=new SJ;switch(a.type){case _.uf:var p=new NJ(a.Qa,a.Tb);c?(l=DK(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new JJ(a.width,a.height)).append([p]),n.entries=[l]);l=new FJ;break;case _.rc:p=new OJ(a.Jb),c?(l=DK(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new LJ(a.channelCount,a.sampleSize,a.ud)).append([p]),n.entries=[l]),l=new XJ}n=(new RJ).append([n,new TJ,new UJ,new WJ,new VJ]);m=(new YJ).append([m]);m=(new ZJ).append([l,m,n]);g=(new $J).append([g,h,m]);f=(new yJ).append([f,
|
|
16
|
+
g]);d=(new xJ).append([d,f,e]);e=new wJ("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Rd(_.Zc),f=b.Rd(_.ad),c&&d.append([new uJ("pssh",c.initData,8)]),f&&d.append([new uJ("pssh",f.initData,8)]),c||f||_.J(kJ,"Could not get PSSH init data!"));c=new CK([e,d]);return _.R(c.write())},GK=function(a,b){var c,d,e,f,g,h;(new _.ul).L("moof",_.vl).X("mfhd",function(m){var n=new bK;n.g=_.W(m.reader);c=n}).L("traf",_.vl).X("tfhd",function(m){var n=m.reader.Fa();if(null===m.flags)throw new _.N(_.O,3,3019,jJ);var p=
|
|
17
|
+
new dK(m.version||0,m.flags||0);p.g=_.W(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.rl(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.B=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.l=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.W(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.W(m.reader));d=p}).X("trun",function(m){var n=m.reader.Fa();if(null===m.flags)throw new _.N(_.O,3,3019,jJ);var p=new cK(m.version||0,m.flags||0);p.g=_.W(m.reader);0<n-
|
|
18
|
+
m.reader.getPosition()&&m.flags&1&&(p.l=_.ql(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.W(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.w.push(_.W(m.reader)),m.flags&512&&p.sampleSize.push(_.W(m.reader)),m.flags&1024&&p.B.push(_.W(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.W(m.reader)):p.j.push(_.ql(m.reader)));e=p}).X("sdtp",function(m){var n=_.tl(m.reader,m.reader.Fa());f=new vJ("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.tl(m.reader,
|
|
19
|
+
16);if(_.ri(n,FK)){n=_.W(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new mK(m.version,m.flags);n.j=_.W(m.reader);m.flags&1&&(n.l=_.ol(m.reader));for(var p=0;p<n.j;p++){var q={zg:_.tl(m.reader,8),Sc:0,wf:[]};if(m.flags&2){q.Sc=_.pl(m.reader);for(var t=0;t<q.Sc;t++){var v={Lf:0,Mf:0};v.Lf=_.pl(m.reader);v.Mf=_.W(m.reader);q.wf.push(v)}}n.g.push(q)}g=n}}).L(_.Qd,function(m){var n=new gK;0<m.reader.Fa()?n.g=_.tl(m.reader,m.reader.Fa()):(_.J(kJ,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,
|
|
20
|
+
!1);if(!h)return null;var l=(new eK).append([d,e]);f&&l.append([f]);b.Yd()&&g&&l.append([g]);l=(new fK).append([c,l]);return new CK([l,h])},HK=function(a,b,c,d){var e=d.Yd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=GK(b,d);if(null===g)return a.request.contentType===_.$e?a.data:g;d=g.get(_.Qd);if(a.request.contentType===_.$e){e=d.g.buffer;if(c){e=_.ai(e);if((e=(new DOMParser).parseFromString(e,_.bf))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new AK(h.getAttribute("ttp:frameRate"),
|
|
21
|
+
h.getAttribute("ttp:subFrameRate"),h.getAttribute("ttp:frameRateMultiplier"),h.getAttribute("ttp:tickRate")),h=h.getElementsByTagName("body")[0]))for(h=h.getElementsByTagName("p"),a=0,b=h.length;a<b;a++){f=h[a];g=c;for(var l=["begin",_.wd],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],t=new RegExp("\\w+:"+q),v=0;if(p.hasAttribute(q))p=p.getAttribute(q);else{q=p.attributes;for(var z=q.length;v<z;v++){var A=q[v].name;if(A=A.match(t)){p=p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],zK(p||
|
|
22
|
+
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.bi(e).buffer}else c=e;return c}h=new fK;a=g.get("mfhd");b=new eK;l=g.get("tfhd");m=new aK(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);n&&b.append([n]);if(e){g=0;l=[];if(c.flags&2)for(l=[],m=0;m<c.j;m++)l.push(10+6*c.g[m].Sc);else g=8;b.append([c,new kK,new lK(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.l=h.a()+8;d=new CK([h,d]);h=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+
|
|
23
|
+
16,d.seek(e.start),e.write(d),h=d.buffer);return h},IK=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},JK=function(a,b,c){a=_.vm(a);c&&a.version!==c&&(a=_.ax(a,c));return{initData:_.Zw(a),initDataType:_.Hc,keyId:b,periodId:null}},LK=function(){this.w=this.g=this.f=this.C=null;this.M=1;this.T=0;this.l="";this.B=this.a=null;this.h=new _.K("clpp.smooth.SmoothParser");
|
|
24
|
+
this.J=!1;this.j=this.A=null;this.P=KK;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.tl.bind(this);this.F=new Map},MK=function(a,b){var c,d,e;return _.G(function(f){if(1==f.a)return c=_.Ai(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.C.networkingEngine.fetch(c),_.x(f,d.O,2);
|
|
25
|
+
e=f.f;a.l=e.uri;return f["return"](e)})},TK=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.ai(b);var f=d.parseFromString(e.trim(),_.bf)}catch(OD){throw OD;}if(f&&f.documentElement.tagName==_.xb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(OD){}if(!c)throw a.h.error("Unable to parse manifest"),new _.N(_.O,4,4033,a.l);var h=+NK(a,c,"MajorVersion"),l=+NK(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+NK(a,c,"Duration"),p="TRUE"===
|
|
26
|
+
c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),t=+c.getAttribute("DVRWindowLength")||Infinity,v=_.gm(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+h+"."+l))throw a.h.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.N(_.O,4,4036,a.l);p?(OK(a,PK),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):OK(a,KK);a.a={startTime:0,delay:0,duration:n/m,Ge:t/m,pd:0};if(v){var z=a.f.playreadyVersion,A=[],C=_.gm(v,"ProtectionHeader")[0],
|
|
27
|
+
F=_.oi(_.im(C)||""),E=_.vm(F).a;A.push(IK(_.ad,{initData:_.Zw(_.nm(E)),initDataType:_.Hc,keyId:E,periodId:null},[E]));A.push(IK(_.Zc,JK(F,E,z),[E]));a.o=A}var H=[],Q=_.gm(c,"StreamIndex");if(!Q.length)throw a.h.error("No streams found!"),new _.N(_.O,4,4034,a.l);for(var P=0;P<Q.length;P++){for(var Ba,ta=a,ya=Q[P],Ja=NK(ta,ya,"Type"),Ha=+ya.getAttribute("Chunks"),ma=ya.getAttribute("Subtype"),la=ya.getAttribute("Language")||_.ff,Ea=_.Jh(la),Bb=ya.getAttribute("Name")||"",Wb=+ya.getAttribute(_.Ya),Hb=
|
|
28
|
+
+ya.getAttribute(_.Xa),nf=NK(ta,ya,"Url"),id=+ya.getAttribute("TimeScale")||null,qm=[],RD=_.gm(ya,_.mb),Vs=0;Vs<RD.length;Vs++){var pf=void 0,gc=void 0,Ws=void 0,qf=ta,ld=RD[Vs],Xs=Ja,BO=+ld.getAttribute("Index"),CO=+NK(qf,ld,"Bitrate"),SD=NaN,TD=NaN,kn=NaN,Ys=NaN,UD=NaN,VD=NaN,WD=NaN,XD=ld.getAttribute("FourCC");switch(Xs){case _.uf:SD=+NK(qf,ld,_.Xa);TD=+NK(qf,ld,_.Ya);break;case _.rc:Ys=+ld.getAttribute("Channels")||2,kn=+NK(qf,ld,"SamplingRate"),VD=+NK(qf,ld,"AudioTag"),UD=+NK(qf,ld,"BitsPerSample"),
|
|
29
|
+
WD=+NK(qf,ld,"PacketSize")}var Zs=String(ld.getAttribute("CodecPrivateData"));if(Xs===_.rc&&!Zs){var YD=Ys,ZD={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},ln=ZD[kn];if("AACH"===XD){gc=new Uint8Array(4);var $D=ZD[2*kn];gc[0]=40|ln>>1;gc[1]=ln<<7|YD<<3|$D>>1;gc[2]=$D<<7|8;gc[3]=0;pf=new Uint16Array(2);pf[0]=(gc[0]<<8)+gc[1];pf[1]=(gc[2]<<8)+gc[3];Ws=pf[0].toString(16)+pf[1].toString(16)}else gc=new Uint8Array(2),gc[0]=16|ln>>1,gc[1]=ln<<7|YD<<3,
|
|
30
|
+
pf=new Uint16Array(1),pf[0]=(gc[0]<<8)+gc[1],Ws=pf[0].toString(16);Zs=Ws.toUpperCase()}var DO={id:qf.T++,type:Xs,index:BO,bitrate:CO,Md:Zs,maxHeight:SD,maxWidth:TD,ud:kn,Nf:Ys,em:VD,Ih:UD,rm:WD,pj:XD,segmentIndex:null};qm.push(DO)}Ba=qm;for(var ye=[],aE=_.gm(ya,"c"),Bj=0;Bj<aE.length;Bj++){var $s=aE[Bj],Md=parseInt($s.getAttribute("t"),10),xh=parseInt($s.getAttribute("d"),10),at=parseInt($s.getAttribute("r"),10),Cj=0;if(isNaN(Md)&&isNaN(xh))throw ta.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
31
|
+
new _.N(_.O,4,4037,ta.l);0===Bj&&isNaN(Md)&&(Cj=Md=0);if(0<Bj){var ng=ye[ye.length-1];Cj=ng.n+1;ng.d||(ng.d=Md-ng.t);Md||(Md=ng.t+ng.d);xh||(xh=Md-ng.t)}ye.push({n:Cj,d:xh,t:Md});if(at){at--;for(var bE=0;bE<at;bE++){var mn=ye[ye.length-1];Cj=mn.n+1;Md=mn.t+mn.d;xh=mn.d;ye.push({n:Cj,d:xh,t:Md})}}}ta.cd()||ye.length===Ha||ta.h.warn("Number of fragments ("+Ha+") differs from number of chunks ("+ye.length+").");H.push({type:Ja,hm:Ha,Dl:ma,language:Ea,od:la,name:Bb,maxWidth:Wb,maxHeight:Hb,Ml:nf,tracks:Ba,
|
|
32
|
+
ng:ye,timescale:id})}var rf={pm:h,Jg:l,timescale:m,duration:n,isLive:p,om:q,Ge:t,Qe:!1,streams:H};if(a.g&&a.w)return QK(a,rf),Promise.resolve();a.F.clear();var bt=rf.timescale,ct=rf.duration,FO=rK(rf.streams,_.rc),GO=rK(rf.streams,_.uf),HO=rK(rf.streams,_.$e),cE=[],nn=RK(a,ct,bt,FO),on=RK(a,ct,bt,GO),IO=RK(a,ct,bt,HO);nn.length||(nn=[null]);on.length||(on=[null]);for(var et=0;et<on.length;et++)for(var ft=0;ft<nn.length;ft++)cE.push(SK(a,on[et],nn[ft]));var dE={startTime:0,variants:cE,textStreams:IO,
|
|
33
|
+
thumbStreams:[]};var KO=rf.streams,gt=a.a.startTime,eE=a.a.delay,ht=a.I,fE=Math.min(a.a.duration||Infinity,ht),it=a.cd(),LO=a.a.Ge,MO=a.a.pd,gE=a.H,hE=isFinite(a.D)?a.D:0;if(it)fE=Infinity,gt=Date.now()/1E3-MO,a.a.startTime=gt,eE=3*gE;else for(var NO=isFinite(ht)?ht:a.a.duration,iE=_.u(KO),jt=iE.next();!jt.done;jt=iE.next())for(var jE=_.u(jt.value.tracks),kt=jE.next();!kt.done;kt=jE.next()){var kE=kt.value;kE.segmentIndex.offset(-hE);_.Lx(kE.segmentIndex,NO)}a.B=new _.Rx(gt,eE,!it,!0);a.B.f=fE;_.Vx(a.B,
|
|
34
|
+
gE);a.B.w=LO;it||a.B.offset(-hE);a.C.filterAllPeriods([dE]);a.g={presentationTimeline:a.B,periods:[dE],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.Vc(a.K),a.J=!0);a.w=rf;return Promise.resolve()},QK=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={Ib:e.Ib},g=f.next())if(e.Ib=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Ib.type&&m.bitrate===l.Ib.bitrate}}(e))){pK(e.Ib,
|
|
35
|
+
g)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var h=UK(a,a.w.timescale,d,g);g=e.Ib.segmentIndex;g.va(h);(h=a.a.Ge)&&_.fy(g,_.ey(g)-h).forEach(function(l){l.Na().forEach(function(m){a.F["delete"](m)})})}else a.h.warn("Cannot find satisfying update for "+e.Ib.type+" track with bitrate "+(e.Ib.bitrate+". Skipping update."))},RK=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=
|
|
36
|
+
d[h.sc],n=UK(a,c,m,l);n=new _.dy(n);var p=null;m.type!==_.$e&&(p=VK(a,b,c,m,l));l.segmentIndex=n;var q=a.M++,t=Promise.resolve.bind(Promise),v=n.Cc.bind(n),z=n.get.bind(n),A=n.Wc.bind(n),C=n.getDuration.bind(n),F=WK[m.type],E="";switch(m.type){case _.uf:E=l.Md;var H=/00000001[0-9]7/.exec(E);E="avc1."+(H&&H[0]?E.substr(E.indexOf(H[0])+10,6):"42c00c");a.h.debug("VIDEO CODECS: ",E);break;case _.rc:E=l.Md,H=2,"AACH"===l.pj?H=5:E&&(H=(parseInt(E.substr(0,2),16)&248)>>3),E="mp4a.40."+H,a.h.debug("AUDIO CODECS: ",
|
|
37
|
+
E)}H=m.type===_.$e?XK[m.Dl]:void 0;return{id:q,originalId:null,tm:null,createSegmentIndex:t,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:C,segmentIndex:n,segmentLookupStrategy:_.Kw,initSegmentReference:p,mimeType:F,codecs:E,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:H,encrypted:a.Te(),keyId:null,language:m.language,originalLanguage:m.od,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,
|
|
38
|
+
roles:[],channelsCount:l.Nf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},UK=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.ng.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=oK(a.l,c,l,d);a.H=Math.max(a.H,m);f.push(new _.lx(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.F.set(q,n);e+=m});if(c.type===_.uf||c.type===_.rc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.pd?a.a.pd=b.endTime:a.a.pd=Math.min(a.a.pd,b.endTime);return f},
|
|
39
|
+
VK=function(a,b,c,d,e){b=qK(b,d.timescale||c,e);c={isLive:a.cd.bind(a),Yd:a.Te.bind(a),wj:function(){return 1},Rd:a.pg.bind(a)};d=new Uint8Array(0);try{d=EK(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.N(_.O,3,4035,g);}var f="data:text/plain;base64,"+_.ni(d);return new _.kx(function(){return[f]},0,null,null,!0)},SK=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.ff;return c||b?{id:a.M++,language:e,primary:!1,audio:c,video:b,bandwidth:d,
|
|
40
|
+
drmInfos:a.o,allowedByApplication:!0,allowedByKeySystem:!0}:null},NK=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.N(_.O,4,4038,a.l,c);},YK=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Db.bind(a),b))},OK=function(a,b){var c=b===KK;if(a.g&&a.g.presentationTimeline){var d=a.g.presentationTimeline;d.j=c;d.l=c}c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.P=b},ZK=function(){};
|
|
41
|
+
tJ.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};tJ.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};tJ.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
|
+
tJ.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.V(a,1):_.V(a,this.size);_.kl(a,sJ(this.type));this.size>b&&mJ(a,this.size);"uuid"===this.type&&_.kl(a,null);if(0<this.f.length&&!this.A)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.w(Z,tJ);Z.prototype.a=function(){return 4+tJ.prototype.a.call(this)};Z.prototype.write=function(a){tJ.prototype.write.call(this,a);nJ(a,this.version);oJ(a,this.flags)};
|
|
43
|
+
_.w(uJ,tJ);uJ.prototype.a=function(){return this.g.byteLength+tJ.prototype.a.call(this)-this.offset};uJ.prototype.write=function(a){tJ.prototype.write.call(this,a);_.kl(a,this.g,this.offset);a.getPosition()};_.w(vJ,Z);vJ.prototype.a=function(){return this.g.byteLength+Z.prototype.a.call(this)-this.offset};vJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.kl(a,this.g,this.offset);a.getPosition()};_.w(wJ,tJ);
|
|
44
|
+
wJ.prototype.a=function(){var a=this.j.length;a=a+4+this.g.join("").length;return a+tJ.prototype.a.call(this)};wJ.prototype.write=function(a){tJ.prototype.write.call(this,a);_.kl(a,sJ(this.j));_.V(a,this.Jg);_.kl(a,sJ(this.g.join("")));a.getPosition()};_.w(xJ,tJ);_.w(yJ,tJ);_.w(zJ,Z);zJ.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=Z.prototype.a.call(this)};
|
|
45
|
+
zJ.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(mJ(a,0),mJ(a,0),_.V(a,this.timescale),mJ(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));_.V(a,65536);pJ(a,this.volume);pJ(a,0);_.V(a,0);_.V(a,0);for(var b=0;b<this.g.length;b++)nJ(a,this.g[b]);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,0);_.V(a,this.j);a.getPosition()};_.w(AJ,tJ);_.w(BJ,Z);BJ.prototype.a=function(){return 20+Z.prototype.a.call(this)};
|
|
46
|
+
BJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.g);_.V(a,1);_.V(a,0);_.V(a,0);_.V(a,0);a.getPosition()};_.w(CJ,Z);CJ.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+Z.prototype.a.call(this)};
|
|
47
|
+
CJ.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(mJ(a,0),mJ(a,0),_.V(a,this.j),_.V(a,0),mJ(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.j),_.V(a,0),_.V(a,this.duration*this.timescale));_.V(a,0);_.V(a,0);pJ(a,0);pJ(a,0);pJ(a,this.volume);pJ(a,0);for(var b=0;b<this.g.length;b++)nJ(a,this.g[b]);pJ(a,this.width);pJ(a,0);pJ(a,this.height);pJ(a,0);a.getPosition()};_.w(DJ,Z);DJ.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
|
|
48
|
+
DJ.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(mJ(a,0),mJ(a,0),_.V(a,this.timescale),mJ(a,this.duration*this.timescale)):(_.V(a,0),_.V(a,0),_.V(a,this.timescale),_.V(a,this.duration*this.timescale));pJ(a,this.language);pJ(a,0);a.getPosition()};_.w(EJ,Z);EJ.prototype.a=function(){return 33+Z.prototype.a.call(this)};
|
|
49
|
+
EJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);this.g===_.uf?_.kl(a,sJ("vide")):_.kl(a,sJ("soun"));_.V(a,0);_.V(a,0);_.V(a,0);this.g===_.uf?_.kl(a,sJ("VideoHandler\x00")):_.kl(a,sJ("SoundHandler\x00"));a.getPosition()};_.w(FJ,Z);FJ.prototype.a=function(){return 2+this.g.byteLength+Z.prototype.a.call(this)};FJ.prototype.write=function(a){Z.prototype.write.call(this,a);pJ(a,0);_.kl(a,this.g);a.getPosition()};_.w(GJ,tJ);GJ.prototype.a=function(){return 8+tJ.prototype.a.call(this)};
|
|
50
|
+
GJ.prototype.write=function(a){tJ.prototype.write.call(this,a);_.V(a,0);pJ(a,0);pJ(a,1)};_.w(HJ,GJ);HJ.prototype.a=function(){return 70+GJ.prototype.a.call(this)};HJ.prototype.write=function(a){GJ.prototype.write.call(this,a);pJ(a,0);pJ(a,0);_.V(a,0);_.V(a,0);_.V(a,0);pJ(a,this.width);pJ(a,this.height);_.V(a,4718592);_.V(a,4718592);_.V(a,0);pJ(a,1);nJ(a,10);_.kl(a,sJ("AVC Coding",31));pJ(a,this.depth);rJ(a,-1)};_.w(IJ,GJ);IJ.prototype.a=function(){return 20+GJ.prototype.a.call(this)};
|
|
51
|
+
IJ.prototype.write=function(a){GJ.prototype.write.call(this,a);_.V(a,0);_.V(a,0);pJ(a,this.channelCount);pJ(a,this.sampleSize);rJ(a,0);pJ(a,0);pJ(a,this.sampleRate);pJ(a,0)};_.w(JJ,HJ);JJ.prototype.write=function(a){HJ.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(KJ,JJ);_.w(LJ,IJ);LJ.prototype.write=function(a){IJ.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(MJ,LJ);_.w(NJ,tJ);
|
|
52
|
+
NJ.prototype.a=function(){for(var a=7,b=0;b<this.Qa.length;b++)a+=2,a+=this.Qa[b].byteLength;for(b=0;b<this.Qa.length;b++)a+=2,a+=this.Tb[b].byteLength;return a+tJ.prototype.a.call(this)};
|
|
53
|
+
NJ.prototype.write=function(a){tJ.prototype.write.call(this,a);nJ(a,this.version);nJ(a,this.g);nJ(a,this.j);nJ(a,this.level);nJ(a,255);nJ(a,224|this.Qa.length);for(var b=0;b<this.Qa.length;b++)pJ(a,this.Qa[b].length),_.kl(a,this.Qa[b]);nJ(a,this.Tb.length);for(b=0;b<this.Tb.length;b++)pJ(a,this.Tb[b].length),_.kl(a,this.Tb[b]);a.getPosition()};_.w(OJ,Z);OJ.prototype.a=function(){return 22+(this.Jb.byteLength+3)+Z.prototype.a.call(this)};
|
|
54
|
+
OJ.prototype.write=function(a){Z.prototype.write.call(this,a);nJ(a,3);nJ(a,23+this.Jb.byteLength);pJ(a,1);nJ(a,0);nJ(a,4);nJ(a,15+this.Jb.byteLength);nJ(a,64);nJ(a,21);oJ(a,0);_.V(a,0);_.V(a,0);nJ(a,5);nJ(a,this.Jb.byteLength);_.kl(a,this.Jb);_.kl(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(PJ,Z);PJ.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};PJ.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.kl(a,sJ(this.location));a.getPosition()};
|
|
55
|
+
_.w(QJ,Z);QJ.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};QJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(RJ,tJ);_.w(SJ,Z);SJ.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
|
|
56
|
+
SJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(TJ,Z);TJ.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};TJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(UJ,Z);
|
|
57
|
+
UJ.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};UJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(VJ,Z);VJ.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+Z.prototype.a.call(this)};
|
|
58
|
+
VJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(WJ,Z);WJ.prototype.a=function(){return 8+Z.prototype.a.call(this)};WJ.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,0);_.V(a,0);a.getPosition()};_.w(XJ,Z);XJ.prototype.a=function(){return 4+Z.prototype.a.call(this)};XJ.prototype.write=function(a){Z.prototype.write.call(this,a);rJ(a,0);pJ(a,0);a.getPosition()};
|
|
59
|
+
_.w(YJ,tJ);_.w(ZJ,tJ);_.w($J,tJ);_.w(aK,Z);aK.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};aK.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?mJ(a,this.g):_.V(a,this.g);a.getPosition()};_.w(bK,Z);bK.prototype.a=function(){return 4+Z.prototype.a.call(this)};bK.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.g);a.getPosition()};_.w(cK,Z);
|
|
60
|
+
cK.prototype.a=function(){var a=4;this.flags&$K&&(a+=4);this.flags&aL&&(a+=4);for(var b=0;b<this.g;b++)this.flags&bL&&(a+=4),this.flags&cL&&(a+=4),this.flags&dL&&(a+=4),this.flags&eL&&(a+=4);return a+Z.prototype.a.call(this)};
|
|
61
|
+
cK.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.g);this.flags&$K&&(a.getPosition(),qJ(a,this.l));this.flags&aL&&_.V(a,this.o);for(var b=0;b<this.g;b++)this.flags&bL&&_.V(a,this.w[b]),this.flags&cL&&_.V(a,this.sampleSize[b]),this.flags&dL&&_.V(a,this.B[b]),this.flags&eL&&(0===this.version?_.V(a,this.j[b]):qJ(a,this.j[b]));a.getPosition()};var $K=1,aL=4,bL=256,cL=512,dL=1024,eL=2048;_.w(dK,Z);
|
|
62
|
+
dK.prototype.a=function(){var a=4;this.flags&fL&&(a+=8);this.flags&gL&&(a+=4);this.flags&hL&&(a+=4);this.flags&iL&&(a+=4);this.flags&jL&&(a+=4);return a+Z.prototype.a.call(this)};dK.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.g);this.flags&fL&&mJ(a,this.j);this.flags&gL&&_.V(a,this.B);this.flags&hL&&_.V(a,this.l);this.flags&iL&&_.V(a,this.w);this.flags&jL&&_.V(a,this.o);a.getPosition()};var fL=1,gL=2,hL=8,iL=16,jL=32;_.w(eK,tJ);_.w(fK,tJ);_.w(gK,tJ);
|
|
63
|
+
gK.prototype.a=function(){return this.g.byteLength+tJ.prototype.a.call(this)};gK.prototype.write=function(a){tJ.prototype.write.call(this,a);0<this.g.byteLength&&_.kl(a,this.g)};_.w(hK,Z);hK.prototype.a=function(){var a=20;1===this.g&&0===this.j&&(a=a+1+this.l.length);return a+Z.prototype.a.call(this)};
|
|
64
|
+
hK.prototype.write=function(a){Z.prototype.write.call(this,a);nJ(a,0);0===this.version?nJ(a,0):nJ(a,0);nJ(a,this.g);nJ(a,this.j);_.kl(a,_.pi(this.o));if(1===this.g&&0===this.j){nJ(a,0);for(var b=0;b<this.l.length;b++)nJ(a,this.l[b])}a.getPosition()};_.w(iK,Z);iK.prototype.a=function(){var a=8;this.flags&1&&(a+=sJ(this.Fb).byteLength);return a+Z.prototype.a.call(this)};iK.prototype.write=function(a){Z.prototype.write.call(this,a);_.kl(a,sJ(this.g));_.V(a,this.j);this.flags&1&&_.kl(a,sJ(this.Fb));a.getPosition()};
|
|
65
|
+
_.w(jK,tJ);jK.prototype.a=function(){return sJ(this.g).byteLength+tJ.prototype.a.call(this)};jK.prototype.write=function(a){tJ.prototype.write.call(this,a);_.kl(a,sJ(this.g));a.getPosition()};_.w(kK,Z);kK.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+Z.prototype.a.call(this)};
|
|
66
|
+
kK.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));_.V(a,1);for(var b=0;1>b;b++)0===this.version?_.V(a,this.offset[b]):mJ(a,this.offset[b]);a.getPosition()};_.w(lK,Z);lK.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.l.length);return a+Z.prototype.a.call(this)};
|
|
67
|
+
lK.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.V(a,0),_.V(a,0));nJ(a,this.g);_.V(a,this.j);if(0===this.g)for(var b=0;b<this.j;b++)nJ(a,this.l[b]);a.getPosition()};_.w(mK,Z);mK.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.g[b].zg.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Sc;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
|
|
68
|
+
mK.prototype.write=function(a){Z.prototype.write.call(this,a);_.V(a,this.j);this.flags&1&&nJ(a,this.l);for(var b=0;b<this.j;b++)if(_.kl(a,this.g[b].zg),this.flags&2){pJ(a,this.g[b].Sc);for(var c=0;c<this.g[b].Sc;c++)pJ(a,this.g[b].wf[c].Lf),_.V(a,this.g[b].wf[c].Mf)}a.getPosition()};var tK=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,uK=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,vK=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,wK=/^(\d*\.?\d*)f$/,xK=/^(\d*\.?\d*)t$/,yK=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;CK.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};CK.prototype.write=function(){this.f=BK(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var FK=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=LK.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.C=b;var d=_.Of(new Set([a,nK(a)])).concat();return MK(this,d).then(function(e){return TK(c,e.data).then(function(){YK(c,c.A);return c.g})})};_.r.stop=function(){this.C&&this.C.networkingEngine.fe(this.K);this.A=this.w=this.g=this.f=this.C=null;this.j&&(clearTimeout(this.j),this.j=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
|
|
69
|
+
_.r.update=function(){var a=this;if(this.cd())return MK(this,[this.l]).then(function(b){return TK(a,b.data).then(function(){return a.g})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.r.onExpirationUpdated=function(){};_.r.setCurrentVariant=function(){};_.r.Db=function(){var a=this;this.h.debug(_.Bw);this.C&&(this.j=null,this.update().then(function(){YK(a,a.A)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&YK(a,100))}))};_.r.cd=function(){return this.P===PK};
|
|
70
|
+
_.r.Te=function(){return 0<this.o.length};_.r.pg=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
|
+
_.r.tl=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.cd.bind(this),Yd:this.Te.bind(this),wj:function(){return 1},Rd:this.pg.bind(this)},d=!1,e=new _.N(_.O,3,4035,null),f=null;try{var g=this.F.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.h.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=HK(a,b,g,c)}catch(h){d=
|
|
72
|
+
!0,e.data=h,3E3===h.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var WK={video:_.wf,audio:_.vc,text:_.oc},KK=_.Cw,PK="LIVE",XK={Pl:_.Hw,Yl:_.Xe};_.w(ZK,_.Mp);ZK.prototype.f=function(){_.Jq.ism=LK;_.Hq[_.pc]=LK};ZK.prototype.a=function(){_.ly("ism");_.my(_.pc)};ZK.prototype.id=function(){return"smooth"};_.I("clpp.smooth.SmoothComponent",ZK);};
|
|
73
73
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
74
74
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
75
75
|
else{_=this.clpp._;(f.call(g,this));}
|