@castlabs/prestoplay 6.32.0-beta.2 → 6.32.0-beta.5
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/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +56 -56
- package/cjs/cl.cdn.js +5 -5
- package/cjs/cl.conviva.js +18 -18
- package/cjs/cl.core.js +191 -191
- package/cjs/cl.dash.js +51 -51
- package/cjs/cl.freewheel.js +9 -9
- package/cjs/cl.hls.js +54 -54
- package/cjs/cl.hlssmpte.js +1 -1
- package/cjs/cl.htmlcue.js +3 -3
- package/cjs/cl.ima.js +11 -11
- package/cjs/cl.mediatailor.js +2 -2
- package/cjs/cl.mse.js +125 -125
- package/cjs/cl.muxdata.js +8 -8
- package/cjs/cl.persistent.js +2 -2
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.simid.js +3 -3
- package/cjs/cl.smooth.js +28 -28
- package/cjs/cl.thumbnails.js +3 -3
- package/cjs/cl.tizen.js +34 -34
- package/cjs/cl.ttml.js +3 -3
- package/cjs/cl.verimatrix.js +1 -1
- package/cjs/cl.vimond.js +8 -8
- package/cjs/cl.vr.js +7 -7
- package/cjs/cl.vtt.js +1 -1
- package/cjs/cl.yospace.js +2 -2
- package/cjs/cl.youbora.js +11 -11
- package/cl.airplay.js +1 -1
- package/cl.cast.js +29 -29
- package/cl.cdn.js +5 -5
- package/cl.conviva.js +3 -3
- package/cl.core.js +116 -116
- package/cl.dash.js +48 -48
- package/cl.freewheel.js +3 -3
- package/cl.hls.js +35 -35
- package/cl.htmlcue.js +1 -1
- package/cl.ima.js +1 -1
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +78 -78
- package/cl.muxdata.js +2 -2
- package/cl.persistent.js +1 -1
- package/cl.playlist.js +4 -4
- package/cl.simid.js +1 -1
- package/cl.smooth.js +22 -22
- package/cl.thumbnails.js +4 -4
- package/cl.tizen.js +15 -15
- package/cl.ttml.js +2 -2
- package/cl.verimatrix.js +1 -1
- package/cl.vimond.js +2 -2
- package/cl.vr.js +2 -2
- package/cl.vtt.js +2 -2
- package/cl.yospace.js +2 -2
- package/cl.youbora.js +8 -8
- package/package.json +1 -1
package/cjs/cl.ttml.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var f=function(window){var Gy='application/mp4; codecs\x3d"stpp.ttml"',Hy='application/mp4; codecs\x3d"stpp.ttml.im1i"',Iy='application/mp4; codecs\x3d"stpp.ttml.im1t"',Jy="backgroundColor",Ky="direction",Ly="displayAlign",My="region",Ny="sans-serif",Oy="textAlign",Py="textDecoration",Qy="writingMode",Ry=function(a,b,c){this.h=a;this.f=b;this.a=c},Sy=function(a,b,c){Ry.call(this,a,[],c);this.j=b||""},Ty=function(a,b,c){Ry.call(this,a,b,c)},Uy=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(e.hasAttribute(c))return e.getAttribute(c)}return null},
|
|
3
3
|
bz=function(a,b){var c=null;if(Vy.test(a)){c=Vy.exec(a);var d=Number(c[1]),e=Number(c[2]),f=Number(c[3]),g=Number(c[4]);g+=(Number(c[5])||0)/b.f;f+=g/b.frameRate;c=f+60*e+3600*d}else Wy.test(a)?c=Xy(Wy,a):Yy.test(a)?c=Xy(Yy,a):Zy.test(a)?(c=Zy.exec(a),c=Number(c[1])/b.frameRate):$y.test(a)?(c=$y.exec(a),c=Number(c[1])/b.a):az.test(a)&&(c=Xy(az,a));return c},Xy=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||
|
|
4
4
|
0)},cz=function(a){return a.split(":").pop()},dz=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},fz=function(a,b){for(;ez.test(a);){var c=ez.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},gz=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},hz=function(a,b,c,d,e,f,g){Ry.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},iz=function(a,b,c){a=Uy(a,b,Oy);if(!a&&c&&(a=Uy(c,b,Oy),!a&&"rltb"===Uy(c,b,Qy)))return _.oe;switch(a){case _.nd:return _.Ep;
|
|
5
|
-
case _.Wf:case _.oe:return _.oe;default:return _.jg}},jz=function(a,b,c){if(_.R.
|
|
5
|
+
case _.Wf:case _.oe:return _.oe;default:return _.jg}},jz=function(a,b,c){if(_.R.Uf(a.w))return document.createTextNode(_.R.vh(a.w||""));if(a.A)return _.cj("br");for(var d=_.cj("span"),e=_.v(a.f),f=e.next();!f.done;f=e.next())_.dj(d,f.value);a=_.v(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(jz(c.get(e.value),b,c));return d},kz=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&
|
|
6
6
|
(this.frameRate*=Number(a[1])/Number(a[2]))},lz=function(a,b,c){Ry.call(this,a,b,c)},oz=function(a,b,c,d){var e=mz.exec(a);a=nz.exec(a);return typeof b===_.h&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},pz=function(a,b){return typeof b===_.h&&0<b?_.Kp:nz.test(a)?0:_.Kp},qz=function(a,b){Ry.call(this,"root-container",[],b);this.j=a},rz=function(a,b,c){return typeof a===_.h?a:typeof b===_.h?b:c},sz=function(a,b){var c=a.getAttribute("extent");return(c=nz.exec(c))?Number(c[b]):null},uz=
|
|
7
7
|
function(a){a=a.getAttribute("cellResolution");return(a=tz.exec(a))?Number(a[2]):null},vz=function(a,b,c){Ry.call(this,a,b,c)},wz=function(a){this.B=a;this.w=this.l=null;this.A=0;this.h=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},yz=function(a){return xz.some(function(b){return b in a.attributes})},zz=function(a,b){if(0===b.length)return[];for(var c=[],d=_.v(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.uh(zz(a,a.a.get(e).f)).concat([e]));return c},Bz=
|
|
8
8
|
function(){return"inline-"+Az++},Cz=function(a){return a.o.map(function(b){return b.build(a.l,a.w,a.A,a.h,a.a,a.j,a.f)}).filter(function(b){return null!=b})},Dz=function(a){this.a=a.firstChild;this.f=new Set},Ez=function(a,b,c,d,e,f){this.h=a;this.a=b;this.j=c;this.l=d;this.f=e;this.attributes=f},Fz=function(a){return cz(a.h.nodeName)},Gz=function(){this.a=new Map},Iz=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},k=b.parentNode;if(k&&a.a.has(k)){var l=a.a.get(k);e=
|
|
@@ -19,10 +19,10 @@ vz.prototype.build=function(a){var b=null;var c=uz(a);c&&(b=rz(a.j.containerHeig
|
|
|
19
19
|
e+";";break a}}d=""}c+=d;a:{if("textOutline"in this.a){d=this.a.textOutline.split(" ");e="black";f=".4em";var g=d[0]&&d[0].trim(),k=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!Pz.test(g)&&Pz.test(k)&&Pz.test(l)?(e=g,f=k):2===d.length&&!Pz.test(g)&&Pz.test(k)?(e=g,f=k):2===d.length&&Pz.test(g)&&Pz.test(k)&&(f=g);if(""!==f){f=dz(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c+=d;"textShadow"in this.a?(d=gz(this.a.textShadow),d=dz(d),d="text-shadow:"+
|
|
20
20
|
d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",Ny).replace("proportionalSerif",Ny).replace("sansSerif",Ny).replace("default",Ny)+";":"");a:{if(Py in this.a){d=[];e=_.v(this.a.textDecoration.split(" "));for(f=e.next();!f.done;f=e.next())switch(f=f.value,f){case "underline":case "overline":d.push(f);break;case "lineThrough":d.push("line-through")}if(0<d.length){d=
|
|
21
21
|
"text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+dz(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=dz(e),e=fz(e,b),d=d+"line-height:"+e+";"):d="";a.push(c+d+"}");a:{if("fontSize"in this.a&&(c=this.a.fontSize.split(" "),d=null,1===c.length&&(d=c[0]),2===c.length&&(d=c[1]),d)){d=d.trim();d=dz(d);d=fz(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.h+" .clpp-text-wrapper {",a.push(c+b+"}"),
|
|
22
|
-
c="::ttml .clpp-text-wrapper__"+this.h+" {",a.push(c+b+"}"));return a};var Qz=new Map([[Jy,"background-color"],["color","color"],[Ky,Ky],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Az=0;Dz.prototype.
|
|
22
|
+
c="::ttml .clpp-text-wrapper__"+this.h+" {",a.push(c+b+"}"));return a};var Qz=new Map([[Jy,"background-color"],["color","color"],[Ky,Ky],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Az=0;Dz.prototype.Ge=function(){return!!this.a};Dz.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Rz.has(cz(a.nodeName))||Sz.has(cz(a.nodeName))||!a.firstChild||this.f.has(a.firstChild)?a.nextSibling?a=a.nextSibling:a=a.parentNode:a=a.firstChild;while(a&&(this.f.has(a)||a.nodeType!==Node.TEXT_NODE&&!Rz.has(cz(a.nodeName))));var b=this.a;this.a=a;return b};
|
|
23
23
|
var Rz=new Set(["tt","head","layout",_.Se,_.Be,My,"styling",_.pg,"body",_.Xd,"p","span","br"]),Sz=new Set([_.pg,_.Be]);Ez.prototype.getId=function(){return this.attributes.id};Jz.prototype.parseInit=function(){};
|
|
24
24
|
Jz.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.N.xb(this.a.ttml||{}),e=_.Vi(a,0,c[0]);e=_.R.ea(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.vg)}catch(n){throw new _.O(_.P,2,2005,"Failed to parse TTML.");}d=new wz(d);e=new Gz;f=new Dz(f);b=b.periodStart;typeof b===_.h&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var k=c[g],l=_.Vi(a,b,k);l=_.Nm(l);var m="urn:mpeg:14496-30:subs:"+g;d.h.set(m,new Sy(m,l,{imageType:"PNG",encoding:"Base64"}));
|
|
25
|
-
b+=k}for(;f.
|
|
25
|
+
b+=k}for(;f.Ge();)a=f.next(),a=Iz(e,a),"tt"===Fz(a)&&(d.l=new qz(d.B,Object.assign({},a.attributes))),"tt"===Fz(a)&&(d.w=new kz(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Fz(a)!==_.Be||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.h.set(c,new Sy(c,a.h.textContent,a.attributes))),Fz(a)===_.Be&&a.attributes.begin&&a.attributes.end?(c="#"+Bz(),b=new Sy(c,a.h.textContent,a.attributes),d.h.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
|
|
26
26
|
Fz(a)===_.pg&&(c=a.getId()||Bz(),b=new vz(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Fz(a)!==_.pg&&yz(a)?(c=Bz(),b=new vz(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Fz(a)!==_.Xd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Bz(),b=new lz(c,zz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Fz(a)!==My?c=null:(c=a.getId(),b=new lz(c,zz(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
|
|
27
27
|
c=b),c&&(a.a=c.getId()),c=a.l,-1===[_.da,"span","br"].indexOf(Fz(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Bz(),b=new hz(c,a.h.nodeName===_.da?a.h.textContent:null,"br"===Fz(a),a.a,a.j,zz(d,a.f),a.attributes),d.f.set(c,b),(g=d.f.get(g))&&g.j.push(c),c=b):c=null),c&&a.l.push(c.getId()),"p"===Fz(a)||a.j?(c=Bz(),b=new hz(c,null,!1,a.a,a.j,zz(d,a.f),a.attributes),d.f.set(c,b),d.o.push(b),c=b):c=null,c&&a.l.push(c.getId());e=Cz(d);f=[];a=_.v(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
|
|
28
28
|
_.uh(c.value.build(d.l)));return{cues:e,styles:f}};Kz.prototype.a=function(a){a=(new Jz(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.v(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Lz(c.startTime)+" --\x3e "+Lz(c.endTime),e=[];switch(c.textAlign){case _.Ee:e.push("align:left");break;case _.Wf:e.push("align:right");break;case _.Ep:e.push("align:middle");break;case _.jg:e.push("align:start");break;case _.oe:e.push("align:end")}switch(c.writingMode){case _.Rg:e.push("vertical:lr");break;
|
package/cjs/cl.verimatrix.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var f=function(window){var uy="VerimatrixVCAS",vy="clpp.verimatrix.Vcas",wy="clpp.verimatrix.VcasComponent",Cy=function(a){_.eq.call(this,uy);var b={};b[xy]=xy;b[yy]=yy;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?zy:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,k=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Ay:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
|
|
3
3
|
this.D=d;this.B=b;this.w=By(this,e);this.o=By(this,f);this.l=By(this,g);this.j=k;this.H=l;this.G=m;this.g=new _.M(vy);_.R.empty(this.w)?this.g.warn(_.Yb):this.Ma(_.Md,{licenseUrl:this.w,videoRobustness:[_.Db,void 0],audioRobustness:[_.Cb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.R.empty(this.o)?this.g.warn(_.sb):this.Ma(_.Kd,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
|
|
4
4
|
_.R.empty(this.l)?this.g.warn(_.Pa):_.R.empty(this.j)?this.g.warn(_.Oa):this.Ma(_.Id,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},By=function(a,b){if(a.D===zy){var c=Object.assign({},{deviceId:_.Om(_.R.Yd(a.A))},a.a&&{authenticator:_.Om(_.R.Yd(a.a))});return b+_.Bn(c)}return b},Dy=function(){this.g=new _.M(wy)};_.w(Cy,_.eq);
|
|
5
|
-
Cy.prototype.h=function(a,b){if(this.D===Ey){var c=this.B[yy],d={};d[this.B[xy]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Cy.prototype.I=function(a,b){var c=_.Cq(b);switch(this.G){case Fy:c=_.Bn({r:c,
|
|
5
|
+
Cy.prototype.h=function(a,b){if(this.D===Ey){var c=this.B[yy],d={};d[this.B[xy]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Cy.prototype.I=function(a,b){var c=_.Cq(b);switch(this.G){case Fy:c=_.Bn({r:c,jq:this.H},!0)}return c};Cy.prototype.K=function(a,b){this.h(a,b);_.Fq(b)};Cy.prototype.L=function(a,b){_.Gq(b)};_.K(vy,Cy);Cy.prototype.constructor=Cy.prototype.constructor;Cy.NAME=uy;var zy="query-string",Ey="http-header";
|
|
6
6
|
Cy.LicenseRequestVuidLocation={QUERY_STRING:zy,HTTP_HEADER:Ey};var xy="DeviceId",yy="Authenticator";Cy.LicenseRequestHttpHeader={DEVICE_ID_HEADER:xy,AUTHENTICATOR_HEADER:yy};var Ay="keyid",Fy="contentid-siteid";Cy.FairPlayAssetIdStrategy={KEYID:Ay,CONTENTID_SITEID:Fy};_.w(Dy,_.jv);Dy.prototype.uninstall=function(){delete _.Yn.VerimatrixVCAS};Dy.prototype.beforeLoad=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===uy){a=a.drm.customData;if(!a)throw new _.O(_.P,7,7100,_.Nd);a=new Cy(a);this.g.info("Registering the Verimatrix VCAS Ultra environment");_.Zn(a)}};Dy.prototype.id=function(){return"verimatrix-vcas"};_.K(wy,Dy);};
|
|
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;});}
|
package/cjs/cl.vimond.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var ky="Registering listeners",ly="clpp.vimond.VimondPlugin",my=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.Bi;this.l=!0;this.h=this.j=this.A=!1;this.B=null;this.f=new _.lj(this.
|
|
2
|
+
var f=function(window){var ky="Registering listeners",ly="clpp.vimond.VimondPlugin",my=function(a,b,c,d,e){this.G=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.Bi;this.l=!0;this.h=this.j=this.A=!1;this.B=null;this.f=new _.lj(this.Ai.bind(this));this.g=new _.M("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.g.debug(ky),this.a.on(this.m,_.kg,this.Vl.bind(this)),this.a.on(this.m,_.Bg,this.Wl.bind(this)),this.a.on(this.m,_.ic,this.Tl.bind(this)),this.a.on(this.m,_.jc,this.Ul.bind(this)))},ny=function(a,
|
|
3
3
|
b){a.m.trigger(new _.Q(_.Yg,{detail:b}))},oy=function(a,b,c){b&&(a.A=!0,a.f.stop());a.m.onError(new _.O(b?_.P:1,9,9201,c))},py=function(a,b,c,d,e){this.l=a;this.o=c;this.h=b;this.a=d;this.j=e;this.g=new _.M("clpp.vimond.VimondService");this.f=0},qy=function(a){this.m=a;this.a=new _.Bi;this.g=new _.M("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.m&&this.a&&(this.g.debug(ky),this.a.on(this.m,_.Sf,this.o.bind(this)),this.a.on(this.m,_.ic,this.j.bind(this)),this.a.on(this.m,_.jc,this.l.bind(this)))},
|
|
4
|
-
ry=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.Af];if(a.h)return[_.oe,_.lf];if(5===c)return[_.oe,null];if(c===_.Fo)return[_.qe,_.lf];var d=_.lf;if(2===c||3===c||a.f)d=_.Af;return["period",d]},sy=function(){this.a=!1;this.g=new _.M(ly);this.j=this.h=this.f=null},ty=function(){};_.r=my.prototype;_.r.
|
|
5
|
-
_.r.
|
|
6
|
-
_.r.
|
|
7
|
-
b.B=e;return _.y(k,b.
|
|
8
|
-
_.r.
|
|
4
|
+
ry=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.Af];if(a.h)return[_.oe,_.lf];if(5===c)return[_.oe,null];if(c===_.Fo)return[_.qe,_.lf];var d=_.lf;if(2===c||3===c||a.f)d=_.Af;return["period",d]},sy=function(){this.a=!1;this.g=new _.M(ly);this.j=this.h=this.f=null},ty=function(){};_.r=my.prototype;_.r.Wl=function(){this.h||(this.h=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Tl=function(){this.g.debug("Ad break started");this.j=!0};
|
|
5
|
+
_.r.Ul=function(){this.g.debug("Ad break stopped");this.j=!1};
|
|
6
|
+
_.r.Vl=function(a){var b=this,c,d,e,f,g;return _.I(function(k){if(1==k.a){c=a.detail;d=_.tu;e=c.currentState;f=c.previousState;b.g.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.h)return b.g.debug("Ignore transition"),k["return"]();if(b.l&&e!==d.PLAYING)return k["return"]();if(b.h&&[d.PAUSED,d.BUFFERING].includes(e))return b.g.debug("Seeking"),k["return"]();b.h&&e===d.PLAYING&&(b.g.debug("Seeked"),b.h=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.C(0);
|
|
7
|
+
b.B=e;return _.y(k,b.Ai(),3)}e===d.ENDED&&b.f.stop();_.A(k)})};
|
|
8
|
+
_.r.Ai=function(){var a=this,b,c,d,e,f,g;return _.I(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.g.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.f.stop();a.f.ia(a.l?10:a.G);a.l=!1;_.F(k,2);return _.y(k,a.D.fireEvent(),4)}if(2!=k.a)return b=k.f,ny(a,b),_.G(k,0);d=c=_.H(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.g.debug("Unreachable service"),ny(a,f),oy(a,a.H,f)):1001===e?(a.g.debug("Generic service error"),ny(a,f),oy(a,a.I,f)):a.g.error(c.toString());_.A(k)})};py.prototype.fireEvent=function(){this.f++;var a=_.N.ta(this.o);a.client.buildName=_.ya;a.client.buildVersion=_.ia;var b=a.client,c=this.a.m.getDrmInfo();b.drm=c?c.keySystem:"";a.client.pageUrl=document.location.href;a.client.streamUrl=this.a.m.ab().url;a.client.userAgent=navigator.userAgent;a.client.videoFormat=this.a.m.ab().type||"";b=a.client;c=this.a.m.ab();c=((new _.zn(c.url)).scheme||"").replace(":","");b.videoProtocol=c;b=ry(this.a,this.f);a.client.playerEvent=b[0]||"";a.client.playerState=
|
|
9
9
|
b[1]||"";a.progress.vod&&(a.progress.vod.position=this.a.getPosition());if(b=a.progress.live){c=this.a;var d=c.m.getPresentationStartTime()||0;c=Math.floor(d+c.m.getPosition());c=(new Date(1E3*c)).toISOString();b.position=c;d=this.a;c=d.m.getPosition();d=d.m.getSeekRange().end;b.onLiveEdge=30>Math.abs(d-c);typeof b.liveResumePossible!==_.cd&&(b.liveResumePossible=!0)}a.progress.eventNumber=this.f;a.timestamp=(new Date).toISOString();this.g.debug("Fire an event");b=_.dl(this.l);b.method=_.rb;b.contentType=
|
|
10
|
-
"application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.Yd(JSON.stringify(a));return this.j.fetch(b).U};py.prototype.
|
|
10
|
+
"application/json";b.headers.Authorization="Bearer "+this.h;b.body=_.R.Yd(JSON.stringify(a));return this.j.fetch(b).U};py.prototype.Dh=function(a){this.h=a};qy.prototype.getPosition=function(){return Math.floor(this.m.getPosition())};qy.prototype.o=function(){this.h=!0};qy.prototype.j=function(){this.f=!0};qy.prototype.l=function(){this.f=!1};_.w(sy,_.gw);_.r=sy.prototype;_.r.onPlayerCreated=function(){};
|
|
11
11
|
_.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.N.R(b.vimond)&&typeof b.vimond===_.$e)?a.namespace()===_.xd&&(this.a=!1,this.g.info("Vimond does not report when casting.")):this.g.debug("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.v(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.g.warn(d+" key is missing");a.onError(new _.O(1,9,9200));return}this.g.debug("Configuration is valid");
|
|
12
12
|
c=b.failIfUnreachable;typeof c!==_.cd&&(c=!0);d=b.failOnError;typeof d!==_.cd&&(d=!0);this.f=new qy(a);this.h=new py(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new my(b.playerEventRequest.eventInterval,c,d,a,this.h)}};_.r.onPlayerWillRelease=function(){if(this.a){if(this.f){var a=this.f;a.g.debug(_.Qb);_.Ei(a.a)}this.j&&(a=this.j,a.g.debug(_.Qb),_.Ei(a.a),a.f.stop());this.j=this.h=this.f=null}};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
|
|
13
|
-
_.r.
|
|
13
|
+
_.r.Dh=function(a){this.a&&this.h&&this.h.Dh(a)};_.K(ly,sy);sy.prototype.updateAuthToken=sy.prototype.Dh;sy.Id="vimond";ty.prototype.create=function(){return new sy};_.fp(new ty);};
|
|
14
14
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
15
15
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
16
16
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.vr.js
CHANGED
|
@@ -7,18 +7,18 @@ by(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute
|
|
|
7
7
|
9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},dy=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
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.h=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)},ey=function(a,
|
|
9
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)},fy=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
|
|
10
|
-
this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=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.l=this.j=0;this.h={x:0,y:0};this.T=new Zx;this.W=new Zx;this.ha=new Zx;this.ma=new Zx;this.B=this
|
|
11
|
-
this.D=this.
|
|
10
|
+
this.ba=this.H=this.f=this.a=this.m=null;this.g=new _.M("clpp.vr");this.I=70;this.X=1;this.P=this.M=!1;this.G=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.l=this.j=0;this.h={x:0,y:0};this.T=new Zx;this.W=new Zx;this.ha=new Zx;this.ma=new Zx;this.B=this.ao.bind(this);
|
|
11
|
+
this.D=this.bo.bind(this);this.K=this.$n.bind(this)},gy=function(a){var b=Ux(1,0,a.l*Math.PI/180);Tx(Ux(0,1,a.j*Math.PI/180),a.T);Tx(b,a.W);ay(a.ha);$x(a.ma,a.T,a.ha);$x(a.H,a.W,a.ma)},hy=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Qx,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},iy=function(){};Vx.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Zx.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,t,u,z){var B=this.a;B[0]=a;B[4]=b;B[8]=c;B[12]=d;B[1]=e;B[5]=f;B[9]=g;B[13]=k;B[2]=l;B[6]=m;B[10]=n;B[14]=p;B[3]=q;B[7]=t;B[11]=u;B[15]=z;return this};var jy={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(fy,_.gw);_.r=fy.prototype;_.r.onPlayerCreated=function(a){this.g.info("Player created");this.m=a};
|
|
12
12
|
_.r.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&&_.N.ya(d))this.I=d;else throw new _.O(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.N.ya(e)&&0<e)this.X=e;else throw new _.O(1,7,7100,"sensitivity configuration must be a positive number");this.M=!!f;this.P=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Tg){this.g.info("Initialize VR Surface");
|
|
13
13
|
if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",jy)||this.a.getContext("experimental-webgl",jy);if(!this.f)throw new _.O(1,9,9003,"Unable to create GL context");this.H=new Zx;ay(this.H);this.ba=new dy(this.f);this.A=new cy(this.f);this.J=new Zx;this.L=new Zx;this.o=this.w=null;this.a.addEventListener(_.Vf,this.G)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
|
|
14
|
-
!1),this.a.addEventListener(Rx,this.K,!1));this.G();this.
|
|
14
|
+
!1),this.a.addEventListener(Rx,this.K,!1));this.G();this.Qj()}else this.g.info("No video element found, can not initialize VR plugin");else this.g.info("No surface found, can not initialize VR plugin")}};
|
|
15
15
|
_.r.onPlayerWillRelease=function(){this.g.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.h.x=0;this.l=this.j=this.h.y=0;this.f&&(delete this.f,this.f=null);this.a&&(hy(this),this.a.removeEventListener(_.Vf,this.G),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.r.onPlayerWillDestroy=function(){var a=this;return _.I(function(b){a.m=null;_.A(b)})};_.r.id=function(){return"vr"};
|
|
16
|
-
_.r.
|
|
16
|
+
_.r.Qj=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Tg){this.w=requestAnimationFrame(this.Qj.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new ey(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
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=$x(this.J,this.L,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.h,!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.ba;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.h);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
|
|
19
|
-
_.r
|
|
20
|
-
_.r
|
|
21
|
-
_.r.
|
|
19
|
+
_.r.$n=function(a){this.g.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Rx)a.type===Rx?a.touches[0]&&(this.h.x=a.touches[0].clientX,this.h.y=a.touches[0].clientY):(this.h.x=a.clientX,this.h.y=a.clientY),this.g.debug("Mouse Start coordinates:",this.h,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(Qx,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
|
|
20
|
+
_.r.ao=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Qx&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.h.x-b;var d=this.h.y-c;this.h.x=b;this.h.y=c;b=this.X;c=d*b*(this.P?-1:1);this.j+=a*b*(this.M?-1:1);this.l+=c;gy(this)};_.r.bo=function(a){this.g.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();hy(this)};_.r.tn=function(a,b){this.l=b;this.j=a;gy(this)};_.r.xm=function(){return{x:this.j,y:this.l}};
|
|
21
|
+
_.r.Xo=function(a){this.I=a;this.G()};_.K("clpp.vr.VrPlugin",fy);fy.prototype.setCameraFieldOfView=fy.prototype.Xo;fy.prototype.getCameraCoordinates=fy.prototype.xm;fy.prototype.moveCamera=fy.prototype.tn;fy.Id="vr";iy.prototype.create=function(){return new fy};_.fp(new iy);};
|
|
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
|
@@ -11,7 +11,7 @@ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|10
|
|
|
11
11
|
e.push(m[0]);while(m)}k=[];d=_.v(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 _.et(p[0]);m=Kx(l);var t=_.ft(l,/[ \t]+--\x3e[ \t]+/g);n=Kx(l);if(null==m||null==t||null==n)throw new _.O(_.P,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Jp(m,n,p,_.$g);g&&(m.id=g);Cx(l);for(n=Dx(l);n;)Jx(m,n,f)||_.Vh(xx,
|
|
12
12
|
n,wx),Cx(l),n=Dx(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.w(Lx,Hx);Lx.prototype.parseMedia=function(a,b){return Hx.prototype.parseMedia.call(this,(new Ex).a(a),b)};Mx.prototype.parseInit=function(a){var b=this,c=!1;(new _.tq).N(_.We,_.uq).N(_.Dg,_.uq).N(_.Qe,_.uq).da("mdhd",function(d){0===d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.oq(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.oq(d.reader),d.reader.skip(8));d.reader.skip(4)}).N(_.Ve,_.uq).N(_.mg,_.uq).da(_.og,_.vq).N("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.O(_.P,2,2008);if(!c)throw new _.O(_.P,2,2008);};
|
|
13
13
|
Mx.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.O(_.P,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.tq).N("moof",_.uq).N("traf",_.uq).da("tfdt",function(x){g=!0;c=0===x.version?_.oq(x.reader):_.qq(x.reader)}).da("tfhd",function(x){var J=x.flags;x=x.reader;x.skip(4);J&1&&x.skip(8);J&2&&x.skip(4);m=J&8?_.oq(x):null}).da("trun",function(x){k=!0;var J=x.version,L=x.flags;x=x.reader;var U=_.oq(x);L&1&&x.skip(4);L&4&&x.skip(4);for(var V=
|
|
14
|
-
[],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,
|
|
14
|
+
[],ta=0;ta<U;ta++){var za={duration:null,sampleSize:null,zh:null};L&256&&(za.duration=_.oq(x));L&512&&(za.sampleSize=_.oq(x));L&1024&&x.skip(4);L&2048&&(za.zh=0===J?_.oq(x):_.pq(x));V.push(za)}d=V}).N(_.Pe,_.wq(function(x){l=!0;e=x})).parse(a);if(!l&&!g&&!k)throw new _.O(_.P,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.jq(p,!1);for(var q=_.v(d),t=q.next();!t.done;t=q.next()){t=t.value;var u=t.duration||m,z=t.zh?c+t.zh:n;n=z+(u||0);var B=0;do{var D=_.oq(p);B+=D;var C=
|
|
15
15
|
_.oq(p);C=_.yq(C);var E=null;"vttc"===C?8<D&&(E=_.sq(p,D-8)):("vtte"!==C&&this.g.error("Unknown box "+C+"! Skipping!"),p.skip(D-8));u?E&&f.push(Ox(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&B<t.sampleSize)}return{cues:f.filter(_.wn),styles:[]}};_.w(Px,_.jv);Px.prototype.install=function(){_.Bv(_.ug,Hx);_.Bv(Ax,Hx);_.Bv(Bx,Hx);_.Bv(_.Oc,Mx);_.Bv(zx,Lx);_.Bv(yx,Lx);_.Ct.push(this.a)};Px.prototype.uninstall=function(){_.Dv(_.ug);_.Dv(Ax);_.Dv(Bx);_.Dv(_.Oc);_.Dv(zx);_.Dv(yx);_.Et(this.a)};Px.prototype.id=function(){return"subtitles-vtt"};_.K("clpp.vtt.VttComponent",Px);};
|
|
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;});}
|
package/cjs/cl.yospace.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var rx="clpp.yospace.YospacePlugin",sx=function(){this.a=null;this.g=new _.M(rx)},tx=function(){};_.w(sx,_.gw);sx.prototype.
|
|
2
|
+
var f=function(window){var rx="clpp.yospace.YospacePlugin",sx=function(){this.a=null;this.g=new _.M(rx)},tx=function(){};_.w(sx,_.gw);sx.prototype.Ri=function(){return this.a};
|
|
3
3
|
sx.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f,g,k;return _.I(function(l){if(1==l.a){d=a.getConfiguration();e=d.yospace;if(!e.enabled)return l["return"]();if(typeof window.YospaceAdManagement!==_.$e)throw new _.O(_.P,9,7003,"Yospace SDK not found.");c.g.info("Yospace enabled.");f=e.streamType||ux;a:{var m=b.url;c.g.info("Creating Yospace session for stream type",f);switch(f){case ux:m=YospaceAdManagement.SessionVOD.create(m);break a;case vx:m=YospaceAdManagement.SessionLive.create(m);
|
|
4
4
|
break a;default:m=YospaceAdManagement.SessionDVRLive.create(m)}}return _.y(l,m,2)}g=l.f;k=g.getSessionState();if(k!==YospaceAdManagement.SessionState.INITIALISED)throw c.g.error("Failed to initialize Yospace session. State:",k,"URL",b.url),new _.O(_.P,9,7003,"Yospace session failed to initialize.");a.trigger(new _.Q(_.qh,{detail:g}));b.url=g.getPlaybackUrl();c.g.info("Yospace session initialized. New URL:",b.url);c.a=g;_.A(l)})};
|
|
5
|
-
sx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.ph,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.K(rx,sx);sx.prototype.getSession=sx.prototype.
|
|
5
|
+
sx.prototype.onPlayerWillRelease=function(a){if(this.a){this.g.info("Shutting down Yospace session.");var b=this.a;this.a.shutdown();this.a=null;a.trigger(new _.Q(_.ph,{detail:b}))}};sx.prototype.id=function(){return"yospace"};_.K(rx,sx);sx.prototype.getSession=sx.prototype.Ri;sx.Id="yospace";tx.prototype.create=function(){return new sx};var ux=_.Vb,vx="LIVE";_.K("clpp.yospace.StreamType",{VOD:ux,LIVE:vx,DVR:"DVR"});_.fp(new tx);};
|
|
6
6
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
7
7
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
8
8
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.youbora.js
CHANGED
|
@@ -3,7 +3,7 @@ var f=function(window){var Pw='" event to NPAW',Qw='" event to Youbora',Rw='Repo
|
|
|
3
3
|
a.startsWith(_.Hd)?"Primetime":a},dx=function(a){return a&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},ex=function(a,b,c,d){b=dx(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.qe;b.severity===_.P?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Rw+a+'" to Youbora',b.code,b));return b},
|
|
4
4
|
fx=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Bi;d.g=new _.M("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.B=!1;d.registerListeners();return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();if(c&&(c=c.sa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),
|
|
5
5
|
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.m.isLive()};b.prototype.getResource=function(){var c=this.m.ab();return c&&c.url};b.prototype.getBitrate=function(){return this.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.Ec()};b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&
|
|
6
|
-
(c=c.Ra())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.
|
|
6
|
+
(c=c.Ra())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.5-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.kg,this.K.bind(this)),this.a.on(this.m,_.qe,this.H.bind(this)),this.a.on(this.m,_.Og,this.J.bind(this)),this.a.on(this.m,_.Ng,this.I.bind(this)),
|
|
7
7
|
this.a.on(this.m,_.Fc,this.D.bind(this)),this.a.on(this.m,_.id,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.Qb);_.Ei(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.j=function(){return this.m.getStats()||_.lu()};b.prototype.w=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.l("state change",c);if(c)switch(c.currentState){case 1:this.w()&&this.f();break;case 3:this.f();
|
|
8
8
|
this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.w()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:this.g.debug(Sw,c)}};b.prototype.f=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=cx(c.keySystem))&&
|
|
9
9
|
this.plugin.setOptions({"content.drm":c});this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=ex(c,this.m.getConfiguration().youbora,this.g,this))&&c.severity===_.P&&(this.h=!0)};b.prototype.J=function(){this.m.isEnded()||(this.l(_.cg),this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.l(_.bg);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);this.o=(c=c.adsTimeline)&&c.$b()};b.prototype.G=function(c){this.g.debug("Casting",
|
|
@@ -11,13 +11,13 @@ c);this.fireCasted()};b.prototype.l=function(c,d){for(var e=[],f=1;f<arguments.l
|
|
|
11
11
|
null;this.a&&(c=youbora.Util.buildRenditionString(this.a.fb(),this.a.eb(),this.a.Ga()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.Ga()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();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&&
|
|
12
12
|
this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ha()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getAdVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};
|
|
13
13
|
b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.gb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);
|
|
14
|
-
this.g.debug(bx,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.
|
|
14
|
+
this.g.debug(bx,c);return c};b.prototype.getPlayerName=function(){return _.ya};b.prototype.getVersion=function(){return"6.32.0-beta.5-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Fc,this.T.bind(this)),this.f.on(this.m,_.Bc,this.P.bind(this)),this.f.on(this.m,_.xc,this.K.bind(this)),this.f.on(this.m,_.zc,this.L.bind(this)),this.f.on(this.m,_.mc,this.I.bind(this)),this.f.on(this.m,_.nc,this.o.bind(this,
|
|
15
15
|
1)),this.f.on(this.m,_.vc,this.o.bind(this,2)),this.f.on(this.m,_.Dc,this.o.bind(this,3)),this.f.on(this.m,_.lc,this.H.bind(this)),this.f.on(this.m,_.Ac,this.M.bind(this)),this.f.on(this.m,_.qe,this.J.bind(this)),this.f.on(this.m,_.ic,this.B.bind(this)),this.f.on(this.m,_.jc,this.D.bind(this)),this.f.on(this.m,_.kc,this.G.bind(this)),this.f.on(this.m,_.yc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Ei(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);
|
|
16
16
|
this.A=!0};b.prototype.T=function(c){this.g.debug(Xw,c);this.j=c.adsTimeline};b.prototype.P=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.L=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h(Vw);this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h(Uw),this.l=
|
|
17
17
|
!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");var c=this.a&&this.a.$a();this.g.debug(Ww,c);this.fireClick(c)};b.prototype.M=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h(Tw,this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();
|
|
18
18
|
c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&ex(c,this.m.getConfiguration().youbora,this.g,this)};b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[Rw+c+Qw].concat(_.uh(e)))};return new b(a)},ix=function(){function a(){var b=NpawPluginAdapters.video.Shaka.call(this)||this;b.h=!1;b.f=!1;b.a=null;b.G=!1;return b}_.w(a,NpawPluginAdapters.video.Shaka);a.prototype.getPlayhead=function(){return this.getIsLive()?
|
|
19
19
|
-1:this.player.getPosition()};a.prototype.getDuration=function(){return this.player.getDuration()};a.prototype.getRendition=function(){var b=null,c=null,d=null,e=this.player.getTrackManager();e&&(e=e.sa())&&(b=e.width,c=e.height,d=e.bandwidth);b&&c&&d||(e=this.j(),b=b||e.width,c=c||e.height,d=d||e.streamBandwidth);return this.getNpawUtils().buildRenditionString(b,c,d)};a.prototype.getIsLive=function(){return this.player.isLive()};a.prototype.getResource=function(){var b=this.player.ab();return b&&
|
|
20
|
-
b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Ra())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-beta.
|
|
20
|
+
b.url};a.prototype.getBitrate=function(){return this.j().streamBandwidth};a.prototype.getThroughput=function(){return this.j().estimatedBandwidth};a.prototype.getPlayrate=function(){return this.player.Ec()};a.prototype.getFramesPerSecond=function(){var b=this.player.getTrackManager();return b&&(b=b.Ra())?b.frameRate:null};a.prototype.getPlayerName=function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-adapter-6.32.0-beta.5-js"};a.prototype.getPlayerVersion=function(){return _.ia};
|
|
21
21
|
a.prototype.registerListeners=function(){var b=this.w();this.player&&b&&(b.on(this.player,_.kg,this.M.bind(this)),b.on(this.player,_.qe,this.J.bind(this)),b.on(this.player,_.cg,this.L.bind(this)),b.on(this.player,_.bg,this.K.bind(this)),b.on(this.player,_.Fc,this.H.bind(this)),b.on(this.player,_.id,this.I.bind(this)),b.on(this.player,_.$c,this.P.bind(this)),b.on(this.player,_.wg,this.T.bind(this)))};a.prototype.unregisterListeners=function(){hx.debug(_.Qb);_.Ei(this.w())};a.prototype.dispose=function(){this.unregisterListeners();
|
|
22
22
|
this.G=!0;this.f=this.h=!1;this.a=null};a.prototype.j=function(){return this.player.getStats()||_.lu()};a.prototype.o=function(){return!!this.player.getConfiguration().autoplay};a.prototype.M=function(b){b=b.detail;this.l("state change",b);if(b)switch(b.currentState){case 1:this.plugin.setVideoOptions({"content.subtitles":this.D()});this.o()&&this.fireStart();break;case 3:this.fireStart();this.A();this.fireResume();this.fireBufferEnd();break;case 4:this.o()&&this.fireStart();this.A();this.fireBufferEnd();
|
|
23
23
|
this.firePause();break;case _.mu:this.fireBufferEnd();this.fireStop();break;case 5:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case 2:this.fireBufferBegin();break;default:hx.debug(Sw,b)}};a.prototype.A=function(){this.fireJoin()};a.prototype.J=function(b){(b=b.detail)&&!this.f&&this.player&&10003!==b.code&&(b=ex(b,this.player.getConfiguration().npaw,hx,this))&&b.severity===_.P&&(this.f=!0)};a.prototype.L=function(){this.player.isEnded()||(this.l(_.cg),
|
|
@@ -27,18 +27,18 @@ this;b.a=null;b.l=null;b.h=null;b.j=null;b.D=!1;b.o=!1;return b}_.w(a,NpawPlugin
|
|
|
27
27
|
a.prototype.getResource=function(){var b=null;this.a&&(b=this.a.getMediaUrl());return b};a.prototype.getTitle=function(){var b=null;this.a&&(b=this.a.getTitle());return b};a.prototype.getProvider=function(){var b=null;this.a&&(b=this.a.getAdvertiserName());return b};a.prototype.getCreativeId=function(){var b=null;this.a&&(b=this.a.getCreativeId());return b};a.prototype.dispose=function(){this.unregisterListeners();this.D=!0;this.j=this.h=this.a=null};a.prototype.getPosition=function(){var b=this.getNpawReference().Constants.AdPosition,
|
|
28
28
|
c=null;if(this.a)switch(this.a.Ha()){case 0:c=b.Preroll;break;case 2:c=b.Postroll;break;case 1:c=b.Midroll}jx.debug("Ad position",c);return c};a.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};a.prototype.getAudioEnabled=function(){var b=this.player.getAdsManager();return b&&0<b.getAdVolume()};a.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};a.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};a.prototype.getExpectedAds=
|
|
29
29
|
function(){return this.a&&this.a.gb()};a.prototype.getGivenAds=function(){return this.getExpectedAds()};a.prototype.getBreaksTime=function(){var b=this;return this.h&&this.h.getCuePoints().map(function(c){return-1===c?b.player.getDuration():c})};a.prototype.getIsFullscreen=function(){return this.player.getSurface().isFullscreen()};a.prototype.getIsVisible=function(){var b=this.player.getSurface().getContainer();b=this.getNpawUtils().calculateAdViewability(b);jx.debug(bx,b);return b};a.prototype.getPlayerName=
|
|
30
|
-
function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-beta.
|
|
30
|
+
function(){return _.ya};a.prototype.getVersion=function(){return"castlabs-ads-adapter-6.32.0-beta.5-js"};a.prototype.getPlayerVersion=function(){return _.ia};a.prototype.B=function(){this.j||(this.j=new _.Bi);return this.j};a.prototype.registerListeners=function(){var b=this.B();this.player&&b&&(b.on(this.player,_.Fc,this.X.bind(this)),b.on(this.player,_.Bc,this.W.bind(this)),b.on(this.player,_.xc,this.M.bind(this)),b.on(this.player,_.zc,this.P.bind(this)),b.on(this.player,_.mc,this.K.bind(this)),
|
|
31
31
|
b.on(this.player,_.nc,this.w.bind(this,1)),b.on(this.player,_.vc,this.w.bind(this,2)),b.on(this.player,_.Dc,this.w.bind(this,3)),b.on(this.player,_.lc,this.J.bind(this)),b.on(this.player,_.Ac,this.T.bind(this)),b.on(this.player,_.qe,this.L.bind(this)),b.on(this.player,_.ic,this.G.bind(this)),b.on(this.player,_.jc,this.H.bind(this)),b.on(this.player,_.kc,this.I.bind(this)),b.on(this.player,_.yc,this.ba.bind(this)))};a.prototype.unregisterListeners=function(){_.Ei(this.B())};a.prototype.X=function(b){jx.debug(Xw,
|
|
32
32
|
b);this.h=b.adsTimeline};a.prototype.W=function(b){this.a=b.ad;this.f("ad start",this.a);this.fireStart();this.fireJoin()};a.prototype.K=function(){this.f("ad ended");this.fireStop({adPlayhead:this.l})};a.prototype.M=function(){this.f("ad pause");this.A();this.firePause()};a.prototype.P=function(){this.f("ad resume");this.A();this.fireResume()};a.prototype.I=function(){this.o=!0;this.f(Vw);this.fireBufferBegin()};a.prototype.ba=function(){this.l=this.getPlayhead();this.A()};a.prototype.A=function(){this.o&&
|
|
33
33
|
(this.f(Uw),this.o=!1,this.fireBufferEnd())};a.prototype.w=function(b){this.f("ad quartile",b);this.fireQuartile(b)};a.prototype.J=function(){this.f("ad clicked");var b=this.a&&this.a.$a();jx.debug(Ww,b);this.fireClick(b)};a.prototype.T=function(){this.f("ad skipped");this.fireSkip()};a.prototype.G=function(b){this.a=b.ad;this.f(Tw,this.a);this.fireBreakStart()};a.prototype.H=function(){this.f("ad break stop");this.fireBreakStop({adPlayhead:this.l});this.getPosition()===this.getNpawReference().Constants.AdPosition.Postroll&&
|
|
34
|
-
this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player.getConfiguration().npaw,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Rw+b+Pw].concat(_.uh(d)))};return a},lx=function(){this.a=null;this.g=new _.M(Yw);this.m=null},mx=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.
|
|
34
|
+
this.fireStop({adPlayhead:this.l})};a.prototype.L=function(b){(b=b.detail)&&10003===b.code&&ex(b,this.player.getConfiguration().npaw,jx,this)};a.prototype.f=function(b,c){for(var d=[],e=1;e<arguments.length;++e)d[e-1]=arguments[e];jx.debug.apply(jx,[Rw+b+Pw].concat(_.uh(d)))};return a},lx=function(){this.a=null;this.g=new _.M(Yw);this.m=null},mx=function(a,b){if(b.namespace()===_.xd)return a.g.info("NPAW does not report when casting."),!1;var c=b.getConfiguration().npaw;return _.N.Rg(c)?c.accountCode?
|
|
35
35
|
_.N.R(window.NpawPlugin)||_.N.R(window.NpawPluginAdapters)?(a.g.warn("NPAW SDK not found."),b.onError(new _.O(1,9,9100)),!1):!0:(a.g.warn("accountCode key is missing in NPAW config"),b.onError(new _.O(1,9,9101)),!1):(a.g.warn("NPAW plugin is loaded but not configured. Will do nothing."),!1)},nx=function(a){a.a&&(a.g.info("Removing NPAW Plugins",a.a),a.a.removeAdsAdapter(),a.a.removeAdapter())},ox=function(){this.a=null;this.g=new _.M(Zw);this.m=null},px=function(a,b){if(b.namespace()===_.xd)return a.g.info("Youbora does not report when casting."),
|
|
36
|
-
!1;var c=b.getConfiguration().youbora;if(!_.N.
|
|
37
|
-
b.onError(new _.O(1,9,9102)));return!0},qx=function(){};var hx=new _.M("clpp.npaw.NpawAdapter");var jx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(lx,_.gw);_.r=lx.prototype;_.r.
|
|
38
|
-
_.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.
|
|
39
|
-
_.r.onPlayerWillDestroy=function(){nx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.K(Yw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.
|
|
40
|
-
_.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.
|
|
41
|
-
ox.prototype.setYouboraPlugin=ox.prototype.
|
|
36
|
+
!1;var c=b.getConfiguration().youbora;if(!_.N.Rg(c))return a.g.debug("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),b.onError(new _.O(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.O(1,9,9100)),!1;"6.8.59"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.59, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),
|
|
37
|
+
b.onError(new _.O(1,9,9102)));return!0},qx=function(){};var hx=new _.M("clpp.npaw.NpawAdapter");var jx=new _.M("clpp.npaw.NpawAdsAdapter");_.w(lx,_.gw);_.r=lx.prototype;_.r.th=function(a){nx(this);if(this.a=a)this.a.registerAdapterFromClass(this.m,ix()),this.a.registerAdsAdapterFromClass(this.m,kx())};_.r.Hm=function(){return this.a};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;mx(this,a)&&(a=a.getConfiguration().npaw,this.th(new NpawPlugin(a.accountCode)))};
|
|
38
|
+
_.r.onContentWillLoad=function(a,b){if(mx(this,a)){var c=a.getConfiguration(),d=c.npaw;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.th(new NpawPlugin(d.accountCode));this.a.setAnalyticsOptions(d)}};_.r.onContentLoaded=function(a){var b={};(a=a.getDrmInfo())&&(a=cx(a.keySystem))&&(b["content.drm"]=a);this.g.info(_.bf,b);this.a.setAnalyticsOptions(b)};_.r.onPlayerWillRelease=function(){};
|
|
39
|
+
_.r.onPlayerWillDestroy=function(){nx(this);this.a&&this.a.destroy()};_.r.id=function(){return"npaw"};_.K(Yw,lx);lx.prototype.getAdsAdapter=lx.prototype.getAdsAdapter;lx.prototype.getAdapter=lx.prototype.getAdapter;lx.prototype.getNpawPlugin=lx.prototype.Hm;lx.prototype.setNpawPlugin=lx.prototype.th;lx.Id="npaw";new _.M(Yw);_.w(ox,_.gw);_.r=ox.prototype;_.r.uh=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(fx(this.m)),this.a.setAdsAdapter(gx(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;px(this,a)&&(a=a.getConfiguration().youbora,this.uh(new youbora.Plugin(a)))};
|
|
40
|
+
_.r.onContentWillLoad=function(a,b){if(px(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[$w]&&(d[$w]=b.isLive);void 0===d[ax]&&(d[ax]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.uh(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.K(Zw,ox);ox.prototype.getAdsAdapter=ox.prototype.getAdsAdapter;ox.prototype.getAdapter=ox.prototype.getAdapter;
|
|
41
|
+
ox.prototype.setYouboraPlugin=ox.prototype.uh;ox.Id="youbora";qx.prototype.create=function(a){return a.npaw?new lx:a.youbora?new ox:null};_.fp(new qx);};
|
|
42
42
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
43
43
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
44
44
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cl.airplay.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var hX=class extends _.Uv{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.cu(()=>{this.m.play().catch(()=>{})});this.h=new _.Vt}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
|
|
2
|
-
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Tc(){return this.f}
|
|
2
|
+
!0;break;case "not-available":this.f=!1}this.m.trigger(new _.H(_.tc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.sc:_.rc;if(this.l||!this.m.isPaused()||3===this.m.getState())this.l?this.m.play().catch(()=>{}):this.o.la(.01);this.m.trigger(new _.H(a))}ya(){return this.j}Tc(){return this.f}gj(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",hX);hX.prototype.showCastMenu=hX.prototype.gj;
|
|
3
3
|
hX.prototype.canCast=hX.prototype.Tc;hX.prototype.isCasting=hX.prototype.ya;hX.Id="airplay";_.Tn(new class{create(){return new hX}});};f.call(g, window);
|
package/cl.cast.js
CHANGED
|
@@ -5,14 +5,14 @@ chrome.cast.media.HlsSegmentFormat,d=chrome.cast.media.HlsVideoSegmentFormat;els
|
|
|
5
5
|
chrome.cast.media;if(!b)throw new _.I(1,8,8001);const c=b.MetadataType,d=b.GenericMediaMetadata,e=b.MovieMediaMetadata,f=b.TvShowMediaMetadata,g=b.MusicTrackMediaMetadata,h=b.PhotoMediaMetadata;b=b.AudiobookChapterMediaMetadata;switch(a){case c.MOVIE:return new e;case c.TV_SHOW:return new f;case c.MUSIC_TRACK:return new g;case c.PHOTO:return new h;case c.AUDIOBOOK_CHAPTER:return new b;default:return new d}},yV=function(){return Math.round(1E3*Math.random())},zV=function(a,b){return a.h.filter(c=>
|
|
6
6
|
c.type===b)},BV=function(a,b){const c=AV(a);return zV(a,b).find(d=>c.includes(d.id))||null},DV=function(a,b,c){const d=a.a.a;if(d)if(c){a.f[b]=c.renditions[0];c=[+c.id];if(b!==_.P){const e=a.ua();e&&c.push(+e.id)}c=new chrome.cast.media.EditTracksInfoRequest(c);d.editTracksInfo(c,()=>{a.f[b]=null;CV(a,b)},e=>{a.f[b]=null;a.g.debug(cV,e)})}else b===_.P&&(c=new chrome.cast.media.EditTracksInfoRequest([]),d.editTracksInfo(c,()=>{CV(a,b)},e=>{a.g.debug(cV,e)}))},AV=function(a){a=a.a?a.a.a:null;return(a?
|
|
7
7
|
a.activeTrackIds||[]:[]).map(b=>b.toString())},CV=function(a,b){b===_.Q?a.a.trigger(new _.H(_.Kc)):b===_.P&&a.a.trigger(new _.H(_.bg))},GV=function(a){if(a)for(const b of EV)FV(b)},FV=function(a){if(!a.f&&window.chrome&&chrome.cast&&chrome.cast.isAvailable&&window.cast&&cast.framework&&cast.framework.CastContext&&a.S.length){a.o=new cast.framework.RemotePlayer;var b=new cast.framework.RemotePlayerController(a.o);a.F.on(b,cast.framework.RemotePlayerEventType.CURRENT_TIME_CHANGED,a.Aa.bind(a));a.F.on(b,
|
|
8
|
-
cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Jb.bind(a));a.f=!0;a.L.resolve();a.w.
|
|
8
|
+
cast.framework.RemotePlayerEventType.MEDIA_INFO_CHANGED,a.Jb.bind(a));a.f=!0;a.L.resolve();a.w.Of();b=cast.framework.CastContext.getInstance();var c=new cast.framework.CastOptions;c.receiverApplicationId=a.S;c.autoJoinPolicy=chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;b.setOptions(c);b.addEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.addEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da);HV&&a.w.la(.02)}},IV=function(a){return _.w(function*(){a.F.release();
|
|
9
9
|
EV.delete(a);if(a.f){a.f=!1;var b=cast.framework.CastContext.getInstance();b.removeEventListener(cast.framework.CastContextEventType.CAST_STATE_CHANGED,a.M);b.removeEventListener(cast.framework.CastContextEventType.SESSION_STATE_CHANGED,a.da)}b=[];a.h&&(b.push(a.h.destroy()),a.h=null);a.l&&(b.push(a.l.destroy()),a.l=null);yield Promise.all(b);a.A=!1;a.w&&(a.w.stop(),a.w=null);a.R=null;a.X=null})},JV=function(a){return _.w(function*(){a.ya()||(yield cast.framework.CastContext.getInstance().requestSession())})},
|
|
10
|
-
LV=function(a,b,c){c=void 0===c?0:c;return _.w(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield KV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),
|
|
10
|
+
LV=function(a,b,c){c=void 0===c?0:c;return _.w(function*(){var d=a.h.ua();d&&d.language&&(a.j.preferredTextLanguage=d.language);(d=a.h.ra())&&d.language&&(a.j.preferredAudioLanguage=d.language);yield KV(a,{source:a.getLoadedSource(),currentTime:c,isLive:a.isLive(),xf:a.getPresentationStartTime(),autoplay:b,Fa:a.j})})},KV=function(a,b){return _.w(function*(){if(a.f){var c=chrome.cast.media.StreamType;yield JV(a);if(b){var d=cast.framework.CastContext.getInstance().getCurrentSession(),e=new chrome.cast.media.MediaInfo(b.source.url,
|
|
11
11
|
b.source.type);e.streamType=b.isLive?c.LIVE:c.BUFFERED;c=b.nb;e.hlsVideoSegmentFormat=vV(b.jc,_.R);e.hlsSegmentFormat=vV(c,_.Q);b.Fa&&(a.J&&(c=yield Promise.resolve(a.J(b.Fa)))&&(b.Fa=c),a.j=b.Fa,a.C=_.jn(a.j),a.B=a.C.findIndex(k=>k.url===b.source.url),b.Fa.remoteTextTracks&&(c=yield Promise.all(b.Fa.remoteTextTracks.map(a.Ma.bind(a))),e.tracks=c.filter(k=>k),b.Fa.remoteTextTracks=void 0),delete b.Fa.autoplay,b.Fa.startTime=null,e.customData={playerConfiguration:rV(b.Fa)});c=a.Lb()||{};var f=MV(c.metadataType),
|
|
12
|
-
g;typeof b.
|
|
12
|
+
g;typeof b.xf===_.r&&(g={metadataType:f,sectionStartAbsoluteTime:b.xf});var h;b.source.name&&(h={metadataType:f,title:b.source.name});c=NV(c);if(g=OV(Object.assign({},g,h,c)))e.metadata=g;e=new chrome.cast.media.LoadRequest(e);(g=b.queueData)&&g.items&&0<g.items.length&&(h=new chrome.cast.media.QueueData,h.items=g.items,h.startIndex=g.startIndex,e.queueData=h);typeof b.autoplay===_.Nc&&(e.autoplay=b.autoplay);typeof b.currentTime===_.r&&(e.currentTime=b.currentTime);yield d.loadMedia(e);null!=b.Fa.muted&&
|
|
13
13
|
a.setMuted(b.Fa.muted);null!=b.Fa.volume&&a.setVolume(b.Fa.volume)}}})},OV=function(a){if(!a)return null;a:{var b=a.metadataType;const c=Object.entries(PV);for(const d of c){const [e,f]=d;if(f===b){b=e;break a}}b=null}if(!b)return null;b=xV(PV[b]);return Object.assign(b,a)},MV=function(a){var b=void 0===b?wV:b;return Object.values(PV).includes(a)?a:b},NV=function(a){const b={};for(const c in a)void 0!==a[c]&&(b[c]=a[c]);return b},RV=function(a,b){QV(a,b.getMediaSession());b.addEventListener(cast.framework.SessionEventType.MEDIA_SESSION,
|
|
14
14
|
a.W);b.addMessageListener(mV,a.P);b.addMessageListener(nV,a.U)},SV=function(a){const b=a.getPosition();a.a&&a.a.media?(a=a.a.media.startAbsoluteTime,a=typeof a!==_.r?null:a):a=null;a=null===a?null:a+b;return null===a?b:a},QV=function(a,b){a.a=b;a.a&&(a.l&&a.l.init(),a.trigger(new _.H(_.se)))},VV=function(a){return new TV(a.h,()=>{a.trigger(new _.H(_.Tc))},(b,c)=>{{const d=a.f.getConfiguration();d.source=c.source;d.autoplay=!1;d.startTime=c.currentTime?Math.max(c.currentTime-1,0):null;d.ima&&d.startTime&&
|
|
15
|
-
(d.ima.playAdsAfterTime=d.startTime);c.
|
|
15
|
+
(d.ima.playAdsAfterTime=d.startTime);c.dg&&(d.preferredAudioLanguage=c.dg);c.jh&&(d.preferredTextLanguage=c.jh);_.ao(a.f,null);a.trigger(new _.H("castingended"));a.j(b,d)}},()=>UV(a))},UV=function(a){return _.w(function*(){a.trigger(new _.H(_.Sc));if(a.f.a!==a.a&&a.a){var b=null!=a.f.Sa();yield a.f.release();_.ao(a.f,a.a);b&&(_.ko(a.f),(b=a.f.getAdsManager())&&(yield b.load()))}})},WV=function(a){a.trigger(new _.H(_.kf))},YV=function(a){XV(a);const b=Math.min(a.a.Jd().length-1,a.a.getPosition()+1);
|
|
16
16
|
a.a.setPosition(b)},XV=function(a){a.j||(a.a.on(_.jf,a.o),a.j=!0)},ZV=function(a){return a.map(b=>{const c={};c.media={contentId:b.configuration.source};c.customData={skippable:!1!==b.skippable};return c})},cW=function(a,b,c){return _.w(function*(){var d=b.adTagUrl;if(d)try{$V=!1;const e=_.zk(d),f=yield c.fetch(e).V;if(f&&f.data){const g=_.ri(f.data),h=(new DOMParser).parseFromString(g,_.ag);if(h.getElementsByTagName("vmap:VMAP").length)aW.warn("VMAP detected."),a.vmapAdsRequest=bW(g);else if(h.getElementsByTagName("VAST").length){aW.warn("VAST detected.");
|
|
17
17
|
{d=g;const k=new cast.framework.messages.BreakClip("bc1");k.vastAdsRequest=bW(d);const l=new cast.framework.messages.Break("b1",[k.id],0);a.breakClips=[k];a.breaks=[l]}}else aW.warn("Unsupported schema."),$V=!0}}catch(e){aW.warn("Failed to fetch an ad",e),$V=!0}})},bW=function(a){const b=new cast.framework.messages.VastAdsRequest;b.adsResponse=a;return b},dW=function(a,b){b=new _.I(1,10,10003,{errorType:b});a.m.onError(b)},eW=function(){return cast.framework.CastReceiverContext.getInstance().getPlayerManager()},
|
|
18
18
|
gW=function(a,b,c){if(c instanceof cast.framework.events.BreaksEvent||-1!==a.getPosition()){var d=null;(c=fW(a,c))&&(d={ad:c});a.m.trigger(new _.H(b,d))}},fW=function(a,b){let c=null;if(a.a&&b instanceof cast.framework.events.BreaksEvent){let d=null,e=null,f;typeof b.breakClipId===_.Uf&&(d=a.a.getBreakClipById(b.breakClipId));typeof b.breakId===_.Uf&&(e=a.a.getBreakById(b.breakId),!e&&d&&(e=a.a.getBreaks().find(g=>g.breakClipIds.includes(d.id))||null),e&&(f=a.a.getBreaks().filter(g=>0<=g.position).sort((g,
|
|
@@ -34,35 +34,35 @@ c.label=b.name;c.src=b.trackContentId;c.mimeType=b.trackContentType;if(b.customD
|
|
|
34
34
|
_.Q)}sa(){return zV(this,_.P)}ta(){const a=this.Ia();return a?a.renditions[0]:null}Qa(){const a=this.ra();return a?a.renditions[0]:null}Xa(){const a=this.ua();return a?a.renditions[0]:null}xb(){return this.f[_.R]||null}Nb(){return this.f[_.Q]||null}Ob(){return this.f[_.P]||null}Ia(){return BV(this,_.R)}ra(){return BV(this,_.Q)}ua(){return BV(this,_.P)}Gb(a){DV(this,_.R,a)}za(a){DV(this,_.Q,a)}ab(a){DV(this,_.P,a)}sb(a){this.Gb(a&&a.track)}Eb(a){this.za(a&&a.track)}Fb(a){this.ab(a&&a.track)}addTextTrack(){return _.w(function*(){})}va(){return!0}};
|
|
35
35
|
JW.prototype.isAbrEnabled=JW.prototype.va;JW.prototype.addTextTrack=JW.prototype.addTextTrack;JW.prototype.setTextRendition=JW.prototype.Fb;JW.prototype.setAudioRendition=JW.prototype.Eb;JW.prototype.setVideoRendition=JW.prototype.sb;JW.prototype.setTextTrack=JW.prototype.ab;JW.prototype.setAudioTrack=JW.prototype.za;JW.prototype.setVideoTrack=JW.prototype.Gb;JW.prototype.getTextTrack=JW.prototype.ua;JW.prototype.getAudioTrack=JW.prototype.ra;JW.prototype.getVideoTrack=JW.prototype.Ia;
|
|
36
36
|
JW.prototype.getLoadingTextRendition=JW.prototype.Ob;JW.prototype.getLoadingAudioRendition=JW.prototype.Nb;JW.prototype.getLoadingVideoRendition=JW.prototype.xb;JW.prototype.getTextRendition=JW.prototype.Xa;JW.prototype.getAudioRendition=JW.prototype.Qa;JW.prototype.getVideoRendition=JW.prototype.ta;JW.prototype.getTextTracks=JW.prototype.sa;JW.prototype.getAudioTracks=JW.prototype.getAudioTracks;JW.prototype.getVideoTracks=JW.prototype.getVideoTracks;var TV=class extends _.Yt{constructor(a,b,c,d){super();this.g=new _.T(_.hd);this.S=a;this.w=new _.Pi(b);this.R=c;this.X=d;this.j=this.G=_.cn();this.C=[];this.B=0;this.I=new _.Hn;this.a=null;this.f=!1;this.L=new _.Kl;this.A=!1;this.ca="";this.ia=1E6;this.h=new JW;this.h.initialize(this);this.l=new IW(this);this.F=new _.Vt;this.H=null;this.K=new Set;this.M=this.cb.bind(this);this.da=this.Ub.bind(this);this.W=this.Tb.bind(this);this.P=this.Ib.bind(this);this.U=this.lb.bind(this);this.o=this.J=null;window.cast||
|
|
37
|
-
Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{GV(!0)},0)}});FV(this);EV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ab)}appendLoad(){return Promise.reject(_.ab)}seekWith(){return Promise.reject(_.ab)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.w(function*(){})}
|
|
38
|
-
a}gd(){return this.f}ya(){return this.A}
|
|
39
|
-
new _.I(1,8,8003,void 0);try{yield JV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.I(1,8,8E3,c);}})}
|
|
37
|
+
Object.defineProperty(window,"cast",{get:()=>window.cast_,set:e=>{window.cast_=e;window.setTimeout(()=>{GV(!0)},0)}});FV(this);EV.add(this)}init(a,b){this.j=this.G=b}unload(){return this.f?new Promise((a,b)=>{this.h&&this.h.release();this.a&&!this.a.idleReason||a();this.a.stop(null,a,b)}):Promise.resolve()}release(){return this.f?this.unload().then(()=>{this.l&&this.l.release()}):Promise.resolve()}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ab)}appendLoad(){return Promise.reject(_.ab)}seekWith(){return Promise.reject(_.ab)}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}destroy(){return _.w(function*(){})}ae(a){this.J=
|
|
38
|
+
a}gd(){return this.f}ya(){return this.A}ef(){return this.ca}sendMessage(a,b){const c=this;return _.w(function*(){if(c.f){var d=cast.framework.CastContext.getInstance().getCurrentSession();if(d)try{yield d.sendMessage(a,b)}catch(f){var e=new _.I(1,8,8E3,{detailedErrorCode:f})}else e=new _.I(1,8,8004,void 0);if(e)c.onError(e)}})}cast(){const a=this;return _.w(function*(){if(!a.gd())throw a.g.warn(hV),new _.I(1,8,8001,void 0);if(!HV)throw a.g.warn(eV),new _.I(1,8,8002,void 0);if(a.ya())throw a.g.warn("Already casting"),
|
|
39
|
+
new _.I(1,8,8003,void 0);try{yield JV(a)}catch(b){const c={};b instanceof chrome.cast.Error?(c.detailedErrorCode=b.code,c.details=b.details,c.reason=b.description):c.detailedErrorCode=b;throw new _.I(1,8,8E3,c);}})}ve(){this.f&&this.ya()&&cast.framework.CastContext.getInstance().endCurrentSession(!0)}addMessageListener(a){typeof a===_.ae&&this.K.add(a)}removeMessageListener(a){typeof a===_.ae&&this.K.delete(a)}play(){return this.f?this.isEnded()?LV(this,!0):new Promise((a,b)=>{if(!this.a)return b(dV);
|
|
40
40
|
this.a.play(null,a,b)}):Promise.resolve()}pause(){return this.f?new Promise((a,b)=>{this.isEnded()&&a();if(!this.a)return b(dV);this.a.pause(null,a,b)}):Promise.resolve()}isPaused(){return this.f?!!this.a&&this.a.playerState===chrome.cast.media.PlayerState.PAUSED:!1}isEnded(){return this.f?5===this.getState():!1}seek(a){return this.f?this.isEnded()?LV(this,!1,a):new Promise((b,c)=>{this.a||c(dV);this.o.isPlayingBreak&&c(bV);const d=new chrome.cast.media.SeekRequest;d.currentTime=a;this.trigger(new _.H(_.ug));
|
|
41
41
|
this.a.seek(d,()=>{this.trigger(new _.H(_.qg));b()},c)}):Promise.resolve()}getPosition(){return this.f?this.getMediaPosition():0}getMediaPosition(){return this.f?this.a&&this.a.getEstimatedTime()||0:0}getDuration(){return this.f?this.getMediaDuration():0}getMediaDuration(){if(!this.f)return 0;if(!this.a||!this.a.media)return-1;const a=this.a.media.duration;return typeof a!==_.r?-1:-1===a?Infinity:a}setDrmCustomDataModifier(){}setCdnErrorCallback(){}detach(){}getPlaybackRate(){return this.f?this.a&&
|
|
42
42
|
this.a.playbackRate||0:0}setPlaybackRate(a){this.f&&this.a&&0<a&&this.sendMessage(oV,{type:"SET_PLAYBACK_RATE",requestId:yV(),mediaSessionId:this.a.mediaSessionId,playbackRate:a})}getVolume(){return this.f?this.a&&this.a.volume.level:0}setVolume(a){this.f&&this.a&&0<=a&&1>=a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(a)),this.a.setVolume(a))}isMuted(){return this.f?this.a&&this.a.volume.muted:!1}setMuted(a){this.f&&this.a&&(a=new chrome.cast.media.VolumeRequest(new chrome.cast.Volume(void 0,
|
|
43
43
|
a)),this.a.setVolume(a))}getPresentationStartTime(){if(!this.f)return 0;if(!this.a||!this.a.media||!this.a.media.metadata)return null;const a=this.a.media.metadata.sectionStartAbsoluteTime;return typeof a!==_.r?null:1E-8===a?0:a}getSeekRange(){if(!this.f)return{start:0,end:0};let a={start:0,end:this.getDuration()};if(this.isLive()){const b=this.a.getEstimatedLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.f?this.l?this.l.getState():
|
|
44
44
|
7:7}getStats(){return this.f?this.a&&this.a.customData&&this.a.customData.stats?sV(this.a.customData.stats):_.xs():_.xs()}isLive(){return this.f?Infinity===this.getDuration():!1}load(a){const b=this;return _.w(function*(){if(b.gd())if(HV){b.C=_.jn(a);b.j=_.en([b.G,a]);var c=b.C[b.B];yield KV(b,{source:c,isLive:c.isLive,autoplay:b.j.autoplay,Fa:b.j,jc:c.jc,nb:c.nb})}else b.g.warn(eV);else b.g.warn(hV)})}getBufferInfo(){return new _.St}getTrackManager(){return this.h}getConfiguration(){return this.j}getSurface(){return null}setNetworkEngine(a){this.I=
|
|
45
|
-
a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(gV)}onError(a){if(a&&(this.trigger(new _.H(_.Xd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.hd}canPlay(){return this.gd()?2:0}Lb(){return this.H}gc(a){this.H=OV(a)}
|
|
46
|
-
{};a={metadataType:MV(b.metadataType),title:a};this.gc(Object.assign({},b,a))}}
|
|
47
|
-
cast.framework.CastState.CONNECTED;HV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.
|
|
48
|
-
this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:SV(this),
|
|
45
|
+
a}getNetworkEngine(){return this.I}getSourceIndex(){return this.B}setSourceIndex(a){this.B=a}setCmsdManager(){}getLoadedSource(){return this.C[this.B]}getPeriods(){return[]}getDrmInfo(){return null}getTimelineCues(){return[]}getCueTimeline(){return null}resetAbr(){this.g.warn(gV)}onError(a){if(a&&(this.trigger(new _.H(_.Xd,{detail:a})),this.l))this.l.onError(a)}namespace(){return _.hd}canPlay(){return this.gd()?2:0}Lb(){return this.H}gc(a){this.H=OV(a)}af(){this.H=null}Jf(a){if(this.f){var b=this.Lb()||
|
|
46
|
+
{};a={metadataType:MV(b.metadataType),title:a};this.gc(Object.assign({},b,a))}}Hf(a){if(this.f){var b=this.Lb()||{},c=MV(b.metadataType);a=new chrome.cast.Image(a);this.gc(Object.assign({},b,{metadataType:c,images:[a]}))}}Gf(a){if(this.f){var b=this.Lb()||{};this.gc(Object.assign({},b,{metadataType:3,artist:a}))}}If(a){if(this.f){var b=this.Lb()||{};a={metadataType:MV(b.metadataType),releaseDate:a};this.gc(Object.assign({},b,a))}}cb(a){const b=cast.framework.CastContext.getInstance(),c=a.castState===
|
|
47
|
+
cast.framework.CastState.CONNECTED;HV=a.castState!==cast.framework.CastState.NO_DEVICES_AVAILABLE;this.ca=c?b.getCurrentSession().getCastDevice().friendlyName:"";this.w.Of()}Ub(a){this.g.debug(`state: ${a.sessionState}, details:`,a);switch(a.sessionState){case cast.framework.SessionState.SESSION_STARTED:this.A=!0;RV(this,a.session);break;case cast.framework.SessionState.SESSION_RESUMED:this.ya()||(this.A=!0,RV(this,a.session),this.X());break;case cast.framework.SessionState.SESSION_ENDED:if(this.ya()&&
|
|
48
|
+
this.a){const d=this.a.media;var b=this.h.ra(),c=this.h.ua();b=b&&b.language||void 0;c=c&&c.language||void 0;this.R(this.getState(),{source:{url:d.contentId,type:d.contentType,isLive:this.isLive()},currentTime:SV(this),jh:c,dg:b})}a.session.removeEventListener(cast.framework.SessionEventType.MEDIA_SESSION,this.W);a.session.removeMessageListener(mV,this.P);a.session.removeMessageListener(nV,this.U);this.A=!1;this.a=null}}Tb(a){this.g.debug("New media session",a.mediaSession);QV(this,a.mediaSession)}Jb(a){a.value&&
|
|
49
49
|
a.value.tracks&&this.h&&this.h.load()}Ib(a,b){const c=sV(b);this.K.forEach(d=>d(c))}lb(a,b){a=sV(b);"event"===a.type&&a.name===_.Eg&&this.trigger(new _.H(_.Uc,{visible:!!a.visible}))}Aa(){this.trigger(new _.H(_.gg))}Ma(a){const b=this;return _.w(function*(){let c=null;const d=yield uV(a,[_.$f,_.Bc],b.I,b.j);d&&(c=new chrome.cast.media.Track(b.ia++,chrome.cast.media.TrackType.TEXT),c.language=d.language,c.name=d.label||null,c.trackContentId=d.url,c.trackContentType=d.mimeType,c.customData={mimeType:a.mimeType,
|
|
50
|
-
url:a.url});return c})}getTextDisplayer(){return null}},HV=!1,EV=new Set;window.__onGCastApiAvailable=GV;var KW=class extends _.Yt{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.ae?c:this.l;this.a=VV(this);this.g=new _.T(jV);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.w(function*(){a.a&&(yield IV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){5!==a&&a!==_.Hs&&(delete b.license,this.f.open(b))}Tc(){return!!this.a&&this.a.gd()&&HV}ya(){return!!this.a&&this.a.ya()}
|
|
50
|
+
url:a.url});return c})}getTextDisplayer(){return null}},HV=!1,EV=new Set;window.__onGCastApiAvailable=GV;var KW=class extends _.Yt{constructor(a,b,c){super();this.f=a;this.h=b;this.j=typeof c===_.ae?c:this.l;this.a=VV(this);this.g=new _.T(jV);this.forwardEventsTo(this.f)}destroy(){const a=this;return _.w(function*(){a.a&&(yield IV(a.a),a.a=null);a.stopForwardingEventsTo(a.f)})}l(a,b){5!==a&&a!==_.Hs&&(delete b.license,this.f.open(b))}Tc(){return!!this.a&&this.a.gd()&&HV}ya(){return!!this.a&&this.a.ya()}ef(){return this.a?this.a.ef():""}ae(a){this.a&&this.a.ae(a)}cast(a,b){const c=this;return _.w(function*(){if(c.a)try{if(yield c.a.cast(),
|
|
51
51
|
c.a){{let e=null;const f=c.f.Sa();if(f){const g=c.f.getTrackManager(),h=g.getVideoTracks()[0];let k,l;h&&h.mimeType&&(k=h.mimeType);const m=c.f.getConfiguration(),n=g.ra();n&&(n.mimeType&&(l=n.mimeType),n.language&&(m.preferredAudioLanguage=n.language),n.roles.length&&(m.preferredAudioRole=n.roles[0]));const p=g.ua();p&&(p.language&&(m.preferredTextLanguage=p.language),p.roles.length&&(m.preferredTextRole=p.roles[0]));const u=f&&typeof f.isLive===_.Nc?f.isLive:c.f.isLive();e={source:f,isLive:u,autoplay:!c.f.isPaused(),
|
|
52
|
-
currentTime:Math.max(c.f.getPosition()-1,0),
|
|
53
|
-
yield b.a.sendMessage(mV,a):b.g.warn(iV)})}
|
|
54
|
-
this.a.addMessageListener(a):this.g.warn(iV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(iV)}Lb(){return this.a&&this.a.Lb()}gc(a){this.a&&this.a.gc(a)}
|
|
55
|
-
KW.prototype.setContentTitle=KW.prototype.
|
|
56
|
-
KW.prototype.changeReceiverId=KW.prototype.
|
|
52
|
+
currentTime:Math.max(c.f.getPosition()-1,0),xf:c.f.getPresentationStartTime(),jc:k,nb:l,Fa:m}}var d=e}b&&d&&(d.queueData={items:b.items,startIndex:b.startIndex});yield UV(c);c.a&&(d&&(d.autoplay=!c.f.isPaused()),a?yield c.f.open(a):c.a.a||(yield KV(c.a,d)))}}catch(e){c.g.error("Error while trying to cast",e),d=new _.H(_.Xd,{detail:e}),c.trigger(d)}})}ve(){this.a&&this.a.ve()}Oh(a){const b=this;return _.w(function*(){a!==b.h&&(b.h=a,b.a&&(yield IV(b.a)),b.a=VV(b))})}sendMessage(a){const b=this;return _.w(function*(){b.a?
|
|
53
|
+
yield b.a.sendMessage(mV,a):b.g.warn(iV)})}ah(){const a=this;return _.w(function*(){yield a.a.sendMessage(oV,{type:"QUEUE_NEXT",requestId:yV(),mediaSessionId:a.a.a.mediaSessionId})})}bh(){const a=this;return _.w(function*(){yield a.a.sendMessage(oV,{type:"QUEUE_PREV",requestId:yV(),mediaSessionId:a.a.a.mediaSessionId})})}$g(a){const b=this;return _.w(function*(){yield b.a.sendMessage(oV,{type:"QUEUE_INSERT",requestId:yV(),mediaSessionId:b.a.a.mediaSessionId,items:a})})}addMessageListener(a){this.a?
|
|
54
|
+
this.a.addMessageListener(a):this.g.warn(iV)}removeMessageListener(a){this.a?this.a.removeMessageListener(a):this.g.warn(iV)}Lb(){return this.a&&this.a.Lb()}gc(a){this.a&&this.a.gc(a)}af(){this.a&&this.a.af()}Jf(a){this.a&&this.a.Jf(a)}Hf(a){this.a&&this.a.Hf(a)}Gf(a){this.a&&this.a.Gf(a)}If(a){this.a&&this.a.If(a)}};_.x(jV,KW);KW.prototype.setContentReleaseDate=KW.prototype.If;KW.prototype.setContentArtist=KW.prototype.Gf;KW.prototype.setContentImage=KW.prototype.Hf;
|
|
55
|
+
KW.prototype.setContentTitle=KW.prototype.Jf;KW.prototype.clearContentMetadata=KW.prototype.af;KW.prototype.setContentMetadata=KW.prototype.gc;KW.prototype.getContentMetadata=KW.prototype.Lb;KW.prototype.removeMessageListener=KW.prototype.removeMessageListener;KW.prototype.addMessageListener=KW.prototype.addMessageListener;KW.prototype.queueAddItems=KW.prototype.$g;KW.prototype.queuePreviousItem=KW.prototype.bh;KW.prototype.queueNextItem=KW.prototype.ah;KW.prototype.sendMessage=KW.prototype.sendMessage;
|
|
56
|
+
KW.prototype.changeReceiverId=KW.prototype.Oh;KW.prototype.forceDisconnect=KW.prototype.ve;KW.prototype.cast=KW.prototype.cast;KW.prototype.setPlayerConfigInterceptor=KW.prototype.ae;KW.prototype.getReceiverName=KW.prototype.ef;KW.prototype.isCasting=KW.prototype.ya;KW.prototype.canCast=KW.prototype.Tc;KW.prototype.destroy=KW.prototype.destroy;var LW=class extends EW{constructor(a){super(a,"clpp.cast.StateManager");this.I=this.S.bind(this);this.H=this.R.bind(this);this.A=this.ca.bind(this);this.w=this.X.bind(this);this.K=this.W.bind(this);this.J=this.U.bind(this);this.L=this.ia.bind(this);this.G=this.da.bind(this);this.F=this.P.bind(this);this.f=this.M.bind(this)}init(){const a=cast.framework.events.EventType,b=cast.framework.CastReceiverContext.getInstance().getPlayerManager();b.addEventListener(a.PLAYING,this.I);b.addEventListener(a.PAUSE,
|
|
57
57
|
this.H);b.addEventListener(a.MEDIA_FINISHED,this.A);b.addEventListener(a.BUFFERING,this.w);b.addEventListener(a.SEEKING,this.K);b.addEventListener(a.SEEKED,this.J);b.addEventListener(a.STALLED,this.L);b.addEventListener(a.PLAYER_LOADING,this.G);b.addEventListener(a.ERROR,this.F);b.addEventListener(a.BITRATE_CHANGED,this.f)}destroy(){const a=this,b=()=>Object.getPrototypeOf(Object.getPrototypeOf(this)).destroy;return _.w(function*(){const c=cast.framework.events.EventType,d=cast.framework.CastReceiverContext.getInstance().getPlayerManager();
|
|
58
58
|
d.removeEventListener(c.PLAYING,a.I);d.removeEventListener(c.PAUSE,a.H);d.removeEventListener(c.MEDIA_FINISHED,a.A);d.removeEventListener(c.BUFFERING,a.w);d.removeEventListener(c.SEEKING,a.K);d.removeEventListener(c.SEEKED,a.J);d.removeEventListener(c.STALLED,a.L);d.removeEventListener(c.PLAYER_LOADING,a.G);d.removeEventListener(c.ERROR,a.F);d.removeEventListener(c.BITRATE_CHANGED,a.f);yield b().call(a)})}S(){this.player.trigger(new _.H(_.Xe));this.a(3)}R(){this.a(4)}ca(){this.a(5)}X(a){a.isBuffering?
|
|
59
|
-
this.a(2):(a=this.player.isPaused()?4:3,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.ug))}U(){this.player.trigger(new _.H(_.qg))}ia(){this.j=2}da(){this.a(1)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Mc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.I(_.D,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Xd,{detail:a}));this.a(_.As)}};var MW=class extends _.Yt{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}
|
|
59
|
+
this.a(2):(a=this.player.isPaused()?4:3,this.a(a))}W(){this.j=1;this.player.trigger(new _.H(_.ug))}U(){this.player.trigger(new _.H(_.qg))}ia(){this.j=2}da(){this.a(1)}M(a){const b=this.player.getStats();this.player.trigger(new _.H(_.Mc,{detail:{bandwidth:a.totalBitrate,width:b.width,height:b.height}}))}P(a){a=new _.I(_.D,7,7300,{detailedErrorCode:a.detailedErrorCode,error:a.error,reason:a.reason});this.player.trigger(new _.H(_.Xd,{detail:a}));this.a(_.As)}};var MW=class extends _.Yt{constructor(a=[],b=0){super();this.a=a.slice();this.f=b}Jd(){return this.a}getPosition(){return this.f}Mb(){return this.a[this.f]||null}Eg(){return this.a[this.f+1]||null}setPosition(a){0>a||a>=this.a.length||(this.f=a,this.trigger(new _.H(_.jf,{item:this.Mb()})))}append(a){this.a.push(a);WV(this)}Ig(a,b){0>b||b>this.a.length||(this.a.splice(b,0,a),WV(this))}remove(a){0>a||a>=this.a.length||a===this.f||(this.a.splice(a,1),this.f>a&&this.f--,WV(this))}clear(){this.a=[];this.f=
|
|
60
60
|
0;WV(this)}};var NW=class extends _.Yt{constructor(a,b,c){c=void 0===c?()=>Promise.resolve():c;super();this.m=a;this.a=b;this.w=c;this.j=this.f=this.h=!1;this.o=()=>{const d=this;return _.w(function*(){if(!d.f){var e=d.a.Mb();if(e){d.f=!0;try{yield d.w(e),yield d.m.open(Object.assign({},e.configuration,{autoplay:!0}))}catch(f){throw f;}finally{d.f=!1}}}})};this.l=()=>{YV(this)}}start(){this.h||this.f||(this.h=!0,this.m.on(_.Wd,this.l),XV(this),this.a.setPosition(this.a.getPosition()))}next(){const a=this.a.Mb();
|
|
61
|
-
a&&!1===a.skippable||YV(this)}
|
|
62
|
-
d=>{d&&d.type===fV&&typeof d.index===_.r&&this.Rb.setPosition(d.index)};this.a.addMessageListener(this.f)}
|
|
63
|
-
this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}
|
|
64
|
-
OW.prototype.next=OW.prototype.next;OW.prototype.toggleCast=OW.prototype.
|
|
65
|
-
OW.prototype.onPlaylistModified=OW.prototype.
|
|
61
|
+
a&&!1===a.skippable||YV(this)}Xd(){var a=this.a.Mb();a&&!1===a.skippable||(XV(this),a=Math.max(0,this.a.getPosition()-1),this.a.setPosition(a))}ed(a){const b=this;return _.w(function*(){b.a.setPosition(a)})}stop(){this.h=!1;this.m.off(_.Wd,this.l);this.a.off(_.jf,this.o);this.j=!1}};var OW=class{constructor(a,b,c){this.player=a;this.Rb=new MW(c);this.sd=new NW({open:this.player.open.bind(this.player),off:this.player.off.bind(this.player),on:this.player.on.bind(this.player)},this.Rb,()=>_.w(function*(){}));this.a=new KW(this.player,b,(d,e)=>{const f=this;return _.w(function*(){const g=f.Rb.getPosition();f.sd.ed(g);e.autoplay=!0;delete e.license;yield f.player.open(e);typeof e.currentTime===_.r&&(yield f.player.setPosition(Math.max(e.currentTime-1,0)));f.player.play()})});this.f=
|
|
62
|
+
d=>{d&&d.type===fV&&typeof d.index===_.r&&this.Rb.setPosition(d.index)};this.a.addMessageListener(this.f)}Ii(a){return this.Rb.on(_.jf,a)}Ji(a){return this.Rb.on(_.kf,a)}Gi(a){return this.player.on(_.Tc,a)}Tc(){return this.a.Tc()}ki(){return this.Rb.Jd()}ya(){return this.a.ya()}append(a){const b=this;return _.w(function*(){b.Rb.append(a);b.a.ya()&&(yield b.a.$g(ZV([a])))})}ei(){return this.Rb.getPosition()}start(){this.sd.start()}play(){this.player.play()}pause(){this.player.pause()}destroy(){this.sd.stop();
|
|
63
|
+
this.a.removeMessageListener(this.f);this.a.destroy();this.player.release()}mj(){const a=this;return _.w(function*(){if(a.a.ya())a.a.ve();else{a.sd.stop();var b=ZV(a.Rb.Jd()),c=a.Rb.getPosition();yield a.a.cast(void 0,{items:b,startIndex:c})}})}next(){const a=this;return _.w(function*(){a.a.ya()?yield a.a.ah():yield a.sd.next()})}Xd(){const a=this;return _.w(function*(){a.a.ya()?yield a.a.bh():yield a.sd.Xd()})}};_.x("clpp.cast.playlist.CastPlaylist",OW);OW.prototype.previous=OW.prototype.Xd;
|
|
64
|
+
OW.prototype.next=OW.prototype.next;OW.prototype.toggleCast=OW.prototype.mj;OW.prototype.destroy=OW.prototype.destroy;OW.prototype.pause=OW.prototype.pause;OW.prototype.play=OW.prototype.play;OW.prototype.start=OW.prototype.start;OW.prototype.getCurrentIndex=OW.prototype.ei;OW.prototype.append=OW.prototype.append;OW.prototype.isCasting=OW.prototype.ya;OW.prototype.getPlaylistItems=OW.prototype.ki;OW.prototype.canCast=OW.prototype.Tc;OW.prototype.onCastStatusChanged=OW.prototype.Gi;
|
|
65
|
+
OW.prototype.onPlaylistModified=OW.prototype.Ji;OW.prototype.onPlaylistItemChange=OW.prototype.Ii;var Y=class{constructor(a,b,c,d,e){this.a=a;this.f=b;this.l=typeof c===_.r?c:1;this.h=typeof d===_.r?d:1;this.j=typeof e===_.r?e:0}eb(){return"Google Cast Framework"}fb(){return cast.framework.VERSION}hb(){return 0}getId(){return this.a.id}getCreativeId(){return""}zb(){return""}getApiFramework(){return null}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return this.a.title||""}getDuration(){return this.a.duration||0}getPosition(){return 0}getSkipTimeOffset(){return this.a.whenSkippable||
|
|
66
66
|
0}Bb(){return!1}Ra(){return this.a.clickThroughUrl||null}getMediaUrl(){return this.a.contentUrl||this.a.contentId||null}Va(){return 0}Ua(){return 0}Ba(){return 0}Ca(){switch(this.pb()){case 0:return 0;case -1:return 2;default:return 1}}getPodIndex(){return this.j}pb(){return this.f.position}gb(){return this.l}Wa(){return this.h}getWrapperAdIds(){return[]}canSeek(){return!1}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}Ab(){return null}};Y.prototype.getVideoElement=Y.prototype.Ab;
|
|
67
67
|
Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.canSeek=Y.prototype.canSeek;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Wa;Y.prototype.getPositionInSequence=Y.prototype.gb;Y.prototype.getPodTimeOffset=Y.prototype.pb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ca;Y.prototype.getMediaBitrate=Y.prototype.Ba;
|
|
68
68
|
Y.prototype.getMediaHeight=Y.prototype.Ua;Y.prototype.getMediaWidth=Y.prototype.Va;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Ra;Y.prototype.isBumper=Y.prototype.Bb;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
|
|
@@ -80,7 +80,7 @@ SW.prototype.getLoadingAudioRendition=SW.prototype.Nb;SW.prototype.getLoadingVid
|
|
|
80
80
|
cast.framework.messages.PlayerState,b=nW();b.getPlayerState()!==a.IDLE&&b.stop();this.j&&this.j.release();this.o&&this.o.release();this.f=null;return Promise.resolve()}release(){return this.unload().then(()=>{this.a&&this.a.release()})}destroy(){const a=this;return _.w(function*(){a.B=null;a.w=_.cn();a.h=a.w;a.l=-1;a.A=null;a.a&&(yield a.a.destroy(),a.a=null);a.j&&(a.j.destroy(),a.j=null)})}play(){nW().play();return Promise.resolve()}pause(){nW().pause();return Promise.resolve()}isPaused(){return nW().getPlayerState()===
|
|
81
81
|
cast.framework.messages.PlayerState.PAUSED}isEnded(){return nW().getPlayerState()===cast.framework.messages.PlayerState.IDLE}seek(a){const b=nW();if(null!==b.getBreakManager().getBreakClipCurrentTimeSec())return Promise.reject(bV);b.seek(a);return Promise.resolve()}getPosition(){return this.getMediaPosition()}setSeekInterceptor(){}setPlaybackSessionId(){}getBandwidthEstimate(){return null}getMediaPosition(){return nW().getCurrentTimeSec()}getDuration(){return this.getMediaDuration()}getMediaDuration(){const a=
|
|
82
82
|
nW().getDurationSec();return typeof a===_.r?-1===a?Infinity:a:-1}getPlaybackRate(){return nW().getPlaybackRate()}setPlaybackRate(a){if(0<a){const b=new cast.framework.messages.SetPlaybackRateRequestData;b.playbackRate=a;nW().sendLocalMediaRequest(b)}}getVolume(){this.g.warn(pV);return null}setVolume(){this.g.warn(pV)}setMuted(){this.g.warn(pV)}isMuted(){this.g.warn(pV);return!1}getLoadedSource(){const a=nW().getMediaInformation();if(a){var b=nW().getPlaybackConfig();b=!!b&&b.protectionSystem!==cast.framework.ContentProtection.NONE;
|
|
83
|
-
var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,
|
|
83
|
+
var c=this.A&&-1!==this.l?this.A[this.l]:null;c=c?c.name:void 0;!c&&a.metadata&&(c=a.metadata.title);return{url:a.contentId,type:a.contentType,Gj:b,name:c}}return null}getDrmInfo(){return null}getPresentationStartTime(){return nW().getStartAbsoluteTime()}getSeekRange(){let a={start:0,end:this.getDuration()};if(this.isLive()){const b=nW().getLiveSeekableRange();b&&typeof b.start===_.r&&typeof b.end===_.r&&(a={start:b.start,end:b.end})}return a}getState(){return this.a?this.a.getState():7}getStats(){var a=
|
|
84
84
|
_.xs();if(this.f){a=nW().getStats();this.f.h=a.estimatedBandwidth||NaN;this.f.w=a.streamBandwidth||NaN;var b=this.f,c=a.height||NaN;b.A=a.width||NaN;b.j=c;b=this.f;c=typeof a.decodedFrames===_.r?a.decodedFrames:NaN;b.o=typeof a.droppedFrames===_.r?a.droppedFrames:NaN;b.l=c;a=this.f.getStats()}return a}isLive(){return Infinity===this.getDuration()}load(a){const b=this;return _.w(function*(){b.f=new _.uv;b.a.l=b.f.a;b.A=_.jn(a);b.h=_.en([b.w,a]);if(b.C)b.C=!1;else{var c=b.A[b.l],d=new cast.framework.messages.LoadRequestData;
|
|
85
85
|
d.autoplay=b.h.autoplay;typeof b.h.startTime===_.r&&(d.currentTime=b.h.startTime);c.type&&(d.media.contentType=c.type);d.media.contentId=c.url;d.media.customData={playerConfiguration:rV(b.h),local:!0};yield nW().load(d)}})}getBufferInfo(){this.g.warn(_.qa);return new _.St}getTrackManager(){return this.j}getConfiguration(){return this.h}getSurface(){return this.B}getTimeline(){return null}setupPlaylist(){return Promise.reject(_.ab)}appendLoad(){return Promise.reject(_.ab)}seekWith(){return Promise.reject(_.ab)}setNetworkEngine(a){this.F=
|
|
86
86
|
a}setCmsdManager(){}getNetworkEngine(){return this.F}getSourceIndex(){return this.l}setSourceIndex(a){this.l=a}getPeriods(){return[]}namespace(){return kV}getTimelineCues(){return this.o&&this.o.getTimelineCues()||[]}getCueTimeline(){return null}resetAbr(){this.g.warn(gV)}onError(a){a=new _.H(_.Xd,{detail:a});this.trigger(a)}canPlay(){return _.aj()?2:0}H(a){a=Object.assign({},a);a.customData||(a.customData={});a.customData.stats=rV(this.getStats());var b=nW(),c=a.media||b.getMediaInformation();b=
|
|
@@ -90,15 +90,15 @@ b;if(!c)return b;e=c.chromecast||null;a=c.abr||null;d=b;a&&typeof a.defaultBandw
|
|
|
90
90
|
a&&null!=a.useShakaForHls&&(d.useShakaForHls=a.useShakaForHls);d.customNamespaces={};d.customNamespaces[mV]=cast.framework.system.MessageType.JSON;d.customNamespaces[nV]=cast.framework.system.MessageType.JSON;a=new cast.framework.PlaybackConfig;a.manifestHandler=this.I.bind(this);a.shakaConfig={streaming:{ignoreTextStreamFailures:!0}};a.enableSmoothLiveRefresh=!0;d.playbackConfig=a;if(a=this.m&&this.m.getSurface().getMedia())d.mediaElement=a;d.disableIdleTimeout=!0;d.maxInactivity=Infinity;this.h&&
|
|
91
91
|
(d.queue=this.h);c.setMessageInterceptor(cast.framework.messages.MessageType.QUEUE_UPDATE,e=>{this.g.info("QUEUE_UPDATE message received",e);var f=this.getQueueManager();if(!f)return e;f=f.getCurrentItem();return f?(f=f.customData)&&!1===f.skippable?null:e:e});c.setMessageInterceptor(cast.framework.messages.MessageType.LOAD,this.H.bind(this));c.setMessageInterceptor(cast.framework.messages.MessageType.MEDIA_STATUS,this.J.bind(this));c.addEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,
|
|
92
92
|
this.C);c.addEventListener(cast.framework.events.EventType.MEDIA_STATUS,this.G.bind(this));b.start(d);b.addCustomMessageListener(mV,this.B);this.l.on(document,_.Eg,()=>{var e={type:"event",name:_.Eg,visible:!document.hidden};vW().sendCustomMessage(nV,void 0,e)})}}stop(){if(this.a){this.a=!1;this.l.release();const a=vW();vW().getPlayerManager().removeEventListener(cast.framework.events.EventType.PLAYER_LOAD_COMPLETE,this.C);a.removeCustomMessageListener(mV,this.B);a.stop();this.j=this.h=this.m=this.f=
|
|
93
|
-
null}}
|
|
93
|
+
null}}ae(a){this.o=a}cj(a){this.A=a}on(a,b){vW().addEventListener(a,b)}off(a,b){vW().removeEventListener(a,b)}addMessageListener(a){typeof a===_.ae&&this.w.add(a)}removeMessageListener(a){typeof a===_.ae&&this.w.delete(a)}sendMessage(a,b){vW().sendCustomMessage(mV,b,a)}gd(){return this.a}jf(){return this.a}Lb(){return wW()}gc(a){xW(this,a)}tj(a){const b=wW();let c=null;a?c=Object.assign({},b,a):c=b;xW(this,c)}ej(a){this.h=a;this.j=null}getQueueManager(){return vW().getPlayerManager().getQueueManager()}G(){var a=
|
|
94
94
|
this.getQueueManager();a&&(a=a.getCurrentItemIndex(),this.j!==a&&(this.j=a,vW().sendCustomMessage(mV,void 0,{type:fV,index:a})))}I(a){a=a.trim();if(a.startsWith("#EXTM3U"))return zW(this,a);try{var b=(new DOMParser).parseFromString(a,_.ag)}catch(k){return a}var c=b.getElementsByTagName("MPD")[0];if(c){a=c;this.g.debug("Detected DASH, parsing");b=vW();c=a.getElementsByTagName("Period");for(var d=c.length-1;0<=d;--d){var e=c[d].getElementsByTagName(_.fa);for(var f=e.length-1;0<=f;--f){var g=e[f].getAttribute("contentType");
|
|
95
95
|
if(g===_.t||g===_.q){g=e[f].getAttribute(_.Ce);var h=e[f].getElementsByTagName(_.nb);for(let k=h.length-1;0<=k;--k){const l=h[k].getAttribute(_.Ce)||g,m=h[k].getAttribute(_.pd);let n=h[k].getAttribute(_.Ng)||void 0,p=h[k].getAttribute(_.be)||void 0;void 0!==n&&(n=+n);void 0!==p&&(p=+p);b.canDisplayType(l,m,n,p)||e[f].removeChild(h[k])}e[f].getElementsByTagName(_.nb).length||c[d].removeChild(e[f])}}c[d].getElementsByTagName(_.fa).length||a.removeChild(c[d])}return a=(new XMLSerializer).serializeToString(a)}if(c=
|
|
96
96
|
b.getElementsByTagName(_.sb)[0]){a=c;this.g.debug("Detected Smooth, parsing");b=vW();c=a.getElementsByTagName("StreamIndex");for(d=c.length-1;0<=d;--d)if(c[d].getAttribute("Type")===_.t){e=c[d].getElementsByTagName(_.lb);for(f=e.length-1;0<=f;--f)g=e[f].getAttribute(_.Ra)||void 0,h=e[f].getAttribute(_.Qa)||void 0,void 0!==g&&(g=+g),void 0!==h&&(h=+h),b.canDisplayType(_.Ag,void 0,g,h)||c[d].removeChild(e[f]);c[d].getElementsByTagName(_.lb).length||a.removeChild(c[d])}a=(new XMLSerializer).serializeToString(a)}return a}H(a){const b=
|
|
97
97
|
this;return _.w(function*(){let c=a;var d;c.media.customData&&(d=sV(c.media.customData.playerConfiguration));if(b.m&&d){b.o&&(d=(yield Promise.resolve(b.o(d)))||d);d.ima&&(yield cW(c.media,d.ima,b.m.getNetworkEngine()));typeof d.startTime===_.r&&d.startTime!==c.currentTime?c.currentTime=d.startTime:d.startTime=c.currentTime||null;c.media.customData.local||(b.f.C=!0,yield _.mo(b.m,d),yield _.no(b.m),d=b.m.Sa(),c.media.contentId=d.url,c.media.contentType=d.type,d.jc&&(c.media.hlsVideoSegmentFormat=
|
|
98
98
|
vV(d.jc,_.R)),d.nb&&(c.media.hlsSegmentFormat=vV(d.nb,_.Q)));const e=c.media.metadata;e&&typeof e.sectionStartAbsoluteTime===_.r&&(d=e.sectionStartAbsoluteTime,e.sectionStartAbsoluteTime=0===d?1E-8:d);void 0===c.autoplay&&(c.autoplay=b.m.getConfiguration().autoplay)}b.A&&(d=yield Promise.resolve(b.A(c)))&&(c=d);return c})}J(a){var b=a.media;b&&b.tracks&&b.tracks.length&&AW(b.tracks);if((b=a.items)&&b.length)for(const c of b)(b=c&&c.media)&&b.tracks&&b.tracks.length&&AW(b.tracks);return a}K(a){if(this.m&&
|
|
99
|
-
(!a.media.customData||!a.media.customData.local)){var b=vW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.po(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.x(lV,tW);tW.prototype.getQueueManager=tW.prototype.getQueueManager;tW.prototype.setQueue=tW.prototype.
|
|
100
|
-
tW.prototype.updateContentMetadata=tW.prototype.
|
|
101
|
-
tW.prototype.setPlayerConfigInterceptor=tW.prototype
|
|
99
|
+
(!a.media.customData||!a.media.customData.local)){var b=vW().getPlayerManager(),c=b.getLiveSeekableRange();if(c){a=c.start;c=c.end;var d=this.m.getConfiguration().startTime;typeof a!==_.r||typeof c!==_.r||typeof d!==_.r||d>=a&&d<=c||(b=b.getMediaTimeForAbsoluteTime(d),typeof b===_.r&&b>=a&&b<=c&&this.m.setPosition(b))}_.po(this.m)}}F(a){this.w.forEach(b=>b(a.data))}};_.x(lV,tW);tW.prototype.getQueueManager=tW.prototype.getQueueManager;tW.prototype.setQueue=tW.prototype.ej;
|
|
100
|
+
tW.prototype.updateContentMetadata=tW.prototype.tj;tW.prototype.setContentMetadata=tW.prototype.gc;tW.prototype.getContentMetadata=tW.prototype.Lb;tW.prototype.isApiReady=tW.prototype.gd;tW.prototype.sendMessage=tW.prototype.sendMessage;tW.prototype.removeMessageListener=tW.prototype.removeMessageListener;tW.prototype.addMessageListener=tW.prototype.addMessageListener;tW.prototype.off=tW.prototype.off;tW.prototype.on=tW.prototype.on;tW.prototype.setLoadRequestDataInterceptor=tW.prototype.cj;
|
|
101
|
+
tW.prototype.setPlayerConfigInterceptor=tW.prototype.ae;tW.prototype.stop=tW.prototype.stop;tW.prototype.start=tW.prototype.start;tW.prototype.init=tW.prototype.init;tW.getInstance=uW;var sW=null;var UW=class{constructor(a){this.l=a;this.a=null;this.B=new _.Vt;this.f=null;BW(this)}load(){return _.w(function*(){})}j(){return!0}A(){}jb(){this.a&&this.a.isPlayingBreak&&!this.a.isPaused&&this.a.controller.playOrPause()}skip(){const a=this.l.a;a&&this.l.sendMessage(oV,{type:"SKIP_AD",requestId:yV(),mediaSessionId:a.mediaSessionId})}getAdVolume(){return this.l.getVolume()||0}h(a){this.l.setVolume(a)}setMuted(a){this.l.setMuted(a)}isMuted(){return!!this.l.isMuted()}qb(){return this.a?this.a.isPlayingBreak:
|
|
102
102
|
!1}isPaused(){return this.a&&this.a.isPlayingBreak?this.a.isPaused:!1}getPosition(){let a=-1;var b=this.l.a;b&&(b=b.getEstimatedBreakClipTime(),typeof b===_.r&&(a=b));return a}w(){return!0}o(){const a=this;return _.w(function*(){a.B.release()})}setVolume(a){this.h(a)}getVolume(){return this.getAdVolume()}pause(){this.jb()}resume(){this.j()}C(a){switch(a.field){case "mediaInfo":a.value&&(a=a.value,a.breaks&&this.l.trigger(new _.H(_.qc,{adsTimeline:new PW(a.breaks)})));break;case "isPlayingBreak":a.value?
|
|
103
103
|
CW(this,_.Ub):(CW(this,_.Yb,this.f),CW(this,_.nc,this.f),this.f=null,CW(this,_.Vb));break;case "isPaused":this.f&&(a.value?CW(this,_.hc):CW(this,_.kc));break;case "breakClipId":this.f&&(a=this.a.breakClipId,this.f.getId()!==a&&null!=a&&(CW(this,_.Yb,this.f),CW(this,_.nc,this.f),this.f=DW(this),CW(this,_.mc,this.f)));break;default:this.f||(this.f=DW(this))&&CW(this,_.mc,this.f)}}};UW.prototype.resume=UW.prototype.resume;UW.prototype.pause=UW.prototype.pause;UW.prototype.getVolume=UW.prototype.getVolume;
|
|
104
|
-
UW.prototype.setVolume=UW.prototype.setVolume;UW.prototype.getPosition=UW.prototype.getPosition;UW.prototype.skip=UW.prototype.skip;var VW=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.hd?!1:!(!b||!b.ima)}create(a){return new UW(a.a)}};var WW=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return uW().
|
|
104
|
+
UW.prototype.setVolume=UW.prototype.setVolume;UW.prototype.getPosition=UW.prototype.getPosition;UW.prototype.skip=UW.prototype.skip;var VW=class{name(){return"clpp.cast.ads.SenderAdsManagerFactory"}a(a,b){return a.namespace()!==_.hd?!1:!(!b||!b.ima)}create(a){return new UW(a.a)}};var WW=class{name(){return"clpp.cast.ads.AdsManagerFactory"}a(a,b){return uW().jf()?!(!b||!b.ima):!1}create(a){return new QW(a)}};_.x("clpp.cast.createCastQueue",function(){FW=class extends cast.framework.QueueBase{initialize(a){let b=a.queueData;b||(b=new cast.framework.messages.QueueData,b.name="queue",b.description="queue",b.items=[{media:a.media}],b.startTime=a.currentTime);return b}};return new FW});_.Kh(new VW);_.Kh(new WW);};f.call(g, window);
|
package/cl.cdn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var XU="clpp.cdn.CdnChallengeComponent",YU=function(a){a=atob(a.replace(/-/g,"+").replace(/_/g,"/"));const b=new Uint8Array(a.length);for(let c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return b.buffer},ZU=function(a){return _.w(function*(){var b=[{initDataTypes:[_.Wc],videoCapabilities:[{contentType:'video/mp4; codecs\x3d"avc1.42E01E"',robustness:_.ob}],audioCapabilities:[{contentType:'audio/mp4; codecs\x3d"mp4a.40.2"',robustness:_.ob}]}];try{var c=yield navigator.requestMediaKeySystemAccess(_.wd,
|
|
2
2
|
b)}catch(e){throw Error("CDN challenge requires Widevine but requestMediaKeySystemAccess failed: "+e.message);}b=yield c.createMediaKeys();(c=_.So.V2)&&(yield b.setServerCertificate(new Uint8Array(c)));const d=b.createSession(_.Yf);b=yield new Promise((e,f)=>{const g=window.setTimeout(()=>{f(Error("CDM challenge session timed out"))},1E4);d.addEventListener(_.Ae,h=>{window.clearTimeout(g);e(h.message)});d.generateRequest(_.Wc,a).catch(h=>{window.clearTimeout(g);f(h)})});d.close().catch(()=>{});return b})},
|
|
3
|
-
$U=function(a){let b="";_.G(a).forEach(c=>{b+=String.fromCharCode(c)});return btoa(b)},aV=function(a,b,c){return _.w(function*(){var d=b.headers["x-drm-challenge-data"],e=b.headers["x-drm-challenge-token"];if(!d||!e)throw a.g.warn("428 received but missing challenge headers"),Error("428 challenge headers missing");a.g.info("428 challenge received");const f=c.
|
|
4
|
-
l;}d=b.uri||b.request.uris[0];try{var h=yield c.
|
|
5
|
-
c.
|
|
6
|
-
_.x(XU,class extends _.Ev{constructor(){super();this.g=new _.T(XU);this.
|
|
7
|
-
e.
|
|
3
|
+
$U=function(a){let b="";_.G(a).forEach(c=>{b+=String.fromCharCode(c)});return btoa(b)},aV=function(a,b,c){return _.w(function*(){var d=b.headers["x-drm-challenge-data"],e=b.headers["x-drm-challenge-token"];if(!d||!e)throw a.g.warn("428 received but missing challenge headers"),Error("428 challenge headers missing");a.g.info("428 challenge received");const f=c.oe.onChallengeStart;typeof f===_.ae&&f();d=YU(d);try{var g=yield ZU(d)}catch(l){throw a.g.error("Failed to create CDM challenge session",l),
|
|
4
|
+
l;}d=b.uri||b.request.uris[0];try{var h=yield c.oe.getAuthToken()}catch(l){throw a.g.error("getAuthToken() failed",l),l;}let k;try{k=yield window.fetch(d,{headers:{"x-drm-license-request":$U(g),"x-drm-challenge-token":e,Authorization:"Bearer "+h}})}catch(l){throw a.g.error("Manifest retry fetch failed",l),l;}if(!k.ok)throw a.g.error("Manifest retry returned "+k.status),Error("CDN challenge retry failed: "+k.status);e=k.headers.get("x-cat");g=k.headers.get(_.Ug);h=k.headers.get(_.Tg);e&&(c.he=e);d=
|
|
5
|
+
c.oe.onCatReceived;e&&typeof d===_.ae&&d(e);d=c.oe.onChallengeComplete;typeof d===_.ae&&d({Uj:g,Tj:h,he:e});b.data=yield k.arrayBuffer();b.status=k.status;k.headers.forEach((l,m)=>{b.headers[m.toLowerCase()]=l});a.g.info("428 challenge complete");return b})};
|
|
6
|
+
_.x(XU,class extends _.Ev{constructor(){super();this.g=new _.T(XU);this.a=new WeakMap}id(){return"cdn-challenge"}beforeLoad(a){var b=a.getConfiguration();const c=b.drm&&b.drm.customData&&b.drm.customData.cdn;if(c&&typeof c.getAuthToken===_.ae){if(b=this.a.get(a)){const e=a.getNetworkEngine();b.Ne&&e.Df(b.Ne);b.Oe&&e.Yd(b.Oe);this.a.delete(a)}var d={he:null,zd:null,oe:c,Ne:null,Oe:null};b=a.getNetworkEngine();d.Ne=e=>{!d.he||1!==e.type&&2!==e.type||(e.headers["x-cat"]=d.he)};d.Oe=e=>{if(428===e.status&&
|
|
7
|
+
e.request&&1===e.request.type){if(d.zd)return d.zd;d.zd=aV(this,e,d).finally(()=>{d.zd=null});return d.zd}if(e.request&&3===e.request.type&&(e=e.headers["x-cat"])){d.he=e;const f=c.onCatReceived;typeof f===_.ae&&f(e)}};b.Ve(d.Ne);b.Sc(d.Oe);this.a.set(a,d)}}});};f.call(g, window);
|
package/cl.conviva.js
CHANGED
|
@@ -9,7 +9,7 @@ GU(a,HU,c)}})},GU=function(a,b,c=xU){if(a.a){a.a.reportAdMetric(Conviva.Constant
|
|
|
9
9
|
d;a.a.setAdPlayerInfo(e);a.a.reportAdStarted(c)}}catch(c){a.g.error("Could not create ad analytics session",c)}}},KU=function(a,b){const c={};c[Conviva.Constants.LOG_LEVEL]=Conviva.Constants.LogLevel.DEBUG;b.serviceUrl&&(a.g.warn("Touchstone URL is set. Do not set this in production!"),c[Conviva.Constants.GATEWAY_URL]=b.serviceUrl.replace(/\/$/,""));Conviva.Analytics.init(b.customerKey,null,c);Conviva.Analytics.setDeviceMetadata(AU(b));b.connectionType&&Conviva.Analytics.reportDeviceMetric(Conviva.Constants.Network.CONNECTION_TYPE,
|
|
10
10
|
b.connectionType);a.a=Conviva.Analytics.buildVideoAnalytics();a.o=!1;b={};b[Conviva.Constants.FRAMEWORK_NAME]=_.ra;b[Conviva.Constants.FRAMEWORK_VERSION]=_.ea;a.a.setPlayerInfo(b)},LU=function(a){return a.m.getConfiguration().autoplay||!1},NU=function(a){if(!a.l)if(a.C)a.g.warn("Current session still active. No-op.");else{var b=a.m.Sa()||a.K,c=a.m.getConfiguration().conviva||null,d=c&&c.viewerId||"N/A",e=c&&c.defaultResource||"N/A";a.g.debug(a.m.getConfiguration().source);var f={},g=new _.lp(b.url);
|
|
11
11
|
b&&(f[Conviva.Constants.ASSET_NAME]=b.name||"N/A",f[Conviva.Constants.STREAM_URL]=_.Qm(g));f[Conviva.Constants.PLAYER_NAME]=c.playerName||_.ra;f[Conviva.Constants.VIEWER_ID]=d;f[Conviva.Constants.DEFAULT_RESOURCE]=e;if(c&&!_.z(c.customTags))for(const h in c.customTags)f[h]=c.customTags[h];a.a.reportPlaybackRequested(f);a.a.setCallback(()=>{a.g.debug("reportMiscellaneousMetrics()");if(MU(a)){var h=1E3*a.m.getPosition();a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAY_HEAD_TIME,h);if(h=a.m.getStats()){h=
|
|
12
|
-
h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.
|
|
12
|
+
h.decodedFrames;const k=h-a.H;a.H=h;isFinite(k)&&(a.g.debug("Current FPS",k),a.a.reportPlaybackMetric(Conviva.Constants.Playback.RENDERED_FRAMERATE,k))}}});a.C=!0;a.h=!0;a.I=!1;0<a.j.length&&(a.g.debug("Report deferred events"),a.j.forEach(h=>{h.xg(h.args)}));a.j=[]}},OU=function(a){if(!a.l&&a.a){const b=BU(a.m.isLive()),c={};c[Conviva.Constants.IS_LIVE]=b;c[Conviva.Constants.DURATION]=a.m.getDuration();a.a.setContentInfo(c)}},MU=function(a){return null!==a.a&&a.C},PU=function(a){a.g.debug("terminateSession()");
|
|
13
13
|
a.a&&(a.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.STOPPED),a.a.reportPlaybackEnded(),a.a.release(),Conviva.Analytics.release(),a.o=!0,a.C=!1,a.A=!1,a.h=!1,a.w=null,a.B=!1,a.P=0,a.J=!1,a.j=[],a.H=0)},RU=function(a,b){const c=b.getConfiguration();a.a=!_.z(c.conviva)&&typeof c.conviva===_.Ie;a.a?"undefined"===typeof window.Conviva?(a.g.warn("Conviva SDK is not loaded. Will do nothing."),a.a=!1,a=new _.I(1,9,9E3),QU(b,a)):b.namespace()===_.hd&&(a.a=!1,
|
|
14
14
|
a.g.debug("Conviva does not report when casting.")):a.g.debug("Conviva plugin is loaded but not configured. Will do nothing.")},SU=function(a){const b=[];typeof a===_.Ie&&(a.customerKey||b.push("customerKey"),a.viewerId||b.push("viewerId"));if(0<b.length)throw new _.I(1,9,9001,{missingKeys:b});},QU=function(a,b){a.trigger(new _.H(_.Xd,{detail:b}))};var UU=class{constructor(a,b){this.m=a;this.R=b;this.B="";this.A=_.ra;this.g=new _.T("clpp.conviva.ad");this.f=new _.Vt;this.a=null;this.h=this.o=this.w=this.j=!1}initialize(a){this.g.debug("Initialize Ad Insights");this.h=this.w=!1;this.B=a.viewerId;this.A=a.playerName||_.ra;IU(this)}release(){this.g.debug("Release Ad Insights");this.w?this.g.debug(_.ia):(_.ai(this.f),this.a&&GU(this,TU),this.f.release(),this.w=!0,this.j=this.h=!1)}destroy(){this.g.debug(_.Dd);this.o?this.g.debug(_.ha):this.o=!0}C(){this.g.debug(yU)}F(){this.g.debug(zU)}L(a){this.g.debug("onAdStarted()");
|
|
15
15
|
a=a.ad;this.j||(this.g.warn("Ad load event was not triggered. This will have incidence on VSF"),FU(this,a));this.j=!1;this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,Conviva.Constants.PlayerState.PLAYING);this.a.reportAdMetric(Conviva.Constants.Playback.RESOLUTION,a.Va(),a.Ua());this.a.reportAdMetric(Conviva.Constants.Playback.BITRATE,a.Ba())}l(a){this.g.debug("onAdStateChanged()");if(this.a){const b=c=>{this.a.reportAdMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.type){case _.jc:case _.kc:b(Conviva.Constants.PlayerState.PLAYING);
|
|
@@ -20,8 +20,8 @@ _.qg,this.U.bind(this)),this.f.on(this.m,_.Ub,this.R.bind(this)),this.f.on(this.
|
|
|
20
20
|
PU(this),this.a=null,this.G=!0)}destroy(){this.g.debug(_.Dd);this.l?this.g.debug(_.ha):this.l=!0}reportAppEvent(a,b){let c=!1;try{Conviva.Analytics.reportAppEvent(a,b),c=!0}catch(d){this.g.debug("Report app event error",d),c=!1}return c}ia(){this.g.debug("onPlayRequest()");MU(this)||LU(this)?MU(this)&&this.A&&!this.h&&(this.g.debug("Resuming VST monitoring ..."),MU(this)&&!this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_ENDED),this.h=!0),this.A=!1):(this.g.debug("Creating conviva session. On Play Requested / No autoplay"),
|
|
21
21
|
NU(this))}X(a){this.g.debug(_.Oe);const b=c=>{if(this.o&&(this.g.debug("Creating conviva session (On Seek / Replay)"),KU(this,this.F),NU(this),OU(this),MU(this))){var d=this.m.getTrackManager();d=d.ta()||d.xb();d.width&&d.height&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,d.width,d.height);d.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,d.bandwidth/1E3)}MU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.PLAYER_STATE,c)};switch(a.detail.currentState){case 3:b(Conviva.Constants.PlayerState.PLAYING);
|
|
22
22
|
break;case 4:b(Conviva.Constants.PlayerState.PAUSED);break;case 2:b(Conviva.Constants.PlayerState.BUFFERING);break;case 5:this.g.debug("onVideoEnded()"),MU(this)&&(this.w&&this.w.Pb()?(this.g.debug("Waiting for postroll Ad before terminating session"),this.J=!0):PU(this))}}L(a){this.g.debug(_.Je);if(MU(this)){if(a=a.detail,typeof a.width===_.r&&typeof a.height===_.r&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.RESOLUTION,a.width,a.height),a.bandwidth&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.BITRATE,
|
|
23
|
-
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({
|
|
23
|
+
a.bandwidth/1E3),(a=a.rendition)&&a.track&&(a=a.track)&&a.frameRate){const b={};b[Conviva.Constants.ENCODED_FRAMERATE]=a.frameRate;this.a.setContentInfo(b)}}else this.j.push({xg:this.L.bind(this),args:a})}W(){this.g.debug("onSeeking()");MU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_STARTED)}U(){this.g.debug("onSeeked()");MU(this)&&this.a.reportPlaybackMetric(Conviva.Constants.Playback.SEEK_ENDED)}ca(a){this.g.debug("onAdsTimelineChanged()");if(a=a.adsTimeline)this.w=a}R(a){this.g.debug(yU);
|
|
24
24
|
var b=a.ad;a=0===b.Ca();const c=CU(b.getPodIndex());MU(this)||LU(this)||!a||NU(this);if(MU(this)){a=0===b.hb()?Conviva.Constants.AdType.CLIENT_SIDE:Conviva.Constants.AdType.SERVER_SIDE;let d=0;const e={};1===b.Wa()&&(d=b.getDuration());e[Conviva.Constants.POD_DURATION]=d;e[Conviva.Constants.POD_INDEX]=++this.P;e[Conviva.Constants.POD_POSITION]=c;b=Conviva.Constants.AdPlayer;b=a!==Conviva.Constants.AdType.CLIENT_SIDE||_.aj()?b.CONTENT:b.SEPARATE;this.a.reportAdBreakStarted(a,b,e);this.B=!0}else this.g.debug("Bug: should already have a valid session")}S(){this.g.debug(zU);
|
|
25
25
|
MU(this)&&this.B&&(this.a.reportAdBreakEnded(),this.B=!1,this.J&&PU(this))}M(a){this.g.debug(_.Le);if(this.o&&this.I)this.g.debug("Session ended in VPF; ignoring subsequent errors");else{var b=a.detail||null,c=b&&b.message||"Player error",d=Conviva.Constants.ErrorSeverity.WARNING;b&&b.severity&&b.severity===_.D&&(d=Conviva.Constants.ErrorSeverity.FATAL,MU(this)||NU(this));MU(this)?(this.g.debug("Report error",c,d),this.a.reportPlaybackError(c,d),d===Conviva.Constants.ErrorSeverity.FATAL&&(this.g.debug("Video Playback Failure"),
|
|
26
|
-
this.I=!0,PU(this))):this.j.push({
|
|
26
|
+
this.I=!0,PU(this))):this.j.push({xg:this.M.bind(this),args:a})}}da(){this.g.debug("onAutoPlayBlocked()");MU(this)&&(this.g.debug("Auto-play blocked. Pausing VST monitoring."),this.A=!0,MU(this)&&this.h&&(this.a.reportPlaybackEvent(Conviva.Constants.Events.USER_WAIT_STARTED),this.h=!1))}};var WU=class{constructor(){this.h=this.f=null;this.a=!1;this.g=new _.T("clpp.conviva")}onPlayerCreated(a){this.f=new VU(a,this.g)}onContentWillLoad(a,b){RU(this,a);if(this.a){var c=a.getConfiguration();c=_.ih(c.conviva||{});try{SU(c);const d=c.enableAdInsights||!1;this.f.initialize(a,c,b);d&&(this.h=new UU(a,()=>this.f.a),this.h.initialize(c))}catch(d){d instanceof _.I?QU(a,d):QU(a,new _.I(1,9,9002,d,d))}}}onContentLoaded(){this.a&&OU(this.f)}onPlayerWillDestroy(){this.a&&(this.a=!1,this.f.destroy(),
|
|
27
27
|
this.f=null,this.h&&(this.h.destroy(),this.h=null))}onPlayerWillRelease(){this.a&&(this.f.release(),this.h&&this.h.release())}id(){return"conviva"}reportAppEvent(a,b){return this.f?this.f.reportAppEvent(a,b):!1}};_.x("clpp.conviva.ConvivaPlugin",WU);WU.prototype.reportAppEvent=WU.prototype.reportAppEvent;WU.Id="conviva";_.Tn(new class{create(){return new WU}});};f.call(g, window);
|