@castlabs/prestoplay 6.2.6-rc-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/README +48 -0
  2. package/cjs/cl.adobe.js +8 -0
  3. package/cjs/cl.airplay.js +8 -0
  4. package/cjs/cl.broadpeak.js +11 -0
  5. package/cjs/cl.cast.js +111 -0
  6. package/cjs/cl.conviva.js +37 -0
  7. package/cjs/cl.core.js +420 -0
  8. package/cjs/cl.crypto.js +15 -0
  9. package/cjs/cl.dash.js +73 -0
  10. package/cjs/cl.externs.js +3870 -0
  11. package/cjs/cl.freewheel.js +29 -0
  12. package/cjs/cl.hls.js +48 -0
  13. package/cjs/cl.hlssmpte.js +11 -0
  14. package/cjs/cl.htmlcue.js +35 -0
  15. package/cjs/cl.ima.js +28 -0
  16. package/cjs/cl.mse.js +263 -0
  17. package/cjs/cl.muxdata.js +16 -0
  18. package/cjs/cl.onboard.js +8 -0
  19. package/cjs/cl.persistent.js +19 -0
  20. package/cjs/cl.playlist.js +10 -0
  21. package/cjs/cl.smooth.js +75 -0
  22. package/cjs/cl.thumbnails.js +28 -0
  23. package/cjs/cl.tizen.js +76 -0
  24. package/cjs/cl.ttml.js +31 -0
  25. package/cjs/cl.verimatrix.js +10 -0
  26. package/cjs/cl.vimond.js +18 -0
  27. package/cjs/cl.vtt.js +19 -0
  28. package/cjs/cl.youbora.js +23 -0
  29. package/cjs/polyfill.min.js +47 -0
  30. package/cl.adobe.js +3 -0
  31. package/cl.airplay.js +3 -0
  32. package/cl.broadpeak.js +5 -0
  33. package/cl.cast.js +83 -0
  34. package/cl.conviva.js +27 -0
  35. package/cl.core.js +364 -0
  36. package/cl.crypto.js +9 -0
  37. package/cl.dash.js +62 -0
  38. package/cl.externs.js +3798 -0
  39. package/cl.freewheel.js +19 -0
  40. package/cl.hls.js +36 -0
  41. package/cl.hlssmpte.js +5 -0
  42. package/cl.htmlcue.js +24 -0
  43. package/cl.ima.js +16 -0
  44. package/cl.mse.js +224 -0
  45. package/cl.muxdata.js +9 -0
  46. package/cl.onboard.js +4 -0
  47. package/cl.persistent.js +11 -0
  48. package/cl.playlist.js +4 -0
  49. package/cl.smooth.js +58 -0
  50. package/cl.thumbnails.js +17 -0
  51. package/cl.tizen.js +57 -0
  52. package/cl.ttml.js +21 -0
  53. package/cl.verimatrix.js +4 -0
  54. package/cl.vimond.js +8 -0
  55. package/cl.vtt.js +12 -0
  56. package/cl.youbora.js +15 -0
  57. package/clpp.styles.css +147 -0
  58. package/package.json +43 -0
