@castlabs/prestoplay 6.2.6 → 6.2.7
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 +12 -0
- package/README.md +1 -1
- 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 +101 -101
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +362 -362
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +68 -68
- package/cjs/cl.externs.js +63 -32
- package/cjs/cl.freewheel.js +19 -19
- package/cjs/cl.hls.js +43 -43
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +18 -18
- package/cjs/cl.mse.js +252 -249
- package/cjs/cl.muxdata.js +11 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.smooth.js +69 -69
- package/cjs/cl.thumbnails.js +22 -22
- package/cjs/cl.tizen.js +69 -69
- package/cjs/cl.ttml.js +26 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +24 -0
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +78 -78
- package/cl.conviva.js +25 -25
- package/cl.core.js +172 -171
- package/cl.crypto.js +8 -8
- package/cl.dash.js +61 -61
- package/cl.externs.js +59 -32
- package/cl.freewheel.js +18 -18
- package/cl.hls.js +36 -36
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +24 -24
- package/cl.ima.js +15 -15
- package/cl.mse.js +223 -220
- package/cl.muxdata.js +9 -9
- package/cl.onboard.js +3 -3
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +57 -57
- package/cl.thumbnails.js +15 -15
- package/cl.tizen.js +55 -55
- package/cl.ttml.js +21 -21
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -0
- package/cl.vtt.js +7 -7
- package/cl.youbora.js +8 -8
- package/package.json +1 -1
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
|
-
_.h.
|
|
6
|
-
_.h.
|
|
7
|
-
b.B=e;return _.v(k,b.
|
|
8
|
-
_.h.
|
|
9
|
-
l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.
|
|
10
|
-
_.hc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.
|
|
11
|
-
f)):a.a.error(c.toString());_.w(k)})};_.h.dispose=function(){this.a.debug(_.nb);_.
|
|
2
|
+
var f=function(window){var yq="Registering listeners",zq="clpp.vimond.VimondPlugin",Aq=function(a,b,c,d,e){this.D=a;this.G=b;this.I=c;this.l=d;this.C=e;this.f=new _.Tf;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.oh(this.vf.bind(this));this.a=new _.D("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(yq),this.f.on(this.l,_.he,this.Qh.bind(this)),this.f.on(this.l,_.ve,this.Rh.bind(this)),this.f.on(this.l,_.tb,this.Oh.bind(this)),this.f.on(this.l,_.ub,this.Ph.bind(this)))},Bq=function(a,
|
|
3
|
+
b){a.l.trigger(new _.E(_.Me,{detail:b}))},Cq=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.J(b?_.K:1,9,9201,c))},Dq=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.D("clpp.vimond.VimondService");this.f=0},Eq=function(a){this.l=a;this.a=new _.Tf;this.g=new _.D("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(yq),this.a.on(this.l,_.Xd,this.fj.bind(this)),this.a.on(this.l,_.tb,this.Mh.bind(this)),this.a.on(this.l,_.ub,this.Nh.bind(this)))},
|
|
4
|
+
Fq=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Qd];if(a.h)return[_.Tc,_.Ld];if(c===_.Gl)return[_.Tc,null];if(c===_.Kl)return[_.Vc,_.Ld];var d=_.Ld;if(c===_.El||c===_.Nl||a.f)d=_.Qd;return["period",d]},Gq=function(){this.a=!1;this.h=new _.D(zq);this.j=this.g=this.f=null},Hq=function(){};_.h=Aq.prototype;_.h.Rh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.h.Oh=function(){this.a.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.h.Ph=function(){this.a.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.h.Qh=function(a){var b=this,c,d,e,f,g;return _.z(function(k){if(1==k.a){c=a.detail;d=_.Il;e=c.currentState;f=c.previousState;b.a.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.g)return b.a.debug("Ignore transition"),k["return"]();if(b.m&&e!==d.PLAYING)return k["return"]();if(b.g&&[d.PAUSED,d.BUFFERING].includes(e))return b.a.debug("Seeking"),k["return"]();b.g&&e===d.PLAYING&&(b.a.debug("Seeked"),b.g=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.H(0);
|
|
7
|
+
b.B=e;return _.v(k,b.vf(),3)}e===d.ENDED&&b.h.stop();_.w(k)})};
|
|
8
|
+
_.h.vf=function(){var a=this,b,c,d,e,f,g;return _.z(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.a.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.$(a.m?10:a.D);a.m=!1;_.qf(k,2);l=a.C;l.f++;var m=_.H.Sa(l.m);m.client.buildName=_.na;m.client.buildVersion=_.da;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 _.Ij(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Fq(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;p=Math.floor(p.l.getPresentationStartTime()+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;var q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);typeof n.liveResumePossible!==
|
|
10
|
+
_.hc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.gh(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Xg(JSON.stringify(m));l=l.j.fetch(n).N;return _.v(k,l,4)}if(2!=k.a)return b=k.f,Bq(a,b),_.rf(k,0);d=c=_.sf(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),Bq(a,f),Cq(a,a.G,f)):1001===e?(a.a.debug("Generic service error"),Bq(a,f),Cq(a,a.I,
|
|
11
|
+
f)):a.a.error(c.toString());_.w(k)})};_.h.dispose=function(){this.a.debug(_.nb);_.Zf(this.f);this.h.stop()};Dq.prototype.Ve=function(a){this.g=a};_.h=Eq.prototype;_.h.getPosition=function(){return Math.floor(this.l.getPosition())};_.h.fj=function(){this.h=!0};_.h.Mh=function(){this.f=!0};_.h.Nh=function(){this.f=!1};_.h.dispose=function(){this.g.debug(_.nb);_.Zf(this.a)};_.u(Gq,_.To);_.h=Gq.prototype;_.h.onPlayerCreated=function(){};
|
|
12
12
|
_.h.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.H.R(b.vimond)&&typeof b.vimond===_.Ad)?a.namespace()===_.wc&&(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=_.t(["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 _.J(1,9,9200));return}this.h.debug("Configuration is valid");
|
|
13
|
-
c=b.failIfUnreachable;typeof c!==_.hc&&(c=!0);d=b.failOnError;typeof d!==_.hc&&(d=!0);this.f=new
|
|
14
|
-
_.h.
|
|
13
|
+
c=b.failIfUnreachable;typeof c!==_.hc&&(c=!0);d=b.failOnError;typeof d!==_.hc&&(d=!0);this.f=new Eq(a);this.g=new Dq(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Aq(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.h.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"vimond"};
|
|
14
|
+
_.h.Ve=function(a){this.a&&this.g&&this.g.Ve(a)};_.A(zq,Gq);Gq.prototype.updateAuthToken=Gq.prototype.Ve;Gq.Id="vimond";Hq.prototype.create=function(){return new Gq};_.gn(new Hq);};
|
|
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
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
(function(){var g={}; var _ = _ || {}
|
|
2
|
+
var f=function(window){var dq="touchmove",eq="touchstart",fq=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},gq=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)},hq=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new fq(a/d*e,b/d*e,0/d*e,Math.cos(c))},iq=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},jq=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
|
|
3
|
+
b):(a.x=0,a.y=0,a.a=0)},kq=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},lq=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},mq=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},nq=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},oq=function(a){var b=new iq(0,0,0),c=new iq(0,0,1),d=new iq,e=new iq,f=new iq;a=a.a;var g=new iq(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();jq(f,1/g);c=lq(d,c,f);g=c.length();jq(c,1/g);lq(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-kq(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-kq(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-kq(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},qq=function(a){this.a=a;this.f=a.createProgram();this.j=
|
|
5
|
+
pq(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.h=pq(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.j);a.attachShader(this.f,this.h);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 _.J(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)},pq=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 _.J(1,
|
|
7
|
+
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},rq=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 k=c/128,l=(.5+k)*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-k);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)},sq=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)},tq=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
+
this.U=this.G=this.f=this.a=this.l=null;this.h=new _.D("clpp.vr");this.I=70;this.D=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.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.O=new mq;this.T=new mq;this.Y=new mq;this.aa=new mq;this.B=this.bj.bind(this);this.C=this.cj.bind(this);this.K=
|
|
11
|
+
this.aj.bind(this)},uq=function(a){var b=hq(1,0,a.m*Math.PI/180);gq(hq(0,1,a.j*Math.PI/180),a.O);gq(b,a.T);oq(a.Y);nq(a.aa,a.O,a.Y);nq(a.G,a.T,a.aa)},vq=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(dq,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},wq=function(){};iq.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};mq.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,x,y){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=k;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=r;C[11]=x;C[15]=y;return this};var xq={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.u(tq,_.To);_.h=tq.prototype;_.h.onPlayerCreated=function(a){this.h.info("Player created");this.l=a};
|
|
12
|
+
_.h.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable)if(this.I=b.vr.fieldOfView?b.vr.fieldOfView:70,a=a.getSurface()){var c=a.getMedia();if(c&&c.tagName.toLowerCase()===_.He){this.h.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",xq)||this.a.getContext("experimental-webgl",xq);if(!this.f)throw new _.J(1,9,9003,"Unable to create GL context");this.G=new mq;oq(this.G);this.U=new rq(this.f);
|
|
13
|
+
this.A=new qq(this.f);this.J=new mq;this.L=new mq;this.o=this.w=null;this.a.addEventListener(_.$d,this.D)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,!1),this.a.addEventListener(eq,this.K,!1));this.D();this.cg()}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")};
|
|
14
|
+
_.h.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&&(vq(this),this.a.removeEventListener(_.$d,this.D),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.h.onPlayerWillDestroy=function(){var a=this;return _.z(function(b){a.l=null;_.w(b)})};_.h.id=function(){return"vr"};
|
|
15
|
+
_.h.cg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.He){this.w=requestAnimationFrame(this.cg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new sq(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,
|
|
16
|
+
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=nq(this.J,this.L,this.G).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.U;a.a.bindBuffer(a.a.ARRAY_BUFFER,
|
|
17
|
+
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)}}}};
|
|
18
|
+
_.h.aj=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===eq)a.type===eq?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(dq,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
|
|
19
|
+
_.h.bj=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===dq&&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;this.j+=a;this.m+=d;uq(this)};_.h.cj=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();vq(this)};_.h.wi=function(a,b){this.m=b;this.j=a;uq(this)};_.h.gi=function(){return{x:this.j,y:this.m}};_.h.Dj=function(a){this.I=a;this.D()};_.A("clpp.vr.VrPlugin",tq);
|
|
20
|
+
tq.prototype.setCameraFieldOfView=tq.prototype.Dj;tq.prototype.getCameraCoordinates=tq.prototype.gi;tq.prototype.moveCamera=tq.prototype.wi;tq.Id="vr";wq.prototype.create=function(){return new tq};_.gn(new wq);};
|
|
21
|
+
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
22
|
+
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
23
|
+
else{_=this.clpp._;(f.call(g,this));}
|
|
24
|
+
})();
|
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
|
-
else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.
|
|
5
|
-
_
|
|
6
|
-
c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},
|
|
7
|
-
new
|
|
8
|
-
|
|
9
|
-
f/9E4-c}}f=[];e=_.t(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.
|
|
10
|
-
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||_.B("VTT parser encountered an invalid VTTRegion setting: ",l,
|
|
11
|
-
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
|
-
g=m}g&&k.push(g)}return{cues:k,styles:e}};_.u(
|
|
13
|
-
|
|
14
|
-
{duration:null,sampleSize:null,
|
|
15
|
-
"vttc"==F?8<I&&(G=_.
|
|
2
|
+
var f=function(window){var Kp=" The setting will be ignored.",Lp="VTT parser encountered an invalid VTT setting: ",Mp="application/x-subrip",Np="text/srt",Op='text/vtt; codecs\x3d"vtt"',Pp='text/vtt; codecs\x3d"wvtt"',Qp=function(a){_.$n(a,/[ \t]+/gm)},Rp=function(a){return a.a==a.f.length?null:(a=_.$n(a,/[^ \t\n]*/gm))?a[0]:null},Sp=function(){},Tp=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},Up=function(){},Vp=function(a){this.a=a},Xp=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.lg:a.textAlign=
|
|
4
|
+
_.Zo[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Fe:_.Ge;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==_.gd||b==_.ge?_.gd:b==_.hd||b==_.Tc?_.hd:_.qc);else if(d=/^region:(.*)$/.exec(b)){if(b=Wp(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=_.$o[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ng,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.$o[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Wp=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.B("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Yp=function(a){a=_.$n(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)},Zp=function(){Vp.apply(this,arguments)},$p=function(){this.a=null;this.f=new _.D("clpp.vtt.mp4")},bq=function(a,b,c){var d,e,f;(new _.qk).M("payl",_.tk(function(g){d=_.Rg(g)})).M("iden",_.tk(function(g){e=_.Rg(g)})).M("sttg",_.tk(function(g){f=_.Rg(g)})).parse(a);return d?aq(d,e,f,b,c):null},aq=function(a,b,c,d,e){a=new _.qg(d,e,a);b&&(a.id=b);if(c)for(b=new _.Zn(c),c=Rp(b);c;)Xp(a,c,[])||_.B(Lp,
|
|
7
|
+
c,Kp),Qp(b),c=Rp(b);return a},cq=function(){this.a=new Up};Sp.prototype.a=function(a){a=_.Rg(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=_.t(b);for(var c=b.next();!c.done;c=b.next())a+=Tp(c.value)}return _.Vg(a)};Up.prototype.create=function(){return new Sp};Up.prototype.probe=function(a,b){return(a===Np||a===Mp)&&b===_.te};Vp.prototype.parseInit=function(){};
|
|
8
|
+
Vp.prototype.parseMedia=function(a,b){var c=_.Rg(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 _.J(_.K,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=Yp(new _.Zn(e[1]));if(null==c)throw new _.J(_.K,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=_.t(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.Zn(k.replace(/\n/g," "));g=new _.tg;Rp(k);Qp(k);for(var l=Rp(k);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||_.B("VTT parser encountered an invalid VTTRegion setting: ",l,Kp);Qp(k);l=Rp(k)}f.push(g)}}e=[];k=_.t(d);for(g=k.next();!g.done;g=k.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)}k=[];d=_.t(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 _.Zn(p[0]);m=Yp(l);var r=_.$n(l,/[ \t]+--\x3e[ \t]+/g);n=Yp(l);if(null==m||null==r||null==n)throw new _.J(_.K,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.qg(m,n,p,_.Oe);g&&(m.id=g);Qp(l);for(n=Rp(l);n;)Xp(m,n,f)||_.B(Lp,
|
|
12
|
+
n,Kp),Qp(l),n=Rp(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.u(Zp,Vp);Zp.prototype.parseMedia=function(a,b){return Vp.prototype.parseMedia.call(this,(new Sp).a(a),b)};$p.prototype.parseInit=function(a){var b=this,c=!1;(new _.qk).M(_.rd,_.rk).M(_.we,_.rk).M(_.md,_.rk).V("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.Ej(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.Ej(d.F),d.F.skip(8));d.F.skip(4)}).M(_.qd,_.rk).M(_.je,_.rk).V(_.me,_.sk).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.J(_.K,2,2008);if(!c)throw new _.J(_.K,2,2008);};
|
|
13
|
+
$p.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),new _.J(_.K,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.qk).M("moof",_.rk).M("traf",_.rk).V("tfdt",function(M){g=!0;c=0==M.version?_.Ej(M.F):_.Gj(M.F)}).V("tfhd",function(M){var O=M.flags;M=M.F;M.skip(4);O&1&&M.skip(8);O&2&&M.skip(4);m=O&8?_.Ej(M):null}).V("trun",function(M){k=!0;var O=M.version,T=M.flags;M=M.F;var Na=_.Ej(M);T&1&&M.skip(4);T&4&&M.skip(4);for(var fa=[],pa=0;pa<Na;pa++){var za=
|
|
14
|
+
{duration:null,sampleSize:null,Se:null};T&256&&(za.duration=_.Ej(M));T&512&&(za.sampleSize=_.Ej(M));T&1024&&M.skip(4);T&2048&&(za.Se=0==O?_.Ej(M):_.Fj(M));fa.push(za)}d=fa}).M(_.ld,_.tk(function(M){l=!0;e=M})).parse(a);if(!l&&!g&&!k)throw new _.J(_.K,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Aj(p,!1);for(var q=_.t(d),r=q.next();!r.done;r=q.next()){r=r.value;var x=r.duration||m,y=r.Se?c+r.Se:n;n=y+(x||0);var C=0;do{var I=_.Ej(p);C+=I;var F=_.Ej(p);F=_.vk(F);var G=null;
|
|
15
|
+
"vttc"==F?8<I&&(G=_.Hj(p,I-8)):("vtte"!=F&&this.f.error("Unknown box "+F+"! Skipping!"),p.skip(I-8));x?G&&f.push(bq(G,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.f.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&C<r.sampleSize)}return{cues:f.filter(_.nl),styles:[]}};_.u(cq,_.mn);cq.prototype.Ea=function(){_.Go[_.te]=Vp;_.Go[Op]=Vp;_.Go[Pp]=Vp;_.Go[_.Ub]=$p;_.Go[Np]=Zp;_.Go[Mp]=Zp;_.ph.push(this.a)};cq.prototype.va=function(){_.Ho(_.te);_.Ho(Op);_.Ho(Pp);_.Ho(_.Ub);_.Ho(Np);_.Ho(Mp);_.rh(this.a)};cq.prototype.id=function(){return _.qe};_.A("clpp.vtt.VttComponent",cq);};
|
|
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,22 +1,22 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
"ClearKey":b.startsWith(_.Cc)?"Primetime":b)&&a.plugin.setOptions({"content.drm":b}));a.fireJoin()},
|
|
4
|
-
_.wc&&(a.f=!1,a.g.info("Youbora does not report when casting.")):(a.g.warn("No valid Youbora SDK available. Youbora SDK is supported","starting from version",6),a.f=!1,b.onError(new _.J(1,9,9100))):a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},
|
|
5
|
-
_.h.getRendition=function(){var a=this.l.getTrackManager();if(a&&(a=a.fa())){var b=a.width;var c=a.height;var d=a.bandwidth}b&&c&&d||(a=this.l.getStats()||_.
|
|
6
|
-
_.h.getThroughput=function(){return(this.l.getStats()||_.
|
|
7
|
-
_.h.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.he,this.
|
|
8
|
-
_.h.
|
|
9
|
-
break;default:this.a.debug("Unhandled state",a)}};_.h.
|
|
10
|
-
_.h.
|
|
2
|
+
var f=function(window){var Ap="accountCode key is missing",Bp="clpp.npaw.YouboraPlugin",Cp="content.isLive",Dp=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.f=new _.Tf;b.a=new _.D("clpp.npaw.YouboraAdapter");b.h=!1;b.g=!1;b.registerListeners();return b},Ep=function(a){a.plugin.isInitiated||(a.g=!1,a.fireInit())},Fp=function(a){var b=a.l.getDrmInfo();b&&(b=b.keySystem,(b=b.startsWith(_.Fc)?"Widevine":b.startsWith(_.Dc)?"FairPlay":b.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":b.startsWith(_.Jd)?
|
|
3
|
+
"ClearKey":b.startsWith(_.Cc)?"Primetime":b)&&a.plugin.setOptions({"content.drm":b}));a.fireJoin()},Gp=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.a=null;b.h=null;b.f=new _.Tf;b.g=new _.D("clpp.npaw.YouboraAdsAdapter");b.registerListeners();return b},Hp=function(){this.a=null;this.f=!1;this.g=new _.D(Bp);this.h=this.j=null},Ip=function(a,b){var c=b.getConfiguration();a.f=!_.H.R(c.youbora)&&typeof c.youbora===_.Ad;a.f?window.youbora&&6<=+youbora.VERSION.split(".")[0]?b.namespace()===
|
|
4
|
+
_.wc&&(a.f=!1,a.g.info("Youbora does not report when casting.")):(a.g.warn("No valid Youbora SDK available. Youbora SDK is supported","starting from version",6),a.f=!1,b.onError(new _.J(1,9,9100))):a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},Jp=function(){};_.u(Dp,youbora.Adapter);_.h=Dp.prototype;_.h.getPlayhead=function(){return this.l.getPosition()};_.h.getDuration=function(){return this.l.getDuration()};
|
|
5
|
+
_.h.getRendition=function(){var a=this.l.getTrackManager();if(a&&(a=a.fa())){var b=a.width;var c=a.height;var d=a.bandwidth}b&&c&&d||(a=this.l.getStats()||_.vl(),b=b||a.width,c=c||a.height,d=d||a.streamBandwidth);return youbora.Util.buildRenditionString(b,c,d)};_.h.getIsLive=function(){return this.l.isLive()};_.h.getResource=function(){var a=this.l.getLoadedSource();return a&&a.url};_.h.getBitrate=function(){return(this.l.getStats()||_.vl()).streamBandwidth};
|
|
6
|
+
_.h.getThroughput=function(){return(this.l.getStats()||_.vl()).estimatedBandwidth};_.h.getPlayrate=function(){return this.l.getPlaybackRate()};_.h.getFramesPerSecond=function(){var a=this.l.getTrackManager();return a&&(a=a.Da())?a.frameRate:null};_.h.getPlayerName=function(){return _.na};_.h.getVersion=function(){return"6.2.7-castlabsadapter-js"};_.h.getPlayerVersion=function(){return _.da};
|
|
7
|
+
_.h.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.he,this.Hj.bind(this)),this.f.on(this.l,_.Vc,this.Wh.bind(this)),this.f.on(this.l,_.De,this.Bj.bind(this)),this.f.on(this.l,_.Ce,this.Aj.bind(this)),this.f.on(this.l,_.Lb,this.Dg.bind(this)),this.f.on(this.l,_.mc,this.Ig.bind(this)))};_.h.unregisterListeners=function(){this.a.debug(_.nb);_.Zf(this.f)};
|
|
8
|
+
_.h.Hj=function(a){this.a.debug("State changed",a);if(a=a.detail)switch(a.currentState){case _.Ll:this.l.getConfiguration().autoplay&&Ep(this);break;case _.Nl:Ep(this);Fp(this);this.fireResume();this.fireBufferEnd();break;case _.Ml:this.l.getConfiguration().autoplay&&Ep(this);Fp(this);this.fireBufferEnd();this.firePause();break;case _.zl:this.fireBufferEnd();this.fireStop();break;case _.Gl:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.El:this.fireBufferBegin();
|
|
9
|
+
break;default:this.a.debug("Unhandled state",a)}};_.h.Wh=function(a){this.a.debug("Fire error",a);!(a=a.detail)||this.g||10003===a.code&&this.plugin.getAdsAdapter()||(a.severity===_.K?(this.g=!0,this.fireFatalError(""+a.code,a.message)):this.fireError(""+a.code,a.message))};_.h.Bj=function(a){this.a.debug("Seeking",a);this.l.isEnded()||(Ep(this),this.fireSeekBegin())};_.h.Aj=function(a){this.a.debug("Seeked",a);this.fireSeekEnd()};
|
|
10
|
+
_.h.Dg=function(a){this.a.debug("adsTimeline",a);a=a.adsTimeline;this.h=!!a&&a.ab()};_.h.Ig=function(a){this.a.debug("Casting",a);this.fireCasted()};_.u(Gp,youbora.Adapter);_.h=Gp.prototype;_.h.getDuration=function(){return this.a&&this.a.getDuration()};_.h.getRendition=function(){var a=null;this.a&&(a=youbora.Util.buildRenditionString(this.a.pb(),this.a.ob(),this.a.$a()));return a};_.h.getBitrate=function(){return this.a&&this.a.$a()};_.h.getPlayhead=function(){var a=this.l.getAdsManager();return a&&a.getPosition()};_.h.getResource=function(){return this.a&&this.a.getMediaUrl()};_.h.getTitle=function(){return this.a&&this.a.getTitle()};
|
|
11
11
|
_.h.getProvider=function(){return this.a&&this.a.getAdvertiserName()};_.h.getCreativeId=function(){return this.a&&this.a.getCreativeId()};_.h.getPosition=function(){var a=youbora.Constants.AdPosition,b=null;if(this.a)switch(this.a.Qa()){case 0:b=a.Preroll;break;case 2:b=a.Postroll;break;case 1:b=a.Midroll}this.g.debug("Ad position",b);return b};_.h.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};_.h.getAudioEnabled=function(){var a=this.l.getAdsManager();return a&&0<a.getVolume()};
|
|
12
12
|
_.h.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};_.h.getGivenBreaks=function(){return this.getExpectedBreaks()};_.h.getExpectedAds=function(){return this.a&&this.a.rb()};_.h.getGivenAds=function(){return this.getExpectedAds()};_.h.getBreaksTime=function(){var a=this;return this.h&&this.h.getCuePoints().map(function(b){return-1===b?a.l.getDuration():b})};_.h.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};
|
|
13
|
-
_.h.getIsVisible=function(){var a=this.l.getSurface().getContainer();a=youbora.Util.calculateAdViewability(a);this.g.debug("is container visible",a);return a};_.h.getPlayerName=function(){return _.
|
|
14
|
-
_.h.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Lb,this.
|
|
15
|
-
this.f.on(this.l,_.tb,this.
|
|
16
|
-
_.h.
|
|
17
|
-
_.h.
|
|
18
|
-
_.h.onContentWillLoad=function(a,b){
|
|
19
|
-
_.h.
|
|
13
|
+
_.h.getIsVisible=function(){var a=this.l.getSurface().getContainer();a=youbora.Util.calculateAdViewability(a);this.g.debug("is container visible",a);return a};_.h.getPlayerName=function(){return _.na};_.h.getVersion=function(){return"6.2.7-castlabsadsadapter-js"};_.h.getPlayerVersion=function(){return _.da};
|
|
14
|
+
_.h.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Lb,this.Cg.bind(this)),this.f.on(this.l,_.Hb,this.zg.bind(this)),this.f.on(this.l,_.Db,this.wg.bind(this)),this.f.on(this.l,_.Fb,this.xg.bind(this)),this.f.on(this.l,_.xb,this.ug.bind(this)),this.f.on(this.l,_.yb,this.Ud.bind(this,1)),this.f.on(this.l,_.Cb,this.Ud.bind(this,2)),this.f.on(this.l,_.Jb,this.Ud.bind(this,3)),this.f.on(this.l,_.wb,this.tg.bind(this)),this.f.on(this.l,_.Gb,this.yg.bind(this)),this.f.on(this.l,_.Vc,this.vg.bind(this)),
|
|
15
|
+
this.f.on(this.l,_.tb,this.Gg.bind(this)),this.f.on(this.l,_.ub,this.Hg.bind(this)),this.f.on(this.l,_.vb,this.Oi.bind(this)),this.f.on(this.l,_.Eb,this.ej.bind(this)))};_.h.unregisterListeners=function(){_.Zf(this.f)};_.h.Cg=function(a){this.g.debug("ad timeline changed",a);this.h=a.adsTimeline};_.h.zg=function(a){this.g.debug("ad start",a);this.a=a.ad;this.fireStart();this.fireJoin()};_.h.ug=function(a){this.g.debug("ad end",a);this.fireStop()};_.h.wg=function(a){this.g.debug("ad pause",a);this.firePause()};
|
|
16
|
+
_.h.xg=function(a){this.g.debug("ad resume",a);this.fireResume()};_.h.Oi=function(a){this.g.debug("on buffering",a);this.fireBufferBegin()};_.h.ej=function(a){this.g.debug("on progress",a);this.fireBufferEnd()};_.h.Ud=function(a,b){this.g.debug("ad quartile",a,b);this.fireQuartile(a)};_.h.tg=function(a){this.g.debug("ad clicked",a);a=this.a&&this.a.Hb();this.g.debug("ad click through url: ",a);this.fireClick(a)};_.h.yg=function(a){this.g.debug("ad skipped",a);this.fireSkip()};
|
|
17
|
+
_.h.Gg=function(a){this.g.debug("break start",a);this.a=a.ad;this.fireBreakStart()};_.h.Hg=function(a){this.g.debug("ad break stop",a);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&(a=this.plugin.getAdapter())&&a.fireStop()};_.h.vg=function(a){this.g.warn("ad error",a);(a=a.detail)&&10003===a.code&&(a.severity===_.K?this.fireFatalError(""+a.code,a.message):this.fireError(""+a.code,a.message))};_.u(Hp,_.To);_.h=Hp.prototype;_.h.onPlayerCreated=function(a){Ip(this,a);if(this.f){this.j=new Dp(a);this.h=new Gp(a);var b=a.getConfiguration().youbora;b.accountCode?this.Pe(new youbora.Plugin(b)):(this.g.warn(Ap),a.onError(new _.J(1,9,9101)))}};
|
|
18
|
+
_.h.onContentWillLoad=function(a,b){Ip(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[Cp]&&(d[Cp]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Pe(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(Ap),a.onError(new _.J(1,9,9101)))}};_.h.onPlayerWillRelease=function(){};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"youbora"};
|
|
19
|
+
_.h.Pe=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(this.j),this.a.setAdsAdapter(this.h)};_.h.getAdapter=function(){return this.a&&this.a.getAdapter()};_.h.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.A(Bp,Hp);Hp.prototype.getAdsAdapter=Hp.prototype.getAdsAdapter;Hp.prototype.getAdapter=Hp.prototype.getAdapter;Hp.prototype.setYouboraPlugin=Hp.prototype.Pe;Hp.Id="youbora";Jp.prototype.create=function(){return new Hp};_.gn(new Jp);};
|
|
20
20
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
21
21
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
22
22
|
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
|
-
_.x("clpp.adobe.AdobeAnalyticsPlugin",
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var nJ=function(a){a.f=new _.cn;a.f.on(a.l,_.ue,()=>lJ(a));a.f.on(a.l,_.te,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.dd,()=>mJ(a));a.f.on(a.l,_.be,b=>{b=b.detail;switch(b.currentState){case _.Ck:a.a.length||mJ(a);s.Media.play(a.a,a.l.getPosition());break;case _.Bk:case _.uk:lJ(a);break;case _.rk:case _.zk:case _.yk:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),lJ(a),s.Media.close(a.a),a.a=""}})},lJ=function(a){s.Media.stop(a.a,a.l.getPosition())},
|
|
2
|
+
mJ=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(),_.la)},oJ=class extends _.So{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,nJ(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
|
+
_.x("clpp.adobe.AdobeAnalyticsPlugin",oJ);oJ.Id="adobe";_.Cl(new class{create(){return new oJ}});};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(_.Gb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Fb:_.Eb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Ck)this.j?this.l.play().catch(()=>{}):this.m.$(.01);this.l.trigger(new _.F(a))}Ya(){return this.h}
|
|
3
|
-
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var kJ=class extends _.So{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.vn(()=>{this.l.play().catch(()=>{})});this.g=new _.cn}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(_.Gb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Fb:_.Eb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Ck)this.j?this.l.play().catch(()=>{}):this.m.$(.01);this.l.trigger(new _.F(a))}Ya(){return this.h}Yc(){return this.f}Af(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",kJ);kJ.prototype.showCastMenu=kJ.prototype.Af;
|
|
3
|
+
kJ.prototype.canCast=kJ.prototype.Yc;kJ.prototype.isCasting=kJ.prototype.Ya;kJ.Id="airplay";_.Cl(new class{create(){return new kJ}});};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.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},
|
|
3
|
-
break;case _.Ck:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Bk:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Df(this.a),this.a=null)}};var
|
|
4
|
-
this.h),this.f.init()})}}
|
|
5
|
-
_.Cl(new class{create(){return new
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var dJ=function(){return!window.SmartLib||!window.GenericPlayerApi},eJ=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===_.ee&&a.g.setUUID(b))},gJ=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,_.Oc,a.U.bind(a));a.h=new fJ(a.l);a.a.attachPlayer(a.h)},hJ=function(a,b){_.Df(a.j);a.f&&
|
|
2
|
+
(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},iJ=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.cn;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.be,this.m.bind(this));b.on(a,_.Yb,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.p&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.uk&&c.notifyStallEnd(!b.isPaused());switch(d){case _.uk:c.notifyStallStart();
|
|
3
|
+
break;case _.Ck:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Bk:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Df(this.a),this.a=null)}};var fJ=class extends GenericPlayerApi{constructor(a){super();this.l=a;this.a=_.Th()}getPlayerName(){return _.la}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 a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3}};var jJ=class extends _.So{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.cn}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(dJ())return a.onError(new _.H(1,9,11E3));eJ(this,c);gJ(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}));hJ(this,void 0)}else b.url=d.getURL(),this.f=new iJ(this.l,
|
|
4
|
+
this.h),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)hJ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:hJ(this,SmartLib.BPDecodingError);break;case 1:hJ(this,SmartLib.BPNetworkingError);break;case 6:hJ(this,SmartLib.BPAccessRightError);break;default:hJ(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){dJ()||hJ(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",jJ);jJ.isSdkMissing=dJ;jJ.Id="broadpeak";
|
|
5
|
+
_.Cl(new class{create(){return new jJ}});};f.call(g, window);
|