@castlabs/prestoplay 6.13.0 → 6.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -6
  5. package/cjs/cl.cast.js +83 -83
  6. package/cjs/cl.conviva.js +24 -24
  7. package/cjs/cl.core.js +431 -429
  8. package/cjs/cl.crypto.js +6 -6
  9. package/cjs/cl.dash.js +59 -59
  10. package/cjs/cl.externs.js +48 -40
  11. package/cjs/cl.freewheel.js +19 -19
  12. package/cjs/cl.hls.js +58 -57
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +17 -17
  15. package/cjs/cl.ima.js +18 -18
  16. package/cjs/cl.mse.js +269 -268
  17. package/cjs/cl.muxdata.js +15 -14
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +13 -13
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.simid.js +15 -15
  22. package/cjs/cl.smooth.js +33 -33
  23. package/cjs/cl.thumbnails.js +26 -26
  24. package/cjs/cl.tizen.js +53 -53
  25. package/cjs/cl.ttml.js +28 -28
  26. package/cjs/cl.verimatrix.js +5 -5
  27. package/cjs/cl.vimond.js +12 -12
  28. package/cjs/cl.vr.js +19 -19
  29. package/cjs/cl.vtt.js +14 -14
  30. package/cjs/cl.youbora.js +18 -18
  31. package/cl.adobe.js +3 -3
  32. package/cl.airplay.js +3 -3
  33. package/cl.broadpeak.js +5 -5
  34. package/cl.cast.js +87 -87
  35. package/cl.conviva.js +27 -27
  36. package/cl.core.js +424 -421
  37. package/cl.crypto.js +8 -8
  38. package/cl.dash.js +67 -67
  39. package/cl.externs.js +48 -40
  40. package/cl.freewheel.js +19 -19
  41. package/cl.hls.js +69 -69
  42. package/cl.hlssmpte.js +5 -5
  43. package/cl.htmlcue.js +26 -26
  44. package/cl.ima.js +17 -17
  45. package/cl.mse.js +221 -220
  46. package/cl.muxdata.js +13 -12
  47. package/cl.onboard.js +4 -4
  48. package/cl.persistent.js +10 -10
  49. package/cl.playlist.js +5 -5
  50. package/cl.simid.js +13 -13
  51. package/cl.smooth.js +59 -59
  52. package/cl.thumbnails.js +19 -19
  53. package/cl.tizen.js +57 -57
  54. package/cl.ttml.js +22 -22
  55. package/cl.verimatrix.js +4 -4
  56. package/cl.vimond.js +8 -8
  57. package/cl.vr.js +15 -15
  58. package/cl.vtt.js +12 -12
  59. package/cl.youbora.js +14 -14
  60. package/package.json +4 -4
  61. package/typings.d.ts +53 -17
