@castlabs/prestoplay 6.10.0 → 6.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +112 -112
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +467 -435
  8. package/cjs/cl.crypto.js +9 -10
  9. package/cjs/cl.dash.js +72 -72
  10. package/cjs/cl.externs.js +132 -33
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +78 -74
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +274 -274
  17. package/cjs/cl.muxdata.js +14 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +24 -24
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +29 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -20
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +395 -368
  36. package/cl.crypto.js +9 -9
  37. package/cl.dash.js +67 -66
  38. package/cl.externs.js +128 -33
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +64 -61
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +26 -26
  43. package/cl.ima.js +17 -17
  44. package/cl.mse.js +238 -239
  45. package/cl.muxdata.js +12 -12
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +11 -11
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +59 -59
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +14 -14
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +15 -15
  58. package/clpp.styles.css +15 -0
  59. package/package.json +1 -1
  60. package/typings.d.ts +202 -19
package/cjs/cl.ttml.js CHANGED
@@ -1,31 +1,33 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var is='application/mp4; codecs\x3d"stpp.ttml"',js='application/mp4; codecs\x3d"stpp.ttml.im1i"',ks='application/mp4; codecs\x3d"stpp.ttml.im1t"',ls="backgroundColor",ms="direction",ws="displayAlign",Es="region",Fs="sans-serif",Gs="textAlign",Hs="textDecoration",Is="writingMode",Js=function(a,b,c){this.g=a;this.f=b;this.a=c},Ks=function(a,b,c){Js.call(this,a,[],c);this.j=b||""},Ls=function(a,b,c){Js.call(this,a,b,c)},Ms=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(c in
3
- e.a)return e.getAttribute(c)}return null},Us=function(a,b){var c=null;if(Ns.test(a)){c=Ns.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 Os.test(a)?c=Ps(Os,a):Qs.test(a)?c=Ps(Qs,a):Rs.test(a)?(c=Rs.exec(a),c=Number(c[1])/b.frameRate):Ss.test(a)?(c=Ss.exec(a),c=Number(c[1])/b.a):Ts.test(a)&&(c=Ps(Ts,a));return c},Ps=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||
4
- 0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},Vs=function(a){return a.split(":").pop()},Ws=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Ys=function(a,b){for(;Xs.test(a);){var c=Xs.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Zs=function(a,b,c,d,e,f,g){Js.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.m=e;this.j=[]},$s=function(a,b,c){a=Ms(a,b,Gs);if(!a&&c&&(a=Ms(c,b,Gs),!a&&"rltb"===Ms(c,b,Is)))return _.ke;switch(a){case _.Dc:return _.zg;case _.ke:case _.gd:return _.ke;default:return _.rd}},
5
- at=function(a,b,c){if(_.Hh(a.w))return document.createTextNode(_.Lh(a.w||""));if(a.A)return _.yn("br");for(var d=_.yn("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.zn(d,f.value);a=_.u(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(at(c.get(e.value),b,c));return d},bt=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=Number(d);0===this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},ct=function(a,
6
- b,c){Js.call(this,a,b,c)},ft=function(a,b,c,d){var e=dt.exec(a);a=et.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},gt=function(a,b){return typeof b===_.k&&0<b?_.Fg:et.test(a)?0:_.Fg},ht=function(a,b){Js.call(this,"root-container",[],b);this.j=a},it=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},jt=function(a,b){var c=a.getAttribute("extent");return(c=et.exec(c))?Number(c[b]):null},lt=function(a){a=a.getAttribute("cellResolution");return(a=kt.exec(a))?
7
- Number(a[2]):null},mt=function(a,b,c){Js.call(this,a,b,c)},nt=function(a){this.B=a;this.w=this.m=null;this.A=0;this.g=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},pt=function(a){return ot.some(function(b){return b in a.attributes})},qt=function(a,b){if(0===b.length)return[];for(var c=[],d=_.u(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.of(qt(a,a.a.get(e).f)).concat([e]));return c},st=function(){return"inline-"+rt++},tt=function(a){return a.o.map(function(b){return b.build(a.m,
8
- a.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},ut=function(a){this.a=a.firstChild;this.f=new Set},vt=function(a,b,c,d,e,f){this.g=a;this.a=b;this.j=c;this.m=d;this.f=e;this.attributes=f},wt=function(a){return Vs(a.g.nodeName)},xt=function(){this.a=new Map},zt=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;if(h&&a.a.has(h)){var l=a.a.get(h);e=_.of(l.m).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.of(l.f).concat(),
9
- g={},yt.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Es)&&(c=b.getAttribute(Es));b.hasAttribute(_.xe)&&f.push.apply(f,_.of(b.getAttribute(_.xe).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=Vs(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new vt(b,c,d,e,f,g);a.a.set(b,c);return c},At=function(a){this.a=a;this.f=new DOMParser},Bt=function(a){this.f=
10
- a},Ct=function(a){return String(Math.floor(a/3600)).padStart(2,"0")+":"+String(Math.floor(a/60%60)).padStart(2,"0")+":"+String(Math.floor(a%60)).padStart(2,"0")+"."+String(Math.floor(1E3*a%1E3)).padStart(3,"0")},Dt=function(){},Et=function(a){this.a=new At(a);this.h=new _.I("clpp.ttml.Mp4TtmlParser")},Ft=function(){this.a=new Dt};Js.prototype.getId=function(){return this.g};Js.prototype.getAttribute=function(a){return this.a[a]};_.w(Ks,Js);_.w(Ls,Js);var Ns=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Os=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Qs=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Rs=/^(\d*(?:\.\d*)?)f$/,Ss=/^(\d*(?:\.\d*)?)t$/,Ts=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,dt=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,et=/^(\d+)px (\d+)px$/,kt=/^(\d+) (\d+)$/,Xs=/(\d+)px/,Gt=/^(\d+px|\d+em|\d*\.?\d+c)$/,ot=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
11
- "color",ls,"opacity","padding","zIndex",Gs,ws,Is,ms,Hs,"textOutline"],yt=["begin",_.gd];_.w(Zs,Ls);
12
- Zs.prototype.build=function(a,b,c,d,e,f,g){var h=Us(this.a.begin,b);b=Us(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.yn(_.Zc);for(var l=_.u(this.j),m=l.next();!m.done;m=l.next())c.appendChild(at(g.get(m.value),e,g));g=new _.Eg(h,b,c.innerHTML.trim(),_.He);g.cssClassList=_.of(this.f).concat();g.textAlign=$s(this,e,null);g.writingMode=_.Ag;g.line=-1;g.lineInterpretation=_.Bg;g.lineAlign=_.Cg;g.containerRows=it(null,lt(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
13
- $s(this,e,f);a:switch(Ms(f,e,Is)){case "tb":case "tblr":a=_.Pe;break a;case "tbrl":a=_.Qe;break a;default:a=_.Ag}g.writingMode=a;a:switch(Ms(f,e,ws)){case _.Dc:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Ms(f,e,ws)){case _.Dc:a=1;break a;default:a=_.Bg}g.lineInterpretation=a;a:switch(Ms(f,e,ws)){case _.Dc:e=_.Dc;break a;default:e=_.Cg}g.lineAlign=e}this.m&&(a=d.get(this.m))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.j.trim(),
14
- g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.w(ct,Ls);
15
- ct.prototype.build=function(a,b){var c=new _.Hg;c.id=this.getId();var d=it(a.j.containerWidth,jt(a,1),720),e=it(a.j.containerHeight,jt(a,2),480);a:switch(Ms(this,b,ws)){case "after":var f="flex-start";break a;case _.Dc:f=_.Dc;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Ms(this,b,Is)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Pc}c.writingMode=f;f=this.getAttribute("extent")||Ms(this,b,"extent");c.width=ft(f,d,1,100);c.widthUnits=gt(f,d);c.height=
16
- ft(f,e,2,100);c.heightUnits=gt(f,e);f=this.getAttribute("origin")||Ms(this,b,"origin");c.viewportAnchorX=ft(f,d,1,0);c.viewportAnchorY=ft(f,e,2,0);c.viewportAnchorUnits=gt(f,d);c.cssClassList=_.of(this.f).concat();return c};_.w(ht,Js);_.w(mt,Js);
17
- mt.prototype.build=function(a){var b=null;var c=lt(a);c&&(b=it(a.j.containerHeight,jt(a,2),480)/c);b=it(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(Ht.entries()),e=d.next();!e.done;e=d.next()){var f=_.u(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+Ws(this.a[e])+";")}a:{if("unicodeBidi"in this.a){d=this.a.unicodeBidi;e="";switch(d){case "normal":case "embed":e=d;break;case "bidiOverride":e="bidi-override"}if(0<e.length){d="unicode-bidi:"+
18
- 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(),h=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!Gt.test(g)&&Gt.test(h)&&Gt.test(l)?(e=g,f=h):2===d.length&&!Gt.test(g)&&Gt.test(h)?(e=g,f=h):2===d.length&&Gt.test(g)&&Gt.test(h)&&(f=g);if(""!==f){f=Ws(f);d="text-shadow:0 0 "+(f+" "+e+",0 0 ")+(f+" "+e+",0 0 ")+(f+" "+e+";");break a}}d=""}c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif",
19
- "monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",Fs).replace("proportionalSerif",Fs).replace("sansSerif",Fs).replace("default",Fs)+";":"");a:{if(Hs in this.a){d=[];e=_.u(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="text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+
20
- Ws(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Ws(e),e=Ys(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=Ws(d);d=Ys(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.g+" .clpp-text-wrapper {",a.push(c+b+"}"),c="::ttml .clpp-text-wrapper__"+this.g+" {",a.push(c+b+"}"));return a};
21
- var Ht=new Map([["color","color"],[ls,"background-color"],[ms,ms],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var rt=0;ut.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!It.has(Vs(a.nodeName))||Jt.has(Vs(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&&!It.has(Vs(a.nodeName))));var b=this.a;this.a=a;return b};var It=new Set(["tt","head","layout",_.Cd,_.od,Es,"styling",_.xe,"body",_.Zc,"p","span","br"]),Jt=new Set([_.xe,_.od]);vt.prototype.getId=function(){return this.attributes.id};At.prototype.parseInit=function(){};
22
- At.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.K.Ua(this.a.ttml||{}),e=_.N(a,0,c[0]);e=_.yh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.Ee)}catch(n){throw new _.L(_.M,2,2005,"Failed to parse TTML.");}d=new nt(d);e=new xt;f=new ut(f);b=b.periodStart;typeof b===_.k&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.N(a,b,h);l=_.Nh(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Ks(m,l,{imageType:"PNG",encoding:"Base64"}));
23
- b+=h}for(;f.a;)a=f.next(),a=zt(e,a),"tt"===wt(a)&&(d.m=new ht(d.B,Object.assign({},a.attributes))),"tt"===wt(a)&&(d.w=new bt(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),wt(a)!==_.od||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new Ks(c,a.g.textContent,a.attributes))),wt(a)===_.od&&a.attributes.begin&&a.attributes.end?(c="#"+st(),b=new Ks(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.j=c.getId()),wt(a)===
24
- _.xe&&(c=a.getId()||st(),b=new mt(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),wt(a)!==_.xe&&pt(a)?(c=st(),b=new mt(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),wt(a)!==_.Zc||!a.attributes.extent&&!a.attributes.origin?c=null:(c=st(),b=new ct(c,qt(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),wt(a)!==Es?c=null:(c=a.getId(),b=new ct(c,qt(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&
25
- (a.a=c.getId()),c=a.m,-1===["#text","span","br"].indexOf(wt(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=st(),b=new Zs(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===wt(a),a.a,a.j,qt(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.m.push(c.getId()),"p"===wt(a)||a.j?(c=st(),b=new Zs(c,null,!1,a.a,a.j,qt(d,a.f),a.attributes),d.f.set(c,b),d.o.push(b),c=b):c=null,c&&a.m.push(c.getId());e=tt(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
26
- _.of(c.value.build(d.m)));return{cues:e,styles:f}};Bt.prototype.a=function(a){a=(new At(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Ct(c.startTime)+" --\x3e "+Ct(c.endTime),e=[];switch(c.textAlign){case _.rd:e.push("align:left");break;case _.ke:e.push("align:right");break;case _.zg:e.push("align:middle");break;case _.rd:e.push("align:start");break;case _.ke:e.push("align:end")}switch(c.writingMode){case _.Pe:e.push("vertical:lr");break;
27
- case _.Qe:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.Ch(b)};Dt.prototype.probe=function(a,b){return a===_.jc&&b===_.De};Dt.prototype.create=function(a){return new Bt(a)};Et.prototype.parseInit=function(a){var b=!1;(new _.Ok).L(_.Fd,_.Pk).L(_.Ge,_.Pk).L(_.Ad,_.Pk).L(_.Ed,_.Pk).L(_.ue,_.Pk).Y(_.we,_.Qk).L("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.L(_.M,2,2007);};
28
- Et.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Ok).L("moof",_.Pk).L("traf",_.Pk).Y("subs",function(h){for(var l=_.U(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.Jk(h.reader),p=0;p<n;++p){var q=1===h.version?_.U(h.reader):_.Jk(h.reader);g.push(q);h.reader.skip(6)}}}).L(_.zd,_.Rk(function(h){d=!0;h=c.a.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.h.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(Ft,_.Bo);Ft.prototype.Qa=function(){_.Tp[_.jc]=At;_.Tp[_.hc]=Et;_.Tp[is]=Et;_.Tp[ks]=Et;_.Tp[js]=Et;_.Ui.push(this.a)};Ft.prototype.Ha=function(){_.Up(_.jc);_.Up(_.hc);_.Up(is);_.Up(ks);_.Up(js);_.Wi(this.a)};Ft.prototype.id=function(){return _.Ae};_.C("clpp.ttml.TtmlComponent",Ft);};
2
+ var f=function(window){var Nt='application/mp4; codecs\x3d"stpp.ttml"',Ot='application/mp4; codecs\x3d"stpp.ttml.im1i"',Pt='application/mp4; codecs\x3d"stpp.ttml.im1t"',Qt="backgroundColor",Rt="direction",St="displayAlign",Tt="region",Ut="sans-serif",Vt="textAlign",Wt="textDecoration",Xt="writingMode",Yt=function(a,b,c){this.g=a;this.f=b;this.a=c},Zt=function(a,b,c){Yt.call(this,a,[],c);this.j=b||""},$t=function(a,b,c){Yt.call(this,a,b,c)},au=function(a,b,c){a=a.f;for(var d=a.length-1;0<=d;d--){var e=b.get(a[d]);if(c in
3
+ e.a)return e.getAttribute(c)}return null},iu=function(a,b){var c=null;if(bu.test(a)){c=bu.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 cu.test(a)?c=du(cu,a):eu.test(a)?c=du(eu,a):fu.test(a)?(c=fu.exec(a),c=Number(c[1])/b.frameRate):gu.test(a)?(c=gu.exec(a),c=Number(c[1])/b.a):hu.test(a)&&(c=du(hu,a));return c},du=function(a,b){var c=a.exec(b);return null==c||""===c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||
4
+ 0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},ju=function(a){return a.split(":").pop()},ku=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},mu=function(a,b){for(;lu.test(a);){var c=lu.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},nu=function(a){return a?a.replace(/(\d*\.?\d+)%/g,function(b,c){return c/100+"em"}):""},ou=function(a,b,c,d,e,f,g){Yt.call(this,a,f,g);this.w=b;this.A=c;this.o=d;this.l=e;this.j=[]},pu=function(a,b,c){a=au(a,b,Vt);if(!a&&c&&(a=au(c,b,Vt),!a&&"rltb"===au(c,
5
+ b,Xt)))return _.Ke;switch(a){case _.Ic:return _.Zg;case _.Ke:case _.wd:return _.Ke;default:return _.Hd}},qu=function(a,b,c){if(_.gi(a.w))return document.createTextNode(_.ki(a.w||""));if(a.A)return _.to("br");for(var d=_.to("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.uo(d,f.value);a=_.u(a.j);for(e=a.next();!e.done;e=a.next())d.appendChild(qu(c.get(e.value),b,c));return d},ru=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*
6
+ this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))},su=function(a,b,c){Yt.call(this,a,b,c)},vu=function(a,b,c,d){var e=tu.exec(a);a=uu.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},wu=function(a,b){return typeof b===_.k&&0<b?_.eh:uu.test(a)?0:_.eh},xu=function(a,b){Yt.call(this,"root-container",[],b);this.j=a},yu=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},zu=function(a,b){var c=a.getAttribute("extent");
7
+ return(c=uu.exec(c))?Number(c[b]):null},Bu=function(a){a=a.getAttribute("cellResolution");return(a=Au.exec(a))?Number(a[2]):null},Cu=function(a,b,c){Yt.call(this,a,b,c)},Du=function(a){this.B=a;this.w=this.l=null;this.A=0;this.g=new Map;this.a=new Map;this.j=new Map;this.f=new Map;this.o=[]},Fu=function(a){return Eu.some(function(b){return b in a.attributes})},Gu=function(a,b){if(0===b.length)return[];for(var c=[],d=_.u(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.Of(Gu(a,
8
+ a.a.get(e).f)).concat([e]));return c},Iu=function(){return"inline-"+Hu++},Ju=function(a){return a.o.map(function(b){return b.build(a.l,a.w,a.A,a.g,a.a,a.j,a.f)}).filter(function(b){return null!=b})},Ku=function(a){this.a=a.firstChild;this.f=new Set},Lu=function(a,b,c,d,e,f){this.g=a;this.a=b;this.j=c;this.l=d;this.f=e;this.attributes=f},Mu=function(a){return ju(a.g.nodeName)},Nu=function(){this.a=new Map},Pu=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},h=b.parentNode;
9
+ if(h&&a.a.has(h)){var l=a.a.get(h);e=_.Of(l.l).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.j,f=_.Of(l.f).concat(),g={},Ou.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Tt)&&(c=b.getAttribute(Tt));b.hasAttribute(_.We)&&f.push.apply(f,_.Of(b.getAttribute(_.We).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(h=d.next();!h.done;h=d.next()){h=h.value;var m=ju(h);g[m]=b.getAttribute(h)}d=
10
+ g.backgroundImage}c=new Lu(b,c,d,e,f,g);a.a.set(b,c);return c},Qu=function(a){this.a=a;this.f=new DOMParser},Ru=function(a){this.f=a},Su=function(a){return String(Math.floor(a/3600)).padStart(2,"0")+":"+String(Math.floor(a/60%60)).padStart(2,"0")+":"+String(Math.floor(a%60)).padStart(2,"0")+"."+String(Math.floor(1E3*a%1E3)).padStart(3,"0")},Tu=function(){},Uu=function(a){this.a=new Qu(a);this.h=new _.K("clpp.ttml.Mp4TtmlParser")},Vu=function(){this.j=new Tu};Yt.prototype.getId=function(){return this.g};
11
+ Yt.prototype.getAttribute=function(a){return this.a[a]};_.w(Zt,Yt);_.w($t,Yt);var bu=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,cu=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,eu=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,fu=/^(\d*(?:\.\d*)?)f$/,gu=/^(\d*(?:\.\d*)?)t$/,hu=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,tu=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,uu=/^(\d+)px (\d+)px$/,Au=/^(\d+) (\d+)$/,lu=/(\d+)px/,Wu=/^(\d+px|\d+em|\d*\.?\d+c)$/,Eu=[Qt,"color",Rt,St,"fontFamily","fontSize","fontStyle","fontWeight",
12
+ "lineHeight","opacity","padding",Vt,Wt,"textOutline",Xt,"zIndex"],Ou=["begin",_.wd];_.w(ou,$t);
13
+ ou.prototype.build=function(a,b,c,d,e,f,g){var h=iu(this.a.begin,b);b=iu(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.to(_.gd);for(var l=_.u(this.j),m=l.next();!m.done;m=l.next())c.appendChild(qu(g.get(m.value),e,g));g=new _.dh(h,b,c.innerHTML.trim(),_.ef);g.cssClassList=_.Of(this.f).concat();g.textAlign=pu(this,e,null);g.writingMode=_.$g;g.line=-1;g.lineInterpretation=_.ah;g.lineAlign=_.bh;g.containerRows=yu(null,Bu(a),15);if(this.o&&(f=f.get(this.o))){g.region=f.build(a,e);g.textAlign=
14
+ pu(this,e,f);a:switch(au(f,e,Xt)){case "tb":case "tblr":a=_.sf;break a;case "tbrl":a=_.tf;break a;default:a=_.$g}g.writingMode=a;a:switch(au(f,e,St)){case _.Ic:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(au(f,e,St)){case _.Ic:a=1;break a;default:a=_.ah}g.lineInterpretation=a;a:switch(au(f,e,St)){case _.Ic:e=_.Ic;break a;default:e=_.bh}g.lineAlign=e}this.l&&(a=d.get(this.l))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.j.trim(),
15
+ g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.w(su,$t);
16
+ su.prototype.build=function(a,b){var c=new _.gh;c.id=this.getId();var d=yu(a.j.containerWidth,zu(a,1),720),e=yu(a.j.containerHeight,zu(a,2),480);a:switch(au(this,b,St)){case "after":var f="flex-start";break a;case _.Ic:f=_.Ic;break a;default:f="flex-end"}c.displayAlign=f;a:switch(au(this,b,Xt)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Wc}c.writingMode=f;f=this.getAttribute("extent")||au(this,b,"extent");c.width=vu(f,d,1,100);c.widthUnits=wu(f,d);c.height=
17
+ vu(f,e,2,100);c.heightUnits=wu(f,e);f=this.getAttribute("origin")||au(this,b,"origin");c.viewportAnchorX=vu(f,d,1,0);c.viewportAnchorY=vu(f,e,2,0);c.viewportAnchorUnits=wu(f,d);c.cssClassList=_.Of(this.f).concat();return c};_.w(xu,Yt);_.w(Cu,Yt);
18
+ Cu.prototype.build=function(a){var b=null;var c=Bu(a);c&&(b=yu(a.j.containerHeight,zu(a,2),480)/c);b=yu(a.j.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(Xu.entries()),e=d.next();!e.done;e=d.next()){var f=_.u(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+ku(this.a[e])+";")}a:{if("unicodeBidi"in this.a){d=this.a.unicodeBidi;e="";switch(d){case "normal":case "embed":e=d;break;case "bidiOverride":e="bidi-override"}if(0<e.length){d="unicode-bidi:"+
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(),h=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!Wu.test(g)&&Wu.test(h)&&Wu.test(l)?(e=g,f=h):2===d.length&&!Wu.test(g)&&Wu.test(h)?(e=g,f=h):2===d.length&&Wu.test(g)&&Wu.test(h)&&(f=g);if(""!==f){f=ku(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=nu(this.a.textShadow),d=ku(d),d="text-shadow:"+
20
+ d+";"):d="";c=c+d+("fontFamily"in this.a?"font-family:"+this.a.fontFamily.replace("monospaceSansSerif","monospace").replace("monospaceSerif","monospace").replace("proportionalSansSerif",Ut).replace("proportionalSerif",Ut).replace("sansSerif",Ut).replace("default",Ut)+";":"");a:{if(Wt in this.a){d=[];e=_.u(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
+ "text-decoration:"+d.join(" ")+";";break a}}d=""}e="padding"in this.a?"border: solid transparent;border-width:"+ku(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=ku(e),e=mu(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=ku(d);d=mu(d,b);b="font-size:"+d+";";break a}b=null}b&&(c="::ttml ."+this.g+" .clpp-text-wrapper {",a.push(c+b+"}"),
22
+ c="::ttml .clpp-text-wrapper__"+this.g+" {",a.push(c+b+"}"));return a};var Xu=new Map([[Qt,"background-color"],["color","color"],[Rt,Rt],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var Hu=0;Ku.prototype.Wd=function(){return!!this.a};Ku.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Yu.has(ju(a.nodeName))||Zu.has(ju(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&&!Yu.has(ju(a.nodeName))));var b=this.a;this.a=a;return b};
23
+ var Yu=new Set(["tt","head","layout",_.Td,_.Ed,Tt,"styling",_.We,"body",_.gd,"p","span","br"]),Zu=new Set([_.We,_.Ed]);Lu.prototype.getId=function(){return this.attributes.id};Qu.prototype.parseInit=function(){};
24
+ Qu.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.M.Sa(this.a.ttml||{}),e=_.R(a,0,c[0]);e=_.Yh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.bf)}catch(n){throw new _.N(_.O,2,2005,"Failed to parse TTML.");}d=new Du(d);e=new Nu;f=new Ku(f);b=b.periodStart;typeof b===_.k&&(d.A=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.R(a,b,h);l=_.mi(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Zt(m,l,{imageType:"PNG",encoding:"Base64"}));
25
+ b+=h}for(;f.Wd();)a=f.next(),a=Pu(e,a),"tt"===Mu(a)&&(d.l=new xu(d.B,Object.assign({},a.attributes))),"tt"===Mu(a)&&(d.w=new ru(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),Mu(a)!==_.Ed||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new Zt(c,a.g.textContent,a.attributes))),Mu(a)===_.Ed&&a.attributes.begin&&a.attributes.end?(c="#"+Iu(),b=new Zt(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.j=c.getId()),
26
+ Mu(a)===_.We&&(c=a.getId()||Iu(),b=new Cu(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.j.get(a.a).f.push(c)),Mu(a)!==_.We&&Fu(a)?(c=Iu(),b=new Cu(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),Mu(a)!==_.gd||!a.attributes.extent&&!a.attributes.origin?c=null:(c=Iu(),b=new su(c,Gu(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),c=b),c&&(a.a=c.getId()),Mu(a)!==Tt?c=null:(c=a.getId(),b=new su(c,Gu(d,a.f),Object.assign({},a.attributes)),d.j.set(c,b),
27
+ c=b),c&&(a.a=c.getId()),c=a.l,-1===["#text","span","br"].indexOf(Mu(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=Iu(),b=new ou(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===Mu(a),a.a,a.j,Gu(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"===Mu(a)||a.j?(c=Iu(),b=new ou(c,null,!1,a.a,a.j,Gu(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=Ju(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
28
+ _.Of(c.value.build(d.l)));return{cues:e,styles:f}};Ru.prototype.a=function(a){a=(new Qu(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.u(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Su(c.startTime)+" --\x3e "+Su(c.endTime),e=[];switch(c.textAlign){case _.Hd:e.push("align:left");break;case _.Ke:e.push("align:right");break;case _.Zg:e.push("align:middle");break;case _.Hd:e.push("align:start");break;case _.Ke:e.push("align:end")}switch(c.writingMode){case _.sf:e.push("vertical:lr");break;
29
+ case _.tf:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.bi(b)};Tu.prototype.probe=function(a,b){return a===_.oc&&b===_.af};Tu.prototype.create=function(a){return new Ru(a)};Uu.prototype.parseInit=function(a){var b=!1;(new _.ul).L(_.Wd,_.vl).L(_.df,_.vl).L(_.Rd,_.vl).L(_.Vd,_.vl).L(_.Te,_.vl).X(_.Ve,_.wl).L("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new _.N(_.O,2,2007);};
30
+ Uu.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.ul).L("moof",_.vl).L("traf",_.vl).X("subs",function(h){for(var l=_.W(h.reader),m=0;m<l;++m){h.reader.skip(4);for(var n=_.pl(h.reader),p=0;p<n;++p){var q=1===h.version?_.W(h.reader):_.pl(h.reader);g.push(q);h.reader.skip(6)}}}).L(_.Qd,_.xl(function(h){d=!0;h=c.a.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.h.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.w(Vu,_.Mp);Vu.prototype.f=function(){_.fr[_.oc]=Qu;_.fr[_.mc]=Uu;_.fr[Nt]=Uu;_.fr[Pt]=Uu;_.fr[Ot]=Uu;_.tj.push(this.j)};Vu.prototype.a=function(){_.gr(_.oc);_.gr(_.mc);_.gr(Nt);_.gr(Pt);_.gr(Ot);_.vj(this.j)};Vu.prototype.id=function(){return"subtitles-ttml"};_.I("clpp.ttml.TtmlComponent",Vu);};
29
31
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
30
32
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
31
33
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Xr="VerimatrixVCAS",Yr="clpp.verimatrix.Vcas",Zr="clpp.verimatrix.VcasComponent",es=function(a){_.Ak.call(this,Xr);var b={};b[$r]=$r;b[as]=as;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?bs:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,h=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?cs:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
- this.D=d;this.B=b;this.w=ds(this,e);this.o=ds(this,f);this.m=ds(this,g);this.j=h;this.H=l;this.F=m;this.h=new _.I(Yr);_.Ih(this.w)?this.h.warn(_.Db):this.Sa(_.Tc,{licenseUrl:this.w,videoRobustness:[_.mb,void 0],audioRobustness:[_.lb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.g.bind(this)}});_.Ih(this.o)?this.h.warn(_.cb):this.Sa(_.Sc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.g.bind(this)}});
4
- _.Ih(this.m)?this.h.warn(_.Ia):_.Ih(this.j)?this.h.warn(_.Ha):this.Sa(_.Rc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},ds=function(a,b){if(a.D===bs){var c=Object.assign({},{deviceId:_.Oh(_.Eh(a.A))},a.a&&{authenticator:_.Oh(_.Eh(a.a))});return b+_.Fi(c)}return b},fs=function(){this.l=null;this.h=new _.I(Zr)};_.w(es,_.Ak);
5
- es.prototype.g=function(a,b){if(this.D===gs){var c=this.B[as],d={};d[this.B[$r]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};es.prototype.I=function(a,b){var c=_.Xk(b);switch(this.F){case hs:c=_.Fi({r:c,gm:this.H},!0)}return c};es.prototype.K=function(a,b){this.g(a,b);_.$k(b)};es.prototype.M=function(a,b){_.al(b)};_.C(Yr,es);es.prototype.constructor=es.prototype.constructor;es.NAME=Xr;var bs="query-string",gs="http-header";
6
- es.LicenseRequestVuidLocation={QUERY_STRING:bs,HTTP_HEADER:gs};var $r="DeviceId",as="Authenticator";es.LicenseRequestHttpHeader={DEVICE_ID_HEADER:$r,AUTHENTICATOR_HEADER:as};var cs="keyid",hs="contentid-siteid";es.FairPlayAssetIdStrategy={KEYID:cs,CONTENTID_SITEID:hs};_.w(fs,_.Bo);_.t=fs.prototype;_.t.Qa=function(a){this.l=a};_.t.Ha=function(){this.l=null};_.t.ac=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===Xr){a=a.drm.customData;if(!a)throw new _.L(_.M,7,7100,_.Uc);a=new es(a);this.h.info("Registering the Verimatrix VCAS Ultra environment");_.vk(a)}};_.t.release=function(){};_.t.id=function(){return"verimatrix-vcas"};_.C(Zr,fs);};
2
+ var f=function(window){var Bt="VerimatrixVCAS",Ct="clpp.verimatrix.Vcas",Dt="clpp.verimatrix.VcasComponent",Jt=function(a){_.hl.call(this,Bt);var b={};b[Et]=Et;b[Ft]=Ft;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Gt:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,h=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?Ht:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.D=d;this.B=b;this.w=It(this,e);this.o=It(this,f);this.l=It(this,g);this.j=h;this.H=l;this.F=m;this.h=new _.K(Ct);_.hi(this.w)?this.h.warn(_.Kb):this.Pa(_.ad,{licenseUrl:this.w,videoRobustness:[_.sb,void 0],audioRobustness:[_.rb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.g.bind(this)}});_.hi(this.o)?this.h.warn(_.gb):this.Pa(_.Zc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.g.bind(this)}});
4
+ _.hi(this.l)?this.h.warn(_.La):_.hi(this.j)?this.h.warn(_.Ka):this.Pa(_.Yc,{licenseUrl:this.l,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},It=function(a,b){if(a.D===Gt){var c=Object.assign({},{deviceId:_.ni(_.di(a.A))},a.a&&{authenticator:_.ni(_.di(a.a))});return b+_.ej(c)}return b},Kt=function(){this.h=new _.K(Dt)};_.w(Jt,_.hl);
5
+ Jt.prototype.g=function(a,b){if(this.D===Lt){var c=this.B[Ft],d={};d[this.B[Et]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};Jt.prototype.I=function(a,b){var c=_.Dl(b);switch(this.F){case Mt:c=_.ej({r:c,um:this.H},!0)}return c};Jt.prototype.K=function(a,b){this.g(a,b);_.Gl(b)};Jt.prototype.M=function(a,b){_.Hl(b)};_.I(Ct,Jt);Jt.prototype.constructor=Jt.prototype.constructor;Jt.NAME=Bt;var Gt="query-string",Lt="http-header";
6
+ Jt.LicenseRequestVuidLocation={QUERY_STRING:Gt,HTTP_HEADER:Lt};var Et="DeviceId",Ft="Authenticator";Jt.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Et,AUTHENTICATOR_HEADER:Ft};var Ht="keyid",Mt="contentid-siteid";Jt.FairPlayAssetIdStrategy={KEYID:Ht,CONTENTID_SITEID:Mt};_.w(Kt,_.Mp);Kt.prototype.a=function(){delete _.al.VerimatrixVCAS};Kt.prototype.g=function(a){a=a.getConfiguration();if(a.drm&&a.drm.env===Bt){a=a.drm.customData;if(!a)throw new _.N(_.O,7,7100,_.bd);a=new Jt(a);this.h.info("Registering the Verimatrix VCAS Ultra environment");_.bl(a)}};Kt.prototype.id=function(){return"verimatrix-vcas"};_.I(Dt,Kt);};
7
7
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
8
8
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
9
9
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.vimond.js CHANGED
@@ -1,17 +1,17 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Nr="Registering listeners",Or="clpp.vimond.VimondPlugin",Pr=function(a,b,c,d,e){this.F=a;this.H=b;this.I=c;this.l=d;this.D=e;this.a=new _.eg;this.m=!0;this.f=this.j=this.A=!1;this.B=null;this.g=new _.$i(this.eg.bind(this));this.h=new _.I("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.a&&(this.h.debug(Nr),this.a.on(this.l,_.re,this.Oi.bind(this)),this.a.on(this.l,_.Fe,this.Pi.bind(this)),this.a.on(this.l,_.Fb,this.Mi.bind(this)),this.a.on(this.l,_.Hb,this.Ni.bind(this)))},Qr=function(a,
3
- b){a.l.trigger(new _.J(_.We,{detail:b}))},Rr=function(a,b,c){b&&(a.A=!0,a.g.stop());a.l.onError(new _.L(b?_.M:1,9,9201,c))},Sr=function(a,b,c,d,e){this.m=a;this.o=c;this.g=b;this.a=d;this.j=e;this.h=new _.I("clpp.vimond.VimondService");this.f=0},Tr=function(a){this.l=a;this.a=new _.eg;this.h=new _.I("clpp.vimond.VimondAdapter");this.f=this.g=!1;this.l&&this.a&&(this.h.debug(Nr),this.a.on(this.l,_.ge,this.Dk.bind(this)),this.a.on(this.l,_.Fb,this.Ki.bind(this)),this.a.on(this.l,_.Hb,this.Li.bind(this)))},
4
- Ur=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.$d];if(a.g)return[_.gd,_.Vd];if(c===_.Vm)return[_.gd,null];if(c===_.Zm)return[_.jd,_.Vd];var d=_.Vd;if(c===_.Tm||c===_.bn||a.f)d=_.$d;return["period",d]},Vr=function(){this.a=!1;this.h=new _.I(Or);this.j=this.g=this.f=null},Wr=function(){};_.t=Pr.prototype;_.t.Pi=function(){this.f||(this.f=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.t.Mi=function(){this.h.debug("Ad break started");this.j=!0};
5
- _.t.Ni=function(){this.h.debug("Ad break stopped");this.j=!1};
6
- _.t.Oi=function(a){var b=this,c,d,e,f,g;return _.B(function(h){if(1==h.a){c=a.detail;d=_.Xm;e=c.currentState;f=c.previousState;b.h.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.h.debug("Ignore transition"),h["return"]();if(b.m&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.h.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.h.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.G(0);
7
- b.B=e;return _.x(h,b.eg(),3)}e===d.ENDED&&b.g.stop();_.y(h)})};
8
- _.t.eg=function(){var a=this,b,c,d,e,f,g;return _.B(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.h.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.g.stop();a.g.aa(a.m?10:a.F);a.m=!1;_.Bf(h,2);l=a.D;l.f++;var m=_.K.wa(l.o);m.client.buildName=_.qa;m.client.buildVersion=_.ea;var n=m.client,p=l.a.l.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.l.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
9
- l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.Di(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Ur(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;var q=p.l.getPresentationStartTime()||0;p=Math.floor(q+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
10
- typeof n.liveResumePossible!==_.uc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.ai(l.m);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Eh(JSON.stringify(m));l=l.j.fetch(n).P;return _.x(h,l,4)}if(2!=h.a)return b=h.f,Qr(a,b),_.Cf(h,0);d=c=_.Df(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.h.debug("Unreachable service"),Qr(a,f),Rr(a,a.H,f)):1001===e?(a.h.debug("Generic service error"),
11
- Qr(a,f),Rr(a,a.I,f)):a.h.error(c.toString());_.y(h)})};_.t.dispose=function(){this.h.debug(_.yb);_.hg(this.a);this.g.stop()};Sr.prototype.Af=function(a){this.g=a};_.t=Tr.prototype;_.t.getPosition=function(){return Math.floor(this.l.getPosition())};_.t.Dk=function(){this.g=!0};_.t.Ki=function(){this.f=!0};_.t.Li=function(){this.f=!1};_.t.dispose=function(){this.h.debug(_.yb);_.hg(this.a)};_.w(Vr,_.eq);_.t=Vr.prototype;_.t.onPlayerCreated=function(){};
12
- _.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.K.R(b.vimond)&&typeof b.vimond===_.Ld)?a.namespace()===_.Jc&&(this.a=!1,this.h.info("Vimond does not report when casting.")):this.h.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.u(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.h.warn(d+" key is missing");a.onError(new _.L(1,9,9200));return}this.h.debug("Configuration is valid");
13
- c=b.failIfUnreachable;typeof c!==_.uc&&(c=!0);d=b.failOnError;typeof d!==_.uc&&(d=!0);this.f=new Tr(a);this.g=new Sr(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Pr(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.t.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"vimond"};
14
- _.t.Af=function(a){this.a&&this.g&&this.g.Af(a)};_.C(Or,Vr);Vr.prototype.updateAuthToken=Vr.prototype.Af;Vr.Id="vimond";Wr.prototype.create=function(){return new Vr};_.vo(new Wr);};
2
+ var f=function(window){var rt="Registering listeners",st="clpp.vimond.VimondPlugin",tt=function(a,b,c,d,e){this.F=a;this.H=b;this.I=c;this.m=d;this.D=e;this.a=new _.Eg;this.l=!0;this.f=this.j=this.A=!1;this.B=null;this.g=new _.zj(this.hg.bind(this));this.h=new _.K("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.m&&this.a&&(this.h.debug(rt),this.a.on(this.m,_.Re,this.Wi.bind(this)),this.a.on(this.m,_.cf,this.Xi.bind(this)),this.a.on(this.m,_.Mb,this.Ui.bind(this)),this.a.on(this.m,_.Nb,this.Vi.bind(this)))},ut=function(a,
3
+ b){a.m.trigger(new _.L(_.zf,{detail:b}))},vt=function(a,b,c){b&&(a.A=!0,a.g.stop());a.m.onError(new _.N(b?_.O:1,9,9201,c))},wt=function(a,b,c,d,e){this.l=a;this.o=c;this.g=b;this.a=d;this.j=e;this.h=new _.K("clpp.vimond.VimondService");this.f=0},xt=function(a){this.m=a;this.a=new _.Eg;this.h=new _.K("clpp.vimond.VimondAdapter");this.f=this.g=!1;this.m&&this.a&&(this.h.debug(rt),this.a.on(this.m,_.Ge,this.Nk.bind(this)),this.a.on(this.m,_.Mb,this.Si.bind(this)),this.a.on(this.m,_.Nb,this.Ti.bind(this)))},
4
+ yt=function(a,b){var c=a.m.getState();if(1===b)return["str-start",_.ve];if(a.g)return[_.wd,_.ke];if(c===_.Qn)return[_.wd,null];if(c===_.Un)return[_.yd,_.ke];var d=_.ke;if(c===_.On||c===_.Xn||a.f)d=_.ve;return["period",d]},zt=function(){this.a=!1;this.h=new _.K(st);this.j=this.g=this.f=null},At=function(){};_.r=tt.prototype;_.r.Xi=function(){this.f||(this.f=1<Math.abs(this.w-this.m.getPosition()));this.w=this.m.getPosition()};_.r.Ui=function(){this.h.debug("Ad break started");this.j=!0};
5
+ _.r.Vi=function(){this.h.debug("Ad break stopped");this.j=!1};
6
+ _.r.Wi=function(a){var b=this,c,d,e,f,g;return _.G(function(h){if(1==h.a){c=a.detail;d=_.Sn;e=c.currentState;f=c.previousState;b.h.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.f)return b.h.debug("Ignore transition"),h["return"]();if(b.l&&e!==d.PLAYING)return h["return"]();if(b.f&&[d.PAUSED,d.BUFFERING].includes(e))return b.h.debug("Seeking"),h["return"]();b.f&&e===d.PLAYING&&(b.h.debug("Seeked"),b.f=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.G(0);
7
+ b.B=e;return _.x(h,b.hg(),3)}e===d.ENDED&&b.g.stop();_.y(h)})};
8
+ _.r.hg=function(){var a=this,b,c,d,e,f,g;return _.G(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.h.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.g.stop();a.g.$(a.l?10:a.F);a.l=!1;_.B(h,2);l=a.D;l.f++;var m=_.M.va(l.o);m.client.buildName=_.sa;m.client.buildVersion=_.fa;var n=m.client,p=l.a.m.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.m.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
9
+ l.a.m.getLoadedSource().type||"";n=m.client;p=l.a.m.getLoadedSource();p=((new _.cj(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=yt(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;var q=p.m.getPresentationStartTime()||0;p=Math.floor(q+p.m.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;q=l.a;p=q.m.getPosition();q=q.m.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);
10
+ typeof n.liveResumePossible!==_.zc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.Ai(l.l);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.di(JSON.stringify(m));l=l.j.fetch(n).O;return _.x(h,l,4)}if(2!=h.a)return b=h.f,ut(a,b),_.ag(h,0);d=c=_.D(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.h.debug("Unreachable service"),ut(a,f),vt(a,a.H,f)):1001===e?(a.h.debug("Generic service error"),
11
+ ut(a,f),vt(a,a.I,f)):a.h.error(c.toString());_.y(h)})};_.r.dispose=function(){this.h.debug(_.Eb);_.Hg(this.a);this.g.stop()};wt.prototype.Bf=function(a){this.g=a};_.r=xt.prototype;_.r.getPosition=function(){return Math.floor(this.m.getPosition())};_.r.Nk=function(){this.g=!0};_.r.Si=function(){this.f=!0};_.r.Ti=function(){this.f=!1};_.r.dispose=function(){this.h.debug(_.Eb);_.Hg(this.a)};_.w(zt,_.rr);_.r=zt.prototype;_.r.onPlayerCreated=function(){};
12
+ _.r.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.M.R(b.vimond)&&typeof b.vimond===_.ae)?a.namespace()===_.Pc&&(this.a=!1,this.h.info("Vimond does not report when casting.")):this.h.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.u(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.h.warn(d+" key is missing");a.onError(new _.N(1,9,9200));return}this.h.debug("Configuration is valid");
13
+ c=b.failIfUnreachable;typeof c!==_.zc&&(c=!0);d=b.failOnError;typeof d!==_.zc&&(d=!0);this.f=new xt(a);this.g=new wt(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new tt(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.r.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"vimond"};
14
+ _.r.Bf=function(a){this.a&&this.g&&this.g.Bf(a)};_.I(st,zt);zt.prototype.updateAuthToken=zt.prototype.Bf;zt.Id="vimond";At.prototype.create=function(){return new zt};_.qp(new At);};
15
15
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
16
16
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
17
17
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.vr.js CHANGED
@@ -1,24 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var rr="touchmove",sr="touchstart",tr=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},ur=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},vr=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new tr(a/d*e,b/d*e,0/d*e,Math.cos(c))},wr=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},xr=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
- b):(a.x=0,a.y=0,a.a=0)},yr=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},zr=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Ar=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Br=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
4
- 3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},Cr=function(a){var b=new wr(0,0,0),c=new wr(0,0,1),d=new wr,e=new wr,f=new wr;a=a.a;var g=new wr(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();xr(f,1/g);c=zr(d,c,f);g=c.length();xr(c,1/g);zr(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-yr(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-yr(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-yr(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Fr=function(a){this.a=a;this.f=a.createProgram();this.m=
5
- Er(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=Er(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.m);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
- 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.L(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Er=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.L(1,
7
- 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Gr=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
- 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Hr=function(a,
9
- b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},Ir=function(){var a=this;this.o=this.w=this.M=this.J=this.A=
10
- this.ha=this.H=this.f=this.a=this.l=null;this.h=new _.I("clpp.vr");this.I=70;this.ga=1;this.T=this.N=!1;this.F=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.M.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.m=this.j=0;this.g={x:0,y:0};this.V=new Ar;this.da=new Ar;this.ma=new Ar;this.na=new Ar;this.B=this.Ak.bind(this);
11
- this.D=this.Bk.bind(this);this.K=this.zk.bind(this)},Jr=function(a){var b=vr(1,0,a.m*Math.PI/180);ur(vr(0,1,a.j*Math.PI/180),a.V);ur(b,a.da);Cr(a.ma);Br(a.na,a.V,a.ma);Br(a.H,a.da,a.na)},Kr=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(rr,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},Lr=function(){};wr.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Ar.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r,v,z){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=r;A[11]=v;A[15]=z;return this};var Mr={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(Ir,_.eq);_.t=Ir.prototype;_.t.onPlayerCreated=function(a){this.h.info("Player created");this.l=a};
12
- _.t.onContentWillLoad=function(a){var b=a.getConfiguration();if(b.vr&&b.vr.enable){var c=b.vr,d=c.fieldOfView,e=c.sensitivity,f=c.invertHorizontalControl;c=c.invertVerticalControl;if(void 0!==d&&_.K.la(d))this.I=d;else throw new _.L(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.K.la(e)&&0<e)this.ga=e;else throw new _.L(1,7,7100,"sensitivity configuration must be a positive number");this.N=!!f;this.T=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.Re){this.h.info("Initialize VR Surface");
13
- if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Mr)||this.a.getContext("experimental-webgl",Mr);if(!this.f)throw new _.L(1,9,9003,"Unable to create GL context");this.H=new Ar;Cr(this.H);this.ha=new Gr(this.f);this.A=new Fr(this.f);this.J=new Ar;this.M=new Ar;this.o=this.w=null;this.a.addEventListener(_.je,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
- !1),this.a.addEventListener(sr,this.K,!1));this.F();this.bh()}else this.h.info("No video element found, can not initialize VR plugin");else this.h.info("No surface found, can not initialize VR plugin")}};
15
- _.t.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.m=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(Kr(this),this.a.removeEventListener(_.je,this.F),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.t.onPlayerWillDestroy=function(){var a=this;return _.B(function(b){a.l=null;_.y(b)})};_.t.id=function(){return"vr"};
16
- _.t.bh=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Re){this.w=requestAnimationFrame(this.bh.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Hr(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
17
- 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Br(this.J,this.M,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ha;a.a.bindBuffer(a.a.ARRAY_BUFFER,
2
+ var f=function(window){var Hs="touchmove",Is="touchstart",Js=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Ks=function(a,b){var c=a.x,d=a.y,e=a.a,f=a.f;b.set(1-2*(d*d+e*e),2*(c*d-e*f),2*(c*e+d*f),0,2*(c*d+e*f),1-2*(c*c+e*e),2*(d*e-c*f),0,2*(c*e-d*f),2*(d*e+c*f),1-2*(c*c+d*d),0,0,0,0,1)},Ls=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Js(a/d*e,b/d*e,0/d*e,Math.cos(c))},Ms=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Ns=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},Os=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Ps=function(a,b,c){var d=b.x,e=b.y;b=b.a;var f=c.x,g=c.y;c=c.a;a.x=e*c-b*g;a.y=b*f-d*c;a.a=d*g-e*f;return a},Qs=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Rs=function(a,b,c){b=b.a;c=c.a;var d=a.a,e=0;do d[4*e]=b[4*e]*c[0]+b[4*e+1]*c[4]+b[4*e+2]*c[8]+b[4*e+3]*c[12],d[4*e+1]=b[4*e]*c[1]+b[4*e+1]*c[5]+b[4*e+2]*c[9]+b[4*e+3]*c[13],d[4*e+2]=b[4*e]*c[2]+b[4*e+1]*c[6]+b[4*e+2]*c[10]+b[4*e+3]*c[14],d[4*e+
4
+ 3]=b[4*e]*c[3]+b[4*e+1]*c[7]+b[4*e+2]*c[11]+b[4*e+3]*c[15];while(4>++e);return a},Ss=function(a){var b=new Ms(0,0,0),c=new Ms(0,0,1),d=new Ms,e=new Ms,f=new Ms;a=a.a;var g=new Ms(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Ns(f,1/g);c=Ps(d,c,f);g=c.length();Ns(c,1/g);Ps(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Os(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Os(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Os(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Us=function(a){this.a=a;this.f=a.createProgram();this.l=
5
+ Ts(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.j=Ts(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.l);a.attachShader(this.f,this.j);a.bindAttribLocation(this.f,
6
+ 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.N(1,9,9004,"Unable to initialize shader");a.useProgram(this.f);this.g=a.getUniformLocation(this.f,"Mvpm");a.uniform1i(a.getUniformLocation(this.f,"Texture0"),0);a.useProgram(null)},Ts=function(a,b,c){b=a.a.createShader(b?a.a.FRAGMENT_SHADER:a.a.VERTEX_SHADER);a.a.shaderSource(b,c);a.a.compileShader(b);if(!a.a.getShaderParameter(b,a.a.COMPILE_STATUS))throw new _.N(1,
7
+ 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},dt=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var h=c/128,l=(.5+h)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-h);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
+ 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},lt=function(a,
9
+ b){this.a=b;this.f=this.a.createTexture();b.activeTexture(b.TEXTURE0);b.bindTexture(b.TEXTURE_2D,this.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE);b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE);b.bindTexture(b.TEXTURE_2D,null)},mt=function(){var a=this;this.o=this.w=this.M=this.J=this.A=
10
+ this.ha=this.H=this.f=this.a=this.m=null;this.h=new _.K("clpp.vr");this.I=70;this.ea=1;this.T=this.P=!1;this.F=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.M.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.l=this.j=0;this.g={x:0,y:0};this.V=new Qs;this.ca=new Qs;this.ma=new Qs;this.na=new Qs;this.B=this.Kk.bind(this);
11
+ this.D=this.Lk.bind(this);this.K=this.Jk.bind(this)},nt=function(a){var b=Ls(1,0,a.l*Math.PI/180);Ks(Ls(0,1,a.j*Math.PI/180),a.V);Ks(b,a.ca);Ss(a.ma);Rs(a.na,a.V,a.ma);Rs(a.H,a.ca,a.na)},ot=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Hs,a.B,!1),a.a.removeEventListener("mouseup",a.D,!1),a.a.removeEventListener("touchend",a.D,!1))},pt=function(){};Ms.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Qs.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,t,v,z){var A=this.a;A[0]=a;A[4]=b;A[8]=c;A[12]=d;A[1]=e;A[5]=f;A[9]=g;A[13]=h;A[2]=l;A[6]=m;A[10]=n;A[14]=p;A[3]=q;A[7]=t;A[11]=v;A[15]=z;return this};var qt={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.w(mt,_.rr);_.r=mt.prototype;_.r.onPlayerCreated=function(a){this.h.info("Player created");this.m=a};
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&&_.M.la(d))this.I=d;else throw new _.N(1,7,7100,"fieldOfView configuration must be a number");if(void 0!==e&&_.M.la(e)&&0<e)this.ea=e;else throw new _.N(1,7,7100,"sensitivity configuration must be a positive number");this.P=!!f;this.T=!!c;if(a=a.getSurface())if((d=a.getMedia())&&d.tagName.toLowerCase()===_.uf){this.h.info("Initialize VR Surface");
13
+ if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",qt)||this.a.getContext("experimental-webgl",qt);if(!this.f)throw new _.N(1,9,9003,"Unable to create GL context");this.H=new Qs;Ss(this.H);this.ha=new dt(this.f);this.A=new Us(this.f);this.J=new Qs;this.M=new Qs;this.o=this.w=null;this.a.addEventListener(_.Je,this.F)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,
14
+ !1),this.a.addEventListener(Is,this.K,!1));this.F();this.hh()}else this.h.info("No video element found, can not initialize VR plugin");else this.h.info("No surface found, can not initialize VR plugin")}};
15
+ _.r.onPlayerWillRelease=function(){this.h.info("Releasing VR plugin resources");this.w&&cancelAnimationFrame(this.w);this.g.x=0;this.l=this.j=this.g.y=0;this.f&&(delete this.f,this.f=null);this.a&&(ot(this),this.a.removeEventListener(_.Je,this.F),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 _.G(function(b){a.m=null;_.y(b)})};_.r.id=function(){return"vr"};
16
+ _.r.hh=function(){if(this.m&&this.f){var a=this.m.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.uf){this.w=requestAnimationFrame(this.hh.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new lt(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
17
+ 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Rs(this.J,this.M,this.H).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.ha;a.a.bindBuffer(a.a.ARRAY_BUFFER,
18
18
  a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.g);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
19
- _.t.zk=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===sr)a.type===sr?a.touches[0]&&(this.g.x=a.touches[0].clientX,this.g.y=a.touches[0].clientY):(this.g.x=a.clientX,this.g.y=a.clientY),this.h.debug("Mouse Start coordinates:",this.g,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(rr,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
- _.t.Ak=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===rr&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;b=this.ga;c=d*b*(this.T?-1:1);this.j+=a*b*(this.N?-1:1);this.m+=c;Jr(this)};_.t.Bk=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Kr(this)};_.t.Uj=function(a,b){this.m=b;this.j=a;Jr(this)};_.t.lj=function(){return{x:this.j,y:this.m}};
21
- _.t.jl=function(a){this.I=a;this.F()};_.C("clpp.vr.VrPlugin",Ir);Ir.prototype.setCameraFieldOfView=Ir.prototype.jl;Ir.prototype.getCameraCoordinates=Ir.prototype.lj;Ir.prototype.moveCamera=Ir.prototype.Uj;Ir.Id="vr";Lr.prototype.create=function(){return new Ir};_.vo(new Lr);};
19
+ _.r.Jk=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Is)a.type===Is?a.touches[0]&&(this.g.x=a.touches[0].clientX,this.g.y=a.touches[0].clientY):(this.g.x=a.clientX,this.g.y=a.clientY),this.h.debug("Mouse Start coordinates:",this.g,a),this.a.addEventListener("mousemove",this.B,!1),this.a.addEventListener(Hs,this.B,!1),this.a.addEventListener("mouseup",this.D,!1),this.a.addEventListener("touchend",this.D,!1)};
20
+ _.r.Kk=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Hs&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;b=this.ea;c=d*b*(this.T?-1:1);this.j+=a*b*(this.P?-1:1);this.l+=c;nt(this)};_.r.Lk=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();ot(this)};_.r.dk=function(a,b){this.l=b;this.j=a;nt(this)};_.r.tj=function(){return{x:this.j,y:this.l}};
21
+ _.r.wl=function(a){this.I=a;this.F()};_.I("clpp.vr.VrPlugin",mt);mt.prototype.setCameraFieldOfView=mt.prototype.wl;mt.prototype.getCameraCoordinates=mt.prototype.tj;mt.prototype.moveCamera=mt.prototype.dk;mt.Id="vr";pt.prototype.create=function(){return new mt};_.qp(new pt);};
22
22
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
23
23
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
24
24
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.vtt.js CHANGED
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Yq=" The setting will be ignored.",Zq="VTT parser encountered an invalid VTT setting: ",$q="application/x-subrip",ar="text/srt",br='text/vtt; codecs\x3d"vtt"',cr='text/vtt; codecs\x3d"wvtt"',dr=function(a){_.Vh(a,/[ \t]+/gm)},er=function(a){return a.a==a.f.length?null:(a=_.Vh(a,/[^ \t\n]*/gm))?a[0]:null},fr=function(){},gr=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
3
- a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},hr=function(){},ir=function(a){this.a=a},kr=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.zg:a.textAlign=
4
- _.kq[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Pe:_.Qe;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.ud||b==_.qe?_.ud:b==_.vd||b==_.gd?_.vd:_.Dc);else if(d=/^region:(.*)$/.exec(b)){if(b=jr(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
5
- c[2]&&(a.lineAlign=_.lq[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.Bg,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.lq[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},jr=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.G("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},lr=function(a){a=_.Vh(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
6
- var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},mr=function(){ir.apply(this,arguments)},nr=function(){this.a=null;this.h=new _.I("clpp.vtt.mp4")},pr=function(a,b,c){var d,e,f;(new _.Ok).L("payl",_.Rk(function(g){d=_.yh(g)})).L("iden",_.Rk(function(g){e=_.yh(g)})).L("sttg",_.Rk(function(g){f=_.yh(g)})).parse(a);return d?or(d,e,f,b,c):null},or=function(a,b,c,d,e){a=new _.Eg(d,e,a,_.Ye);b&&(a.id=b);if(c)for(b=new _.Uh(c),c=er(b);c;)kr(a,c,[])||
7
- _.G(Zq,c,Yq),dr(b),c=er(b);return a},qr=function(){this.a=new hr};fr.prototype.a=function(a){a=_.yh(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=gr(c.value)}return _.Ch(a)};hr.prototype.create=function(){return new fr};hr.prototype.probe=function(a,b){return(a===ar||a===$q)&&b===_.De};ir.prototype.parseInit=function(){};
8
- ir.prototype.parseMedia=function(a,b){var c=_.yh(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.L(_.M,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=lr(new _.Uh(e[1]));if(null==c)throw new _.L(_.M,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
- f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.Uh(h.replace(/\n/g," "));g=new _.Hg;er(h);dr(h);for(var l=er(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.G("VTT parser encountered an invalid VTTRegion setting: ",l,Yq);dr(h);l=er(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Uh(p[0]);m=lr(l);var r=_.Vh(l,/[ \t]+--\x3e[ \t]+/g);n=lr(l);if(null==m||null==r||null==n)throw new _.L(_.M,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.Eg(m,n,p,_.Ye);g&&(m.id=g);dr(l);for(n=er(l);n;)kr(m,n,f)||_.G(Zq,
12
- n,Yq),dr(l),n=er(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(mr,ir);mr.prototype.parseMedia=function(a,b){return ir.prototype.parseMedia.call(this,(new fr).a(a),b)};nr.prototype.parseInit=function(a){var b=this,c=!1;(new _.Ok).L(_.Fd,_.Pk).L(_.Ge,_.Pk).L(_.Ad,_.Pk).Y("mdhd",function(d){0==d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.U(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.U(d.reader),d.reader.skip(8));d.reader.skip(4)}).L(_.Ed,_.Pk).L(_.ue,_.Pk).Y(_.we,_.Qk).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.L(_.M,2,2008);if(!c)throw new _.L(_.M,2,2008);};
13
- nr.prototype.parseMedia=function(a,b){if(!this.a)throw this.h.error("No init segment for MP4+VTT!"),new _.L(_.M,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.Ok).L("moof",_.Pk).L("traf",_.Pk).Y("tfdt",function(H){g=!0;c=0==H.version?_.U(H.reader):_.Lk(H.reader)}).Y("tfhd",function(H){var Q=H.flags;H=H.reader;H.skip(4);Q&1&&H.skip(8);Q&2&&H.skip(4);m=Q&8?_.U(H):null}).Y("trun",function(H){h=!0;var Q=H.version,O=H.flags;H=H.reader;var Ca=_.U(H);O&1&&H.skip(4);O&4&&H.skip(4);for(var sa=[],
14
- wa=0;wa<Ca;wa++){var Fa={duration:null,sampleSize:null,xf:null};O&256&&(Fa.duration=_.U(H));O&512&&(Fa.sampleSize=_.U(H));O&1024&&H.skip(4);O&2048&&(Fa.xf=0==Q?_.U(H):_.Kk(H));sa.push(Fa)}d=sa}).L(_.zd,_.Rk(function(H){l=!0;e=H})).parse(a);if(!l&&!g&&!h)throw new _.L(_.M,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Fk(p,!1);for(var q=_.u(d),r=q.next();!r.done;r=q.next()){r=r.value;var v=r.duration||m,z=r.xf?c+r.xf:n;n=z+(v||0);var A=0;do{var D=_.U(p);A+=D;var F=_.U(p);
15
- F=_.Tk(F);var E=null;"vttc"==F?8<D&&(E=_.Nk(p,D-8)):("vtte"!=F&&this.h.error("Unknown box "+F+"! Skipping!"),p.skip(D-8));v?E&&f.push(pr(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.h.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&A<r.sampleSize)}return{cues:f.filter(_.Ng),styles:[]}};_.w(qr,_.Bo);qr.prototype.Qa=function(){_.Tp[_.De]=ir;_.Tp[br]=ir;_.Tp[cr]=ir;_.Tp[_.ic]=nr;_.Tp[ar]=mr;_.Tp[$q]=mr;_.Ui.push(this.a)};qr.prototype.Ha=function(){_.Up(_.De);_.Up(br);_.Up(cr);_.Up(_.ic);_.Up(ar);_.Up($q);_.Wi(this.a)};qr.prototype.id=function(){return _.Ae};_.C("clpp.vtt.VttComponent",qr);};
2
+ var f=function(window){var ns=" The setting will be ignored.",os="VTT parser encountered an invalid VTT setting: ",ps="application/x-subrip",qs="text/srt",rs='text/vtt; codecs\x3d"vtt"',ss='text/vtt; codecs\x3d"wvtt"',ts=function(a){_.ui(a,/[ \t]+/gm)},us=function(a){return a.a==a.f.length?null:(a=_.ui(a,/[^ \t\n]*/gm))?a[0]:null},vs=function(){},ws=function(a){var b="";for(a=a.split(/\n/);3<a.length;){for(var c=3;c<a.length;++c)a[2]+="\n"+a[c];a.splice(3,a.length-3)}if(3!==a.length)return"";c=0;!a[0].match(/\d+:\d+:\d+/)&&
3
+ a[1].match(/\d+:\d+:\d+/)&&(b+=a[0].match(/\w+/)+"\n",++c);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);if(d)b+=d[1]+":"+d[2]+":"+d[3]+"."+d[4]+" --\x3e ",b+=d[5]+":"+d[6]+":"+d[7]+"."+d[8]+"\n",++c;else return""}else return"";a[c]&&(b+=a[c]+"\n\n");return b},xs=function(){},ys=function(a){this.a=a},As=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.Zg:a.textAlign=
4
+ _.xr[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.sf:_.tf;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.Kd||b==_.Qe?_.Kd:b==_.Ld||b==_.wd?_.Ld:_.Ic);else if(d=/^region:(.*)$/.exec(b)){if(b=zs(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
5
+ c[2]&&(a.lineAlign=_.yr[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ah,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.yr[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},zs=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.J("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Bs=function(a){a=_.ui(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
6
+ var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Cs=function(){ys.apply(this,arguments)},Ds=function(){this.a=null;this.h=new _.K("clpp.vtt.mp4")},Fs=function(a,b,c){var d,e,f;(new _.ul).L("payl",_.xl(function(g){d=_.Yh(g)})).L("iden",_.xl(function(g){e=_.Yh(g)})).L("sttg",_.xl(function(g){f=_.Yh(g)})).parse(a);return d?Es(d,e,f,b,c):null},Es=function(a,b,c,d,e){a=new _.dh(d,e,a,_.Bf);b&&(a.id=b);if(c)for(b=new _.ti(c),c=us(b);c;)As(a,c,[])||
7
+ _.J(os,c,ns),ts(b),c=us(b);return a},Gs=function(){this.j=new xs};vs.prototype.a=function(a){a=_.Yh(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=ws(c.value)}return _.bi(a)};xs.prototype.create=function(){return new vs};xs.prototype.probe=function(a,b){return(a===qs||a===ps)&&b===_.af};ys.prototype.parseInit=function(){};
8
+ ys.prototype.parseMedia=function(a,b){var c=_.Yh(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.N(_.O,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Bs(new _.ti(e[1]));if(null==c)throw new _.N(_.O,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.ti(h.replace(/\n/g," "));g=new _.gh;us(h);ts(h);for(var l=us(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
+ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.J("VTT parser encountered an invalid VTTRegion setting: ",l,ns);ts(h);l=us(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
+ e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.ti(p[0]);m=Bs(l);var t=_.ui(l,/[ \t]+--\x3e[ \t]+/g);n=Bs(l);if(null==m||null==t||null==n)throw new _.N(_.O,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.dh(m,n,p,_.Bf);g&&(m.id=g);ts(l);for(n=us(l);n;)As(m,n,f)||_.J(os,
12
+ n,ns),ts(l),n=us(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Cs,ys);Cs.prototype.parseMedia=function(a,b){return ys.prototype.parseMedia.call(this,(new vs).a(a),b)};Ds.prototype.parseInit=function(a){var b=this,c=!1;(new _.ul).L(_.Wd,_.vl).L(_.df,_.vl).L(_.Rd,_.vl).X("mdhd",function(d){0==d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).L(_.Vd,_.vl).L(_.Te,_.vl).X(_.Ve,_.wl).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.N(_.O,2,2008);if(!c)throw new _.N(_.O,2,2008);};
13
+ Ds.prototype.parseMedia=function(a,b){if(!this.a)throw this.h.error("No init segment for MP4+VTT!"),new _.N(_.O,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.ul).L("moof",_.vl).L("traf",_.vl).X("tfdt",function(H){g=!0;c=0==H.version?_.W(H.reader):_.rl(H.reader)}).X("tfhd",function(H){var Q=H.flags;H=H.reader;H.skip(4);Q&1&&H.skip(8);Q&2&&H.skip(4);m=Q&8?_.W(H):null}).X("trun",function(H){h=!0;var Q=H.version,P=H.flags;H=H.reader;var Ba=_.W(H);P&1&&H.skip(4);P&4&&H.skip(4);for(var ta=[],
14
+ ya=0;ya<Ba;ya++){var Ja={duration:null,sampleSize:null,yf:null};P&256&&(Ja.duration=_.W(H));P&512&&(Ja.sampleSize=_.W(H));P&1024&&H.skip(4);P&2048&&(Ja.yf=0==Q?_.W(H):_.ql(H));ta.push(Ja)}d=ta}).L(_.Qd,_.xl(function(H){l=!0;e=H})).parse(a);if(!l&&!g&&!h)throw new _.N(_.O,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.ll(p,!1);for(var q=_.u(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.yf?c+t.yf:n;n=z+(v||0);var A=0;do{var C=_.W(p);A+=C;var F=_.W(p);
15
+ F=_.zl(F);var E=null;"vttc"==F?8<C&&(E=_.tl(p,C-8)):("vtte"!=F&&this.h.error("Unknown box "+F+"! Skipping!"),p.skip(C-8));v?E&&f.push(Fs(E,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.h.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&A<t.sampleSize)}return{cues:f.filter(_.mh),styles:[]}};_.w(Gs,_.Mp);Gs.prototype.f=function(){_.fr[_.af]=ys;_.fr[rs]=ys;_.fr[ss]=ys;_.fr[_.nc]=Ds;_.fr[qs]=Cs;_.fr[ps]=Cs;_.tj.push(this.j)};Gs.prototype.a=function(){_.gr(_.af);_.gr(rs);_.gr(ss);_.gr(_.nc);_.gr(qs);_.gr(ps);_.vj(this.j)};Gs.prototype.id=function(){return"subtitles-vtt"};_.I("clpp.vtt.VttComponent",Gs);};
16
16
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
17
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
18
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.youbora.js CHANGED
@@ -1,24 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Nq='" event to Youbora',Oq='Reporting "',Pq="clpp.npaw.YouboraPlugin",Qq="content.isLive",Rq=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Sq=function(a,b,c,d){b=Rq(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.jd;b.severity===_.M?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
- b)):(d.fireError(b.code,b.message,b.metadata),c.debug(Oq+a+'" to Youbora',b.code,b));return b},Tq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.a=new _.eg;d.h=new _.I("clpp.npaw.YouboraAdapter");d.w=!1;d.g=!1;d.registerListeners();d.B=!1;return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.l.getPosition()};b.prototype.getDuration=function(){return this.l.getDuration()};b.prototype.getRendition=function(){var c=this.l.getTrackManager();
4
- if(c&&(c=c.fa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.m(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.l.isLive()};b.prototype.getResource=function(){var c=this.l.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.m().streamBandwidth};b.prototype.getThroughput=function(){return this.m().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.l.getPlaybackRate()};
5
- b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.Pa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.qa};b.prototype.getVersion=function(){return"6.10.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.a&&(this.h.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.a.on(this.l,_.re,this.K.bind(this)),this.a.on(this.l,_.jd,this.H.bind(this)),this.a.on(this.l,
6
- _.Ne,this.J.bind(this)),this.a.on(this.l,_.Me,this.I.bind(this)),this.a.on(this.l,_.Zb,this.D.bind(this)),this.a.on(this.l,_.zc,this.F.bind(this)))};b.prototype.unregisterListeners=function(){this.h.debug(_.yb);_.hg(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.m=function(){return this.l.getStats()||_.Fm()};b.prototype.o=function(){return!!this.l.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
7
- if(c)switch(c.currentState){case _.$m:this.o()&&this.f();break;case _.bn:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.an:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Om:this.fireBufferEnd();this.fireStop();break;case _.Vm:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Tm:this.fireBufferBegin();break;default:this.h.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
- (this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Tc)?"Widevine":c.startsWith(_.Rc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Td)?"ClearKey":c.startsWith(_.Qc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.g||10003===c.code&&this.plugin.getAdsAdapter()||(c=Sq(c,this.l,this.h,this))&&c.severity===_.M&&(this.g=!0)};
9
- b.prototype.J=function(){this.j(_.me);this.l.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.le);this.fireSeekEnd()};b.prototype.D=function(c){this.h.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.lb()};b.prototype.F=function(c){this.h.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[Oq+c+Nq].concat(_.of(e)))};return new b(a)},Uq=function(a){function b(c){var d=
10
- youbora.Adapter.call(this,c)||this;d.l=c;d.a=null;d.j=null;d.f=new _.eg;d.h=new _.I("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.m=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.yb(),this.a.xb(),this.a.kb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.kb()};b.prototype.getPlayhead=function(){var c=this.l.getAdsManager();
11
- return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.$a()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.h.debug("Ad position",
12
- d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.Ab()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
13
- function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.l.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.l.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.h.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.qa};b.prototype.getVersion=function(){return"6.10.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
- function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Zb,this.V.bind(this)),this.f.on(this.l,_.Vb,this.T.bind(this)),this.f.on(this.l,_.Qb,this.K.bind(this)),this.f.on(this.l,_.Tb,this.M.bind(this)),this.f.on(this.l,_.Kb,this.I.bind(this)),this.f.on(this.l,_.Lb,this.o.bind(this,1)),this.f.on(this.l,_.Pb,this.o.bind(this,2)),this.f.on(this.l,_.Xb,this.o.bind(this,3)),this.f.on(this.l,_.Jb,this.H.bind(this)),this.f.on(this.l,_.Ub,this.N.bind(this)),this.f.on(this.l,
15
- _.jd,this.J.bind(this)),this.f.on(this.l,_.Fb,this.B.bind(this)),this.f.on(this.l,_.Hb,this.D.bind(this)),this.f.on(this.l,_.Ib,this.F.bind(this)),this.f.on(this.l,_.Sb,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.hg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();
16
- this.fireJoin()};b.prototype.I=function(){this.g("ad ended");this.fireStop()};b.prototype.K=function(){this.g("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.g("ad resume");this.w();this.fireResume()};b.prototype.F=function(){this.m=!0;this.g("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.m&&(this.g("ad buffering ended"),this.m=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.g("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.g("ad clicked");
17
- var c=this.a&&this.a.Nb();this.h.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.N=function(){this.g("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()};b.prototype.D=function(){this.g("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Sq(c,this.l,this.h,this)};
18
- b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[Oq+c+Nq].concat(_.of(e)))};return new b(a)},Vq=function(){this.a=null;this.h=new _.I(Pq);this.l=null},Wq=function(a,b){if(b.namespace()===_.Jc)return a.h.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.K.vg(c))return a.h.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.h.warn("accountCode key is missing in Youbora config"),
19
- b.onError(new _.L(1,9,9101)),!1;if(_.K.R(window.youbora))return a.h.warn("Youbora SDK not found."),b.onError(new _.L(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.h.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.L(1,9,9102)));return!0},Xq=function(){};_.w(Vq,_.eq);_.t=Vq.prototype;_.t.sf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Tq(this.l)),this.a.setAdsAdapter(Uq(this.l))};_.t.getAdapter=function(){return this.a&&this.a.getAdapter()};_.t.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.t.onPlayerCreated=function(a){this.l=a;Wq(this,a)&&(a=a.getConfiguration().youbora,this.sf(new youbora.Plugin(a)))};
20
- _.t.onContentWillLoad=function(a,b){if(Wq(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[Qq]&&(d[Qq]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.sf(new youbora.Plugin(d));this.a.setOptions(d)}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.C(Pq,Vq);Vq.prototype.getAdsAdapter=Vq.prototype.getAdsAdapter;Vq.prototype.getAdapter=Vq.prototype.getAdapter;
21
- Vq.prototype.setYouboraPlugin=Vq.prototype.sf;Vq.Id="youbora";Xq.prototype.create=function(){return new Vq};_.vo(new Xq);};
2
+ var f=function(window){var cs='" event to Youbora',ds='Reporting "',es="clpp.npaw.YouboraPlugin",fs="content.isLive",gs=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},hs=function(a,b,c,d){b=gs(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.yd;b.severity===_.O?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
+ b)):(d.fireError(b.code,b.message,b.metadata),c.debug(ds+a+'" to Youbora',b.code,b));return b},is=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Eg;d.h=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.g=!1;d.registerListeners();d.B=!1;return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();
4
+ if(c&&(c=c.ga())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),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.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
5
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Oa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.sa};b.prototype.getVersion=function(){return"6.11.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.fa};b.prototype.registerListeners=function(){this.m&&this.a&&(this.h.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Re,this.K.bind(this)),this.a.on(this.m,_.yd,this.H.bind(this)),this.a.on(this.m,
6
+ _.mf,this.J.bind(this)),this.a.on(this.m,_.lf,this.I.bind(this)),this.a.on(this.m,_.dc,this.D.bind(this)),this.a.on(this.m,_.Ec,this.F.bind(this)))};b.prototype.unregisterListeners=function(){this.h.debug(_.Eb);_.Hg(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.Fn()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
7
+ if(c)switch(c.currentState){case _.Vn:this.o()&&this.f();break;case _.Xn:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Wn:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Jn:this.fireBufferEnd();this.fireStop();break;case _.Qn:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.On:this.fireBufferBegin();break;default:this.h.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
+ (this.g=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.ad)?"Widevine":c.startsWith(_.Yc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.ie)?"ClearKey":c.startsWith(_.Xc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.g||10003===c.code&&this.plugin.getAdsAdapter()||(c=hs(c,this.m,this.h,this))&&c.severity===_.O&&(this.g=!0)};
9
+ b.prototype.J=function(){this.j(_.Me);this.m.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Le);this.fireSeekEnd()};b.prototype.D=function(c){this.h.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.kb()};b.prototype.F=function(c){this.h.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[ds+c+cs].concat(_.Of(e)))};return new b(a)},js=function(a){function b(c){var d=
10
+ youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Eg;d.h=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.xb(),this.a.wb(),this.a.jb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.jb()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
11
+ return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Za()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.h.debug("Ad position",
12
+ d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.zb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
13
+ function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.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);this.h.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.sa};b.prototype.getVersion=function(){return"6.11.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
+ function(){return _.fa};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.dc,this.V.bind(this)),this.f.on(this.m,_.$b,this.T.bind(this)),this.f.on(this.m,_.Vb,this.K.bind(this)),this.f.on(this.m,_.Yb,this.M.bind(this)),this.f.on(this.m,_.Qb,this.I.bind(this)),this.f.on(this.m,_.Rb,this.o.bind(this,1)),this.f.on(this.m,_.Ub,this.o.bind(this,2)),this.f.on(this.m,_.bc,this.o.bind(this,3)),this.f.on(this.m,_.Pb,this.H.bind(this)),this.f.on(this.m,_.Zb,this.P.bind(this)),this.f.on(this.m,
15
+ _.yd,this.J.bind(this)),this.f.on(this.m,_.Mb,this.B.bind(this)),this.f.on(this.m,_.Nb,this.D.bind(this)),this.f.on(this.m,_.Ob,this.F.bind(this)),this.f.on(this.m,_.Xb,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Hg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.h.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.g("ad start",this.a);this.fireStart();
16
+ this.fireJoin()};b.prototype.I=function(){this.g("ad ended");this.fireStop()};b.prototype.K=function(){this.g("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.g("ad resume");this.w();this.fireResume()};b.prototype.F=function(){this.l=!0;this.g("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.g("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.g("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.g("ad clicked");
17
+ var c=this.a&&this.a.Lb();this.h.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.P=function(){this.g("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.g("ad break start",this.a);this.fireBreakStart()};b.prototype.D=function(){this.g("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&hs(c,this.m,this.h,this)};
18
+ b.prototype.g=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.h.debug.apply(this.h,[ds+c+cs].concat(_.Of(e)))};return new b(a)},ks=function(){this.a=null;this.h=new _.K(es);this.m=null},ls=function(a,b){if(b.namespace()===_.Pc)return a.h.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.M.Dg(c))return a.h.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.h.warn("accountCode key is missing in Youbora config"),
19
+ b.onError(new _.N(1,9,9101)),!1;if(_.M.R(window.youbora))return a.h.warn("Youbora SDK not found."),b.onError(new _.N(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.h.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.N(1,9,9102)));return!0},ms=function(){};_.w(ks,_.rr);_.r=ks.prototype;_.r.uf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(is(this.m)),this.a.setAdsAdapter(js(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;ls(this,a)&&(a=a.getConfiguration().youbora,this.uf(new youbora.Plugin(a)))};
20
+ _.r.onContentWillLoad=function(a,b){if(ls(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[fs]&&(d[fs]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.uf(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.I(es,ks);ks.prototype.getAdsAdapter=ks.prototype.getAdsAdapter;ks.prototype.getAdapter=ks.prototype.getAdapter;
21
+ ks.prototype.setYouboraPlugin=ks.prototype.uf;ks.Id="youbora";ms.prototype.create=function(){return new ks};_.qp(new ms);};
22
22
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
23
23
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
24
24
  else{_=this.clpp._;(f.call(g,this));}
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var fN=function(a){a.f=new _.po;a.f.on(a.l,_.Fe,()=>dN(a));a.f.on(a.l,_.Ee,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.qd,()=>eN(a));a.f.on(a.l,_.me,b=>{b=b.detail;switch(b.currentState){case _.Nl:a.a.length||eN(a);s.Media.play(a.a,a.l.getPosition());break;case _.Ml:case _.Fl:dN(a);break;case _.Cl:case _.Kl:case _.Jl:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),dN(a),s.Media.close(a.a),a.a=""}})},dN=function(a){s.Media.stop(a.a,a.l.getPosition())},
2
- eN=function(a){{const b=a.l.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.l.getDuration()}`);s.Media.open(a.a,a.l.getDuration(),_.ma)},gN=class extends _.fq{constructor(){super();this.l=this.f=null;this.a="";this.g=new _.Q("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.l=a,fN(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""}id(){return"adobe"}};
3
- _.z("clpp.adobe.AdobeAnalyticsPlugin",gN);gN.Id="adobe";_.Nm(new class{create(){return new gN}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var zO=function(a){a.f=new _.vp;a.f.on(a.m,_.af,()=>xO(a));a.f.on(a.m,_.$e,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.Bd,()=>yO(a));a.f.on(a.m,_.Ge,b=>{b=b.detail;switch(b.currentState){case _.Dm:a.a.length||yO(a);s.Media.play(a.a,a.m.getPosition());break;case _.Cm:case _.vm:xO(a);break;case _.sm:case _.Am:case _.zm:a.h.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),xO(a),s.Media.close(a.a),a.a=""}})},xO=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
+ yO=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.h.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.na)},AO=class extends _.rr{constructor(){super();this.m=this.f=null;this.a="";this.h=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,zO(this)):this.h.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
3
+ _.z("clpp.adobe.AdobeAnalyticsPlugin",AO);AO.Id="adobe";_.En(new class{create(){return new AO}});};f.call(g, window);
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var cN=class extends _.fq{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.Uo(()=>{this.l.play().catch(()=>{})});this.g=new _.po}onPlayerCreated(a){this.l=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.o.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.w.bind(this)))}onPlayerWillRelease(){this.m.stop();this.g.release()}id(){return"airplay"}o(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.l.trigger(new _.F(_.Sb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Rb:_.Pb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Nl)this.j?this.l.play().catch(()=>{}):this.m.da(.01);this.l.trigger(new _.F(a))}ib(){return this.h}sd(){return this.f}pg(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",cN);cN.prototype.showCastMenu=cN.prototype.pg;
3
- cN.prototype.canCast=cN.prototype.sd;cN.prototype.isCasting=cN.prototype.ib;cN.Id="airplay";_.Nm(new class{create(){return new cN}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var wO=class extends _.rr{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.$p(()=>{this.m.play().catch(()=>{})});this.g=new _.vp}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.g.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 _.F(_.Yb,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Xb:_.Wb;if(this.l||!this.m.isPaused()||this.m.getState()===_.Dm)this.l?this.m.play().catch(()=>{}):this.o.ca(.01);this.m.trigger(new _.F(a))}ib(){return this.j}xd(){return this.f}Ig(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",wO);wO.prototype.showCastMenu=wO.prototype.Ig;
3
+ wO.prototype.canCast=wO.prototype.xd;wO.prototype.isCasting=wO.prototype.ib;wO.Id="airplay";_.En(new class{create(){return new wO}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,5 +1,5 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var WM=function(){return!window.SmartLib||!window.GenericPlayerApi},XM=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof b===_.pe&&a.g.setUUID(b))},ZM=function(a,b){b=b.customParameters||{};a.a=a.g.createStreamingSession();for(const c in b)a.a.setCustomParameter(c,b[c]);a.j.on(a.l,_.ad,a.U.bind(a));a.h=YM(a.l);a.a.attachPlayer(a.h)},$M=function(a,b){_.Nf(a.j);a.f&&(a.f.release(),
2
- a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},aN=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.po;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.me,this.m.bind(this));b.on(a,_.gc,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Fl&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Fl:c.notifyStallStart();break;
3
- case _.Nl:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Ml:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Nf(this.a),this.a=null)}};var YM=a=>{class b extends GenericPlayerApi{constructor(c){super();this.l=c;this.a=_.Gi()}getPlayerName(){return _.ma}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.l.isLive()?0:1E3*this.l.getDuration()}getCurrentPosition(){return 1E3*this.l.getPosition()}getCurrentBitrate(){const c=this.l.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var bN=class extends _.fq{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.po}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(WM())return a.onError(new _.H(1,9,11E3));XM(this,c);ZM(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.l.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));$M(this,void 0)}else b.url=d.getURL(),this.f=new aN(this.l,
4
- this.h),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)$M(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:$M(this,SmartLib.BPDecodingError);break;case 1:$M(this,SmartLib.BPNetworkingError);break;case 6:$M(this,SmartLib.BPAccessRightError);break;default:$M(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){WM()||$M(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.z("clpp.broadpeak.BroadpeakPlugin",bN);bN.isSdkMissing=WM;bN.Id="broadpeak";
5
- _.Nm(new class{create(){return new bN}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var pO=function(){return!window.SmartLib||!window.GenericPlayerApi},qO=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof b===_.Je&&a.g.setUUID(b))},sO=function(a,b){b=b.customParameters||{};a.a=a.g.createStreamingSession();for(const c in b)a.a.setCustomParameter(c,b[c]);a.l.on(a.m,_.ld,a.U.bind(a));a.j=rO(a.m);a.a.attachPlayer(a.j)},tO=function(a,b){_.jg(a.l);a.f&&(a.f.release(),
2
+ a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},uO=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.vp;this.g=!1}init(){const a=this.m,b=this.a;b.on(a,_.Ge,this.o.bind(this));b.on(a,_.mc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.vm&&c.notifyStallEnd(!b.isPaused());switch(d){case _.vm:c.notifyStallStart();break;
3
+ case _.Dm:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Cm:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.jg(this.a),this.a=null)}};var rO=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.cj()}getPlayerName(){return _.na}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var vO=class extends _.rr{constructor(){super();this.j=this.f=this.a=this.g=this.m=null;this.l=new _.vp}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(pO())return a.onError(new _.H(1,9,11E3));qO(this,c);sO(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));tO(this,void 0)}else b.url=d.getURL(),this.f=new uO(this.m,
4
+ this.j),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)tO(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:tO(this,SmartLib.BPDecodingError);break;case 1:tO(this,SmartLib.BPNetworkingError);break;case 6:tO(this,SmartLib.BPAccessRightError);break;default:tO(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){pO()||tO(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.z("clpp.broadpeak.BroadpeakPlugin",vO);vO.isSdkMissing=pO;vO.Id="broadpeak";
5
+ _.En(new class{create(){return new vO}});};f.call(g, window);