@castlabs/prestoplay 6.9.0 → 6.10.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 +39 -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 +105 -104
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +420 -417
- package/cjs/cl.crypto.js +10 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +11 -12
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +72 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +273 -272
- package/cjs/cl.muxdata.js +14 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +68 -68
- 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 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +363 -359
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +11 -12
- package/cl.freewheel.js +17 -17
- package/cl.hls.js +61 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +235 -236
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- 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 +13 -13
- package/package.json +1 -1
- package/typings.d.ts +47 -2
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.l.getPosition()};
|
|
7
|
-
_.
|
|
8
|
-
b={request_start:c,request_type:
|
|
9
|
-
b);
|
|
10
|
-
_.t.
|
|
11
|
-
_.t.
|
|
12
|
-
_.t.
|
|
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 Mu=function(a){switch(a.type){case 1:return Ju;case 2:return Ku;case 3:return Lu}},Ou=function(a){var b=Object.keys(a).find(function(c){return Nu.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},Pu=function(a,b){this.l=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.eg;this.h=b;this.w=this.m=this.g=!1;this.A=null;this.j=a.getNetworkEngine();this.F=this.yi.bind(this);this.D=this.fl.bind(this)},Ru=function(a){var b={debug:!0,
|
|
3
|
+
data:Qu(a)};a.f&&a.f.muxOptionsOverride&&_.K.Pc(a.f.muxOptionsOverride)&&(b=_.K.wa(b,a.f.muxOptionsOverride));b=_.K.wa(b,{getPlayheadTime:function(){return 1E3*a.l.getPosition()},getStateData:function(){a.h.debug("getStateData()");var c=a.l.getLoadedSource(),d=a.l.getTrackManager(),e=a.l.getSurface(),f={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 g=new _.Di(c.url);
|
|
4
|
+
f.video_source_url=_.Ei(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.l.getSurface().getMedia())?c={videoWidth:c.videoWidth,videoHeight:c.videoHeight}:(c=a.l.getTrackManager().fa(),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},Qu=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.qa,player_software_name:_.qa,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},Su=function(a,b,c){a.h.debug("Event: "+b);a.A.emit(a.B,b,c)},Tu=function(a){a.a.on(a.l,_.Fe,function(){var b={player_playhead_time:1E3*
|
|
6
|
+
a.l.getPosition()};Su(a,_.Fe,b)});a.a.on(a.l,_.Zd,function(){return Su(a,_.Zd)});a.a.on(a.l,_.tc,a.vi.bind(a));a.a.on(a.l,_.re,a.xi.bind(a));a.a.on(a.l,_.Ne,function(){return Su(a,_.me)});a.a.on(a.l,_.Me,function(){return Su(a,_.le)});a.a.on(a.l,_.jd,a.wi.bind(a));a.a.on(a.l,_.Fb,function(){return Su(a,"adbreakstart")});a.a.on(a.l,_.Hb,function(){return Su(a,"adbreakend")});a.a.on(a.l,_.Vb,function(){Su(a,"adplay");Su(a,"adplaying")});a.a.on(a.l,_.Qb,function(){return Su(a,"adpause")});a.a.on(a.l,
|
|
7
|
+
_.Tb,function(){Su(a,"adplay");Su(a,"adplaying")});a.a.on(a.l,_.Wb,function(){return Su(a,"adended")});a.a.on(a.l,_.Lb,function(){return Su(a,"adfirstquartile")});a.a.on(a.l,_.Pb,function(){return Su(a,"admidpoint")});a.a.on(a.l,_.Xb,function(){return Su(a,"adthirdquartile")});a.j.Gd(a.F);a.j.Df(a.D);a.a.on(a.l,_.jd,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 _.Di(b.uris[b.uriIndex]);
|
|
8
|
+
b={request_start:c,request_type:Mu(b),request_hostname:d.a};a.h.debug("onRequestCanceled()","Track event: requestcanceled",b);Su(a,"requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.Di(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:Mu(b),request_hostname:e.a,request_error:""+Mu(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);Su(a,"requestfailed",b)}})},Uu=function(a){_.hg(a.a);a.j.ee(a.F);a.j.$g(a.D)},Vu=function(){this.f=null;this.a=!1;this.h=new _.I("clpp.muxdata")},Wu=function(a){return!_.K.R(a)&&typeof a.init===_.ld&&typeof a.emit===_.ld},Xu=function(){},Ju="manifest",Ku="media",Lu="encryption",Nu=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.t=Pu.prototype;_.t.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.B,Ru(this))}catch(d){throw this.g=!1,Uu(this),new _.L(1,9,9302,null,d);}Su(this,"playerready")}this.m&&!this.w&&(a=Qu(this),Su(this,"videochange",a),this.m=!1);Tu(this)};_.t.release=function(){this.h.debug("release()");this.m?this.h.debug(_.ia):(Uu(this),this.m=!0,this.o=this.f=null)};_.t.destroy=function(){this.h.debug(_.Xc);this.w?this.h.debug(_.ha):(this.w=!0,Su(this,"destroy"))};
|
|
10
|
+
_.t.vi=function(a){this.h.debug(_.Md);var b=a.detail;a=this.l.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.La())&&a.bandwidth&&(b+=a.bandwidth),Su(this,"renditionchange",{video_source_bitrate:b}))};_.t.xi=function(a){this.h.debug(_.Qd);switch(a.detail.currentState){case _.$m:this.l.getConfiguration().autoplay&&Su(this,_.Zd);break;case _.bn:Su(this,_.$d);break;case _.an:Su(this,_.Vd);break;case _.Vm:Su(this,_.id)}};
|
|
11
|
+
_.t.wi=function(a){this.h.debug(_.Nd);if(this.g&&(a=a.detail||null))if(10003===a.code)Su(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);Su(this,_.jd,{player_error_code:a.code,player_error_message:b})}};
|
|
12
|
+
_.t.yi=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 _.Di(b.uris[b.uriIndex]);a={request_start:e,request_type:Mu(b),request_hostname:g.a,request_id:Ou(c),request_bytes_loaded:d,request_response_start:h,request_response_end:a,request_response_headers:c,request_media_duration:f,
|
|
13
|
+
request_url:_.Ei(g)};this.h.debug("onRequestCompleted()","Track event: requestcompleted",a);Su(this,"requestcompleted",a)}};_.t.fl=function(a){a.requestStartTimestamp=Date.now()};_.w(Vu,_.eq);_.t=Vu.prototype;_.t.onPlayerCreated=function(a){this.f=new Pu(a,this.h)};
|
|
14
|
+
_.t.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.K.Ua(c.muxdata);try{var d=[];typeof c===_.Ld&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.L(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.K.R(e.muxdata)&&typeof e.muxdata===_.Ld){var f=e.muxdata;d=Wu(f.muxLib)?f.muxLib:window.mux;if(!Wu(d)){this.h.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.L(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)}};_.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(_.jd,{detail:b}))};_.C("clpp.muxdata.MuxDataPlugin",Vu);Vu.Id="mux";Xu.prototype.create=function(){return new Vu};_.vo(new Xu);};
|
|
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
|
-
_.t.ac=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.h.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),
|
|
2
|
+
var f=function(window){var Hu=function(){this.l=null;this.h=new _.I("clpp.onboard")},Iu=function(a,b){function c(l){return l&&(_.Fh(l,"https://")||_.Fh(l,"http://")||_.Fh(l,"//"))?l:d+l}var d=b.baseUrl;_.Gh(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),h=new _.Ak(a);h.Sa(_.Tc,{licenseUrl:e,videoRobustness:[_.mb,void 0],audioRobustness:[_.lb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:_.pl,
|
|
3
|
+
licenseResponse:_.ul}});h.Sa(_.Rc,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.rl,licenseResponse:_.sl,extractContentId:_.nl,certificateRequest:_.tl}});h.Sa(_.Sc,{licenseUrl:f,modifiers:{licenseRequest:_.pl}});_.vk(h)};_.w(Hu,_.Bo);_.t=Hu.prototype;_.t.Qa=function(a){this.l=a};_.t.Ha=function(){this.l=null};
|
|
4
|
+
_.t.ac=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.h.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),Iu(b,a))};_.t.release=function(){};_.t.id=function(){return"onboard"};_.C("clpp.onboard.OnboardComponent",Hu);_.C("clpp.onboard.register",Iu);};
|
|
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 _.x(f,_.
|
|
4
|
-
label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.
|
|
5
|
-
serverCertificate:e?new Uint8Array(e):null,audioCapabilities:c,videoCapabilities:d,drmConfig:f}},
|
|
6
|
-
f.length?q["return"]():_.x(q,d.get(f),2);case 2:if(g=q.f)return e.debug(
|
|
7
|
-
drmConfig:a},_.x(q,d.store(f,g),4);case 4:return
|
|
2
|
+
var f=function(window){var ou="A persistent DRM session already exists for: ",pu="No DRM configuration.",qu="clpp.persistent",ru=function(a){a.B=[a.g];a.o=0;a.m=0},su=function(a){var b=a.B.splice(0)[0];(b=a.g=a.g||b)?b.ug?a.a=a.o||a.m:void 0!=b.G&&a.m<b.G?(a.a=b.G,a.g=null):a.a=a.m:a.a=0},tu=function(a,b){for(var c=[],d=_.u(a),e=d.next();!e.done;e=d.next())c.push(b(e.value));return c},uu=function(a){a=a.f.keys();a=tu(a,function(b){return b.sessionId});return Array.from(a)},vu=function(a,b){var c,d,e;return _.B(function(f){if(1==
|
|
3
|
+
f.a)return _.x(f,_.gm(a,b),2);c=f.f;if(!c)return a.h.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.f.get(c))&&a.B&&(e.rb=new _.fi,d.push(e.rb));a.h.debug("Attempting to remove session",b);d.push(c.remove());return f["return"](Promise.all(d))})},xu=function(a,b){a.J=wu;a.K=[];a.F=!0;return _.Ol(a,b)},zu=function(a,b,c,d,e,f){a.J=yu;var g=new Map,h=_.im(b);g.set(h,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.Sd,persistentState:_.ie,sessionTypes:[_.Xd],
|
|
4
|
+
label:h,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.Ul(a,g)},Au=function(){},Bu=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}},Cu=function(a,b){var c=_.xk(a),d=_.ik({drm:a});d.drm=a;var e=new _.Kl({Db:b,onError:function(){},df:function(){},onExpirationUpdated:function(){},onEvent:function(){},getConfiguration:function(){return d},Mc:function(){return null}});e.g=c;return e},Fu=function(a,b,c){var d,e,f,g,h,l,m,n,p;return _.B(function(q){switch(q.a){case 1:d=Du;e=Eu;if(!a)return e.debug(pu),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(ou,f),q["return"]();h=Cu(a,c);_.Bf(q,3,4);return _.x(q,xu(h,b),6);case 6:return _.x(q,_.$l(h),7);case 7:return _.x(q,_.am(h),8);case 8:return l=h.getDrmInfo(),m=b.map(function(r){return{contentType:_.Xi(r.video.mimeType,r.video.codecs),robustness:l.videoRobustness}}),n=uu(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 ru(q),_.x(q,h.destroy(),10);case 10:su(q);break;case 3:throw p=_.Df(q),e.error("Error while persisting DRM session"),new _.L(1,6,6200,null,p);}})},Gu=function(){this.l=null;this.a=Du;this.h=new _.I(qu)},wu=1,yu=2;_.t=Au.prototype;
|
|
8
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));_.y(d)})};_.t.get=function(a){var b;return _.B(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](
|
|
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,v,z,A,E,H,
|
|
11
|
-
r=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,
|
|
12
|
-
return _.x(
|
|
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=
|
|
14
|
-
6);case 6:return _.x(l,_
|
|
15
|
-
_.t.
|
|
9
|
+
btoa(c));_.y(d)})};_.t.get=function(a){var b;return _.B(function(c){return(b=window.localStorage.getItem(encodeURIComponent(a)))?c["return"](Bu(atob(b))):c["return"](null)})};_.t["delete"]=function(a){return _.B(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.y(b)})};_.t.clear=function(){return _.B(function(a){window.localStorage.clear();_.y(a)})};_.t.getName=function(){return"clpp.persistent.SimpleSessionStorage"};_.C("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.K.R(a)||(_.K.nb(a.store)||c.push("store"),_.K.nb(a.get)||c.push("get"),_.K.nb(a["delete"])||c.push("delete"),_.K.nb(a.clear)||c.push("clear"),_.K.nb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw Eu.warn("Invalid session storage implementation"),new _.L(1,6,6202,{missingMethods:b});Du=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,v,z,A,D,F,E,H,Q,O,Ca;return _.B(function(sa){switch(sa.a){case 1:f=Du;g=Eu;h=function(wa,Fa){return new _.L(1,6,6200,wa,Fa)};l=_.fn(a).shift();if(!l)throw h("No source specified.");if(!b)throw h(pu);m=b.offlineId;if(typeof m!==_.ve||!m.length)throw h("Missing offline id.");return _.x(sa,f.get(m),2);case 2:if(n=sa.f)return g.debug(ou,m),sa["return"]();p=_.ik();q=new _.ri;
|
|
11
|
+
r=[];v=_.u(d);for(z=v.next();!z.done;z=v.next())A=z.value,D=new A,_.mk(D.id())||(D.Qa(null),_.ok(D),r.push(D));F=null;_.Bf(sa,3,4);return _.x(sa,_.vp(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return F=sa.f,F.configure(p.manifest),_.x(sa,F.start(l.url,{networkingEngine:q,filterAllPeriods:function(){},filterNewPeriod:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=sa.f;if(!E.periods.length)throw h(null,new _.L(_.M,4,4014));H=_.op(E.periods);
|
|
12
|
+
return _.x(sa,Fu(b,H,q),4);case 4:for(ru(sa);r.length;)Q=r.shift(),Q.Ha(),_.lk["delete"](Q.id());O=[];F&&O.push(F.stop());O.push(q.destroy());return _.x(sa,Promise.all(O),9);case 9:su(sa);break;case 3:Ca=_.Df(sa);if(Ca instanceof _.L&&6200===Ca.code)throw Ca;throw h(null,Ca);}})});
|
|
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=Du;c=Eu;if(!_.K.$(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.Bf(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=Cu(f.drmConfig,e);return _.x(l,zu(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.x(l,_.$l(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,vu(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 ru(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:su(l);break;case 2:throw h=_.Df(l),c.error("Failed to remove session"),new _.L(1,6,6201,null,h);}})});var Du=new Au,Eu=new _.I(qu);_.w(Gu,_.Bo);_.t=Gu.prototype;_.t.Qa=function(a){this.l=a};_.t.Ha=function(){this.l=null};_.t.release=function(){};_.t.ac=function(){this.a=Du};_.t.id=function(){return _.Wd};_.t.Xk=function(a,b,c){var d=this,e;return _.B(function(f){if(1==f.a){if(!a)return d.h.debug("No DRM configuration found for loaded source."),f["return"]();_.Bf(f,2);return _.x(f,Fu(a,b,c),4)}if(2!=f.a)return d.l.trigger(new _.J(_.bd,{offlineId:a.offlineId})),_.Cf(f,0);e=_.Df(f);d.l.onError(e);_.y(f)})};
|
|
15
|
+
_.t.oj=function(a){var b=this,c;return _.B(function(d){if(1==d.a)return _.Bf(d,2),_.x(d,b.a.get(a),4);if(2!=d.a){if(c=d.f)return d["return"](c.sessionIds);b.h.debug("No offline session found for "+a);return d["return"]([])}_.Df(d);b.h.warn("Error while loading session info from storage");return d["return"]([])})};_.C("clpp.persistent.PersistentLicenseComponent",Gu);};
|
|
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 _.B(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.
|
|
5
|
-
_.t.append=function(a){this.a.push(a);
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var f=function(window){var lu=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.ak.call(this);this.l=a;this.m=b;this.f=0;this.a=[];this.g=!1;this.j=this.Hg.bind(this)},mu=function(a){a.trigger(new _.J(_.be))},nu=function(a,b){return 0<=b&&b<a.a.length};_.w(lu,_.ak);_.t=lu.prototype;_.t.on=function(a,b,c){return _.ak.prototype.on.call(this,a,b,c)};_.t.one=function(a,b,c){return _.ak.prototype.one.call(this,a,b,c)};_.t.off=function(a,b){return _.ak.prototype.off.call(this,a,b)};_.t.getPosition=function(){return this.f};
|
|
3
|
+
_.t.wj=function(){return this.a};_.t.Je=function(){return 0<this.a.length&&nu(this,this.f)?this.a[this.f]:null};_.t.yj=function(){var a=this.f+1;return 0<this.a.length&&nu(this,a)?this.a[a]:null};_.t.Jj=function(){return this.g};_.t.start=function(){this.g||(this.g=!0,this.l.on(_.id,this.j),this.Wd(this.f,!0))};_.t.stop=function(){this.g=!1;this.l.off(_.id,this.j)};_.t.Hg=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.Wd(b),0)})};_.t.$k=function(){var a=this,b;return _.B(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Wd(b),0)})};_.t.Wd=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&&nu(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Je())?_.x(e,c.m(d),3):e.G(0)}if(4!=e.a)return _.x(e,c.l.load(d.configuration),4);c.trigger(new _.J(_.ae,{item:d}));_.y(e)})};
|
|
5
|
+
_.t.append=function(a){this.a.push(a);mu(this)};_.t.Fj=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Je();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));mu(this)}};_.t.remove=function(a){if(0<this.a.length&&nu(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);mu(this)}};_.t.clear=function(){this.stop();this.f=0;this.a=[];this.g=!1;mu(this)};_.C("clpp.Playlist",lu);lu.prototype.clear=lu.prototype.clear;lu.prototype.remove=lu.prototype.remove;
|
|
6
|
+
lu.prototype.insert=lu.prototype.Fj;lu.prototype.append=lu.prototype.append;lu.prototype.goTo=lu.prototype.Wd;lu.prototype.previous=lu.prototype.$k;lu.prototype.next=lu.prototype.next;lu.prototype.onEnded=lu.prototype.Hg;lu.prototype.stop=lu.prototype.stop;lu.prototype.start=lu.prototype.start;lu.prototype.isStarted=lu.prototype.Jj;lu.prototype.getUpcoming=lu.prototype.yj;lu.prototype.getCurrent=lu.prototype.Je;lu.prototype.getQueue=lu.prototype.wj;lu.prototype.getPosition=lu.prototype.getPosition;
|
|
7
|
+
lu.prototype.off=lu.prototype.off;lu.prototype.one=lu.prototype.one;lu.prototype.on=lu.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;Y.call(this,"url ",0,1);this.location=a},
|
|
8
|
-
|
|
9
|
-
a;this.j=b;this.Gb=""},
|
|
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
|
-
new
|
|
18
|
-
m.reader.getPosition()&&m.flags&1&&(p.m=_.
|
|
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.N=
|
|
25
|
-
e=f.f;a.m=e.uri;return f["return"](e)})},
|
|
26
|
-
c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,v=_.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if(
|
|
30
|
-
os=
|
|
31
|
-
4,4037,
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
a.C.filterAllPeriods([
|
|
35
|
-
var h=
|
|
36
|
-
n;var q=a.M++,r=Promise.resolve.bind(Promise),v=n.Fc.bind(n),z=n.get.bind(n),A=n.
|
|
37
|
-
findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:
|
|
38
|
-
0,f=[],g=c.timescale||b;c.
|
|
39
|
-
|
|
40
|
-
a.h.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},
|
|
41
|
-
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};X.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
|
|
42
|
-
X.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.
|
|
43
|
-
_.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
|
-
_.t.update=function(){var a=this;if(this.
|
|
70
|
-
_.t.
|
|
71
|
-
_.t.
|
|
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 WH="Full MP4 box must have flags defined",XH="clpp.smooth.SmoothMP4Processor",YH="codecPrivateData",ZH=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.T(a,c);_.T(a,d)},$H=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.Dk()}},aI=function(a,b){$H(a,b>>16&255);$H(a,b>>8&255);$H(a,b&255)},bI=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.Dk()}},cI=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.Dk()}},dI=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.g),a.a+=2}catch(c){_.Dk()}},eI=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.A=!1;this.entries=[];this.f=[]},Y=function(a,b,c){X.call(this,a);this.version=b;this.flags=c},fI=function(a,b,c){X.call(this,a);this.g=b;this.offset=c},gI=function(a,b,c,d,e){Y.call(this,
|
|
4
|
+
a,b,c);this.g=d;this.offset=e},hI=function(a,b,c){X.call(this,"ftyp");this.j=a;this.Ag=b;this.g=c},iI=function(){X.call(this,_.Fd)},jI=function(){X.call(this,_.Ge)},kI=function(a,b,c){Y.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]},lI=function(){X.call(this,"mvex")},mI=function(a){Y.call(this,"trex",0,0);this.g=a},nI=function(a,b,c,d,e){Y.call(this,"tkhd",1,7);this.j=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]},oI=function(a,b){Y.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},pI=function(a){Y.call(this,"hdlr",0,0);this.g=a},qI=function(){Y.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},rI=function(a){X.call(this,a);this.A=!0},sI=function(a){rI.call(this,a);this.height=this.width=0;this.depth=24},tI=function(a,b,c,d){rI.call(this,
|
|
6
|
+
a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},uI=function(a,b){sI.call(this,"avc1");this.width=a;this.height=b},vI=function(a,b){uI.call(this,a,b);this.type="encv"},wI=function(a,b,c){tI.call(this,"mp4a",a,b,c)},xI=function(a,b,c){wI.call(this,a,b,c);this.type="enca"},yI=function(a,b){X.call(this,"avcC");this.Ta=a;this.Ub=b;this.version=1;this.g=this.Ta[0][1];this.j=this.Ta[0][2];this.level=this.Ta[0][3]},zI=function(a){Y.call(this,"esds",0,0);this.Lb=a},AI=function(a){a=void 0===a?
|
|
7
|
+
"":a;Y.call(this,"url ",0,1);this.location=a},BI=function(){Y.call(this,"dref",0,0)},CI=function(){X.call(this,_.ue)},DI=function(){Y.call(this,_.we,0,0)},EI=function(){Y.call(this,"stts",0,0)},FI=function(){Y.call(this,"stsc",0,0)},GI=function(){Y.call(this,"stco",0,0)},HI=function(){Y.call(this,"stsz",0,0)},II=function(){Y.call(this,"smhd",0,0)},JI=function(){X.call(this,"dinf")},KI=function(){X.call(this,_.Ed)},LI=function(){X.call(this,_.Ad)},MI=function(a,b){Y.call(this,"tfdt",a,0);this.g=b},
|
|
8
|
+
NI=function(){Y.call(this,"mfhd",0,0);this.g=0},OI=function(a,b){Y.call(this,"trun",a,b);this.o=this.m=this.g=0;this.w=[];this.sampleSize=[];this.B=[];this.j=[]},PI=function(a,b){Y.call(this,"tfhd",a,b);this.g=255;this.o=this.w=this.m=this.B=this.j=0},QI=function(){X.call(this,"traf")},RI=function(){X.call(this,"moof")},SI=function(){X.call(this,_.zd);this.g=new Uint8Array(0)},TI=function(){Y.call(this,"tenc",0,0);this.g=1;this.j=8;this.o="";this.m=[]},UI=function(a,b){Y.call(this,"schm",0,0);this.g=
|
|
9
|
+
a;this.j=b;this.Gb=""},VI=function(a){X.call(this,"frma");this.g=a},WI=function(){Y.call(this,"saio",0,0);this.offset=[0]},XI=function(a,b,c){Y.call(this,"saiz",0,0);this.g=a;this.m=b;this.j=c},YI=function(a,b){Y.call(this,"senc",a,b);this.j=0;this.m=8;this.g=[]},ZI=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},$I=function(a,b,c,d){c=b.jg[c];b=b.yl;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 _.Pv([a],[b])[0]},aJ=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Re?c=["maxWidth","maxHeight","bitrate",YH,"fourCC"]:a.type===_.mc&&(c=["bitrate",YH,"channels","bitsPerSample","samplingRate","fourCC"]);return _.K.pa(a,b,c,["id","segmentIndex"])},bJ=function(a,b,c){var d=c.Nd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Ta:null,Ub:null,width:NaN,height:NaN,Lb:null,vd:NaN,
|
|
11
|
+
sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Re:a.Ta=[_.Qh(d[1])];a.Ub=[_.Qh(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.mc:a.Lb=_.Qh(c.Nd),a.sampleSize=c.zh||16,a.vd=c.vd,a.channelCount=c.Nf}return a},cJ=function(a,b){return a.filter(function(c){return c.type===b})},dJ=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)},kJ=function(a,b,c){var d=null;if(eJ.test(a)){a=eJ.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 fJ.test(a)?d=dJ(fJ,a):gJ.test(a)?d=dJ(gJ,a):hJ.test(a)?(a=hJ.exec(a),d=Number(a[1])/c.frameRate):iJ.test(a)?(a=iJ.exec(a),d=Number(a[1])/c.a):jJ.test(a)&&(d=dJ(jJ,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},lJ=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))},nJ=function(a){this.a=a;this.f=mJ(this)},mJ=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.Ck(b)},oJ=function(a,b,c){a:{var d=_.u([_.Tc,_.Sc]);for(var e=d.next();!e.done;e=d.next())if((e=c.Td(e.value))&&e.keyId){d=e.keyId;break a}_.G(XH,"Could not get default Key ID for DRM init data!");
|
|
14
|
+
d=null}c=new X("xxxx");a.type===_.Re?c=new vI(a.width,a.height):c=new xI(a.channelCount,a.sampleSize,a.vd);a=new TI;a.g=1;a.j=8;a.o=d||"00000000000000000000000000000000";a=(new X("schi")).append([a]);b=(new X(_.oe)).append([new VI(b),new UI(_.Cc,65536),a]);c.append([b]);return c},pJ=function(a,b){var c=b.Zd(),d=new kI(a.timescale,a.duration,a.id),e=(new lI).append([new mI(a.id)]),f=new nI(a.id,a.duration,a.timescale,a.width,a.height),g=new oI(a.timescale,a.duration),h=new pI(a.type),l=null,m=new BI;
|
|
15
|
+
m.entries=[new AI];var n=new DI;switch(a.type){case _.Re:var p=new yI(a.Ta,a.Ub);c?(l=oJ(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new uI(a.width,a.height)).append([p]),n.entries=[l]);l=new qI;break;case _.mc:p=new zI(a.Lb),c?(l=oJ(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new wI(a.channelCount,a.sampleSize,a.vd)).append([p]),n.entries=[l]),l=new II}n=(new CI).append([n,new EI,new FI,new HI,new GI]);m=(new JI).append([m]);m=(new KI).append([l,m,n]);g=(new LI).append([g,h,m]);f=(new jI).append([f,
|
|
16
|
+
g]);d=(new iI).append([d,f,e]);e=new hI("dash",0,["iso6","mp41","avc1"]);c&&(c=b.Td(_.Sc),f=b.Td(_.Tc),c&&d.append([new fI("pssh",c.initData,8)]),f&&d.append([new fI("pssh",f.initData,8)]),c||f||_.G(XH,"Could not get PSSH init data!"));c=new nJ([e,d]);return _.N(c.write())},rJ=function(a,b){var c,d,e,f,g,h;(new _.Ok).L("moof",_.Pk).Y("mfhd",function(m){var n=new NI;n.g=_.U(m.reader);c=n}).L("traf",_.Pk).Y("tfhd",function(m){var n=m.reader.Ea();if(null===m.flags)throw new _.L(_.M,3,3019,WH);var p=
|
|
17
|
+
new PI(m.version||0,m.flags||0);p.g=_.U(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.Lk(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.B=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.m=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.w=_.U(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.o=_.U(m.reader));d=p}).Y("trun",function(m){var n=m.reader.Ea();if(null===m.flags)throw new _.L(_.M,3,3019,WH);var p=new OI(m.version||0,m.flags||0);p.g=_.U(m.reader);0<n-
|
|
18
|
+
m.reader.getPosition()&&m.flags&1&&(p.m=_.Kk(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.o=_.U(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.w.push(_.U(m.reader)),m.flags&512&&p.sampleSize.push(_.U(m.reader)),m.flags&1024&&p.B.push(_.U(m.reader)),m.flags&2048&&(0===m.version?p.j.push(_.U(m.reader)):p.j.push(_.Kk(m.reader)));e=p}).Y("sdtp",function(m){var n=_.Nk(m.reader,m.reader.Ea());f=new gI("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Nk(m.reader,
|
|
19
|
+
16);if(_.Sh(n,qJ)){n=_.U(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new YI(m.version,m.flags);n.j=_.U(m.reader);m.flags&1&&(n.m=_.Ik(m.reader));for(var p=0;p<n.j;p++){var q={rg:_.Nk(m.reader,8),Vc:0,vf:[]};if(m.flags&2){q.Vc=_.Jk(m.reader);for(var r=0;r<q.Vc;r++){var v={Lf:0,Mf:0};v.Lf=_.Jk(m.reader);v.Mf=_.U(m.reader);q.vf.push(v)}}n.g.push(q)}g=n}}).L(_.zd,function(m){var n=new SI;0<m.reader.Ea()?n.g=_.Nk(m.reader,m.reader.Ea()):(_.G(XH,"mdat box is empty!"),n.g=new Uint8Array(0));h=n}).parse(a,
|
|
20
|
+
!1);if(!h)return null;var l=(new QI).append([d,e]);f&&l.append([f]);b.Zd()&&g&&l.append([g]);l=(new RI).append([c,l]);return new nJ([l,h])},sJ=function(a,b,c,d){var e=d.Zd(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=rJ(b,d);if(null===g)return a.request.contentType===_.Ce?a.data:g;d=g.get(_.zd);if(a.request.contentType===_.Ce){e=d.g.buffer;if(c){e=_.Bh(e);if((e=(new DOMParser).parseFromString(e,_.Ee))&&"tt"===e.documentElement.tagName.toLowerCase())var h=e.documentElement;if(h&&(d=new lJ(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",_.gd],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],r=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(r)){p=p.getAttribute(A[0]);break b}}p=null}}f.setAttribute(l[m],kJ(p||
|
|
22
|
+
"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.Ch(e).buffer}else c=e;return c}h=new RI;a=g.get("mfhd");b=new QI;l=g.get("tfhd");m=new MI(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].Vc);else g=8;b.append([c,new WI,new XI(g,l,c.j)])}h.append([a,b]);f.flags|=1;f.m=h.a()+8;d=new nJ([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},tJ=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},uJ=function(a,b,c){a=_.tw(a);c&&a.version!==c&&(a=_.pw(a,c));return{initData:_.Iv(a),initDataType:_.Cc,keyId:b,periodId:null}},wJ=function(){this.w=this.g=this.f=this.C=null;this.M=1;this.T=0;this.m="";this.B=this.a=null;this.h=new _.I("clpp.smooth.SmoothParser");
|
|
24
|
+
this.J=!1;this.j=this.A=null;this.N=vJ;this.H=0;this.D=this.I=Infinity;this.o=[];this.K=this.gl.bind(this);this.F=new Map},xJ=function(a,b){var c,d,e;return _.B(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.P,2);
|
|
25
|
+
e=f.f;a.m=e.uri;return f["return"](e)})},EJ=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.Bh(b);var f=d.parseFromString(e.trim(),_.Ee)}catch(QC){throw QC;}if(f&&f.documentElement.tagName==_.rb)var g=f.documentElement;c=g&&0<g.getElementsByTagName("parsererror").length?null:g}catch(QC){}if(!c)throw a.h.error("Unable to parse manifest"),new _.L(_.M,4,4033,a.m);var h=+yJ(a,c,"MajorVersion"),l=+yJ(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+yJ(a,c,"Duration"),p="TRUE"===
|
|
26
|
+
c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,v=_.iw(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 _.L(_.M,4,4036,a.m);p?(zJ(a,AJ),a.A=typeof a.f.liveRefreshPeriod===_.k?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):zJ(a,vJ);a.a={startTime:0,delay:0,duration:n/m,De:r/m,qd:0};if(v){var z=a.f.playreadyVersion,A=[],D=_.iw(v,"ProtectionHeader")[0],
|
|
27
|
+
F=_.Ph(_.kw(D)||""),E=_.tw(F).a;A.push(tJ(_.Tc,{initData:_.Iv(_.El(E)),initDataType:_.Cc,keyId:E,periodId:null},[E]));A.push(tJ(_.Sc,uJ(F,E,z),[E]));a.o=A}var H=[],Q=_.iw(c,"StreamIndex");if(!Q.length)throw a.h.error("No streams found!"),new _.L(_.M,4,4034,a.m);for(var O=0;O<Q.length;O++){for(var Ca,sa=a,wa=Q[O],Fa=yJ(sa,wa,"Type"),Ea=+wa.getAttribute("Chunks"),ka=wa.getAttribute("Subtype"),la=wa.getAttribute("Language")||_.Ie,Na=_.ih(la),tb=wa.getAttribute("Name")||"",Rb=+wa.getAttribute(_.Va),Gb=
|
|
28
|
+
+wa.getAttribute(_.Ua),Mb=yJ(sa,wa,"Url"),Dr=+wa.getAttribute("TimeScale")||null,TC=[],UC=_.iw(wa,_.gb),ns=0;ns<UC.length;ns++){var hf=void 0,bc=void 0,os=void 0,jf=sa,hd=UC[ns],ps=Fa,lN=+hd.getAttribute("Index"),mN=+yJ(jf,hd,"Bitrate"),VC=NaN,WC=NaN,Gm=NaN,qs=NaN,XC=NaN,YC=NaN,ZC=NaN,$C=hd.getAttribute("FourCC");switch(ps){case _.Re:VC=+yJ(jf,hd,_.Ua);WC=+yJ(jf,hd,_.Va);break;case _.mc:qs=+hd.getAttribute("Channels")||2,Gm=+yJ(jf,hd,"SamplingRate"),YC=+yJ(jf,hd,"AudioTag"),XC=+yJ(jf,hd,"BitsPerSample"),
|
|
29
|
+
ZC=+yJ(jf,hd,"PacketSize")}var rs=String(hd.getAttribute("CodecPrivateData"));if(ps===_.mc&&!rs){var aD=qs,bD={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},Hm=bD[Gm];if("AACH"===$C){bc=new Uint8Array(4);var cD=bD[2*Gm];bc[0]=40|Hm>>1;bc[1]=Hm<<7|aD<<3|cD>>1;bc[2]=cD<<7|8;bc[3]=0;hf=new Uint16Array(2);hf[0]=(bc[0]<<8)+bc[1];hf[1]=(bc[2]<<8)+bc[3];os=hf[0].toString(16)+hf[1].toString(16)}else bc=new Uint8Array(2),bc[0]=16|Hm>>1,bc[1]=Hm<<7|aD<<3,
|
|
30
|
+
hf=new Uint16Array(1),hf[0]=(bc[0]<<8)+bc[1],os=hf[0].toString(16);rs=os.toUpperCase()}var nN={id:jf.T++,type:ps,index:lN,bitrate:mN,Nd:rs,maxHeight:VC,maxWidth:WC,vd:Gm,Nf:qs,Rl:YC,zh:XC,dm:ZC,hj:$C,segmentIndex:null};TC.push(nN)}Ca=TC;for(var te=[],dD=_.iw(wa,"c"),hj=0;hj<dD.length;hj++){var ss=dD[hj],Id=parseInt(ss.getAttribute("t"),10),mh=parseInt(ss.getAttribute("d"),10),ts=parseInt(ss.getAttribute("r"),10),ij=0;if(isNaN(Id)&&isNaN(mh))throw sa.h.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
31
|
+
new _.L(_.M,4,4037,sa.m);0===hj&&isNaN(Id)&&(ij=Id=0);if(0<hj){var bg=te[te.length-1];ij=bg.n+1;bg.d||(bg.d=Id-bg.t);Id||(Id=bg.t+bg.d);mh||(mh=Id-bg.t)}te.push({n:ij,d:mh,t:Id});if(ts){ts--;for(var eD=0;eD<ts;eD++){var Im=te[te.length-1];ij=Im.n+1;Id=Im.t+Im.d;mh=Im.d;te.push({n:ij,d:mh,t:Id})}}}sa.fd()||te.length===Ea||sa.h.warn("Number of fragments ("+Ea+") differs from number of chunks ("+te.length+").");H.push({type:Fa,Ul:Ea,ol:ka,language:Na,pd:la,name:tb,maxWidth:Rb,maxHeight:Gb,yl:Mb,tracks:Ca,
|
|
32
|
+
jg:te,timescale:Dr})}var kf={bm:h,Ag:l,timescale:m,duration:n,isLive:p,am:q,De:r,Oe:!1,streams:H};if(a.g&&a.w)return BJ(a,kf),Promise.resolve();a.F.clear();var us=kf.timescale,vs=kf.duration,pN=cJ(kf.streams,_.mc),qN=cJ(kf.streams,_.Re),rN=cJ(kf.streams,_.Ce),fD=[],Jm=CJ(a,vs,us,pN),Km=CJ(a,vs,us,qN),sN=CJ(a,vs,us,rN);Jm.length||(Jm=[null]);Km.length||(Km=[null]);for(var xs=0;xs<Km.length;xs++)for(var ys=0;ys<Jm.length;ys++)fD.push(DJ(a,Km[xs],Jm[ys]));var gD={startTime:0,variants:fD,textStreams:sN,
|
|
33
|
+
thumbStreams:[]};var uN=kf.streams,zs=a.a.startTime,hD=a.a.delay,As=a.I,iD=Math.min(a.a.duration||Infinity,As),Bs=a.fd(),vN=a.a.De,wN=a.a.qd,jD=a.H,kD=isFinite(a.D)?a.D:0;if(Bs)iD=Infinity,zs=Date.now()/1E3-wN,a.a.startTime=zs,hD=3*jD;else for(var xN=isFinite(As)?As:a.a.duration,lD=_.u(uN),Cs=lD.next();!Cs.done;Cs=lD.next())for(var mD=_.u(Cs.value.tracks),Ds=mD.next();!Ds.done;Ds=mD.next()){var nD=Ds.value;nD.segmentIndex.offset(-kD);_.Dw(nD.segmentIndex,xN)}a.B=new _.Jw(zs,hD,!Bs,!0);a.B.f=iD;_.Ow(a.B,
|
|
34
|
+
jD);a.B.m=vN;Bs||a.B.offset(-kD);a.C.filterAllPeriods([gD]);a.g={presentationTimeline:a.B,periods:[gD],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.C.networkingEngine.Gd(a.K),a.J=!0);a.w=kf;return Promise.resolve()},BJ=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={Kb:e.Kb},g=f.next())if(e.Kb=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Kb.type&&m.bitrate===l.Kb.bitrate}}(e))){aJ(e.Kb,
|
|
35
|
+
g)||a.h.warn("The current stream is updated with a stream that seems to have different base properties!");var h=FJ(a,a.w.timescale,d,g);g=e.Kb.segmentIndex;g.wa(h);(h=a.a.De)&&_.Zw(g,_.Yw(g)-h).forEach(function(l){l.Oa().forEach(function(m){a.F["delete"](m)})})}else a.h.warn("Cannot find satisfying update for "+e.Kb.type+" track with bitrate "+(e.Kb.bitrate+". Skipping update."))},CJ=function(a,b,c,d){for(var e=[],f={vc:0};f.vc<d.length;f={vc:f.vc},f.vc++){var g=d[f.vc].tracks.map(function(h){return function(l){var m=
|
|
36
|
+
d[h.vc],n=FJ(a,c,m,l);n=new _.Xw(n);var p=null;m.type!==_.Ce&&(p=GJ(a,b,c,m,l));l.segmentIndex=n;var q=a.M++,r=Promise.resolve.bind(Promise),v=n.Fc.bind(n),z=n.get.bind(n),A=n.Yc.bind(n),D=n.getDuration.bind(n),F=HJ[m.type],E="";switch(m.type){case _.Re:E=l.Nd;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 _.mc:E=l.Nd,H=2,"AACH"===l.hj?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===_.Ce?IJ[m.ol]:void 0;return{id:q,originalId:null,fm:null,createSegmentIndex:r,findSegmentPosition:v,getSegmentReference:z,adjustSegmentDurations:A,getDuration:D,segmentIndex:n,segmentLookupStrategy:_.vv,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.Re(),keyId:null,language:m.language,originalLanguage:m.pd,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},FJ=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.jg.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=$I(a.m,c,l,d);a.H=Math.max(a.H,m);f.push(new _.Sv(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.F.set(q,n);e+=m});if(c.type===_.Re||c.type===_.mc)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.qd?a.a.qd=b.endTime:a.a.qd=Math.min(a.a.qd,b.endTime);return f},
|
|
39
|
+
GJ=function(a,b,c,d,e){b=bJ(b,d.timescale||c,e);c={isLive:a.fd.bind(a),Zd:a.Re.bind(a),nj:function(){return 1},Td:a.lg.bind(a)};d=new Uint8Array(0);try{d=pJ(b,c)}catch(g){throw a.h.error("Failed to generate initialization segment."),new _.L(_.M,3,4035,g);}var f="data:text/plain;base64,"+_.Oh(d);return new _.Rv(function(){return[f]},0,null,null,!0)},DJ=function(a,b,c){var d=(c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Ie;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},yJ=function(a,b,c){if(b=b.getAttribute(c))return b;a.h.error("required attribute not provided: "+c);throw new _.L(_.M,4,4038,a.m,c);},JJ=function(a,b){null!=a.A&&null!=b&&(a.j=window.setTimeout(a.Eb.bind(a),b))},zJ=function(a,b){var c=b===vJ;a.g&&a.g.presentationTimeline&&_.Kw(a.g.presentationTimeline,c);c&&null!=a.j&&(window.clearTimeout(a.j),a.j=null,a.A=null);a.N=b},KJ=function(){};
|
|
41
|
+
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};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?_.T(a,1):_.T(a,this.size);_.Ek(a,eI(this.type));this.size>b&&ZH(a,this.size);"uuid"===this.type&&_.Ek(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(Y,X);Y.prototype.a=function(){return 4+X.prototype.a.call(this)};Y.prototype.write=function(a){X.prototype.write.call(this,a);$H(a,this.version);aI(a,this.flags)};
|
|
43
|
+
_.w(fI,X);fI.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)-this.offset};fI.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,this.g,this.offset);a.getPosition()};_.w(gI,Y);gI.prototype.a=function(){return this.g.byteLength+Y.prototype.a.call(this)-this.offset};gI.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ek(a,this.g,this.offset);a.getPosition()};_.w(hI,X);
|
|
44
|
+
hI.prototype.a=function(){var a=this.j.length;a=a+4+this.g.join("").length;return a+X.prototype.a.call(this)};hI.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,eI(this.j));_.T(a,this.Ag);_.Ek(a,eI(this.g.join("")));a.getPosition()};_.w(iI,X);_.w(jI,X);_.w(kI,Y);kI.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
|
+
kI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(ZH(a,0),ZH(a,0),_.T(a,this.timescale),ZH(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));_.T(a,65536);bI(a,this.volume);bI(a,0);_.T(a,0);_.T(a,0);for(var b=0;b<this.g.length;b++)$H(a,this.g[b]);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,0);_.T(a,this.j);a.getPosition()};_.w(lI,X);_.w(mI,Y);mI.prototype.a=function(){return 20+Y.prototype.a.call(this)};
|
|
46
|
+
mI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);_.T(a,1);_.T(a,0);_.T(a,0);_.T(a,0);a.getPosition()};_.w(nI,Y);nI.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
|
+
nI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(ZH(a,0),ZH(a,0),_.T(a,this.j),_.T(a,0),ZH(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.j),_.T(a,0),_.T(a,this.duration*this.timescale));_.T(a,0);_.T(a,0);bI(a,0);bI(a,0);bI(a,this.volume);bI(a,0);for(var b=0;b<this.g.length;b++)$H(a,this.g[b]);bI(a,this.width);bI(a,0);bI(a,this.height);bI(a,0);a.getPosition()};_.w(oI,Y);oI.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Y.prototype.a.call(this)};
|
|
48
|
+
oI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?(ZH(a,0),ZH(a,0),_.T(a,this.timescale),ZH(a,this.duration*this.timescale)):(_.T(a,0),_.T(a,0),_.T(a,this.timescale),_.T(a,this.duration*this.timescale));bI(a,this.language);bI(a,0);a.getPosition()};_.w(pI,Y);pI.prototype.a=function(){return 33+Y.prototype.a.call(this)};
|
|
49
|
+
pI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);this.g===_.Re?_.Ek(a,eI("vide")):_.Ek(a,eI("soun"));_.T(a,0);_.T(a,0);_.T(a,0);this.g===_.Re?_.Ek(a,eI("VideoHandler\x00")):_.Ek(a,eI("SoundHandler\x00"));a.getPosition()};_.w(qI,Y);qI.prototype.a=function(){return 2+this.g.byteLength+Y.prototype.a.call(this)};qI.prototype.write=function(a){Y.prototype.write.call(this,a);bI(a,0);_.Ek(a,this.g);a.getPosition()};_.w(rI,X);rI.prototype.a=function(){return 8+X.prototype.a.call(this)};
|
|
50
|
+
rI.prototype.write=function(a){X.prototype.write.call(this,a);_.T(a,0);bI(a,0);bI(a,1)};_.w(sI,rI);sI.prototype.a=function(){return 70+rI.prototype.a.call(this)};sI.prototype.write=function(a){rI.prototype.write.call(this,a);bI(a,0);bI(a,0);_.T(a,0);_.T(a,0);_.T(a,0);bI(a,this.width);bI(a,this.height);_.T(a,4718592);_.T(a,4718592);_.T(a,0);bI(a,1);$H(a,10);_.Ek(a,eI("AVC Coding",31));bI(a,this.depth);dI(a,-1)};_.w(tI,rI);tI.prototype.a=function(){return 20+rI.prototype.a.call(this)};
|
|
51
|
+
tI.prototype.write=function(a){rI.prototype.write.call(this,a);_.T(a,0);_.T(a,0);bI(a,this.channelCount);bI(a,this.sampleSize);dI(a,0);bI(a,0);bI(a,this.sampleRate);bI(a,0)};_.w(uI,sI);uI.prototype.write=function(a){sI.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(vI,uI);_.w(wI,tI);wI.prototype.write=function(a){tI.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.w(xI,wI);_.w(yI,X);
|
|
52
|
+
yI.prototype.a=function(){for(var a=7,b=0;b<this.Ta.length;b++)a+=2,a+=this.Ta[b].byteLength;for(b=0;b<this.Ta.length;b++)a+=2,a+=this.Ub[b].byteLength;return a+X.prototype.a.call(this)};
|
|
53
|
+
yI.prototype.write=function(a){X.prototype.write.call(this,a);$H(a,this.version);$H(a,this.g);$H(a,this.j);$H(a,this.level);$H(a,255);$H(a,224|this.Ta.length);for(var b=0;b<this.Ta.length;b++)bI(a,this.Ta[b].length),_.Ek(a,this.Ta[b]);$H(a,this.Ub.length);for(b=0;b<this.Ub.length;b++)bI(a,this.Ub[b].length),_.Ek(a,this.Ub[b]);a.getPosition()};_.w(zI,Y);zI.prototype.a=function(){return 22+(this.Lb.byteLength+3)+Y.prototype.a.call(this)};
|
|
54
|
+
zI.prototype.write=function(a){Y.prototype.write.call(this,a);$H(a,3);$H(a,23+this.Lb.byteLength);bI(a,1);$H(a,0);$H(a,4);$H(a,15+this.Lb.byteLength);$H(a,64);$H(a,21);aI(a,0);_.T(a,0);_.T(a,0);$H(a,5);$H(a,this.Lb.byteLength);_.Ek(a,this.Lb);_.Ek(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(AI,Y);AI.prototype.a=function(){return this.location.length+Y.prototype.a.call(this)};AI.prototype.write=function(a){Y.prototype.write.call(this,a);0<this.location.length&&_.Ek(a,eI(this.location));a.getPosition()};
|
|
55
|
+
_.w(BI,Y);BI.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)};BI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(CI,X);_.w(DI,Y);DI.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
|
+
DI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(EI,Y);EI.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)};EI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(FI,Y);
|
|
57
|
+
FI.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)};FI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(GI,Y);GI.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
|
+
GI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(HI,Y);HI.prototype.a=function(){return 8+Y.prototype.a.call(this)};HI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,0);_.T(a,0);a.getPosition()};_.w(II,Y);II.prototype.a=function(){return 4+Y.prototype.a.call(this)};II.prototype.write=function(a){Y.prototype.write.call(this,a);dI(a,0);bI(a,0);a.getPosition()};
|
|
59
|
+
_.w(JI,X);_.w(KI,X);_.w(LI,X);_.w(MI,Y);MI.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Y.prototype.a.call(this)};MI.prototype.write=function(a){Y.prototype.write.call(this,a);1===this.version?ZH(a,this.g):_.T(a,this.g);a.getPosition()};_.w(NI,Y);NI.prototype.a=function(){return 4+Y.prototype.a.call(this)};NI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);a.getPosition()};_.w(OI,Y);
|
|
60
|
+
OI.prototype.a=function(){var a=4;this.flags&LJ&&(a+=4);this.flags&MJ&&(a+=4);for(var b=0;b<this.g;b++)this.flags&NJ&&(a+=4),this.flags&OJ&&(a+=4),this.flags&PJ&&(a+=4),this.flags&QJ&&(a+=4);return a+Y.prototype.a.call(this)};
|
|
61
|
+
OI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&LJ&&(a.getPosition(),cI(a,this.m));this.flags&MJ&&_.T(a,this.o);for(var b=0;b<this.g;b++)this.flags&NJ&&_.T(a,this.w[b]),this.flags&OJ&&_.T(a,this.sampleSize[b]),this.flags&PJ&&_.T(a,this.B[b]),this.flags&QJ&&(0===this.version?_.T(a,this.j[b]):cI(a,this.j[b]));a.getPosition()};var LJ=1,MJ=4,NJ=256,OJ=512,PJ=1024,QJ=2048;_.w(PI,Y);
|
|
62
|
+
PI.prototype.a=function(){var a=4;this.flags&RJ&&(a+=8);this.flags&SJ&&(a+=4);this.flags&TJ&&(a+=4);this.flags&UJ&&(a+=4);this.flags&VJ&&(a+=4);return a+Y.prototype.a.call(this)};PI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.g);this.flags&RJ&&ZH(a,this.j);this.flags&SJ&&_.T(a,this.B);this.flags&TJ&&_.T(a,this.m);this.flags&UJ&&_.T(a,this.w);this.flags&VJ&&_.T(a,this.o);a.getPosition()};var RJ=1,SJ=2,TJ=8,UJ=16,VJ=32;_.w(QI,X);_.w(RI,X);_.w(SI,X);
|
|
63
|
+
SI.prototype.a=function(){return this.g.byteLength+X.prototype.a.call(this)};SI.prototype.write=function(a){X.prototype.write.call(this,a);0<this.g.byteLength&&_.Ek(a,this.g)};_.w(TI,Y);TI.prototype.a=function(){var a=20;1===this.g&&0===this.j&&(a=a+1+this.m.length);return a+Y.prototype.a.call(this)};
|
|
64
|
+
TI.prototype.write=function(a){Y.prototype.write.call(this,a);$H(a,0);0===this.version?$H(a,0):$H(a,0);$H(a,this.g);$H(a,this.j);_.Ek(a,_.Qh(this.o));if(1===this.g&&0===this.j){$H(a,0);for(var b=0;b<this.m.length;b++)$H(a,this.m[b])}a.getPosition()};_.w(UI,Y);UI.prototype.a=function(){var a=8;this.flags&1&&(a+=eI(this.Gb).byteLength);return a+Y.prototype.a.call(this)};UI.prototype.write=function(a){Y.prototype.write.call(this,a);_.Ek(a,eI(this.g));_.T(a,this.j);this.flags&1&&_.Ek(a,eI(this.Gb));a.getPosition()};
|
|
65
|
+
_.w(VI,X);VI.prototype.a=function(){return eI(this.g).byteLength+X.prototype.a.call(this)};VI.prototype.write=function(a){X.prototype.write.call(this,a);_.Ek(a,eI(this.g));a.getPosition()};_.w(WI,Y);WI.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
|
+
WI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));_.T(a,1);for(var b=0;1>b;b++)0===this.version?_.T(a,this.offset[b]):ZH(a,this.offset[b]);a.getPosition()};_.w(XI,Y);XI.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.m.length);return a+Y.prototype.a.call(this)};
|
|
67
|
+
XI.prototype.write=function(a){Y.prototype.write.call(this,a);this.flags&1&&(_.T(a,0),_.T(a,0));$H(a,this.g);_.T(a,this.j);if(0===this.g)for(var b=0;b<this.j;b++)$H(a,this.m[b]);a.getPosition()};_.w(YI,Y);YI.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.j;b++)if(a+=this.g[b].rg.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Vc;c++)a+=2,a+=4}return a+Y.prototype.a.call(this)};
|
|
68
|
+
YI.prototype.write=function(a){Y.prototype.write.call(this,a);_.T(a,this.j);this.flags&1&&$H(a,this.m);for(var b=0;b<this.j;b++)if(_.Ek(a,this.g[b].rg),this.flags&2){bI(a,this.g[b].Vc);for(var c=0;c<this.g[b].Vc;c++)bI(a,this.g[b].vf[c].Lf),_.T(a,this.g[b].vf[c].Mf)}a.getPosition()};var eJ=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,fJ=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,gJ=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,hJ=/^(\d*\.?\d*)f$/,iJ=/^(\d*\.?\d*)t$/,jJ=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;nJ.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};nJ.prototype.write=function(){this.f=mJ(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var qJ=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.t=wJ.prototype;_.t.configure=function(a){this.f=a};_.t.start=function(a,b){var c=this;this.C=b;var d=_.of(new Set([a,ZI(a)])).concat();return xJ(this,d).then(function(e){return EJ(c,e.data).then(function(){JJ(c,c.A);return c.g})})};_.t.stop=function(){this.C&&this.C.networkingEngine.ee(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
|
+
_.t.update=function(){var a=this;if(this.fd())return xJ(this,[this.m]).then(function(b){return EJ(a,b.data).then(function(){return a.g})})["catch"](function(b){if(a.C)a.C.onError(b)})};_.t.onExpirationUpdated=function(){};_.t.setCurrentVariant=function(){};_.t.Eb=function(){var a=this;this.h.debug(_.mv);this.C&&(this.j=null,this.update().then(function(){JJ(a,a.A)})["catch"](function(b){a.C&&(a.C.onError(b),1===b.severity&&JJ(a,100))}))};_.t.fd=function(){return this.N===AJ};
|
|
70
|
+
_.t.Re=function(){return 0<this.o.length};_.t.lg=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.gl=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.fd.bind(this),Zd:this.Re.bind(this),nj:function(){return 1},Td:this.lg.bind(this)},d=!1,e=new _.L(_.M,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=sJ(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 HJ={video:_.Te,audio:_.qc,text:_.jc},vJ=_.nv,AJ="LIVE",IJ={Al:"caption",Jl:_.ye};_.w(KJ,_.Bo);KJ.prototype.Qa=function(){_.yp.ism=wJ;_.wp[_.kc]=wJ};KJ.prototype.Ha=function(){_.ex("ism");_.fx(_.kc)};KJ.prototype.id=function(){return"smooth"};_.C("clpp.smooth.SmoothComponent",KJ);};
|
|
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));}
|