package/cjs/cl.vtt.js CHANGED
@@ -1,18 +1,18 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var Gu=" The setting will be ignored.",Hu="VTT parser encountered an invalid VTT setting: ",Iu="application/x-subrip",Ju="text/srt",Ku='text/vtt; codecs\x3d"vtt"',Lu='text/vtt; codecs\x3d"wvtt"',Mu=function(a){_.lj(a,/[ \t]+/gm)},Nu=function(a){return a.a==a.f.length?null:(a=_.lj(a,/[^ \t\n]*/gm))?a[0]:null},Ou=function(){},Pu=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},Qu=function(){},Ru=function(a){this.a=a},Tu=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.Zh:a.textAlign=
4
- _.Mt[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.qg:_.rg;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==_.Be||b==_.Sf?_.Be:b==_.De||b==_.le?_.De:_.sd);else if(d=/^region:(.*)$/.exec(b)){if(b=Su(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
5
- c[2]&&(a.lineAlign=_.Nt[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ai,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Nt[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Su=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.J("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Uu=function(a){a=_.lj(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
6
- var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Vu=function(){Ru.apply(this,arguments)},Wu=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},Yu=function(a,b,c){var d,e,f;(new _.mm).L("payl",_.pm(function(g){d=_.R.Z(g)})).L("iden",_.pm(function(g){e=_.R.Z(g)})).L("sttg",_.pm(function(g){f=_.R.Z(g)})).parse(a);return d?Xu(d,e,f,b,c):null},Xu=function(a,b,c,d,e){a=new _.di(d,e,a,_.zg);b&&(a.id=b);if(c)for(b=new _.kj(c),c=Nu(b);c;)Tu(a,c,[])||
7
- _.J(Hu,c,Gu),Mu(b),c=Nu(b);return a},Zu=function(){this.j=new Qu};Ou.prototype.a=function(a){a=_.R.Z(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=Pu(c.value)}return _.R.Va(a)};Qu.prototype.create=function(){return new Ou};Qu.prototype.probe=function(a,b){return(a===Ju||a===Iu)&&b===_.cg};Ru.prototype.parseInit=function(){};
8
- Ru.prototype.parseMedia=function(a,b){var c=_.R.Z(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 _.P(_.Q,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=Uu(new _.kj(e[1]));if(null==c)throw new _.P(_.Q,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
- f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.kj(h.replace(/\n/g," "));g=new _.gi;Nu(h);Mu(h);for(var l=Nu(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
- Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.J("VTT parser encountered an invalid VTTRegion setting: ",l,Gu);Mu(h);l=Nu(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
- e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.kj(p[0]);m=Uu(l);var t=_.lj(l,/[ \t]+--\x3e[ \t]+/g);n=Uu(l);if(null==m||null==t||null==n)throw new _.P(_.Q,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.di(m,n,p,_.zg);g&&(m.id=g);Mu(l);for(n=Nu(l);n;)Tu(m,n,f)||_.J(Hu,
12
- n,Gu),Mu(l),n=Nu(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Vu,Ru);Vu.prototype.parseMedia=function(a,b){return Ru.prototype.parseMedia.call(this,(new Ou).a(a),b)};Wu.prototype.parseInit=function(a){var b=this,c=!1;(new _.mm).L(_.Oe,_.nm).L(_.fg,_.nm).L(_.Je,_.nm).Y("mdhd",function(d){0==d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).L(_.Ne,_.nm).L(_.Vf,_.nm).Y(_.Xf,_.om).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.P(_.Q,2,2008);if(!c)throw new _.P(_.Q,2,2008);};
13
- Wu.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.P(_.Q,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.mm).L("moof",_.nm).L("traf",_.nm).Y("tfdt",function(I){g=!0;c=0==I.version?_.W(I.reader):_.jm(I.reader)}).Y("tfhd",function(I){var O=I.flags;I=I.reader;I.skip(4);O&1&&I.skip(8);O&2&&I.skip(4);m=O&8?_.W(I):null}).Y("trun",function(I){h=!0;var O=I.version,M=I.flags;I=I.reader;var aa=_.W(I);M&1&&I.skip(4);M&4&&I.skip(4);for(var oa=[],
14
- pa=0;pa<aa;pa++){var Ja={duration:null,sampleSize:null,Rf:null};M&256&&(Ja.duration=_.W(I));M&512&&(Ja.sampleSize=_.W(I));M&1024&&I.skip(4);M&2048&&(Ja.Rf=0==O?_.W(I):_.im(I));oa.push(Ja)}d=oa}).L(_.Ie,_.pm(function(I){l=!0;e=I})).parse(a);if(!l&&!g&&!h)throw new _.P(_.Q,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.dm(p,!1);for(var q=_.u(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.Rf?c+t.Rf:n;n=z+(v||0);var D=0;do{var G=_.W(p);D+=G;var F=_.W(p);
15
- F=_.rm(F);var B=null;"vttc"==F?8<G&&(B=_.lm(p,G-8)):("vtte"!=F&&this.g.error("Unknown box "+F+"! Skipping!"),p.skip(G-8));v?B&&f.push(Yu(B,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&D<t.sampleSize)}return{cues:f.filter(_.ni),styles:[]}};_.w(Zu,_.Hr);Zu.prototype.f=function(){_.et[_.cg]=Ru;_.et[Ku]=Ru;_.et[Lu]=Ru;_.et[_.Wc]=Wu;_.et[Ju]=Vu;_.et[Iu]=Vu;_.ok.push(this.j)};Zu.prototype.a=function(){_.ft(_.cg);_.ft(Ku);_.ft(Lu);_.ft(_.Wc);_.ft(Ju);_.ft(Iu);_.qk(this.j)};Zu.prototype.id=function(){return"subtitles-vtt"};_.H("clpp.vtt.VttComponent",Zu);};
2
+ var f=function(window){var Hu=" The setting will be ignored.",Iu="VTT parser encountered an invalid VTT setting: ",Ju="application/x-subrip",Ku="text/srt",Lu='text/vtt; codecs\x3d"vtt"',Mu='text/vtt; codecs\x3d"wvtt"',Nu=function(a){_.lj(a,/[ \t]+/gm)},Ou=function(a){return a.a==a.f.length?null:(a=_.lj(a,/[^ \t\n]*/gm))?a[0]:null},Pu=function(){},Qu=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},Ru=function(){},Su=function(a){this.a=a},Uu=function(a,b,c){var d;if(d=/^align:(start|middle|center|end|left|right)$/.exec(b))b=d[1],"middle"==b?a.textAlign=_.Zh:a.textAlign=
4
+ _.Nt[b.toUpperCase()];else if(d=/^vertical:(lr|rl)$/.exec(b))a.writingMode="lr"==d[1]?_.qg:_.rg;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==_.Ce||b==_.Sf?_.Ce:b==_.De||b==_.le?_.De:_.sd);else if(d=/^region:(.*)$/.exec(b)){if(b=Tu(c,d[1]))a.region=b}else{a:{if(c=/^line:([\d.]+)%(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=1,a.line=Number(c[1]),
5
+ c[2]&&(a.lineAlign=_.Ot[c[2].toUpperCase()]);else if(c=/^line:(-?\d+)(?:,(start|end|center))?$/.exec(b))a.lineInterpretation=_.ai,a.line=Number(c[1]),c[2]&&(a.lineAlign=_.Ot[c[2].toUpperCase()]);else{a=!1;break a}a=!0}return a}return!0},Tu=function(a,b){var c=a.filter(function(d){return d.id==b});return c.length?c[0]:(_.J("VTT parser could not find a region with id: ",b," The region will be ignored."),null)},Vu=function(a){a=_.lj(a,/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g);if(null==a)return null;
6
+ var b=Number(a[2]),c=Number(a[3]);return 59<b||59<c?null:Number(a[4])/1E3+c+60*b+3600*(Number(a[1])||0)},Wu=function(){Su.apply(this,arguments)},Xu=function(){this.a=null;this.g=new _.K("clpp.vtt.mp4")},Zu=function(a,b,c){var d,e,f;(new _.mm).L("payl",_.pm(function(g){d=_.R.Z(g)})).L("iden",_.pm(function(g){e=_.R.Z(g)})).L("sttg",_.pm(function(g){f=_.R.Z(g)})).parse(a);return d?Yu(d,e,f,b,c):null},Yu=function(a,b,c,d,e){a=new _.di(d,e,a,_.zg);b&&(a.id=b);if(c)for(b=new _.kj(c),c=Ou(b);c;)Uu(a,c,[])||
7
+ _.J(Iu,c,Hu),Nu(b),c=Ou(b);return a},$u=function(){this.j=new Ru};Pu.prototype.a=function(a){a=_.R.Z(a);a=a.replace(/\r+/g,"");a=a.replace(/^\s+|\s+$/g,"");a=a.replace(/<[a-zA-Z\\/][^>]*>/g,"");var b=a.split("\n\n");a="";if(0<b.length){a+="WEBVTT\n\n";b=_.u(b);for(var c=b.next();!c.done;c=b.next())a+=Qu(c.value)}return _.R.Va(a)};Ru.prototype.create=function(){return new Pu};Ru.prototype.probe=function(a,b){return(a===Ku||a===Ju)&&b===_.cg};Su.prototype.parseInit=function(){};
8
+ Su.prototype.parseMedia=function(a,b){var c=_.R.Z(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 _.P(_.Q,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=Vu(new _.kj(e[1]));if(null==c)throw new _.P(_.Q,2,2E3);f=Number(f[1]);for(e=b.segmentStart;95443.7176888889<=e;)e-=95443.7176888889,f+=8589934592;c=b.periodStart+
9
+ f/9E4-c}}else this.a.streaming.relativeTextTimestamp&&null!==b.segmentStart&&(c=b.segmentStart);f=[];e=_.u(d);for(var g=e.next();!g.done;g=e.next()){var h=g.value;if(/^region/.test(h.toLowerCase())){h=new _.kj(h.replace(/\n/g," "));g=new _.gi;Ou(h);Nu(h);for(var l=Ou(h);l;){var m;a:{var n=g,p=l;if(m=/^id:(.*)$/.exec(p))n.id=m[1];else if(m=/^width:(\d{1,2}|100)%$/.exec(p))n.width=Number(m[1]);else if(m=/^lines:(\d+)$/.exec(p))n.height=Number(m[1]),n.heightUnits=2;else if(m=/^regionanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.regionAnchorX=
10
+ Number(m[1]),n.regionAnchorY=Number(m[2]);else if(m=/^viewportanchor:(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(p))n.viewportAnchorX=Number(m[1]),n.viewportAnchorY=Number(m[2]);else if(/^scroll:up$/.exec(p))n.scroll="up";else{m=!1;break a}m=!0}m||_.J("VTT parser encountered an invalid VTTRegion setting: ",l,Hu);Nu(h);l=Ou(h)}f.push(g)}}e=[];h=_.u(d);for(g=h.next();!g.done;g=h.next())if(g=g.value,/^style/.test(g.toLowerCase())){g=g.replace(/^style/i,"").replace(/\n/g," ");l=/[^{}]+{[^{}]*}/g;do(m=l.exec(g))&&
11
+ e.push(m[0]);while(m)}h=[];d=_.u(d);for(g=d.next();!g.done;g=d.next())if(g=g.value,g.includes("--\x3e")){p=g.split("\n");var q=c;if(1==p.length&&!p[0]||/^NOTE($|[ \t])/.test(p[0])||"STYLE"==p[0])g=null;else{g=null;p[0].includes("--\x3e")||(g=p[0],p.splice(0,1));l=new _.kj(p[0]);m=Vu(l);var t=_.lj(l,/[ \t]+--\x3e[ \t]+/g);n=Vu(l);if(null==m||null==t||null==n)throw new _.P(_.Q,2,2001);m+=q;n+=q;p=p.slice(1).join("\n").trim();m=new _.di(m,n,p,_.zg);g&&(m.id=g);Nu(l);for(n=Ou(l);n;)Uu(m,n,f)||_.J(Iu,
12
+ n,Hu),Nu(l),n=Ou(l);null!=g&&(m.id=g);g=m}g&&h.push(g)}return{cues:h,styles:e}};_.w(Wu,Su);Wu.prototype.parseMedia=function(a,b){return Su.prototype.parseMedia.call(this,(new Pu).a(a),b)};Xu.prototype.parseInit=function(a){var b=this,c=!1;(new _.mm).L(_.Oe,_.nm).L(_.fg,_.nm).L(_.Je,_.nm).Y("mdhd",function(d){0==d.version?(d.reader.skip(4),d.reader.skip(4),b.a=_.W(d.reader),d.reader.skip(4)):(d.reader.skip(8),d.reader.skip(8),b.a=_.W(d.reader),d.reader.skip(8));d.reader.skip(4)}).L(_.Ne,_.nm).L(_.Vf,_.nm).Y(_.Xf,_.om).L("wvtt",function(){c=!0}).parse(a);if(!this.a)throw new _.P(_.Q,2,2008);if(!c)throw new _.P(_.Q,2,2008);};
13
+ Xu.prototype.parseMedia=function(a,b){if(!this.a)throw this.g.error("No init segment for MP4+VTT!"),new _.P(_.Q,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,l=!1,m=null;(new _.mm).L("moof",_.nm).L("traf",_.nm).Y("tfdt",function(I){g=!0;c=0==I.version?_.W(I.reader):_.jm(I.reader)}).Y("tfhd",function(I){var O=I.flags;I=I.reader;I.skip(4);O&1&&I.skip(8);O&2&&I.skip(4);m=O&8?_.W(I):null}).Y("trun",function(I){h=!0;var O=I.version,M=I.flags;I=I.reader;var ba=_.W(I);M&1&&I.skip(4);M&4&&I.skip(4);for(var ha=[],
14
+ qa=0;qa<ba;qa++){var Ta={duration:null,sampleSize:null,Sf:null};M&256&&(Ta.duration=_.W(I));M&512&&(Ta.sampleSize=_.W(I));M&1024&&I.skip(4);M&2048&&(Ta.Sf=0==O?_.W(I):_.im(I));ha.push(Ta)}d=ha}).L(_.Ie,_.pm(function(I){l=!0;e=I})).parse(a);if(!l&&!g&&!h)throw new _.P(_.Q,2,2008);var n=c,p=new DataView(e.buffer,e.byteOffset,e.byteLength);p=new _.dm(p,!1);for(var q=_.u(d),t=q.next();!t.done;t=q.next()){t=t.value;var v=t.duration||m,z=t.Sf?c+t.Sf:n;n=z+(v||0);var D=0;do{var G=_.W(p);D+=G;var F=_.W(p);
15
+ F=_.rm(F);var B=null;"vttc"==F?8<G&&(B=_.lm(p,G-8)):("vtte"!=F&&this.g.error("Unknown box "+F+"! Skipping!"),p.skip(G-8));v?B&&f.push(Zu(B,b.periodStart+z/this.a,b.periodStart+n/this.a)):this.g.error("WVTT sample duration unknown, and no default found!")}while(t.sampleSize&&D<t.sampleSize)}return{cues:f.filter(_.ni),styles:[]}};_.w($u,_.Ir);$u.prototype.f=function(){_.ft[_.cg]=Su;_.ft[Lu]=Su;_.ft[Mu]=Su;_.ft[_.Wc]=Xu;_.ft[Ku]=Wu;_.ft[Ju]=Wu;_.ok.push(this.j)};$u.prototype.a=function(){_.gt(_.cg);_.gt(Lu);_.gt(Mu);_.gt(_.Wc);_.gt(Ku);_.gt(Ju);_.qk(this.j)};$u.prototype.id=function(){return"subtitles-vtt"};_.H("clpp.vtt.VttComponent",$u);};
16
16
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
17
17
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
18
18
  else{_=this.clpp._;(f.call(g,this));}
package/cjs/cl.youbora.js CHANGED
@@ -1,24 +1,24 @@
1
1
  (function(){var g={}; var _ = _ || {}
2
- var f=function(window){var vu='" event to Youbora',wu='Reporting "',xu="clpp.npaw.YouboraPlugin",yu="content.isLive",zu=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Au=function(a,b,c,d){b=zu(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ne;b.severity===_.Q?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
- b)):(d.fireError(b.code,b.message,b.metadata),c.debug(wu+a+'" to Youbora',b.code,b));return b},Bu=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Eh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.B=!1;return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();
4
- if(c&&(c=c.ia())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
5
- b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Sa())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.13.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Tf,this.K.bind(this)),this.a.on(this.m,_.ne,this.H.bind(this)),this.a.on(this.m,
6
- _.ng,this.J.bind(this)),this.a.on(this.m,_.mg,this.I.bind(this)),this.a.on(this.m,_.Nc,this.D.bind(this)),this.a.on(this.m,_.nd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.gc);_.Hh(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.Co()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
7
- if(c)switch(c.currentState){case _.So:this.o()&&this.f();break;case _.Uo:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.To:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Go:this.fireBufferEnd();this.fireStop();break;case _.No:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Lo:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
- (this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Rd)?"Widevine":c.startsWith(_.Md)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.af)?"ClearKey":c.startsWith(_.Ld)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Au(c,this.m,this.g,this))&&c.severity===_.Q&&(this.h=!0)};
9
- b.prototype.J=function(){this.j(_.Mf);this.m.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Lf);this.fireSeekEnd()};b.prototype.D=function(c){this.g.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.nb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[wu+c+vu].concat(_.Og(e)))};return new b(a)},Cu=function(a){function b(c){var d=
10
- youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Eh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Bb(),this.a.Ab(),this.a.mb()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.mb()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
11
- return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.bb()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
2
+ var f=function(window){var wu='" event to Youbora',xu='Reporting "',yu="clpp.npaw.YouboraPlugin",zu="content.isLive",Au=function(a){return(a=a.getConfiguration().youbora)&&a.errorFilter?a.errorFilter:function(b){return{code:""+b.code,message:b.message,severity:b.severity}}},Bu=function(a,b,c,d){b=Au(b)(a);if(!b)return c.debug("Error not sent to Youbora",a.code,a.message),null;a=10003===a.code?"ad error":_.ne;b.severity===_.Q?(d.fireFatalError(b.code,b.message,b.metadata),c.debug('Reporting "fatal '+a+'" to Youbora',b.code,
3
+ b)):(d.fireError(b.code,b.message,b.metadata),c.debug(xu+a+'" to Youbora',b.code,b));return b},Cu=function(a){function b(c){var d=youbora.Adapter.call(this,c)||this;d.m=c;d.a=new _.Eh;d.g=new _.K("clpp.npaw.YouboraAdapter");d.w=!1;d.h=!1;d.registerListeners();d.B=!1;return d}_.w(b,youbora.Adapter);b.prototype.getPlayhead=function(){return this.getIsLive()?-1:this.m.getPosition()};b.prototype.getDuration=function(){return this.m.getDuration()};b.prototype.getRendition=function(){var c=this.m.getTrackManager();
4
+ if(c&&(c=c.ka())){var d=c.width;var e=c.height;var f=c.bandwidth}d&&e&&f||(c=this.l(),d=d||c.width,e=e||c.height,f=f||c.streamBandwidth);return youbora.Util.buildRenditionString(d,e,f)};b.prototype.getIsLive=function(){return this.m.isLive()};b.prototype.getResource=function(){var c=this.m.getLoadedSource();return c&&c.url};b.prototype.getBitrate=function(){return this.l().streamBandwidth};b.prototype.getThroughput=function(){return this.l().estimatedBandwidth};b.prototype.getPlayrate=function(){return this.m.getPlaybackRate()};
5
+ b.prototype.getFramesPerSecond=function(){var c=this.m.getTrackManager();return c&&(c=c.Ia())?c.frameRate:null};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.14.0-castlabsadapter-js"};b.prototype.getPlayerVersion=function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.a&&(this.g.debug("registering listeners"),youbora.Util.logAllEvents(this.m),this.a.on(this.m,_.Tf,this.K.bind(this)),this.a.on(this.m,_.ne,this.H.bind(this)),this.a.on(this.m,
6
+ _.og,this.J.bind(this)),this.a.on(this.m,_.mg,this.I.bind(this)),this.a.on(this.m,_.Nc,this.C.bind(this)),this.a.on(this.m,_.nd,this.G.bind(this)))};b.prototype.unregisterListeners=function(){this.g.debug(_.gc);_.Hh(this.a)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.B=!0};b.prototype.l=function(){return this.m.getStats()||_.Do()};b.prototype.o=function(){return!!this.m.getConfiguration().autoplay};b.prototype.K=function(c){c=c.detail;this.j("state change",c);
7
+ if(c)switch(c.currentState){case _.To:this.o()&&this.f();break;case _.Vo:this.f();this.A();this.fireResume();this.fireBufferEnd();break;case _.Uo:this.o()&&this.f();this.A();this.fireBufferEnd();this.firePause();break;case _.Ho:this.fireBufferEnd();this.fireStop();break;case _.Oo:this.fireBufferEnd();this.w&&this.plugin.getAdsAdapter()?this.firePause():this.fireStop();break;case _.Mo:this.fireBufferBegin();break;default:this.g.debug("Unhandled state",c)}};b.prototype.f=function(){this.plugin.isInitiated||
8
+ (this.h=!1,this.fireInit())};b.prototype.A=function(){var c=this.m.getDrmInfo();c&&(c=c.keySystem,(c=c.startsWith(_.Rd)?"Widevine":c.startsWith(_.Md)?"FairPlay":c.match(/^com\.(microsoft|chromecast)\.playready/)?"PlayReady":c.startsWith(_.af)?"ClearKey":c.startsWith(_.Ld)?"Primetime":c)&&this.plugin.setOptions({"content.drm":c}));this.fireJoin()};b.prototype.H=function(c){!(c=c.detail)||this.h||10003===c.code&&this.plugin.getAdsAdapter()||(c=Bu(c,this.m,this.g,this))&&c.severity===_.Q&&(this.h=!0)};
9
+ b.prototype.J=function(){this.j(_.Mf);this.m.isEnded()||(this.f(),this.fireSeekBegin())};b.prototype.I=function(){this.j(_.Lf);this.fireSeekEnd()};b.prototype.C=function(c){this.g.debug("adsTimeline",c);c=c.adsTimeline;this.w=!!c&&c.pb()};b.prototype.G=function(c){this.g.debug("Casting",c);this.fireCasted()};b.prototype.j=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[xu+c+wu].concat(_.Og(e)))};return new b(a)},Du=function(a){function b(c){var d=
10
+ youbora.Adapter.call(this,c)||this;d.m=c;d.a=null;d.j=null;d.f=new _.Eh;d.g=new _.K("clpp.npaw.YouboraAdsAdapter");d.registerListeners();d.A=!1;d.l=!1;return d}_.w(b,youbora.Adapter);b.prototype.getDuration=function(){return this.a&&this.a.getDuration()};b.prototype.getRendition=function(){var c=null;this.a&&(c=youbora.Util.buildRenditionString(this.a.Bb(),this.a.Ab(),this.a.ob()));return c};b.prototype.getBitrate=function(){return this.a&&this.a.ob()};b.prototype.getPlayhead=function(){var c=this.m.getAdsManager();
11
+ return c&&c.getPosition()};b.prototype.getResource=function(){return this.a&&this.a.getMediaUrl()};b.prototype.getTitle=function(){return this.a&&this.a.getTitle()};b.prototype.getProvider=function(){return this.a&&this.a.getAdvertiserName()};b.prototype.getCreativeId=function(){return this.a&&this.a.getCreativeId()};b.prototype.getPosition=function(){var c=youbora.Constants.AdPosition,d=null;if(this.a)switch(this.a.cb()){case 0:d=c.Preroll;break;case 2:d=c.Postroll;break;case 1:d=c.Midroll}this.g.debug("Ad position",
12
12
  d);return d};b.prototype.getIsSkippable=function(){return this.a&&-1!==this.a.getSkipTimeOffset()};b.prototype.getAudioEnabled=function(){var c=this.m.getAdsManager();return c&&0<c.getVolume()};b.prototype.getExpectedBreaks=function(){return this.j&&this.j.getCuePoints().length};b.prototype.getGivenBreaks=function(){return this.getExpectedBreaks()};b.prototype.getExpectedAds=function(){return this.a&&this.a.Db()};b.prototype.getGivenAds=function(){return this.getExpectedAds()};b.prototype.getBreaksTime=
13
- function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.13.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
- function(){return _.ia};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Nc,this.V.bind(this)),this.f.on(this.m,_.Ic,this.T.bind(this)),this.f.on(this.m,_.Ec,this.K.bind(this)),this.f.on(this.m,_.Gc,this.M.bind(this)),this.f.on(this.m,_.zc,this.I.bind(this)),this.f.on(this.m,_.Ac,this.o.bind(this,1)),this.f.on(this.m,_.Dc,this.o.bind(this,2)),this.f.on(this.m,_.Kc,this.o.bind(this,3)),this.f.on(this.m,_.yc,this.H.bind(this)),this.f.on(this.m,_.Hc,this.P.bind(this)),this.f.on(this.m,
15
- _.ne,this.J.bind(this)),this.f.on(this.m,_.vc,this.B.bind(this)),this.f.on(this.m,_.wc,this.D.bind(this)),this.f.on(this.m,_.xc,this.G.bind(this)),this.f.on(this.m,_.Fc,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Hh(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
13
+ function(){var c=this;return this.j&&this.j.getCuePoints().map(function(d){return-1===d?c.m.getDuration():d})};b.prototype.getIsFullscreen=function(){return this.m.getSurface().isFullscreen()};b.prototype.getIsVisible=function(){var c=this.m.getSurface().getContainer();c=youbora.Util.calculateAdViewability(c);this.g.debug("is container visible",c);return c};b.prototype.getPlayerName=function(){return _.wa};b.prototype.getVersion=function(){return"6.14.0-castlabsadsadapter-js"};b.prototype.getPlayerVersion=
14
+ function(){return _.ja};b.prototype.registerListeners=function(){this.m&&this.f&&(this.f.on(this.m,_.Nc,this.V.bind(this)),this.f.on(this.m,_.Hc,this.T.bind(this)),this.f.on(this.m,_.Dc,this.K.bind(this)),this.f.on(this.m,_.Fc,this.M.bind(this)),this.f.on(this.m,_.yc,this.I.bind(this)),this.f.on(this.m,_.zc,this.o.bind(this,1)),this.f.on(this.m,_.Cc,this.o.bind(this,2)),this.f.on(this.m,_.Jc,this.o.bind(this,3)),this.f.on(this.m,_.xc,this.H.bind(this)),this.f.on(this.m,_.Gc,this.P.bind(this)),this.f.on(this.m,
15
+ _.ne,this.J.bind(this)),this.f.on(this.m,_.uc,this.B.bind(this)),this.f.on(this.m,_.vc,this.C.bind(this)),this.f.on(this.m,_.wc,this.G.bind(this)),this.f.on(this.m,_.Ec,this.w.bind(this)))};b.prototype.unregisterListeners=function(){_.Hh(this.f)};b.prototype.dispose=function(){youbora.Adapter.prototype.dispose.call(this);this.A=!0};b.prototype.V=function(c){this.g.debug("ad timeline changed",c);this.j=c.adsTimeline};b.prototype.T=function(c){this.a=c.ad;this.h("ad start",this.a);this.fireStart();
16
16
  this.fireJoin()};b.prototype.I=function(){this.h("ad ended");this.fireStop()};b.prototype.K=function(){this.h("ad pause");this.w();this.firePause()};b.prototype.M=function(){this.h("ad resume");this.w();this.fireResume()};b.prototype.G=function(){this.l=!0;this.h("ad buffering started");this.fireBufferBegin()};b.prototype.w=function(){this.l&&(this.h("ad buffering ended"),this.l=!1,this.fireBufferEnd())};b.prototype.o=function(c){this.h("ad quartile",c);this.fireQuartile(c)};b.prototype.H=function(){this.h("ad clicked");
17
- var c=this.a&&this.a.Rb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.P=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()};b.prototype.D=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Au(c,this.m,this.g,this)};
18
- b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[wu+c+vu].concat(_.Og(e)))};return new b(a)},Du=function(){this.a=null;this.g=new _.K(xu);this.m=null},Eu=function(a,b){if(b.namespace()===_.Cd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.N.ah(c))return a.g.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),
19
- b.onError(new _.P(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.P(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.P(1,9,9102)));return!0},Fu=function(){};_.w(Du,_.qt);_.r=Du.prototype;_.r.Mf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Bu(this.m)),this.a.setAdsAdapter(Cu(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;Eu(this,a)&&(a=a.getConfiguration().youbora,this.Mf(new youbora.Plugin(a)))};
20
- _.r.onContentWillLoad=function(a,b){if(Eu(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[yu]&&(d[yu]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Mf(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.H(xu,Du);Du.prototype.getAdsAdapter=Du.prototype.getAdsAdapter;Du.prototype.getAdapter=Du.prototype.getAdapter;
21
- Du.prototype.setYouboraPlugin=Du.prototype.Mf;Du.Id="youbora";Fu.prototype.create=function(){return new Du};_.mq(new Fu);};
17
+ var c=this.a&&this.a.Rb();this.g.debug("ad click through url: ",c);this.fireClick(c)};b.prototype.P=function(){this.h("ad skipped");this.fireSkip()};b.prototype.B=function(c){this.a=c.ad;this.h("ad break start",this.a);this.fireBreakStart()};b.prototype.C=function(){this.h("ad break stop");this.fireBreakStop();if(this.getPosition()===youbora.Constants.AdPosition.Postroll){var c=this.plugin.getAdapter();c&&c.fireStop()}};b.prototype.J=function(c){(c=c.detail)&&10003===c.code&&Bu(c,this.m,this.g,this)};
18
+ b.prototype.h=function(c,d){for(var e=[],f=1;f<arguments.length;++f)e[f-1]=arguments[f];this.g.debug.apply(this.g,[xu+c+wu].concat(_.Og(e)))};return new b(a)},Eu=function(){this.a=null;this.g=new _.K(yu);this.m=null},Fu=function(a,b){if(b.namespace()===_.Cd)return a.g.info("Youbora does not report when casting."),!1;var c=b.getConfiguration().youbora;if(!_.N.bh(c))return a.g.warn("Youbora plugin is loaded but not configured. Will do nothing."),!1;if(!c.accountCode)return a.g.warn("accountCode key is missing in Youbora config"),
19
+ b.onError(new _.P(1,9,9101)),!1;if(_.N.R(window.youbora))return a.g.warn("Youbora SDK not found."),b.onError(new _.P(1,9,9100)),!1;"6.8.49"!==youbora.VERSION&&(a.g.warn("Youbora SDK version is not supported. The supported version is 6.8.49, found version "+(youbora.VERSION+". Some or all features of YouboraPlugin may not work correctly.")),b.onError(new _.P(1,9,9102)));return!0},Gu=function(){};_.w(Eu,_.rt);_.r=Eu.prototype;_.r.Nf=function(a){this.a&&(this.a.removeAdsAdapter(),this.a.removeAdapter());if(this.a=a)this.a.setAdapter(Cu(this.m)),this.a.setAdsAdapter(Du(this.m))};_.r.getAdapter=function(){return this.a&&this.a.getAdapter()};_.r.getAdsAdapter=function(){return this.a&&this.a.getAdsAdapter()};_.r.onPlayerCreated=function(a){this.m=a;Fu(this,a)&&(a=a.getConfiguration().youbora,this.Nf(new youbora.Plugin(a)))};
20
+ _.r.onContentWillLoad=function(a,b){if(Fu(this,a)){var c=a.getConfiguration(),d=c.youbora;void 0===d[zu]&&(d[zu]=b.isLive);void 0===d["content.title"]&&(d["content.title"]=b.name);void 0===d.viewerId&&(d.viewerId=c.viewerId);this.a||this.Nf(new youbora.Plugin(d));this.a.setOptions(d)}};_.r.onPlayerWillRelease=function(){};_.r.onPlayerWillDestroy=function(){};_.r.id=function(){return"youbora"};_.H(yu,Eu);Eu.prototype.getAdsAdapter=Eu.prototype.getAdsAdapter;Eu.prototype.getAdapter=Eu.prototype.getAdapter;
21
+ Eu.prototype.setYouboraPlugin=Eu.prototype.Nf;Eu.Id="youbora";Gu.prototype.create=function(){return new Eu};_.nq(new Gu);};
22
22
  if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
23
23
  else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
24
24
  else{_=this.clpp._;(f.call(g,this));}
package/cl.adobe.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var MQ=function(a){a.f=new _.hr;a.f.on(a.m,_.Kf,()=>KQ(a));a.f.on(a.m,_.Jf,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.ge,()=>LQ(a));a.f.on(a.m,_.rf,b=>{b=b.detail;switch(b.currentState){case _.qn:a.a.length||LQ(a);s.Media.play(a.a,a.m.getPosition());break;case _.pn:case _.hn:KQ(a);break;case _.en:case _.nn:case _.mn:a.h.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),KQ(a),s.Media.close(a.a),a.a=""}})},KQ=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
- LQ=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.h.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.pa)},NQ=class extends _.jt{constructor(){super();this.m=this.f=null;this.a="";this.h=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,MQ(this)):this.h.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
3
- _.z("clpp.adobe.AdobeAnalyticsPlugin",NQ);NQ.Id="adobe";_.ro(new class{create(){return new NQ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var NQ=function(a){a.f=new _.ir;a.f.on(a.m,_.Lf,()=>LQ(a));a.f.on(a.m,_.Kf,()=>{s.Media.play(a.a,a.m.getPosition())});a.f.on(a.m,_.he,()=>MQ(a));a.f.on(a.m,_.sf,b=>{b=b.detail;switch(b.currentState){case _.rn:a.a.length||MQ(a);s.Media.play(a.a,a.m.getPosition());break;case _.qn:case _.jn:LQ(a);break;case _.fn:case _.on:case _.nn:a.g.info(`Close session for ${a.a} `+`in player state ${b.currentState}.`),LQ(a),s.Media.close(a.a),a.a=""}})},LQ=function(a){s.Media.stop(a.a,a.m.getPosition())},
2
+ MQ=function(a){{const b=a.m.getLoadedSource();a.a=b?b.name||b.url:""}a.g.info(`Open session for ${a.a} `+`with duration ${a.m.getDuration()}`);s.Media.open(a.a,a.m.getDuration(),_.pa)},OQ=class extends _.kt{constructor(){super();this.m=this.f=null;this.a="";this.g=new _.R("clpp.adobe.AdobePlugin")}onPlayerCreated(a){window.s&&s.Media?(this.m=a,NQ(this)):this.g.warn("Adobe API not available.")}onPlayerWillDestroy(){this.f&&(this.f.release(),this.f=null);this.m=null;this.a=""}id(){return"adobe"}};
3
+ _.z("clpp.adobe.AdobeAnalyticsPlugin",OQ);OQ.Id="adobe";_.so(new class{create(){return new OQ}});};f.call(g, window);
package/cl.airplay.js CHANGED
@@ -1,3 +1,3 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var JQ=class extends _.jt{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Rr(()=>{this.m.play().catch(()=>{})});this.g=new _.hr}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.g.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.g.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.g.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
- !0;break;case "not-available":this.f=!1}this.m.trigger(new _.F(_.qc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.pc:_.oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.qn)this.l?this.m.play().catch(()=>{}):this.o.ca(.01);this.m.trigger(new _.F(a))}kb(){return this.j}Jd(){return this.f}Xg(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",JQ);JQ.prototype.showCastMenu=JQ.prototype.Xg;
3
- JQ.prototype.canCast=JQ.prototype.Jd;JQ.prototype.isCasting=JQ.prototype.kb;JQ.Id="airplay";_.ro(new class{create(){return new JQ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var KQ=class extends _.kt{constructor(){super();this.a=this.m=null;this.l=this.f=this.j=!1;this.o=new _.Sr(()=>{this.m.play().catch(()=>{})});this.h=new _.ir}onPlayerCreated(a){this.m=a;this.a=a.getSurface().getMedia()}onContentWillLoad(){this.a&&(this.h.on(this.a,"webkitplaybacktargetavailabilitychanged",this.w.bind(this)),this.h.on(this.a,"webkitcurrentplaybacktargetiswirelesschanged",this.A.bind(this)))}onPlayerWillRelease(){this.o.stop();this.h.release()}id(){return"airplay"}w(a){switch(a.availability){case "available":this.f=
2
+ !0;break;case "not-available":this.f=!1}this.m.trigger(new _.F(_.qc,{canCast:this.f}))}A(){const a=(this.j=this.a.webkitCurrentPlaybackTargetIsWireless)?_.pc:_.oc;if(this.l||!this.m.isPaused()||this.m.getState()===_.rn)this.l?this.m.play().catch(()=>{}):this.o.ca(.01);this.m.trigger(new _.F(a))}mb(){return this.j}Kd(){return this.f}Zg(){this.f&&(this.l=!this.m.isPaused(),this.a.webkitShowPlaybackTargetPicker())}};_.z("clpp.airplay.AirPlayPlugin",KQ);KQ.prototype.showCastMenu=KQ.prototype.Zg;
3
+ KQ.prototype.canCast=KQ.prototype.Kd;KQ.prototype.isCasting=KQ.prototype.mb;KQ.Id="airplay";_.so(new class{create(){return new KQ}});};f.call(g, window);
package/cl.broadpeak.js CHANGED
@@ -1,5 +1,5 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var CQ=function(){return!window.SmartLib||!window.GenericPlayerApi},DQ=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.g||(a.g=SmartLib.getInstance(),a.g.init(c,d,e),typeof b===_.uf&&a.g.setUUID(b))},FQ=function(a,b){b=b.customParameters||{};a.a=a.g.createStreamingSession();for(const c in b)a.a.setCustomParameter(c,b[c]);a.l.on(a.m,_.Nd,a.U.bind(a));a.j=EQ(a.m);a.a.attachPlayer(a.j)},GQ=function(a,b){_.Tg(a.l);a.f&&(a.f.release(),
2
- a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},HQ=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.hr;this.g=!1}init(){const a=this.m,b=this.a;b.on(a,_.rf,this.o.bind(this));b.on(a,_.Jc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.hn&&c.notifyStallEnd(!b.isPaused());switch(d){case _.hn:c.notifyStallStart();break;
3
- case _.qn:this.g?c.notifyResume():(c.notifyFirstImage(),this.g=!0);break;case _.pn:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Tg(this.a),this.a=null)}};var EQ=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Nj()}getPlayerName(){return _.pa}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var IQ=class extends _.jt{constructor(){super();this.j=this.f=this.a=this.g=this.m=null;this.l=new _.hr}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(CQ())return a.onError(new _.H(1,9,11E3));DQ(this,c);FQ(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));GQ(this,void 0)}else b.url=d.getURL(),this.f=new HQ(this.m,
4
- this.j),this.f.init()})}}U(a){a=a.detail;if(7003===a.code)GQ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:GQ(this,SmartLib.BPDecodingError);break;case 1:GQ(this,SmartLib.BPNetworkingError);break;case 6:GQ(this,SmartLib.BPAccessRightError);break;default:GQ(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){CQ()||GQ(this,SmartLib.BPSessionEndsNormally)}id(){return"broadpeak"}};_.z("clpp.broadpeak.BroadpeakPlugin",IQ);IQ.isSdkMissing=CQ;IQ.Id="broadpeak";
5
- _.ro(new class{create(){return new IQ}});};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var DQ=function(){return!window.SmartLib||!window.GenericPlayerApi},EQ=function(a,b){const c=b.analyticsAddress||null,d=b.nanoCDNHost||null,e=b.broadpeakDomainNames||"";b=b.uuid||null;a.h||(a.h=SmartLib.getInstance(),a.h.init(c,d,e),typeof b===_.vf&&a.h.setUUID(b))},GQ=function(a,b){b=b.customParameters||{};a.a=a.h.createStreamingSession();a.a.setOption(StreamingSessionOptions.SESSION_PRECACHE,!0);for(const c in b)a.a.setCustomParameter(c,b[c]);a.o.on(a.m,_.Nd,a.U.bind(a));a.l=FQ(a.m);
2
+ a.a.attachPlayer(a.l)},HQ=function(a,b){_.Ug(a.o);a.f&&(a.f.release(),a.f=null);a.a&&(a.a.stopStreamingSession(b),a.a=null)},IQ=class{constructor(a,b){this.m=a;this.f=b;this.a=new _.ir;this.h=!1}init(){const a=this.m,b=this.a;b.on(a,_.sf,this.o.bind(this));b.on(a,_.Jc,this.j.bind(this));b.on(a,"seek",this.l.bind(this))}j(a){a=a.detail;typeof a.bandwidth===_.r&&this.f.notifyLayerSwitch(a.bandwidth/1E3)}o(a){const b=this.m,c=this.f;a=a.detail;const d=a.currentState;a.previousState===_.jn&&c.notifyStallEnd(!b.isPaused());
3
+ switch(d){case _.jn:c.notifyStallStart();break;case _.rn:this.h?c.notifyResume():(c.notifyFirstImage(),this.h=!0);break;case _.qn:c.notifyPause()}}l(){const a=1E3*this.m.getPosition();this.f.notifySeek(a)}release(){this.a&&(_.Ug(this.a),this.a=null)}};var FQ=a=>{class b extends GenericPlayerApi{constructor(c){super();this.m=c;this.a=_.Oj()}getPlayerName(){return _.pa}getVersion(){return _.da}getOSName(){return this.a.os}getDeviceVersion(){return this.a.osVersion.name}getDeviceType(){return"browser"}getTotalDuration(){return this.m.isLive()?0:1E3*this.m.getDuration()}getCurrentPosition(){return 1E3*this.m.getPosition()}getCurrentBitrate(){const c=this.m.getStats();return(c?c.streamBandwidth:0)/1E3}}return new b(a)};var JQ=class extends _.kt{constructor(){super();this.l=this.f=this.a=this.h=this.m=null;this.o=new _.ir;this.j=!1}onPlayerCreated(a){this.m=a}onContentWillLoad(a,b){const c=a.getConfiguration().broadpeak;if(c){if(DQ())return a.onError(new _.H(1,9,11E3));this.j=!0;EQ(this,c);GQ(this,c);return this.a.getURL(b.url).then(d=>{if(d.isError()){const e=d.getDetailedErrorCode();d=d.getDetailedErrorMessage();this.m.onError(new _.H(1,9,11001,{bpkErrorCode:e,message:d}));HQ(this,void 0)}else b.url=d.getURL(),
4
+ this.f=new IQ(this.m,this.l),this.f.init()})}}onContentLoaded(){!1!==this.j&&this.a.precacheEnded()}U(a){a=a.detail;if(7003===a.code)HQ(this,SmartLib.BPFormatNotSupportedError);else if(a.severity===_.G)switch(a.category){case 3:HQ(this,SmartLib.BPDecodingError);break;case 1:HQ(this,SmartLib.BPNetworkingError);break;case 6:HQ(this,SmartLib.BPAccessRightError);break;default:HQ(this,SmartLib.BPUnspecifiedError)}}onPlayerWillRelease(){DQ()||HQ(this,SmartLib.BPSessionEndsNormally);this.j=!1}id(){return"broadpeak"}};
5
+ _.z("clpp.broadpeak.BroadpeakPlugin",JQ);JQ.isSdkMissing=DQ;JQ.Id="broadpeak";_.so(new class{create(){return new JQ}});};f.call(g, window);