@castlabs/prestoplay 6.7.0 → 6.9.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 +50 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +419 -420
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +72 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +272 -261
- package/cjs/cl.muxdata.js +15 -11
- 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 +71 -71
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +18 -18
- 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 +358 -363
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +61 -57
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +238 -228
- package/cl.muxdata.js +12 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -58
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -15
- package/package.json +1 -1
- package/typings.d.ts +74 -20
package/cjs/cl.verimatrix.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.D=d;this.B=b;this.w=
|
|
4
|
-
_.
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var f=function(window){var Rr="VerimatrixVCAS",Sr="clpp.verimatrix.Vcas",Tr="clpp.verimatrix.VcasComponent",Zr=function(a){_.wk.call(this,Rr);var b={};b[Ur]=Ur;b[Vr]=Vr;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Wr:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,h=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Xr:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
|
+
this.D=d;this.B=b;this.w=Yr(this,e);this.o=Yr(this,f);this.m=Yr(this,g);this.j=h;this.H=l;this.F=m;this.h=new _.I(Sr);_.Eh(this.w)?this.h.warn(_.Db):this.Pa(_.Rc,{licenseUrl:this.w,videoRobustness:[_.mb,void 0],audioRobustness:[_.lb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.g.bind(this)}});_.Eh(this.o)?this.h.warn(_.cb):this.Pa(_.Qc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.g.bind(this)}});
|
|
4
|
+
_.Eh(this.m)?this.h.warn(_.Ia):_.Eh(this.j)?this.h.warn(_.Ha):this.Pa(_.Pc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},Yr=function(a,b){if(a.D===Wr){var c=Object.assign({},{deviceId:_.Kh(_.Ah(a.A))},a.a&&{authenticator:_.Kh(_.Ah(a.a))});return b+_.Bi(c)}return b},$r=function(){this.l=null;this.h=new _.I(Tr)};_.w(Zr,_.wk);
|
|
5
|
+
Zr.prototype.g=function(a,b){if(this.D===as){var c=this.B[Vr],d={};d[this.B[Ur]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Zr.prototype.I=function(a,b){var c=_.Tk(b);switch(this.F){case bs:c=_.Bi({r:c,cm:this.H},!0)}return c};Zr.prototype.K=function(a,b){this.g(a,b);_.Wk(b)};Zr.prototype.M=function(a,b){_.Xk(b)};_.C(Sr,Zr);Zr.prototype.constructor=Zr.prototype.constructor;Zr.NAME=Rr;var Wr="query-string",as="http-header";
|
|
6
|
+
Zr.LicenseRequestVuidLocation={QUERY_STRING:Wr,HTTP_HEADER:as};var Ur="DeviceId",Vr="Authenticator";Zr.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Ur,AUTHENTICATOR_HEADER:Vr};var Xr="keyid",bs="contentid-siteid";Zr.FairPlayAssetIdStrategy={KEYID:Xr,CONTENTID_SITEID:bs};_.w($r,_.wo);_.t=$r.prototype;_.t.Oa=function(a){this.l=a};_.t.Ha=function(){this.l=null};_.t.ac=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===Rr){a=a.drm.customData;if(!a)throw new _.L(_.M,7,7100,_.Sc);a=new Zr(a);this.h.info("Registering the Verimatrix VCAS Ultra environment");_.rk(a)}};_.t.release=function(){};_.t.id=function(){return"verimatrix-vcas"};_.C(Tr,$r);};
|
|
7
7
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
8
8
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
9
9
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vimond.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b){a.l.trigger(new _.
|
|
4
|
-
|
|
5
|
-
_.t.
|
|
6
|
-
_.t.
|
|
7
|
-
b.B=e;return _.x(h,b.
|
|
8
|
-
_.t.
|
|
9
|
-
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.
|
|
10
|
-
typeof n.liveResumePossible!==_.
|
|
11
|
-
|
|
12
|
-
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.K.R(b.vimond)&&typeof b.vimond===_.
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.
|
|
14
|
-
_.t.
|
|
2
|
+
var f=function(window){var Hr="Registering listeners",Ir="clpp.vimond.VimondPlugin",Jr=function(a,b,c,d,e){this.F=a;this.H=b;this.I=c;this.l=d;this.D=e;this.a=new _.dg;this.m=!0;this.f=this.j=this.A=!1;this.B=null;this.g=new _.Wi(this.bg.bind(this));this.h=new _.I("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.a&&(this.h.debug(Hr),this.a.on(this.l,_.pe,this.Li.bind(this)),this.a.on(this.l,_.De,this.Mi.bind(this)),this.a.on(this.l,_.Fb,this.Ji.bind(this)),this.a.on(this.l,_.Gb,this.Ki.bind(this)))},Kr=function(a,
|
|
3
|
+
b){a.l.trigger(new _.J(_.Ue,{detail:b}))},Lr=function(a,b,c){b&&(a.A=!0,a.g.stop());a.l.onError(new _.L(b?_.M:1,9,9201,c))},Mr=function(a,b,c,d,e){this.m=a;this.o=c;this.g=b;this.a=d;this.j=e;this.h=new _.I("clpp.vimond.VimondService");this.f=0},Nr=function(a){this.l=a;this.a=new _.dg;this.h=new _.I("clpp.vimond.VimondAdapter");this.f=this.g=!1;this.l&&this.a&&(this.h.debug(Hr),this.a.on(this.l,_.ee,this.Ak.bind(this)),this.a.on(this.l,_.Fb,this.Hi.bind(this)),this.a.on(this.l,_.Gb,this.Ii.bind(this)))},
|
|
4
|
+
Or=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Yd];if(a.g)return[_.ed,_.Td];if(c===_.Qm)return[_.ed,null];if(c===_.Um)return[_.hd,_.Td];var d=_.Td;if(c===_.Om||c===_.Xm||a.f)d=_.Yd;return["period",d]},Pr=function(){this.a=!1;this.h=new _.I(Ir);this.j=this.g=this.f=null},Qr=function(){};_.t=Jr.prototype;_.t.Mi=function(){this.f||(this.f=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.t.Ji=function(){this.h.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.t.Ki=function(){this.h.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.t.Li=function(a){var b=this,c,d,e,f,g;return _.B(function(h){if(1==h.a){c=a.detail;d=_.Sm;e=c.currentState;f=c.previousState;b.h.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.h.debug("Ignore transition"),h["return"]();if(b.m&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.h.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.h.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.G(0);
|
|
7
|
+
b.B=e;return _.x(h,b.bg(),3)}e===d.ENDED&&b.g.stop();_.y(h)})};
|
|
8
|
+
_.t.bg=function(){var a=this,b,c,d,e,f,g;return _.B(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.h.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.g.stop();a.g.aa(a.m?10:a.F);a.m=!1;_.zf(h,2);l=a.D;l.f++;var m=_.K.va(l.o);m.client.buildName=_.oa;m.client.buildVersion=_.ea;var n=m.client,p=l.a.l.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.l.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
|
|
9
|
+
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.zi(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Or(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;var q=p.l.getPresentationStartTime()||0;p=Math.floor(q+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
|
|
10
|
+
typeof n.liveResumePossible!==_.sc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.Xh(l.m);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Ah(JSON.stringify(m));l=l.j.fetch(n).P;return _.x(h,l,4)}if(2!=h.a)return b=h.f,Kr(a,b),_.Af(h,0);d=c=_.Bf(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.h.debug("Unreachable service"),Kr(a,f),Lr(a,a.H,f)):1001===e?(a.h.debug("Generic service error"),
|
|
11
|
+
Kr(a,f),Lr(a,a.I,f)):a.h.error(c.toString());_.y(h)})};_.t.dispose=function(){this.h.debug(_.yb);_.gg(this.a);this.g.stop()};Mr.prototype.zf=function(a){this.g=a};_.t=Nr.prototype;_.t.getPosition=function(){return Math.floor(this.l.getPosition())};_.t.Ak=function(){this.g=!0};_.t.Hi=function(){this.f=!0};_.t.Ii=function(){this.f=!1};_.t.dispose=function(){this.h.debug(_.yb);_.gg(this.a)};_.w(Pr,_.$p);_.t=Pr.prototype;_.t.onPlayerCreated=function(){};
|
|
12
|
+
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.K.R(b.vimond)&&typeof b.vimond===_.Jd)?a.namespace()===_.Hc&&(this.a=!1,this.h.info("Vimond does not report when casting.")):this.h.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.u(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.h.warn(d+" key is missing");a.onError(new _.L(1,9,9200));return}this.h.debug("Configuration is valid");
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.sc&&(c=!0);d=b.failOnError;typeof d!==_.sc&&(d=!0);this.f=new Nr(a);this.g=new Mr(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Jr(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.t.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"vimond"};
|
|
14
|
+
_.t.zf=function(a){this.a&&this.g&&this.g.zf(a)};_.C(Ir,Pr);Pr.prototype.updateAuthToken=Pr.prototype.zf;Pr.Id="vimond";Qr.prototype.create=function(){return new Pr};_.qo(new Qr);};
|
|
15
15
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
16
16
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
17
17
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vr.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b):(a.x=0,a.y=0,a.a=0)},
|
|
4
|
-
3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},
|
|
5
|
-
|
|
6
|
-
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.L(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},
|
|
7
|
-
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},
|
|
8
|
-
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},
|
|
9
|
-
b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},
|
|
10
|
-
this.ha=this.H=this.f=this.a=this.l=null;this.h=new _.
|
|
11
|
-
this.D=this.
|
|
12
|
-
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.K.la(d))this.I=d;else throw new _.L(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.K.la(e)&&0<e)this.ga=e;else throw new _.L(1,7,7100,"sensitivity configuration must be a positive number");this.
|
|
13
|
-
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",
|
|
14
|
-
!1),this.a.addEventListener(
|
|
15
|
-
_.t.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.m=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(
|
|
16
|
-
_.t.
|
|
17
|
-
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=
|
|
2
|
+
var f=function(window){var mr="touchmove",nr="touchstart",or=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},pr=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},qr=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new or(a/d*e,b/d*e,0/d*e,Math.cos(c))},rr=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},sr=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},tr=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},ur=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},vr=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},wr=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
|
|
4
|
+
3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},xr=function(a){var b=new rr(0,0,0),c=new rr(0,0,1),d=new rr,e=new rr,f=new rr;a=a.a;var g=new rr(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();sr(f,1/g);c=ur(d,c,f);g=c.length();sr(c,1/g);ur(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-tr(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-tr(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-tr(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},zr=function(a){this.a=a;this.f=a.createProgram();this.m=
|
|
5
|
+
yr(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=yr(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.m);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
|
|
6
|
+
0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.L(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},yr=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.L(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Ar=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
|
|
8
|
+
5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Br=function(a,
|
|
9
|
+
b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},Cr=function(){var a=this;this.o=this.w=this.M=this.J=this.A=
|
|
10
|
+
this.ha=this.H=this.f=this.a=this.l=null;this.h=new _.I("clpp.vr");this.I=70;this.ga=1;this.T=this.N=!1;this.F=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.M.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.m=this.j=0;this.g={x:0,y:0};this.V=new vr;this.da=new vr;this.ma=new vr;this.na=new vr;this.B=this.xk.bind(this);
|
|
11
|
+
this.D=this.yk.bind(this);this.K=this.wk.bind(this)},Dr=function(a){var b=qr(1,0,a.m*Math.PI/180);pr(qr(0,1,a.j*Math.PI/180),a.V);pr(b,a.da);xr(a.ma);wr(a.na,a.V,a.ma);wr(a.H,a.da,a.na)},Er=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(mr,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},Fr=function(){};rr.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};vr.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r,v,z){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=r;A[11]=v;A[15]=z;return this};var Gr={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(Cr,_.$p);_.t=Cr.prototype;_.t.onPlayerCreated=function(a){this.h.info("Player created");this.l=a};
|
|
12
|
+
_.t.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.K.la(d))this.I=d;else throw new _.L(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.K.la(e)&&0<e)this.ga=e;else throw new _.L(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.T=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Pe){this.h.info("Initialize VR Surface");
|
|
13
|
+
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Gr)||this.a.getContext("experimental-webgl",Gr);if(!this.f)throw new _.L(1,9,9003,"Unable to create GL context");this.H=new vr;xr(this.H);this.ha=new Ar(this.f);this.A=new zr(this.f);this.J=new vr;this.M=new vr;this.o=this.w=null;this.a.addEventListener(_.he,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
+
!1),this.a.addEventListener(nr,this.K,!1));this.F();this.Yg()}else this.h.info("No video element found, can not initialize VR plugin");else this.h.info("No surface found, can not initialize VR plugin")}};
|
|
15
|
+
_.t.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.m=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(Er(this),this.a.removeEventListener(_.he,this.F),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.t.onPlayerWillDestroy=function(){var a=this;return _.B(function(b){a.l=null;_.y(b)})};_.t.id=function(){return"vr"};
|
|
16
|
+
_.t.Yg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Pe){this.w=requestAnimationFrame(this.Yg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Br(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
|
|
17
|
+
0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=wr(this.J,this.M,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ha;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
18
18
|
a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.g);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.t.
|
|
20
|
-
_.t.
|
|
21
|
-
_.t.
|
|
19
|
+
_.t.wk=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===nr)a.type===nr?a.touches[0]&&(this.g.x=a.touches[0].clientX,this.g.y=a.touches[0].clientY):(this.g.x=a.clientX,this.g.y=a.clientY),this.h.debug("Mouse Start coordinates:",this.g,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(mr,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
|
|
20
|
+
_.t.xk=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===mr&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;b=this.ga;c=d*b*(this.T?-1:1);this.j+=a*b*(this.N?-1:1);this.m+=c;Dr(this)};_.t.yk=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Er(this)};_.t.Rj=function(a,b){this.m=b;this.j=a;Dr(this)};_.t.ij=function(){return{x:this.j,y:this.m}};
|
|
21
|
+
_.t.fl=function(a){this.I=a;this.F()};_.C("clpp.vr.VrPlugin",Cr);Cr.prototype.setCameraFieldOfView=Cr.prototype.fl;Cr.prototype.getCameraCoordinates=Cr.prototype.ij;Cr.prototype.moveCamera=Cr.prototype.Rj;Cr.Id="vr";Fr.prototype.create=function(){return new Cr};_.qo(new Fr);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vtt.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},
|
|
4
|
-
_.
|
|
5
|
-
c[2]&&(a.lineAlign=_.
|
|
6
|
-
var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},
|
|
7
|
-
c,
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.
|
|
10
|
-
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.G("VTT parser encountered an invalid VTTRegion setting: ",l,
|
|
11
|
-
e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.
|
|
12
|
-
n,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var f=function(window){var Tq=" The setting will be ignored.",Uq="VTT parser encountered an invalid VTT setting: ",Vq="application/x-subrip",Wq="text/srt",Xq='text/vtt; codecs\x3d"vtt"',Yq='text/vtt; codecs\x3d"wvtt"',Zq=function(a){_.Rh(a,/[ \t]+/gm)},$q=function(a){return a.a==a.f.length?null:(a=_.Rh(a,/[^ \t\n]*/gm))?a[0]:null},ar=function(){},br=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
|
|
3
|
+
a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},cr=function(){},dr=function(a){this.a=a},fr=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.tg:a.textAlign=
|
|
4
|
+
_.fq[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ne:_.Oe;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.sd||b==_.oe?_.sd:b==_.td||b==_.ed?_.td:_.Bc);else if(d=/^region:(.*)$/.exec(b)){if(b=er(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
|
|
5
|
+
c[2]&&(a.lineAlign=_.gq[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.vg,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.gq[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},er=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.G("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},gr=function(a){a=_.Rh(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
|
|
6
|
+
var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},hr=function(){dr.apply(this,arguments)},ir=function(){this.a=null;this.h=new _.I("clpp.vtt.mp4")},kr=function(a,b,c){var d,e,f;(new _.Kk).L("payl",_.Nk(function(g){d=_.uh(g)})).L("iden",_.Nk(function(g){e=_.uh(g)})).L("sttg",_.Nk(function(g){f=_.uh(g)})).parse(a);return d?jr(d,e,f,b,c):null},jr=function(a,b,c,d,e){a=new _.yg(d,e,a);b&&(a.id=b);if(c)for(b=new _.Qh(c),c=$q(b);c;)fr(a,c,[])||_.G(Uq,
|
|
7
|
+
c,Tq),Zq(b),c=$q(b);return a},lr=function(){this.a=new cr};ar.prototype.a=function(a){a=_.uh(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=br(c.value)}return _.yh(a)};cr.prototype.create=function(){return new ar};cr.prototype.probe=function(a,b){return(a===Wq||a===Vq)&&b===_.Be};dr.prototype.parseInit=function(){};
|
|
8
|
+
dr.prototype.parseMedia=function(a,b){var c=_.uh(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.L(_.M,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=gr(new _.Qh(e[1]));if(null==c)throw new _.L(_.M,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
|
|
9
|
+
f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Qh(h.replace(/\n/g," "));g=new _.Bg;$q(h);Zq(h);for(var l=$q(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
|
|
10
|
+
Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.G("VTT parser encountered an invalid VTTRegion setting: ",l,Tq);Zq(h);l=$q(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
|
|
11
|
+
e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Qh(p[0]);m=gr(l);var r=_.Rh(l,/[ \t]+--\x3e[ \t]+/g);n=gr(l);if(null==m||null==r||null==n)throw new _.L(_.M,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.yg(m,n,p,_.We);g&&(m.id=g);Zq(l);for(n=$q(l);n;)fr(m,n,f)||_.G(Uq,
|
|
12
|
+
n,Tq),Zq(l),n=$q(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(hr,dr);hr.prototype.parseMedia=function(a,b){return dr.prototype.parseMedia.call(this,(new ar).a(a),b)};ir.prototype.parseInit=function(a){var b=this,c=!1;(new _.Kk).L(_.Dd,_.Lk).L(_.Ee,_.Lk).L(_.yd,_.Lk).Y("mdhd",function(d){0==d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.T(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.T(d.reader),d.reader.skip(8));d.reader.skip(4)}).L(_.Cd,_.Lk).L(_.re,_.Lk).Y(_.ue,_.Mk).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.L(_.M,2,2008);if(!c)throw new _.L(_.M,2,2008);};
|
|
13
|
+
ir.prototype.parseMedia=function(a,b){if(!this.a)throw this.h.error("No init segment for MP4+VTT!"),new _.L(_.M,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Kk).L("moof",_.Lk).L("traf",_.Lk).Y("tfdt",function(F){g=!0;c=0==F.version?_.T(F.reader):_.Ik(F.reader)}).Y("tfhd",function(F){var V=F.flags;F=F.reader;F.skip(4);V&1&&F.skip(8);V&2&&F.skip(4);m=V&8?_.T(F):null}).Y("trun",function(F){h=!0;var V=F.version,P=F.flags;F=F.reader;var Ca=_.T(F);P&1&&F.skip(4);P&4&&F.skip(4);for(var qa=[],
|
|
14
|
+
ra=0;ra<Ca;ra++){var Da={duration:null,sampleSize:null,wf:null};P&256&&(Da.duration=_.T(F));P&512&&(Da.sampleSize=_.T(F));P&1024&&F.skip(4);P&2048&&(Da.wf=0==V?_.T(F):_.Gk(F));qa.push(Da)}d=qa}).L(_.xd,_.Nk(function(F){l=!0;e=F})).parse(a);if(!l&&!g&&!h)throw new _.L(_.M,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Bk(p,!1);for(var q=_.u(d),r=q.next();!r.done;r=q.next()){r=r.value;var v=r.duration||m,z=r.wf?c+r.wf:n;n=z+(v||0);var A=0;do{var E=_.T(p);A+=E;var H=_.T(p);
|
|
15
|
+
H=_.Pk(H);var D=null;"vttc"==H?8<E&&(D=_.Jk(p,E-8)):("vtte"!=H&&this.h.error("Unknown box "+H+"! Skipping!"),p.skip(E-8));v?D&&f.push(kr(D,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.h.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&A<r.sampleSize)}return{cues:f.filter(_.Jg),styles:[]}};_.w(lr,_.wo);lr.prototype.Oa=function(){_.Op[_.Be]=dr;_.Op[Xq]=dr;_.Op[Yq]=dr;_.Op[_.fc]=ir;_.Op[Wq]=hr;_.Op[Vq]=hr;_.Qi.push(this.a)};lr.prototype.Ha=function(){_.Pp(_.Be);_.Pp(Xq);_.Pp(Yq);_.Pp(_.fc);_.Pp(Wq);_.Pp(Vq);_.Si(this.a)};lr.prototype.id=function(){return _.ye};_.C("clpp.vtt.VttComponent",lr);};
|
|
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.youbora.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(
|
|
2
|
+
var f=function(window){var Iq='" event to Youbora',Jq='Reporting "',Kq="clpp.npaw.YouboraPlugin",Lq="content.isLive",Mq=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Nq=function(a,b,c,d){b=Mq(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.hd;b.severity===_.M?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
|
|
3
|
+
b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Jq+a+'" to Youbora',b.code,b));return b},Oq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.a=new _.dg;d.h=new _.I("clpp.npaw.YouboraAdapter");d.w=!1;d.g=!1;d.registerListeners();d.B=!1;return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.l.getPosition()};b.prototype.getDuration=function(){return this.l.getDuration()};b.prototype.getRendition=function(){var c=this.l.getTrackManager();
|
|
4
4
|
if(c&&(c=c.fa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.m(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.l.isLive()};b.prototype.getResource=function(){var c=this.l.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.m().streamBandwidth};b.prototype.getThroughput=function(){return this.m().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.l.getPlaybackRate()};
|
|
5
|
-
b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.
|
|
6
|
-
_.
|
|
7
|
-
if(c)switch(c.currentState){case _.
|
|
8
|
-
(this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.
|
|
9
|
-
b.prototype.J=function(){this.j(_.
|
|
10
|
-
youbora.Adapter.call(this,c)||this;d.l=c;d.a=null;d.j=null;d.f=new _.
|
|
11
|
-
return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a
|
|
12
|
-
d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.
|
|
13
|
-
function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.l.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.h.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.
|
|
14
|
-
function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.
|
|
15
|
-
_.
|
|
5
|
+
b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.Na())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.oa};b.prototype.getVersion=function(){return"6.9.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.a&&(this.h.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.a.on(this.l,_.pe,this.K.bind(this)),this.a.on(this.l,_.hd,this.H.bind(this)),this.a.on(this.l,
|
|
6
|
+
_.Le,this.J.bind(this)),this.a.on(this.l,_.Ke,this.I.bind(this)),this.a.on(this.l,_.Wb,this.D.bind(this)),this.a.on(this.l,_.xc,this.F.bind(this)))};b.prototype.unregisterListeners=function(){this.h.debug(_.yb);_.gg(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.m=function(){return this.l.getStats()||_.Am()};b.prototype.o=function(){return!!this.l.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
|
|
7
|
+
if(c)switch(c.currentState){case _.Vm:this.o()&&this.f();break;case _.Xm:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Wm:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Em:this.fireBufferEnd();this.fireStop();break;case _.Qm:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Om:this.fireBufferBegin();break;default:this.h.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
|
|
8
|
+
(this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Rc)?"Widevine":c.startsWith(_.Pc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Rd)?"ClearKey":c.startsWith(_.Oc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.g||10003===c.code&&this.plugin.getAdsAdapter()||(c=Nq(c,this.l,this.h,this))&&c.severity===_.M&&(this.g=!0)};
|
|
9
|
+
b.prototype.J=function(){this.j(_.ke);this.l.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.je);this.fireSeekEnd()};b.prototype.D=function(c){this.h.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.lb()};b.prototype.F=function(c){this.h.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[Jq+c+Iq].concat(_.mf(e)))};return new b(a)},Pq=function(a){function b(c){var d=
|
|
10
|
+
youbora.Adapter.call(this,c)||this;d.l=c;d.a=null;d.j=null;d.f=new _.dg;d.h=new _.I("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.m=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.yb(),this.a.xb(),this.a.kb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.kb()};b.prototype.getPlayhead=function(){var c=this.l.getAdsManager();
|
|
11
|
+
return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.$a()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.h.debug("Ad position",
|
|
12
|
+
d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.Ab()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
|
|
13
|
+
function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.l.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.h.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.oa};b.prototype.getVersion=function(){return"6.9.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
|
|
14
|
+
function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Wb,this.V.bind(this)),this.f.on(this.l,_.Sb,this.T.bind(this)),this.f.on(this.l,_.Ob,this.K.bind(this)),this.f.on(this.l,_.Qb,this.M.bind(this)),this.f.on(this.l,_.Jb,this.I.bind(this)),this.f.on(this.l,_.Kb,this.o.bind(this,1)),this.f.on(this.l,_.Nb,this.o.bind(this,2)),this.f.on(this.l,_.Ub,this.o.bind(this,3)),this.f.on(this.l,_.Ib,this.H.bind(this)),this.f.on(this.l,_.Rb,this.N.bind(this)),this.f.on(this.l,
|
|
15
|
+
_.hd,this.J.bind(this)),this.f.on(this.l,_.Fb,this.B.bind(this)),this.f.on(this.l,_.Gb,this.D.bind(this)),this.f.on(this.l,_.Hb,this.F.bind(this)),this.f.on(this.l,_.Pb,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.gg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();
|
|
16
16
|
this.fireJoin()};b.prototype.I=function(){this.g("ad ended");this.fireStop()};b.prototype.K=function(){this.g("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.g("ad resume");this.w();this.fireResume()};b.prototype.F=function(){this.m=!0;this.g("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.m&&(this.g("ad buffering ended"),this.m=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.g("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.g("ad clicked");
|
|
17
|
-
var c=this.a&&this.a.Nb();this.h.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.
|
|
18
|
-
b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[
|
|
19
|
-
b.onError(new _.L(1,9,9101)),!1;if(_.K.R(window.youbora))return a.h.warn("Youbora SDK not found."),b.onError(new _.L(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.h.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.L(1,9,9102)));return!0},
|
|
20
|
-
_.t.onContentWillLoad=function(a,b){if(
|
|
21
|
-
|
|
17
|
+
var c=this.a&&this.a.Nb();this.h.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.N=function(){this.g("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()};b.prototype.D=function(){this.g("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Nq(c,this.l,this.h,this)};
|
|
18
|
+
b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[Jq+c+Iq].concat(_.mf(e)))};return new b(a)},Qq=function(){this.a=null;this.h=new _.I(Kq);this.l=null},Rq=function(a,b){if(b.namespace()===_.Hc)return a.h.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.K.rg(c))return a.h.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.h.warn("accountCode key is missing in Youbora config"),
|
|
19
|
+
b.onError(new _.L(1,9,9101)),!1;if(_.K.R(window.youbora))return a.h.warn("Youbora SDK not found."),b.onError(new _.L(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.h.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.L(1,9,9102)));return!0},Sq=function(){};_.w(Qq,_.$p);_.t=Qq.prototype;_.t.rf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Oq(this.l)),this.a.setAdsAdapter(Pq(this.l))};_.t.getAdapter=function(){return this.a&&this.a.getAdapter()};_.t.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.t.onPlayerCreated=function(a){this.l=a;Rq(this,a)&&(a=a.getConfiguration().youbora,this.rf(new youbora.Plugin(a)))};
|
|
20
|
+
_.t.onContentWillLoad=function(a,b){if(Rq(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Lq]&&(d[Lq]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.rf(new youbora.Plugin(d));this.a.setOptions(d)}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.C(Kq,Qq);Qq.prototype.getAdsAdapter=Qq.prototype.getAdsAdapter;Qq.prototype.getAdapter=Qq.prototype.getAdapter;
|
|
21
|
+
Qq.prototype.setYouboraPlugin=Qq.prototype.rf;Qq.Id="youbora";Sq.prototype.create=function(){return new Qq};_.qo(new Sq);};
|
|
22
22
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
23
23
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
24
24
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cl.adobe.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
|
|
3
|
-
_.z("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var WM=function(a){a.f=new _.jo;a.f.on(a.l,_.Ce,()=>UM(a));a.f.on(a.l,_.Be,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.od,()=>VM(a));a.f.on(a.l,_.je,b=>{b=b.detail;switch(b.currentState){case _.Hl:a.a.length||VM(a);s.Media.play(a.a,a.l.getPosition());break;case _.Gl:case _.zl:UM(a);break;case _.wl:case _.El:case _.Dl:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),UM(a),s.Media.close(a.a),a.a=""}})},UM=function(a){s.Media.stop(a.a,a.l.getPosition())},
|
|
2
|
+
VM=function(a){{const b=a.l.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.l.getDuration()}`);s.Media.open(a.a,a.l.getDuration(),_.ma)},XM=class extends _.$p{constructor(){super();this.l=this.f=null;this.a="";this.g=new _.O("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.l=a,WM(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""}id(){return"adobe"}};
|
|
3
|
+
_.z("clpp.adobe.AdobeAnalyticsPlugin",XM);XM.Id="adobe";_.Hm(new class{create(){return new XM}});};f.call(g, window);
|
package/cl.airplay.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
!0;break;case "not-available":this.f=!1}this.l.trigger(new _.F(_.
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var TM=class extends _.$p{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.Oo(()=>{this.l.play().catch(()=>{})});this.g=new _.jo}onPlayerCreated(a){this.l=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.o.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.w.bind(this)))}onPlayerWillRelease(){this.m.stop();this.g.release()}id(){return"airplay"}o(a){switch(a.availability){case "available":this.f=
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.l.trigger(new _.F(_.Qb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Ob:_.Mb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Hl)this.j?this.l.play().catch(()=>{}):this.m.da(.01);this.l.trigger(new _.F(a))}ib(){return this.h}qd(){return this.f}lg(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",TM);TM.prototype.showCastMenu=TM.prototype.lg;
|
|
3
|
+
TM.prototype.canCast=TM.prototype.qd;TM.prototype.isCasting=TM.prototype.ib;TM.Id="airplay";_.Hm(new class{create(){return new TM}});};f.call(g, window);
|
package/cl.broadpeak.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},
|
|
3
|
-
case _.
|
|
4
|
-
this.h),this.f.init()})}}
|
|
5
|
-
_.
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MM=function(){return!window.SmartLib||!window.GenericPlayerApi},NM=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof b===_.me&&a.g.setUUID(b))},PM=function(a,b){b=b.customParameters||{};a.a=a.g.createStreamingSession();for(const c in b)a.a.setCustomParameter(c,b[c]);a.j.on(a.l,_.Yc,a.U.bind(a));a.h=OM(a.l);a.a.attachPlayer(a.h)},QM=function(a,b){_.Mf(a.j);a.f&&(a.f.release(),
|
|
2
|
+
a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},RM=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.jo;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.je,this.m.bind(this));b.on(a,_.ec,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.zl&&c.notifyStallEnd(!b.isPaused());switch(d){case _.zl:c.notifyStallStart();break;
|
|
3
|
+
case _.Hl:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Gl:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Mf(this.a),this.a=null)}};var OM=a=>{class b extends GenericPlayerApi{constructor(c){super();this.l=c;this.a=_.Bi()}getPlayerName(){return _.ma}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.l.isLive()?0:1E3*this.l.getDuration()}getCurrentPosition(){return 1E3*this.l.getPosition()}getCurrentBitrate(){const c=this.l.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var SM=class extends _.$p{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.jo}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(MM())return a.onError(new _.H(1,9,11E3));NM(this,c);PM(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.l.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));QM(this,void 0)}else b.url=d.getURL(),this.f=new RM(this.l,
|
|
4
|
+
this.h),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)QM(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:QM(this,SmartLib.BPDecodingError);break;case 1:QM(this,SmartLib.BPNetworkingError);break;case 6:QM(this,SmartLib.BPAccessRightError);break;default:QM(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){MM()||QM(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.z("clpp.broadpeak.BroadpeakPlugin",SM);SM.isSdkMissing=MM;SM.Id="broadpeak";
|
|
5
|
+
_.Hm(new class{create(){return new SM}});};f.call(g, window);
|