@castlabs/prestoplay 6.30.0 → 6.31.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 +247 -179
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +19 -7
- package/cjs/cl.cast.js +120 -120
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +567 -566
- package/cjs/cl.crypto.js +10 -10
- package/cjs/cl.dash.js +95 -92
- package/cjs/cl.externs.js +224 -40
- package/cjs/cl.freewheel.js +26 -25
- package/cjs/cl.hls.js +79 -78
- package/cjs/cl.hlssmpte.js +4 -4
- package/cjs/cl.htmlcue.js +19 -19
- package/cjs/cl.ima.js +26 -25
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +352 -350
- package/cjs/cl.muxdata.js +13 -13
- package/cjs/cl.onboard.js +2 -2
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +10 -10
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +16 -16
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +15 -15
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +12 -12
- package/cjs/cl.vtt.js +12 -12
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +35 -35
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +14 -6
- package/cl.cast.js +99 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +413 -412
- package/cl.crypto.js +8 -8
- package/cl.dash.js +87 -84
- package/cl.externs.js +225 -37
- package/cl.freewheel.js +20 -19
- package/cl.hls.js +76 -76
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +20 -19
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +299 -300
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +62 -60
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +31 -31
- package/package.json +8 -7
- package/typings.d.ts +85 -61
package/cjs/cl.muxdata.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var fB=function(a){switch(a.type){case 1:return cB;case 2:return dB;case 3:return eB}},hB=function(a){var b=Object.keys(a).find(function(c){return gB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},iB=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.wi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.
|
|
3
|
-
data:jB(a)};a.f&&a.f.muxOptionsOverride&&_.
|
|
4
|
-
f.video_source_url=_.
|
|
2
|
+
var f=function(window){var fB=function(a){switch(a.type){case 1:return cB;case 2:return dB;case 3:return eB}},hB=function(a){var b=Object.keys(a).find(function(c){return gB.includes(c.toLowerCase())});return void 0!==b?a[b]:void 0},iB=function(a,b){this.m=a;this.o=this.f=null;this.B=("000000"+(Math.random()*Math.pow(36,6)<<0).toString(36)).slice(-6);this.a=new _.wi;this.g=b;this.A=this.l=this.h=!1;this.w=null;this.j=a.getNetworkEngine();this.G=this.vl.bind(this);this.D=this.ul.bind(this)},kB=function(a){var b={debug:!0,
|
|
3
|
+
data:jB(a)};a.f&&a.f.muxOptionsOverride&&_.N.Fd(a.f.muxOptionsOverride)&&(b=_.N.ta(b,a.f.muxOptionsOverride));b=_.N.ta(b,{getPlayheadTime:function(){return 1E3*a.m.getPosition()},getStateData:function(){a.g.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 _.vn(c.url);
|
|
4
|
+
f.video_source_url=_.wn(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().sa(),c={videoWidth:c.width,videoHeight:c.height});e=c;c=e.videoWidth;e=e.videoHeight;a.g.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
5
|
d.language);return f}});a.g.debug("Mux SDK options",b);return b},jB=function(a){var b={env_key:a.f.envKey,video_title:a.o&&a.o.name||"",player_name:_.ya,player_software_name:_.ya,player_software_version:_.ia,player_mux_plugin_name:"CastlabsPlayer built-in Mux Plugin",player_mux_plugin_version:_.ia};(a=a.m.getConfiguration().viewerId)&&(b.viewer_user_id=a);return b},lB=function(a){a.a.on(a.m,_.zg,function(){var b={player_playhead_time:1E3*a.m.getPosition()};a.emit(_.zg,b)});a.a.on(a.m,_.pf,function(){return a.emit(_.pf)});
|
|
6
|
-
a.a.on(a.m,_.ad,a.
|
|
7
|
-
_.Cc,function(){return a.emit("adended")});a.a.on(a.m,_.oc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.wc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Dc,function(){return a.emit("adthirdquartile")});a.j.
|
|
8
|
-
request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.
|
|
9
|
-
b)}})},mB=function(a){_.zi(a.a);a.j.
|
|
10
|
-
_.r.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.r.
|
|
11
|
-
_.r.
|
|
12
|
-
_.r.
|
|
13
|
-
request_url:_.
|
|
14
|
-
_.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.
|
|
15
|
-
var
|
|
6
|
+
a.a.on(a.m,_.ad,a.rl.bind(a));a.a.on(a.m,_.ig,a.tl.bind(a));a.a.on(a.m,_.Ng,function(){return a.emit(_.ag)});a.a.on(a.m,_.Mg,function(){return a.emit(_.$f)});a.a.on(a.m,_.qe,a.sl.bind(a));a.a.on(a.m,_.jc,function(){return a.emit("adbreakstart")});a.a.on(a.m,_.kc,function(){return a.emit("adbreakend")});a.a.on(a.m,_.Bc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,_.xc,function(){return a.emit("adpause")});a.a.on(a.m,_.zc,function(){a.emit("adplay");a.emit("adplaying")});a.a.on(a.m,
|
|
7
|
+
_.Cc,function(){return a.emit("adended")});a.a.on(a.m,_.oc,function(){return a.emit("adfirstquartile")});a.a.on(a.m,_.wc,function(){return a.emit("admidpoint")});a.a.on(a.m,_.Dc,function(){return a.emit("adthirdquartile")});a.j.Ud(a.G);a.j.Ah(a.D);a.a.on(a.m,_.qe,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 _.vn(b.uris[b.uriIndex]);b={request_start:c,request_type:fB(b),
|
|
8
|
+
request_hostname:d.a};a.g.debug("onRequestCanceled()","Track event: requestcanceled",b);a.emit("requestcanceled",b)}else{d=b.requestStartTimestamp;var e=new _.vn(b.uris[b.uriIndex]),f=c.data;b={request_start:d,request_type:fB(b),request_hostname:e.a,request_error:""+fB(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.g.debug("onRequestFailed()","Track event: requestfailed",b);a.emit("requestfailed",
|
|
9
|
+
b)}})},mB=function(a){_.zi(a.a);a.j.Vf(a.G);a.j.Fj(a.D)},nB=function(){this.f=this.m=null;this.a=!1;this.g=new _.M("clpp.muxdata")},oB=function(a){return!_.N.R(a)&&typeof a.init===_.ue&&typeof a.emit===_.ue},pB=function(a,b){a.trigger(new _.Q(_.qe,{detail:b}))},qB=function(){},cB="manifest",dB="media",eB="encryption",gB=["x-request-id","cf-ray","x-amz-cf-id","x-akamai-request-id"];_.r=iB.prototype;_.r.initialize=function(a,b,c){this.f=a;this.o=b;this.w=c;if(!this.h){try{this.h=!0,this.w.init(this.B,kB(this))}catch(d){throw this.h=!1,mB(this),new _.O(1,9,9302,null,d);}this.emit("playerready")}this.l&&!this.A&&(a=jB(this),this.emit("videochange",a),this.l=!1);lB(this)};_.r.release=function(){this.g.debug("release()");this.l?this.g.debug(_.ma):(mB(this),this.l=!0,this.o=this.f=null)};_.r.destroy=function(){this.g.debug(_.Vd);this.A?this.g.debug(_.la):(this.A=!0,this.emit("destroy"))};
|
|
10
|
+
_.r.emit=function(a,b){if(null===this.w)throw new _.O(1,9,9301);this.w.emit(this.B,a,b)};_.r.rl=function(a){this.g.debug(_.af);var b=a.detail;a=this.m.getTrackManager();b&&b.bandwidth&&(b=b.bandwidth,(a=a.Za())&&a.bandwidth&&(b+=a.bandwidth),this.emit("renditionchange",{video_source_bitrate:b}))};_.r.tl=function(a){this.g.debug(_.ff);switch(a.detail.currentState){case 1:this.m.getConfiguration().autoplay&&this.emit(_.pf);break;case 3:this.emit(_.Af);break;case 4:this.emit(_.lf);break;case 5:this.emit(_.pe)}};
|
|
11
|
+
_.r.sl=function(a){this.g.debug(_.cf);if(this.h&&(a=a.detail||null))if(10003===a.code)this.emit("aderror");else if(a.severity===_.P){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);this.emit(_.qe,{player_error_code:a.code,player_error_message:b})}};
|
|
12
|
+
_.r.vl=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,k=e+a.responseStartMs;a=e+a.timeMs;f=f&&g?g-f:void 0;g=new _.vn(b.uris[b.uriIndex]);a={request_start:e,request_type:fB(b),request_hostname:g.a,request_id:hB(c),request_bytes_loaded:d,request_response_start:k,request_response_end:a,request_response_headers:c,request_media_duration:f,
|
|
13
|
+
request_url:_.wn(g)};this.g.debug("onRequestCompleted()","Track event: requestcompleted",a);this.emit("requestcompleted",a)}};_.r.ul=function(a){a.requestStartTimestamp=Date.now()};_.w(nB,_.Yv);_.r=nB.prototype;_.r.onPlayerCreated=function(a){this.m=a;this.f=new iB(a,this.g)};
|
|
14
|
+
_.r.onContentWillLoad=function(a,b){var c=a.getConfiguration();c=_.N.wb(c.muxdata);try{var d=[];typeof c===_.$e&&(c.envKey||d.push("envKey"));if(0<d.length)throw new _.O(1,9,9300,{missingKeys:d});var e=a.getConfiguration();d=null;if(this.a=!_.N.R(e.muxdata)&&typeof e.muxdata===_.$e){var f=e.muxdata;d=oB(f.muxLib)?f.muxLib:window.mux;if(!oB(d)){this.g.warn("Mux SDK is not loaded. Will do nothing.");this.a=!1;var g=new _.O(1,9,9301);pB(a,g)}}else this.g.debug("Mux plugin is loaded but not configured. Will do nothing.");
|
|
15
|
+
var k=d;null!==k&&this.f.initialize(c,b,k)}catch(l){this.a=!1,pB(a,l)}};_.r.onContentLoaded=function(){};_.r.onPlayerWillDestroy=function(){this.a&&(this.f.destroy(),this.m=this.f=null)};_.r.onPlayerWillRelease=function(){this.a&&this.f.release()};_.r.id=function(){return"mux"};_.r.emit=function(a,b){try{this.f.emit(a,b)}catch(c){throw null!==this.m&&pB(this.m,c),c;}};_.K("clpp.muxdata.MuxDataPlugin",nB);nB.prototype.emit=nB.prototype.emit;nB.Id="mux";qB.prototype.create=function(){return new nB};_.bp(new qB);};
|
|
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.onboard.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var aB=function(){this.g=new _.
|
|
3
|
-
serverCertificate:_.aq(
|
|
2
|
+
var f=function(window){var aB=function(){this.g=new _.M("clpp.onboard");this.a=new Set},bB=function(a,b){function c(n){return n&&(_.R.startsWith(n,_.ze)||_.R.startsWith(n,"http://")||_.R.startsWith(n,"//"))?n:d+n}var d=b.baseUrl;_.R.endsWith(d,"/")||(d+="/");var e=c(b.widevineUrl||"widevine"),f=c(b.playreadyUrl||"playready"),g=c(b.fairplayUrl||"fairplay"),k=b.serverCertificate,l=_.Zp("V2"),m=new _.$p(a);m.qb(_.Md,{licenseUrl:e,videoRobustness:[_.Db,void 0],audioRobustness:[_.Cb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,
|
|
3
|
+
serverCertificate:_.aq(k,l),modifiers:{licenseRequest:_.Rq,licenseResponse:_.Wq}});m.qb(_.Id,{licenseUrl:g,certificateUrl:g,modifiers:{licenseRequest:_.Tq,licenseResponse:_.Uq,extractContentId:_.Pq,certificateRequest:_.Vq}});m.qb(_.Kd,{licenseUrl:f,modifiers:{licenseRequest:_.Rq}});_.Vn(m)};_.w(aB,_.av);aB.prototype.uninstall=function(){for(var a=_.v(this.a),b=a.next();!b.done;b=a.next())delete _.Un[b.value];this.a.clear()};
|
|
4
4
|
aB.prototype.beforeLoad=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,serverCertificate:a.serverCertificate,playreadyUrl:a.playreadyUrl,fairplayUrl:a.fairplayUrl},this.g.info("Registering the DRMtoday Onboard environment, name\x3d'"+b+"'"),bB(b,a),this.a.add(b))};aB.prototype.id=function(){return"onboard"};_.K("clpp.onboard.OnboardComponent",aB);
|
|
5
5
|
_.K("clpp.onboard.register",bB);};
|
|
6
6
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
package/cjs/cl.persistent.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var KA="A persistent DRM session already exists for: ",LA="No DRM configuration.",MA="clpp.persistent",NA="clpp.persistent.SimpleSessionStorage",OA=function(a){var b=[];a=_.v(a.h.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value.sessionId);return b},PA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.ws(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.h.get(c))&&a.
|
|
3
|
-
b);d.push(c.remove());return f["return"](Promise.all(d))})},RA=function(a,b){a.L=QA;a.
|
|
4
|
-
g)},UA=function(){this.g=new _.
|
|
5
|
-
|
|
6
|
-
m=b.map(function(t){return{contentType:_.
|
|
2
|
+
var f=function(window){var KA="A persistent DRM session already exists for: ",LA="No DRM configuration.",MA="clpp.persistent",NA="clpp.persistent.SimpleSessionStorage",OA=function(a){var b=[];a=_.v(a.h.keys());for(var c=a.next();!c.done;c=a.next())b.push(c.value.sessionId);return b},PA=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return _.x(f,_.ws(a,b),2);c=f.f;if(!c)return a.g.debug("Ignoring attempt to remove missing session",b),f["return"]();d=[];(e=a.h.get(c))&&a.D&&(e.Hc=new _.nm,d.push(e.Hc));a.g.debug("Attempting to remove session",
|
|
3
|
+
b);d.push(c.remove());return f["return"](Promise.all(d))})},RA=function(a,b){a.L=QA;a.M=[];a.H=!0;return _.Zr(a,b)},TA=function(a,b,c,d,e,f){a.L=SA;var g=new Map,k=_.Bs(b);g.set(k,{audioCapabilities:e,videoCapabilities:f,distinctiveIdentifier:_.hf,persistentState:_.Sf,sessionTypes:[_.nf],label:k,drmInfos:[{keySystem:b,licenseServerUri:c,distinctiveIdentifierRequired:!1,persistentStateRequired:!0,audioRobustness:"",videoRobustness:"",serverCertificate:d,initData:null,keyIds:null}]});return _.is(a,
|
|
4
|
+
g)},UA=function(){this.g=new _.M(NA)},VA=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}},WA=function(a,b){var c=_.Xn(a),d=_.Nn([{drm:a}]);d.drm=a;var e=new _.Vr({Kb:b,onError:function(){},Pg:function(){},
|
|
5
|
+
Og:function(){},onEvent:function(){},getConfiguration:function(){return d},yd:function(){return null}});e.f=c;return e},ZA=function(a,b,c){var d,e,f,g,k,l,m,n,p;return _.I(function(q){switch(q.a){case 1:d=XA;e=YA;if(!a)return e.debug(LA),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(KA,f),q["return"]();k=WA(a,c);_.F(q,3,4);return _.x(q,RA(k,b),6);case 6:return _.x(q,_.ps(k),7);case 7:return _.x(q,_.qs(k),8);case 8:return l=k.getDrmInfo(),
|
|
6
|
+
m=b.map(function(t){return{contentType:_.En(t.video.mimeType,t.video.codecs),robustness:l.videoRobustness}}),n=OA(k),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 _.Eh(q),_.x(q,k.destroy(),10);case 10:_.Fh(q);break;case 3:throw p=_.H(q),e.error("Error while persisting DRM session "+f),new _.O(1,6,6200,null,p);}})},$A=function(){this.g=new _.M(MA)},
|
|
7
7
|
QA=1,SA=2;_.r=UA.prototype;
|
|
8
|
-
_.r.store=function(a,b){var c;return _.I(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),
|
|
9
|
-
_.
|
|
10
|
-
_.K("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,
|
|
11
|
-
[];u=_.v(d);for(y=u.next();!y.done;y=u.next())
|
|
12
|
-
new _.O(_.P,4,4014));
|
|
13
|
-
_.K("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,
|
|
14
|
-
6);case 6:return _.x(l,_.ps(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,PA(d,m),2);c.debug("successfully removed session with id",m);_.
|
|
15
|
-
_.K("clpp.persistent.getSessionStorage",function(){return XA});var XA=new UA,YA=new _.
|
|
8
|
+
_.r.store=function(a,b){var c;return _.I(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),k=JSON.stringify(b.videoCapabilities);c=JSON.stringify({sessionIds:e,keySystem:b.keySystem,licenseServerUri:encodeURIComponent(b.licenseServerUri),serverCertificate:f,audioCapabilities:g,videoCapabilities:k,drmConfig:JSON.stringify(b.drmConfig)});window.localStorage.setItem(encodeURIComponent(a),btoa(c));
|
|
9
|
+
_.A(d)})};_.r.get=function(a){var b=this,c;return _.I(function(d){if(c=window.localStorage.getItem(encodeURIComponent(a)))try{return d["return"](VA(atob(c)))}catch(e){b.g.warn("Error while loading offline items for "+a+" from storage: ",e)}return d["return"](null)})};_.r["delete"]=function(a){return _.I(function(b){window.localStorage.removeItem(encodeURIComponent(a));_.A(b)})};_.r.clear=function(){return _.I(function(a){window.localStorage.clear();_.A(a)})};_.r.getName=function(){return NA};_.K("clpp.persistent.useStorage",function(a){var b=["store","get","delete","clear","getName"];var c=[];_.N.R(a)||(_.N.Zb(a.store)||c.push("store"),_.N.Zb(a.get)||c.push("get"),_.N.Zb(a["delete"])||c.push("delete"),_.N.Zb(a.clear)||c.push("clear"),_.N.Zb(a.getName)||c.push("getName"),b=c);if(0<b.length)throw YA.warn("Invalid session storage implementation"),new _.O(1,6,6202,{missingMethods:b});XA=a});
|
|
10
|
+
_.K("clpp.persistent.fetchLicense",function(a,b,c){for(var d=[],e=2;e<arguments.length;++e)d[e-2]=arguments[e];var f,g,k,l,m,n,p,q,t,u,y,C,D,B,E,z,L,J,V;return _.I(function(U){switch(U.a){case 1:f=XA;g=YA;k=function(ta,wa){return new _.O(1,6,6200,ta,wa)};l=_.Rn(a).shift();if(!l)throw k("No source specified.");if(!b)throw k(LA);m=b.offlineId;if(typeof m!==_.lg||!m.length)throw k("Missing offline id.");return _.x(U,f.get(m),2);case 2:if(n=U.f)return g.debug(KA,m),U["return"]();p=_.Ln();q=new _.Xm;t=
|
|
11
|
+
[];u=_.v(d);for(y=u.next();!y.done;y=u.next())C=y.value,D=new C,_.ii(D.id())||(D.install(),_.ki(D),t.push(D));B=null;_.F(U,3,4);return _.x(U,_.Uv(l.url,q,p.manifest.attemptParameters,l.type||null),6);case 6:return B=U.f,B.configure(p.manifest),_.x(U,B.start(l.url,{configurationId:"",networkingEngine:q,onContentSteeringInfoFound:function(){return null},filterAllPeriods:function(){},filterNewPeriod:function(){},onEvent:function(){},onError:function(){}}),7);case 7:E=U.f;if(!E.periods.length)throw k(null,
|
|
12
|
+
new _.O(_.P,4,4014));z=_.mv(E.periods);return _.x(U,ZA(b,z,q),4);case 4:for(_.Eh(U);t.length;)L=t.shift(),L.uninstall(),_.hi["delete"](L.id());J=[];B&&J.push(B.stop());J.push(q.destroy());return _.x(U,Promise.all(J),9);case 9:_.Fh(U);break;case 3:V=_.H(U);if(V instanceof _.O&&6200===V.code)throw V;throw k(null,V);}})});
|
|
13
|
+
_.K("clpp.persistent.removeLicense",function(a){var b,c,d,e,f,g,k;return _.I(function(l){switch(l.a){case 1:b=XA;c=YA;if(!_.N.ja(a)||0===a.length)return c.warn("Invalid offlineId"),l["return"]();e=d=null;_.F(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 _.Xm;d=WA(f.drmConfig,e);return _.x(l,TA(d,f.keySystem,f.licenseServerUri,f.serverCertificate,f.audioCapabilities,f.videoCapabilities),
|
|
14
|
+
6);case 6:return _.x(l,_.ps(d),7);case 7:return _.x(l,Promise.all(f.sessionIds.map(function(m){return _.I(function(n){if(1==n.a)return _.x(n,PA(d,m),2);c.debug("successfully removed session with id",m);_.A(n)})})),8);case 8:return _.x(l,b["delete"](a),3);case 3:return _.Eh(l),g=[],d&&g.push(d.destroy()),e&&g.push(e.destroy()),_.x(l,Promise.all(g),10);case 10:_.Fh(l);break;case 2:throw k=_.H(l),c.error("Failed to remove session"),new _.O(1,6,6201,null,k);}})});
|
|
15
|
+
_.K("clpp.persistent.getSessionStorage",function(){return XA});var XA=new UA,YA=new _.M(MA);_.w($A,_.av);$A.prototype.id=function(){return _.mf};$A.prototype.f=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().drm;if(!d)return c.g.debug("No DRM configuration found for loaded source."),g["return"]();c.g.debug("Persisting DRM session ID: "+d.offlineId);e=a.getNetworkEngine();_.F(g,2);return _.x(g,ZA(d,b,e),4)}if(2!=g.a)return a.trigger(new _.Q(_.he,{offlineId:d.offlineId})),_.G(g,0);f=_.H(g);a.onError(f);_.A(g)})};
|
|
16
16
|
$A.prototype.a=function(a){var b=this,c,d;return _.I(function(e){if(1==e.a)return b.g.debug("Getting EME session IDs for "+a),c=XA,_.F(e,2),_.x(e,c.get(a),4);if(2!=e.a){if(d=e.f)return e["return"](d.sessionIds||[]);b.g.debug("No offline session found for "+a);return e["return"]([])}_.H(e);b.g.warn("Error while loading session info from storage");return e["return"]([])})};_.K("clpp.persistent.PersistentLicenseComponent",$A);};
|
|
17
17
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
18
18
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
package/cjs/cl.playlist.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var HA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Di.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.
|
|
3
|
-
_.r.
|
|
4
|
-
_.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.
|
|
5
|
-
_.r.
|
|
6
|
-
_.r.remove=function(a){if(0<this.a.length&&JA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);IA(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;IA(this)};_.K("clpp.Playlist",HA);HA.prototype.clear=HA.prototype.clear;HA.prototype.remove=HA.prototype.remove;HA.prototype.insert=HA.prototype.
|
|
7
|
-
HA.prototype.onEnded=HA.prototype.
|
|
2
|
+
var f=function(window){var HA=function(a,b){b=void 0===b?function(){return Promise.resolve()}:b;_.Di.call(this);this.m=a;this.l=b;this.f=0;this.a=[];this.h=!1;this.j=this.Ja.bind(this)},IA=function(a){a.trigger(new _.Q(_.Cf))},JA=function(a,b){return 0<=b&&b<a.a.length};_.w(HA,_.Di);_.r=HA.prototype;_.r.on=function(a,b,c){return _.Di.prototype.on.call(this,a,b,c)};_.r.one=function(a,b,c){return _.Di.prototype.one.call(this,a,b,c)};_.r.off=function(a,b){return _.Di.prototype.off.call(this,a,b)};_.r.getPosition=function(){return this.f};
|
|
3
|
+
_.r.pe=function(){return this.a};_.r.Tb=function(){return 0<this.a.length&&JA(this,this.f)?this.a[this.f]:null};_.r.Ji=function(){var a=this.f+1;return 0<this.a.length&&JA(this,a)?this.a[a]:null};_.r.Ig=function(){return this.h};_.r.start=function(){this.h||(this.h=!0,this.m.on(_.pe,this.j),this.Cd(this.f,!0))};_.r.stop=function(){this.h=!1;this.m.off(_.pe,this.j)};_.r.Ja=function(){this.next()};
|
|
4
|
+
_.r.next=function(){var a=this,b;return _.I(function(c){b=Math.min(a.a.length-1,a.f+1);return _.x(c,a.Cd(b),0)})};_.r.Ke=function(){var a=this,b;return _.I(function(c){b=Math.max(0,a.f-1);return _.x(c,a.Cd(b),0)})};
|
|
5
|
+
_.r.Cd=function(a,b){b=void 0===b?!1:b;var c=this,d;return _.I(function(e){if(1==e.a){if(!(0<c.a.length&&JA(c,a))||!b&&c.f===a)return e["return"]();c.f=a;return(d=c.Tb())&&!1===d.skippable?e["return"]():d?_.x(e,c.l(d),3):e.C(0)}if(4!=e.a)return _.x(e,c.m.load(d.configuration),4);c.trigger(new _.Q(_.Bf,{item:d}));_.A(e)})};_.r.append=function(a){this.a.push(a);IA(this)};_.r.Oi=function(a,b){if(0<=b&&b<=this.a.length){var c=this.Tb();this.a.splice(b,0,a);c&&(this.f=this.a.indexOf(c));IA(this)}};
|
|
6
|
+
_.r.remove=function(a){if(0<this.a.length&&JA(this,a)){if(this.f===a)throw Error("Can't remove the current item");this.a.splice(a,1);IA(this)}};_.r.clear=function(){this.stop();this.f=0;this.a=[];this.h=!1;IA(this)};_.K("clpp.Playlist",HA);HA.prototype.clear=HA.prototype.clear;HA.prototype.remove=HA.prototype.remove;HA.prototype.insert=HA.prototype.Oi;HA.prototype.append=HA.prototype.append;HA.prototype.goTo=HA.prototype.Cd;HA.prototype.previous=HA.prototype.Ke;HA.prototype.next=HA.prototype.next;
|
|
7
|
+
HA.prototype.onEnded=HA.prototype.Ja;HA.prototype.stop=HA.prototype.stop;HA.prototype.start=HA.prototype.start;HA.prototype.isStarted=HA.prototype.Ig;HA.prototype.getUpcoming=HA.prototype.Ji;HA.prototype.getCurrent=HA.prototype.Tb;HA.prototype.getQueue=HA.prototype.pe;HA.prototype.getPosition=HA.prototype.getPosition;HA.prototype.off=HA.prototype.off;HA.prototype.one=HA.prototype.one;HA.prototype.on=HA.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.simid.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
2
|
var f=function(window){var pA="No surface found. Can not attach frame!",qA="SIMID:Media:timeupdate",rA="Starting creative",wA=function(a,b){var c=this;this.f=a;this.w=b;this.h="";this.l=0;this.j=new Map;this.a=document.createElement("iframe");this.a.style.opacity="0";var d=this.w.style;d.className?this.a.classList.add(d.className):(this.a.style.border=_.Ze,this.a.style.backgroundColor="transparent",this.a.style.transition="opacity .5s",this.a.style.transitionDelay=".5s",this.a.style.pointerEvents=_.Ze,this.a.style.overflow=
|
|
3
3
|
_.we);this.a.classList.add(_.sd);this.o=function(e){if(e.source===c.a.contentWindow&&(e=(e=e.data)?typeof e===_.lg?JSON.parse(e):e:null))if(e.type)switch(c.g.info("Received message ["+e.messageId+"] '"+e.type+"':",e.args),e.type){case "createSession":sA(c,e);break;case "resolve":e=e.args;var f=c.j.get(e.messageId);f&&f.resolve(e);break;case "reject":e=e.args;(f=c.j.get(e.messageId))&&f.reject(e);break;case "SIMID:Creative:requestResize":f=c.f;var g=e.args;f.g.info("Creative requested resize",g);if(f.m&&
|
|
4
|
-
f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var
|
|
5
|
-
g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);uA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.
|
|
4
|
+
f.m.getSurface()&&f.m.getSurface().getMedia()&&g.mediaDimensions){f.h?f.m.getSurface().getMedia().style.transition="":(f.m.getSurface().getMedia().style.transition="left .5s, top .5s,width .5s, height .5s",f.h=!0);var k=tA(f,g.mediaDimensions);f.m.getSurface().getMedia().style.left=k.left;f.m.getSurface().getMedia().style.top=k.top;f.m.getSurface().getMedia().style.width=k.width;f.m.getSurface().getMedia().style.height=k.height}g.creativeDimensions&&(g=tA(f,g.creativeDimensions),f.a.a.style.left=
|
|
5
|
+
g.left,f.a.a.style.top=g.top,f.a.a.style.width=g.width,f.a.a.style.height=g.height);uA(c,e)}else c.g.warn("WARNING: received message without 'type' property")};this.g=new _.M("clpp.simid.SimidPlayer");vA(this.f,this)},zA=function(a){var b=xA(a,"SIMID:Player:startCreative",void 0);yA(a,b).then(function(){var c=a.f;c.g.info(rA);c.m.trigger(new _.Q(_.cg));a.a.style.opacity="1"})["catch"](function(c){a.unload();a.f.g.error("Error while starting creative",c)})},sA=function(a,b){var c;_.I(function(d){if(1==
|
|
6
6
|
d.a){a.h=b.sessionId;uA(a,b);_.F(d,2);var e=a.f;var f=e.getSurface(),g=e.getContainer();e={environmentData:{videoDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},creativeDimensions:{x:0,y:0,height:g.clientHeight,width:g.clientWidth},fullscreen:f.isFullscreen(),fullscreenAllowed:!0,variableDurationAllowed:!1,skippableState:"notSkippable",version:"1.1",skipoffset:"",siteUrl:window.location.toString(),appId:"",useragent:"",deviceId:"",muted:e.m.isMuted()||!1,volume:e.m.getVolume()||0,navigationSupport:"adHandles",
|
|
7
|
-
closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=xA(a,"SIMID:Player:init",e);e=yA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.
|
|
7
|
+
closeButtonSupport:"adHandles",nonlinearDuration:e.f.duration},creativeData:{adParameters:e.f.adParameters||"",clickThruUri:"",clickThruUrl:""}};e=xA(a,"SIMID:Player:init",e);e=yA(a,e);return _.x(d,e,4)}if(2!=d.a)return a.g.info("Player Init acknowledged"),a.f.g.info("SIMID Player initialized"),_.G(d,0);c=_.H(d);a.g.error("Error while initializing",c);a.f.g.error("Error while initializing SIMID player: ",c);a.unload();_.A(d)})},xA=function(a,b,c){return{type:b,sessionId:a.h,messageId:a.l++,timestamp:Date.now(),
|
|
8
8
|
args:c}},AA=function(a,b){a.h?(b.type!==qA&&a.g.info("Posting message ["+b.messageId+"] '"+b.type+"':",b.args),a.a.contentWindow&&a.a.contentWindow.postMessage(JSON.stringify(b),"*")):a.g.warn("WARNING: no session available to send message '"+b.type+"'")},uA=function(a,b){AA(a,xA(a,"resolve",{messageId:b.messageId,value:void 0}))},yA=function(a,b){return new Promise(function(c,d){new BA(a.j,c,d,b);AA(a,b)})},BA=function(a,b,c,d){var e=this;var f=void 0===f?-1:f;this.f=a;this.l=b;this.j=c;this.h=d;
|
|
9
|
-
this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},CA=function(){this.g=new _.
|
|
10
|
-
e);AA(d,e)}})},EA=function(a){this.m=a;this.a=null;this.g=new _.
|
|
9
|
+
this.a=null;this.f.set(d.messageId,this);0<=f&&(this.a=setTimeout(function(){e.resolve()},f))},CA=function(){this.g=new _.M("clpp.simid.Plugin");this.h=this.a=this.m=null;this.l=[];this.j=null;this.w=this.xl.bind(this);this.f=null;this.o=!1},DA=function(a,b,c){return new ResizeObserver(function(){if(a.a.h){var d=a.a,e={videoDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},creativeDimensions:{x:0,y:0,height:b.clientHeight,width:b.clientWidth},fullscreen:c.isFullscreen()};e=xA(d,"SIMID:Player:resize",
|
|
10
|
+
e);AA(d,e)}})},EA=function(a){this.m=a;this.a=null;this.g=new _.M("clpp.simid.Loader");this.h=!1;this.f=null},tA=function(a,b){var c=a.getContainer(),d=c.clientWidth;c=c.clientHeight;return{top:b.y/c*100+"%",left:b.x/d*100+"%",width:b.width/d*100+"%",height:b.height/c*100+"%"}},vA=function(a,b){a.g.info("SIMID Session created");a.a=b},FA=function(a){a.g.info("Stopping creative");a.m.getSurface().getMedia().style.transition=".5s";setTimeout(function(){a.m.getSurface().getMedia().style.transition=""},
|
|
11
11
|
500);a.m.getSurface().getMedia().style.left="";a.m.getSurface().getMedia().style.top="";a.m.getSurface().getMedia().style.width="";a.m.getSurface().getMedia().style.height="";a.a.a.style.left="";a.a.a.style.top="";a.a.a.style.width="";a.a.a.style.height="";a.h=!1;a.m.trigger(new _.Q(_.dg))},GA=function(){};
|
|
12
|
-
wA.prototype.load=function(a){window.addEventListener(_.
|
|
13
|
-
BA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};BA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(CA,_.
|
|
12
|
+
wA.prototype.load=function(a){window.addEventListener(_.Re,this.o);this.h="";this.l=0;var b=this.f.url();this.g.info('Loading "'+b+'" as src of iFrame');this.a.src=b;this.g.info("Attaching iFrame");a.appendChild(this.a)};wA.prototype.unload=function(){FA(this.f);this.h=this.a.src="";this.l=0;this.a.style.opacity="0";window.removeEventListener(_.Re,this.o);this.a.parentElement&&this.a.parentElement.removeChild(this.a)};
|
|
13
|
+
BA.prototype.resolve=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.l(a)};BA.prototype.reject=function(a){null!==this.a&&(clearTimeout(this.a),this.a=null);this.f["delete"](this.h.messageId);this.j(a)};_.w(CA,_.Yv);_.r=CA.prototype;_.r.id=function(){return"simid"};_.r.onPlayerCreated=function(a){this.g.info("New player created");this.a&&(this.a.unload(),this.a=null);this.m=a;this.h&&this.h.release();this.h=new EA(a)};
|
|
14
14
|
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.simid&&b.simid.creatives&&0!==b.simid.creatives.length){this.l=b.simid.creatives;this.g.info("Setting up SIMID plugin for "+this.l.length+" creatives");var c=this.m.getSurface();c?(this.g.info("Creating new session"),this.a=new wA(this.h,b.simid),b=c.getContainer(),this.j=DA(this,b,c),this.j.observe(b),a.on(_.zg,this.w)):this.g.warn(pA)}};
|
|
15
|
-
_.r.
|
|
16
|
-
b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.
|
|
17
|
-
_.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.r.
|
|
15
|
+
_.r.xl=function(){var a=this.m.getPosition();a:if(this.f&&a<this.f.startTime+this.f.duration)var b=this.f;else{for(b=0;b<this.l.length;b++){var c=this.l[b],d=c.startTime+c.duration;if(a>=c.startTime-(c.preload||5)&&a<d){b=c;break a}}b=null}b?b===this.f?(b=b.startTime,this.a&&(c=a>=b,!this.o&&c&&(zA(this.a),this.o=!0,this.g.info(rA)),c&&(c=this.a,AA(c,xA(c,qA,{currentTime:a-b}))))):((a=this.m.getSurface())||this.g.warn(pA),a=a.getContainer(),this.f=b,this.o=!1,this.g.info("Loading session"),this.h.f=
|
|
16
|
+
b,this.a.load(a)):this.f&&(this.a.unload(),this.f=null,this.o=!1)};_.r.onPlayerWillRelease=function(a){_.Yv.prototype.onPlayerWillRelease.call(this,a);this.m.getSurface()&&(this.j&&(this.j.disconnect(),this.j=null),a.off(_.zg,this.w),this.f&&(this.a.unload(),this.f=this.h.f=null))};_.r=EA.prototype;_.r.release=function(){this.g.info("Releasing loader")};
|
|
17
|
+
_.r.getContainer=function(){var a=this.getSurface().getContainer();if(!a)throw this.g.error("No player container found. Can not create SIMID init data"),new _.O(1,10,10100,"No player container found");return a};_.r.getSurface=function(){var a=this.m.getSurface();if(!a)throw this.g.error("No player surface found. Can not create SIMID init data"),new _.O(1,10,10100,"No surface");return a};_.r.Hi=function(){return this.a};_.r.url=function(){return this.f?this.f.url:""};GA.prototype.create=function(){return new CA};_.bp(new GA);};
|
|
18
18
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
19
19
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
20
20
|
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.h),a.a+=2}catch(c){_.cq()}},
|
|
4
|
-
b,c,d,e){Z.call(this,a,b,c);this.f=d;this.offset=e},
|
|
5
|
-
1,7);this.h=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.f=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},
|
|
6
|
-
|
|
7
|
-
a},
|
|
8
|
-
"tfdt",a,0);this.baseMediaDecodeTime=b},
|
|
9
|
-
function(a,b){Z.call(this,"schm",0,0);this.f=a;this.h=b;this.
|
|
10
|
-
String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.
|
|
11
|
-
|
|
12
|
-
b,c){var d=null;if(
|
|
13
|
-
d);return b+":"+c+":"+a+"."+d},
|
|
14
|
-
"Could not get default Key ID for DRM init data!");d=null}c=new
|
|
15
|
-
a.duration),
|
|
16
|
-
g=(new
|
|
17
|
-
if(null===m.flags)throw new _.O(_.P,3,3019,
|
|
18
|
-
var p=new
|
|
19
|
-
m.version||0,m.flags||0,n,0)}).
|
|
20
|
-
(_.Qh(
|
|
21
|
-
e.documentElement;if(
|
|
22
|
-
p.getAttribute(
|
|
23
|
-
new
|
|
24
|
-
this.
|
|
25
|
-
c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.
|
|
26
|
-
Infinity,q=c
|
|
27
|
-
keyId:B,periodId:null},[B]));y.push(
|
|
28
|
-
_.yb),
|
|
29
|
-
|
|
30
|
-
{id:
|
|
31
|
-
isNaN(
|
|
32
|
-
|
|
33
|
-
thumbStreams:[]};var
|
|
34
|
-
a.
|
|
35
|
-
l.
|
|
36
|
-
f.
|
|
37
|
-
(
|
|
38
|
-
label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.
|
|
39
|
-
1],a.J=Math.min(a.J,e),0===a.a.
|
|
40
|
-
0),e=c?c.language:_.Hg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},
|
|
41
|
-
a.l=null,a.B=null);a.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Z.prototype.write=function(a){
|
|
45
|
-
_.w(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
_.w(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_.w(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_.w(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
_.r.update=function(){var a=this;if(this.
|
|
70
|
-
_.r.
|
|
71
|
-
_.r.
|
|
72
|
-
!0,e.data=
|
|
2
|
+
var f=function(window){var KQ="Full MP4 box must have flags defined",LQ="clpp.smooth.SmoothMP4Processor",MQ="codecPrivateData",NQ=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.W(a,c);_.W(a,d)},OQ=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.cq()}},PQ=function(a,b){OQ(a,b>>16&255);OQ(a,b>>8&255);OQ(a,b&255)},QQ=function(a,b){try{a.f.setUint16(a.a,b,a.h),a.a+=2}catch(c){_.cq()}},RQ=function(a,b){try{a.f.setInt32(a.a,b,a.h),a.a+=4}catch(c){_.cq()}},SQ=function(a,b){try{a.f.setInt16(a.a,
|
|
3
|
+
b,a.h),a.a+=2}catch(c){_.cq()}},TQ=function(a,b){for(var c=0;c<a.a.length;++c)if(a.a[c].endTime>b)return a.a.splice(0,c);c=a.a;a.a=[];return c},UQ=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},VQ=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.children=[]},Z=function(a,b,c){VQ.call(this,
|
|
4
|
+
a);this.version=b;this.flags=c},WQ=function(a,b,c){VQ.call(this,a);this.f=b;this.offset=c},XQ=function(a,b,c,d,e){Z.call(this,a,b,c);this.f=d;this.offset=e},YQ=function(a,b,c){VQ.call(this,"ftyp");this.h=a;this.$i=b;this.f=c},ZQ=function(){VQ.call(this,_.We)},$Q=function(){VQ.call(this,_.Bg)},aR=function(a,b,c){Z.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.f=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},bR=function(){VQ.call(this,
|
|
5
|
+
"mvex")},cR=function(a){Z.call(this,"trex",0,0);this.f=a},dR=function(a,b,c,d,e){Z.call(this,"tkhd",1,7);this.h=a;this.duration=b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.f=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},eR=function(a,b){Z.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},fR=function(a){Z.call(this,"hdlr",0,0);this.f=a},gR=function(){Z.call(this,"vmhd",0,1);this.f=new Uint8Array([0,0,0,0,0,0])},hR=function(a){VQ.call(this,
|
|
6
|
+
a);this.w=!0},iR=function(a){hR.call(this,a);this.height=this.width=0;this.depth=24},jR=function(a,b,c,d){hR.call(this,a);this.channelCount=b;this.sampleSize=c;this.sampleRate=d},kR=function(a,b){iR.call(this,"avc1");this.width=a;this.height=b},lR=function(a,b){kR.call(this,a,b);this.type="encv"},mR=function(a,b,c){jR.call(this,"mp4a",a,b,c)},nR=function(a,b,c){mR.call(this,a,b,c);this.type="enca"},oR=function(a,b){VQ.call(this,"avcC");this.rb=a;this.Dc=b;this.version=1;this.f=this.rb[0][1];this.h=
|
|
7
|
+
this.rb[0][2];this.level=this.rb[0][3]},pR=function(a){Z.call(this,"esds",0,0);this.vc=a},qR=function(a){a=void 0===a?"":a;Z.call(this,"url ",0,1);this.location=a},rR=function(){Z.call(this,"dref",0,0)},sR=function(){VQ.call(this,_.kg)},tR=function(){Z.call(this,_.mg,0,0)},uR=function(){Z.call(this,"stts",0,0)},vR=function(){Z.call(this,"stsc",0,0)},wR=function(){Z.call(this,"stco",0,0)},xR=function(){Z.call(this,"stsz",0,0)},yR=function(){Z.call(this,"smhd",0,0)},zR=function(){VQ.call(this,"dinf")},
|
|
8
|
+
AR=function(){VQ.call(this,_.Ve)},BR=function(){VQ.call(this,_.Qe)},CR=function(a,b){Z.call(this,"tfdt",a,0);this.baseMediaDecodeTime=b},DR=function(){Z.call(this,"mfhd",0,0);this.f=0},ER=function(a,b){Z.call(this,"trun",a,b);this.l=this.j=this.f=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},FR=function(a,b){Z.call(this,"tfhd",a,b);this.f=255;this.l=this.o=this.j=this.A=this.h=0},GR=function(){VQ.call(this,"traf")},HR=function(){VQ.call(this,"moof")},IR=function(){VQ.call(this,_.Oe);this.f=
|
|
9
|
+
new Uint8Array(0)},JR=function(){Z.call(this,"tenc",0,0);this.f=1;this.h=8;this.l="";this.j=[]},KR=function(a,b){Z.call(this,"schm",0,0);this.f=a;this.h=b;this.oc=""},LR=function(a){VQ.call(this,"frma");this.f=a},MR=function(){Z.call(this,"saio",0,0);this.offset=[0]},NR=function(a,b,c){Z.call(this,"saiz",0,0);this.f=a;this.j=b;this.h=c},OR=function(a,b){Z.call(this,"senc",a,b);this.h=0;this.j=8;this.f=[]},PR=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?
|
|
10
|
+
a:a+"/Manifest"},QR=function(a,b,c,d){c=b.si[c];b=b.op;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",String(c.t)).replace("{start_time}",String(c.t));return _.xC([a],[b])[0]},RR=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Sg?c=["maxWidth","maxHeight","bitrate",MQ,"fourCC"]:a.type===_.Sc&&(c=["bitrate",MQ,"channels","bitsPerSample","samplingRate","fourCC"]);return _.N.ua(a,b,c,["id","segmentIndex"])},
|
|
11
|
+
SR=function(a,b,c){var d=c.pf.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,rb:null,Dc:null,width:NaN,height:NaN,vc:null,Le:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Sg:a.rb=[_.Mm(d[1])];a.Dc=[_.Mm(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Sc:a.vc=_.Mm(c.pf),a.sampleSize=c.rk||16,a.Le=c.Le,a.channelCount=c.Ph}return a},TR=function(a,b){return a.filter(function(c){return c.type===b})},UR=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:
|
|
12
|
+
(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},bS=function(a,b,c){var d=null;if(VR.test(a)){a=VR.exec(a);d=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 WR.test(a)?d=UR(WR,a):YR.test(a)?d=UR(YR,a):ZR.test(a)?(a=ZR.exec(a),d=Number(a[1])/c.frameRate):$R.test(a)?(a=$R.exec(a),d=Number(a[1])/c.a):aS.test(a)&&(d=UR(aS,a));d+=b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-
|
|
13
|
+
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},cS=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))},eS=function(a){this.a=a;this.f=dS(this)},dS=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.bq(b)},fS=function(a,b,c){a:{var d=
|
|
14
|
+
_.v([_.Md,_.Kd]);for(var e=d.next();!e.done;e=d.next())if((e=c.xf(e.value))&&e.keyId){d=e.keyId;break a}_.Qh(LQ,"Could not get default Key ID for DRM init data!");d=null}c=new VQ("xxxx");a.type===_.Sg?c=new lR(a.width,a.height):c=new nR(a.channelCount,a.sampleSize,a.Le);a=new JR;a.f=1;a.h=8;a.l=d||"00000000000000000000000000000000";a=(new VQ("schi")).append([a]);b=(new VQ(_.eg)).append([new LR(b),new KR(_.ld,65536),a]);c.append([b]);return c},gS=function(a,b){var c=b.zf(),d=new aR(a.timescale,a.duration,
|
|
15
|
+
a.id),e=(new bR).append([new cR(a.id)]),f=new dR(a.id,a.duration,a.timescale,a.width,a.height),g=new eR(a.timescale,a.duration),k=new fR(a.type),l=null,m=new rR;m.entries=[new qR];var n=new tR;switch(a.type){case _.Sg:var p=new oR(a.rb,a.Dc);c?(l=fS(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new kR(a.width,a.height)).append([p]),n.entries=[l]);l=new gR;break;case _.Sc:p=new pR(a.vc),c?(l=fS(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new mR(a.channelCount,a.sampleSize,a.Le)).append([p]),n.entries=
|
|
16
|
+
[l]),l=new yR}n=(new sR).append([n,new uR,new vR,new xR,new wR]);m=(new zR).append([m]);m=(new AR).append([l,m,n]);g=(new BR).append([g,k,m]);f=(new $Q).append([f,g]);d=(new ZQ).append([d,f,e]);e=new YQ("dash",0,["iso6","mp41","avc1"]);c&&(c=b.xf(_.Kd),f=b.xf(_.Md),c&&d.append([new WQ("pssh",c.initData,8)]),f&&d.append([new WQ("pssh",f.initData,8)]),c||f||_.Qh(LQ,"Could not get PSSH init data!"));c=new eS([e,d]);return _.Qi(c.write())},iS=function(a,b){var c,d,e,f,g,k;(new _.oq).N("moof",_.pq).da("mfhd",
|
|
17
|
+
function(m){var n=new DR;n.f=_.jq(m.reader);c=n}).N("traf",_.pq).da("tfhd",function(m){var n=m.reader.bb();if(null===m.flags)throw new _.O(_.P,3,3019,KQ);var p=new FR(m.version||0,m.flags||0);p.f=_.jq(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.h=_.lq(m.reader));0<n-m.reader.getPosition()&&m.flags&2&&(p.A=_.jq(m.reader));0<n-m.reader.getPosition()&&m.flags&8&&(p.j=_.jq(m.reader));0<n-m.reader.getPosition()&&m.flags&16&&(p.o=_.jq(m.reader));0<n-m.reader.getPosition()&&m.flags&32&&(p.l=_.jq(m.reader));
|
|
18
|
+
d=p}).da("trun",function(m){var n=m.reader.bb();if(null===m.flags)throw new _.O(_.P,3,3019,KQ);var p=new ER(m.version||0,m.flags||0);p.f=_.jq(m.reader);0<n-m.reader.getPosition()&&m.flags&1&&(p.j=_.kq(m.reader));0<n-m.reader.getPosition()&&m.flags&4&&(p.l=_.jq(m.reader));if(0<n-m.reader.getPosition())for(n=0;n<p.f;n++)m.flags&256&&p.o.push(_.jq(m.reader)),m.flags&512&&p.sampleSize.push(_.jq(m.reader)),m.flags&1024&&p.A.push(_.jq(m.reader)),m.flags&2048&&(0===m.version?p.h.push(_.jq(m.reader)):p.h.push(_.kq(m.reader)));
|
|
19
|
+
e=p}).da("sdtp",function(m){var n=_.nq(m.reader,m.reader.bb());f=new XQ("sdtp",m.version||0,m.flags||0,n,0)}).N("uuid",function(m){var n=_.nq(m.reader,16);if(_.Om(n,hS)){n=_.jq(m.reader);m.version=n>>>24;m.flags=n&16777215;n=new OR(m.version,m.flags);n.h=_.jq(m.reader);m.flags&1&&(n.j=_.hq(m.reader));for(var p=0;p<n.h;p++){var q={Ni:_.nq(m.reader,8),Md:0,kh:[]};if(m.flags&2){q.Md=_.iq(m.reader);for(var t=0;t<q.Md;t++){var u={Lh:0,Mh:0};u.Lh=_.iq(m.reader);u.Mh=_.jq(m.reader);q.kh.push(u)}}n.f.push(q)}g=
|
|
20
|
+
n}}).N(_.Oe,function(m){var n=new IR;0<m.reader.bb()?n.f=_.nq(m.reader,m.reader.bb()):(_.Qh(LQ,"mdat box is empty!"),n.f=new Uint8Array(0));k=n}).parse(a,!1);if(!k)return null;var l=(new GR).append([d,e]);f&&l.append([f]);b.zf()&&g&&l.append([g]);l=(new HR).append([c,l]);return new eS([l,k])},jS=function(a,b,c,d){var e=d.zf(),f=parseInt(c*b,10);b=a.data||new ArrayBuffer(0);var g=iS(b,d);if(null===g)return a.request.contentType===_.Cn?a.data:g;d=g.get(_.Oe);if(a.request.contentType===_.Cn){e=d.f.buffer;
|
|
21
|
+
if(c){e=_.R.le(e);if((e=(new DOMParser).parseFromString(e,_.tg))&&"tt"===e.documentElement.tagName.toLowerCase())var k=e.documentElement;if(k&&(d=new cS(k.getAttribute("ttp:frameRate"),k.getAttribute("ttp:subFrameRate"),k.getAttribute("ttp:frameRateMultiplier"),k.getAttribute("ttp:tickRate")),k=k.getElementsByTagName("body")[0]))for(k=k.getElementsByTagName("p"),a=0,b=k.length;a<b;a++){f=k[a];g=c;for(var l=["begin",_.oe],m=0,n=l.length;m<n;m++){b:{var p=f;var q=l[m],t=new RegExp("\\w+:"+q),u=0;if(p.hasAttribute(q))p=
|
|
22
|
+
p.getAttribute(q);else{q=p.attributes;for(var y=q.length;u<y;u++){var C=q[u].name;if(C=C.match(t)){p=p.getAttribute(C[0]);break b}}p=null}}f.setAttribute(l[m],bS(p||"",g,d))}}e=(new XMLSerializer).serializeToString(e);c=_.R.sb(e).buffer}else c=e;return c}k=new HR;a=g.get("mfhd");b=new GR;l=g.get("tfhd");m=new CR(1,f);f=g.get("trun");n=g.get("sdtp");c=g.get("senc");l.f=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.h;m++)l.push(10+
|
|
23
|
+
6*c.f[m].Md);else g=8;b.append([c,new MR,new NR(g,l,c.h)])}k.append([a,b]);f.flags|=1;f.j=k.a()+8;d=new eS([k,d]);k=d.write();e&&(e=d.get("saio"),d=d.f,e.offset[0]=c.start+16,d.seek(e.start),e.write(d),k=d.buffer);return k},kS=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,periodId:null}},lS=function(a,b,c){a=_.Qr(a);c&&a.version!==c&&(a=_.nC(a,c));
|
|
24
|
+
return{initData:_.lC(a),initDataType:_.ld,keyId:b,periodId:null}},nS=function(){this.A=this.j=this.f=this.F=null;this.h=1;this.P=0;this.o="";this.D=this.a=null;this.g=new _.M("clpp.smooth.SmoothParser");this.K=!1;this.l=this.B=null;this.M=mS;this.I=0;this.G=this.J=Infinity;this.w=[];this.L=this.Go.bind(this);this.H=new Map},oS=function(a,b){var c,d,e;return _.I(function(f){if(1==f.a)return c=_.Zk(b),c.timeout=a.f.attemptParameters.timeout,c.maxAttempts=Math.max(a.f.attemptParameters.maxAttempts,b.length),
|
|
25
|
+
c.baseDelay=a.f.attemptParameters.baseDelay,c.backoffFactor=a.f.attemptParameters.backoffFactor,c.fuzzFactor=a.f.attemptParameters.fuzzFactor,c.type=1,d=a.F.networkingEngine.fetch(c),_.x(f,d.U,2);e=f.f;a.o=e.uri;return f["return"](e)})},vS=function(a,b){var c=_.Lr,d=null;try{var e=_.R.le(b);d=c.Je(e,_.Jb)}catch(SX){}if(!d)throw a.g.error("Unable to parse manifest"),new _.O(_.P,4,4033,a.o);var f=+pS(a,d,"MajorVersion"),g=+pS(a,d,"MinorVersion"),k=+d.getAttribute("TimeScale")||1E7,l=+pS(a,d,"Duration"),
|
|
26
|
+
m="TRUE"===d.getAttribute("IsLive"),n=+d.getAttribute("LookAheadCount"),p=+d.getAttribute("DVRWindowLength")||Infinity,q=c.aa(d,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+f+"."+g))throw a.g.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),new _.O(_.P,4,4036,a.o);m?(qS(a,rS),a.B=typeof a.f.liveRefreshPeriod===_.h?1E3*a.f.liveRefreshPeriod:Math.min(1E3*a.I,1E4),l=Infinity):qS(a,mS);a.a={startTime:0,delay:0,duration:l/k,wg:p/k,Ce:0};if(q){var t=a.f.playreadyVersion,u=_.Lr,y=[],C=u.aa(q,
|
|
27
|
+
"ProtectionHeader")[0],D=_.Lm(u.va(C)||""),B=_.Qr(D).a;y.push(kS(_.Md,{initData:_.lC(_.Ir(B)),initDataType:_.ld,keyId:B,periodId:null},[B]));y.push(kS(_.Kd,lS(D,B,t),[B]));a.w=y}var E=[],z=_.Lr.aa(d,"StreamIndex");if(!z.length)throw a.g.error("No streams found!"),new _.O(_.P,4,4034,a.o);for(var L=0;L<z.length;L++){for(var J,V=a,U=z[L],ta=pS(V,U,"Type"),wa=+U.getAttribute("Chunks"),qa=U.getAttribute("Subtype")||"",za=U.getAttribute("Language")||_.Hg,Fa=_.ro(za),Ya=U.getAttribute("Name")||"",ec=+U.getAttribute(_.eb),
|
|
28
|
+
qd=+U.getAttribute(_.db),rd=pS(V,U,"Url"),dk=+U.getAttribute("TimeScale")||null,tc=[],Pe=_.Lr.aa(U,_.yb),Dg=0;Dg<Pe.length;Dg++){var Pd=void 0,Yb=void 0,fc=void 0,Qd=V,vc=Pe[Dg],Eg=ta,tW=+vc.getAttribute("Index"),uW=+pS(Qd,vc,"Bitrate"),nJ=NaN,oJ=NaN,Eo=NaN,Av=NaN,pJ=NaN,qJ=NaN,rJ=NaN,sJ=vc.getAttribute("FourCC")||"";switch(Eg){case _.Sg:nJ=+pS(Qd,vc,_.db);oJ=+pS(Qd,vc,_.eb);break;case _.Sc:Av=+vc.getAttribute("Channels")||2,Eo=+pS(Qd,vc,"SamplingRate"),qJ=+pS(Qd,vc,"AudioTag"),pJ=+pS(Qd,vc,"BitsPerSample"),
|
|
29
|
+
rJ=+pS(Qd,vc,"PacketSize")}var Bv=String(vc.getAttribute("CodecPrivateData"));if(Eg===_.Sc&&!Bv){var tJ=Av,uJ={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},Fo=uJ[Eo];if("AACH"===sJ){Yb=new Uint8Array(4);var vJ=uJ[2*Eo];Yb[0]=40|Fo>>1;Yb[1]=Fo<<7|tJ<<3|vJ>>1;Yb[2]=vJ<<7|8;Yb[3]=0;Pd=new Uint16Array(2);Pd[0]=(Yb[0]<<8)+Yb[1];Pd[1]=(Yb[2]<<8)+Yb[3];fc=Pd[0].toString(16)+Pd[1].toString(16)}else Yb=new Uint8Array(2),Yb[0]=16|Fo>>1,Yb[1]=Fo<<7|tJ<<3,
|
|
30
|
+
Pd=new Uint16Array(1),Pd[0]=(Yb[0]<<8)+Yb[1],fc=Pd[0].toString(16);Bv=fc.toUpperCase()}var vW={id:Qd.P++,type:Eg,index:tW,bitrate:uW,pf:Bv,maxHeight:nJ,maxWidth:oJ,Le:Eo,Ph:Av,Fp:qJ,rk:pJ,Wp:rJ,im:sJ,segmentIndex:null};tc.push(vW)}J=tc;for(var Se=[],wJ=_.Lr.aa(U,"c"),sk=0;sk<wJ.length;sk++){var Cv=wJ[sk],le=parseInt(Cv.getAttribute("t"),10),bi=parseInt(Cv.getAttribute("d"),10),Dv=parseInt(Cv.getAttribute("r"),10),tk=0;if(isNaN(le)&&isNaN(bi))throw V.g.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),
|
|
31
|
+
new _.O(_.P,4,4037,V.o);0===sk&&isNaN(le)&&(tk=le=0);if(0<sk){var Gg=Se[Se.length-1];tk=Gg.n+1;Gg.d||(Gg.d=le-Gg.t);le||(le=Gg.t+Gg.d);bi||(bi=le-Gg.t)}Se.push({n:tk,d:bi,t:le});if(Dv){Dv--;for(var xJ=0;xJ<Dv;xJ++){var Go=Se[Se.length-1];tk=Go.n+1;le=Go.t+Go.d;bi=Go.d;Se.push({n:tk,d:bi,t:le})}}}V.be()||Se.length===wa||V.g.warn("Number of fragments ("+wa+") differs from number of chunks ("+Se.length+").");E.push({type:ta,Kp:wa,Wo:qa,language:Fa,Gd:za,name:Ya,maxWidth:ec,maxHeight:qd,op:rd,tracks:J,
|
|
32
|
+
si:Se,timescale:dk})}var Ef={Up:f,$i:g,timescale:k,duration:l,isLive:m,Tp:n,wg:p,Eg:!1,streams:E};if(a.j&&a.A)return sS(a,Ef),Promise.resolve();a.H.clear();var Ev=Ef.timescale,Ho=Ef.duration,xW=TR(Ef.streams,_.Sc),yW=TR(Ef.streams,_.Sg),zW=TR(Ef.streams,_.Cn),yJ=[],Io=tS(a,Ho,Ev,xW),Jo=tS(a,Ho,Ev,yW),AW=tS(a,Ho,Ev,zW);Io.length||(Io=[null]);Jo.length||(Jo=[null]);for(var Gv=0;Gv<Jo.length;Gv++)for(var Hv=0;Hv<Io.length;Hv++)yJ.push(uS(a,Jo[Gv],Io[Hv]));var zJ={id:"ID",configurationId:void 0,startTime:0,
|
|
33
|
+
endTime:Ho,variants:yJ,textStreams:AW,thumbStreams:[]};var CW=Ef.streams,Iv=a.a.startTime,AJ=a.a.delay,Jv=a.J,BJ=Math.min(a.a.duration||Infinity,Jv),Kv=a.be(),DW=a.a.wg,EW=a.a.Ce,CJ=a.I,DJ=isFinite(a.G)?a.G:0;if(Kv)BJ=Infinity,Iv=Date.now()/1E3-EW,a.a.startTime=Iv,AJ=3*CJ;else for(var FW=isFinite(Jv)?Jv:a.a.duration,EJ=_.v(CW),Lv=EJ.next();!Lv.done;Lv=EJ.next())for(var FJ=_.v(Lv.value.tracks),Mv=FJ.next();!Mv.done;Mv=FJ.next()){var GJ=Mv.value;GJ.segmentIndex.offset(-DJ);_.bD(GJ.segmentIndex,FW)}var HJ=
|
|
34
|
+
a.f.timeline||{};HJ.type=void 0;a.D=new _.oD(HJ,Iv,AJ,!Kv,!0);a.D.f=BJ;_.wD(a.D,CJ);a.D.A=DW;Kv||a.D.offset(-DJ);a.F.filterAllPeriods([zJ]);a.j={presentationTimeline:a.D,periods:[zJ],minBufferTime:0,cues:[]};Promise.resolve();a.K||(a.F.networkingEngine.Ud(a.L),a.K=!0);a.A=Ef;return Promise.resolve()},sS=function(a,b){for(var c=0;c<a.A.streams.length;c++)for(var d=b.streams[c],e={},f=_.v(a.A.streams[c].tracks),g=f.next();!g.done;e={uc:e.uc},g=f.next())if(e.uc=g.value,g=d.tracks.find(function(l){return function(m){return m.type===
|
|
35
|
+
l.uc.type&&m.bitrate===l.uc.bitrate}}(e))){RR(e.uc,g)||a.g.warn("The current stream is updated with a stream that seems to have different base properties!");var k=wS(a,a.A.timescale,d,g);g=e.uc.segmentIndex;g.ta(k);(k=a.a.wg)&&TQ(g,(g.a.length?g.a[g.a.length-1].endTime:0)-k).forEach(function(l){l.Ia().forEach(function(m){a.H["delete"](m)})})}else a.g.warn("Cannot find satisfying update for "+e.uc.type+" track with bitrate "+(e.uc.bitrate+". Skipping update."))},tS=function(a,b,c,d){for(var e=[],f=
|
|
36
|
+
{jd:0};f.jd<d.length;f={jd:f.jd},f.jd++){var g=d[f.jd].tracks.map(function(k){return function(l){var m=d[k.jd],n=wS(a,c,m,l);n=new _.LD(n);var p=null;m.type!==_.Cn&&(p=xS(a,b,c,m,l));l.segmentIndex=n;var q=_.aK++,t=Promise.resolve.bind(Promise),u=n.nf.bind(n),y=n.get.bind(n),C=n.lg.bind(n),D=n.getDuration.bind(n),B=yS[m.type],E="";switch(m.type){case _.Sg:E=l.pf;var z=/00000001[0-9]7/.exec(E);E="avc1."+(z&&z[0]?E.substr(E.indexOf(z[0])+10,6):"42c00c");a.g.debug("VIDEO CODECS: ",E);break;case _.Sc:E=
|
|
37
|
+
l.pf,z=2,"AACH"===l.im?z=5:E&&(z=(parseInt(E.substr(0,2),16)&248)>>3),E="mp4a.40."+z,a.g.debug("AUDIO CODECS: ",E)}z=m.type===_.Cn?zS[m.Wo]:void 0;return{id:q,originalId:null,Zp:null,createSegmentIndex:t,findSegmentPosition:u,getSegmentReference:y,adjustSegmentDurations:C,getDuration:D,segmentIndex:n,segmentLookupStrategy:_.UB,initSegmentReference:p,mimeType:B,codecs:E,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||void 0,kind:z,encrypted:a.Hg(),keyId:null,language:m.language,
|
|
38
|
+
originalLanguage:m.Gd,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.Ph||null,spatialAudio:!1,closedCaptions:null}}}(f));e=e.concat(g)}return e},wS=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.si.forEach(function(k,l){var m=k.d/g;if(0===l){var n=k.t/g;a.G=Math.min(a.G,n)}else n=f[l-1].endTime;var p=n+m,q=QR(a.o,c,l,d);a.I=Math.max(a.I,m);f.push(new _.Sp(l,n,p,function(){return[q]},0,null,0,null,!0,g));a.H.set(q,n);e+=m});if(c.type===_.Sg||
|
|
39
|
+
c.type===_.Sc)b=f[f.length-1],a.J=Math.min(a.J,e),0===a.a.Ce?a.a.Ce=b.endTime:a.a.Ce=Math.min(a.a.Ce,b.endTime);return f},xS=function(a,b,c,d,e){b=SR(b,d.timescale||c,e);c={isLive:a.be.bind(a),zf:a.Hg.bind(a),sm:function(){return 1},xf:a.zi.bind(a)};d=new Uint8Array(0);try{d=gS(b,c)}catch(g){throw a.g.error("Failed to generate initialization segment."),new _.O(_.P,3,4035,g);}var f="data:text/plain;base64,"+_.Km(d);return new _.LC(function(){return[f]},0,null,null,!0)},uS=function(a,b,c){var d=(c?
|
|
40
|
+
c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.Hg;return c||b?{id:a.h++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.w,allowedByApplication:!0,allowedByKeySystem:!0}:null},pS=function(a,b,c){if(b=b.getAttribute(c))return b;a.g.error("required attribute not provided: "+c);throw new _.O(_.P,4,4038,a.o,c);},AS=function(a,b){null!=a.B&&null!=b&&(a.l=window.setTimeout(a.mc.bind(a),b))},qS=function(a,b){var c=b===mS;a.j&&a.j.presentationTimeline&&_.rD(a.j.presentationTimeline,c);c&&null!=
|
|
41
|
+
a.l&&(window.clearTimeout(a.l),a.l=null,a.B=null);a.M=b},BS=function(){};VQ.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.children.push(a[b]),a[b].parent=this;return this};VQ.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.children.length;b++){if(this.children[b].type===a)return this.children[b];var c=this.children[b].get(a);if(c)return c}return null};
|
|
42
|
+
VQ.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.children.length)for(var c=0;c<this.children.length;c++)b+=this.children[c].a();this.size>a&&(b+=8);return b};
|
|
43
|
+
VQ.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.W(a,1):_.W(a,this.size);_.dq(a,UQ(this.type));this.size>b&&NQ(a,this.size);"uuid"===this.type&&_.dq(a,null);if(0<this.children.length&&!this.w)for(b=0;b<this.children.length;b++)this.children[b].write(a),this.children[b].a(),a.getPosition()};_.w(Z,VQ);Z.prototype.a=function(){return 4+VQ.prototype.a.call(this)};
|
|
44
|
+
Z.prototype.write=function(a){VQ.prototype.write.call(this,a);OQ(a,this.version);PQ(a,this.flags)};_.w(WQ,VQ);WQ.prototype.a=function(){return this.f.byteLength+VQ.prototype.a.call(this)-this.offset};WQ.prototype.write=function(a){VQ.prototype.write.call(this,a);_.dq(a,this.f,this.offset);a.getPosition()};_.w(XQ,Z);XQ.prototype.a=function(){return this.f.byteLength+Z.prototype.a.call(this)-this.offset};XQ.prototype.write=function(a){Z.prototype.write.call(this,a);_.dq(a,this.f,this.offset);a.getPosition()};
|
|
45
|
+
_.w(YQ,VQ);YQ.prototype.a=function(){var a=this.h.length;a=a+4+this.f.join("").length;return a+VQ.prototype.a.call(this)};YQ.prototype.write=function(a){VQ.prototype.write.call(this,a);_.dq(a,UQ(this.h));_.W(a,this.$i);_.dq(a,UQ(this.f.join("")));a.getPosition()};_.w(ZQ,VQ);_.w($Q,VQ);_.w(aR,Z);aR.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.f.length;return a+=Z.prototype.a.call(this)};
|
|
46
|
+
aR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(NQ(a,0),NQ(a,0),_.W(a,this.timescale),NQ(a,this.duration*this.timescale)):(_.W(a,0),_.W(a,0),_.W(a,this.timescale),_.W(a,this.duration*this.timescale));_.W(a,65536);QQ(a,this.volume);QQ(a,0);_.W(a,0);_.W(a,0);for(var b=0;b<this.f.length;b++)OQ(a,this.f[b]);_.W(a,0);_.W(a,0);_.W(a,0);_.W(a,0);_.W(a,0);_.W(a,0);_.W(a,this.h);a.getPosition()};_.w(bR,VQ);_.w(cR,Z);cR.prototype.a=function(){return 20+Z.prototype.a.call(this)};
|
|
47
|
+
cR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.f);_.W(a,1);_.W(a,0);_.W(a,0);_.W(a,0);a.getPosition()};_.w(dR,Z);dR.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.f.length;return a+Z.prototype.a.call(this)};
|
|
48
|
+
dR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(NQ(a,0),NQ(a,0),_.W(a,this.h),_.W(a,0),NQ(a,this.duration*this.timescale)):(_.W(a,0),_.W(a,0),_.W(a,this.h),_.W(a,0),_.W(a,this.duration*this.timescale));_.W(a,0);_.W(a,0);QQ(a,0);QQ(a,0);QQ(a,this.volume);QQ(a,0);for(var b=0;b<this.f.length;b++)OQ(a,this.f[b]);QQ(a,this.width);QQ(a,0);QQ(a,this.height);QQ(a,0);a.getPosition()};_.w(eR,Z);eR.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+Z.prototype.a.call(this)};
|
|
49
|
+
eR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?(NQ(a,0),NQ(a,0),_.W(a,this.timescale),NQ(a,this.duration*this.timescale)):(_.W(a,0),_.W(a,0),_.W(a,this.timescale),_.W(a,this.duration*this.timescale));QQ(a,this.language);QQ(a,0);a.getPosition()};_.w(fR,Z);fR.prototype.a=function(){return 33+Z.prototype.a.call(this)};
|
|
50
|
+
fR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,0);this.f===_.Sg?_.dq(a,UQ("vide")):_.dq(a,UQ("soun"));_.W(a,0);_.W(a,0);_.W(a,0);this.f===_.Sg?_.dq(a,UQ("VideoHandler\x00")):_.dq(a,UQ("SoundHandler\x00"));a.getPosition()};_.w(gR,Z);gR.prototype.a=function(){return 2+this.f.byteLength+Z.prototype.a.call(this)};gR.prototype.write=function(a){Z.prototype.write.call(this,a);QQ(a,0);_.dq(a,this.f);a.getPosition()};_.w(hR,VQ);hR.prototype.a=function(){return 8+VQ.prototype.a.call(this)};
|
|
51
|
+
hR.prototype.write=function(a){VQ.prototype.write.call(this,a);_.W(a,0);QQ(a,0);QQ(a,1)};_.w(iR,hR);iR.prototype.a=function(){return 70+hR.prototype.a.call(this)};iR.prototype.write=function(a){hR.prototype.write.call(this,a);QQ(a,0);QQ(a,0);_.W(a,0);_.W(a,0);_.W(a,0);QQ(a,this.width);QQ(a,this.height);_.W(a,4718592);_.W(a,4718592);_.W(a,0);QQ(a,1);OQ(a,10);_.dq(a,UQ("AVC Coding",31));QQ(a,this.depth);SQ(a,-1)};_.w(jR,hR);jR.prototype.a=function(){return 20+hR.prototype.a.call(this)};
|
|
52
|
+
jR.prototype.write=function(a){hR.prototype.write.call(this,a);_.W(a,0);_.W(a,0);QQ(a,this.channelCount);QQ(a,this.sampleSize);SQ(a,0);QQ(a,0);QQ(a,this.sampleRate);QQ(a,0)};_.w(kR,iR);kR.prototype.write=function(a){iR.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};_.w(lR,kR);_.w(mR,jR);mR.prototype.write=function(a){jR.prototype.write.call(this,a);for(var b=0;b<this.children.length;b++)this.children[b].write(a);a.getPosition()};
|
|
53
|
+
_.w(nR,mR);_.w(oR,VQ);oR.prototype.a=function(){for(var a=7,b=0;b<this.rb.length;b++)a+=2,a+=this.rb[b].byteLength;for(b=0;b<this.rb.length;b++)a+=2,a+=this.Dc[b].byteLength;return a+VQ.prototype.a.call(this)};
|
|
54
|
+
oR.prototype.write=function(a){VQ.prototype.write.call(this,a);OQ(a,this.version);OQ(a,this.f);OQ(a,this.h);OQ(a,this.level);OQ(a,255);OQ(a,224|this.rb.length);for(var b=0;b<this.rb.length;b++)QQ(a,this.rb[b].length),_.dq(a,this.rb[b]);OQ(a,this.Dc.length);for(b=0;b<this.Dc.length;b++)QQ(a,this.Dc[b].length),_.dq(a,this.Dc[b]);a.getPosition()};_.w(pR,Z);pR.prototype.a=function(){return 22+(this.vc.byteLength+3)+Z.prototype.a.call(this)};
|
|
55
|
+
pR.prototype.write=function(a){Z.prototype.write.call(this,a);OQ(a,3);OQ(a,23+this.vc.byteLength);QQ(a,1);OQ(a,0);OQ(a,4);OQ(a,15+this.vc.byteLength);OQ(a,64);OQ(a,21);PQ(a,0);_.W(a,0);_.W(a,0);OQ(a,5);OQ(a,this.vc.byteLength);_.dq(a,this.vc);_.dq(a,new Uint8Array([6,1,2]));a.getPosition()};_.w(qR,Z);qR.prototype.a=function(){return this.location.length+Z.prototype.a.call(this)};qR.prototype.write=function(a){Z.prototype.write.call(this,a);0<this.location.length&&_.dq(a,UQ(this.location));a.getPosition()};
|
|
56
|
+
_.w(rR,Z);rR.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)};rR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(sR,VQ);_.w(tR,Z);tR.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)};
|
|
57
|
+
tR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(uR,Z);uR.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)};uR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(vR,Z);
|
|
58
|
+
vR.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)};vR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(wR,Z);wR.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)};
|
|
59
|
+
wR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.w(xR,Z);xR.prototype.a=function(){return 8+Z.prototype.a.call(this)};xR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,0);_.W(a,0);a.getPosition()};_.w(yR,Z);yR.prototype.a=function(){return 4+Z.prototype.a.call(this)};yR.prototype.write=function(a){Z.prototype.write.call(this,a);SQ(a,0);QQ(a,0);a.getPosition()};
|
|
60
|
+
_.w(zR,VQ);_.w(AR,VQ);_.w(BR,VQ);_.w(CR,Z);CR.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+Z.prototype.a.call(this)};CR.prototype.write=function(a){Z.prototype.write.call(this,a);1===this.version?NQ(a,this.baseMediaDecodeTime):_.W(a,this.baseMediaDecodeTime);a.getPosition()};_.w(DR,Z);DR.prototype.a=function(){return 4+Z.prototype.a.call(this)};DR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.f);a.getPosition()};_.w(ER,Z);
|
|
61
|
+
ER.prototype.a=function(){var a=4;this.flags&1&&(a+=4);this.flags&4&&(a+=4);for(var b=0;b<this.f;b++)this.flags&256&&(a+=4),this.flags&512&&(a+=4),this.flags&1024&&(a+=4),this.flags&2048&&(a+=4);return a+Z.prototype.a.call(this)};
|
|
62
|
+
ER.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.f);this.flags&1&&(a.getPosition(),RQ(a,this.j));this.flags&4&&_.W(a,this.l);for(var b=0;b<this.f;b++)this.flags&256&&_.W(a,this.o[b]),this.flags&512&&_.W(a,this.sampleSize[b]),this.flags&1024&&_.W(a,this.A[b]),this.flags&2048&&(0===this.version?_.W(a,this.h[b]):RQ(a,this.h[b]));a.getPosition()};_.w(FR,Z);
|
|
63
|
+
FR.prototype.a=function(){var a=4;this.flags&1&&(a+=8);this.flags&2&&(a+=4);this.flags&8&&(a+=4);this.flags&16&&(a+=4);this.flags&32&&(a+=4);return a+Z.prototype.a.call(this)};FR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.f);this.flags&1&&NQ(a,this.h);this.flags&2&&_.W(a,this.A);this.flags&8&&_.W(a,this.j);this.flags&16&&_.W(a,this.o);this.flags&32&&_.W(a,this.l);a.getPosition()};_.w(GR,VQ);_.w(HR,VQ);_.w(IR,VQ);IR.prototype.a=function(){return this.f.byteLength+VQ.prototype.a.call(this)};
|
|
64
|
+
IR.prototype.write=function(a){VQ.prototype.write.call(this,a);0<this.f.byteLength&&_.dq(a,this.f)};_.w(JR,Z);JR.prototype.a=function(){var a=20;1===this.f&&0===this.h&&(a=a+1+this.j.length);return a+Z.prototype.a.call(this)};JR.prototype.write=function(a){Z.prototype.write.call(this,a);OQ(a,0);0===this.version?OQ(a,0):OQ(a,0);OQ(a,this.f);OQ(a,this.h);_.dq(a,_.Mm(this.l));if(1===this.f&&0===this.h){OQ(a,0);for(var b=0;b<this.j.length;b++)OQ(a,this.j[b])}a.getPosition()};_.w(KR,Z);
|
|
65
|
+
KR.prototype.a=function(){var a=8;this.flags&1&&(a+=UQ(this.oc).byteLength);return a+Z.prototype.a.call(this)};KR.prototype.write=function(a){Z.prototype.write.call(this,a);_.dq(a,UQ(this.f));_.W(a,this.h);this.flags&1&&_.dq(a,UQ(this.oc));a.getPosition()};_.w(LR,VQ);LR.prototype.a=function(){return UQ(this.f).byteLength+VQ.prototype.a.call(this)};LR.prototype.write=function(a){VQ.prototype.write.call(this,a);_.dq(a,UQ(this.f));a.getPosition()};_.w(MR,Z);
|
|
66
|
+
MR.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)};MR.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.W(a,0),_.W(a,0));_.W(a,1);for(var b=0;1>b;b++)0===this.version?_.W(a,this.offset[b]):NQ(a,this.offset[b]);a.getPosition()};_.w(NR,Z);NR.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.f&&(a+=this.j.length);return a+Z.prototype.a.call(this)};
|
|
67
|
+
NR.prototype.write=function(a){Z.prototype.write.call(this,a);this.flags&1&&(_.W(a,0),_.W(a,0));OQ(a,this.f);_.W(a,this.h);if(0===this.f)for(var b=0;b<this.h;b++)OQ(a,this.j[b]);a.getPosition()};_.w(OR,Z);OR.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.f[b].Ni.byteLength,this.flags&2){a+=2;for(var c=0;c<this.f[b].Md;c++)a+=2,a+=4}return a+Z.prototype.a.call(this)};
|
|
68
|
+
OR.prototype.write=function(a){Z.prototype.write.call(this,a);_.W(a,this.h);this.flags&1&&OQ(a,this.j);for(var b=0;b<this.h;b++)if(_.dq(a,this.f[b].Ni),this.flags&2){QQ(a,this.f[b].Md);for(var c=0;c<this.f[b].Md;c++)QQ(a,this.f[b].kh[c].Lh),_.W(a,this.f[b].kh[c].Mh)}a.getPosition()};var VR=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,WR=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,YR=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,ZR=/^(\d*\.?\d*)f$/,$R=/^(\d*\.?\d*)t$/,aS=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;eS.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};eS.prototype.write=function(){this.f=dS(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var hS=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.r=nS.prototype;_.r.configure=function(a){this.f=a};_.r.start=function(a,b){var c=this;this.F=b;var d=_.ph(new Set([a,PR(a)])).concat();return oS(this,d).then(function(e){return vS(c,e.data).then(function(){AS(c,c.B);return c.j})})};_.r.requestStop=function(){};_.r.stop=function(){this.F&&this.F.networkingEngine.Vf(this.L);this.B=this.A=this.j=this.f=this.F=null;this.l&&(clearTimeout(this.l),this.l=null);this.K=!1;this.J=this.G=Infinity;return Promise.resolve()};
|
|
69
|
+
_.r.update=function(){var a=this;if(this.be())return oS(this,[this.o]).then(function(b){return vS(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.F)a.F.onError(b)})};_.r.setCurrentVariant=function(){};_.r.mc=function(){var a=this;this.g.debug(_.LB);this.F&&(this.l=null,this.update().then(function(){AS(a,a.B)})["catch"](function(b){a.F&&(a.F.onError(b),1===b.severity&&AS(a,100))}))};_.r.be=function(){return this.M===rS};_.r.Hg=function(){return 0<this.w.length};
|
|
70
|
+
_.r.zi=function(a){var b=null;if(this.w.length)for(var c=0;c<this.w.length;c++)if(this.w[c].keySystem===a){b=this.w[c].initData[0];break}return b};
|
|
71
|
+
_.r.Go=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.A.timescale,c={isLive:this.be.bind(this),zf:this.Hg.bind(this),sm:function(){return 1},xf:this.zi.bind(this)},d=!1,e=new _.O(_.P,3,4035,null),f=null;try{var g=this.H.get(a.request.uris[a.request.uriIndex])||a.request.startTime||0;g!==a.request.startTime&&this.g.debug("Using base media decode time "+g+" instead of segment reference time "+a.request.startTime);f=jS(a,b,g,c)}catch(k){d=
|
|
72
|
+
!0,e.data=k,3E3===k.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};_.r.loadVariant=function(a){return _.I(function(b){return b["return"](a)})};_.r.loadTextStream=function(a,b){var c=this,d,e;return _.I(function(f){(e=c.j.periods.find(function(g){return g.id===b}))&&(d=e.textStreams.find(function(g){return g.id===a})||null);if(!d)throw new _.ui(_.BB+a);return f["return"](d)})};var yS={video:_.Ug,audio:_.Wc,text:_.Pc},mS=_.Ub,rS="LIVE",zS={rp:_.gd,yp:_.og};_.w(BS,_.av);BS.prototype.install=function(){_.Wv.ism=nS;_.Vv[_.Qc]=nS};BS.prototype.uninstall=function(){_.jE("ism");_.kE(_.Qc)};BS.prototype.id=function(){return _.fg};_.K("clpp.smooth.SmoothComponent",BS);};
|
|
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));}
|