@@ -0,0 +1,75 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var sE="Full MP4 box must have flags defined",tE="clpp.smooth.SmoothMP4Processor",uE="codecPrivateData",vE=function(a,b){var c=Math.floor(b/Math.pow(2,32)),d=b-c*Math.pow(2,32);_.R(a,c);_.R(a,d)},wE=function(a,b){try{a.f.setUint8(a.a,b),a.a+=1}catch(c){_.xj()}},xE=function(a,b){wE(a,b>>16&255);wE(a,b>>8&255);wE(a,b&255)},yE=function(a,b){try{a.f.setUint16(a.a,b,a.g),a.a+=2}catch(c){_.xj()}},zE=function(a,b){try{a.f.setInt32(a.a,b,a.g),a.a+=4}catch(c){_.xj()}},AE=function(a,b){try{a.f.setInt16(a.a,
3
+ b,a.g),a.a+=2}catch(c){_.xj()}},BE=function(a,b){if(void 0!=b){for(var c=new Uint8Array(b),d=Math.min(a.length,b),e=0;e<d;++e)c[e]=a.charCodeAt(e);for(;e<b;e++)c[e]=0;return c}c=new Uint8Array(a.length);for(d=0;d<a.length;++d)c[d]=a.charCodeAt(d);return c},V=function(a){this.type=a;this.size=this.start=0;this.parent=null;this.w=!1;this.entries=[];this.f=[]},W=function(a,b,c){V.call(this,a);this.version=b;this.flags=c},CE=function(a,b,c){V.call(this,a);this.g=b;this.offset=c},DE=function(a,b,c,d,e){W.call(this,
4
+ a,b,c);this.g=d;this.offset=e},EE=function(a,b,c){V.call(this,"ftyp");this.h=a;this.If=b;this.g=c},FE=function(){V.call(this,_.rd)},GE=function(){V.call(this,_.ve)},HE=function(a,b,c){W.call(this,"mvhd",1,0);this.timescale=a;this.duration=b;this.volume=256;this.h=c+1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},IE=function(){V.call(this,"mvex")},JE=function(a){W.call(this,"trex",0,0);this.g=a},KE=function(a,b,c,d,e){W.call(this,"tkhd",1,7);this.h=a;this.duration=
5
+ b;this.timescale=c;this.width=d;this.height=e;this.volume=1;this.g=[0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0]},LE=function(a,b){W.call(this,"mdhd",1,0);this.timescale=a;this.duration=b;this.language=21956},ME=function(a){W.call(this,"hdlr",0,0);this.g=a},NE=function(){W.call(this,"vmhd",0,1);this.g=new Uint8Array([0,0,0,0,0,0])},OE=function(a){V.call(this,a);this.w=!0},PE=function(a){OE.call(this,a);this.height=this.width=0},QE=function(a,b,c,d){OE.call(this,a);this.channelCount=
6
+ b;this.sampleSize=c;this.sampleRate=d},RE=function(a,b){PE.call(this,"avc1");this.width=a;this.height=b},SE=function(a,b){RE.call(this,a,b);this.type="encv"},TE=function(a,b,c){QE.call(this,"mp4a",a,b,c)},UE=function(a,b,c){TE.call(this,a,b,c);this.type="enca"},VE=function(a,b){V.call(this,"avcC");this.Fa=a;this.Lb=b;this.version=1;this.g=this.Fa[0][1];this.h=this.Fa[0][2];this.level=this.Fa[0][3]},WE=function(a){W.call(this,"esds",0,0);this.Eb=a},XE=function(a){a=void 0===a?"":a;W.call(this,"url ",
7
+ 0,1);this.location=a},YE=function(){W.call(this,"dref",0,0)},ZE=function(){V.call(this,_.ke)},$E=function(){W.call(this,_.me,0,0)},aF=function(){W.call(this,"stts",0,0)},bF=function(){W.call(this,"stsc",0,0)},cF=function(){W.call(this,"stco",0,0)},dF=function(){W.call(this,"stsz",0,0)},eF=function(){W.call(this,"smhd",0,0)},fF=function(){V.call(this,"dinf")},gF=function(){V.call(this,_.qd)},hF=function(){V.call(this,_.md)},iF=function(a,b){W.call(this,"tfdt",a,0);this.g=b},jF=function(){W.call(this,
8
+ "mfhd",0,0);this.g=0},kF=function(a,b){W.call(this,"trun",a,b);this.m=this.j=this.g=0;this.o=[];this.sampleSize=[];this.A=[];this.h=[]},lF=function(a,b){W.call(this,"tfhd",a,b);this.g=255;this.m=this.o=this.j=this.A=this.h=0},mF=function(){V.call(this,"traf")},nF=function(){V.call(this,"moof")},oF=function(){V.call(this,_.ld);this.g=new Uint8Array(0)},pF=function(){W.call(this,"tenc",0,0);this.g=1;this.h=8;this.m="";this.j=[]},qF=function(a,b){W.call(this,"schm",0,0);this.g=a;this.h=b;this.yb=""},
9
+ rF=function(a){V.call(this,"frma");this.g=a},sF=function(){W.call(this,"saio",0,0);this.offset=[0]},tF=function(a,b,c){W.call(this,"saiz",0,0);this.g=a;this.j=b;this.h=c},uF=function(a,b){W.call(this,"senc",a,b);this.h=0;this.j=8;this.g=[]},vF=function(a){var b=a.split("/");return b[b.length-1].toLowerCase().match("manifest(\\(.+\\))?")?a:a+"/Manifest"},wF=function(a,b,c,d){c=b.xf[c];b=b.Fj;a=a.replace("Manifest","");b=b.replace("{bitrate}",String(d.bitrate)).replace("{Bitrate}",String(d.bitrate)).replace("{start time}",
10
+ String(c.t)).replace("{start_time}",String(c.t));return _.Tt([a],[b])[0]},xF=function(a,b){if(a.type!==b.type)return!1;var c=[];a.type===_.Ge?c=["maxWidth","maxHeight","bitrate",uE,"fourCC"]:a.type===_.Zb&&(c=["bitrate",uE,"channels","bitsPerSample","samplingRate","fourCC"]);return _.H.Oa(a,b,c,["id","segmentIndex"])},yF=function(a,b,c){var d=c.nd.split("00000001");a={id:1,type:c.type,duration:a/b,timescale:b,Fa:null,Lb:null,width:NaN,height:NaN,Eb:null,Zc:NaN,sampleSize:NaN,channelCount:NaN};switch(c.type){case _.Ge:a.Fa=
11
+ [_.gj(d[1])];a.Lb=[_.gj(d[2])];a.width=c.maxWidth;a.height=c.maxHeight;break;case _.Zb:a.Eb=_.gj(c.nd),a.sampleSize=c.Bg||16,a.Zc=c.Zc,a.channelCount=c.cf}return a},zF=function(a,b){return a.filter(function(c){return c.type===b})},AF=function(a,b){var c=a.exec(b);return null==c||""==c[0]?null:(Number(c[4])||0)/1E3+(Number(c[3])||0)+60*(Number(c[2])||0)+3600*(Number(c[1])||0)},HF=function(a,b,c){var d=null;if(BF.test(a)){a=BF.exec(a);d=Number(a[1]);var e=Number(a[2]),f=Number(a[3]),g=Number(a[4]);
12
+ g+=(Number(a[5])||0)/c.f;f+=g/c.frameRate;d=f+60*e+3600*d}else CF.test(a)?d=AF(CF,a):DF.test(a)?d=AF(DF,a):EF.test(a)?(a=EF.exec(a),d=Number(a[1])/c.frameRate):FF.test(a)?(a=FF.exec(a),d=Number(a[1])/c.a):GF.test(a)&&(d=AF(GF,a));d+=b;b=Math.floor(d/3600);c=Math.floor((d-3600*b)/60);a=Math.floor(d-3600*b-60*c);d-=a;10>b&&(b="0"+b);10>c&&(c="0"+c);10>a&&(a="0"+a);0===d?d="000":d=Math.round(1E3*d);return b+":"+c+":"+a+"."+d},IF=function(a,b,c,d){this.frameRate=Number(a)||30;this.f=Number(b)||1;this.a=
13
+ Number(d);0==this.a&&(this.a=a?this.frameRate*this.f:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=parseInt(a[1],10)/parseInt(a[2],10))},KF=function(a){this.a=a;this.f=JF(this)},JF=function(a){for(var b=0,c=0;c<a.a.length;c++)b+=a.a[c].a();return new _.wj(b)},LF=function(a){var b=_.gi();a="ie"===b.browser||"edge"===b.browser?a.fe(_.Ec):a.fe(_.Fc);null===a&&(_.B(tE,"Could not get PSSH box!"),a={initData:new Uint8Array(0),initDataType:_.pc,keyId:"",periodId:null});return a},MF=function(a,b,c){var d=
14
+ LF(c);c=new V("xxxx");a.type===_.Ge?c=new SE(a.width,a.height):c=new UE(a.channelCount,a.sampleSize,a.Zc);a=new pF;a.g=1;a.h=8;a.m=d.keyId||"00000000000000000000000000000000";a=(new V("schi")).append([a]);b=(new V("sinf")).append([new rF(b),new qF(_.pc,65536),a]);c.append([b]);return c},NF=function(a,b){var c=b.yd(),d=new HE(a.timescale,a.duration,a.id),e=(new IE).append([new JE(a.id)]),f=new KE(a.id,a.duration,a.timescale,a.width,a.height),g=new LE(a.timescale,a.duration),k=new ME(a.type),l=null,
15
+ m=new YE;m.entries=[new XE];var n=new $E;switch(a.type){case _.Ge:var p=new VE(a.Fa,a.Lb);c?(l=MF(a,"avc1",b),l.append([p]),n.entries=[l]):(l=(new RE(a.width,a.height)).append([p]),n.entries=[l]);l=new NE;break;case _.Zb:p=new WE(a.Eb),c?(l=MF(a,"mp4a",b),l.append([p]),n.entries=[l]):(l=(new TE(a.channelCount,a.sampleSize,a.Zc)).append([p]),n.entries=[l]),l=new eF}n=(new ZE).append([n,new aF,new bF,new dF,new cF]);m=(new fF).append([m]);m=(new gF).append([l,m,n]);g=(new hF).append([g,k,m]);f=(new GE).append([f,
16
+ g]);d=(new FE).append([d,f,e]);e=new EE("dash",0,["iso6","mp41","avc1"]);c&&(c=LF(b).initData,d.append([new CE("pssh",c,8)]));c=new KF([e,d]);return _.Q(c.write())},PF=function(a,b){var c,d,e,f,g,k;(new _.pk).L("moof",_.qk).U("mfhd",function(m){var n=new jF;n.g=_.Dj(m.F);c=n}).L("traf",_.qk).U("tfhd",function(m){var n=m.F.Aa();if(null===m.flags)throw new _.J(_.K,3,3019,sE);var p=new lF(m.version||0,m.flags||0);p.g=_.Dj(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.h=_.Fj(m.F));0<n-m.F.getPosition()&&
17
+ m.flags&2&&(p.A=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&8&&(p.j=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&16&&(p.o=_.Dj(m.F));0<n-m.F.getPosition()&&m.flags&32&&(p.m=_.Dj(m.F));d=p}).U("trun",function(m){var n=m.F.Aa();if(null===m.flags)throw new _.J(_.K,3,3019,sE);var p=new kF(m.version||0,m.flags||0);p.g=_.Dj(m.F);0<n-m.F.getPosition()&&m.flags&1&&(p.j=_.Ej(m.F));0<n-m.F.getPosition()&&m.flags&4&&(p.m=_.Dj(m.F));if(0<n-m.F.getPosition())for(n=0;n<p.g;n++)m.flags&256&&p.o.push(_.Dj(m.F)),m.flags&
18
+ 512&&p.sampleSize.push(_.Dj(m.F)),m.flags&1024&&p.A.push(_.Dj(m.F)),m.flags&2048&&(0===m.version?p.h.push(_.Dj(m.F)):p.h.push(_.Ej(m.F)));e=p}).U("sdtp",function(m){var n=_.Gj(m.F,m.F.Aa());f=new DE("sdtp",m.version||0,m.flags||0,n,0)}).L("uuid",function(m){var n=_.Gj(m.F,16);if(_.ij(n,OF)){n=_.Dj(m.F);m.version=n>>>24;m.flags=n&16777215;n=new uF(m.version,m.flags);n.h=_.Dj(m.F);m.flags&1&&(n.j=_.Ct(m.F));for(var p=0;p<n.h;p++){var q={Bf:_.Gj(m.F,8),Ic:0,Oe:[]};if(m.flags&2){q.Ic=_.Cj(m.F);for(var r=
19
+ 0;r<q.Ic;r++){var x={af:0,bf:0};x.af=_.Cj(m.F);x.bf=_.Dj(m.F);q.Oe.push(x)}}n.g.push(q)}g=n}}).L(_.ld,function(m){var n=new oF;0<m.F.Aa()?n.g=_.Gj(m.F,m.F.Aa()):(_.B(tE,"mdat box is empty!"),n.g=new Uint8Array(0));k=n}).parse(a,!1);if(!k)return null;var l=(new mF).append([d,e]);f&&l.append([f]);b.yd()&&g&&l.append([g]);l=(new nF).append([c,l]);return new KF([l,k])},QF=function(a,b,c){var d=c.yd(),e=a.request.startTime,f=parseInt(e*b,10);b=a.data||new ArrayBuffer(0);var g=PF(b,c);if(null===g)return a.request.contentType===
20
+ _.re?a.data:g;c=g.get(_.ld);if(a.request.contentType===_.re){d=c.g.buffer;if(e){d=_.Tg(d);if((d=(new DOMParser).parseFromString(d,_.te))&&"tt"===d.documentElement.tagName.toLowerCase())var k=d.documentElement;if(k&&(c=new IF(k.getAttribute("ttp:frameRate"),k.getAttribute("ttp:subFrameRate"),k.getAttribute("ttp:frameRateMultiplier"),k.getAttribute("ttp:tickRate")),k=k.getElementsByTagName("body")[0]))for(k=k.getElementsByTagName("p"),a=0,b=k.length;a<b;a++){f=k[a];g=["begin",_.Tc];for(var l=0,m=g.length;l<
21
+ m;l++){b:{var n=f;var p=g[l],q=new RegExp("\\w+:"+p),r=0;if(n.hasAttribute(p))n=n.getAttribute(p);else{p=n.attributes;for(var x=p.length;r<x;r++){var y=p[r].name;if(y=y.match(q)){n=n.getAttribute(y[0]);break b}}n=null}}f.setAttribute(g[l],HF(n||"",e,c))}}d=(new XMLSerializer).serializeToString(d);e=_.Ug(d).buffer}else e=d;return e}k=new nF;a=g.get("mfhd");b=new mF;l=g.get("tfhd");m=new iF(1,f);f=g.get("trun");n=g.get("sdtp");e=g.get("senc");l.g=1;l.flags&=16777214;l.flags|=131072;b.append([l,m,f]);
22
+ n&&b.append([n]);if(d){g=0;l=[];if(e.flags&2)for(l=[],m=0;m<e.h;m++)l.push(10+6*e.g[m].Ic);else g=8;b.append([e,new sF,new tF(g,l,e.h)])}k.append([a,b]);f.flags|=1;f.j=k.a()+8;c=new KF([k,c]);k=c.write();d&&(d=c.get("saio"),c=c.f,d.offset[0]=e.start+16,c.seek(d.start),d.write(c),k=c.buffer);return k},RF=function(a,b,c){return{keySystem:a,licenseServerUri:"",distinctiveIdentifierRequired:!1,persistentStateRequired:!1,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[b],keyIds:c,
23
+ periodId:null}},SF=function(a,b,c){a=_.pu(a);c&&a.version!==c&&(a=_.nu(a,c));return{initData:_.gu(a),initDataType:_.pc,keyId:b,periodId:null}},UF=function(){this.B=this.j=this.h=this.g=null;this.M=1;this.T=0;this.o="";this.w=this.a=null;this.f=new _.C("clpp.smooth.SmoothParser");this.J=!1;this.m=this.C=null;this.P=TF;this.H=0;this.D=this.I=Infinity;this.A=[];this.K=this.qj.bind(this)},VF=function(a,b){var c,d,e;return _.z(function(f){if(1==f.a)return c=_.fh(b),c.timeout=a.h.attemptParameters.timeout,
24
+ c.maxAttempts=Math.max(a.h.attemptParameters.maxAttempts,b.length),c.baseDelay=a.h.attemptParameters.baseDelay,c.backoffFactor=a.h.attemptParameters.backoffFactor,c.fuzzFactor=a.h.attemptParameters.fuzzFactor,c.type=1,d=a.g.networkingEngine.fetch(c),_.v(f,d.N,2);e=f.f;a.o=e.uri;return f["return"](e)})},bG=function(a,b){var c=null;try{var d=new DOMParser;try{var e=_.Tg(b);var f=d.parseFromString(e.trim(),_.te)}catch(PA){throw PA;}if(f&&f.documentElement.tagName==_.kb)var g=f.documentElement;c=g&&0<
25
+ g.getElementsByTagName("parsererror").length?null:g}catch(PA){}if(!c)throw a.f.error("Unable to parse manifest"),new _.J(_.K,4,4033,a.o);var k=+WF(a,c,"MajorVersion"),l=+WF(a,c,"MinorVersion"),m=+c.getAttribute("TimeScale")||1E7,n=+WF(a,c,"Duration"),p="TRUE"===c.getAttribute("IsLive"),q=+c.getAttribute("LookAheadCount"),r=+c.getAttribute("DVRWindowLength")||Infinity,x=_.au(c,"Protection")[0];if(!1===/^[2].[0-2]$/.test(""+k+"."+l))throw a.f.error("Smooth Streaming version must be 2.0, 2.1 or 2.2"),
26
+ new _.J(_.K,4,4036,a.o);p?(XF(a,YF),a.C=typeof a.h.liveRefreshPeriod===_.zd?1E3*a.h.liveRefreshPeriod:Math.min(1E3*a.H,1E4),n=Infinity):XF(a,TF);a.a={startTime:0,delay:0,duration:n/m,ae:r/m,Vc:0};if(x){var y=a.h.playreadyVersion,E=[],I=_.au(x,"ProtectionHeader")[0],F=_.fj(_.cu(I)||""),G=_.pu(F).a;E.push(RF(_.Fc,{initData:_.gu(_.ju(G)),initDataType:_.pc,keyId:G,periodId:null},[G]));E.push(RF(_.Ec,SF(F,G,y),[G]));a.A=E}var M=[],O=_.au(c,"StreamIndex");if(!O.length)throw a.f.error("No streams found!"),
27
+ new _.J(_.K,4,4034,a.o);for(var T=0;T<O.length;T++){for(var Ma,ea=a,na=O[T],ya=WF(ea,na,"Type"),Aa=+na.getAttribute("Chunks"),Ra=na.getAttribute("Subtype"),Sa=_.rh(na.getAttribute("Language")||_.xe),xa=na.getAttribute("Name")||"",ib=+na.getAttribute(_.Oa),eb=+na.getAttribute(_.Na),Bb=WF(ea,na,"Url"),ud=+na.getAttribute("TimeScale")||null,Di=[],vc=_.au(na,_.ab),Qf=0;Qf<vc.length;Qf++){var Ze=ea,Vc=vc[Qf],zr=ya,BJ=+Vc.getAttribute("Index"),CJ=+WF(Ze,Vc,"Bitrate"),SA=NaN,TA=NaN,hm=NaN,Ar=NaN,UA=NaN,
28
+ VA=NaN,WA=NaN,XA=Vc.getAttribute("FourCC");switch(zr){case _.Ge:SA=+WF(Ze,Vc,_.Na);TA=+WF(Ze,Vc,_.Oa);break;case _.Zb:Ar=+Vc.getAttribute("Channels")||2,hm=+WF(Ze,Vc,"SamplingRate"),VA=+WF(Ze,Vc,"AudioTag"),UA=+WF(Ze,Vc,"BitsPerSample"),WA=+WF(Ze,Vc,"PacketSize")}var Br=String(Vc.getAttribute("CodecPrivateData"));if(zr===_.Zb&&!Br){var YA=Ar,ZA={96E3:0,88200:1,64E3:2,48E3:3,44100:4,32E3:5,24E3:6,22050:7,16E3:8,12E3:9,11025:10,8E3:11,7350:12},im=ZA[hm];if("AACH"===XA){var fc=new Uint8Array(4);var $A=
29
+ ZA[2*hm];fc[0]=40|im>>1;fc[1]=im<<7|YA<<3|$A>>1;fc[2]=$A<<7|8;fc[3]=0;var Tf=new Uint16Array(2);Tf[0]=(fc[0]<<8)+fc[1];Tf[1]=(fc[2]<<8)+fc[3];var aB=Tf[0].toString(16)+Tf[1].toString(16)}else fc=new Uint8Array(2),fc[0]=16|im>>1,fc[1]=im<<7|YA<<3,Tf=new Uint16Array(1),Tf[0]=(fc[0]<<8)+fc[1],aB=Tf[0].toString(16);Br=aB.toUpperCase()}var DJ={id:Ze.T++,type:zr,index:BJ,bitrate:CJ,nd:Br,maxHeight:SA,maxWidth:TA,Zc:hm,cf:Ar,Wj:VA,Bg:UA,fk:WA,$h:XA,fb:null};Di.push(DJ)}Ma=Di;for(var je=[],bB=_.au(na,"c"),
30
+ Ti=0;Ti<bB.length;Ti++){var Cr=bB[Ti],vd=parseInt(Cr.getAttribute("t"),10),ih=parseInt(Cr.getAttribute("d"),10),Dr=parseInt(Cr.getAttribute("r"),10),Ui=0;if(isNaN(vd)&&isNaN(ih))throw ea.f.error("Either one or both FragmentDuration and FragmentTime field MUST be present in StreamFragmentElement"),new _.J(_.K,4,4037,ea.o);0===Ti&&isNaN(vd)&&(Ui=vd=0);if(0<Ti){var Uf=je[je.length-1];Ui=Uf.n+1;Uf.d||(Uf.d=vd-Uf.t);vd||(vd=Uf.t+Uf.d);ih||(ih=vd-Uf.t)}je.push({n:Ui,d:ih,t:vd});if(Dr){Dr--;for(var cB=0;cB<
31
+ Dr;cB++){var jm=je[je.length-1];Ui=jm.n+1;vd=jm.t+jm.d;ih=jm.d;je.push({n:Ui,d:ih,t:vd})}}}ea.Qc()||je.length===Aa||ea.f.warn("Number of fragments ("+Aa+") differs from number of chunks ("+je.length+").");M.push({type:ya,Xj:Aa,zj:Ra,language:Sa,name:xa,maxWidth:ib,maxHeight:eb,Fj:Bb,tracks:Ma,xf:je,timescale:ud})}var $e={dk:k,If:l,timescale:m,duration:n,isLive:p,ck:q,ae:r,me:!1,streams:M};if(a.j&&a.B)return ZF(a,$e),Promise.resolve();var Er=$e.timescale,Fr=$e.duration,FJ=zF($e.streams,_.Zb),GJ=zF($e.streams,
32
+ _.Ge),HJ=zF($e.streams,_.re),dB=[],km=$F(a,Fr,Er,FJ),lm=$F(a,Fr,Er,GJ),IJ=$F(a,Fr,Er,HJ);km.length||(km=[null]);lm.length||(lm=[null]);for(var Hr=0;Hr<lm.length;Hr++)for(var Ir=0;Ir<km.length;Ir++)dB.push(aG(a,lm[Hr],km[Ir]));var eB={startTime:0,variants:dB,textStreams:IJ,thumbStreams:[]};var KJ=$e.streams,Jr=a.a.startTime,fB=a.a.delay,Kr=a.I,gB=Math.min(a.a.duration||Infinity,Kr),Lr=a.Qc(),LJ=a.a.ae,MJ=a.a.Vc,hB=a.H,iB=isFinite(a.D)?a.D:0;if(Lr)gB=Infinity,Jr=Date.now()/1E3-MJ,a.a.startTime=Jr,fB=
33
+ 3*hB;else for(var NJ=isFinite(Kr)?Kr:a.a.duration,jB=_.t(KJ),Mr=jB.next();!Mr.done;Mr=jB.next())for(var kB=_.t(Mr.value.tracks),Nr=kB.next();!Nr.done;Nr=kB.next()){var lB=Nr.value;lB.fb.offset(-iB);_.Ju(lB.fb,NJ)}a.w=new _.xu(Jr,fB,!0);a.w.f=!Lr;a.w.Pb(gB);_.Au(a.w,hB);a.w.hc=LJ;Lr||a.w.offset(-iB);a.g.filterAllPeriods([eB]);a.j={presentationTimeline:a.w,periods:[eB],offlineSessionIds:[],minBufferTime:0};Promise.resolve();a.J||(a.g.networkingEngine.Td(a.K),a.J=!0);a.B=$e;return Promise.resolve()},
34
+ ZF=function(a,b){for(var c=0;c<a.B.streams.length;c++)for(var d=b.streams[c],e={},f=_.t(a.B.streams[c].tracks),g=f.next();!g.done;e={Db:e.Db},g=f.next())if(e.Db=g.value,g=d.tracks.find(function(l){return function(m){return m.type===l.Db.type&&m.bitrate===l.Db.bitrate}}(e))){xF(e.Db,g)||a.f.warn("The current stream is updated with a stream that seems to have different base properties!");var k=cG(a,a.B.timescale,d,g);g=e.Db.fb;g.Sa(k);(k=a.a.ae)&&_.Iu(g,(g.a.length?g.a[g.a.length-1].endTime:0)-k)}else a.f.warn("Cannot find satisfying update for "+
35
+ e.Db.type+" track with bitrate "+(e.Db.bitrate+". Skipping update."))},$F=function(a,b,c,d){for(var e=[],f={qc:0};f.qc<d.length;f={qc:f.qc},f.qc++){var g=d[f.qc].tracks.map(function(k){return function(l){var m=d[k.qc],n=cG(a,c,m,l),p=new _.Hu(n),q=null;m.type!==_.re&&(q=dG(a,b,c,m,l));l.fb=p;n=a.M++;var r=Promise.resolve.bind(Promise),x=p.Pc.bind(p),y=p.get.bind(p),E=p.Kc.bind(p);p=p.getDuration.bind(p);var I=eG[m.type],F="";switch(m.type){case _.Ge:F=l.nd;var G=/00000001[0-9]7/.exec(F);F="avc1."+
36
+ (G&&G[0]?F.substr(F.indexOf(G[0])+10,6):"42c00c");a.f.debug("VIDEO CODECS: ",F);break;case _.Zb:F=l.nd,G=2,"AACH"===l.$h?G=5:F&&(G=(parseInt(F.substr(0,2),16)&248)>>3),F="mp4a.40."+G,a.f.debug("AUDIO CODECS: ",F)}G=m.type===_.re?fG[m.zj]:void 0;return{id:n,originalId:null,hk:null,createSegmentIndex:r,findSegmentPosition:x,getSegmentReference:y,adjustSegmentDurations:E,getDuration:p,initSegmentReference:q,mimeType:I,codecs:F,frameRate:void 0,bandwidth:l.bitrate,width:l.maxWidth||void 0,height:l.maxHeight||
37
+ void 0,kind:G,encrypted:a.oe(),keyId:null,language:m.language,label:m.name,type:m.type,primary:!1,trickModeVideo:null,emsgSchemeIdUris:null,roles:[],channelsCount:l.cf||null,closedCaptions:null}}}(f));e=e.concat(g)}return e},cG=function(a,b,c,d){var e=0,f=[],g=c.timescale||b;c.xf.forEach(function(k,l){var m=k.d/g;if(0===l){var n=k.t/g;a.D=Math.min(a.D,n)}else n=f[l-1].endTime;var p=n+m,q=wF(a.o,c,l,d);a.H=Math.max(a.H,m);f.push(new _.wu(l,n,p,function(){return[q]},0,null,0,null,!0,g));e+=m});if(c.type===
38
+ _.Ge||c.type===_.Zb)b=f[f.length-1],a.I=Math.min(a.I,e),0===a.a.Vc?a.a.Vc=b.endTime:a.a.Vc=Math.min(a.a.Vc,b.endTime);return f},dG=function(a,b,c,d,e){b=yF(b,d.timescale||c,e);c={isLive:a.Qc.bind(a),yd:a.oe.bind(a),ei:function(){return 1},fe:a.zf.bind(a)};d=new Uint8Array(0);try{d=NF(b,c)}catch(g){throw a.f.error("Failed to generate initialization segment."),new _.J(_.K,3,4035,g);}var f="data:text/plain;base64,"+_.ej(d);return new _.vu(function(){return[f]},0,null,null,!0)},aG=function(a,b,c){var d=
39
+ (c?c.bandwidth:0)+(b?b.bandwidth:0),e=c?c.language:_.xe;return c||b?{id:a.M++,language:e,primary:!1,audio:c,video:b,bandwidth:d,drmInfos:a.A,allowedByApplication:!0,allowedByKeySystem:!0}:null},WF=function(a,b,c){if(b=b.getAttribute(c))return b;a.f.error("required attribute not provided: "+c);throw new _.J(_.K,4,4038,a.o,c);},gG=function(a,b){null!=a.C&&null!=b&&(a.m=window.setTimeout(a.yh.bind(a),b))},XF=function(a,b){var c=b===TF;a.j&&a.j.presentationTimeline&&(a.j.presentationTimeline.f=c);c&&
40
+ null!=a.m&&(window.clearTimeout(a.m),a.m=null,a.C=null);a.P=b},hG=function(){};V.prototype.append=function(a){a=void 0===a?[]:a;for(var b=0;b<a.length;b++)this.f.push(a[b]),a[b].parent=this;return this};V.prototype.get=function(a){if(this.type===a)return this;for(var b=0;b<this.f.length;b++){if(this.f[b].type===a)return this.f[b];var c=this.f[b].get(a);if(c)return c}return null};
41
+ V.prototype.a=function(){var a=Math.pow(2,32)-1;var b=4+this.type.length;"uuid"===this.type&&(b+=16);if(0<this.f.length)for(var c=0;c<this.f.length;c++)b+=this.f[c].a();this.size>a&&(b+=8);return b};
42
+ V.prototype.write=function(a){var b=Math.pow(2,32)-1;this.start=a.getPosition();this.size=this.a();this.size>b?_.R(a,1):_.R(a,this.size);_.yj(a,BE(this.type));this.size>b&&vE(a,this.size);"uuid"===this.type&&_.yj(a,null);if(0<this.f.length&&!this.w)for(b=0;b<this.f.length;b++)this.f[b].write(a),this.f[b].a(),a.getPosition()};_.u(W,V);W.prototype.a=function(){return 4+V.prototype.a.call(this)};W.prototype.write=function(a){V.prototype.write.call(this,a);wE(a,this.version);xE(a,this.flags)};
43
+ _.u(CE,V);CE.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)-this.offset};CE.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,this.g,this.offset);a.getPosition()};_.u(DE,W);DE.prototype.a=function(){return this.g.byteLength+W.prototype.a.call(this)-this.offset};DE.prototype.write=function(a){W.prototype.write.call(this,a);_.yj(a,this.g,this.offset);a.getPosition()};_.u(EE,V);
44
+ EE.prototype.a=function(){var a=this.h.length;a=a+4+this.g.join("").length;return a+V.prototype.a.call(this)};EE.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,BE(this.h));_.R(a,this.If);_.yj(a,BE(this.g.join("")));a.getPosition()};_.u(FE,V);_.u(GE,V);_.u(HE,W);HE.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;a=a+44+this.g.length;return a+=W.prototype.a.call(this)};
45
+ HE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.timescale),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));_.R(a,65536);yE(a,this.volume);yE(a,0);_.R(a,0);_.R(a,0);for(var b=0;b<this.g.length;b++)wE(a,this.g[b]);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,0);_.R(a,this.h);a.getPosition()};_.u(IE,V);_.u(JE,W);JE.prototype.a=function(){return 20+W.prototype.a.call(this)};
46
+ JE.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);_.R(a,1);_.R(a,0);_.R(a,0);_.R(a,0);a.getPosition()};_.u(KE,W);KE.prototype.a=function(){var a=0;a=1===this.version?a+32:a+20;a=a+24+this.g.length;return a+W.prototype.a.call(this)};
47
+ KE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.h),_.R(a,0),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.h),_.R(a,0),_.R(a,this.duration*this.timescale));_.R(a,0);_.R(a,0);yE(a,0);yE(a,0);yE(a,this.volume);yE(a,0);for(var b=0;b<this.g.length;b++)wE(a,this.g[b]);yE(a,this.width);yE(a,0);yE(a,this.height);yE(a,0);a.getPosition()};_.u(LE,W);LE.prototype.a=function(){var a=0;a=1===this.version?a+28:a+16;return a+4+W.prototype.a.call(this)};
48
+ LE.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?(vE(a,0),vE(a,0),_.R(a,this.timescale),vE(a,this.duration*this.timescale)):(_.R(a,0),_.R(a,0),_.R(a,this.timescale),_.R(a,this.duration*this.timescale));yE(a,this.language);yE(a,0);a.getPosition()};_.u(ME,W);ME.prototype.a=function(){return 33+W.prototype.a.call(this)};
49
+ ME.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);this.g===_.Ge?_.yj(a,BE("vide")):_.yj(a,BE("soun"));_.R(a,0);_.R(a,0);_.R(a,0);this.g===_.Ge?_.yj(a,BE("VideoHandler\x00")):_.yj(a,BE("SoundHandler\x00"));a.getPosition()};_.u(NE,W);NE.prototype.a=function(){return 2+this.g.byteLength+W.prototype.a.call(this)};NE.prototype.write=function(a){W.prototype.write.call(this,a);yE(a,0);_.yj(a,this.g);a.getPosition()};_.u(OE,V);OE.prototype.a=function(){return 8+V.prototype.a.call(this)};
50
+ OE.prototype.write=function(a){V.prototype.write.call(this,a);_.R(a,0);yE(a,0);yE(a,1)};_.u(PE,OE);PE.prototype.a=function(){return 70+OE.prototype.a.call(this)};PE.prototype.write=function(a){OE.prototype.write.call(this,a);yE(a,0);yE(a,0);_.R(a,0);_.R(a,0);_.R(a,0);yE(a,this.width);yE(a,this.height);_.R(a,4718592);_.R(a,4718592);_.R(a,0);yE(a,1);wE(a,10);_.yj(a,BE("AVC Coding",31));yE(a,24);AE(a,-1)};_.u(QE,OE);QE.prototype.a=function(){return 20+OE.prototype.a.call(this)};
51
+ QE.prototype.write=function(a){OE.prototype.write.call(this,a);_.R(a,0);_.R(a,0);yE(a,this.channelCount);yE(a,this.sampleSize);AE(a,0);yE(a,0);yE(a,this.sampleRate);yE(a,0)};_.u(RE,PE);RE.prototype.write=function(a){PE.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(SE,RE);_.u(TE,QE);TE.prototype.write=function(a){QE.prototype.write.call(this,a);for(var b=0;b<this.f.length;b++)this.f[b].write(a);a.getPosition()};_.u(UE,TE);_.u(VE,V);
52
+ VE.prototype.a=function(){for(var a=7,b=0;b<this.Fa.length;b++)a+=2,a+=this.Fa[b].byteLength;for(b=0;b<this.Fa.length;b++)a+=2,a+=this.Lb[b].byteLength;return a+V.prototype.a.call(this)};
53
+ VE.prototype.write=function(a){V.prototype.write.call(this,a);wE(a,this.version);wE(a,this.g);wE(a,this.h);wE(a,this.level);wE(a,255);wE(a,224|this.Fa.length);for(var b=0;b<this.Fa.length;b++)yE(a,this.Fa[b].length),_.yj(a,this.Fa[b]);wE(a,this.Lb.length);for(b=0;b<this.Lb.length;b++)yE(a,this.Lb[b].length),_.yj(a,this.Lb[b]);a.getPosition()};_.u(WE,W);WE.prototype.a=function(){return 22+(this.Eb.byteLength+3)+W.prototype.a.call(this)};
54
+ WE.prototype.write=function(a){W.prototype.write.call(this,a);wE(a,3);wE(a,23+this.Eb.byteLength);yE(a,1);wE(a,0);wE(a,4);wE(a,15+this.Eb.byteLength);wE(a,64);wE(a,21);xE(a,0);_.R(a,0);_.R(a,0);wE(a,5);wE(a,this.Eb.byteLength);_.yj(a,this.Eb);_.yj(a,new Uint8Array([6,1,2]));a.getPosition()};_.u(XE,W);XE.prototype.a=function(){return this.location.length+W.prototype.a.call(this)};XE.prototype.write=function(a){W.prototype.write.call(this,a);0<this.location.length&&_.yj(a,BE(this.location));a.getPosition()};
55
+ _.u(YE,W);YE.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};YE.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(ZE,V);_.u($E,W);$E.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
56
+ $E.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(aF,W);aF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};aF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(bF,W);
57
+ bF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};bF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(cF,W);cF.prototype.a=function(){for(var a=4,b=0;b<this.entries.length;b++)a+=this.entries[b].a();return a+W.prototype.a.call(this)};
58
+ cF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.entries.length);for(var b=0;b<this.entries.length;b++)this.entries[b].write(a);a.getPosition()};_.u(dF,W);dF.prototype.a=function(){return 8+W.prototype.a.call(this)};dF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,0);_.R(a,0);a.getPosition()};_.u(eF,W);eF.prototype.a=function(){return 4+W.prototype.a.call(this)};eF.prototype.write=function(a){W.prototype.write.call(this,a);AE(a,0);yE(a,0);a.getPosition()};
59
+ _.u(fF,V);_.u(gF,V);_.u(hF,V);_.u(iF,W);iF.prototype.a=function(){var a=0;a=1===this.version?a+8:a+4;return a+W.prototype.a.call(this)};iF.prototype.write=function(a){W.prototype.write.call(this,a);1===this.version?vE(a,this.g):_.R(a,this.g);a.getPosition()};_.u(jF,W);jF.prototype.a=function(){return 4+W.prototype.a.call(this)};jF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);a.getPosition()};_.u(kF,W);
60
+ kF.prototype.a=function(){var a=4;this.flags&iG&&(a+=4);this.flags&jG&&(a+=4);for(var b=0;b<this.g;b++)this.flags&kG&&(a+=4),this.flags&lG&&(a+=4),this.flags&mG&&(a+=4),this.flags&nG&&(a+=4);return a+W.prototype.a.call(this)};
61
+ kF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&iG&&(a.getPosition(),zE(a,this.j));this.flags&jG&&_.R(a,this.m);for(var b=0;b<this.g;b++)this.flags&kG&&_.R(a,this.o[b]),this.flags&lG&&_.R(a,this.sampleSize[b]),this.flags&mG&&_.R(a,this.A[b]),this.flags&nG&&(0===this.version?_.R(a,this.h[b]):zE(a,this.h[b]));a.getPosition()};var iG=1,jG=4,kG=256,lG=512,mG=1024,nG=2048;_.u(lF,W);
62
+ lF.prototype.a=function(){var a=4;this.flags&oG&&(a+=8);this.flags&pG&&(a+=4);this.flags&qG&&(a+=4);this.flags&rG&&(a+=4);this.flags&sG&&(a+=4);return a+W.prototype.a.call(this)};lF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.g);this.flags&oG&&vE(a,this.h);this.flags&pG&&_.R(a,this.A);this.flags&qG&&_.R(a,this.j);this.flags&rG&&_.R(a,this.o);this.flags&sG&&_.R(a,this.m);a.getPosition()};var oG=1,pG=2,qG=8,rG=16,sG=32;_.u(mF,V);_.u(nF,V);_.u(oF,V);
63
+ oF.prototype.a=function(){return this.g.byteLength+V.prototype.a.call(this)};oF.prototype.write=function(a){V.prototype.write.call(this,a);0<this.g.byteLength&&_.yj(a,this.g)};_.u(pF,W);pF.prototype.a=function(){var a=20;1===this.g&&0===this.h&&(a=a+1+this.j.length);return a+W.prototype.a.call(this)};
64
+ pF.prototype.write=function(a){W.prototype.write.call(this,a);wE(a,0);0===this.version?wE(a,0):wE(a,0);wE(a,this.g);wE(a,this.h);_.yj(a,_.gj(this.m));if(1===this.g&&0===this.h){wE(a,0);for(var b=0;b<this.j.length;b++)wE(a,this.j[b])}a.getPosition()};_.u(qF,W);qF.prototype.a=function(){var a=8;this.flags&1&&(a+=BE(this.yb).byteLength);return a+W.prototype.a.call(this)};qF.prototype.write=function(a){W.prototype.write.call(this,a);_.yj(a,BE(this.g));_.R(a,this.h);this.flags&1&&_.yj(a,BE(this.yb));a.getPosition()};
65
+ _.u(rF,V);rF.prototype.a=function(){return BE(this.g).byteLength+V.prototype.a.call(this)};rF.prototype.write=function(a){V.prototype.write.call(this,a);_.yj(a,BE(this.g));a.getPosition()};_.u(sF,W);sF.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=4;for(var b=0;1>b;b++)a=0===this.version?a+4:a+8;return a+W.prototype.a.call(this)};
66
+ sF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));_.R(a,1);for(var b=0;1>b;b++)0===this.version?_.R(a,this.offset[b]):vE(a,this.offset[b]);a.getPosition()};_.u(tF,W);tF.prototype.a=function(){var a=0;this.flags&1&&(a+=8);a+=5;0===this.g&&(a+=this.j.length);return a+W.prototype.a.call(this)};
67
+ tF.prototype.write=function(a){W.prototype.write.call(this,a);this.flags&1&&(_.R(a,0),_.R(a,0));wE(a,this.g);_.R(a,this.h);if(0===this.g)for(var b=0;b<this.h;b++)wE(a,this.j[b]);a.getPosition()};_.u(uF,W);uF.prototype.a=function(){var a=4;this.flags&1&&(a+=1);for(var b=0;b<this.h;b++)if(a+=this.g[b].Bf.byteLength,this.flags&2){a+=2;for(var c=0;c<this.g[b].Ic;c++)a+=2,a+=4}return a+W.prototype.a.call(this)};
68
+ uF.prototype.write=function(a){W.prototype.write.call(this,a);_.R(a,this.h);this.flags&1&&wE(a,this.j);for(var b=0;b<this.h;b++)if(_.yj(a,this.g[b].Bf),this.flags&2){yE(a,this.g[b].Ic);for(var c=0;c<this.g[b].Ic;c++)yE(a,this.g[b].Oe[c].af),_.R(a,this.g[b].Oe[c].bf)}a.getPosition()};var BF=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,CF=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,DF=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,EF=/^(\d*\.?\d*)f$/,FF=/^(\d*\.?\d*)t$/,GF=/^(?:(\d*\.?\d*)h)?(?:(\d*\.?\d*)m)?(?:(\d*\.?\d*)s)?(?:(\d*\.?\d*)ms)?$/;KF.prototype.get=function(a){for(var b=0;b<this.a.length;b++){var c=this.a[b].get(a);if(c)return c}return null};KF.prototype.write=function(){this.f=JF(this);for(var a=0;a<this.a.length;a++)this.a[a].write(this.f);return this.f.buffer};var OF=new Uint8Array([162,57,79,82,90,155,79,20,162,68,108,66,124,100,141,244]);_.h=UF.prototype;_.h.configure=function(a){this.h=a};_.h.start=function(a,b){var c=this;this.g=b;var d=_.bf(new Set([a,vF(a)])).concat();return VF(this,d).then(function(e){return bG(c,e.data).then(function(){gG(c,c.C);return c.j})})};_.h.stop=function(){this.g&&this.g.networkingEngine.Ie(this.K);this.C=this.B=this.j=this.h=this.g=null;this.m&&(clearTimeout(this.m),this.m=null);this.J=!1;this.I=this.D=Infinity;return Promise.resolve()};
69
+ _.h.update=function(){var a=this;if(this.Qc())return VF(this,[this.o]).then(function(b){return bG(a,b.data).then(function(){return a.j})})["catch"](function(b){if(a.g)a.g.onError(b)})};_.h.onExpirationUpdated=function(){};_.h.yh=function(){var a=this;this.f.debug(_.ot);this.g&&(this.m=null,this.update().then(function(){gG(a,a.C)})["catch"](function(b){a.g&&(a.g.onError(b),1===b.severity&&gG(a,100))}))};_.h.Qc=function(){return this.P===YF};_.h.oe=function(){return 0<this.A.length};
70
+ _.h.zf=function(a){var b=null;if(this.A.length)for(var c=0;c<this.A.length;c++)if(this.A[c].keySystem===a){b=this.A[c].initData[0];break}return b};
71
+ _.h.qj=function(a){if(2!==a.request.type||a.uri.startsWith("data:"))return Promise.resolve(a);var b=a.request.timescale||this.B.timescale,c={isLive:this.Qc.bind(this),yd:this.oe.bind(this),ei:function(){return 1},fe:this.zf.bind(this)},d=!1,e=new _.J(_.K,3,4035,null),f=null;try{f=QF(a,b,c)}catch(g){d=!0,e.data=g,3E3===g.code&&(e.code=4039)}if(d||!f)return Promise.reject(e);a.data=f;return Promise.resolve(a)};var eG={video:_.Ie,audio:_.cc,text:_.Vb},TF="VOD",YF="LIVE",fG={Hj:"caption",Qj:_.yt};_.u(hG,_.ln);hG.prototype.Da=function(){_.ko.ism=UF;_.io[_.Wb]=UF};hG.prototype.va=function(){_.Ou("ism");_.Pu(_.Wb)};hG.prototype.id=function(){return"smooth"};_.A("clpp.smooth.SmoothComponent",hG);};
72
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
73
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
74
+ else{_=this.clpp._;(f.call(g,this));}
75
+ })();
@@ -0,0 +1,28 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var Yr="No thumbnail duration or URL specified",Zr="No thumbnail found for position ",$r="Position is out of range: ",as="Thumbnail URL is mandatory",bs="Wrong gridSize format",cs="clpp.thumbnails",ds=function(a,b,c,d,e,f,g,k,l,m,n,p){d=void 0===d?0:d;e=void 0===e?0:e;f=void 0===f?0:f;g=void 0===g?0:g;k=void 0===k?1:k;l=void 0===l?1:l;m=void 0===m?0:m;n=void 0===n?0:n;p=void 0===p?new Image:p;this.time=b;this.a=p;this.src=a;this.duration=c;this.x=d;this.y=e;this.width=f;this.height=g;this.g=k;this.m=
3
+ l;this.h=m;this.j=n;this.f=null},es=function(a,b){this.time=a;this.duration=0;this.offset=b;this.length=0;this.a=new _.Nh},fs=function(){this.g=new _.C(cs);this.f=new ArrayBuffer(0);this.a=[];this.h=new _.Nh},gs=function(a){var b=a.f.byteLength;a.a.forEach(function(c){c.offset+c.length<b&&c.a.resolve()})},is=function(a,b){return hs(a,b).then(function(c){return new ds(c,b.time,b.duration)})},hs=function(a,b){return b.load().then(function(){var c=_.Q(a.f,b.offset,b.length);return"data:image/jpeg;base64,"+
4
+ _.dj(c)})},js=function(){this.log=new _.C(cs);this.g=null;this.a=[];this.w=!1},ls=function(a,b){b.reduce(function(c,d){var e=d,f=!1;typeof d===_.Ad&&(e=d.step,f=d.preloadWhileBuffering);return c.then(function(){return ks(a,0,e,!!f)})},Promise.resolve())},ks=function(a,b,c,d){if(a.w||b>=a.a.length)return Promise.resolve();var e=b+c;return ms(a,d).then(function(){return a.a[b].load()}).then(function(){return ks(a,e,c,d)})},ms=function(a,b){return new Promise(function(c){if(b||a.g.getState()!==_.Dl)c();
5
+ else a.g.one(_.ic,function(){c()})})},ns=function(){js.call(this);this.f=null},os=function(a){a=a.split(/\.|:/).map(parseFloat);var b=0,c,d={3:.001,2:1,1:60,0:3600};for(c=a.length-1;0<=c;c--)b+=a[c]*d[c];return b},ps=function(){js.call(this);this.f=null;this.o=this.h=1;this.j=0},qs=function(){js.apply(this,arguments)},rs=function(a,b){for(var c=null,d=_.t(a),e=d.next();!e.done;e=d.next())e=e.value,e.startTime<=b&&(c=e);return c},ss=function(a,b){var c=a.horizontalTiles||b.horizontalTiles||1,d=a.verticalTiles||
6
+ b.verticalTiles||1,e=c*d;return{Tc:c,Ue:d,Af:e,durationPerTile:a.durationPerTile||b.durationPerTile||(a.endTime-a.startTime)/e}},ts=function(){this.f=new _.C(cs);this.a=this.l=null},us=function(a){return a.some(function(b){return 0<b.thumbStreams.length})},vs=function(a){if(!a)return null;a=new _.Hj(a);return a.path.match(/.*\.vtt$/i)?"WEBVTT":a.path.match(/.*\.bif$/i)?"BIF":a.path.match(/.*\.(png|jpg|jpeg)$/i)?"SINGLE":null},ws=function(){};ds.prototype.raw=function(){return this.a.cloneNode(!1)};
7
+ ds.prototype.element=function(a,b){var c=this.width,d=this.height,e=this.width/this.height;void 0!==a&&void 0===b&&(b=0);null!==a&&void 0!==a&&(c=a);null!==b&&void 0!==b&&(d=b);c||(c=Math.ceil(d*e));d||(d=Math.ceil(c/e));e=document.createElement(_.Lc);e.style.width=c+_.Ud;e.style.height=d+_.Ud;e.style.backgroundColor="#000";e.style.backgroundRepeat="no-repeat";e.style.backgroundImage="url("+this.src+")";e.style.backgroundSize=Math.ceil(c/this.width*(this.a.naturalWidth||this.a.width))+"px "+Math.ceil(d/
8
+ this.height*(this.a.naturalHeight||this.a.height))+_.Ud;var f=this.y/this.height;e.style.backgroundPositionX="-"+this.x/this.width*c+_.Ud;e.style.backgroundPositionY="-"+f*d+_.Ud;return e};
9
+ ds.prototype.load=function(){var a=this;this.f||(this.f=new Promise(function(b,c){function d(){a.width||(a.width=(a.a.naturalWidth||a.a.width)/a.g);a.height||(a.height=(a.a.naturalHeight||a.a.height)/a.m);a.x||(a.x=a.width*a.h);a.y||(a.y=a.height*a.j)}if(a.a.src&&a.a.complete)d(),b(a);else{var e=null,f=function(){d();a.a.removeEventListener("load",f);a.a.removeEventListener(_.Wc,e);b(a)};e=function(){a.a.removeEventListener("load",f);a.a.removeEventListener(_.Wc,e);c()};a.a.addEventListener("load",
10
+ f);a.a.addEventListener(_.Wc,e);a.a.src=a.src}}));return this.f};_.A("clpp.thumbnails.Thumbnail",ds);ds.prototype.load=ds.prototype.load;ds.prototype.element=ds.prototype.element;ds.prototype.raw=ds.prototype.raw;es.prototype.load=function(){return this.a};
11
+ fs.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.J(_.K,7,7100,as);var d=_.fh(b.url);d.type=_.eh;a.getNetworkEngine().fetch(d).N.then(function(e){e=e.data;var f=_.Q(c.f);e=_.Q(e);for(var g=f.byteLength+e.byteLength,k=new ArrayBuffer(g),l=new DataView(k),m=0,n=0,p=f.byteLength;n<p;n++)l.setUint8(m,f[n]),m+=1;f=0;for(n=e.byteLength;f<n;f++)l.setUint8(m,e[f]),m+=1;c.f=k;c.g.info("Appended "+e.byteLength+" bytes.Total data now "+(g+" bytes."))}).then(function(){var e=c.f,f=_.Q(e),g=
12
+ String.fromCharCode.apply(null,xs),k=Array.prototype.slice.call(f,0,8);f=64;var l=0;var m=!1;if(g===String.fromCharCode.apply(null,k))for(e=new DataView(e,16,20),e=e.getUint32(0,!0),0===e&&(e=1E3);!m;){l+=1;k=e;g=new DataView(c.f,f);m=g.getUint32(0,!0);k=m*k/1E3;g=g.getUint32(4,!0);g=new es(k,g);if(k=c.a.length)k=c.a[k-1],k.length=g.offset-k.offset,k.duration=g.time-k.time;c.a.push(g);f+=8;(m=4294967295===m)&&c.h.resolve();if(1E5<l)throw Error("There was a problem during reading BIF entries");}else throw Error("The file is not a valid BIF format");
13
+ }).then(function(){gs(c)})["catch"](function(e){c.g.error("Error while loading thumbnail index",e)})};fs.prototype.get=function(a){var b=this;return 0>a?Promise.reject($r+a):this.h.then(function(){for(var c=0;c<b.a.length;c++){var d=b.a[c];if(d.time>=a&&a<d.time+d.duration)return is(b,d).then(function(e){return e.load().then(function(){return e})})}return Promise.reject(Zr+a)})};var xs=[137,66,73,70,13,10,26,10];js.prototype.init=function(a,b){var c=this;this.g=a;a.one(_.Xd,function(){c.w=!0});a.isLive()||this.m().then(function(){b&&b.preload&&ls(c,b.preload)})};_.u(ns,js);
14
+ ns.prototype.init=function(a,b){var c=this;if(!b||!b.url)throw new _.J(_.K,7,7100,as);var d=b.url,e=_.fh(d);e.type=_.eh;this.f=a.getNetworkEngine().fetch(e).N.then(function(f){if(f=f.data){f=_.Qg(f).split(/\n/);for(var g=0;g<f.length;g++){var k=f[g],l=k.split(" --\x3e ");if(2===l.length){k=f[++g];var m=k.indexOf("\x3d"),n=0>m?[]:k.substr(m+1).split(/,/).map(parseFloat);m=n[0];var p=n[1],q=n[2];n=n[3];var r=k.indexOf("#");k=0>r?k:k.substr(0,r);k.match(/^http|^\/\//)||(k=d.substr(0,d.lastIndexOf("/"))+"/"+
15
+ k);r=os(l[0]);l=os(l[1])-r;c.a.push(new ds(k,r,l,m,p,q,n,0,0))}}}})["catch"](function(f){c.log.error("[VTT] Error while loading thumbnail",f)});js.prototype.init.call(this,a,b)};ns.prototype.get=function(a){var b=this;return 0>a?Promise.reject($r+a):this.f.then(function(){for(var c={},d=0;d<b.a.length;c={Rb:c.Rb},d++)if(c.Rb=b.a[d],c.Rb.time>=a&&a<c.Rb.time+c.Rb.duration)return c.Rb.load().then(function(e){return function(){return e.Rb}}(c));return Promise.reject(Zr+a)})};ns.prototype.m=function(){return this.f};_.u(ps,js);
16
+ ps.prototype.init=function(a,b){if(!b||!b.url)throw new _.J(_.K,7,7100,as);if("GRID"===b.mode&&!b.gridSize)throw new _.J(_.K,7,7100,"Grid size is mandatory for GRID mode");if(!b.duration)throw new _.J(_.K,7,7100,"Duration is mandatory");this.f=b;var c=this.f.duration,d=this.f.url;if(!c||!d)throw this.log.error(Yr,c,d),new _.J(_.K,7,7100,Yr);this.j=c;if(this.f.gridSize)try{var e=this.f.gridSize.split(/x/).map(function(f){return parseInt(f,10)}).filter(function(f){return 0<f});if(2===e.length)this.h=e[0],
17
+ this.o=e[1];else throw new _.J(_.K,7,7100,bs);}catch(f){throw this.log.error("Error during parsing gridSize",f),new _.J(_.K,7,7100,bs);}js.prototype.init.call(this,a,b)};ps.prototype.get=function(a){var b=this.g.getDuration();if(void 0===this.f.duration)return Promise.reject("Duration configuration not defined");var c=Math.floor(a/this.f.duration);if(0>a||a>b)return Promise.reject($r+a);var d=this.a[c];return d?d.load().then(function(){return d}):Promise.reject(Zr+a+" at index "+c)};
18
+ ps.prototype.m=function(){if(0<this.a.length)return Promise.resolve();var a=this.g.getDuration(),b=this.h*this.o;a=Math.ceil(Math.ceil(a/this.j)/b);for(var c=this.f.templateKey||"$index$",d=0;d<a;d++)for(var e=this.f.url.replace(c,String(d+1)),f=new Image,g=0;g<b;g++)this.a.push(new ds(e,this.j*(d*b+g),this.j,0,0,0,0,this.h,this.o,g%this.h,Math.floor(g/this.h),f));return Promise.resolve()};_.u(qs,js);
19
+ qs.prototype.get=function(a){if(0>a)return this.log.error("Position must be greater than 0 but is "+a),Promise.reject();var b=this.g.getPeriods();b=rs(b,a);if(!b)return this.log.error("Could not find period for specified position",a),Promise.reject();var c=b.thumbStreams.sort(this.f)[0];if(!c)return this.log.error("Could not find thumb stream for specified position",a),Promise.reject();b=c.findSegmentPosition(a-b.startTime);if(null===b||void 0===b)return this.log.error("Could not find segment index for specified position",a),
20
+ Promise.reject();var d=c.getSegmentReference(b);if(d){var e=ss(d,c);a=Math.floor((a-d.startTime)/e.durationPerTile);var f;if(0<this.a.length)d=c.findSegmentPosition(0),null!==d&&(f=this.a[(b-d)*e.Af+a]);else if((c=d.Ra())&&0<c.length){var g=0,k=0;d=d.startTime;1<e.Af&&(g=a%e.Tc,k=Math.floor(a/e.Tc),d+=a*e.durationPerTile);f=new ds(c[0],d,e.durationPerTile,void 0,void 0,void 0,void 0,e.Tc,e.Ue,g,k)}if(f)return f.load().then(function(){return f})}this.log.error("segment reference for specified segment index does not exist",
21
+ b);return Promise.reject()};qs.prototype.f=function(a,b){return void 0!==a.bandwidth&&void 0!==b.bandwidth?a.bandwidth-b.bandwidth:0};
22
+ qs.prototype.m=function(){if(0<this.a.length)return Promise.resolve();var a=this.g.getPeriods();a=_.t(a);for(var b=a.next();!b.done;b=a.next())if(b=b.value.thumbStreams.sort(this.f)[0])for(var c=b.findSegmentPosition(0),d=void 0;null!==c&&!_.H.R(d=b.getSegmentReference(c++));)for(var e=ss(d,b),f=d.Ra()[0],g=new Image,k=d.startTime,l=0;l<e.Ue;++l)for(var m=0;m<e.Tc;++m)this.a.push(new ds(f,k,e.durationPerTile,void 0,void 0,void 0,void 0,e.Tc,e.Ue,m,l,g)),k+=e.durationPerTile;return Promise.resolve()};_.h=ts.prototype;_.h.onPlayerCreated=function(a){this.l=a};_.h.onPlayerWillDestroy=function(){this.l=null};_.h.onPlayerWillRelease=function(){this.a=null};
23
+ _.h.onContentWillLoad=function(a){var b=this,c=a.getConfiguration();if(c.thumbnails){var d=c.thumbnails;d&&(void 0===d.enabled||d.enabled)&&((c=d.mode)||(c=vs(d.url||null)),c&&("SINGLE"===c||"GRID"===c?this.a=new ps:"WEBVTT"===c?this.a=new ns:"BIF"===c&&(this.a=new fs)),this.a&&(this.f.info("Loading thumbs configuraiton",d),this.l.one(_.jd,function(){b.f.info("Initialize thumbnails provider");b.a.init(a,d)})))}else this.a=null};
24
+ _.h.onContentLoaded=function(a,b){for(var c=1;c<arguments.length;++c);if(!this.a&&(c=(c=a.getConfiguration())&&c.thumbnails,!c||void 0===c.enabled||c.enabled)){var d=a.getPeriods();this.f.info(_.Cd,d);us(d)&&(this.a=new qs,this.a.init(a,c))}};_.h.get=function(a){return this.a?this.a.get(a):Promise.reject()};_.h.id=function(){return"thumbnails"};_.A("clpp.thumbnails.ThumbnailsPlugin",ts);ts.prototype.get=ts.prototype.get;ts.Id="thumbnails";ws.prototype.create=function(){return new ts};_.fn(new ws);};
25
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
26
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
27
+ else{_=this.clpp._;(f.call(g,this));}
28
+ })();
@@ -0,0 +1,76 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var NC="An unknown error occured while trying to get volume",OC="Cannot get loading rendition due to platform limitations",PC="PARAM_START_POSITION",QC="SecurityError",RC="The require privilege is: http://tizen.org/privilege/tv.audio",SC="|STARTBITRATE\x3d",TC=function(a,b,c){function d(e){c.call(a,e);a.removeEventListener(b,d)}a.addEventListener(b,d)},UC=function(a,b){this.h=a;this.w=null;this.a=_.yd;this.o=null;this.j=!1;this.f=new Map;this.m=b;this.g=new _.C("clpp.tizen.DrmEngine")},XC=function(a){var b,
3
+ c,d;return _.z(function(e){if(1==e.a){b=a.a===_.Fc||a.a===_.Ec;if(!b)throw new _.J(_.K,6,6001,"The key system "+a.a+" is not supported by the player or the platform");c=a.f.get(a.a);if(!c.Wc)throw new _.J(_.K,6,6012,"No license server given for "+a.a);_.pf(e,2);return a.a===_.Fc?_.v(e,VC(a),5):_.v(e,WC(a,c),5)}if(2!=e.a)return a.w={keySystem:a.a,licenseServerUri:c.Wc,distinctiveIdentifierRequired:!1,persistentStateRequired:c.Fe,audioRobustness:"",videoRobustness:"",serverCertificate:null,initData:[],
4
+ keyIds:[],periodId:null},_.qf(e,0);d=_.rf(e);a.g.error("Error while configuring CDM for "+a.a,d);throw new _.J(_.K,6,6005,{message:JSON.stringify(d)});})},WC=function(a,b){var c,d,e,f;return _.z(function(g){c=YC;d=ZC;e={};e[d.kg]=!b.Fe;e[d.lg]=b.Wc;""!==b.customData&&(e[d.jg]=b.customData);f=JSON.stringify(e);a.g.debug("PlayReady properties: ",f);try{webapis.avplay.setDrm(c.PLAYREADY,"SetProperties",f)}catch(k){throw k;}_.w(g)})},VC=function(a){var b;return _.z(function(c){b=YC;try{webapis.avplay.setDrm(b.gd,
5
+ "Initialize",""),webapis.avplay.setDrm(b.gd,"widevine_app_session",a.o.id),webapis.avplay.setDrm(b.gd,"widevine_data_type",a.o.type)}catch(d){throw d;}_.w(c)})},$C=function(a,b){var c,d,e,f,g,k,l,m,n,p,q,r,x,y,E,I,F;_.z(function(G){if(1==G.a){c=YC;d=a.f.get(a.a);a.g.debug("DRM Challenge data: ",b.challenge);e=atob(b.challenge);f=new Uint8Array(e.length);for(g=0;g<e.length;++g)f[g]=e.charCodeAt(g);k=b.serverurl&&""!==b.serverurl?b.serverurl:d.Wc;l=_.fh([k],_.ch());l.type=3;l.body=f.buffer;l.method=
6
+ "POST";_.pf(G,2);return _.v(G,a.m.wb.fetch(l).N,4)}if(2!=G.a){m=G.f;if(a.j){n=_.Q(m.data);p=n.byteLength;q="";for(r=0;r<p;r++)q+=String.fromCharCode(n[r]);x=btoa(q);y=b.session_id+PC+(x+PC);a.g.debug("Widevine license params",y);try{webapis.avplay.setDrm(c.gd,"widevine_license_data",y)}catch(M){a.g.error("License response rejected by CDM"),E=new _.J(_.K,6,6008,{browserError:JSON.stringify(M)}),a.m.onError(E)}}return _.qf(G,0)}I=_.rf(G);a.g.error("License request failed.",JSON.stringify(I));F=new _.J(_.K,
7
+ 6,6007,{message:_.Ba,url:I.data.url,status:I.data.status||NaN,response:I.data.response||"",headers:I.data.headers||{}},I);a.m.onError(F);_.w(G)})},aD=function(a){this.l=a;this.a=this.l.a;this.f=_.yl;this.j=_.zl;this.w=(new Date).getTime();this.m=!1;this.o=-1;this.h=2;this.g=new _.C("clpp.tizen.StateManager")},cD=function(a,b){if(a.f!==b)if(a.f===_.Jl&&b!==_.yl)a.g.debug(_.lt+bD(b));else{var c=(new Date).getTime();a.j=a.f;a.f=b;a.f===_.Dl?(a.o=(new Date).getTime(),a.l.trigger(new _.D(_.jc,{detail:{bufferedTimeMS:-1,
8
+ reason:a.h}}))):a.j===_.Dl&&a.l.trigger(new _.D(_.ic,{detail:{bufferedTimeMS:c-a.o,reason:a.h}}));var d={currentState:a.f,previousState:a.j,timeSinceLastStateChangeMS:c-a.w};a.w=c;a.l.trigger(new _.D(_.he,{detail:d}));a.g.debug("State changed:",bD(a.j),"-\x3e",bD(a.f))}},bD=function(a){return Object.keys(_.Hl)[a]},fD=function(a){if(a.m){var b=a.a.getState(),c=a.f;switch(b){case dD:c=_.Ml;break;case eD:c=_.Ll;break;default:a.l.isEnded()?c=_.Fl:a.g.debug("Inconsistent AVPlay plackback state:",b)}cD(a,
9
+ c)}},gD=function(){this.o=this.A=this.g=this.h=this.B=this.l=this.j=this.f=null;this.w=!0;this.m=null;this.a=new _.C("clpp.tizen.TextStreamer")},hD=function(a){if(!a)return!1;a=a.periods;for(var b=!1,c=0;c<a.length;c++)b=b||0<a[c].textStreams.length;return b},iD=function(a){var b,c;return _.z(function(d){if(1==d.a)return b=a.l.getConfiguration(),c=null,_.v(d,_.ho(a.B.url,a.l.getNetworkEngine(),b.manifest.attemptParameters,a.B.type),2);(c=d.f)&&c.configure(b.manifest);return d["return"](c)})},jD=function(a){var b=
10
+ document.createElement(_.Ge),c=new _.Wu,d=new _.Wt(function(){return null}),e=a.l.getTextDisplayer();return new _.bv(b,c,e,d,a.l.getConfiguration())},kD=function(a){var b={qb:function(){return a.l.getPosition()},W:a.h,wb:a.l.getNetworkEngine(),ye:a.Hh.bind(a),xe:a.Gh.bind(a),onError:a.S.bind(a),Of:function(){},onEvent:function(){},Tf:a.Ih.bind(a),Cd:function(){},de:function(){return new _.fw}};return new _.$w(a.f,b)},lD=function(a){var b=a.l.getPosition(),c=null;a=_.t(a.f.periods);for(var d=a.next();!d.done;d=
11
+ a.next())d=d.value,d.startTime<=b&&(c=d);return c},mD=function(a){a.a.debug("getTextStreams()",a.f);if(a.f){var b=[],c=a.f.periods;a.a.debug("getting text streams");for(var d=0;d<c.length;d++)if(a.a.debug(c[d].startTime,a.l.getPosition()),c[d].startTime<=a.l.getPosition()){b=c[d].textStreams;break}a=b}else a=[];b=[];for(d=c=0;d<a.length;d++){var e=new _.wg(String(c++),_.L);e.mimeType=a[d].mimeType;e.language=a[d].language;e.roles=a[d].roles;e.kind=a[d].kind||_.zt;var f=new _.Dg(String(a[d].id),e);
12
+ f.bandwidth=a[d].bandwidth||null;e.renditions.push(f);b.push(e)}return b},nD=function(a){if(a.h&&!a.h.getTextDisplayer().isTextVisible())return null;if(a.g){var b=_.ax(a.g,_.re),c=null;if(b){a=mD(a);for(var d=0;d<a.length;d++)if(a[d].renditions[0].id===String(b.id)){c=a[d].renditions[0];break}}return c}return null},oD=function(a,b){a.a.debug("Set active track",b);if(b&&(a.o=b.language,a.A=b.roles[0]||"",a.f&&a.g)){a.setTextVisibility(!0);var c=lD(a),d=b.renditions[0];(c=c.textStreams.find(function(e){return String(e.id)==
13
+ d.id}))?(a.w?(a.a.debug("Switching period defer text selection"),a.m=c):(_.ix(a.g,c,!0,0),a.l.trigger(new _.D(_.Hh))),a.o=c.language):a.a.error(_.kt,d.id)}},pD=function(){this.h=this.f=this.l=null;this.g={};this.a=new _.C("clpp.tizen.TrackManager");this.w=this.m=this.j=null;this.A=!1;this.o=1},qD=function(a,b){a.l.trigger(new _.D(_.Ke,{details:{width:b.width,height:b.height,bandwidth:b.bandwidth,track:b.track,abrSelection:a.f.o}}))},rD=function(a){var b=a.fa();b&&a.l.trigger(new _.D(_.gc,{detail:{width:b.width,
14
+ height:b.height,bandwidth:b.bandwidth,rendition:b}}))},sD=function(a){var b=a.l.getConfiguration(),c=_.vh(b.preferredAudioLanguage||[]),d=a.g[_.N]||[];if(d.length){var e=null;c.some(function(g){e=_.Kt(g,d.map(function(k){return k.language}));return!!e});if(e){var f=d.filter(function(g){return g.language===e});c=f[0];1<f.length&&b.preferredAudioRole&&(f=f.filter(function(g){return 0<=g.roles.indexOf(b.preferredAudioRole)}),0<f.length&&(c=f[0]));a.a.debug("Setting audio track with preferred language:",
15
+ e);a.ma(c)}else a.a.debug("Preferred language(s) not available")}else a.a.debug("Could not set preferred audio language")},wD=function(a,b){if(b){var c=b.track.type.toUpperCase();tD(a.f,c,Number(b.id)).then(function(){c===uD&&(a.j=b,a.l.trigger(new _.D(_.Gh)));c===vD&&(a.m=b,a.l.trigger(new _.D(_.Hh)))})["catch"](function(){a.a.error("Could not select "+c+" track.")})}else a.a.debug("Must provide valid rendition")},xD=function(a,b,c){var d=_.rh(b.language||_.xe);c.language=_.xg(d);c.channelsCount=
16
+ b.channels?Number(b.channels):null;c.mimeType=_.cc;a=new _.Dg(String(a),c);a.track=c;a.codec=b.fourCC||null;a.bandwidth=b.bit_rate||null;return a},yD=function(a,b,c){c.mimeType=_.Ie;a=new _.Dg(String(a),c);a.track=c;a.width=b.Width||null;a.height=b.Height||null;a.bandwidth=b.Bit_rate?Number(b.Bit_rate):null;a.codec=b.fourCC||null;return a},zD=function(a,b,c){b=_.rh(b.track_lang||_.xe);c.mimeType="text/ttml";c.language=_.xg(b);c.kind=_.zt;return new _.Dg(String(a),c)},AD=function(a,b){var c=null;try{c=
17
+ JSON.parse(b)}catch(d){a.a.warn("Couldn't retrieve extra infos from stream."),c=null}return c},DD=function(a,b){function c(n,p){for(var q=0;q<n.length;q++)if(n[q].language===p)return n[q];return null}var d={};if(0>=b.length)return d;for(var e=b.filter(function(n){return n.type===BD}),f=b.filter(function(n){return n.type===uD}),g=[],k=0;k<f.length;k++){var l=AD(a,f[k].extra_info);if(l){var m=_.rh(l.language||_.xe);m=_.xg(m);m=c(g,m);m||(m=new _.wg(String(a.o++),_.N),g.push(m));m.renditions.push(xD(f[k].index,
18
+ l,m))}else a.a.warn("Skipping audio stream with no extra info")}f=new _.wg(String(a.o++),_.yg);for(k=0;k<e.length;k++)(l=AD(a,e[k].extra_info))?f.renditions.push(yD(e[k].index,l,f)):a.a.warn("Skipping video stream with no extra info");e=[];e=a.h?mD(a.h):CD(a,b);d[_.yg]=[f];d[_.N]=g;d[_.L]=e;return d},CD=function(a,b){for(var c=b.filter(function(k){return k.type===vD}),d=[],e=0;e<c.length;e++){var f=AD(a,c[e].extra_info);if(f){var g=new _.wg(String(a.o++),_.L);g.renditions.push(zD(c[e].index,f,g));
19
+ d.push(g)}else a.a.warn("Skipping text stream with no extra info")}return d},ED=function(a,b){for(var c=a.g[_.yg]||[],d=[],e=0;e<c.length;e++)for(var f=0;f<c[e].renditions.length;f++)_.H.Oa(c[e].renditions[f],b,Object.keys(b))&&d.push(c[e].renditions[f]);return d[0]||null},FD=function(a,b,c){a=a.g[c]||[];b=String(b.index);c=null;for(var d=0;d<a.length;d++)for(var e=0;e<a[d].renditions.length;e++)if(a[d].renditions[e].id===b){c=a[d].renditions[e];break}return c},HD=function(a,b){if(b===_.L&&a.h)return nD(a.h);
20
+ var c=GD(a.f)||[];if(0===c.length)return null;c=c.filter(function(e){return e.type===b.toUpperCase()})[0];var d=null;b===_.yg&&(d=AD(a,c.extra_info),d=ED(a,{width:d.Width,height:d.Height}));b===_.N&&(c?(d=FD(a,c,_.N),a.j=d):d=a.j);b===_.L&&(c?(d=FD(a,c,_.L),a.m=d):d=a.m);return d},ID=function(a){_.Mh.call(this);this.l=a;this.h=null;this.a=new _.C("clpp.tizen.Middleware");this.C=1;this.B=!1;this.m=null;this.D=0;this.o=!0;this.g=!1;this.f=null;this.A=1;this.w=!1;this.j={}},JD=function(a){return _.z(function(b){tizen.systeminfo.getPropertyValue("DISPLAY",
21
+ function(c){a.A=c.resolutionWidth/1920;a.a.debug("Display resolution ratio: ",a.A)},function(c){a.a.debug("Could not load DISPLAY property");throw c;});_.w(b)})},LD=function(a){try{webapis.avplay.setListener({onbufferingstart:a.Bh.bind(a),onbufferingprogress:a.Ah.bind(a),onbufferingcomplete:a.zh.bind(a),onstreamcompleted:a.Eh.bind(a),oncurrentplaytime:function(b){a.trigger(new _.D(KD,{currentTime:b}))},onevent:a.Dh.bind(a),onsubtitlechange:a.Fh.bind(a),ondrmevent:a.Ch.bind(a),onerror:a.S.bind(a)})}catch(b){a.a.error(b)}},
22
+ MD=function(a){var b=!!a.l.getTrackManager().Ba();try{webapis.avplay.setSilentSubtitle(!b)}catch(c){a.a.debug("Could not set AVPlay subtitle config",c)}},ND=function(a,b){try{var c=b.estimatedBandwidth||0,d=b.currentBandwidth||0;a.a.debug({estimatedBandwidth:c,Yj:d});0!==c&&0!==d&&c>=1.15*d&&webapis.avplay.setStreamingProperty("ADAPTIVE_INFO",SC+d)}catch(e){a.a.debug(e)}},OD=function(a,b){try{webapis.avplay.setStreamingProperty("ADAPTIVE_INFO","|BITRATES\x3d"+b+SC+b)}catch(c){throw a.a.debug("Could not set fixed bandwdth",
23
+ c),c;}},RD=function(a){return{position:a.getPosition(),state:a.l.getState(),$e:a.getState(),playbackRate:a.getPlaybackRate(),isLive:a.isLive(),duration:a.getDuration(),isMuted:PD(a),volume:a.getVolume(),Cj:QD(a),Rh:GD(a)}},TD=function(a){var b,c;return _.z(function(d){if(1==d.a)return _.v(d,SD(),2);if(3!=d.a)return b=new Promise(function(e){(new _.nh(e)).Z(5)}),_.v(d,Promise.race([JD(a).then(function(){return!0}),b.then(function(){return!1})]),3);c=d.f;if(!c)return a.a.debug("Took to long for the SDK to be ready"),
24
+ d["return"](Promise.reject("SDK Timeout"));_.w(d)})},ZD=function(a,b,c){var d,e,f,g,k,l,m,n;return _.z(function(p){switch(p.a){case 1:a.m=_.Ql(b);d=a.D;e=c||{estimatedBandwidth:0,currentBandwidth:0,nextBandwidth:null,currentPosition:0};a.a.debug("Loading manifest URL: "+a.m[d].url);f=b.startTime||void 0;a.g&&(a.trigger(new _.D(UD)),f=c.currentPosition);_.pf(p,2);g=a.m[d].url;k=a.m[d].type;k!==_.Rb||g.includes(".mpd")||(l=new URL(g),l.searchParams.append("cl-ext",".mpd"),g=l.toString());webapis.avplay.open(g);
25
+ e.nextBandwidth?(OD(a,e.nextBandwidth),a.o=!1):(a.o||ND(a,e),a.o=!0);LD(a);if(!b.drm||!b.drm.env){a.a.debug("No DRM configuration was provided. Assuming clear content");p.G(4);break}m={onError:function(q){return a.l.onError(q)},wb:a.l.getNetworkEngine()};a.h=new UC(b.drm,m);return _.v(p,a.h.init(),4);case 4:return a.g||a.trigger(new _.D(VD)),_.v(p,WD(a),6);case 6:a.g||a.trigger(new _.D(XD));f&&typeof f===_.zd&&0<f&&a.seek(f)["catch"](function(q){a.a.debug("Couldn't set start position",q)});a.g||(b.volume&&
26
+ a.setVolume(b.volume),b.muted&&YD(a,b.muted),b.autoplay&&a.l.play()["catch"](function(q){a.a.debug("Autoplay failed",q)}));_.qf(p,0);break;case 2:throw n=_.rf(p),a.a.debug("Error while attempting to load source."),n;}})},WD=function(a){return _.z(function(b){a.a.debug("avplay.prepare()");return b["return"](new Promise(function(c,d){try{webapis.avplay.prepareAsync(function(){a.a.debug("AVPlay is ready!");MD(a);c()},function(e){a.a.debug("prepareAsync failed",e);d(e)})}catch(e){a.a.debug("Failed to prepare media player for playback"),
27
+ d(e)}}))})},$D=function(a,b,c){a.a.debug("switchVideoTrack()");try{var d={estimatedBandwidth:parseInt(webapis.avplay.getStreamingProperty("CURRENT_BANDWITH"),10),currentBandwidth:b,nextBandwidth:c,currentPosition:a.getPosition()};a.f=RD(a);a.g=!0;webapis.avplay.stop();webapis.avplay.close();return a.load(a.l.getConfiguration(),d).then(function(){var e=a.f.$e;a.g=!1;a.f=null;return e===eD?a.pause():a.play()})}catch(e){return Promise.reject(e)}},QD=function(a){return a.g&&a.f?a.f.Cj:webapis.avplay.getTotalTrackInfo()},
28
+ GD=function(a){return a.g&&a.f?a.f.Rh:webapis.avplay.getCurrentStreamInfo()},tD=function(a,b,c){b=b.toUpperCase();b===vD&&aE(a,!0);var d=a.j[b];d&&(d.Fd.stop(),a.j[b]=null,a.a.debug("Cancelled pending track switch for "+b));return new Promise(function(e,f){function g(k,l,m){m=void 0===m?!1:m;try{webapis.avplay.setSelectTrack(k,l),a.j[k]=null,e()}catch(n){a.a.debug("Could not set "+k+" track. Trying again...AVPlay state: "+(a.getState()+", buffering: ")+a.w,n),!1===m&&(a.j[k]={type:k,index:l,Ye:0,
29
+ Fd:new _.nh(function(){return g(k,c,!0)})}),(l=a.j[k])&&3>l.Ye?(!a.w&&++l.Ye,l.Fd.Z(a.w?.5:.25)):(a.a.debug("Could not set track after multiple attempts.Giving up..."),l&&l.Fd.stop(),a.j[k]=null,f())}}g(b,c)})},aE=function(a,b){var c=a.l.getTextDisplayer();c&&c.setTextVisibility(b);c=a.l.g;try{c||webapis.avplay.setSilentSubtitle(!b)}catch(d){a.a.debug("Could not set text track visibility",d)}},YD=function(a,b){try{tizen.tvaudiocontrol.setMute(b)}catch(c){switch(c.name){case QC:a.a.warn("The application does not have the privilege to set mute.",
30
+ RC);break;default:a.a.warn(NC,c)}}},PD=function(a){var b=null;try{b=tizen.tvaudiocontrol.isMute()}catch(c){switch(c.name){case QC:a.a.warn("The application doesn't have the privilege to get the mute state.",RC);break;default:a.a.warn(NC,c)}}return!!b},SD=function(){return new Promise(function(a,b){if(window.webapis)a();else{var c=document.createElement("script");TC(c,"load",function(d){return a(d)});TC(c,_.Wc,function(d){return b(d)});c.src="$WEBAPIS/webapis/webapis.js";document.querySelector("head").appendChild(c)}})},
31
+ bE=function(){_.Mh.call(this);this.a=new ID(this);this.f=new aD(this);this.configuration=this.B=_.Ri();this.w=null;this.h=new _.C("clpp.tizen.Player");this.j=null;this.m=new pD;this.C=new _.ji;this.o=this.g=null;this.A=!1},cE=function(a){if("NONE"!==a.a.getState()){var b=a.j.getBoundingClientRect();a=a.a;var c=Math.floor(b.left*a.A),d=Math.floor(b.top*a.A),e=Math.floor(b.width*a.A);b=Math.floor(b.height*a.A);a.a.debug("Setting display area to","x:",c,"y:",d,"width:",e,"height:",b);webapis.avplay.setDisplayRect(c,
32
+ d,e,b);0===c&&0===d&&1920===e&&1080===b&&webapis.avplay.setDisplayMethod("PLAYER_DISPLAY_MODE_LETTER_BOX")}else a.h.debug("Could not apply dimension. Player state "+a.a.getState())},dE=function(){},eE=function(){this.a=null};
33
+ UC.prototype.init=function(){var a=this,b,c,d,e,f,g;return _.z(function(k){if(1==k.a){b=_.oj[a.h.env]||null;if(!b)throw a.g.debug(_.ra,_.$a+a.h.env+_.aa),new _.J(_.K,6,6015,_.sa+a.h.env+"' is missing.");a.o={id:String(Math.floor(1E4*Math.random())),type:"MPEG-DASH"};c=Object.keys(a.h.customData||{}).length?btoa(JSON.stringify(a.h.customData)):"";d=_.qj(b,a.h.customData);(e=d[_.Ec])&&a.f.set(_.Ec,{Wc:e.licenseUrl||"",customData:c,Fe:!1});(f=d[_.Fc])&&a.f.set(_.Fc,{Wc:f.licenseUrl||"",customData:c,
34
+ Fe:!1});if(0===a.f.size)throw new _.J(_.K,6,6E3);if((g=a.h.preferredDrmSystem)&&a.f.get(g))a.a=g;else if(a.f.get(_.Ec))a.a=_.Ec;else if(a.f.get(_.Fc))a.a=_.Fc;else throw new _.J(_.K,6,6001,"Configuration for the target system is missing.");return _.v(k,XC(a),2)}a.j=!0;_.w(k)})};UC.prototype.release=function(){var a=this;return _.z(function(b){a.j=!1;a.w=null;a.a=_.yd;a.o=null;a.f=new Map;_.w(b)})};UC.prototype.getDrmInfo=function(){return this.w};
35
+ var ZC={kg:"DeleteLicenseAfterUse",lg:"LicenseServer",Mj:"GetChallenge",Nj:"HttpHeader",Rj:"UserAgent",Ij:"Cookie",jg:"CustomData"};_.h=aD.prototype;_.h.release=function(){cD(this,_.yl);this.m=!1;this.o=-1;this.h=2};_.h.destroy=function(){this.release();this.a.off(UD,this.mf);this.a.off(fE,this.lf);this.a.off(gE,this.kf);this.a.off(VD,this.Vf);this.a.off(XD,this.Uf);this.a.off(hE,this.nf);this.l=this.a=null};_.h.mf=function(){this.g.debug("Buffering start. Player state: ",this.a.getState());this.h=this.a.B?1:2;cD(this,_.Dl)};_.h.lf=function(a){this.g.debug("Buffering progress: "+a.percent+" %. Player state: ",bD(this.f))};
36
+ _.h.kf=function(){this.g.debug("Buffering complete. Player state: ",this.a.getState());if(!this.m){this.m=!0;var a=this.l.getConfiguration().autoplay,b=this.a.getState()===iE;if(!a&&b){cD(this,_.Ll);return}}if(a=this.f!==_.Kl)a=this.a.getState(),a=a===dD||a===eD;a&&fD(this)};_.h.Vf=function(){this.g.debug("Preparing starts. AVPlay State: ",this.a.getState());this.a.getState()===jE?cD(this,_.Kl):this.g.error("AVPlay prepares while state is not IDLE")};
37
+ _.h.Uf=function(){this.g.debug("Preparing ends: AVPlay state:",this.a.getState())};_.h.nf=function(){cD(this,_.Fl)};_.h.getState=function(){return this.f};_.h=gD.prototype;
38
+ _.h.load=function(a){var b=this,c,d,e,f,g,k,l;return _.z(function(m){switch(m.a){case 1:if(!b.l)return b.a.debug("Text streamer is not initialized. Will not load()"),m["return"]();b.B=a;c=b;return _.v(m,iD(b),2);case 2:c.j=m.f;if(!b.j)return b.a.debug("Could not find manifest parser for source. Make sure parsers are registered."),m["return"]();d={networkingEngine:b.l.getNetworkEngine(),filterNewPeriod:function(){},filterAllPeriods:function(){},onTimelineCueAdded:function(){},onEvent:function(){},onError:function(){}};
39
+ _.pf(m,3);e=b;return _.v(m,b.j.start(a.url,d),5);case 5:e.f=m.f;_.qf(m,4);break;case 3:return f=_.rf(m),b.a.warn(f),_.pf(m,6),g=b,_.v(m,b.j.start(a.url.replace("https://","http://"),d),8);case 8:g.f=m.f;_.qf(m,4);break;case 6:k=_.rf(m),b.a.error(k),b.f=null;case 4:if(!b.f||!hD(b.f)){m.G(0);break}b.h=jD(b);_.pf(m,10);return _.v(m,b.h.H,12);case 12:b.g=kD(b);l=b.l.getConfiguration();b.g.m=l.streaming;b.o=l.preferredTextLanguage;b.A=l.preferredTextRole;_.qf(m,0);break;case 10:_.rf(m),b.a.debug("Could not setup media source..."),
40
+ b.h=null,b.g=null,b.j=null,b.f=null,_.w(m)}})};_.h.Hh=function(a){this.a.debug(_.ut,a);this.w=!0;var b=_.Hv(a.textStreams,this.o||"",this.A||"")[0]||null;this.m&&(a.textStreams.includes(this.m)&&(b=this.m),this.m=null);return{variant:null,text:b}};_.h.Gh=function(){this.a.debug("canSwitch_");this.w=!1;this.m&&(_.ix(this.g,this.m,!0,0),this.m=null)};_.h.S=function(){this.a.debug("onError_")};_.h.Ih=function(){this.j&&this.j.update&&this.j.update()};
41
+ _.h.start=function(){var a=this;return _.z(function(b){if(!a.g)return b["return"]();try{a.g.start()}catch(c){a.a.error("Error while starting streaming engine",c)}_.w(b)})};_.h.setTextVisibility=function(a){this.a.debug("Set text visibility",a);this.h&&this.h.getTextDisplayer().setTextVisibility(a)};_.h.release=function(){var a=this;return _.z(function(b){a.l=null;a.f=null;a.B=null;a.A=null;a.o=null;a.w=!0;a.m=null;_.w(b)})};
42
+ _.h.destroy=function(){var a=this;return _.z(function(b){switch(b.a){case 1:if(!a.j){b.G(2);break}return _.v(b,a.j.stop(),3);case 3:a.j=null;case 2:if(!a.g){b.G(4);break}return _.v(b,a.g.destroy(),5);case 5:a.g=null,a.w=!0;case 4:if(!a.h){b.G(0);break}return _.v(b,a.h.destroy(),7);case 7:a.h=null,_.w(b)}})};_.u(pD,_.P);_.h=pD.prototype;_.h.Lf=function(a){var b=a.eventid;a=a.data;switch(b){case kE:0<Object.keys(this.g).length||(this.a.debug("Loading track manager!"),this.load());b=webapis.avplay.getCurrentStreamInfo();0<b.length&&(b=+AD(this,b[0].extra_info).Bit_rate,b=ED(this,{bandwidth:b}))&&(this.w=b,qD(this,b));break;case lE:rD(this);break;default:this.a.debug("Event type: "+b+" data: "+a)}};_.h.Be=function(a){a.detail.currentState===_.Ml&&this.l.off(_.he,this.Be)};
43
+ _.h.Fb=function(a){var b=this;this.l=a;this.f=this.l.a;this.l.on(_.he,function(c){b.A||(c=c.detail,c.currentState===_.Ml&&(b.a.debug("Current state",c.currentState),b.A=!0,sD(b)))});this.f.on(mE,this.Lf,this)};_.h.release=function(){this.g={};this.h=this.w=this.m=this.j=null;this.A=!1;this.o=1};
44
+ _.h.load=function(){if(this.f&&!(0<Object.keys(this.g).length)){this.h=this.l.g;this.l.off(_.he,this.Be);this.l.on(_.he,this.Be,this);try{var a=QD(this.f);this.g=DD(this,a);var b=this.g[_.N]||[];b.length&&(this.j=b[0].renditions[0]||null);rD(this)}catch(c){this.a.debug("Could not load track manager")}}};_.h.destroy=function(){this.f.off(mE,this.Lf);this.f=this.l=null};_.h.getVideoTracks=function(){return this.g[_.yg]||[]};_.h.getAudioTracks=function(){return this.g[_.N]||[]};
45
+ _.h.ea=function(){return this.g[_.L]||[]};_.h.fa=function(){return HD(this,_.yg)};_.h.za=function(){return HD(this,_.N)};_.h.Ba=function(){return HD(this,_.L)};_.h.Pa=function(){return this.w};_.h.Ya=function(){this.a.info(OC);return null};_.h.Za=function(){this.a.info(OC);return null};_.h.Ca=function(){var a=this.fa();return a?a.track:null};_.h.ha=function(){var a=this.za();return a?a.track:null};_.h.ia=function(){var a=this.Ba();return a?a.track:null};
46
+ _.h.Va=function(a){var b=this;null===a?(a=this.fa(),$D(this.f,a.bandwidth,null).then(function(){rD(b)})):0<a.renditions.length&&this.Ua(a.renditions[0])};_.h.ma=function(a){a?wD(this,a.renditions[0]):this.a.warn("Cannot disable audio tracks on this platform.","Consider muting audio instead...")};_.h.ua=function(a){a?(a=a.renditions[0],this.h?oD(this.h,a.track):wD(this,a)):(this.a.debug("Disabling text tracks"),this.m=null,aE(this.f,!1),this.l.trigger(new _.D(_.Hh)))};
47
+ _.h.Ua=function(a){var b=this,c=this.fa();this.f.o||a.width!==c.width||a.height!==c.height||a.bandwidth!==c.bandwidth?(this.w=a,qD(this,a),$D(this.f,c.bandwidth,a.bandwidth).then(function(){rD(b)})["catch"](function(d){var e=new _.J(_.K,7,7200,{tizenerror:d});b.a.debug("Error while switching video track",d);b.l.onError(e)})):this.a.debug("Trying to switch to already active rendition. Doing nothing...")};_.h.gb=function(a){wD(this,a)};_.h.hb=function(a){this.h?oD(this.h,a.track):wD(this,a)};
48
+ _.h.addTextTrack=function(){};_.h.ja=function(){return this.f.o};pD.prototype.isAbrEnabled=pD.prototype.ja;pD.prototype.addTextTrack=pD.prototype.addTextTrack;pD.prototype.setTextRendition=pD.prototype.hb;pD.prototype.setAudioRendition=pD.prototype.gb;pD.prototype.setVideoRendition=pD.prototype.Ua;pD.prototype.setTextTrack=pD.prototype.ua;pD.prototype.setAudioTrack=pD.prototype.ma;pD.prototype.setVideoTrack=pD.prototype.Va;pD.prototype.getTextTrack=pD.prototype.ia;pD.prototype.getAudioTrack=pD.prototype.ha;
49
+ pD.prototype.getVideoTrack=pD.prototype.Ca;pD.prototype.getLoadingTextRendition=pD.prototype.Za;pD.prototype.getLoadingAudioRendition=pD.prototype.Ya;pD.prototype.getLoadingVideoRendition=pD.prototype.Pa;pD.prototype.getTextRendition=pD.prototype.Ba;pD.prototype.getAudioRendition=pD.prototype.za;pD.prototype.getVideoRendition=pD.prototype.fa;pD.prototype.getTextTracks=pD.prototype.ea;pD.prototype.getAudioTracks=pD.prototype.getAudioTracks;pD.prototype.getVideoTracks=pD.prototype.getVideoTracks;_.u(ID,_.Mh);_.h=ID.prototype;_.h.Bh=function(){this.w=!0;this.g||this.trigger(new _.D(UD))};_.h.Ah=function(a){this.w=!0;this.trigger(new _.D(fE,{percent:a}))};_.h.zh=function(){this.w=!1;this.trigger(new _.D(gE))};_.h.Eh=function(){this.trigger(new _.D(hE))};_.h.Dh=function(a,b){this.trigger(new _.D(mE,{eventid:a,data:b}))};_.h.Fh=function(a,b,c,d,e){this.trigger(new _.D(nE,{duration:a,text:b,subtitleType:c,attriCount:d,attributes:e}))};
50
+ _.h.Ch=function(a,b){this.trigger(new _.D(oE,{drmType:a,drmData:b}));if(this.h){var c=this.h;if(c.j)if(c.a===_.Fc&&"Challenge"===b.name)$C(c,b);else if("DrmError"===b.name){c.g.debug("DrmError event",b);var d=new _.J(_.K,6,6005,{message:JSON.stringify(b)});c.m.onError(d)}}};_.h.S=function(a){this.trigger(new _.D(pE,{eventType:a}))};
51
+ _.h.play=function(){function a(){return new Promise(function(d,e){function f(){d();clearTimeout(g)}var g=null;b.one(KD,f,b);g=setTimeout(function(){b.off(KD,f);e("Timeout")},3E4)})}var b=this,c=this.getState();if(c===jE)return(new Promise(function(d,e){webapis.avplay.prepareAsync(function(){MD(b);d(webapis.avplay.play())},function(f){b.trigger(new _.D(pE));e(f)})})).then(function(){return a()});if(c===eD||c===iE)try{return webapis.avplay.play(),a()}catch(d){return Promise.reject(d)}return c===dD?
52
+ Promise.resolve():Promise.reject("Player is in invalid state")};_.h.pause=function(){try{webapis.avplay.pause()}catch(a){Promise.reject(a)}return this.getState()===eD?Promise.resolve():Promise.reject()};
53
+ _.h.setPlaybackRate=function(a){var b=this.getState();if(b===iE||b===dD||b===eD){try{webapis.avplay.setSpeed(a),this.C=a}catch(c){return this.a.debug("Error while trying to set playback rate",c),this.setPlaybackRate(this.C)}return!0}this.a.debug("Cannot set playback rate; AVPlay is in inconsistent state: "+b);return!1};_.h.getPlaybackRate=function(){return this.C};
54
+ _.h.load=function(a,b){var c=this,d;return _.z(function(e){switch(e.a){case 1:return c.a.debug("configure()",b||""),_.pf(e,2),_.v(e,TD(c),4);case 4:return _.v(e,ZD(c,a,b),5);case 5:_.qf(e,0);break;case 2:throw d=_.rf(e),new _.J(_.K,7,7003,null,d);}})};_.h.getState=function(){if(this.g&&this.f)return this.f.$e;try{return webapis.avplay.getState()}catch(a){this.S(JSON.stringify(a))}};
55
+ _.h.seek=function(a){var b=this,c=1E3*a;return new Promise(function(d,e){b.B=!0;b.l.trigger(new _.D(_.Ce));webapis.avplay.seekTo(c,function(){b.B=!1;b.l.trigger(new _.D(_.Be));d()},function(){b.B=!1;e()})})};_.h.getPosition=function(){if(this.g&&this.f)return this.f.position;try{return webapis.avplay.getCurrentTime()/1E3}catch(a){this.S(JSON.stringify(a))}};_.h.getDuration=function(){if(this.g&&this.f)return this.f.duration;try{return webapis.avplay.getDuration()/1E3}catch(a){this.S(JSON.stringify(a))}};
56
+ _.h.release=function(){var a=this;return new Promise(function(b,c){try{a.h&&(a.h.release(),a.h=null);webapis.avplay.stop();webapis.avplay.close();for(var d in a.j){var e=a.j[d];e&&e.Fd.stop()}a.j={};a.C=1;a.B=!1;a.m=null;a.f=null;return b()}catch(f){return c(f)}})};_.h.getVolume=function(){var a=null;try{a=tizen.tvaudiocontrol.getVolume()}catch(b){switch(b.name){case QC:this.a.debug("The application does not have the privilege to get the volume.",RC);break;default:this.a.debug(NC,b)}}return a};
57
+ _.h.setVolume=function(a){try{tizen.tvaudiocontrol.setVolume(Math.max(0,Math.min(100*a,100)))}catch(b){switch(b.name){case "InvalidValueError":this.a.warn("Invalid value passed for setVolume.","The passed value value should be in the range of 0 to 1.");break;case QC:this.a.warn("The application does not have the privilege to set the volume.",RC);break;default:this.a.warn("An unknown error occured while trying to set volume",b)}}};
58
+ _.h.isLive=function(){if(this.g&&this.f)return this.f.isLive;try{return"1"===webapis.avplay.getStreamingProperty("IS_LIVE")}catch(a){this.S(JSON.stringify(a))}};_.h.stop=function(){try{webapis.avplay.stop()}catch(a){this.a.debug(a)}};_.h.getDrmInfo=function(){this.h&&this.h.getDrmInfo();return null};_.h.setSourceIndex=function(a){this.D=a};_.h.getSourceIndex=function(){return this.D};_.h.getLoadedSource=function(){return this.m&&this.m[this.getSourceIndex()]};
59
+ var jE="IDLE",iE="READY",dD="PLAYING",eD="PAUSED",BD="VIDEO",uD="AUDIO",vD="TEXT",lE="PLAYER_MSG_RESOLUTION_CHANGED",kE="PLAYER_MSG_BITRATE_CHANGE",YC={PLAYREADY:"PLAYREADY",Jj:"EME_PLAYREADY",Sj:"VERIMATRIX",gd:"WIDEVINE_CDM",Kj:"EME_WIDEVINE_CDM",Tj:"WIDEVINE_CLASSIC"};_.u(bE,_.Mh);_.h=bE.prototype;_.h.hf=function(){var a=this;this.h.debug("On Stream completed. Current time: ",this.getPosition());this.trigger(new _.D(_.Uc));this.configuration.loop?this.seek(this.configuration.startTime||0)["catch"](function(){a.h.debug("Could not loop playback")}):this.a.stop()};_.h.ff=function(a){this.trigger(new _.D(_.ue,{currentTime:a.currentTime/1E3}))};
60
+ _.h.jf=function(a){var b=this.a.getPosition(),c=b+a.duration/1E3,d=a.text||"";this.h.debug("Got subtitles: ",d,"start:",b,"end:",c,a);(d=_.bh(d))&&this.o.append([new _.pg(b,c,d)],[])};_.h.gf=function(a){this.h.debug("DRM event: "+a.drmType+", data: "+a.drmData)};_.h.Nf=function(){this.A||(this.h.debug("Initial buffering completed..."),this.A=!0)};
61
+ _.h.S=function(a){this.h.debug("Error: TYPE: "+a.eventType);cD(this.f,_.Jl);a=new _.J(_.K,7,7200,{tizenerror:a.eventType});this.a.release();this.trigger(new _.D(_.Wc,{detail:a}))};
62
+ _.h.init=function(a,b){this.configuration=this.B=b;this.w=a;this.a.on(hE,this.hf,this);this.a.on(KD,this.ff,this);this.a.on(nE,this.jf,this);this.a.on(oE,this.gf,this);this.a.on(pE,this.S,this);this.a.on(gE,this.Nf,this);var c=this.f;c.a.on(UD,c.mf,c);c.a.on(fE,c.lf,c);c.a.on(gE,c.kf,c);c.a.on(VD,c.Vf,c);c.a.on(XD,c.Uf,c);c.a.on(hE,c.nf,c);this.m.Fb(this);this.h.debug("Initializing player surface");this.w.hideMediaElement();c=qE;qE+=1;this.j=_.gm(_.Ad,{id:"__clpp_tizen_player_"+c,type:"application/avplayer"});
63
+ this.w.addElementToContainer(this.j,!0);var d=this.w.getMedia();if(d){c=this.j;var e=[_.Ve,_.Zc,"position",_.dd,"top"],f={};d=null!==d.parentElement?window.getComputedStyle(d,null):d.style;if(!e||0===e.length){e||(e=[]);for(var g in d)e.push(g)}g=_.t(e);for(e=g.next();!e.done;e=g.next())e=e.value,f[e]=d[e];_.nm(c,f);cE(this)}};_.h.getSurface=function(){return this.w};_.h.getConfiguration=function(){return this.configuration};
64
+ _.h.destroy=function(){var a=this;return _.z(function(b){switch(b.a){case 1:return _.v(b,a.release(),2);case 2:a.a.off(hE,a.hf);a.a.off(KD,a.ff);a.a.off(nE,a.jf);a.a.off(oE,a.gf);a.a.off(pE,a.S);a.a.off(gE,a.Nf);if(!a.g){b.G(3);break}return _.v(b,a.g.destroy(),4);case 4:a.g=null;case 3:a.j&&(a.j.parentElement.removeChild(a.j),a.j=null),a.m.destroy(),a.f.destroy(),a.m=null,a.f=null,_.w(b)}})};_.h.namespace=function(){return rE};_.h.getPlaybackRate=function(){return this.a.getPlaybackRate()};
65
+ _.h.setDrmCustomDataModifier=function(){};_.h.setCdnErrorCallback=function(){};_.h.setPlaybackRate=function(a){this.a.setPlaybackRate(a)};_.h.getPosition=function(){return 0<(this.configuration.startTime||0)&&!this.A?0:this.f.getState()===_.Fl?this.getDuration():this.a.getPosition()||0};_.h.seek=function(a){return typeof a===_.zd&&0<=a?(this.isLive()||(a=Math.min(a,this.getDuration())),this.a.seek(a)):Promise.reject()};_.h.getPresentationStartTime=function(){return 0};
66
+ _.h.getSeekRange=function(){return{start:0,end:0}};_.h.getVolume=function(){var a=this.a.getVolume();return typeof a===_.zd?a/100:null};_.h.setVolume=function(a){this.a.setVolume(a)};_.h.getDuration=function(){return this.a.getDuration()};_.h.getBufferInfo=function(){this.h.warn(_.ma);return new _.Lh};_.h.getTrackManager=function(){return this.m};_.h.unload=function(){var a=this;return this.a.release().then(function(){a.m.release()})};
67
+ _.h.release=function(){var a=this;return _.z(function(b){switch(b.a){case 1:if(!a.g){b.G(2);break}return _.v(b,a.g.release(),2);case 2:if(!a.o){b.G(4);break}return _.v(b,a.o.destroy(),5);case 5:a.o=null;case 4:return _.v(b,a.a.release(),6);case 6:a.m.release(),a.f.release(),a.A=!1,_.w(b)}})};
68
+ _.h.load=function(a){var b=this,c,d,e,f,g;return _.z(function(k){switch(k.a){case 1:_.Wi(a)&&(b.configuration=_.Vi(b.B,a));c=_.ll(b.configuration,["html",_.xd]);b.o=c.create(b);d=_.Ql(b.configuration)[0];e=!!b.configuration.tizen&&b.configuration.tizen.sideStreamText;if(!e){k.G(2);break}b.g=new gD;b.g.l=b;_.pf(k,3);return _.v(k,b.g.load(d),5);case 5:b.g.start();_.qf(k,2);break;case 3:f=_.rf(k),b.h.error(f);case 2:return _.pf(k,6),_.v(k,b.a.load(b.configuration),8);case 8:_.qf(k,7);break;case 6:throw g=
69
+ _.rf(k),b.onError(g),g;case 7:b.m.load(),_.w(k)}})};_.h.play=function(){var a=this;this.trigger(new _.D(_.Pd));cE(this);return this.a.play().then(function(){fD(a.f)})};_.h.pause=function(){var a=this;return this.a.pause().then(function(){fD(a.f)})};_.h.getState=function(){return this.f.getState()};_.h.getPeriods=function(){return[]};_.h.onError=function(a){var b=new _.D(_.Wc,{detail:a});a.severity===_.K&&(cD(this.f,_.Jl),this.a.release());this.trigger(b);b.defaultPrevented&&(b.a=!0)};
70
+ _.h.getDrmInfo=function(){return this.a.getDrmInfo()};_.h.isEnded=function(){return this.f.getState()===_.Fl};_.h.isPaused=function(){return this.a.getState()===eD};_.h.isMuted=function(){return PD(this.a)};_.h.setMuted=function(a){YD(this.a,a)};_.h.getNetworkEngine=function(){return this.C};_.h.setNetworkEngine=function(a){this.C=a};_.h.isLive=function(){return this.a.isLive()};_.h.getStats=function(){return null};_.h.setSourceIndex=function(a){this.a.setSourceIndex(a)};_.h.getSourceIndex=function(){return this.a.getSourceIndex()};
71
+ _.h.getLoadedSource=function(){return this.a.getLoadedSource()};_.h.canPlay=function(a,b){return(new dE).canPlay(a,b)};_.h.getTimelineCues=function(){return[]};_.h.getTextDisplayer=function(){return this.o};_.h.resetAbr=function(){};bE.prototype.getTextDisplayer=bE.prototype.getTextDisplayer;bE.prototype.setNetworkEngine=bE.prototype.setNetworkEngine;bE.prototype.getNetworkEngine=bE.prototype.getNetworkEngine;var rE="clpp.tizen",qE=0;dE.prototype.a=function(){return rE};
72
+ dE.prototype.canPlay=function(a){a=a.type;var b=!!window.webapis;if((a===_.Rb||a===_.Xb||a===_.Wb)&&b){if(_.ei(2))return 2;if(_.ei(3)||_.ei(4)||_.ei(5)||_.ei(6))return _.B("Use of clpp.tizen.TizenComponent is not recommended for Tizen version \x3e\x3d 3."),1}return 0};dE.prototype.create=function(){return new bE};_.u(eE,_.ln);eE.prototype.Da=function(){this.a=new dE;_.Of(this.a)};eE.prototype.va=function(){if(this.a){var a=this.a.a();a&&_.Mf[a]&&(delete _.Mf[a],_.Nf.info("Removed Player factory: '"+a+"'"));this.a=null}};eE.prototype.id=function(){return"tizen"};_.A("clpp.tizen.TizenComponent",eE);var UD="onbufferingstart",fE="onbufferingprogress",gE="onbufferingcomplete",hE="onstreamcompleted",KD="oncurrentplaytime",mE="onevent",nE="onsubtitlechange",oE="ondrmevent",pE="onerror",VD="preparingstart",XD="preparingend";};
73
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
74
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
75
+ else{_=this.clpp._;(f.call(g,this));}
76
+ })();
package/cjs/cl.ttml.js ADDED
@@ -0,0 +1,31 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var yq='application/mp4; codecs\x3d"stpp.ttml"',zq='application/mp4; codecs\x3d"stpp.ttml.im1i"',Aq='application/mp4; codecs\x3d"stpp.ttml.im1t"',Bq="backgroundColor",Cq="direction",Dq="displayAlign",Eq="region",Fq="sans-serif",Gq="textAlign",Hq="textDecoration",Iq="writingMode",Jq=function(a,b,c){this.g=a;this.f=b;this.a=c},Kq=function(a,b,c){Jq.call(this,a,[],c);this.h=b||""},Lq=function(a,b,c){Jq.call(this,a,b,c)},Mq=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},Uq=function(a,b){var c=null;if(Nq.test(a)){c=Nq.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 Oq.test(a)?c=Pq(Oq,a):Qq.test(a)?c=Pq(Qq,a):Rq.test(a)?(c=Rq.exec(a),c=Number(c[1])/b.frameRate):Sq.test(a)?(c=Sq.exec(a),c=Number(c[1])/b.a):Tq.test(a)&&(c=Pq(Tq,a));return c},Pq=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)},Vq=function(a){return a.split(":").pop()},Wq=function(a){return a.replace(/(\d*\.?\d+)c/g,"$1em")},Yq=function(a,b){for(;Xq.test(a);){var c=Xq.exec(a)[0];a=a.replace(c,parseInt(c,10)/b+"em")}return a},Zq=function(a,b,c,d,e,f,g){Jq.call(this,a,f,g);this.o=b;this.w=c;this.m=d;this.j=e;this.h=[]},$q=function(a,b,c){a=Mq(a,b,Gq);if(!a&&c&&(a=Mq(c,b,Gq),!a&&"rltb"===Mq(c,b,Iq)))return _.ae;switch(a){case _.qc:return _.kg;case _.ae:case _.Tc:return _.ae;default:return _.dd}},
5
+ ar=function(a,b,c){if(_.Zg(a.o))return document.createTextNode(_.bh(a.o||""));if(a.w)return _.gm("br");for(var d=_.gm("span"),e=_.t(a.f),f=e.next();!f.done;f=e.next())_.mm(d,f.value);a=_.t(a.h);for(e=a.next();!e.done;e=a.next())d.appendChild(ar(c.get(e.value),b,c));return d},br=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]))},cr=function(a,
6
+ b,c){Jq.call(this,a,b,c)},fr=function(a,b,c,d){var e=dr.exec(a);a=er.exec(a);return typeof b===_.zd&&0<b&&a?100*Number(a[c])/b:e?Number(e[c]):a?Number(a[c]):d},gr=function(a,b){return typeof b===_.zd&&0<b?_.qg:er.test(a)?0:_.qg},hr=function(a,b){Jq.call(this,"root-container",[],b);this.h=a},ir=function(a,b,c){return typeof a===_.zd?a:typeof b===_.zd?b:c},jr=function(a,b){var c=a.getAttribute("extent");return(c=er.exec(c))?Number(c[b]):null},lr=function(a){a=a.getAttribute("cellResolution");return(a=
7
+ kr.exec(a))?Number(a[2]):null},mr=function(a,b,c){Jq.call(this,a,b,c)},nr=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=[]},pr=function(a){return or.some(function(b){return b in a.a})},qr=function(a,b){if(0===b.length)return[];for(var c=[],d=_.t(b),e=d.next();!e.done;e=d.next())e=e.value,a.a.has(e)&&c.push.apply(c,_.bf(qr(a,a.a.get(e).f)).concat([e]));return c},sr=function(){return"inline-"+rr++},tr=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})},ur=function(a){this.a=a.firstChild;this.f=new Set},vr=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},wr=function(a){return Vq(a.h.nodeName)},xr=function(){this.a=new Map},Gr=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=_.bf(l.m).concat();-1===["#text","span","br"].indexOf(b.nodeName)&&(c=l.f,d=l.j,f=_.bf(l.g).concat(),
9
+ g={},yr.forEach(function(n){n in l.a&&(g[n]=l.a[n])}))}if(b.nodeType===b.ELEMENT_NODE){b.hasAttribute(Eq)&&(c=b.getAttribute(Eq));b.hasAttribute(_.ne)&&f.push.apply(f,_.bf(b.getAttribute(_.ne).split(" ")));d=Array.from(b.attributes).map(function(n){return n.name});d=_.t(d);for(k=d.next();!k.done;k=d.next()){k=k.value;var m=Vq(k);g[m]=b.getAttribute(k)}d=g.backgroundImage}c=new vr(b,c,d,e,f,g);a.a.set(b,c);return c},Or=function(a){this.a=a;this.f=new DOMParser},Pr=function(a){this.f=a},Qr=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")},Rr=function(){},Sr=function(a){this.f=new Or(a);this.a=new _.C("clpp.ttml.Mp4TtmlParser")},Tr=function(){this.a=new Rr};Jq.prototype.aa=function(){return this.g};Jq.prototype.getAttribute=function(a){return this.a[a]};_.u(Kq,Jq);_.u(Lq,Jq);var Nq=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Oq=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Qq=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d+)$/,Rq=/^(\d*(?:\.\d*)?)f$/,Sq=/^(\d*(?:\.\d*)?)t$/,Tq=/^(?:(\d*(?:\.\d*)?)h)?(?:(\d*(?:\.\d*)?)m)?(?:(\d*(?:\.\d*)?)s)?(?:(\d*(?:\.\d*)?)ms)?$/,dr=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,er=/^(\d+)px (\d+)px$/,kr=/^(\d+) (\d+)$/,Xq=/(\d+)px/,Ur=/^(\d+px|\d+em|\d*\.?\d+c)$/,or=["fontStyle","fontSize","fontFamily","fontWeight","lineHeight",
11
+ "color",Bq,"opacity","padding","zIndex",Gq,Dq,Iq,Cq,Hq,"textOutline"],yr=["begin",_.Tc];_.u(Zq,Lq);
12
+ Zq.prototype.build=function(a,b,c,d,e,f,g){var k=Uq(this.a.begin,b);b=Uq(this.a.end,b);if(null===k||null===b)return null;k+=c;b+=c;c=_.gm(_.Lc);for(var l=_.t(this.h),m=l.next();!m.done;m=l.next())c.appendChild(ar(g.get(m.value),e,g));g=new _.pg(k,b,c.innerHTML,_.we);g.cssClassList=_.bf(this.f).concat();g.textAlign=$q(this,e,null);g.writingMode=_.lg;g.line=-1;g.lineInterpretation=_.mg;g.lineAlign=_.ng;g.containerRows=ir(null,lr(a),15);if(this.m&&(f=f.get(this.m))){g.region=f.build(a,e);g.textAlign=
13
+ $q(this,e,f);a:switch(Mq(f,e,Iq)){case "tb":case "tblr":a=_.Ee;break a;case "tbrl":a=_.Fe;break a;default:a=_.lg}g.writingMode=a;a:switch(Mq(f,e,Dq)){case _.qc:a=50;break a;case "after":a=-1;break a;default:a=0}g.line=a;a:switch(Mq(f,e,Dq)){case _.qc:a=1;break a;default:a=_.mg}g.lineInterpretation=a;a:switch(Mq(f,e,Dq)){case _.qc:e=_.qc;break a;default:e=_.ng}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};_.u(cr,Lq);
15
+ cr.prototype.build=function(a,b){var c=new _.sg;c.id=this.aa();var d=ir(a.h.containerWidth,jr(a,1),720),e=ir(a.h.containerHeight,jr(a,2),480);a:switch(Mq(this,b,Dq)){case "after":var f="flex-start";break a;case _.qc:f=_.qc;break a;default:f="flex-end"}c.displayAlign=f;a:switch(Mq(this,b,Iq)){case "tb":case "tblr":f="row-reverse";break a;case "tbrl":f="row";break a;default:f=_.Bc}c.writingMode=f;f=this.getAttribute("extent")||Mq(this,b,"extent");c.width=fr(f,d,1,100);c.widthUnits=gr(f,d);c.height=
16
+ fr(f,e,2,100);c.heightUnits=gr(f,e);f=this.getAttribute("origin")||Mq(this,b,"origin");c.viewportAnchorX=fr(f,d,1,0);c.viewportAnchorY=fr(f,e,2,0);c.viewportAnchorUnits=gr(f,d);c.cssClassList=_.bf(this.f).concat();return c};_.u(hr,Jq);_.u(mr,Jq);
17
+ mr.prototype.build=function(a){var b=null;var c=lr(a);c&&(b=ir(a.h.containerHeight,jr(a,2),480)/c);b=ir(a.h.fontSizeRadix,b,16);a=[];c="::ttml ."+this.g+", ::ttml ."+this.g+" * {";for(var d=_.t(Vr.entries()),e=d.next();!e.done;e=d.next()){var f=_.t(e.value);e=f.next().value;f=f.next().value;e in this.a&&(c+=f+":"+Wq(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&&!Ur.test(g)&&Ur.test(k)&&Ur.test(l)?(e=g,f=k):2===d.length&&!Ur.test(g)&&Ur.test(k)?(e=g,f=k):2===d.length&&Ur.test(g)&&Ur.test(k)&&(f=g);if(""!==f){f=Wq(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",Fq).replace("proportionalSerif",Fq).replace("sansSerif",Fq).replace("default",Fq)+";":"");a:{if(Hq in this.a){d=[];e=_.t(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
+ Wq(this.a.padding)+";":"";c=c+d+e;"lineHeight"in this.a?(d="",e=this.a.lineHeight,e=Wq(e),e=Yq(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=Wq(d);d=Yq(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 Vr=new Map([["color","color"],[Bq,"background-color"],[Cq,Cq],["fontStyle","font-style"],["fontWeight","font-weight"],["opacity","opacity"],["zIndex","z-index"]]);var rr=0;ur.prototype.next=function(){if(!this.a)return null;var a=this.a;do this.f.add(a),a.nodeType!==Node.TEXT_NODE&&!Wr.has(Vq(a.nodeName))||Xr.has(Vq(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&&!Wr.has(Vq(a.nodeName))));var b=this.a;this.a=a;return b};var Wr=new Set(["tt","head","layout",_.od,_.ad,Eq,"styling",_.ne,"body",_.Lc,"p","span","br"]),Xr=new Set([_.ne,_.ad]);vr.prototype.aa=function(){return this.a.id};Or.prototype.parseInit=function(){};
22
+ Or.prototype.parseMedia=function(a,b,c){c&&c.length||(c=[a.byteLength]);var d=_.H.xa(this.a.ttml||{}),e=_.Q(a,0,c[0]);e=_.Qg(e);if(""===e)return{cues:[],styles:[]};var f=null;try{f=this.f.parseFromString(e,_.te)}catch(n){throw new _.J(_.K,2,2005,"Failed to parse TTML.");}d=new nr(d);e=new xr;f=new ur(f);b=b.periodStart;typeof b===_.zd&&(d.w=b);b=c[0];for(var g=1;g<c.length;++g){var k=c[g],l=_.Q(a,b,k);l=_.dj(l);var m="urn:mpeg:14496-30:subs:"+g;d.g.set(m,new Kq(m,l,{imageType:"PNG",encoding:"Base64"}));
23
+ b+=k}for(;f.a;)a=f.next(),a=Gr(e,a),"tt"===wr(a)&&(d.j=new hr(d.A,Object.assign({},a.a))),"tt"===wr(a)&&(d.o=new br(a.a.frameRate,a.a.subFrameRate,a.a.frameRateMultiplier,a.a.tickRate)),wr(a)!==_.ad||a.a.begin||a.a.end||(c="#"+a.aa(),d.g.set(c,new Kq(c,a.h.textContent,a.a))),wr(a)===_.ad&&a.a.begin&&a.a.end?(c="#"+sr(),b=new Kq(c,a.h.textContent,a.a),d.g.set(c,b),c=b):c=null,c&&(a.j=c.aa()),wr(a)===_.ne&&(c=a.aa()||sr(),b=new mr(c,a.g,Object.assign({},a.a)),d.a.set(c,b),a.f&&d.h.get(a.f).f.push(c)),
24
+ wr(a)!==_.ne&&pr(a)?(c=sr(),b=new mr(c,[],Object.assign({},a.a)),d.a.set(c,b),c=b):c=null,c&&a.g.push(c.aa()),wr(a)!==_.Lc||!a.a.extent&&!a.a.origin?c=null:(c=sr(),b=new cr(c,qr(d,a.g),Object.assign({},a.a)),d.h.set(c,b),c=b),c&&(a.f=c.aa()),wr(a)!==Eq?c=null:(c=a.aa(),b=new cr(c,qr(d,a.g),Object.assign({},a.a)),d.h.set(c,b),c=b),c&&(a.f=c.aa()),c=a.m,-1===["#text","span","br"].indexOf(wr(a))||0===c.length?c=null:(c=c[c.length-1],d.f.has(c)?(b=sr(),g=new Zq(b,"#text"===a.h.nodeName?a.h.textContent:
25
+ null,"br"===wr(a),a.f,a.j,qr(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.aa()),"p"===wr(a)||a.j?(c=sr(),b=new Zq(c,null,!1,a.f,a.j,qr(d,a.g),a.a),d.f.set(c,b),d.m.push(b),c=b):c=null,c&&a.m.push(c.aa());e=tr(d);f=[];a=_.t(d.a.values());for(c=a.next();!c.done;c=a.next())f.push.apply(f,_.bf(c.value.build(d.j)));return{cues:e,styles:f}};Pr.prototype.a=function(a){a=(new Or(this.f)).parseMedia(a,{periodStart:0,segmentStart:null,segmentEnd:0}).cues;var b="WEBVTT\n\n";a=_.t(a);for(var c=a.next();!c.done;c=a.next()){c=c.value;var d=Qr(c.startTime)+" --\x3e "+Qr(c.endTime),e=[];switch(c.textAlign){case _.dd:e.push("align:left");break;case _.ae:e.push("align:right");break;case _.kg:e.push("align:middle");break;case _.dd:e.push("align:start");break;case _.ae:e.push("align:end")}switch(c.writingMode){case _.Ee:e.push("vertical:lr");break;
26
+ case _.Fe:e.push("vertical:rl")}b+=d+(e.length?" "+e.join(" "):"")+"\n";b+=c.payload+"\n\n"}return _.Ug(b)};Rr.prototype.probe=function(a,b){return a===_.Vb&&b===_.se};Rr.prototype.create=function(a){return new Pr(a)};Sr.prototype.parseInit=function(a){var b=!1;(new _.pk).L(_.rd,_.qk).L(_.ve,_.qk).L(_.md,_.qk).L(_.qd,_.qk).L(_.ke,_.qk).U(_.me,_.rk).L("stpp",function(c){b=!0;c.cb.stop()}).parse(a);if(!b)throw new _.J(_.K,2,2007);};
27
+ Sr.prototype.parseMedia=function(a,b){var c=this,d=!1,e=[],f=[],g=[];(new _.pk).L("moof",_.qk).L("traf",_.qk).U("subs",function(k){for(var l=_.Dj(k.F),m=0;m<l;++m){k.F.skip(4);for(var n=_.Cj(k.F),p=0;p<n;++p){var q=1===k.version?_.Dj(k.F):_.Cj(k.F);g.push(q);k.F.skip(6)}}}).L(_.ld,_.sk(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}};_.u(Tr,_.ln);Tr.prototype.Da=function(){_.Fo[_.Vb]=Or;_.Fo[_.Tb]=Sr;_.Fo[yq]=Sr;_.Fo[Aq]=Sr;_.Fo[zq]=Sr;_.oh.push(this.a)};Tr.prototype.va=function(){_.Go(_.Vb);_.Go(_.Tb);_.Go(yq);_.Go(Aq);_.Go(zq);_.qh(this.a)};Tr.prototype.id=function(){return _.pe};_.A("clpp.ttml.TtmlComponent",Tr);};
28
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
29
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
30
+ else{_=this.clpp._;(f.call(g,this));}
31
+ })();
@@ -0,0 +1,10 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var mq="VerimatrixVCAS",nq="clpp.verimatrix.Vcas",oq="clpp.verimatrix.VcasComponent",uq=function(a){_.uj.call(this,mq);var b={};b[pq]=pq;b[qq]=qq;var c=a.authenticator,d=void 0===a.licenseRequestVuidLocation?rq: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?sq:a.fairPlayAssetIdStrategy;this.A=a.deviceId;this.a=c;
3
+ this.C=d;this.B=b;this.w=tq(this,e);this.o=tq(this,f);this.m=tq(this,g);this.j=k;this.H=l;this.D=m;this.f=new _.C(nq);_.$g(this.w)?this.f.warn(_.rb):this.Ea(_.Fc,{licenseUrl:this.w,videoRobustness:[_.gb,void 0],audioRobustness:[_.fb,void 0],persistentStateRequired:!1,distinctiveIdentifierRequired:!1,serverCertificate:null,modifiers:{licenseRequest:this.h.bind(this)}});_.$g(this.o)?this.f.warn(_.Xa):this.Ea(_.Ec,{licenseUrl:this.o,videoRobustness:["3000"],audioRobustness:["2000"],modifiers:{licenseRequest:this.h.bind(this)}});
4
+ _.$g(this.m)?this.f.warn(_.Da):_.$g(this.j)?this.f.warn(_.Ca):this.Ea(_.Dc,{licenseUrl:this.m,certificateUrl:this.j,modifiers:{licenseRequest:this.K.bind(this),licenseResponse:this.M.bind(this),extractContentId:this.I.bind(this)}})},tq=function(a,b){if(a.C===rq){var c=Object.assign({},{deviceId:_.ej(_.Wg(a.A))},a.a&&{authenticator:_.ej(_.Wg(a.a))});return b+_.Jj(c)}return b},vq=function(){this.l=null;this.a=new _.C(oq)};_.u(uq,_.uj);
5
+ uq.prototype.h=function(a,b){if(this.C===wq){var c=this.B[qq],d={};d[this.B[pq]]=this.A;this.a&&(d[c]=this.a);Object.keys(d).forEach(function(e){b.headers[e]=d[e]})}};uq.prototype.I=function(a,b){var c=_.Nj(b);switch(this.D){case xq:c=_.Jj({r:c,ik:this.H},!0)}return c};uq.prototype.K=function(a,b){this.h(a,b);_.Pj(b)};uq.prototype.M=function(a,b){_.Qj(b)};_.A(nq,uq);uq.prototype.constructor=uq.prototype.constructor;uq.NAME=mq;var rq="query-string",wq="http-header";
6
+ uq.LicenseRequestVuidLocation={QUERY_STRING:rq,HTTP_HEADER:wq};var pq="DeviceId",qq="Authenticator";uq.LicenseRequestHttpHeader={DEVICE_ID_HEADER:pq,AUTHENTICATOR_HEADER:qq};var sq="keyid",xq="contentid-siteid";uq.FairPlayAssetIdStrategy={KEYID:sq,CONTENTID_SITEID:xq};_.u(vq,_.ln);_.h=vq.prototype;_.h.Da=function(a){this.l=a};_.h.va=function(){this.l=null};_.h.Vb=function(){var a=this.l.getConfiguration();if(a.drm&&a.drm.env===mq){a=a.drm.customData;if(!a)throw new _.J(_.K,7,7100,_.Gc);a=new uq(a);this.a.info("Registering the Verimatrix VCAS Ultra environment");_.pj(a)}};_.h.release=function(){};_.h.id=function(){return"verimatrix-vcas"};_.A(oq,vq);};
7
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
8
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
9
+ else{_=this.clpp._;(f.call(g,this));}
10
+ })();
@@ -0,0 +1,18 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var cq="Registering listeners",dq="clpp.vimond.VimondPlugin",eq=function(a,b,c,d,e){this.D=a;this.H=b;this.I=c;this.l=d;this.C=e;this.f=new _.Vf;this.m=!0;this.g=this.j=this.A=!1;this.B=null;this.h=new _.nh(this.tf.bind(this));this.a=new _.C("clpp.vimond.VimondDispatcher");this.o=this.w=0;this.l&&this.f&&(this.a.debug(cq),this.f.on(this.l,_.he,this.Nh.bind(this)),this.f.on(this.l,_.ue,this.Oh.bind(this)),this.f.on(this.l,_.tb,this.Lh.bind(this)),this.f.on(this.l,_.ub,this.Mh.bind(this)))},fq=function(a,
3
+ b){a.l.trigger(new _.D(_.Le,{detail:b}))},gq=function(a,b,c){b&&(a.A=!0,a.h.stop());a.l.onError(new _.J(b?_.K:1,9,9201,c))},hq=function(a,b,c,d,e){this.o=a;this.m=c;this.g=b;this.a=d;this.j=e;this.h=new _.C("clpp.vimond.VimondService");this.f=0},iq=function(a){this.l=a;this.a=new _.Vf;this.g=new _.C("clpp.vimond.VimondAdapter");this.f=this.h=!1;this.l&&this.a&&(this.g.debug(cq),this.a.on(this.l,_.Xd,this.Yi.bind(this)),this.a.on(this.l,_.tb,this.Jh.bind(this)),this.a.on(this.l,_.ub,this.Kh.bind(this)))},
4
+ jq=function(a,b){var c=a.l.getState();if(1===b)return["str-start",_.Qd];if(a.h)return[_.Tc,_.Ld];if(c===_.Fl)return[_.Tc,null];if(c===_.Jl)return[_.Wc,_.Ld];var d=_.Ld;if(c===_.Dl||c===_.Ml||a.f)d=_.Qd;return["period",d]},kq=function(){this.a=!1;this.h=new _.C(dq);this.j=this.g=this.f=null},lq=function(){};_.h=eq.prototype;_.h.Oh=function(){this.g||(this.g=1<Math.abs(this.w-this.l.getPosition()));this.w=this.l.getPosition()};_.h.Lh=function(){this.a.debug("Ad break started");this.j=!0};
5
+ _.h.Mh=function(){this.a.debug("Ad break stopped");this.j=!1};
6
+ _.h.Nh=function(a){var b=this,c,d,e,f,g;return _.z(function(k){if(1==k.a){c=a.detail;d=_.Hl;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.G(0);
7
+ b.B=e;return _.v(k,b.tf(),3)}e===d.ENDED&&b.h.stop();_.w(k)})};
8
+ _.h.tf=function(){var a=this,b,c,d,e,f,g;return _.z(function(k){if(1==k.a){var l=Math.floor(Date.now()/1E3);0<a.o&&a.a.debug("Last event was "+(l-a.o)+" seconds ago");a.o=l;a.h.stop();a.h.Z(a.m?10:a.D);a.m=!1;_.pf(k,2);l=a.C;l.f++;var m=_.H.Sa(l.m);m.client.buildName=_.oa;m.client.buildVersion=_.da;var n=m.client,p=l.a.l.getDrmInfo();n.drm=p?p.keySystem:"";m.client.pageUrl=document.location.href;m.client.streamUrl=l.a.l.getLoadedSource().url;m.client.userAgent=navigator.userAgent;m.client.videoFormat=
9
+ l.a.l.getLoadedSource().type||"";n=m.client;p=l.a.l.getLoadedSource();p=((new _.Hj(p.url)).scheme||"").replace(":","");n.videoProtocol=p;n=jq(l.a,l.f);m.client.playerEvent=n[0]||"";m.client.playerState=n[1]||"";m.progress.vod&&(m.progress.vod.position=l.a.getPosition());if(n=m.progress.live){p=l.a;p=Math.floor(p.l.getPresentationStartTime()+p.l.getPosition());p=(new Date(1E3*p)).toISOString();n.position=p;var q=l.a;p=q.l.getPosition();q=q.l.getSeekRange().end;n.onLiveEdge=30>Math.abs(q-p);typeof n.liveResumePossible!==
10
+ _.hc&&(n.liveResumePossible=!0)}m.progress.eventNumber=l.f;m.timestamp=(new Date).toISOString();l.h.debug("Fire an event");n=_.fh(l.o);n.method="POST";n.contentType="application/json";n.headers.Authorization="Bearer "+l.g;n.body=_.Wg(JSON.stringify(m));l=l.j.fetch(n).N;return _.v(k,l,4)}if(2!=k.a)return b=k.f,fq(a,b),_.qf(k,0);d=c=_.rf(k);e=d.code;f=d.data;g=[1002,1003];g.includes(e)?(a.a.debug("Unreachable service"),fq(a,f),gq(a,a.H,f)):1001===e?(a.a.debug("Generic service error"),fq(a,f),gq(a,a.I,
11
+ f)):a.a.error(c.toString());_.w(k)})};_.h.dispose=function(){this.a.debug(_.nb);_.Yf(this.f);this.h.stop()};hq.prototype.Te=function(a){this.g=a};_.h=iq.prototype;_.h.getPosition=function(){return Math.floor(this.l.getPosition())};_.h.Yi=function(){this.h=!0};_.h.Jh=function(){this.f=!0};_.h.Kh=function(){this.f=!1};_.h.dispose=function(){this.g.debug(_.nb);_.Yf(this.a)};_.u(kq,_.So);_.h=kq.prototype;_.h.onPlayerCreated=function(){};
12
+ _.h.onContentWillLoad=function(a){var b=a.getConfiguration();(this.a=!_.H.R(b.vimond)&&typeof b.vimond===_.Ad)?a.namespace()===_.wc&&(this.a=!1,this.h.info("Vimond does not report when casting.")):this.h.warn("Vimond plugin is loaded but not configured. Will do nothing.");if(this.a){b=a.getConfiguration().vimond;for(var c=_.t(["authToken","playerEventRequest"]),d=c.next();!d.done;d=c.next())if(d=d.value,!b[d]){this.h.warn(d+" key is missing");a.onError(new _.J(1,9,9200));return}this.h.debug("Configuration is valid");
13
+ c=b.failIfUnreachable;typeof c!==_.hc&&(c=!0);d=b.failOnError;typeof d!==_.hc&&(d=!0);this.f=new iq(a);this.g=new hq(b.playerEventRequest.uri,b.authToken,b.playerEventRequest.body,this.f,a.getNetworkEngine());this.j=new eq(b.playerEventRequest.eventInterval,c,d,a,this.g)}};_.h.onPlayerWillRelease=function(){this.a&&(this.f&&this.f.dispose(),this.j&&this.j.dispose(),this.j=this.g=this.f=null)};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"vimond"};
14
+ _.h.Te=function(a){this.a&&this.g&&this.g.Te(a)};_.A(dq,kq);kq.prototype.updateAuthToken=kq.prototype.Te;kq.Id="vimond";lq.prototype.create=function(){return new kq};_.fn(new lq);};
15
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
16
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
17
+ else{_=this.clpp._;(f.call(g,this));}
18
+ })();
package/cjs/cl.vtt.js ADDED
@@ -0,0 +1,19 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var Jp=" The setting will be ignored.",Kp="VTT parser encountered an invalid VTT setting: ",Lp="application/x-subrip",Mp="text/srt",Np='text/vtt; codecs\x3d"vtt"',Op='text/vtt; codecs\x3d"wvtt"',Pp=function(a){_.Zn(a,/[ \t]+/gm)},Qp=function(a){return a.a==a.f.length?null:(a=_.Zn(a,/[^ \t\n]*/gm))?a[0]:null},Rp=function(){},Sp=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},Tp=function(){},Up=function(){},Wp=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.kg:a.textAlign=_.Yo[b.toUpperCase()];
4
+ else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.Ee:_.Fe;else if(d=/^size:([\d.]+)%$/.exec(b))a.size=Number(d[1]);else if(d=/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/.exec(b))a.position=Number(d[1]),d[2]&&(b=d[2],a.positionAlign=b==_.gd||b==_.ge?_.gd:b==_.hd||b==_.Tc?_.hd:_.qc);else if(d=/^region:(.*)$/.exec(b)){if(b=Vp(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]),c[2]&&(a.lineAlign=
5
+ _.Zo[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.mg,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Zo[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Vp=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.B("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Xp=function(a){a=_.Zn(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;var b=Number(a[2]),
6
+ c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Yp=function(){},Zp=function(){this.a=null;this.f=new _.C("clpp.vtt.mp4")},aq=function(a,b,c){var d,e,f;(new _.pk).L("payl",_.sk(function(g){d=_.Qg(g)})).L("iden",_.sk(function(g){e=_.Qg(g)})).L("sttg",_.sk(function(g){f=_.Qg(g)})).parse(a);return d?$p(d,e,f,b,c):null},$p=function(a,b,c,d,e){a=new _.pg(d,e,a);b&&(a.id=b);if(c)for(b=new _.Yn(c),c=Qp(b);c;)Wp(a,c,[])||_.B(Kp,c,Jp),Pp(b),c=Qp(b);return a},bq=function(){this.a=
7
+ new Tp};Rp.prototype.a=function(a){a=_.Qg(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.t(b);for(var c=b.next();!c.done;c=b.next())a+=Sp(c.value)}return _.Ug(a)};Tp.prototype.create=function(){return new Rp};Tp.prototype.probe=function(a,b){return(a===Mp||a===Lp)&&b===_.se};Up.prototype.parseInit=function(){};
8
+ Up.prototype.parseMedia=function(a,b){var c=_.Qg(a);c=c.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var d=c.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(d[0]))throw new _.J(_.K,2,2E3);c=b.periodStart;if(d[0].includes("X-TIMESTAMP-MAP")){var e=d[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),f=d[0].match(/MPEGTS:(\d+)/m);if(e&&f){c=Xp(new _.Yn(e[1]));if(null==c)throw new _.J(_.K,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}f=[];e=_.t(d);for(var g=e.next();!g.done;g=e.next()){var k=g.value;if(/^region/.test(k.toLowerCase())){k=new _.Yn(k.replace(/\n/g," "));g=new _.sg;Qp(k);Pp(k);for(var l=Qp(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=Number(m[1]),n.regionAnchorY=Number(m[2]);
10
+ else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.B("VTT parser encountered an invalid VTTRegion setting: ",l,Jp);Pp(k);l=Qp(k)}f.push(g)}}e=[];k=_.t(d);for(g=k.next();!g.done;g=k.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&e.push(m[0]);while(m)}k=[];d=_.t(d);
11
+ for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.Yn(p[0]);m=Xp(l);var r=_.Zn(l,/[ \t]+--\x3e[ \t]+/g);n=Xp(l);if(null==m||null==r||null==n)throw new _.J(_.K,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.pg(m,n,p,_.Ne);g&&(m.id=g);Pp(l);for(n=Qp(l);n;)Wp(m,n,f)||_.B(Kp,n,Jp),Pp(l),n=Qp(l);null!=g&&(m.id=g);
12
+ g=m}g&&k.push(g)}return{cues:k,styles:e}};_.u(Yp,Up);Yp.prototype.parseMedia=function(a,b){return Up.prototype.parseMedia.call(this,(new Rp).a(a),b)};Zp.prototype.parseInit=function(a){var b=this,c=!1;(new _.pk).L(_.rd,_.qk).L(_.ve,_.qk).L(_.md,_.qk).U("mdhd",function(d){0==d.version?(d.F.skip(4),d.F.skip(4),b.a=_.Dj(d.F),d.F.skip(4)):(d.F.skip(8),d.F.skip(8),b.a=_.Dj(d.F),d.F.skip(8));d.F.skip(4)}).L(_.qd,_.qk).L(_.ke,_.qk).U(_.me,_.rk).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.J(_.K,2,2008);if(!c)throw new _.J(_.K,2,2008);};
13
+ Zp.prototype.parseMedia=function(a,b){if(!this.a)throw this.f.error("No init segment for MP4+VTT!"),new _.J(_.K,2,2008);var c=0,d=[],e,f=[],g=!1,k=!1,l=!1,m=null;(new _.pk).L("moof",_.qk).L("traf",_.qk).U("tfdt",function(M){g=!0;c=0==M.version?_.Dj(M.F):_.Fj(M.F)}).U("tfhd",function(M){var O=M.flags;M=M.F;M.skip(4);O&1&&M.skip(8);O&2&&M.skip(4);m=O&8?_.Dj(M):null}).U("trun",function(M){k=!0;var O=M.version,T=M.flags;M=M.F;var Ma=_.Dj(M);T&1&&M.skip(4);T&4&&M.skip(4);for(var ea=[],na=0;na<Ma;na++){var ya=
14
+ {duration:null,sampleSize:null,Qe:null};T&256&&(ya.duration=_.Dj(M));T&512&&(ya.sampleSize=_.Dj(M));T&1024&&M.skip(4);T&2048&&(ya.Qe=0==O?_.Dj(M):_.Ej(M));ea.push(ya)}d=ea}).L(_.ld,_.sk(function(M){l=!0;e=M})).parse(a);if(!l&&!g&&!k)throw new _.J(_.K,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.zj(p,!1);for(var q=_.t(d),r=q.next();!r.done;r=q.next()){r=r.value;var x=r.duration||m,y=r.Qe?c+r.Qe:n;n=y+(x||0);var E=0;do{var I=_.Dj(p);E+=I;var F=_.Dj(p);F=_.uk(F);var G=null;
15
+ "vttc"==F?8<I&&(G=_.Gj(p,I-8)):("vtte"!=F&&this.f.error("Unknown box "+F+"! Skipping!"),p.skip(I-8));x?G&&f.push(aq(G,b.periodStart+y/this.a,b.periodStart+n/this.a)):this.f.error("WVTT sample duration unknown, and no default found!")}while(r.sampleSize&&E<r.sampleSize)}return{cues:f.filter(_.ml),styles:[]}};_.u(bq,_.ln);bq.prototype.Da=function(){_.Fo[_.se]=Up;_.Fo[Np]=Up;_.Fo[Op]=Up;_.Fo[_.Ub]=Zp;_.Fo[Mp]=Yp;_.Fo[Lp]=Yp;_.oh.push(this.a)};bq.prototype.va=function(){_.Go(_.se);_.Go(Np);_.Go(Op);_.Go(_.Ub);_.Go(Mp);_.Go(Lp);_.qh(this.a)};bq.prototype.id=function(){return _.pe};_.A("clpp.vtt.VttComponent",bq);};
16
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
+ else{_=this.clpp._;(f.call(g,this));}
19
+ })();
@@ -0,0 +1,23 @@
1
+ (function(){var g={}; var _ = _ || {}
2
+ var f=function(window){var zp="accountCode key is missing",Ap="clpp.npaw.YouboraPlugin",Bp="content.isLive",Cp=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.f=new _.Vf;b.a=new _.C("clpp.npaw.YouboraAdapter");b.h=!1;b.g=!1;b.registerListeners();return b},Dp=function(a){a.plugin.isInitiated||(a.g=!1,a.fireInit())},Ep=function(a){var b=a.l.getDrmInfo();b&&(b=b.keySystem,(b=b.startsWith(_.Fc)?"Widevine":b.startsWith(_.Dc)?"FairPlay":b.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":b.startsWith(_.Jd)?
3
+ "ClearKey":b.startsWith(_.Cc)?"Primetime":b)&&a.plugin.setOptions({"content.drm":b}));a.fireJoin()},Fp=function(a){var b=youbora.Adapter.call(this,a)||this;b.l=a;b.a=null;b.h=null;b.f=new _.Vf;b.g=new _.C("clpp.npaw.YouboraAdsAdapter");b.registerListeners();return b},Gp=function(){this.a=null;this.f=!1;this.g=new _.C(Ap);this.h=this.j=null},Hp=function(a,b){var c=b.getConfiguration();a.f=!_.H.R(c.youbora)&&typeof c.youbora===_.Ad;a.f?window.youbora&&6<=+youbora.VERSION.split(".")[0]?b.namespace()===
4
+ _.wc&&(a.f=!1,a.g.info("Youbora does not report when casting.")):(a.g.warn("No valid Youbora SDK available. Youbora SDK is supported","starting from version",6),a.f=!1,b.onError(new _.J(1,9,9100))):a.g.warn("Youbora plugin is loaded but not configured. Will do nothing.")},Ip=function(){};_.u(Cp,youbora.Adapter);_.h=Cp.prototype;_.h.getPlayhead=function(){return this.l.getPosition()};_.h.getDuration=function(){return this.l.getDuration()};
5
+ _.h.getRendition=function(){var a=this.l.getTrackManager();if(a&&(a=a.fa())){var b=a.width;var c=a.height;var d=a.bandwidth}b&&c&&d||(a=this.l.getStats()||_.ul(),b=b||a.width,c=c||a.height,d=d||a.streamBandwidth);return youbora.Util.buildRenditionString(b,c,d)};_.h.getIsLive=function(){return this.l.isLive()};_.h.getResource=function(){var a=this.l.getLoadedSource();return a&&a.url};_.h.getBitrate=function(){return(this.l.getStats()||_.ul()).streamBandwidth};
6
+ _.h.getThroughput=function(){return(this.l.getStats()||_.ul()).estimatedBandwidth};_.h.getPlayrate=function(){return this.l.getPlaybackRate()};_.h.getFramesPerSecond=function(){var a=this.l.getTrackManager();return a&&(a=a.Ca())?a.frameRate:null};_.h.getPlayerName=function(){return _.oa};_.h.getVersion=function(){return"6.2.6-rc-1-castlabsadapter-js"};_.h.getPlayerVersion=function(){return _.da};
7
+ _.h.registerListeners=function(){this.l&&this.f&&(this.a.debug("registering listeners"),youbora.Util.logAllEvents(this.l),this.f.on(this.l,_.he,this.yj.bind(this)),this.f.on(this.l,_.Wc,this.Th.bind(this)),this.f.on(this.l,_.Ce,this.tj.bind(this)),this.f.on(this.l,_.Be,this.sj.bind(this)),this.f.on(this.l,_.Lb,this.Ag.bind(this)),this.f.on(this.l,_.mc,this.Fg.bind(this)))};_.h.unregisterListeners=function(){this.a.debug(_.nb);_.Yf(this.f)};
8
+ _.h.yj=function(a){this.a.debug("State changed",a);if(a=a.detail)switch(a.currentState){case _.Kl:this.l.getConfiguration().autoplay&&Dp(this);break;case _.Ml:Dp(this);Ep(this);this.fireResume();this.fireBufferEnd();break;case _.Ll:this.l.getConfiguration().autoplay&&Dp(this);Ep(this);this.fireBufferEnd();this.firePause();break;case _.yl:this.fireBufferEnd();this.fireStop();break;case _.Fl:this.fireBufferEnd();this.h&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Dl:this.fireBufferBegin();
9
+ break;default:this.a.debug("Unhandled state",a)}};_.h.Th=function(a){this.a.debug("Fire error",a);!(a=a.detail)||this.g||10003===a.code&&this.plugin.getAdsAdapter()||(a.severity===_.K?(this.g=!0,this.fireFatalError(""+a.code,a.message)):this.fireError(""+a.code,a.message))};_.h.tj=function(a){this.a.debug("Seeking",a);this.l.isEnded()||(Dp(this),this.fireSeekBegin())};_.h.sj=function(a){this.a.debug("Seeked",a);this.fireSeekEnd()};
10
+ _.h.Ag=function(a){this.a.debug("adsTimeline",a);a=a.adsTimeline;this.h=!!a&&a.ab()};_.h.Fg=function(a){this.a.debug("Casting",a);this.fireCasted()};_.u(Fp,youbora.Adapter);_.h=Fp.prototype;_.h.getDuration=function(){return this.a&&this.a.getDuration()};_.h.getRendition=function(){var a=null;this.a&&(a=youbora.Util.buildRenditionString(this.a.pb(),this.a.ob(),this.a.$a()));return a};_.h.getBitrate=function(){return this.a&&this.a.$a()};_.h.getPlayhead=function(){var a=this.l.getAdsManager();return a&&a.getPosition()};_.h.getResource=function(){return this.a&&this.a.getMediaUrl()};_.h.getTitle=function(){return this.a&&this.a.getTitle()};
11
+ _.h.getProvider=function(){return this.a&&this.a.getAdvertiserName()};_.h.getCreativeId=function(){return this.a&&this.a.getCreativeId()};_.h.getPosition=function(){var a=youbora.Constants.AdPosition,b=null;if(this.a)switch(this.a.Qa()){case 0:b=a.Preroll;break;case 2:b=a.Postroll;break;case 1:b=a.Midroll}this.g.debug("Ad position",b);return b};_.h.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};_.h.getAudioEnabled=function(){var a=this.l.getAdsManager();return a&&0<a.getVolume()};
12
+ _.h.getExpectedBreaks=function(){return this.h&&this.h.getCuePoints().length};_.h.getGivenBreaks=function(){return this.getExpectedBreaks()};_.h.getExpectedAds=function(){return this.a&&this.a.rb()};_.h.getGivenAds=function(){return this.getExpectedAds()};_.h.getBreaksTime=function(){var a=this;return this.h&&this.h.getCuePoints().map(function(b){return-1===b?a.l.getDuration():b})};_.h.getIsFullscreen=function(){return this.l.getSurface().isFullscreen()};
13
+ _.h.getIsVisible=function(){var a=this.l.getSurface().getContainer();a=youbora.Util.calculateAdViewability(a);this.g.debug("is container visible",a);return a};_.h.getPlayerName=function(){return _.oa};_.h.getVersion=function(){return"6.2.6-rc-1-castlabsadsadapter-js"};_.h.getPlayerVersion=function(){return _.da};
14
+ _.h.registerListeners=function(){this.l&&this.f&&(this.f.on(this.l,_.Lb,this.zg.bind(this)),this.f.on(this.l,_.Hb,this.wg.bind(this)),this.f.on(this.l,_.Db,this.tg.bind(this)),this.f.on(this.l,_.Fb,this.ug.bind(this)),this.f.on(this.l,_.xb,this.rg.bind(this)),this.f.on(this.l,_.yb,this.Sd.bind(this,1)),this.f.on(this.l,_.Cb,this.Sd.bind(this,2)),this.f.on(this.l,_.Jb,this.Sd.bind(this,3)),this.f.on(this.l,_.wb,this.qg.bind(this)),this.f.on(this.l,_.Gb,this.vg.bind(this)),this.f.on(this.l,_.Wc,this.sg.bind(this)),
15
+ this.f.on(this.l,_.tb,this.Dg.bind(this)),this.f.on(this.l,_.ub,this.Eg.bind(this)),this.f.on(this.l,_.vb,this.Ji.bind(this)),this.f.on(this.l,_.Eb,this.Xi.bind(this)))};_.h.unregisterListeners=function(){_.Yf(this.f)};_.h.zg=function(a){this.g.debug("ad timeline changed",a);this.h=a.adsTimeline};_.h.wg=function(a){this.g.debug("ad start",a);this.a=a.ad;this.fireStart();this.fireJoin()};_.h.rg=function(a){this.g.debug("ad end",a);this.fireStop()};_.h.tg=function(a){this.g.debug("ad pause",a);this.firePause()};
16
+ _.h.ug=function(a){this.g.debug("ad resume",a);this.fireResume()};_.h.Ji=function(a){this.g.debug("on buffering",a);this.fireBufferBegin()};_.h.Xi=function(a){this.g.debug("on progress",a);this.fireBufferEnd()};_.h.Sd=function(a,b){this.g.debug("ad quartile",a,b);this.fireQuartile(a)};_.h.qg=function(a){this.g.debug("ad clicked",a);a=this.a&&this.a.Hb();this.g.debug("ad click through url: ",a);this.fireClick(a)};_.h.vg=function(a){this.g.debug("ad skipped",a);this.fireSkip()};
17
+ _.h.Dg=function(a){this.g.debug("break start",a);this.a=a.ad;this.fireBreakStart()};_.h.Eg=function(a){this.g.debug("ad break stop",a);this.fireBreakStop();this.getPosition()===youbora.Constants.AdPosition.Postroll&&(a=this.plugin.getAdapter())&&a.fireStop()};_.h.sg=function(a){this.g.warn("ad error",a);(a=a.detail)&&10003===a.code&&(a.severity===_.K?this.fireFatalError(""+a.code,a.message):this.fireError(""+a.code,a.message))};_.u(Gp,_.So);_.h=Gp.prototype;_.h.onPlayerCreated=function(a){Hp(this,a);if(this.f){this.j=new Cp(a);this.h=new Fp(a);var b=a.getConfiguration().youbora;b.accountCode?this.Ne(new youbora.Plugin(b)):(this.g.warn(zp),a.onError(new _.J(1,9,9101)))}};
18
+ _.h.onContentWillLoad=function(a,b){Hp(this,a);if(this.f){var c=a.getConfiguration(),d=c.youbora;d.accountCode?(void 0===d[Bp]&&(d[Bp]=b.isLive),void 0===d["content.title"]&&(d["content.title"]=b.name),void 0===d.viewerId&&(d.viewerId=c.viewerId),this.a||this.Ne(new youbora.Plugin(d)),this.a.setOptions(d)):(this.g.warn(zp),a.onError(new _.J(1,9,9101)))}};_.h.onPlayerWillRelease=function(){};_.h.onPlayerWillDestroy=function(){};_.h.id=function(){return"youbora"};
19
+ _.h.Ne=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(this.j),this.a.setAdsAdapter(this.h)};_.h.getAdapter=function(){return this.a&&this.a.getAdapter()};_.h.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.A(Ap,Gp);Gp.prototype.getAdsAdapter=Gp.prototype.getAdsAdapter;Gp.prototype.getAdapter=Gp.prototype.getAdapter;Gp.prototype.setYouboraPlugin=Gp.prototype.Ne;Gp.Id="youbora";Ip.prototype.create=function(){return new Gp};_.fn(new Ip);};
20
+ if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
21
+ else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
22
+ else{_=this.clpp._;(f.call(g,this));}
23
+ })();