@castlabs/prestoplay 6.3.0 → 6.4.1

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 (58) hide show
  1. package/CHANGELOG.md +70 -1
  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 +108 -107
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +426 -398
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +72 -69
  10. package/cjs/cl.externs.js +79 -155
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +47 -44
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -32
  15. package/cjs/cl.ima.js +22 -22
  16. package/cjs/cl.mse.js +259 -254
  17. package/cjs/cl.muxdata.js +12 -12
  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 +69 -69
  22. package/cjs/cl.thumbnails.js +24 -23
  23. package/cjs/cl.tizen.js +70 -70
  24. package/cjs/cl.ttml.js +27 -26
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +18 -18
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +20 -19
  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 -87
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +365 -348
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -63
  38. package/cl.externs.js +74 -154
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +39 -37
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +16 -16
  44. package/cl.mse.js +233 -222
  45. package/cl.muxdata.js +8 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +10 -10
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -58
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -21
  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 +16 -15
  58. package/package.json +4 -2
package/cjs/cl.ttml.js CHANGED
@@ -1,30 +1,31 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var qr='application/mp4; codecs\x3d"stpp.ttml"',rr='application/mp4; codecs\x3d"stpp.ttml.im1i"',sr='application/mp4; codecs\x3d"stpp.ttml.im1t"',tr="backgroundColor",ur="direction",vr="displayAlign",wr="region",xr="sans-serif",yr="textAlign",zr="textDecoration",Ar="writingMode",Br=function(a,b,c){this.g=a;this.f=b;this.a=c},Cr=function(a,b,c){Br.call(this,a,[],c);this.h=b||""},Dr=function(a,b,c){Br.call(this,a,b,c)},Er=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},$r=function(a,b){var c=null;if(Fr.test(a)){c=Fr.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 Gr.test(a)?c=Hr(Gr,a):Ir.test(a)?c=Hr(Ir,a):Qr.test(a)?(c=Qr.exec(a),c=Number(c[1])/b.frameRate):Yr.test(a)?(c=Yr.exec(a),c=Number(c[1])/b.a):Zr.test(a)&&(c=Hr(Zr,a));return c},Hr=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)},as=function(a){return a.split(":").pop()},bs=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},ds=function(a,b){for(;cs.test(a);){var c=cs.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},es=function(a,b,c,d,e,f,g){Br.call(this,a,f,g);this.o=b;this.w=c;this.m=d;this.j=e;this.h=[]},fs=function(a,b,c){a=Er(a,b,yr);if(!a&&c&&(a=Er(c,b,yr),!a&&"rltb"===Er(c,b,Ar)))return _.ae;switch(a){case _.sc:return _.ng;case _.ae:case _.Xc:return _.ae;default:return _.gd}},
5
- gs=function(a,b,c){if(_.bh(a.o))return document.createTextNode(_.eh(a.o||""));if(a.w)return _.Km("br");for(var d=_.Km("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.Lm(d,f.value);a=_.u(a.h);for(e=a.next();!e.done;e=a.next())d.appendChild(gs(c.get(e.value),b,c));return d},hs=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]))},is=function(a,
6
- b,c){Br.call(this,a,b,c)},ls=function(a,b,c,d){var e=js.exec(a);a=ks.exec(a);return typeof b===_.h&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},ms=function(a,b){return typeof b===_.h&&0<b?_.tg:ks.test(a)?0:_.tg},ns=function(a,b){Br.call(this,"root-container",[],b);this.h=a},os=function(a,b,c){return typeof a===_.h?a:typeof b===_.h?b:c},ps=function(a,b){var c=a.getAttribute("extent");return(c=ks.exec(c))?Number(c[b]):null},rs=function(a){a=a.getAttribute("cellResolution");return(a=qs.exec(a))?
7
- Number(a[2]):null},ss=function(a,b,c){Br.call(this,a,b,c)},ts=function(a){this.A=a;this.o=this.j=null;this.w=0;this.g=new Map;this.a=new Map;this.h=new Map;this.f=new Map;this.m=[]},vs=function(a){return us.some(function(b){return b in a.a})},ws=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,_.df(ws(a,a.a.get(e).f)).concat([e]));return c},ys=function(){return"inline-"+xs++},zs=function(a){return a.m.map(function(b){return b.build(a.j,
8
- a.o,a.w,a.g,a.a,a.h,a.f)}).filter(function(b){return null!=b})},As=function(a){this.a=a.firstChild;this.f=new Set},Bs=function(a,b,c,d,e,f){this.h=a;this.f=b;this.j=c;this.m=d;this.g=e;this.a=f},Cs=function(a){return as(a.h.nodeName)},Ds=function(){this.a=new Map},Fs=function(a,b){if(a.a.has(b))return a.a.get(b);var c=null,d=null,e=[],f=[],g={},k=b.parentNode;if(k&&a.a.has(k)){var l=a.a.get(k);e=_.df(l.m).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.f,d=l.j,f=_.df(l.g).concat(),g=
9
- {},Es.forEach(function(n){n in l.a&&(g[n]=l.a[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(wr)&&(c=b.getAttribute(wr));b.hasAttribute(_.oe)&&f.push.apply(f,_.df(b.getAttribute(_.oe).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.u(d);for(k=d.next();!k.done;k=d.next()){k=k.value;var m=as(k);g[m]=b.getAttribute(k)}d=g.backgroundImage}c=new Bs(b,c,d,e,f,g);a.a.set(b,c);return c},Gs=function(a){this.a=a;this.f=new DOMParser},Hs=function(a){this.f=a},Is=function(a){return String(Math.floor(a/
10
- 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")},Js=function(){},Ks=function(a){this.f=new Gs(a);this.a=new _.G("clpp.ttml.Mp4TtmlParser")},Ls=function(){this.a=new Js};Br.prototype.ba=function(){return this.g};Br.prototype.getAttribute=function(a){return this.a[a]};_.v(Cr,Br);_.v(Dr,Br);var Fr=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Gr=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Ir=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Qr=/^(\d*(?:\.\d*)?)f$/,Yr=/^(\d*(?:\.\d*)?)t$/,Zr=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,js=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,ks=/^(\d+)px (\d+)px$/,qs=/^(\d+) (\d+)$/,cs=/(\d+)px/,Ms=/^(\d+px|\d+em|\d*\.?\d+c)$/,us=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
11
- "color",tr,"opacity","padding","zIndex",yr,vr,Ar,ur,zr,"textOutline"],Es=["begin",_.Xc];_.v(es,Dr);
12
- es.prototype.build=function(a,b,c,d,e,f,g){var k=$r(this.a.begin,b);b=$r(this.a.end,b);if(null===k||null===b)return null;k+=c;b+=c;c=_.Km(_.Oc);for(var l=_.u(this.h),m=l.next();!m.done;m=l.next())c.appendChild(gs(g.get(m.value),e,g));g=new _.sg(k,b,c.innerHTML,_.ye);g.cssClassList=_.df(this.f).concat();g.textAlign=fs(this,e,null);g.writingMode=_.og;g.line=-1;g.lineInterpretation=_.pg;g.lineAlign=_.qg;g.containerRows=os(null,rs(a),15);if(this.m&&(f=f.get(this.m))){g.region=f.build(a,e);g.textAlign=
13
- fs(this,e,f);a:switch(Er(f,e,Ar)){case "tb":case "tblr":a=_.Ge;break a;case "tbrl":a=_.He;break a;default:a=_.og}g.writingMode=a;a:switch(Er(f,e,vr)){case _.sc:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Er(f,e,vr)){case _.sc:a=1;break a;default:a=_.pg}g.lineInterpretation=a;a:switch(Er(f,e,vr)){case _.sc:e=_.sc;break a;default:e=_.qg}g.lineAlign=e}this.j&&(a=d.get(this.j))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.h.trim(),
14
- g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.v(is,Dr);
15
- is.prototype.build=function(a,b){var c=new _.vg;c.id=this.ba();var d=os(a.h.containerWidth,ps(a,1),720),e=os(a.h.containerHeight,ps(a,2),480);a:switch(Er(this,b,vr)){case "after":var f="flex-start";break a;case _.sc:f=_.sc;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Er(this,b,Ar)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Ec}c.writingMode=f;f=this.getAttribute("extent")||Er(this,b,"extent");c.width=ls(f,d,1,100);c.widthUnits=ms(f,d);c.height=
16
- ls(f,e,2,100);c.heightUnits=ms(f,e);f=this.getAttribute("origin")||Er(this,b,"origin");c.viewportAnchorX=ls(f,d,1,0);c.viewportAnchorY=ls(f,e,2,0);c.viewportAnchorUnits=ms(f,d);c.cssClassList=_.df(this.f).concat();return c};_.v(ns,Br);_.v(ss,Br);
17
- ss.prototype.build=function(a){var b=null;var c=rs(a);c&&(b=os(a.h.containerHeight,ps(a,2),480)/c);b=os(a.h.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(Ns.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+":"+bs(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(),k=d[1]&&d[1].trim(),l=d[2]&&d[2].trim();3===d.length&&!Ms.test(g)&&Ms.test(k)&&Ms.test(l)?(e=g,f=k):2===d.length&&!Ms.test(g)&&Ms.test(k)?(e=g,f=k):2===d.length&&Ms.test(g)&&Ms.test(k)&&(f=g);if(""!==f){f=bs(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",xr).replace("proportionalSerif",xr).replace("sansSerif",xr).replace("default",xr)+";":"");a:{if(zr 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
- bs(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=bs(e),e=ds(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=bs(d);d=ds(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 Ns=new Map([["color","color"],[tr,"background-color"],[ur,ur],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var xs=0;As.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Os.has(as(a.nodeName))||Ps.has(as(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&&!Os.has(as(a.nodeName))));var b=this.a;this.a=a;return b};var Os=new Set(["tt","head","layout",_.rd,_.dd,wr,"styling",_.oe,"body",_.Oc,"p","span","br"]),Ps=new Set([_.oe,_.dd]);Bs.prototype.ba=function(){return this.a.id};Gs.prototype.parseInit=function(){};
22
- Gs.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.J.Ha(this.a.ttml||{}),e=_.R(a,0,c[0]);e=_.Tg(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.ve)}catch(n){throw new _.K(_.M,2,2005,"Failed to parse TTML.");}d=new ts(d);e=new Ds;f=new As(f);b=b.periodStart;typeof b===_.h&&(d.w=b);b=c[0];for(var g=1;g<c.length;++g){var k=c[g],l=_.R(a,b,k);l=_.jj(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Cr(m,l,{imageType:"PNG",encoding:"Base64"}));
23
- b+=k}for(;f.a;)a=f.next(),a=Fs(e,a),"tt"===Cs(a)&&(d.j=new ns(d.A,Object.assign({},a.a))),"tt"===Cs(a)&&(d.o=new hs(a.a.frameRate,a.a.subFrameRate,a.a.frameRateMultiplier,a.a.tickRate)),Cs(a)!==_.dd||a.a.begin||a.a.end||(c="#"+a.ba(),d.g.set(c,new Cr(c,a.h.textContent,a.a))),Cs(a)===_.dd&&a.a.begin&&a.a.end?(c="#"+ys(),b=new Cr(c,a.h.textContent,a.a),d.g.set(c,b),c=b):c=null,c&&(a.j=c.ba()),Cs(a)===_.oe&&(c=a.ba()||ys(),b=new ss(c,a.g,Object.assign({},a.a)),d.a.set(c,b),a.f&&d.h.get(a.f).f.push(c)),
24
- Cs(a)!==_.oe&&vs(a)?(c=ys(),b=new ss(c,[],Object.assign({},a.a)),d.a.set(c,b),c=b):c=null,c&&a.g.push(c.ba()),Cs(a)!==_.Oc||!a.a.extent&&!a.a.origin?c=null:(c=ys(),b=new is(c,ws(d,a.g),Object.assign({},a.a)),d.h.set(c,b),c=b),c&&(a.f=c.ba()),Cs(a)!==wr?c=null:(c=a.ba(),b=new is(c,ws(d,a.g),Object.assign({},a.a)),d.h.set(c,b),c=b),c&&(a.f=c.ba()),c=a.m,-1===["#text","span","br"].indexOf(Cs(a))||0===c.length?c=null:(c=c[c.length-1],d.f.has(c)?(b=ys(),g=new es(b,"#text"===a.h.nodeName?a.h.textContent:
25
- null,"br"===Cs(a),a.f,a.j,ws(d,a.g),a.a),d.f.set(b,g),d.f.get(c).h.push(b),c=g):c=null),c&&a.m.push(c.ba()),"p"===Cs(a)||a.j?(c=ys(),b=new es(c,null,!1,a.f,a.j,ws(d,a.g),a.a),d.f.set(c,b),d.m.push(b),c=b):c=null,c&&a.m.push(c.ba());e=zs(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,_.df(c.value.build(d.j)));return{cues:e,styles:f}};Hs.prototype.a=function(a){a=(new Gs(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=Is(c.startTime)+" --\x3e "+Is(c.endTime),e=[];switch(c.textAlign){case _.gd:e.push("align:left");break;case _.ae:e.push("align:right");break;case _.ng:e.push("align:middle");break;case _.gd:e.push("align:start");break;case _.ae:e.push("align:end")}switch(c.writingMode){case _.Ge:e.push("vertical:lr");break;
26
- case _.He:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.Xg(b)};Js.prototype.probe=function(a,b){return a===_.Xb&&b===_.ue};Js.prototype.create=function(a){return new Hs(a)};Ks.prototype.parseInit=function(a){var b=!1;(new _.Pj).M(_.vd,_.Qj).M(_.xe,_.Qj).M(_.pd,_.Qj).M(_.td,_.Qj).M(_.le,_.Qj).V(_.ne,_.Rj).M("stpp",function(c){b=!0;c.Ua.stop()}).parse(a);if(!b)throw new _.K(_.M,2,2007);};
27
- Ks.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Pj).M("moof",_.Qj).M("traf",_.Qj).V("subs",function(k){for(var l=_.Kj(k.F),m=0;m<l;++m){k.F.skip(4);for(var n=_.Jj(k.F),p=0;p<n;++p){var q=1===k.version?_.Kj(k.F):_.Jj(k.F);g.push(q);k.F.skip(6)}}}).M(_.od,_.Sj(function(k){d=!0;k=c.f.parseMedia(k,b,g);e=e.concat(k.cues);f=f.concat(k.styles)})).parse(a);d||this.a.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.v(Ls,_.Kn);Ls.prototype.Da=function(){_.ep[_.Xb]=Gs;_.ep[_.Vb]=Ks;_.ep[qr]=Ks;_.ep[sr]=Ks;_.ep[rr]=Ks;_.rh.push(this.a)};Ls.prototype.va=function(){_.fp(_.Xb);_.fp(_.Vb);_.fp(qr);_.fp(sr);_.fp(rr);_.th(this.a)};Ls.prototype.id=function(){return _.re};_.B("clpp.ttml.TtmlComponent",Ls);};
2
+ var f=function(window){var os='application/mp4; codecs\x3d"stpp.ttml"',ps='application/mp4; codecs\x3d"stpp.ttml.im1i"',qs='application/mp4; codecs\x3d"stpp.ttml.im1t"',rs="backgroundColor",ss="direction",ts="displayAlign",us="region",vs="sans-serif",ws="textAlign",xs="textDecoration",ys="writingMode",zs=function(a,b,c){this.g=a;this.f=b;this.a=c},As=function(a,b,c){zs.call(this,a,[],c);this.h=b||""},Bs=function(a,b,c){zs.call(this,a,b,c)},Cs=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},Ks=function(a,b){var c=null;if(Ds.test(a)){c=Ds.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 Es.test(a)?c=Fs(Es,a):Gs.test(a)?c=Fs(Gs,a):Hs.test(a)?(c=Hs.exec(a),c=Number(c[1])/b.frameRate):Is.test(a)?(c=Is.exec(a),c=Number(c[1])/b.a):Js.test(a)&&(c=Fs(Js,a));return c},Fs=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)},Ls=function(a){return a.split(":").pop()},Ms=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Os=function(a,b){for(;Ns.test(a);){var c=Ns.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Ps=function(a,b,c,d,e,f,g){zs.call(this,a,f,g);this.o=b;this.w=c;this.m=d;this.j=e;this.h=[]},Qs=function(a,b,c){a=Cs(a,b,ws);if(!a&&c&&(a=Cs(c,b,ws),!a&&"rltb"===Cs(c,b,ys)))return _.he;switch(a){case _.Ac:return _.sg;case _.he:case _.dd:return _.he;default:return _.od}},
5
+ Rs=function(a,b,c){if(_.xh(a.o))return document.createTextNode(_.Bh(a.o||""));if(a.w)return _.xn("br");for(var d=_.xn("span"),e=_.u(a.f),f=e.next();!f.done;f=e.next())_.yn(d,f.value);a=_.u(a.h);for(e=a.next();!e.done;e=a.next())d.appendChild(Rs(c.get(e.value),b,c));return d},Ss=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]))},Ts=function(a,
6
+ b,c){zs.call(this,a,b,c)},Ws=function(a,b,c,d){var e=Us.exec(a);a=Vs.exec(a);return typeof b===_.k&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},Xs=function(a,b){return typeof b===_.k&&0<b?_.yg:Vs.test(a)?0:_.yg},Ys=function(a,b){zs.call(this,"root-container",[],b);this.h=a},Zs=function(a,b,c){return typeof a===_.k?a:typeof b===_.k?b:c},$s=function(a,b){var c=a.getAttribute("extent");return(c=Vs.exec(c))?Number(c[b]):null},bt=function(a){a=a.getAttribute("cellResolution");return(a=at.exec(a))?
7
+ Number(a[2]):null},ct=function(a,b,c){zs.call(this,a,b,c)},dt=function(a){this.A=a;this.o=this.j=null;this.w=0;this.g=new Map;this.a=new Map;this.h=new Map;this.f=new Map;this.m=[]},ft=function(a){return et.some(function(b){return b in a.attributes})},gt=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,_.kf(gt(a,a.a.get(e).f)).concat([e]));return c},it=function(){return"inline-"+ht++},jt=function(a){return a.m.map(function(b){return b.build(a.j,
8
+ a.o,a.w,a.g,a.a,a.h,a.f)}).filter(function(b){return null!=b})},kt=function(a){this.a=a.firstChild;this.f=new Set},lt=function(a,b,c,d,e,f){this.g=a;this.a=b;this.h=c;this.j=d;this.f=e;this.attributes=f},mt=function(a){return Ls(a.g.nodeName)},nt=function(){this.a=new Map},pt=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=_.kf(l.j).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.a,d=l.h,f=_.kf(l.f).concat(),
9
+ g={},ot.forEach(function(n){n in l.attributes&&(g[n]=l.attributes[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(us)&&(c=b.getAttribute(us));b.hasAttribute(_.ve)&&f.push.apply(f,_.kf(b.getAttribute(_.ve).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=Ls(h);g[m]=b.getAttribute(h)}d=g.backgroundImage}c=new lt(b,c,d,e,f,g);a.a.set(b,c);return c},qt=function(a){this.a=a;this.f=new DOMParser},rt=function(a){this.f=
10
+ a},st=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")},tt=function(){},ut=function(a){this.f=new qt(a);this.a=new _.H("clpp.ttml.Mp4TtmlParser")},vt=function(){this.a=new tt};zs.prototype.getId=function(){return this.g};zs.prototype.getAttribute=function(a){return this.a[a]};_.v(As,zs);_.v(Bs,zs);var Ds=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Es=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Gs=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Hs=/^(\d*(?:\.\d*)?)f$/,Is=/^(\d*(?:\.\d*)?)t$/,Js=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,Us=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,Vs=/^(\d+)px (\d+)px$/,at=/^(\d+) (\d+)$/,Ns=/(\d+)px/,wt=/^(\d+px|\d+em|\d*\.?\d+c)$/,et=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
11
+ "color",rs,"opacity","padding","zIndex",ws,ts,ys,ss,xs,"textOutline"],ot=["begin",_.dd];_.v(Ps,Bs);
12
+ Ps.prototype.build=function(a,b,c,d,e,f,g){var h=Ks(this.a.begin,b);b=Ks(this.a.end,b);if(null===h||null===b)return null;h+=c;b+=c;c=_.xn(_.Vc);for(var l=_.u(this.h),m=l.next();!m.done;m=l.next())c.appendChild(Rs(g.get(m.value),e,g));g=new _.xg(h,b,c.innerHTML.trim(),_.Fe);g.cssClassList=_.kf(this.f).concat();g.textAlign=Qs(this,e,null);g.writingMode=_.tg;g.line=-1;g.lineInterpretation=_.ug;g.lineAlign=_.vg;g.containerRows=Zs(null,bt(a),15);if(this.m&&(f=f.get(this.m))){g.region=f.build(a,e);g.textAlign=
13
+ Qs(this,e,f);a:switch(Cs(f,e,ys)){case "tb":case "tblr":a=_.Ne;break a;case "tbrl":a=_.Oe;break a;default:a=_.tg}g.writingMode=a;a:switch(Cs(f,e,ts)){case _.Ac:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Cs(f,e,ts)){case _.Ac:a=1;break a;default:a=_.ug}g.lineInterpretation=a;a:switch(Cs(f,e,ts)){case _.Ac:e=_.Ac;break a;default:e=_.vg}g.lineAlign=e}this.j&&(a=d.get(this.j))&&(d=a.getAttribute("encoding"),e=a.getAttribute("imageType")||a.getAttribute("imagetype"),a=a.h.trim(),
14
+ g.backgroundImage=("PNG"===e&&"Base64"===d&&0<a.length?"data:image/png;base64,"+a:null)||"");return g};_.v(Ts,Bs);
15
+ Ts.prototype.build=function(a,b){var c=new _.Ag;c.id=this.getId();var d=Zs(a.h.containerWidth,$s(a,1),720),e=Zs(a.h.containerHeight,$s(a,2),480);a:switch(Cs(this,b,ts)){case "after":var f="flex-start";break a;case _.Ac:f=_.Ac;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Cs(this,b,ys)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Lc}c.writingMode=f;f=this.getAttribute("extent")||Cs(this,b,"extent");c.width=Ws(f,d,1,100);c.widthUnits=Xs(f,d);c.height=
16
+ Ws(f,e,2,100);c.heightUnits=Xs(f,e);f=this.getAttribute("origin")||Cs(this,b,"origin");c.viewportAnchorX=Ws(f,d,1,0);c.viewportAnchorY=Ws(f,e,2,0);c.viewportAnchorUnits=Xs(f,d);c.cssClassList=_.kf(this.f).concat();return c};_.v(Ys,zs);_.v(ct,zs);
17
+ ct.prototype.build=function(a){var b=null;var c=bt(a);c&&(b=Zs(a.h.containerHeight,$s(a,2),480)/c);b=Zs(a.h.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.u(xt.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+":"+Ms(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&&!wt.test(g)&&wt.test(h)&&wt.test(l)?(e=g,f=h):2===d.length&&!wt.test(g)&&wt.test(h)?(e=g,f=h):2===d.length&&wt.test(g)&&wt.test(h)&&(f=g);if(""!==f){f=Ms(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",vs).replace("proportionalSerif",vs).replace("sansSerif",vs).replace("default",vs)+";":"");a:{if(xs 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
+ Ms(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Ms(e),e=Os(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=Ms(d);d=Os(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 xt=new Map([["color","color"],[rs,"background-color"],[ss,ss],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var ht=0;kt.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!yt.has(Ls(a.nodeName))||zt.has(Ls(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&&!yt.has(Ls(a.nodeName))));var b=this.a;this.a=a;return b};var yt=new Set(["tt","head","layout",_.zd,_.kd,us,"styling",_.ve,"body",_.Vc,"p","span","br"]),zt=new Set([_.ve,_.kd]);lt.prototype.getId=function(){return this.attributes.id};qt.prototype.parseInit=function(){};
22
+ qt.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.J.Ma(this.a.ttml||{}),e=_.N(a,0,c[0]);e=_.oh(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.Ce)}catch(n){throw new _.L(_.M,2,2005,"Failed to parse TTML.");}d=new dt(d);e=new nt;f=new kt(f);b=b.periodStart;typeof b===_.k&&(d.w=b);b=c[0];for(var g=1;g<c.length;++g){var h=c[g],l=_.N(a,b,h);l=_.ak(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new As(m,l,{imageType:"PNG",encoding:"Base64"}));
23
+ b+=h}for(;f.a;)a=f.next(),a=pt(e,a),"tt"===mt(a)&&(d.j=new Ys(d.A,Object.assign({},a.attributes))),"tt"===mt(a)&&(d.o=new Ss(a.attributes.frameRate,a.attributes.subFrameRate,a.attributes.frameRateMultiplier,a.attributes.tickRate)),mt(a)!==_.kd||a.attributes.begin||a.attributes.end||(c="#"+a.getId(),d.g.set(c,new As(c,a.g.textContent,a.attributes))),mt(a)===_.kd&&a.attributes.begin&&a.attributes.end?(c="#"+it(),b=new As(c,a.g.textContent,a.attributes),d.g.set(c,b),c=b):c=null,c&&(a.h=c.getId()),mt(a)===
24
+ _.ve&&(c=a.getId()||it(),b=new ct(c,a.f,Object.assign({},a.attributes)),d.a.set(c,b),a.a&&d.h.get(a.a).f.push(c)),mt(a)!==_.ve&&ft(a)?(c=it(),b=new ct(c,[],Object.assign({},a.attributes)),d.a.set(c,b),c=b):c=null,c&&a.f.push(c.getId()),mt(a)!==_.Vc||!a.attributes.extent&&!a.attributes.origin?c=null:(c=it(),b=new Ts(c,gt(d,a.f),Object.assign({},a.attributes)),d.h.set(c,b),c=b),c&&(a.a=c.getId()),mt(a)!==us?c=null:(c=a.getId(),b=new Ts(c,gt(d,a.f),Object.assign({},a.attributes)),d.h.set(c,b),c=b),c&&
25
+ (a.a=c.getId()),c=a.j,-1===["#text","span","br"].indexOf(mt(a))||0===c.length?c=null:(g=c[c.length-1],d.f.has(g)?(c=it(),b=new Ps(c,"#text"===a.g.nodeName?a.g.textContent:null,"br"===mt(a),a.a,a.h,gt(d,a.f),a.attributes),d.f.set(c,b),(g=d.f.get(g))&&g.h.push(c),c=b):c=null),c&&a.j.push(c.getId()),"p"===mt(a)||a.h?(c=it(),b=new Ps(c,null,!1,a.a,a.h,gt(d,a.f),a.attributes),d.f.set(c,b),d.m.push(b),c=b):c=null,c&&a.j.push(c.getId());e=jt(d);f=[];a=_.u(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,
26
+ _.kf(c.value.build(d.j)));return{cues:e,styles:f}};rt.prototype.a=function(a){a=(new qt(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=st(c.startTime)+" --\x3e "+st(c.endTime),e=[];switch(c.textAlign){case _.od:e.push("align:left");break;case _.he:e.push("align:right");break;case _.sg:e.push("align:middle");break;case _.od:e.push("align:start");break;case _.he:e.push("align:end")}switch(c.writingMode){case _.Ne:e.push("vertical:lr");break;
27
+ case _.Oe:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.sh(b)};tt.prototype.probe=function(a,b){return a===_.fc&&b===_.Be};tt.prototype.create=function(a){return new rt(a)};ut.prototype.parseInit=function(a){var b=!1;(new _.Fk).M(_.Cd,_.Gk).M(_.Ee,_.Gk).M(_.xd,_.Gk).M(_.Bd,_.Gk).M(_.se,_.Gk).V(_.ue,_.Hk).M("stpp",function(c){b=!0;c.Wa.stop()}).parse(a);if(!b)throw new _.L(_.M,2,2007);};
28
+ ut.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.Fk).M("moof",_.Gk).M("traf",_.Gk).V("subs",function(h){for(var l=_.U(h.F),m=0;m<l;++m){h.F.skip(4);for(var n=_.Ak(h.F),p=0;p<n;++p){var q=1===h.version?_.U(h.F):_.Ak(h.F);g.push(q);h.F.skip(6)}}}).M(_.wd,_.Ik(function(h){d=!0;h=c.f.parseMedia(h,b,g);e=e.concat(h.cues);f=f.concat(h.styles)})).parse(a);d||this.a.warn("Couldn't find the mdat box");return{cues:e,styles:f}};_.v(vt,_.zo);vt.prototype.Ja=function(){_.Rp[_.fc]=qt;_.Rp[_.dc]=ut;_.Rp[os]=ut;_.Rp[qs]=ut;_.Rp[ps]=ut;_.Ci.push(this.a)};vt.prototype.Ca=function(){_.Sp(_.fc);_.Sp(_.dc);_.Sp(os);_.Sp(qs);_.Sp(ps);_.Ei(this.a)};vt.prototype.id=function(){return _.ye};_.B("clpp.ttml.TtmlComponent",vt);};
28
29
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
29
30
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
30
31
  else{_=this.clpp._;(f.call(g,this));}
@@ -1,9 +1,9 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var er="VerimatrixVCAS",fr="clpp.verimatrix.Vcas",gr="clpp.verimatrix.VcasComponent",mr=function(a){_.Aj.call(this,er);var b={};b[hr]=hr;b[ir]=ir;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?jr:a.licenseRequestVuidLocation;b=void 0===a.httpHeaderNames?b:a.httpHeaderNames;var e=a.widevineLicenseUrl,f=a.playReadyLicenseUrl,g=a.fairPlayLicenseUrl,k=a.fairPlayCertificateUrl,l=a.fairPlaySiteId,m=void 0===a.fairPlayAssetIdStrategy?kr:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
- this.C=d;this.B=b;this.w=lr(this,e);this.o=lr(this,f);this.m=lr(this,g);this.j=k;this.G=l;this.D=m;this.f=new _.G(fr);_.ch(this.w)?this.f.warn(_.ub):this.Ea(_.Ic,{licenseUrl:this.w,videoRobustness:[_.hb,void 0],audioRobustness:[_.gb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.ch(this.o)?this.f.warn(_.Ya):this.Ea(_.Hc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
- _.ch(this.m)?this.f.warn(_.Da):_.ch(this.j)?this.f.warn(_.Ca):this.Ea(_.Gc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},lr=function(a,b){if(a.C===jr){var c=Object.assign({},{deviceId:_.kj(_.Zg(a.A))},a.a&&{authenticator:_.kj(_.Zg(a.a))});return b+_.Yj(c)}return b},nr=function(){this.l=null;this.a=new _.G(gr)};_.v(mr,_.Aj);
5
- mr.prototype.h=function(a,b){if(this.C===or){var c=this.B[ir],d={};d[this.B[hr]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};mr.prototype.I=function(a,b){var c=_.ck(b);switch(this.D){case pr:c=_.Yj({r:c,ak:this.G},!0)}return c};mr.prototype.K=function(a,b){this.h(a,b);_.fk(b)};mr.prototype.L=function(a,b){_.gk(b)};_.B(fr,mr);mr.prototype.constructor=mr.prototype.constructor;mr.NAME=er;var jr="query-string",or="http-header";
6
- mr.LicenseRequestVuidLocation={QUERY_STRING:jr,HTTP_HEADER:or};var hr="DeviceId",ir="Authenticator";mr.LicenseRequestHttpHeader={DEVICE_ID_HEADER:hr,AUTHENTICATOR_HEADER:ir};var kr="keyid",pr="contentid-siteid";mr.FairPlayAssetIdStrategy={KEYID:kr,CONTENTID_SITEID:pr};_.v(nr,_.Kn);_.t=nr.prototype;_.t.Da=function(a){this.l=a};_.t.va=function(){this.l=null};_.t.Ub=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===er){a=a.drm.customData;if(!a)throw new _.K(_.M,7,7100,_.Jc);a=new mr(a);this.a.info("Registering the Verimatrix VCAS Ultra environment");_.vj(a)}};_.t.release=function(){};_.t.id=function(){return"verimatrix-vcas"};_.B(gr,nr);};
2
+ var f=function(window){var Qr="VerimatrixVCAS",Rr="clpp.verimatrix.Vcas",Sr="clpp.verimatrix.VcasComponent",ds=function(a){_.rk.call(this,Qr);var b={};b[Tr]=Tr;b[Ur]=Ur;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?Vr: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?Wr:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.C=d;this.B=b;this.w=Xr(this,e);this.o=Xr(this,f);this.m=Xr(this,g);this.j=h;this.G=l;this.D=m;this.f=new _.H(Rr);_.yh(this.w)?this.f.warn(_.Cb):this.Ka(_.Pc,{licenseUrl:this.w,videoRobustness:[_.nb,void 0],audioRobustness:[_.mb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.yh(this.o)?this.f.warn(_.db):this.Ka(_.Oc,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
+ _.yh(this.m)?this.f.warn(_.Ja):_.yh(this.j)?this.f.warn(_.Ia):this.Ka(_.Nc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.L.bind(this),extractContentId:this.I.bind(this)}})},Xr=function(a,b){if(a.C===Vr){var c=Object.assign({},{deviceId:_.bk(_.uh(a.A))},a.a&&{authenticator:_.bk(_.uh(a.a))});return b+_.oi(c)}return b},ls=function(){this.l=null;this.a=new _.H(Sr)};_.v(ds,_.rk);
5
+ ds.prototype.h=function(a,b){if(this.C===ms){var c=this.B[Ur],d={};d[this.B[Tr]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};ds.prototype.I=function(a,b){var c=_.Ok(b);switch(this.D){case ns:c=_.oi({r:c,uk:this.G},!0)}return c};ds.prototype.K=function(a,b){this.h(a,b);_.Rk(b)};ds.prototype.L=function(a,b){_.Sk(b)};_.B(Rr,ds);ds.prototype.constructor=ds.prototype.constructor;ds.NAME=Qr;var Vr="query-string",ms="http-header";
6
+ ds.LicenseRequestVuidLocation={QUERY_STRING:Vr,HTTP_HEADER:ms};var Tr="DeviceId",Ur="Authenticator";ds.LicenseRequestHttpHeader={DEVICE_ID_HEADER:Tr,AUTHENTICATOR_HEADER:Ur};var Wr="keyid",ns="contentid-siteid";ds.FairPlayAssetIdStrategy={KEYID:Wr,CONTENTID_SITEID:ns};_.v(ls,_.zo);_.t=ls.prototype;_.t.Ja=function(a){this.l=a};_.t.Ca=function(){this.l=null};_.t.Wb=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===Qr){a=a.drm.customData;if(!a)throw new _.L(_.M,7,7100,_.Qc);a=new ds(a);this.a.info("Registering the Verimatrix VCAS Ultra environment");_.mk(a)}};_.t.release=function(){};_.t.id=function(){return"verimatrix-vcas"};_.B(Sr,ls);};
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 Vq="Registering listeners",Wq="clpp.vimond.VimondPlugin",Xq=function(a,b,c,d,e){this.D=a;this.G=b;this.I=c;this.l=d;this.C=e;this.f=new _.Wf;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.qh(this.vf.bind(this));this.a=new _.G("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(Vq),this.f.on(this.l,_.ie,this.Eh.bind(this)),this.f.on(this.l,_.we,this.Fh.bind(this)),this.f.on(this.l,_.wb,this.Ch.bind(this)),this.f.on(this.l,_.xb,this.Dh.bind(this)))},Yq=function(a,
3
- b){a.l.trigger(new _.I(_.Ne,{detail:b}))},Zq=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.K(b?_.M:1,9,9201,c))},$q=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.G("clpp.vimond.VimondService");this.f=0},ar=function(a){this.l=a;this.a=new _.Wf;this.g=new _.G("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(Vq),this.a.on(this.l,_.Xd,this.Si.bind(this)),this.a.on(this.l,_.wb,this.Ah.bind(this)),this.a.on(this.l,_.xb,this.Bh.bind(this)))},
4
- br=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Qd];if(a.h)return[_.Xc,_.Ld];if(c===_.dm)return[_.Xc,null];if(c===_.hm)return[_.Zc,_.Ld];var d=_.Ld;if(c===_.bm||c===_.km||a.f)d=_.Qd;return["period",d]},cr=function(){this.a=!1;this.h=new _.G(Wq);this.j=this.g=this.f=null},dr=function(){};_.t=Xq.prototype;_.t.Fh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.t.Ch=function(){this.a.debug("Ad break started");this.j=!0};
5
- _.t.Dh=function(){this.a.debug("Ad break stopped");this.j=!1};
6
- _.t.Eh=function(a){var b=this,c,d,e,f,g;return _.A(function(k){if(1==k.a){c=a.detail;d=_.fm;e=c.currentState;f=c.previousState;b.a.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return k["return"]();if(e===b.B&&!b.g)return b.a.debug("Ignore transition"),k["return"]();if(b.m&&e!==d.PLAYING)return k["return"]();if(b.g&&[d.PAUSED,d.BUFFERING].includes(e))return b.a.debug("Seeking"),k["return"]();b.g&&e===d.PLAYING&&(b.a.debug("Seeked"),b.g=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return k.H(0);
7
- b.B=e;return _.w(k,b.vf(),3)}e===d.ENDED&&b.h.stop();_.z(k)})};
8
- _.t.vf=function(){var a=this,b,c,d,e,f,g;return _.A(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.a.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.$(a.m?10:a.D);a.m=!1;_.rf(k,2);l=a.C;l.f++;var m=_.J.Ta(l.m);m.client.buildName=_.oa;m.client.buildVersion=_.ea;var n=m.client,p=l.a.l.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.l.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
9
- l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.Wj(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=br(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!==_.jc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.ih(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Zg(JSON.stringify(m));l=l.j.fetch(n).O;return _.w(k,l,4)}if(2!=k.a)return b=k.f,Yq(a,b),_.sf(k,0);d=c=_.tf(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),Yq(a,f),Zq(a,a.G,f)):1001===e?(a.a.debug("Generic service error"),
11
- Yq(a,f),Zq(a,a.I,f)):a.a.error(c.toString());_.z(k)})};_.t.dispose=function(){this.a.debug(_.qb);_.ag(this.f);this.h.stop()};$q.prototype.Ve=function(a){this.g=a};_.t=ar.prototype;_.t.getPosition=function(){return Math.floor(this.l.getPosition())};_.t.Si=function(){this.h=!0};_.t.Ah=function(){this.f=!0};_.t.Bh=function(){this.f=!1};_.t.dispose=function(){this.g.debug(_.qb);_.ag(this.a)};_.v(cr,_.rp);_.t=cr.prototype;_.t.onPlayerCreated=function(){};
12
- _.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.J.R(b.vimond)&&typeof b.vimond===_.Bd)?a.namespace()===_.yc&&(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 _.K(1,9,9200));return}this.h.debug("Configuration is valid");
13
- c=b.failIfUnreachable;typeof c!==_.jc&&(c=!0);d=b.failOnError;typeof d!==_.jc&&(d=!0);this.f=new ar(a);this.g=new $q(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Xq(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.Ve=function(a){this.a&&this.g&&this.g.Ve(a)};_.B(Wq,cr);cr.prototype.updateAuthToken=cr.prototype.Ve;cr.Id="vimond";dr.prototype.create=function(){return new cr};_.Fn(new dr);};
2
+ var f=function(window){var Gr="Registering listeners",Hr="clpp.vimond.VimondPlugin",Ir=function(a,b,c,d,e){this.D=a;this.G=b;this.I=c;this.l=d;this.C=e;this.f=new _.cg;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.Li(this.Df.bind(this));this.a=new _.H("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(Gr),this.f.on(this.l,_.pe,this.Ph.bind(this)),this.f.on(this.l,_.De,this.Qh.bind(this)),this.f.on(this.l,_.Fb,this.Nh.bind(this)),this.f.on(this.l,_.Gb,this.Oh.bind(this)))},Jr=function(a,
3
+ b){a.l.trigger(new _.I(_.Ue,{detail:b}))},Kr=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.L(b?_.M:1,9,9201,c))},Lr=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.H("clpp.vimond.VimondService");this.f=0},Mr=function(a){this.l=a;this.a=new _.cg;this.g=new _.H("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(Gr),this.a.on(this.l,_.de,this.jj.bind(this)),this.a.on(this.l,_.Fb,this.Lh.bind(this)),this.a.on(this.l,_.Gb,this.Mh.bind(this)))},
4
+ Nr=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Xd];if(a.h)return[_.dd,_.Sd];if(c===_.Vm)return[_.dd,null];if(c===_.Zm)return[_.fd,_.Sd];var d=_.Sd;if(c===_.Tm||c===_.bn||a.f)d=_.Xd;return["period",d]},Or=function(){this.a=!1;this.h=new _.H(Hr);this.j=this.g=this.f=null},Pr=function(){};_.t=Ir.prototype;_.t.Qh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.t.Nh=function(){this.a.debug("Ad break started");this.j=!0};
5
+ _.t.Oh=function(){this.a.debug("Ad break stopped");this.j=!1};
6
+ _.t.Ph=function(a){var b=this,c,d,e,f,g;return _.A(function(h){if(1==h.a){c=a.detail;d=_.Xm;e=c.currentState;f=c.previousState;b.a.debug("State changed, prev: "+f+" curr: "+e);if(b.A||b.j)return h["return"]();if(e===b.B&&!b.g)return b.a.debug("Ignore transition"),h["return"]();if(b.m&&e!==d.PLAYING)return h["return"]();if(b.g&&[d.PAUSED,d.BUFFERING].includes(e))return b.a.debug("Seeking"),h["return"]();b.g&&e===d.PLAYING&&(b.a.debug("Seeked"),b.g=!1);g=[d.PLAYING,d.PAUSED,d.ERROR,d.ENDED];if(!g.includes(e))return h.H(0);
7
+ b.B=e;return _.y(h,b.Df(),3)}e===d.ENDED&&b.h.stop();_.z(h)})};
8
+ _.t.Df=function(){var a=this,b,c,d,e,f,g;return _.A(function(h){if(1==h.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.a.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.Z(a.m?10:a.D);a.m=!1;_.xf(h,2);l=a.C;l.f++;var m=_.J.Va(l.m);m.client.buildName=_.ta;m.client.buildVersion=_.ia;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 _.mi(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=Nr(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!==_.rc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.Hh(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.uh(JSON.stringify(m));l=l.j.fetch(n).P;return _.y(h,l,4)}if(2!=h.a)return b=h.f,Jr(a,b),_.yf(h,0);d=c=_.zf(h);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),Jr(a,f),Kr(a,a.G,f)):1001===e?(a.a.debug("Generic service error"),
11
+ Jr(a,f),Kr(a,a.I,f)):a.a.error(c.toString());_.z(h)})};_.t.dispose=function(){this.a.debug(_.yb);_.fg(this.f);this.h.stop()};Lr.prototype.df=function(a){this.g=a};_.t=Mr.prototype;_.t.getPosition=function(){return Math.floor(this.l.getPosition())};_.t.jj=function(){this.h=!0};_.t.Lh=function(){this.f=!0};_.t.Mh=function(){this.f=!1};_.t.dispose=function(){this.g.debug(_.yb);_.fg(this.a)};_.v(Or,_.cq);_.t=Or.prototype;_.t.onPlayerCreated=function(){};
12
+ _.t.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.J.R(b.vimond)&&typeof b.vimond===_.Id)?a.namespace()===_.Fc&&(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!==_.rc&&(c=!0);d=b.failOnError;typeof d!==_.rc&&(d=!0);this.f=new Mr(a);this.g=new Lr(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new Ir(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.df=function(a){this.a&&this.g&&this.g.df(a)};_.B(Hr,Or);Or.prototype.updateAuthToken=Or.prototype.df;Or.Id="vimond";Pr.prototype.create=function(){return new Or};_.uo(new Pr);};
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,23 +1,23 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Aq="touchmove",Bq="touchstart",Cq=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},Dq=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)},Eq=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new Cq(a/d*e,b/d*e,0/d*e,Math.cos(c))},Fq=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},Gq=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
- b):(a.x=0,a.y=0,a.a=0)},Hq=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},Iq=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},Jq=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},Kq=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},Lq=function(a){var b=new Fq(0,0,0),c=new Fq(0,0,1),d=new Fq,e=new Fq,f=new Fq;a=a.a;var g=new Fq(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();Gq(f,1/g);c=Iq(d,c,f);g=c.length();Gq(c,1/g);Iq(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-Hq(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-Hq(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-Hq(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},Nq=function(a){this.a=a;this.f=a.createProgram();this.j=
5
- Mq(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.h=Mq(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.j);a.attachShader(this.f,this.h);a.bindAttribLocation(this.f,
6
- 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.K(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)},Mq=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 _.K(1,
7
- 9,9004,"Unable to compile GL shader: "+a.a.getShaderInfoLog(b));return b},Oq=function(a){this.a=a;var b=[],c,d;for(d=0;70>=d;d++){var e=3>=d?d/4/64:67<=d?(63+(d-66)/4)/64:(d-3)/64;var f=(e-.5)*Math.PI,g=Math.cos(f);for(c=0;128>=c;c++){var k=c/128,l=(.5+k)*Math.PI*2;128===c?(b.push(b[645*d]),b.push(b[645*d+1]),b.push(b[645*d+2])):(b.push(100*Math.cos(l)*g),b.push(100*Math.sin(l)*g),b.push(100*Math.sin(f)));0===d||70===d?b.push(.5):b.push(1-k);b.push(1-e)}}e=[];for(c=0;128>c;c++)for(d=0;70>d;d++)f=
8
- 5*(129*d+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*d+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]),f=5*(129*(d+1)+c+1),e.push(b[f],b[f+1],b[f+2],b[f+3],b[f+4]);this.g=e.length/5;this.f=a.createBuffer();b=new Float32Array(e);a.bindBuffer(a.ARRAY_BUFFER,this.f);a.bufferData(a.ARRAY_BUFFER,b,a.STATIC_DRAW)},Pq=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)},Qq=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
- this.U=this.G=this.f=this.a=this.l=null;this.h=new _.G("clpp.vr");this.I=70;this.D=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.m=this.j=0;this.g={x:0,y:0};this.N=new Jq;this.T=new Jq;this.Y=new Jq;this.aa=new Jq;this.B=this.Pi.bind(this);this.C=this.Qi.bind(this);this.K=
11
- this.Oi.bind(this)},Rq=function(a){var b=Eq(1,0,a.m*Math.PI/180);Dq(Eq(0,1,a.j*Math.PI/180),a.N);Dq(b,a.T);Lq(a.Y);Kq(a.aa,a.N,a.Y);Kq(a.G,a.T,a.aa)},Sq=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(Aq,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Tq=function(){};Fq.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};Jq.prototype.set=function(a,b,c,d,e,f,g,k,l,m,n,p,q,r,x,y){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=k;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=r;C[11]=x;C[15]=y;return this};var Uq={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.v(Qq,_.rp);_.t=Qq.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)if(this.I=b.vr.fieldOfView?b.vr.fieldOfView:70,a=a.getSurface()){var c=a.getMedia();if(c&&c.tagName.toLowerCase()===_.Ie){this.h.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Uq)||this.a.getContext("experimental-webgl",Uq);if(!this.f)throw new _.K(1,9,9003,"Unable to create GL context");this.G=new Jq;Lq(this.G);this.U=new Oq(this.f);
13
- this.A=new Nq(this.f);this.J=new Jq;this.L=new Jq;this.o=this.w=null;this.a.addEventListener(_.$d,this.D)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,!1),this.a.addEventListener(Bq,this.K,!1));this.D();this.cg()}else this.h.info("No video element found, can not initialize VR plugin")}else this.h.info("No surface found, can not initialize VR plugin")};
14
- _.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&&(Sq(this),this.a.removeEventListener(_.$d,this.D),this.a.parentElement.removeChild(this.a),this.a.removeEventListener("mousedown",this.K,!1),delete this.a,this.a=null)};_.t.onPlayerWillDestroy=function(){var a=this;return _.A(function(b){a.l=null;_.z(b)})};_.t.id=function(){return"vr"};
15
- _.t.cg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Ie){this.w=requestAnimationFrame(this.cg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Pq(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
16
- 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=Kq(this.J,this.L,this.G).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.U;a.a.bindBuffer(a.a.ARRAY_BUFFER,
2
+ var f=function(window){var lr="touchmove",mr="touchstart",nr=function(a,b,c,d){this.x=a||0;this.y=b||0;this.a=c||0;this.f=d||1},or=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)},pr=function(a,b,c){c*=.5;var d=Math.sqrt(a*a+b*b),e=Math.sin(c);return new nr(a/d*e,b/d*e,0/d*e,Math.cos(c))},qr=function(a,b,c){this.x=a||0;this.y=b||0;this.a=c||0},rr=function(a,b){isFinite(b)?(a.x*=b,a.y*=b,a.a*=
3
+ b):(a.x=0,a.y=0,a.a=0)},sr=function(a,b){return a.x*b.x+a.y*b.y+a.a*b.a},tr=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},ur=function(){this.a=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},vr=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},wr=function(a){var b=new qr(0,0,0),c=new qr(0,0,1),d=new qr,e=new qr,f=new qr;a=a.a;var g=new qr(0,1,0);f.x=b.x-g.x;f.y=b.y-g.y;f.a=b.a-g.a;g=f.length();rr(f,1/g);c=tr(d,c,f);g=c.length();rr(c,1/g);tr(e,f,d);a[0]=d.x;a[1]=d.y;a[2]=d.a;a[3]=-sr(d,b);a[4]=e.x;a[5]=e.y;a[6]=e.a;a[7]=-sr(e,b);a[8]=f.x;a[9]=f.y;a[10]=f.a;a[11]=-sr(f,b);a[12]=0;a[13]=0;a[14]=0;a[15]=1},yr=function(a){this.a=a;this.f=a.createProgram();this.j=
5
+ xr(this,!1,"uniform highp mat4 Mvpm;\nattribute highp vec4 aPosition;\nattribute highp vec2 aTexCoord;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_Position \x3d Mvpm * aPosition;\n oTexCoord \x3d aTexCoord;\n}\n");this.h=xr(this,!0,"precision highp float;\nuniform sampler2D Texture0;\nvarying highp vec2 oTexCoord;\nvoid main()\n{\n gl_FragColor \x3d texture2D(Texture0, oTexCoord);\n gl_FragColor.w \x3d 1.0;\n}\n");a.attachShader(this.f,this.j);a.attachShader(this.f,this.h);a.bindAttribLocation(this.f,
6
+ 0,"aPosition");a.bindAttribLocation(this.f,1,"aTexCoord");a.linkProgram(this.f);if(!a.getProgramParameter(this.f,a.LINK_STATUS))throw new _.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)},xr=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},zr=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)},Ar=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)},Br=function(){var a=this;this.o=this.w=this.L=this.J=this.A=
10
+ this.U=this.G=this.f=this.a=this.l=null;this.h=new _.H("clpp.vr");this.I=70;this.D=function(){if(a.a&&a.f){a.f.viewport(0,0,a.a.width,a.a.height);var b=a.L.a,c=Math.tan(.5*a.I*Math.PI/180);b[0]=1/(a.a.width/a.a.height*c);b[1]=0;b[2]=0;b[3]=0;b[4]=0;b[5]=1/c;b[6]=0;b[7]=0;b[8]=0;b[9]=0;b[10]=2E3/-1999.9;b[11]=200/-1999.9;b[12]=0;b[13]=0;b[14]=-1;b[15]=1}};this.m=this.j=0;this.g={x:0,y:0};this.O=new ur;this.S=new ur;this.X=new ur;this.$=new ur;this.B=this.gj.bind(this);this.C=this.hj.bind(this);this.K=
11
+ this.fj.bind(this)},Cr=function(a){var b=pr(1,0,a.m*Math.PI/180);or(pr(0,1,a.j*Math.PI/180),a.O);or(b,a.S);wr(a.X);vr(a.$,a.O,a.X);vr(a.G,a.S,a.$)},Dr=function(a){a.a&&(a.a.removeEventListener("mousemove",a.B,!1),a.a.removeEventListener(lr,a.B,!1),a.a.removeEventListener("mouseup",a.C,!1),a.a.removeEventListener("touchend",a.C,!1))},Er=function(){};qr.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.a*this.a)};ur.prototype.set=function(a,b,c,d,e,f,g,h,l,m,n,p,q,r,w,x){var C=this.a;C[0]=a;C[4]=b;C[8]=c;C[12]=d;C[1]=e;C[5]=f;C[9]=g;C[13]=h;C[2]=l;C[6]=m;C[10]=n;C[14]=p;C[3]=q;C[7]=r;C[11]=w;C[15]=x;return this};var Fr={alpha:!1,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!1,preserveDrawingBuffer:!1,devicePixelRatio:1};_.v(Br,_.cq);_.t=Br.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)if(this.I=b.vr.fieldOfView?b.vr.fieldOfView:70,a=a.getSurface()){var c=a.getMedia();if(c&&c.tagName.toLowerCase()===_.Pe){this.h.info("Initialize VR Surface");if(!this.a){this.a=document.createElement("canvas");this.a.style.width="100%";this.f=this.a.getContext("webgl",Fr)||this.a.getContext("experimental-webgl",Fr);if(!this.f)throw new _.L(1,9,9003,"Unable to create GL context");this.G=new ur;wr(this.G);this.U=new zr(this.f);
13
+ this.A=new yr(this.f);this.J=new ur;this.L=new ur;this.o=this.w=null;this.a.addEventListener(_.ge,this.D)}a.addElementToContainer(this.a,!0,!0);a.hideMediaElement();b.vr.attachMouseListener&&(this.a.addEventListener("mousedown",this.K,!1),this.a.addEventListener(mr,this.K,!1));this.D();this.mg()}else this.h.info("No video element found, can not initialize VR plugin")}else this.h.info("No surface found, can not initialize VR plugin")};
14
+ _.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&&(Dr(this),this.a.removeEventListener(_.ge,this.D),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 _.A(function(b){a.l=null;_.z(b)})};_.t.id=function(){return"vr"};
15
+ _.t.mg=function(){if(this.l&&this.f){var a=this.l.getSurface();if(a&&(a=a.getMedia())&&a.tagName.toLowerCase()===_.Pe){this.w=requestAnimationFrame(this.mg.bind(this));var b=this.f;this.o||a.readyState!==a.HAVE_ENOUGH_DATA||(this.o=new Ar(a,b));b.clearColor(0,0,0,1);b.clearDepth(1);b.clearStencil(0);b.enable(b.DEPTH_TEST);b.depthFunc(b.LEQUAL);b.frontFace(b.CCW);b.cullFace(b.BACK);b.disable(b.CULL_FACE);b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA);b.depthMask(!0);b.clearColor(0,
16
+ 0,0,1);b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT);if(this.o){var c=this.A;c.a.useProgram(c.f);c=vr(this.J,this.L,this.G).a;var d=c[1];c[1]=c[4];c[4]=d;d=c[2];c[2]=c[8];c[8]=d;d=c[6];c[6]=c[9];c[9]=d;d=c[3];c[3]=c[12];c[12]=d;d=c[7];c[7]=c[13];c[13]=d;d=c[11];c[11]=c[14];c[14]=d;b.uniformMatrix4fv(this.A.g,!1,this.J.a);c=this.o;c.a.activeTexture(c.a.TEXTURE0);c.a.bindTexture(c.a.TEXTURE_2D,c.f);b.texImage2D(b.TEXTURE_2D,0,b.RGB,b.RGB,b.UNSIGNED_BYTE,a);a=this.U;a.a.bindBuffer(a.a.ARRAY_BUFFER,
17
17
  a.f);a.a.vertexAttribPointer(0,3,a.a.FLOAT,!1,20,0);a.a.vertexAttribPointer(1,2,a.a.FLOAT,!1,20,12);a.a.enableVertexAttribArray(0);a.a.enableVertexAttribArray(1);a.a.drawArrays(a.a.TRIANGLES,0,a.g);a=this.o;a.a.bindTexture(a.a.TEXTURE_2D,null);this.A.a.useProgram(null)}}}};
18
- _.t.Oi=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===Bq)a.type===Bq?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(Aq,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
19
- _.t.Pi=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===Aq&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;this.j+=a;this.m+=d;Rq(this)};_.t.Qi=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Sq(this)};_.t.hi=function(a,b){this.m=b;this.j=a;Rq(this)};_.t.Uh=function(){return{x:this.j,y:this.m}};_.t.nj=function(a){this.I=a;this.D()};_.B("clpp.vr.VrPlugin",Qq);
20
- Qq.prototype.setCameraFieldOfView=Qq.prototype.nj;Qq.prototype.getCameraCoordinates=Qq.prototype.Uh;Qq.prototype.moveCamera=Qq.prototype.hi;Qq.Id="vr";Tq.prototype.create=function(){return new Qq};_.Fn(new Tq);};
18
+ _.t.fj=function(a){this.h.debug("Mouse Down. Enable VR mouse interaction");a.preventDefault();if(0===a.button||a.type===mr)a.type===mr?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(lr,this.B,!1),this.a.addEventListener("mouseup",this.C,!1),this.a.addEventListener("touchend",this.C,!1)};
19
+ _.t.gj=function(a){a.preventDefault();var b=a.clientX,c=a.clientY;a.type===lr&&a.touches[0]&&(b=a.touches[0].clientX,c=a.touches[0].clientY);a=this.g.x-b;var d=this.g.y-c;this.g.x=b;this.g.y=c;this.j+=a;this.m+=d;Cr(this)};_.t.hj=function(a){this.h.debug("Mouse Up. Removing mouse interaction listeners");a.preventDefault();Dr(this)};_.t.Ci=function(a,b){this.m=b;this.j=a;Cr(this)};_.t.fi=function(){return{x:this.j,y:this.m}};_.t.Hj=function(a){this.I=a;this.D()};_.B("clpp.vr.VrPlugin",Br);
20
+ Br.prototype.setCameraFieldOfView=Br.prototype.Hj;Br.prototype.getCameraCoordinates=Br.prototype.fi;Br.prototype.moveCamera=Br.prototype.Ci;Br.Id="vr";Er.prototype.create=function(){return new Br};_.uo(new Er);};
21
21
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
22
22
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
23
23
  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 gq=" The setting will be ignored.",hq="VTT parser encountered an invalid VTT setting: ",iq="application/x-subrip",jq="text/srt",kq='text/vtt; codecs\x3d"vtt"',lq='text/vtt; codecs\x3d"wvtt"',mq=function(a){_.zo(a,/[ \t]+/gm)},nq=function(a){return a.a==a.f.length?null:(a=_.zo(a,/[^ \t\n]*/gm))?a[0]:null},oq=function(){},pq=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},qq=function(){},rq=function(a){this.a=a},tq=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.ng:a.textAlign=
