@castlabs/prestoplay 6.34.0-beta.1 → 6.34.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.
- package/CHANGELOG.md +18 -2
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +18 -18
- package/cjs/cl.cast.js +127 -127
- package/cjs/cl.conviva.js +32 -32
- package/cjs/cl.core.js +608 -606
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +101 -101
- package/cjs/cl.externs.js +37 -38
- package/cjs/cl.freewheel.js +25 -25
- package/cjs/cl.hls.js +77 -77
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -30
- package/cjs/cl.ima.js +24 -24
- package/cjs/cl.mediatailor.js +3 -3
- package/cjs/cl.mse.js +351 -355
- package/cjs/cl.muxdata.js +14 -14
- package/cjs/cl.onboard.js +4 -4
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.simid.js +16 -16
- package/cjs/cl.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +26 -26
- package/cjs/cl.tizen.js +72 -72
- package/cjs/cl.ttml.js +29 -29
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +12 -12
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.yospace.js +4 -4
- package/cjs/cl.youbora.js +35 -35
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +11 -11
- package/cl.cast.js +98 -98
- package/cl.conviva.js +26 -26
- package/cl.core.js +438 -435
- package/cl.crypto.js +9 -9
- package/cl.dash.js +89 -89
- package/cl.externs.js +37 -38
- package/cl.freewheel.js +16 -16
- package/cl.hls.js +82 -82
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mediatailor.js +2 -2
- package/cl.mse.js +301 -305
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +5 -5
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.simid.js +14 -14
- package/cl.smooth.js +61 -61
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +56 -56
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +7 -7
- package/cl.vr.js +14 -14
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +29 -29
- package/package.json +1 -1
- package/typings.d.ts +24 -136
package/cjs/cl.htmlcue.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},
|
|
4
|
-
1<Math.abs(a-b)},
|
|
5
|
-
0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new
|
|
6
|
-
case "+y":return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
a.a;this.j=void 0===b?!1:b;this.a=
|
|
10
|
-
a.id,"clpp-text-cue-region",b);this.f=a},
|
|
11
|
-
a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},
|
|
12
|
-
c)},
|
|
13
|
-
c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},
|
|
14
|
-
this.G=new _.
|
|
15
|
-
c.start===d.start&&c.end===d.end)),c&&(a.l=d,
|
|
16
|
-
else{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
d=g)}}else d.appendChild(document.createTextNode(
|
|
21
|
-
|
|
22
|
-
c.next();!d.done;d=c.next())_.
|
|
23
|
-
c,null),f=
|
|
24
|
-
|
|
25
|
-
l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=
|
|
26
|
-
|
|
27
|
-
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&
|
|
28
|
-
}a=
|
|
29
|
-
|
|
30
|
-
_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();
|
|
31
|
-
_.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Qb(.25),this.L.enableResizeObserver&&this.w.start(),
|
|
2
|
+
var f=function(window){var oT="CLPP Subtitle Styles",pT="Unsupported unit",qT="clpp-text-plain",rT="clpp-text-ttml",sT="clpp.htmlcue.HtmlTextDisplayer",tT="initial",uT=function(a){return _.Jj(a,{gi:function(b,c){return b.va(c)}})},vT=function(a,b){if(0===b.length)return a;var c=a,d=a.findIndex(function(e){return e.startTime>=b[0].startTime});0<=d&&(c=c.slice(0,d));return c.concat(b)},wT=function(a,b){for(var c=0,d=a.length-1;c<=d;){var e=c+d>>1,f=b(a[e]);if(0===f)return e;0<f?c=e+1:d=e-1}return-1},xT=function(){},yT=function(a){if(!a.input)return null;
|
|
3
|
+
var b=a.input.match(/^([^<]*)(<[^>]+>?)?/);b=b[1]?b[1]:b[2];a.input=a.input.substr(b.length);return b},AT=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return zT[c]});return a},CT=function(a,b){BT(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){BT(a,c)})},BT=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},DT=function(a,b){return 0===a?"0":a+b},ET=function(a,b){return 1>Math.abs(a-b)||a<b},FT=function(a,b){return a<b&&
|
|
4
|
+
1<Math.abs(a-b)},GT=function(a,b){return a>b&&1<Math.abs(a-b)},HT=function(a,b){return 1>Math.abs(a-b)||a>b},IT=function(a,b,c,d,e,f){this.left=a;this.f=b;this.top=c;this.a=d;this.height=e;this.width=f},JT=function(a){return new IT(a.left,a.f,a.top,a.a,a.height,a.width)},KT=function(a){var b=a.getBoundingClientRect(),c=getComputedStyle(a,null),d=parseFloat(c.getPropertyValue("border-left-width"))||0,e=parseFloat(c.getPropertyValue("border-right-width"))||0,f=parseFloat(c.getPropertyValue("border-top-width"))||
|
|
5
|
+
0;c=parseFloat(c.getPropertyValue("border-bottom-width"))||0;var g=(b.top||a.offsetTop)+f;f=(b.height||a.offsetHeight)-f-c;return new IT(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},LT=function(a,b){return b.some(function(c){return FT(a.left,c.f)&>(a.f,c.left)&&FT(a.top,c.a)&>(a.a,c.top)})},MT=function(a,b){return HT(a.top,b.top)&&ET(a.a,b.a)&&HT(a.left,b.left)&&ET(a.f,b.f)},NT=function(a,b,c){switch(c){case "+x":return FT(a.left,b.left);case "-x":return GT(a.f,b.f);
|
|
6
|
+
case "+y":return FT(a.top,b.top);case "-y":return GT(a.a,b.a);default:throw Error("Unknown axis");}},OT=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},PT=function(a,b,c){OT.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.D=c},RT=function(a){var b=a.a.childNodes[0],c=a.a.getBoundingClientRect(),d=b.getClientRects();b=c.height/d.length;c=c.width/d.length;return QT(a)?b:c},UT=function(a,b,c){return QT(a)&&_.N.ya(c)?DT(c,_.Lf):(ST(a)||
|
|
7
|
+
TT(a))&&_.N.ya(b)?DT(b,"%"):tT},ST=function(a){return a.f.writingMode===_.Jg},TT=function(a){return a.f.writingMode===_.Kg},QT=function(a){return a.f.writingMode===_.Nj},VT=function(a,b,c){return(ST(a)||TT(a))&&_.N.ya(c)?DT(c,_.Lf):ST(a)&&_.N.R(c)?DT(0,_.Lf):QT(a)&&_.N.ya(b)?DT(b,"%"):tT},WT=function(a,b){if(typeof a.f.position===_.h&&typeof a.f.size===_.h)switch(b){case _.Be:return a.f.position;case "auto":case _.nd:return a.f.position-a.f.size/2;case _.Ce:return a.f.position-a.f.size}return 0},
|
|
8
|
+
XT=function(a){switch(a.f.positionAlign){case _.Be:return _.ye;case "auto":case _.nd:return _.Mj;case _.Ce:return _.Sf}return a.f.textAlign},YT=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.eg:case _.ye:return _.Be;case _.Mj:return _.nd;case _.ke:case _.Sf:return _.Ce}return a.f.positionAlign},ZT=function(a){switch(a.f.writingMode){case _.Nj:return"horizontal-tb";case _.Jg:return _.Jg;case _.Kg:return _.Kg;default:throw Error("Unknown writing mode");}},$T=function(a,b){this.l=a;this.f=
|
|
9
|
+
a.a;this.j=void 0===b?!1:b;this.a=KT(a.a);this.h=[]},aU=function(a,b){if(a.j)switch(b.writingMode){case _.Nj:return["-y"];case _.Jg:return["+x"];case _.Kg:return["-x"]}var c=[];switch(b.writingMode){case _.Nj:c=["+y","-y"];break;case _.Jg:c=["+x","-x"];break;case _.Kg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},bU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=KT(a.l.a)},cU=function(a,b,c){OT.call(this,a,b,c);this.h=null;this.l=[]},dU=function(a,b){cU.call(this,
|
|
10
|
+
a.id,"clpp-text-cue-region",b);this.f=a},eU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Sj)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(pT);},gU=function(a){this.g=new _.L("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=fU(this,this.h);this.f=fU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},hU=function(a,b){var c=!1;try{a.f.insertRule(b,0);var d=
|
|
11
|
+
a.f.cssRules[0];d instanceof CSSStyleRule&&(c=d.selectorText.split(",").every(function(e){return 0===e.trim().indexOf("."+a.h+" ")}))}catch(e){}0<a.f.cssRules.length&&a.f.deleteRule(0);return c},iU=function(a,b){var c="."+a.h+" .clpp-text-container",d=c+" .clpp-text-cue";return b=b.replace(/::cue\((#[^)]+)\)/g,c+" $1").replace(/::cue\(([^)]+)\)/g,d+" $1").replace(/::cue-region\(([^)]+)\)/g,c+" $1 .clpp-text-cue").replace(/::cue/g,d).replace(/::cue-region/g,c+" .clpp-text-cue-region .clpp-text-cue").replace(/::ttml/g,
|
|
12
|
+
c)},fU=function(a,b,c){var d=document.createElement(_.kg),e=d.dataset;e.name=oT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);jU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},jU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===oT&&a.g.error("PRESTOplay HTML style element #CLPP Subtitle Styles has been unexpectedly removed! Some styles will not work!")})})});
|
|
13
|
+
c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},mU=function(a){_.Sv.call(this,a);var b=this;this.g=new _.L(sT);this.m=a;this.L=kU(a.getConfiguration());this.j=!1;this.f=[];this.D=a.getSurface().getContainer();this.h=new gU(a.getSurface().getUniqueCssClass());this.a=new cU(null,"clpp-text-container",{});this.w=new _.zv(a.getSurface(),this.ml.bind(this));this.J=null;this.D?(this.D.appendChild(this.a.a),this.a.init(null)):this.g.warn("No container element! Subtitles will not appear. Please check your player surface configuration or switch to NativeTextDisplayer.");
|
|
14
|
+
this.G=new _.Zh(function(){lU(b)});this.A=new Map;this.l=null},kU=function(a){a=_.N.wb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},nU=function(a,b){return a.startTime<=b&&a.endTime>b},lU=function(a,b){if((b||a.j)&&a.D){var c=a.m.getPosition(),d;!(d=b)&&(d=a.J!==c)&&(d=a.m instanceof _.X?3===a.m.getState():8===a.m.getState());if(d&&(a.J=c,d=oU(a,c),(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&
|
|
15
|
+
c.start===d.start&&c.end===d.end)),c&&(a.l=d,pU(a),d))){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Xv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.v(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,k=null;switch(e.payloadType){case _.Ug:k="clpp-text-vtt";break;case _.yg:k=rT;break;case _.Lj:k=qT}k&&!g.classList.contains(k)&&_.rr(g,k);g=KT(f.a.a);if(0===g.width||0===g.height)f.g.warn("The height or width of the `.clpp-text-container` element is zero. Captions will not be displayed. Please check if the `clpp.styles.css` file has been included.");
|
|
16
|
+
else{BT({fontSize:qU(f,e.containerRows)},f.a.a);g=null;k=e.payloadType===_.Ug;var l=e.payloadType===_.yg;e.region&&(k||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new dU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new PT(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}},oU=function(a,b){var c=wT(a.f,function(e){return nU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&nU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
|
|
17
|
+
nU(a.f[c+1],b);)c++;return{start:d,end:c}},rU=function(a){pU(a);a.J=null;a.l=null;a.f=[]},pU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(rT);b.classList.remove(qT);a=a.a;bU(a.h);a.l=[]}},qU=function(a,b){var c=KT(a.a.a).height;if(null!==a.I)return a.getFontSize();if(null!==a.B){var d=a.getFontSizePercent();return Math.round(c*d)+_.Lf}if(typeof b===_.h&&0<b)return Math.round(c/b)+_.Lf;d=a.getFontSizePercent();return Math.round(c*d)+_.Lf},sU=function(){},
|
|
18
|
+
tU=function(){};
|
|
19
|
+
xT.prototype.parse=function(a){a={input:a};for(var b=_.tr(_.Td),c=[],d=b,e;null!==(e=yT(a));)if("\x3c"===e[0])if("/"===e[1])c.length&&c[c.length-1]===e.substr(2).replace("\x3e","")&&(c.pop(),d=d.parentNode);else{if(e=e.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)){var f=e[1];var g=e[3];var k=uU[f];k?(k=_.tr(k),(f=vU[f])&&g&&k.setAttribute(f,g.trim()),g=k):g=null;!g||wU[g.localName]&&wU[g.localName]!==d.localName||(e[2]&&(g.className=e[2].substr(1).replace(/\./g," ")),c.push(e[1]),d.appendChild(g),
|
|
20
|
+
d=g)}}else d.appendChild(document.createTextNode(AT(e)));return b};var uU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},vU={v:"voice",lang:"lang"},wU={rt:"ruby"},zT={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};OT.prototype.init=function(){this.j=!0};OT.prototype.A=function(){return!1};_.w(PT,OT);PT.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
|
|
21
|
+
PT.prototype.init=function(a){OT.prototype.init.call(this,a);if(this.h)_.rr(this.a,"clpp-text-cue-image"),this.a.style.backgroundImage='url("'+this.f.backgroundImage+'")',this.l.stretchSmpteImage&&(this.a.style.backgroundSize="contain");else if(a){var b=this.f;if(b.payloadType===_.yg){var c=_.tr(_.Td);c.innerHTML=b.payload;b=c}else b.payloadType===_.Ug?b=(new xT).parse(b.payload):(c=_.tr(_.Td),c.textContent=b.payload,b=c);_.rr(b,this.w);this.id&&(b.id=this.id);c=_.v(this.f.cssClassList);for(var d=
|
|
22
|
+
c.next();!d.done;d=c.next())_.rr(b,d.value);BT({writingMode:ZT(this)},b);this.a.appendChild(b);_.rr(this.a,"clpp-text-wrapper");c=_.v(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.rr(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Oj,this.f.line=QT(this)?-1:0);c=ZT(this);BT({writingMode:c,webkitWritingMode:c,direction:tT,textAlign:XT(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=WT(this,YT(this));d=VT(this,c,null);var e=UT(this,
|
|
23
|
+
c,null),f=TT(this)&&_.N.R(null)?DT(0,_.Lf):tT;BT({position:"absolute",left:d,right:f,top:e,width:QT(this)?DT(this.f.size,"%"):tT,height:ST(this)||TT(this)?DT(this.f.size,"%"):tT},this.a);d=this.f;a=QT(this)?a.height:a.width;e=RT(this);if(d.lineInterpretation===_.Oj)f=e*Math.round(d.line),Math.abs(f)>a&&(f=e*(0>d.line?0:-1)),0>f&&(f+=a);else{f=e/a*100;var g=d.line;switch(d.lineAlign){case _.nd:g-=f/2;break;case _.ke:g-=f}f=Math.round(g/100*a)}TT(this)&&(f=a-f-e);a=f;d=VT(this,c,a);e=TT(this)&&_.N.R(a)?
|
|
24
|
+
DT(0,_.Lf):tT;BT({left:d,right:e,top:UT(this,c,a)},this.a)}CT(this.D,b)}};PT.prototype.o=function(){return _.tr(_.Td)};$T.prototype.append=function(a){var b=a.a;b.style.visibility=_.se;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=KT(a.a);var d=aU(this,a.f),e=RT(a),f=JT(c),g=null,k=0;d=_.v(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;NT(c,this.a,l)||MT(c,this.a)&<(c,this.h);){var m=c,n=e;switch(l){case "+x":m.left+=n;m.f+=n;break;case "-x":m.left-=n;m.f-=n;break;case "+y":m.top+=n;m.a+=n;break;case "-y":m.top-=n,m.a-=n}}if(this.j||MT(c,this.a))break a;l=this.a;l=Math.max(0,Math.min(c.f,
|
|
25
|
+
l.f)-Math.max(c.left,l.left))*Math.max(0,Math.min(c.a,l.a)-Math.max(c.top,l.top))/(c.height*c.width);l>k&&(g=JT(c),k=l);c=JT(f)}c=g||f}BT({top:DT(c.top-this.a.top,_.Lf),bottom:DT(this.a.a-c.a,_.Lf),left:DT(c.left-this.a.left,_.Lf),right:DT(this.a.f-c.f,_.Lf),height:DT(c.height,_.Lf),width:DT(c.width,_.Lf)},a.a)}b.style.visibility="visible";this.h.push(KT(a.a))};_.w(cU,OT);cU.prototype.init=function(){this.h=new $T(this);this.j=!0};cU.prototype.o=function(){var a=_.tr(_.Td);_.rr(a,this.w);this.id&&(a.id=this.id);return a};cU.prototype.appendChild=function(a){bU(this.h);this.l.unshift(a);a=_.v(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.w(dU,cU);
|
|
26
|
+
dU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Sj:b=b.width/100*a.width;break a;default:throw Error(pT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Sj)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(pT);d=a.height;var e=eU(this,d,a.height);BT(this.B,this.a);BT({left:DT(c,_.Lf),top:DT(e,_.Lf),width:DT(b,_.Lf),height:DT(d,_.Lf)},this.a);this.f.writingMode&&BT({display:"flex",
|
|
27
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&BT({"justify-content":this.f.displayAlign},this.a);b=_.v(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.rr(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Sj:b=b.height/100*a.height;break a;case 2:b=b.height;d=new PT(new _.Rj(0,1,"Lorem ipsum",_.Lj),{},{});c=d.a;this.a.appendChild(c);d.init(KT(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(pT);
|
|
28
|
+
}a=eU(this,b,a.height);BT({top:DT(a,_.Lf),height:DT(b,_.Lf)},this.a);this.h=new $T(this,!0);this.j=!0};dU.prototype.getId=function(){return this.f.id};gU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=iU(this,a);if(hU(this,b)){try{this.a.insertRule(b,this.a.cssRules.length),this.g.debug("Added CSS rule "+b)}catch(c){this.g.error("An error occurred when adding a CSS rule: "+b)}this.l.push(a)}else this.g.warn("Stylesheet CLPP Subtitle Styles ignoring the CSS rule because it's not safe: "+b)}};
|
|
29
|
+
gU.prototype.destroy=function(){var a=this;return _.I(function(b){if(null==a.a)return b["return"]();a.j.forEach(function(c){return c()});a.j=[];if(null!=a.a){for(;0<a.a.cssRules.length;)a.a.deleteRule(0);a.l=[]}document.head.removeChild(a.a.ownerNode);document.head.removeChild(a.f.ownerNode);a.a=null;a.f=null;a.g.debug("Stylesheet CLPP Subtitle Styles has been destroyed.");_.A(b)})};_.w(mU,_.Sv);_.r=mU.prototype;_.r.getClass=function(){return _.te};_.r.isRenderer=function(){return!0};_.r.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.v(b),d=c.next();!d.done;d=c.next())this.h.appendRule(d.value);a.sort(function(e,f){return e.startTime!==f.startTime?e.startTime-f.startTime:e.endTime-f.endTime});this.f=vT(this.f,uT(a));this.l=null;lU(this,!1)}};_.r.ec=function(){null==this.h||lU(this,!0)};
|
|
30
|
+
_.r.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();rU(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.D.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.A(b)})};_.r.remove=function(a,b){if(null==this.h)return!1;this.f=this.f.filter(function(c){return c.startTime<a||c.endTime>=b});this.l=null;lU(this,!0);return!0};_.r.isTextVisible=function(){return this.j};
|
|
31
|
+
_.r.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Qb(.25),this.L.enableResizeObserver&&this.w.start(),lU(this,!0)):(this.G.stop(),this.w.stop(),rU(this)))};_.r.ml=function(){lU(this,!0)};_.J(sT,mU);mU.prototype.setTextVisibility=mU.prototype.setTextVisibility;mU.prototype.isTextVisible=mU.prototype.isTextVisible;mU.prototype.remove=mU.prototype.remove;mU.prototype.destroy=mU.prototype.destroy;mU.prototype.append=mU.prototype.append;sU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.yi()};sU.prototype.create=function(a){return new mU(a)};_.w(tU,_.Ju);tU.prototype.install=function(){_.xq(_.te,new sU)};tU.prototype.uninstall=function(){_.vq.has(_.te)&&(_.vq["delete"](_.te),_.wq.info("Removed factory: 'html'"))};tU.prototype.id=function(){return"subtitles-htmlcue"};_.J("clpp.htmlcue.HtmlCueComponent",tU);};
|
|
32
32
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
33
33
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
34
34
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.ima.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.wb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.
|
|
4
|
-
c.on(this.j,d,this.
|
|
5
|
-
c.on(b,d.RESUMED,a.
|
|
6
|
-
Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.
|
|
7
|
-
a.w=null;
|
|
8
|
-
var d=null;c&&(d={ad:new
|
|
9
|
-
d["return"]();
|
|
2
|
+
var f=function(window){var US="clpp.ima.AdsManagerFactory",VS=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},WS=function(){},XS=function(a){this.a=a},YS=function(){this.a=this.h=this.f=null},ZS=function(){return!window.google||!google.ima||!google.ima.AdsLoader},$S=function(){},aT=function(a){var b=a.ye("ima");if(!b)throw Error("IMA plugin not created.");var c=b.Hd(),d=b.h;b=b.a;if(!c||!d||!b)throw Error("IMA plugin not initialized.");var e=a.getSurface().getMedia();if(!e)throw Error("Missing media element.");
|
|
3
|
+
this.m=a;this.o=e;a=this.m.getConfiguration();a=_.N.wb(a.ima||{});this.A=_.N.ta({disableCustomPlayback:!1},a);this.X=c;this.ba=d;this.j=b;this.T=new _.Bv;this.g=new _.L("clpp.ima");this.a=null;this.P=!1;this.h=null;this.f=new _.pl;this.W=!1;this.L=new _.li;this.ha=new WS;this.w=null;this.l=this.M=!1;this.H=1;this.J=this.B=this.D=!1;this.I=this.K=null;this.G=!0;c=this.L;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.An.bind(this));
|
|
4
|
+
c.on(this.j,d,this.zn.bind(this));c.on(this.m,_.le,this.Jn.bind(this))},bT=function(a){var b=a.a,c=a.L,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.pn.bind(a));c.on(b,d.LOADED,a.ql.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Kn.bind(a));c.on(b,d.STARTED,a.tl.bind(a));c.on(b,d.LOG,a.tn.bind(a));c.on(b,d.AD_PROGRESS,a.rl.bind(a));c.on(b,d.AD_BUFFERING,a.qn.bind(a));c.on(b,d.FIRST_QUARTILE,a.ol.bind(a));c.on(b,d.MIDPOINT,a.un.bind(a));c.on(b,d.THIRD_QUARTILE,a.ul.bind(a));c.on(b,d.PAUSED,a.wn.bind(a));
|
|
5
|
+
c.on(b,d.RESUMED,a.xn.bind(a));c.on(b,d.CLICK,a.nl.bind(a));c.on(b,d.SKIPPED,a.sl.bind(a));c.on(b,d.IMPRESSION,a.pl.bind(a));c.on(b,d.COMPLETE,a.rn.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Ln.bind(a))},cT=function(a){a=a.A;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.h&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.cd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.h&&(b.loadVideoTimeout=a.loadVideoTimeout);
|
|
6
|
+
Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.h&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.cd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},eT=function(a){_.I(function(b){switch(b.a){case 1:return a.I=a.m.getPosition(),_.y(b,dT(a,[8,10,11]),2);case 2:return _.y(b,a.m.pause(),3);case 3:return _.y(b,a.m.detach(),4);case 4:a.a.start(),_.A(b)}})},gT=function(a){a.M=!1;
|
|
7
|
+
a.w=null;fT(a,_.Bc);a.m.getSurface().hide(a.X)},dT=function(a,b){return _.I(function(c){return c["return"](new Promise(function(d,e){var f=setTimeout(function(){clearInterval(g);e(Error("Timeout waiting for player state"))},1E4),g=setInterval(function(){var k=a.m.getPlayerState();3===k?(clearInterval(g),clearTimeout(f),e(Error("Player entered error state"))):b.includes(k)&&(clearInterval(g),clearTimeout(f),d())},200)}))})},hT=function(a){_.sr(a.o,{visibility:"visible"})},fT=function(a,b,c){c=c&&c.getAd();
|
|
8
|
+
var d=null;c&&(d={ad:new VS(c,a.D,a.B)});a.m.trigger(new _.R(b,d))},iT=function(a,b){var c=b?a.ha.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},jT=function(a){var b=_.ti()||_.ui()||_.yi();return!1===a.A.disableCustomPlayback&&b},kT=function(a){return jT(a)&&a.a.isCustomPlaybackUsed()},mT=function(a){var b,c;_.I(function(d){if(1==d.a)return a.ba.initialize(),b=!!a.m.getConfiguration().muted,_.y(d,a.T.canPlay(b),2);c=d.f;if(!c&&!kT(a))return fT(a,_.ad),a.g.warn(_.ra),
|
|
9
|
+
d["return"]();lT(a);_.A(d)})},lT=function(a){a.a.init(a.o.offsetWidth,a.o.offsetHeight,google.ima.ViewMode.NORMAL);kT(a)?a.A.isVast&&eT(a):a.a.start();a.W=!0},nT=function(){this.Ea=new _.L(US)};_.r=VS.prototype;_.r.kb=function(){return"Google IMA SDK"};_.r.lb=function(){return google.ima.VERSION};_.r.ob=function(){return 0};_.r.getId=function(){return this.a.getAdId()};_.r.getCreativeId=function(){return this.a.getCreativeId()};_.r.Ib=function(){return""};_.r.getApiFramework=function(){return this.a.getApiFramework()};
|
|
10
10
|
_.r.getAdSystem=function(){return this.a.getAdSystem()};_.r.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.r.getTitle=function(){return this.a.getTitle()};_.r.getDuration=function(){return this.a.getDuration()};_.r.getPosition=function(){return 0};_.r.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.r.Kb=function(){return this.f?this.f.getIsBumper():!1};
|
|
11
|
-
_.r.Za=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.
|
|
11
|
+
_.r.Za=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ve&&typeof b[d].clickThroughUrl===_.ig});c&&(a=b[c].clickThroughUrl);return a};_.r.getMediaUrl=function(){return this.a.getMediaUrl()};_.r.eb=function(){return this.a.getVastMediaWidth()};_.r.cb=function(){return this.a.getVastMediaHeight()};_.r.Ga=function(){return this.a.getVastMediaBitrate()};_.r.Ha=function(){return this.h?_.Ck:this.j?_.Fk:0};
|
|
12
12
|
_.r.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.r.yb=function(){return this.f?this.f.getTimeOffset():0};_.r.nb=function(){return this.f?this.f.getAdPosition():1};_.r.fb=function(){return this.f?this.f.getTotalAds():1};_.r.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.r.canSeek=function(){return!1};_.r.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.r.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.r.Jb=function(){return null};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
_.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.
|
|
17
|
-
|
|
18
|
-
_.r.
|
|
19
|
-
|
|
20
|
-
_.r.
|
|
21
|
-
_.r.
|
|
22
|
-
_.r.
|
|
23
|
-
2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.
|
|
24
|
-
_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.
|
|
25
|
-
return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return
|
|
26
|
-
_.r.
|
|
27
|
-
_.r.Ac=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;
|
|
13
|
+
VS.prototype.getVideoElement=VS.prototype.Jb;VS.prototype.getWrapperCreativeIds=VS.prototype.getWrapperCreativeIds;VS.prototype.getWrapperAdSystems=VS.prototype.getWrapperAdSystems;VS.prototype.canSeek=VS.prototype.canSeek;VS.prototype.getWrapperAdIds=VS.prototype.getWrapperAdIds;VS.prototype.getSequenceLength=VS.prototype.fb;VS.prototype.getPositionInSequence=VS.prototype.nb;VS.prototype.getPodTimeOffset=VS.prototype.yb;VS.prototype.getPodIndex=VS.prototype.getPodIndex;VS.prototype.getPodType=VS.prototype.Ha;
|
|
14
|
+
VS.prototype.getMediaBitrate=VS.prototype.Ga;VS.prototype.getMediaHeight=VS.prototype.cb;VS.prototype.getMediaWidth=VS.prototype.eb;VS.prototype.getMediaUrl=VS.prototype.getMediaUrl;VS.prototype.getClickThroughUrl=VS.prototype.Za;VS.prototype.isBumper=VS.prototype.Kb;VS.prototype.getSkipTimeOffset=VS.prototype.getSkipTimeOffset;VS.prototype.getPosition=VS.prototype.getPosition;VS.prototype.getDuration=VS.prototype.getDuration;VS.prototype.getTitle=VS.prototype.getTitle;
|
|
15
|
+
VS.prototype.getAdvertiserName=VS.prototype.getAdvertiserName;VS.prototype.getAdSystem=VS.prototype.getAdSystem;VS.prototype.getApiFramework=VS.prototype.getApiFramework;VS.prototype.getSourceId=VS.prototype.Ib;VS.prototype.getCreativeId=VS.prototype.getCreativeId;VS.prototype.getId=VS.prototype.getId;VS.prototype.getTechnology=VS.prototype.ob;VS.prototype.getAdManagerVersion=VS.prototype.lb;VS.prototype.getAdManagerName=VS.prototype.kb;WS.prototype.create=function(a){var b=google.ima.AdError.ErrorCode;switch(a){case b.VAST_LOAD_TIMEOUT:case b.VAST_MEDIA_LOAD_TIMEOUT:case b.FAILED_TO_REQUEST_ADS:return 0;case b.VIDEO_PLAY_ERROR:return 1;default:return 2}};XS.prototype.getCuePoints=function(){return this.a};XS.prototype.$b=function(){return 0<=this.a.indexOf(0)||0===this.a.length};XS.prototype.Zb=function(){return 0<=this.a.indexOf(-1)};XS.prototype.hasPostroll=XS.prototype.Zb;XS.prototype.hasPreroll=XS.prototype.$b;XS.prototype.getCuePoints=XS.prototype.getCuePoints;_.w(YS,_.iw);_.r=YS.prototype;_.r.onPlayerCreated=function(a){if(ZS())return a.onError(new _.O(1,9,1E4));this.f=_.qr(_.Td,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.h=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.h);this.a.getSettings().setPlayerType(_.Ca);this.a.getSettings().setPlayerVersion(_.ka);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
16
|
+
_.r.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.h&&(this.h.destroy(),this.h=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.r.pm=function(){return this.a};_.r.nm=function(){return this.h};_.r.Hd=function(){return this.f};_.r.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",YS);YS.prototype.getAdContainer=YS.prototype.Hd;YS.prototype.getAdDisplayContainer=YS.prototype.nm;YS.prototype.getAdsLoader=YS.prototype.pm;YS.Id="ima";
|
|
17
|
+
YS.isSdkMissing=ZS;$S.prototype.create=function(){return new YS};_.r=aT.prototype;
|
|
18
|
+
_.r.An=function(a){var b=this;this.a=a.getAdsManager(this.o,cT(this));this.a.isCustomPlaybackUsed()&&!jT(this)?(this.g.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.m.onError(new _.O(1,9,10002)),this.Ac()):(this.setMuted(this.l),this.Pa(this.H),this.h=new _.zv(this.m.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.K=new XS(a),this.m.trigger(new _.R(_.Ec,{adsTimeline:this.K})),
|
|
19
|
+
bT(this));this.f.resolve()};_.r.zn=function(a){iT(this,a.getError());this.f.resolve()};_.r.Kn=function(a){this.J=!0;kT(this)||(this.m.pause(),_.sr(this.o,{visibility:_.se}));fT(this,_.hc,a);this.h.start()};_.r.pn=function(){kT(this)?eT(this):this.a.start()};_.r.ql=function(a){a.getAd().isLinear()?fT(this,_.sc,a):(this.a.discardAdBreak(),this.D||(this.D=!0,this.m.play()))};_.r.tl=function(a){this.M=!0;this.G=!1;this.w=a.getAd().getDuration();fT(this,_.Ac,a);this.m.getSurface().show(this.X)};
|
|
20
|
+
_.r.tn=function(a){a=a.getAdData();iT(this,a?a.adError:null);gT(this)};_.r.rl=function(a){fT(this,_.vc,a)};_.r.qn=function(a){fT(this,_.jc,a)};_.r.ol=function(a){fT(this,_.mc,a)};_.r.un=function(a){fT(this,_.tc,a)};_.r.ul=function(a){fT(this,_.Cc,a)};_.r.wn=function(a){this.G=!0;fT(this,_.uc,a)};_.r.xn=function(a){this.G=!1;fT(this,_.wc,a)};_.r.nl=function(a){this.pause();fT(this,_.kc,a)};_.r.sl=function(a){fT(this,_.yc,a);gT(this)};_.r.pl=function(a){fT(this,_.qc,a)};
|
|
21
|
+
_.r.rn=function(a){fT(this,_.lc,a);gT(this)};
|
|
22
|
+
_.r.Ln=function(){var a=this,b,c;return _.I(function(d){switch(d.a){case 1:a.D=!0;if(!kT(a)||null===a.I){if(!a.J)return d["return"](a.m.play());hT(a);d.C(2);break}b=a.m.getVolume();c=a.m.isMuted();var e=a.m;e.a&&e.a.forwardEventsTo(e);e=a.m;e.f=_.N.ta(e.f,{volume:b,muted:c});return _.y(d,_.au(a.m),3);case 3:if(a.B||!a.I){d.C(2);break}return _.y(d,dT(a,[6,8,10,11]),5);case 5:return _.y(d,a.m.play(),6);case 6:return _.y(d,a.m.pause(),7);case 7:return _.y(d,dT(a,[10,11]),8);case 8:return _.y(d,a.m.setPosition(a.I),
|
|
23
|
+
2);case 2:a.J=!1;a.h&&a.h.stop();if(a.B){d.C(10);break}return _.y(d,a.m.play(),10);case 10:fT(a,_.ic),_.A(d)}})};_.r.Jn=function(){this.B=!0;this.j.contentComplete()};
|
|
24
|
+
_.r.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.A;try{if(typeof c.adTagUrl!==_.ig)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.T.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.T.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(f);
|
|
25
|
+
return g["return"](a.f)})};_.r.Bb=function(){if(this.P||!this.a||this.P)return!0;if(!this.W){if(this.K.$b())return mT(this),!1;this.ba.initialize();lT(this);return!0}return this.zb()&&this.a?(this.a.resume(),!1):!0};_.r.Sc=function(){};_.r.Pc=function(){return!0};_.r.Sa=function(){this.a&&this.a.pause()};_.r.isPaused=function(){return this.G};_.r.skip=function(){this.a&&this.a.skip()};_.r.getAdVolume=function(){return this.a?this.l?this.H:this.a.getVolume():1};
|
|
26
|
+
_.r.Pa=function(a){this.H=a;this.a&&(this.l||this.a.setVolume(a))};_.r.setVolume=function(a){this.Pa(a)};_.r.getVolume=function(){return this.getAdVolume()};_.r.pause=function(){this.Sa()};_.r.resume=function(){this.Bb()};_.r.setMuted=function(a){this.l=a;this.a&&(a?this.a.setVolume(0):this.a.setVolume(this.H))};_.r.isMuted=function(){return this.l};_.r.zb=function(){return this.M};_.r.getPosition=function(){if(!this.a||null===this.w)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.w-a};
|
|
27
|
+
_.r.Ac=function(){this.a&&(this.a.destroy(),this.a=null);this.P=!0;hT(this);this.L.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};aT.prototype.getPosition=aT.prototype.getPosition;aT.prototype.resume=aT.prototype.resume;aT.prototype.pause=aT.prototype.pause;aT.prototype.getVolume=aT.prototype.getVolume;aT.prototype.setVolume=aT.prototype.setVolume;aT.prototype.getAdVolume=aT.prototype.getAdVolume;aT.prototype.skip=aT.prototype.skip;aT.prototype.pauseAd=aT.prototype.Sa;nT.prototype.name=function(){return US};nT.prototype.a=function(a,b){return a.namespace()===_.xd?!1:ZS()?(this.Ea.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};nT.prototype.create=function(a){return new aT(a)};_.Zq(new nT);_.fu(new $S);};
|
|
28
28
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
29
29
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
30
30
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.mediatailor.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
var f=function(window){var RS=function(){this.g=new _.L("clpp.mediatailor.MediaTailorPlugin")},SS=function(a,b,c){var d,e,f,g,k;return _.I(function(l){if(1==l.a)return _.y(l,fetch(b,{method:_.qb,body:JSON.stringify(c.sessionConfig)}),2);if(3!=l.a)return d=l.f,_.y(l,d.json(),3);e=l.f;f=e.manifestUrl;g=e.trackingUrl;k={Dj:_.hk(f,b),nq:g?_.hk(g,b):null};a.g.info("Media Tailor session initialized.\n - manifest URI: "+k.Dj);return l["return"](k)})},TS=function(){};_.w(RS,_.iw);
|
|
3
|
+
RS.prototype.onContentWillLoad=function(a,b){var c=this,d,e,f;return _.I(function(g){if(1==g.a){d=a.getConfiguration().mediatailor;if(!d.enabled)return g["return"]();c.g.info("MediaTailor plugin is enabled");_.F(g,2);return _.y(g,SS(c,b.url,d),4)}if(2!=g.a)return e=g.f,a.trigger(new _.R("mt-session-started")),b.url=e.Dj,_.G(g,0);f=_.H(g);c.g.error("Failed to start session",f);throw new _.O(_.Q,9,7003,"Media Tailor session failed to initialize.");})};RS.prototype.id=function(){return"mediatailor"};
|
|
4
|
+
TS.prototype.create=function(){return new RS};_.fu(new TS);};
|
|
5
5
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
6
6
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
7
7
|
else{_=this.clpp._;(f.call(g,this));}
|