4
- _.xp[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ge:_.He;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==_.jd||b==_.he?_.jd:b==_.kd||b==_.Xc?_.kd:_.sc);else if(d=/^region:(.*)$/.exec(b)){if(b=sq(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=_.yp[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.pg,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.yp[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},sq=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.D("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},uq=function(a){a=_.zo(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)},vq=function(){rq.apply(this,arguments)},wq=function(){this.a=null;this.f=new _.G("clpp.vtt.mp4")},yq=function(a,b,c){var d,e,f;(new _.Pj).M("payl",_.Sj(function(g){d=_.Tg(g)})).M("iden",_.Sj(function(g){e=_.Tg(g)})).M("sttg",_.Sj(function(g){f=_.Tg(g)})).parse(a);return d?xq(d,e,f,b,c):null},xq=function(a,b,c,d,e){a=new _.sg(d,e,a);b&&(a.id=b);if(c)for(b=new _.yo(c),c=nq(b);c;)tq(a,c,[])||_.D(hq,
7
- c,gq),mq(b),c=nq(b);return a},zq=function(){this.a=new qq};oq.prototype.a=function(a){a=_.Tg(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+=pq(c.value)}return _.Xg(a)};qq.prototype.create=function(){return new oq};qq.prototype.probe=function(a,b){return(a===jq||a===iq)&&b===_.ue};rq.prototype.parseInit=function(){};
8
- rq.prototype.parseMedia=function(a,b){var c=_.Tg(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 _.K(_.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=uq(new _.yo(e[1]));if(null==c)throw new _.K(_.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 k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.yo(k.replace(/\n/g," "));g=new _.vg;nq(k);mq(k);for(var l=nq(k);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.D("VTT parser encountered an invalid VTTRegion setting: ",l,gq);mq(k);l=nq(k)}f.push(g)}}e=[];k=_.u(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}k=[];d=_.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 _.yo(p[0]);m=uq(l);var r=_.zo(l,/[ \t]+--\x3e[ \t]+/g);n=uq(l);if(null==m||null==r||null==n)throw new _.K(_.M,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.sg(m,n,p,_.Pe);g&&(m.id=g);mq(l);for(n=nq(l);n;)tq(m,n,f)||_.D(hq,
12
- n,gq),mq(l),n=nq(l);null!=g&&(m.id=g);g=m}g&&k.push(g)}return{cues:k,styles:e}};_.v(vq,rq);vq.prototype.parseMedia=function(a,b){return rq.prototype.parseMedia.call(this,(new oq).a(a),b)};wq.prototype.parseInit=function(a){var b=this,c=!1;(new _.Pj).M(_.vd,_.Qj).M(_.xe,_.Qj).M(_.pd,_.Qj).V("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.Kj(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.Kj(d.F),d.F.skip(8));d.F.skip(4)}).M(_.td,_.Qj).M(_.le,_.Qj).V(_.ne,_.Rj).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.K(_.M,2,2008);if(!c)throw new _.K(_.M,2,2008);};
13
- wq.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),new _.K(_.M,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.Pj).M("moof",_.Qj).M("traf",_.Qj).V("tfdt",function(L){g=!0;c=0==L.version?_.Kj(L.F):_.Mj(L.F)}).V("tfhd",function(L){var O=L.flags;L=L.F;L.skip(4);O&1&&L.skip(8);O&2&&L.skip(4);m=O&8?_.Kj(L):null}).V("trun",function(L){k=!0;var O=L.version,S=L.flags;L=L.F;var ra=_.Kj(L);S&1&&L.skip(4);S&4&&L.skip(4);for(var W=[],ca=0;ca<ra;ca++){var fa=
14
- {duration:null,sampleSize:null,Se:null};S&256&&(fa.duration=_.Kj(L));S&512&&(fa.sampleSize=_.Kj(L));S&1024&&L.skip(4);S&2048&&(fa.Se=0==O?_.Kj(L):_.Lj(L));W.push(fa)}d=W}).M(_.od,_.Sj(function(L){l=!0;e=L})).parse(a);if(!l&&!g&&!k)throw new _.K(_.M,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.Fj(p,!1);for(var q=_.u(d),r=q.next();!r.done;r=q.next()){r=r.value;var x=r.duration||m,y=r.Se?c+r.Se:n;n=y+(x||0);var C=0;do{var H=_.Kj(p);C+=H;var F=_.Kj(p);F=_.Uj(F);var E=null;
15
- "vttc"==F?8<H&&(E=_.Nj(p,H-8)):("vtte"!=F&&this.f.error("Unknown box "+F+"! Skipping!"),p.skip(H-8));x?E&&f.push(yq(E,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.f.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&C<r.sampleSize)}return{cues:f.filter(_.Ll),styles:[]}};_.v(zq,_.Kn);zq.prototype.Da=function(){_.ep[_.ue]=rq;_.ep[kq]=rq;_.ep[lq]=rq;_.ep[_.Wb]=wq;_.ep[jq]=vq;_.ep[iq]=vq;_.rh.push(this.a)};zq.prototype.va=function(){_.fp(_.ue);_.fp(kq);_.fp(lq);_.fp(_.Wb);_.fp(jq);_.fp(iq);_.th(this.a)};zq.prototype.id=function(){return _.re};_.B("clpp.vtt.VttComponent",zq);};
2
+ var f=function(window){var Sq=" The setting will be ignored.",Tq="VTT parser encountered an invalid VTT setting: ",Uq="application/x-subrip",Vq="text/srt",Wq='text/vtt; codecs\x3d"vtt"',Xq='text/vtt; codecs\x3d"wvtt"',Yq=function(a){_.$g(a,/[ \t]+/gm)},Zq=function(a){return a.a==a.f.length?null:(a=_.$g(a,/[^ \t\n]*/gm))?a[0]:null},$q=function(){},ar=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},br=function(){},cr=function(a){this.a=a},er=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.sg:a.textAlign=
4
+ _.iq[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ne:_.Oe;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.rd||b==_.oe?_.rd:b==_.sd||b==_.dd?_.sd:_.Ac);else if(d=/^region:(.*)$/.exec(b)){if(b=dr(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=_.jq[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ug,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.jq[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},dr=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.F("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},fr=function(a){a=_.$g(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)},gr=function(){cr.apply(this,arguments)},hr=function(){this.a=null;this.f=new _.H("clpp.vtt.mp4")},jr=function(a,b,c){var d,e,f;(new _.Fk).M("payl",_.Ik(function(g){d=_.oh(g)})).M("iden",_.Ik(function(g){e=_.oh(g)})).M("sttg",_.Ik(function(g){f=_.oh(g)})).parse(a);return d?ir(d,e,f,b,c):null},ir=function(a,b,c,d,e){a=new _.xg(d,e,a);b&&(a.id=b);if(c)for(b=new _.Zg(c),c=Zq(b);c;)er(a,c,[])||_.F(Tq,
7
+ c,Sq),Yq(b),c=Zq(b);return a},kr=function(){this.a=new br};$q.prototype.a=function(a){a=_.oh(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+=ar(c.value)}return _.sh(a)};br.prototype.create=function(){return new $q};br.prototype.probe=function(a,b){return(a===Vq||a===Uq)&&b===_.Be};cr.prototype.parseInit=function(){};
8
+ cr.prototype.parseMedia=function(a,b){var c=_.oh(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=fr(new _.Zg(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 _.Zg(h.replace(/\n/g," "));g=new _.Ag;Zq(h);Yq(h);for(var l=Zq(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||_.F("VTT parser encountered an invalid VTTRegion setting: ",l,Sq);Yq(h);l=Zq(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 _.Zg(p[0]);m=fr(l);var r=_.$g(l,/[ \t]+--\x3e[ \t]+/g);n=fr(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 _.xg(m,n,p,_.We);g&&(m.id=g);Yq(l);for(n=Zq(l);n;)er(m,n,f)||_.F(Tq,
12
+ n,Sq),Yq(l),n=Zq(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.v(gr,cr);gr.prototype.parseMedia=function(a,b){return cr.prototype.parseMedia.call(this,(new $q).a(a),b)};hr.prototype.parseInit=function(a){var b=this,c=!1;(new _.Fk).M(_.Cd,_.Gk).M(_.Ee,_.Gk).M(_.xd,_.Gk).V("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.U(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.U(d.F),d.F.skip(8));d.F.skip(4)}).M(_.Bd,_.Gk).M(_.se,_.Gk).V(_.ue,_.Hk).M("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.L(_.M,2,2008);if(!c)throw new _.L(_.M,2,2008);};
13
+ hr.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.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 _.Fk).M("moof",_.Gk).M("traf",_.Gk).V("tfdt",function(K){g=!0;c=0==K.version?_.U(K.F):_.Dk(K.F)}).V("tfhd",function(K){var O=K.flags;K=K.F;K.skip(4);O&1&&K.skip(8);O&2&&K.skip(4);m=O&8?_.U(K):null}).V("trun",function(K){h=!0;var O=K.version,T=K.flags;K=K.F;var Da=_.U(K);T&1&&K.skip(4);T&4&&K.skip(4);for(var ea=[],fa=0;fa<Da;fa++){var xa=
14
+ {duration:null,sampleSize:null,af:null};T&256&&(xa.duration=_.U(K));T&512&&(xa.sampleSize=_.U(K));T&1024&&K.skip(4);T&2048&&(xa.af=0==O?_.U(K):_.Bk(K));ea.push(xa)}d=ea}).M(_.wd,_.Ik(function(K){l=!0;e=K})).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 _.wk(p,!1);for(var q=_.u(d),r=q.next();!r.done;r=q.next()){r=r.value;var w=r.duration||m,x=r.af?c+r.af:n;n=x+(w||0);var C=0;do{var D=_.U(p);C+=D;var E=_.U(p);E=_.Kk(E);var G=null;"vttc"==
15
+ E?8<D&&(G=_.Ek(p,D-8)):("vtte"!=E&&this.f.error("Unknown box "+E+"! Skipping!"),p.skip(D-8));w?G&&f.push(jr(G,b.periodStart+x/this.a,b.periodStart+n/this.a)):this.f.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&C<r.sampleSize)}return{cues:f.filter(_.Dg),styles:[]}};_.v(kr,_.zo);kr.prototype.Ja=function(){_.Rp[_.Be]=cr;_.Rp[Wq]=cr;_.Rp[Xq]=cr;_.Rp[_.ec]=hr;_.Rp[Vq]=gr;_.Rp[Uq]=gr;_.Ci.push(this.a)};kr.prototype.Ca=function(){_.Sp(_.Be);_.Sp(Wq);_.Sp(Xq);_.Sp(_.ec);_.Sp(Vq);_.Sp(Uq);_.Ei(this.a)};kr.prototype.id=function(){return _.ye};_.B("clpp.vtt.VttComponent",kr);};
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,23 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Zp="accountCode key is missing in Youbora config",$p="clpp.npaw.YouboraPlugin",aq="content.isLive",bq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.f=new _.Wf;d.a=new _.G("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.registerListeners();d.A=!1;return d}_.v(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.l.getPosition()};b.prototype.getDuration=function(){return this.l.getDuration()};b.prototype.getRendition=function(){var c=this.l.getTrackManager();
3
- if(c&&(c=c.fa())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),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.j().streamBandwidth};b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.l.getPlaybackRate()};
4
- b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.Ca())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.oa};b.prototype.getVersion=function(){return"6.3.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ea};b.prototype.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.ie,this.J.bind(this)),this.f.on(this.l,_.Zc,this.D.bind(this)),this.f.on(this.l,
5
- _.Ee,this.I.bind(this)),this.f.on(this.l,_.De,this.G.bind(this)),this.f.on(this.l,_.Nb,this.B.bind(this)),this.f.on(this.l,_.oc,this.C.bind(this)))};b.prototype.unregisterListeners=function(){this.a.debug(_.qb);_.ag(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.j=function(){return this.l.getStats()||_.Tl()};b.prototype.m=function(){return!!this.l.getConfiguration().autoplay};b.prototype.J=function(c){this.a.debug("State changed",c);if(c=
6
- c.detail)switch(c.currentState){case _.im:this.m()&&this.g();break;case _.km:this.g();this.w();this.fireResume();this.fireBufferEnd();break;case _.jm:this.m()&&this.g();this.w();this.fireBufferEnd();this.firePause();break;case _.Xl:this.fireBufferEnd();this.fireStop();break;case _.dm:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.bm:this.fireBufferBegin();break;default:this.a.debug("Unhandled state",c)}};b.prototype.g=function(){this.plugin.isInitiated||
7
- (this.h=!1,this.fireInit())};b.prototype.w=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Ic)?"Widevine":c.startsWith(_.Gc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Jd)?"ClearKey":c.startsWith(_.Fc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.D=function(c){this.a.debug("Fire error",c);!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c.severity===_.M?(this.h=!0,
8
- this.fireFatalError(""+c.code,c.message)):this.fireError(""+c.code,c.message))};b.prototype.I=function(c){this.a.debug("Seeking",c);this.l.isEnded()||(this.g(),this.fireSeekBegin())};b.prototype.G=function(c){this.a.debug("Seeked",c);this.fireSeekEnd()};b.prototype.B=function(c){this.a.debug("adsTimeline",c);c=c.adsTimeline;this.o=!!c&&c.cb()};b.prototype.C=function(c){this.a.debug("Casting",c);this.fireCasted()};return new b(a)},cq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;
9
- d.l=c;d.a=null;d.h=null;d.f=new _.Wf;d.g=new _.G("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.m=!1;return d}_.v(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.rb(),this.a.qb(),this.a.bb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.bb()};b.prototype.getPlayhead=function(){var c=this.l.getAdsManager();return c&&c.getPosition()};
10
- 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.Ra()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};
11
- 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.h&&this.h.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.tb()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=
12
- this;return this.h&&this.h.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.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.oa};b.prototype.getVersion=function(){return"6.3.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ea};
13
- b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Nb,this.I.bind(this)),this.f.on(this.l,_.Jb,this.G.bind(this)),this.f.on(this.l,_.Fb,this.B.bind(this)),this.f.on(this.l,_.Hb,this.C.bind(this)),this.f.on(this.l,_.Ab,this.w.bind(this)),this.f.on(this.l,_.Bb,this.j.bind(this,1)),this.f.on(this.l,_.Eb,this.j.bind(this,2)),this.f.on(this.l,_.Lb,this.j.bind(this,3)),this.f.on(this.l,_.zb,this.o.bind(this)),this.f.on(this.l,_.Ib,this.D.bind(this)),this.f.on(this.l,_.Zc,this.A.bind(this)),
14
- this.f.on(this.l,_.wb,this.J.bind(this)),this.f.on(this.l,_.xb,this.K.bind(this)),this.f.on(this.l,_.yb,this.L.bind(this)),this.f.on(this.l,_.Gb,this.N.bind(this)))};b.prototype.unregisterListeners=function(){_.ag(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.m=!0};b.prototype.I=function(c){this.g.debug("ad timeline changed",c);this.h=c.adsTimeline};b.prototype.G=function(c){this.g.debug("ad start",c);this.a=c.ad;this.fireStart();this.fireJoin()};b.prototype.w=
15
- function(c){this.g.debug("ad end",c);this.fireStop()};b.prototype.B=function(c){this.g.debug("ad pause",c);this.firePause()};b.prototype.C=function(c){this.g.debug("ad resume",c);this.fireResume()};b.prototype.L=function(c){this.g.debug("on buffering",c);this.fireBufferBegin()};b.prototype.N=function(c){this.g.debug("on progress",c);this.fireBufferEnd()};b.prototype.j=function(c,d){this.g.debug("ad quartile",c,d);this.fireQuartile(c)};b.prototype.o=function(c){this.g.debug("ad clicked",c);c=this.a&&
16
- this.a.Hb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.D=function(c){this.g.debug("ad skipped",c);this.fireSkip()};b.prototype.J=function(c){this.g.debug("break start",c);this.a=c.ad;this.fireBreakStart()};b.prototype.K=function(c){this.g.debug("ad break stop",c);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&(c=this.plugin.getAdapter())&&c.fireStop()};b.prototype.A=function(c){this.g.warn("ad error",c);(c=c.detail)&&10003===c.code&&(c.severity===
17
- _.M?this.fireFatalError(""+c.code,c.message):this.fireError(""+c.code,c.message))};return new b(a)},dq=function(){this.a=null;this.f=!1;this.g=new _.G($p);this.l=null},eq=function(a,b){var c=b.getConfiguration();a.f=!_.J.R(c.youbora)&&typeof c.youbora===_.Bd;a.f?window.youbora&&6<=+youbora.VERSION.split(".")[0]?b.namespace()===_.yc&&(a.f=!1,a.g.info("Youbora does not report when casting.")):(a.g.warn("No valid Youbora SDK available. Youbora SDK is supported","starting from version",6),a.f=!1,b.onError(new _.K(1,
18
- 9,9100))):a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},fq=function(){};_.v(dq,_.rp);_.t=dq.prototype;_.t.Pe=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(bq(this.l)),this.a.setAdsAdapter(cq(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;eq(this,a);if(this.f){var b=a.getConfiguration().youbora;b.accountCode?this.Pe(new youbora.Plugin(b)):(this.g.warn(Zp),a.onError(new _.K(1,9,9101)))}};
19
- _.t.onContentWillLoad=function(a,b){eq(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[aq]&&(d[aq]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Pe(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(Zp),a.onError(new _.K(1,9,9101)))}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.B($p,dq);
20
- dq.prototype.getAdsAdapter=dq.prototype.getAdsAdapter;dq.prototype.getAdapter=dq.prototype.getAdapter;dq.prototype.setYouboraPlugin=dq.prototype.Pe;dq.Id="youbora";fq.prototype.create=function(){return new dq};_.Fn(new fq);};
2
+ var f=function(window){var Jq="accountCode key is missing in Youbora config",Kq="clpp.npaw.YouboraPlugin",Lq="content.isLive",Mq=function(a,b){for(var c=a.split("."),d=b.split("."),e=0;e<c.length;e++){var f=parseInt(c[e],10),g=parseInt(d[e],10);if(f<g)return!0;if(f>g)break}return!1},Nq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.f=new _.cg;d.a=new _.H("clpp.npaw.YouboraAdapter");d.o=!1;d.h=!1;d.registerListeners();d.A=!1;return d}_.v(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.l.getPosition()};
3
+ b.prototype.getDuration=function(){return this.l.getDuration()};b.prototype.getRendition=function(){var c=this.l.getTrackManager();if(c&&(c=c.ea())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.j(),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.j().streamBandwidth};
4
+ b.prototype.getThroughput=function(){return this.j().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.l.getPlaybackRate()};b.prototype.getFramesPerSecond=function(){var c=this.l.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.ta};b.prototype.getVersion=function(){return"6.4.1-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),
5
+ youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.pe,this.J.bind(this)),this.f.on(this.l,_.fd,this.D.bind(this)),this.f.on(this.l,_.Le,this.I.bind(this)),this.f.on(this.l,_.Ke,this.G.bind(this)),this.f.on(this.l,_.Wb,this.B.bind(this)),this.f.on(this.l,_.wc,this.C.bind(this)))};b.prototype.unregisterListeners=function(){this.a.debug(_.yb);_.fg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.j=function(){return this.l.getStats()||_.Km()};
6
+ b.prototype.m=function(){return!!this.l.getConfiguration().autoplay};b.prototype.J=function(c){this.a.debug("State changed",c);if(c=c.detail)switch(c.currentState){case _.$m:this.m()&&this.g();break;case _.bn:this.g();this.w();this.fireResume();this.fireBufferEnd();break;case _.an:this.m()&&this.g();this.w();this.fireBufferEnd();this.firePause();break;case _.Om:this.fireBufferEnd();this.fireStop();break;case _.Vm:this.fireBufferEnd();this.o&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();
7
+ break;case _.Tm:this.fireBufferBegin();break;default:this.a.debug("Unhandled state",c)}};b.prototype.g=function(){this.plugin.isInitiated||(this.h=!1,this.fireInit())};b.prototype.w=function(){var c=this.l.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Pc)?"Widevine":c.startsWith(_.Nc)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.Qd)?"ClearKey":c.startsWith(_.Mc)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.D=
8
+ function(c){this.a.debug("Fire error",c);!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c.severity===_.M?(this.h=!0,this.fireFatalError(""+c.code,c.message)):this.fireError(""+c.code,c.message))};b.prototype.I=function(c){this.a.debug("Seeking",c);this.l.isEnded()||(this.g(),this.fireSeekBegin())};b.prototype.G=function(c){this.a.debug("Seeked",c);this.fireSeekEnd()};b.prototype.B=function(c){this.a.debug("adsTimeline",c);c=c.adsTimeline;this.o=!!c&&c.hb()};b.prototype.C=function(c){this.a.debug("Casting",
9
+ c);this.fireCasted()};return new b(a)},Oq=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.l=c;d.a=null;d.h=null;d.f=new _.cg;d.g=new _.H("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.m=!1;return d}_.v(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.vb(),this.a.ub(),this.a.gb()));return c};b.prototype.getBitrate=function(){return this.a&&
10
+ this.a.gb()};b.prototype.getPlayhead=function(){var c=this.l.getAdsManager();return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.Ua()){case 0:d=
11
+ c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.l.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.xb()};
12
+ b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=function(){var c=this;return this.h&&this.h.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.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.ta};
13
+ b.prototype.getVersion=function(){return"6.4.1-castlabsadsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Wb,this.I.bind(this)),this.f.on(this.l,_.Sb,this.G.bind(this)),this.f.on(this.l,_.Ob,this.B.bind(this)),this.f.on(this.l,_.Qb,this.C.bind(this)),this.f.on(this.l,_.Jb,this.w.bind(this)),this.f.on(this.l,_.Kb,this.j.bind(this,1)),this.f.on(this.l,_.Nb,this.j.bind(this,2)),this.f.on(this.l,_.Ub,this.j.bind(this,
14
+ 3)),this.f.on(this.l,_.Ib,this.o.bind(this)),this.f.on(this.l,_.Rb,this.D.bind(this)),this.f.on(this.l,_.fd,this.A.bind(this)),this.f.on(this.l,_.Fb,this.J.bind(this)),this.f.on(this.l,_.Gb,this.K.bind(this)),this.f.on(this.l,_.Hb,this.L.bind(this)),this.f.on(this.l,_.Pb,this.O.bind(this)))};b.prototype.unregisterListeners=function(){_.fg(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.m=!0};b.prototype.I=function(c){this.g.debug("ad timeline changed",c);
15
+ this.h=c.adsTimeline};b.prototype.G=function(c){this.g.debug("ad start",c);this.a=c.ad;this.fireStart();this.fireJoin()};b.prototype.w=function(c){this.g.debug("ad end",c);this.fireStop()};b.prototype.B=function(c){this.g.debug("ad pause",c);this.firePause()};b.prototype.C=function(c){this.g.debug("ad resume",c);this.fireResume()};b.prototype.L=function(c){this.g.debug("on buffering",c);this.fireBufferBegin()};b.prototype.O=function(c){this.g.debug("on progress",c);this.fireBufferEnd()};b.prototype.j=
16
+ function(c,d){this.g.debug("ad quartile",c,d);this.fireQuartile(c)};b.prototype.o=function(c){this.g.debug("ad clicked",c);c=this.a&&this.a.Ib();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.D=function(c){this.g.debug("ad skipped",c);this.fireSkip()};b.prototype.J=function(c){this.g.debug("break start",c);this.a=c.ad;this.fireBreakStart()};b.prototype.K=function(c){this.g.debug("ad break stop",c);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&
17
+ (c=this.plugin.getAdapter())&&c.fireStop()};b.prototype.A=function(c){this.g.warn("ad error",c);(c=c.detail)&&10003===c.code&&(c.severity===_.M?this.fireFatalError(""+c.code,c.message):this.fireError(""+c.code,c.message))};return new b(a)},Pq=function(){this.a=null;this.f=!1;this.g=new _.H(Kq);this.l=null},Qq=function(a,b){var c=b.getConfiguration();a.f=!_.J.R(c.youbora)&&typeof c.youbora===_.Id;if(a.f)if(null==window.youbora)a.f=!1,a.g.warn("Youbora SDK not found."),b.onError(new _.L(1,9,9100));
18
+ else{c=youbora.VERSION;var d;if(typeof c===_.te&&null!=c.match(/^\d+\.\d+\.\d+$/)){if(d=!Mq(c,"6.8.12"))d="6.8.25"===c||Mq(c,"6.8.25")}else d=!1;d||(a.g.warn("Youbora SDK version is not supported. Supported versions are 6.8.12 - 6.8.25, found version "+(c+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.L(1,9,9102)));b.namespace()===_.Fc&&(a.f=!1,a.g.info("Youbora does not report when casting."))}else a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},
19
+ Rq=function(){};_.v(Pq,_.cq);_.t=Pq.prototype;_.t.Xe=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Nq(this.l)),this.a.setAdsAdapter(Oq(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;Qq(this,a);if(this.f){var b=a.getConfiguration().youbora;b.accountCode?this.Xe(new youbora.Plugin(b)):(this.g.warn(Jq),a.onError(new _.L(1,9,9101)))}};
20
+ _.t.onContentWillLoad=function(a,b){Qq(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[Lq]&&(d[Lq]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Xe(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(Jq),a.onError(new _.L(1,9,9101)))}};_.t.onPlayerWillRelease=function(){};_.t.onPlayerWillDestroy=function(){};_.t.id=function(){return"youbora"};_.B(Kq,Pq);
21
+ Pq.prototype.getAdsAdapter=Pq.prototype.getAdsAdapter;Pq.prototype.getAdapter=Pq.prototype.getAdapter;Pq.prototype.setYouboraPlugin=Pq.prototype.Xe;Pq.Id="youbora";Rq.prototype.create=function(){return new Pq};_.uo(new Rq);};
21
22
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
22
23
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
23
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 LJ=function(a){a.f=new _.Fn;a.f.on(a.l,_.Be,()=>JJ(a));a.f.on(a.l,_.Ae,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.id,()=>KJ(a));a.f.on(a.l,_.ge,b=>{b=b.detail;switch(b.currentState){case _.dl:a.a.length||KJ(a);s.Media.play(a.a,a.l.getPosition());break;case _.bl:case _.Vk:JJ(a);break;case _.Sk:case _.$k:case _.Zk:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),JJ(a),s.Media.close(a.a),a.a=""}})},JJ=function(a){s.Media.stop(a.a,a.l.getPosition())},
2
- KJ=function(a){{const b=a.l.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.l.getDuration()}`);s.Media.open(a.a,a.l.getDuration(),_.la)},MJ=class extends _.up{constructor(){super();this.l=this.f=null;this.a="";this.g=new _.O("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.l=a,LJ(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""}id(){return"adobe"}};
3
- _.x("clpp.adobe.AdobeAnalyticsPlugin",MJ);MJ.Id="adobe";_.cm(new class{create(){return new MJ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var TK=function(a){a.f=new _.mo;a.f.on(a.l,_.Be,()=>RK(a));a.f.on(a.l,_.Ae,()=>{s.Media.play(a.a,a.l.getPosition())});a.f.on(a.l,_.nd,()=>SK(a));a.f.on(a.l,_.ie,b=>{b=b.detail;switch(b.currentState){case _.Ll:a.a.length||SK(a);s.Media.play(a.a,a.l.getPosition());break;case _.Kl:case _.Dl:RK(a);break;case _.Al:case _.Il:case _.Hl:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),RK(a),s.Media.close(a.a),a.a=""}})},RK=function(a){s.Media.stop(a.a,a.l.getPosition())},
2
+ SK=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(),_.pa)},UK=class extends _.Zp{constructor(){super();this.l=this.f=null;this.a="";this.g=new _.O("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.l=a,TK(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.l=null;this.a=""}id(){return"adobe"}};
3
+ _.x("clpp.adobe.AdobeAnalyticsPlugin",UK);UK.Id="adobe";_.Km(new class{create(){return new UK}});};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 IJ=class extends _.up{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.Xn(()=>{this.l.play().catch(()=>{})});this.g=new _.Fn}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 _.B(_.Lb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Jb:_.Ib;if(this.j||!this.l.isPaused()||this.l.getState()===_.dl)this.j?this.l.play().catch(()=>{}):this.m.$(.01);this.l.trigger(new _.B(a))}$a(){return this.h}Zc(){return this.f}Bf(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",IJ);IJ.prototype.showCastMenu=IJ.prototype.Bf;
3
- IJ.prototype.canCast=IJ.prototype.Zc;IJ.prototype.isCasting=IJ.prototype.$a;IJ.Id="airplay";_.cm(new class{create(){return new IJ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var QK=class extends _.Zp{constructor(){super();this.a=this.l=null;this.j=this.f=this.h=!1;this.m=new _.No(()=>{this.l.play().catch(()=>{})});this.g=new _.mo}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 _.C(_.Pb,{canCast:this.f}))}w(){const a=(this.h=this.a.webkitCurrentPlaybackTargetIsWireless)?_.Nb:_.Mb;if(this.j||!this.l.isPaused()||this.l.getState()===_.Ll)this.j?this.l.play().catch(()=>{}):this.m.aa(.01);this.l.trigger(new _.C(a))}fb(){return this.h}fd(){return this.f}Qf(){this.f&&(this.j=!this.l.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.x("clpp.airplay.AirPlayPlugin",QK);QK.prototype.showCastMenu=QK.prototype.Qf;
3
+ QK.prototype.canCast=QK.prototype.fd;QK.prototype.isCasting=QK.prototype.fb;QK.Id="airplay";_.Km(new class{create(){return new QK}});};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 BJ=function(){return!window.SmartLib||!window.GenericPlayerApi},CJ=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))},EJ=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,_.Tc,a.U.bind(a));a.h=new DJ(a.l);a.a.attachPlayer(a.h)},FJ=function(a,b){_.Jf(a.j);a.f&&
2
- (a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},GJ=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.Fn;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.ge,this.m.bind(this));b.on(a,_.bc,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.p&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Vk&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Vk:c.notifyStallStart();
3
- break;case _.dl:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.bl:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Jf(this.a),this.a=null)}};var DJ=class extends GenericPlayerApi{constructor(a){super();this.l=a;this.a=_.ai()}getPlayerName(){return _.la}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.l.isLive()?0:1E3*this.l.getDuration()}getCurrentPosition(){return 1E3*this.l.getPosition()}getCurrentBitrate(){const a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3}};var HJ=class extends _.up{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.Fn}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(BJ())return a.onError(new _.G(1,9,11E3));CJ(this,c);EJ(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.l.onError(new _.G(1,9,11001,{bpkErrorCode:e,message:d}));FJ(this,void 0)}else b.url=d.getURL(),this.f=new GJ(this.l,
4
- this.h),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)FJ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:FJ(this,SmartLib.BPDecodingError);break;case 1:FJ(this,SmartLib.BPNetworkingError);break;case 6:FJ(this,SmartLib.BPAccessRightError);break;default:FJ(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){BJ()||FJ(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",HJ);HJ.isSdkMissing=BJ;HJ.Id="broadpeak";
5
- _.cm(new class{create(){return new HJ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var JK=function(){return!window.SmartLib||!window.GenericPlayerApi},KK=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===_.le&&a.g.setUUID(b))},MK=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,_.Wc,a.T.bind(a));a.h=new LK(a.l);a.a.attachPlayer(a.h)},NK=function(a,b){_.Mf(a.j);a.f&&
2
+ (a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},OK=class{constructor(a,b){this.l=a;this.f=b;this.a=new _.mo;this.g=!1}init(){const a=this.l,b=this.a;b.on(a,_.ie,this.m.bind(this));b.on(a,_.ec,this.h.bind(this));b.on(a,"seek",this.j.bind(this))}h(a){a=a.detail;typeof a.bandwidth===_.p&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}m(a){const b=this.l,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.Dl&&c.notifyStallEnd(!b.isPaused());switch(d){case _.Dl:c.notifyStallStart();
3
+ break;case _.Ll:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.Kl:c.notifyPause()}}j(){const a=1E3*this.l.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Mf(this.a),this.a=null)}};var LK=class extends GenericPlayerApi{constructor(a){super();this.l=a;this.a=_.ri()}getPlayerName(){return _.pa}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.l.isLive()?0:1E3*this.l.getDuration()}getCurrentPosition(){return 1E3*this.l.getPosition()}getCurrentBitrate(){const a=this.l.getStats();return(a?a.streamBandwidth:0)/1E3}};var PK=class extends _.Zp{constructor(){super();this.h=this.f=this.a=this.g=this.l=null;this.j=new _.mo}onPlayerCreated(a){this.l=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(JK())return a.onError(new _.H(1,9,11E3));KK(this,c);MK(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}));NK(this,void 0)}else b.url=d.getURL(),this.f=new OK(this.l,
4
+ this.h),this.f.init()})}}T(a){a=a.detail;if(7003===a.code)NK(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.F)switch(a.category){case 3:NK(this,SmartLib.BPDecodingError);break;case 1:NK(this,SmartLib.BPNetworkingError);break;case 6:NK(this,SmartLib.BPAccessRightError);break;default:NK(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){JK()||NK(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.x("clpp.broadpeak.BroadpeakPlugin",PK);PK.isSdkMissing=JK;PK.Id="broadpeak";
5
+ _.Km(new class{create(){return new PK}});};f.call(g, window);