@castlabs/prestoplay 6.22.0 → 6.23.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.
- package/CHANGELOG.md +9 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +7 -7
- package/cjs/cl.cast.js +112 -112
- package/cjs/cl.conviva.js +32 -33
- package/cjs/cl.core.js +591 -586
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +81 -80
- package/cjs/cl.externs.js +43 -36
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +69 -69
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +30 -29
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +330 -325
- package/cjs/cl.muxdata.js +15 -15
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.sessions.js +16 -16
- package/cjs/cl.simid.js +15 -15
- package/cjs/cl.smooth.js +72 -72
- 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 -13
- 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 +37 -37
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +88 -88
- package/cl.conviva.js +27 -27
- package/cl.core.js +477 -474
- package/cl.crypto.js +9 -9
- package/cl.dash.js +76 -75
- package/cl.externs.js +43 -36
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +74 -74
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -26
- package/cl.ima.js +17 -17
- package/cl.mse.js +295 -291
- package/cl.muxdata.js +13 -13
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +10 -10
- package/cl.playlist.js +5 -5
- package/cl.sessions.js +10 -10
- package/cl.simid.js +13 -13
- package/cl.smooth.js +59 -59
- package/cl.thumbnails.js +19 -19
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +22 -22
- package/cl.verimatrix.js +4 -4
- package/cl.vimond.js +8 -8
- package/cl.vr.js +15 -15
- package/cl.vtt.js +12 -12
- package/cl.yospace.js +3 -3
- package/cl.youbora.js +28 -27
- package/package.json +1 -1
- package/typings.d.ts +53 -6
package/cjs/cl.htmlcue.js
CHANGED
|
@@ -1,33 +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.
|
|
11
|
-
|
|
12
|
-
c
|
|
13
|
-
c.observe(b,{subtree:!1,childList:!0});a.j.push(function(){return c.disconnect()})},
|
|
14
|
-
this.G=new _.
|
|
15
|
-
d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.
|
|
16
|
-
else{
|
|
17
|
-
end:c}},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
c
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_.u.
|
|
2
|
+
var f=function(window){var TT="CLPP Subtitle Styles",UT="Unsupported unit",VT="clpp-text-plain",WT="clpp-text-ttml",XT="clpp.htmlcue.HtmlTextDisplayer",YT="initial",ZT=function(a){return _.Di(a,{zh:function(b,c){return b.na(c)}})},$T=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)},aU=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},bU=function(){},cU=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},eU=function(a){for(var b=null;b=a.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)a=a.replace(b[0],function(c){return dU[c]});return a},gU=function(a,b){fU(a,b);Array.from(b.getElementsByTagName("*")).forEach(function(c){fU(a,c)})},fU=function(a,b){for(var c in a)null!=a[c]&&(b.style[c]=a[c])},hU=function(a,b){return 0===a?"0":a+b},iU=function(a,b){return 1>Math.abs(a-b)||a<b},jU=function(a,b){return a<b&&
|
|
4
|
+
1<Math.abs(a-b)},kU=function(a,b){return a>b&&1<Math.abs(a-b)},lU=function(a,b){return 1>Math.abs(a-b)||a>b},mU=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},nU=function(a){return new mU(a.left,a.f,a.top,a.a,a.height,a.width)},oU=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 mU(b.left+d,b.right+e,g,(b.bottom||g+f)+c,f,(b.width||a.offsetWidth)-d-e)},pU=function(a,b){return b.some(function(c){return jU(a.left,c.f)&&kU(a.f,c.left)&&jU(a.top,c.a)&&kU(a.a,c.top)})},qU=function(a,b){return lU(a.top,b.top)&&iU(a.a,b.a)&&lU(a.left,b.left)&&iU(a.f,b.f)},rU=function(a,b,c){switch(c){case "+x":return jU(a.left,b.left);case "-x":return kU(a.f,b.f);
|
|
6
|
+
case "+y":return jU(a.top,b.top);case "-y":return kU(a.a,b.a);default:throw Error("Unknown axis");}},sU=function(a,b,c){this.id=a;this.w=b;this.B=c;this.a=this.o();this.j=!1},tU=function(a,b,c){sU.call(this,a.id,"clpp-text-cue",{});this.l=b;this.f=a;this.h=!!this.f.backgroundImage;this.C=c},vU=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 uU(a)?b:c},yU=function(a,b,c){return uU(a)&&_.N.ua(c)?hU(c,_.Lf):(wU(a)||
|
|
7
|
+
xU(a))&&_.N.ua(b)?hU(b,"%"):YT},wU=function(a){return a.f.writingMode===_.Eg},xU=function(a){return a.f.writingMode===_.Hg},uU=function(a){return a.f.writingMode===_.Hi},zU=function(a,b,c){return(wU(a)||xU(a))&&_.N.ua(c)?hU(c,_.Lf):wU(a)&&_.N.R(c)?hU(0,_.Lf):uU(a)&&_.N.ua(b)?hU(b,"%"):YT},AU=function(a,b){if(typeof a.f.position===_.k&&typeof a.f.size===_.k)switch(b){case _.Ee:return a.f.position;case "auto":case _.rd:return a.f.position-a.f.size/2;case _.Fe:return a.f.position-a.f.size}return 0},
|
|
8
|
+
BU=function(a){switch(a.f.positionAlign){case _.Ee:return _.Be;case "auto":case _.rd:return _.Gi;case _.Fe:return _.Sf}return a.f.textAlign},CU=function(a){if(!a.f.positionAlign)switch(a.f.textAlign){case _.Be:case _.Be:return _.Ee;case _.Gi:return _.rd;case _.Sf:case _.Sf:return _.Fe}return a.f.positionAlign},DU=function(a){switch(a.f.writingMode){case _.Hi:return"horizontal-tb";case _.Eg:return _.Eg;case _.Hg:return _.Hg;default:throw Error("Unknown writing mode");}},EU=function(a,b){this.l=a;this.f=
|
|
9
|
+
a.a;this.j=void 0===b?!1:b;this.a=oU(a.a);this.h=[]},FU=function(a,b){if(a.j)switch(b.writingMode){case _.Hi:return["-y"];case _.Eg:return["+x"];case _.Hg:return["-x"]}var c=[];switch(b.writingMode){case _.Hi:c=["+y","-y"];break;case _.Eg:c=["+x","-x"];break;case _.Hg:c=["-x","+x"]}0>b.line&&(c=c.reverse());return c},GU=function(a){for(a.h=[];0<a.f.childNodes.length;)a.f.removeChild(a.f.childNodes[0]);a.a=oU(a.l.a)},HU=function(a,b,c){sU.call(this,a,b,c);this.h=null;this.l=[]},IU=function(a,b){HU.call(this,
|
|
10
|
+
a.id,"clpp-text-cue-region",b);this.f=a},JU=function(a,b,c){a=a.f;var d=a.viewportAnchorUnits;if(d===_.Mi)return a.viewportAnchorY/100*c-a.regionAnchorY/100*b;if(0===d)return a.viewportAnchorY-a.regionAnchorY;throw Error(UT);},LU=function(a){this.g=new _.K("clpp.htmlcue.StyleManager");this.j=[];this.h=a;this.l=[];this.a=KU(this,this.h);this.f=KU(this,this.h,!0);this.f.disabled=!0;this.g.debug("Stylesheet CLPP Subtitle Styles has been created.")},MU=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},NU=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)},KU=function(a,b,c){var d=document.createElement(_.kg),e=d.dataset;e.name=TT;e["for"]=b;c&&(e.name="CLPP Subtitle Styles (sandbox)",e.sandbox=!0);b=document.head;b.appendChild(d);OU(a,b);a.g.debug("Created HTML style element #CLPP Subtitle Styles.");return d.sheet},OU=function(a,b){var c=new MutationObserver(function(d){d.forEach(function(e){e.removedNodes.forEach(function(f){f.id===TT&&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()})},RU=function(a){_.wv.call(this,a);var b=this;this.g=new _.K(XT);this.m=a;this.L=PU(a.getConfiguration());this.j=!1;this.f=[];this.C=a.getSurface().getContainer();this.h=new LU(a.getSurface().getUniqueCssClass());this.a=new HU(null,"clpp-text-container",{});this.w=new _.Au(a.getSurface(),this.lk.bind(this));this.J=null;this.C?(this.C.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 _.xl(function(){QU(b)});this.A=new Map;this.l=null},PU=function(a){a=_.N.cb(a.htmlcue||{});_.N.R(a.stretchSmpteImage)&&(a.stretchSmpteImage=!1);_.N.R(a.enableResizeObserver)&&(a.enableResizeObserver=!0);return a},SU=function(a,b){return a.startTime<=b&&a.endTime>b},QU=function(a,b){if((b||a.j)&&a.C){var c=a.m.getPosition();if(b||a.J!==c&&a.m.getState()===_.iq){a.J=c;var d=TU(a,c);(c=b)||(c=a.l,c=!(null===c&&null===d||null!==c&&null!==d&&c.start===d.start&&c.end===d.end));if(c&&(a.l=d,UU(a),
|
|
15
|
+
d)){c={color:a.getFontColor()||void 0,backgroundColor:a.getBackgroundColor()||void 0,fontFamily:a.getFontFamily()||void 0,textShadow:_.Bv(a)||void 0};d=a.f.slice(d.start,d.end+1);d=_.w(d);for(var e=d.next();!e.done;e=d.next()){var f=a;e=e.value;var g=f.a.a,h=null;switch(e.payloadType){case _.Og:h="clpp-text-vtt";break;case _.sg:h=WT;break;case _.Fi:h=VT}h&&!g.classList.contains(h)&&_.Jq(g,h);g=oU(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{fU({fontSize:VU(f,e.containerRows)},f.a.a);g=null;h=e.payloadType===_.Og;var l=e.payloadType===_.sg;e.region&&(h||l||e.backgroundImage)&&(f.A.has(e.region.id)?g=f.A.get(e.region.id):(g=new IU(e.region,{}),f.A.set(e.region.id,g),f.a.appendChild(g)));e=new tU(e,f.L,c);g?g.appendChild(e):f.a.appendChild(e)}}}}}},TU=function(a,b){var c=aU(a.f,function(e){return SU(e,b)?0:b!==e.startTime?b-e.startTime:b-e.endTime});if(-1===c)return null;for(var d=c;0<=d-1&&SU(a.f[d-1],b);)d--;for(;c+1<a.f.length&&
|
|
17
|
+
SU(a.f[c+1],b);)c++;return{start:d,end:c}},WU=function(a){UU(a);a.J=null;a.l=null;a.f=[]},UU=function(a){a.A.clear();if(a.a){var b=a.a.a;b.classList.remove("clpp-text-vtt");b.classList.remove(WT);b.classList.remove(VT);a=a.a;GU(a.h);a.l=[]}},VU=function(a,b){var c=oU(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===_.k&&0<b)return Math.round(c/b)+_.Lf;d=a.getFontSizePercent();return Math.round(c*d)+_.Lf},XU=function(){},
|
|
18
|
+
YU=function(){};
|
|
19
|
+
bU.prototype.parse=function(a){a={input:a};for(var b=_.Lq(_.Xd),c=[],d=b,e;null!==(e=cU(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 h=ZU[f];h?(h=_.Lq(h),(f=$U[f])&&g&&h.setAttribute(f,g.trim()),g=h):g=null;!g||aV[g.localName]&&aV[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(eU(e)));return b};var ZU={c:"c",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"v",lang:"lang"},$U={v:"voice",lang:"lang"},aV={rt:"ruby"},dU={"\x26amp;":"\x26","\x26lt;":"\x3c","\x26gt;":"\x3e","\x26lrm;":"\u200e","\x26rlm;":"\u200f","\x26nbsp;":"\u00a0"};sU.prototype.init=function(){this.j=!0};sU.prototype.A=function(){return!1};_.x(tU,sU);tU.prototype.A=function(){return!this.h&&!(this.f.region&&this.f.region.displayAlign)};
|
|
21
|
+
tU.prototype.init=function(a){sU.prototype.init.call(this,a);if(this.h)_.Jq(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===_.sg){var c=_.Lq(_.Xd);c.innerHTML=b.payload;b=c}else b.payloadType===_.Og?b=(new bU).parse(b.payload):(c=_.Lq(_.Xd),c.textContent=b.payload,b=c);_.Jq(b,this.w);this.id&&(b.id=this.id);c=_.w(this.f.cssClassList);for(var d=
|
|
22
|
+
c.next();!d.done;d=c.next())_.Jq(b,d.value);fU({writingMode:DU(this)},b);this.a.appendChild(b);_.Jq(this.a,"clpp-text-wrapper");c=_.w(this.f.cssClassList);for(d=c.next();!d.done;d=c.next())_.Jq(this.a,"clpp-text-wrapper__"+d.value);_.N.R(this.f.line)&&(this.f.lineInterpretation=_.Ii,this.f.line=uU(this)?-1:0);c=DU(this);fU({writingMode:c,webkitWritingMode:c,direction:YT,textAlign:BU(this)},this.a);if(!this.f.region||!this.f.region.displayAlign){c=AU(this,CU(this));d=zU(this,c,null);var e=yU(this,
|
|
23
|
+
c,null),f=xU(this)&&_.N.R(null)?hU(0,_.Lf):YT;fU({position:"absolute",left:d,right:f,top:e,width:uU(this)?hU(this.f.size,"%"):YT,height:wU(this)||xU(this)?hU(this.f.size,"%"):YT},this.a);d=this.f;a=uU(this)?a.height:a.width;e=vU(this);if(d.lineInterpretation===_.Ii)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 _.rd:g-=f/2;break;case _.oe:g-=f}f=Math.round(g/100*a)}xU(this)&&(f=a-f-e);a=f;d=zU(this,c,a);e=xU(this)&&_.N.R(a)?
|
|
24
|
+
hU(0,_.Lf):YT;fU({left:d,right:e,top:yU(this,c,a)},this.a)}gU(this.C,b)}};tU.prototype.o=function(){return _.Lq(_.Xd)};EU.prototype.append=function(a){var b=a.a;b.style.visibility=_.we;this.f.appendChild(b);a.j||a.init(this.a);if(a.A()){a:{var c=oU(a.a);var d=FU(this,a.f),e=vU(a),f=nU(c),g=null,h=0;d=_.w(d);for(var l=d.next();!l.done;l=d.next()){for(l=l.value;rU(c,this.a,l)||qU(c,this.a)&&pU(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||qU(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>h&&(g=nU(c),h=l);c=nU(f)}c=g||f}fU({top:hU(c.top-this.a.top,_.Lf),bottom:hU(this.a.a-c.a,_.Lf),left:hU(c.left-this.a.left,_.Lf),right:hU(this.a.f-c.f,_.Lf),height:hU(c.height,_.Lf),width:hU(c.width,_.Lf)},a.a)}b.style.visibility="visible";this.h.push(oU(a.a))};_.x(HU,sU);HU.prototype.init=function(){this.h=new EU(this);this.j=!0};HU.prototype.o=function(){var a=_.Lq(_.Xd);_.Jq(a,this.w);this.id&&(a.id=this.id);return a};HU.prototype.appendChild=function(a){GU(this.h);this.l.unshift(a);a=_.w(this.l);for(var b=a.next();!b.done;b=a.next())this.h.append(b.value)};_.x(IU,HU);
|
|
26
|
+
IU.prototype.init=function(a){a:{var b=this.f;switch(b.widthUnits){case 0:b=b.width;break a;case _.Mi:b=b.width/100*a.width;break a;default:throw Error(UT);}}var c=this.f;var d=c.viewportAnchorUnits;if(d===_.Mi)c=c.viewportAnchorX/100*a.width-c.regionAnchorX/100*b;else if(0===d)c=c.viewportAnchorX-c.regionAnchorX;else throw Error(UT);d=a.height;var e=JU(this,d,a.height);fU(this.B,this.a);fU({left:hU(c,_.Lf),top:hU(e,_.Lf),width:hU(b,_.Lf),height:hU(d,_.Lf)},this.a);this.f.writingMode&&fU({display:"flex",
|
|
27
|
+
"flex-direction":this.f.writingMode},this.a);this.f.displayAlign&&fU({"justify-content":this.f.displayAlign},this.a);b=_.w(this.f.cssClassList);for(c=b.next();!c.done;c=b.next())_.Jq(this.a,c.value);a:switch(b=this.f,b.heightUnits){case 0:b=b.height;break a;case _.Mi:b=b.height/100*a.height;break a;case 2:b=b.height;d=new tU(new _.Li(0,1,"Lorem ipsum",_.Fi),{},{});c=d.a;this.a.appendChild(c);d.init(oU(this.a));d=c.getBoundingClientRect().height;this.a.removeChild(c);b*=d;break a;default:throw Error(UT);
|
|
28
|
+
}a=JU(this,b,a.height);fU({top:hU(a,_.Lf),height:hU(b,_.Lf)},this.a);this.h=new EU(this,!0);this.j=!0};IU.prototype.getId=function(){return this.f.id};LU.prototype.appendRule=function(a){if(null!=this.a&&!this.l.some(function(c){return c===a})){var b=NU(this,a);if(MU(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
|
+
LU.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.");_.B(b)})};_.x(RU,_.wv);_.u=RU.prototype;_.u.append=function(a,b){if(null!=this.h&&0!==a.length){for(var c=_.w(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=$T(this.f,ZT(a));this.l=null;QU(this,!1)}};_.u.Nb=function(){null==this.h||QU(this,!0)};
|
|
30
|
+
_.u.destroy=function(){var a=this;return _.I(function(b){if(1==b.a){if(null==a.h)return b["return"]();WU(a);a.G.stop();return _.y(b,a.h.destroy(),2)}a.h=null;a.C.removeChild(a.a.a);a.a=null;a.w.stop();a.w=null;a.j=!1;_.B(b)})};_.u.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;QU(this,!0);return!0};_.u.isTextVisible=function(){return this.j};
|
|
31
|
+
_.u.setTextVisibility=function(a){null!=this.h&&this.j!==a&&((this.j=a)?(this.G.Ab(.25),this.L.enableResizeObserver&&this.w.start(),QU(this,!0)):(this.G.stop(),this.w.stop(),WU(this)))};_.u.lk=function(){QU(this,!0)};_.J(XT,RU);RU.prototype.setTextVisibility=RU.prototype.setTextVisibility;RU.prototype.isTextVisible=RU.prototype.isTextVisible;RU.prototype.remove=RU.prototype.remove;RU.prototype.destroy=RU.prototype.destroy;RU.prototype.append=RU.prototype.append;XU.prototype.a=function(a){return!!a.enableHtmlCue&&!_.Hl()};XU.prototype.create=function(a){return new RU(a)};_.x(YU,_.Kt);YU.prototype.f=function(){_.Ip(_.xe,new XU)};YU.prototype.a=function(){_.Gp.has(_.xe)&&(_.Gp["delete"](_.xe),_.Hp.info("Removed factory: 'html'"))};YU.prototype.id=function(){return _.mg};_.J("clpp.htmlcue.HtmlCueComponent",YU);};
|
|
31
32
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
32
33
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
33
34
|
else{_=this.clpp._;(f.call(g,this));}
|
package/cjs/cl.ima.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
c;this.
|
|
4
|
-
d.LOADED,a.
|
|
5
|
-
d.CONTENT_RESUME_REQUESTED,a.
|
|
6
|
-
_.
|
|
7
|
-
_.
|
|
8
|
-
!google.ima||!google.ima.AdsLoader},
|
|
9
|
-
_.u.getTitle=function(){return this.a.getTitle()};_.u.getDuration=function(){return this.a.getDuration()};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.u.
|
|
10
|
-
_.u.
|
|
11
|
-
_.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.u.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.u.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
_.u.
|
|
16
|
-
_.u.
|
|
17
|
-
_.u.
|
|
18
|
-
_.u.
|
|
19
|
-
_.u.
|
|
20
|
-
_.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.G;try{if(typeof c.adTagUrl!==_.
|
|
21
|
-
return g["return"](a.f)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.
|
|
22
|
-
_.u.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.u.
|
|
23
|
-
_.u.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)};_.u.
|
|
24
|
-
|
|
2
|
+
var f=function(window){var AT="clpp.ima.AdsManagerFactory",BT=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.j=b;this.h=c},CT=function(){},DT=function(a){this.a=a},ET=function(a){var b=a.Wd("ima");if(!b)throw Error("IMA plugin not created.");var c=b.cd(),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.");this.m=a;this.l=e;a=this.m.getConfiguration();a=_.N.cb(a.ima||{});this.G=_.N.qa({disableCustomPlayback:!1},a);this.L=
|
|
3
|
+
c;this.M=d;this.j=b;this.J=new _.Cu;this.g=new _.K("clpp.ima");this.h=this.a=null;this.f=new _.mk;this.K=!1;this.H=new _.Wh;this.P=new CT;this.o=null;this.C=this.A=this.B=!1;this.I=this.w=null;c=this.H;d=google.ima.AdErrorEvent.Type.AD_ERROR;c.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.zm.bind(this));c.on(this.j,d,this.ym.bind(this));c.on(this.m,_.pe,this.Fm.bind(this))},FT=function(a){var b=a.a,c=a.H,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.pm.bind(a));c.on(b,
|
|
4
|
+
d.LOADED,a.qk.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Gm.bind(a));c.on(b,d.STARTED,a.tk.bind(a));c.on(b,d.LOG,a.tm.bind(a));c.on(b,d.AD_PROGRESS,a.rk.bind(a));c.on(b,d.AD_BUFFERING,a.qm.bind(a));c.on(b,d.FIRST_QUARTILE,a.nk.bind(a));c.on(b,d.MIDPOINT,a.um.bind(a));c.on(b,d.THIRD_QUARTILE,a.uk.bind(a));c.on(b,d.PAUSED,a.wm.bind(a));c.on(b,d.RESUMED,a.xm.bind(a));c.on(b,d.CLICK,a.mk.bind(a));c.on(b,d.SKIPPED,a.sk.bind(a));c.on(b,d.IMPRESSION,a.pk.bind(a));c.on(b,d.COMPLETE,a.rm.bind(a));c.on(b,
|
|
5
|
+
d.CONTENT_RESUME_REQUESTED,a.Hm.bind(a))},GT=function(a){a=a.G;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.k&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.hd?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.k&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.k&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
|
|
6
|
+
_.hd&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},IT=function(a){a.o=null;HT(a,_.Ic);a.m.getSurface().hide(a.L)},JT=function(a){_.Kq(a.l,{visibility:"visible"})},HT=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new BT(c,a.B,a.A)});a.m.trigger(new _.L(b,d))},KT=function(a,b){var c=b?a.P.create(b.getErrorCode()):null;a.m.onError(new _.O(1,9,10003,{errorType:c},b))},LT=function(a){return!1===a.G.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&
|
|
7
|
+
_.vk()},NT=function(a){var b,c;return _.I(function(d){if(1==d.a)return a.M.initialize(),b=!!a.m.getConfiguration().muted,_.y(d,a.J.canPlay(b),2);c=d.f;if(!c&&!LT(a))return HT(a,_.fd),a.g.warn(_.la),d["return"]();MT(a);_.B(d)})},OT=function(a,b){return _.I(function(c){if(1==c.a)return a.M.initialize(),_.y(c,b.play(),2);MT(a);_.B(c)})},MT=function(a){a.a.init(a.l.offsetWidth,a.l.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.K=!0},PT=function(){this.a=this.h=this.f=null},QT=function(){return!window.google||
|
|
8
|
+
!google.ima||!google.ima.AdsLoader},RT=function(){},ST=function(){this.jd=new _.K(AT)};_.u=BT.prototype;_.u.ob=function(){return"Google IMA SDK"};_.u.pb=function(){return google.ima.VERSION};_.u.sb=function(){return 0};_.u.getId=function(){return this.a.getAdId()};_.u.getCreativeId=function(){return this.a.getCreativeId()};_.u.Sb=function(){return""};_.u.getApiFramework=function(){return this.a.getApiFramework()};_.u.getAdSystem=function(){return this.a.getAdSystem()};_.u.getAdvertiserName=function(){return this.a.getAdvertiserName()};
|
|
9
|
+
_.u.getTitle=function(){return this.a.getTitle()};_.u.getDuration=function(){return this.a.getDuration()};_.u.getPosition=function(){return 0};_.u.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.u.Wb=function(){return this.f?this.f.getIsBumper():!1};_.u.qb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Xe&&typeof b[d].clickThroughUrl===_.ig});c&&(a=b[c].clickThroughUrl);return a};_.u.getMediaUrl=function(){return this.a.getMediaUrl()};
|
|
10
|
+
_.u.fb=function(){return this.a.getVastMediaWidth()};_.u.eb=function(){return this.a.getVastMediaHeight()};_.u.Qa=function(){return this.a.getVastMediaBitrate()};_.u.Ra=function(){return this.h?2:this.j?1:0};_.u.getPodIndex=function(){return this.f?this.f.getPodIndex():0};_.u.Fb=function(){return this.f?this.f.getTimeOffset():0};_.u.Gb=function(){return this.f?this.f.getAdPosition():1};_.u.gb=function(){return this.f?this.f.getTotalAds():1};_.u.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};
|
|
11
|
+
_.u.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.u.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};_.u.Vb=function(){return null};BT.prototype.getVideoElement=BT.prototype.Vb;BT.prototype.getWrapperCreativeIds=BT.prototype.getWrapperCreativeIds;BT.prototype.getWrapperAdSystems=BT.prototype.getWrapperAdSystems;BT.prototype.getWrapperAdIds=BT.prototype.getWrapperAdIds;BT.prototype.getSequenceLength=BT.prototype.gb;BT.prototype.getPositionInSequence=BT.prototype.Gb;
|
|
12
|
+
BT.prototype.getPodTimeOffset=BT.prototype.Fb;BT.prototype.getPodIndex=BT.prototype.getPodIndex;BT.prototype.getPodType=BT.prototype.Ra;BT.prototype.getMediaBitrate=BT.prototype.Qa;BT.prototype.getMediaHeight=BT.prototype.eb;BT.prototype.getMediaWidth=BT.prototype.fb;BT.prototype.getMediaUrl=BT.prototype.getMediaUrl;BT.prototype.getClickThroughUrl=BT.prototype.qb;BT.prototype.isBumper=BT.prototype.Wb;BT.prototype.getSkipTimeOffset=BT.prototype.getSkipTimeOffset;BT.prototype.getPosition=BT.prototype.getPosition;
|
|
13
|
+
BT.prototype.getDuration=BT.prototype.getDuration;BT.prototype.getTitle=BT.prototype.getTitle;BT.prototype.getAdvertiserName=BT.prototype.getAdvertiserName;BT.prototype.getAdSystem=BT.prototype.getAdSystem;BT.prototype.getApiFramework=BT.prototype.getApiFramework;BT.prototype.getSourceId=BT.prototype.Sb;BT.prototype.getCreativeId=BT.prototype.getCreativeId;BT.prototype.getId=BT.prototype.getId;BT.prototype.getTechnology=BT.prototype.sb;BT.prototype.getAdManagerVersion=BT.prototype.pb;
|
|
14
|
+
BT.prototype.getAdManagerName=BT.prototype.ob;CT.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}};DT.prototype.getCuePoints=function(){return this.a};DT.prototype.Ib=function(){return 0<=this.a.indexOf(0)||0===this.a.length};DT.prototype.Hb=function(){return 0<=this.a.indexOf(-1)};DT.prototype.hasPostroll=DT.prototype.Hb;DT.prototype.hasPreroll=DT.prototype.Ib;DT.prototype.getCuePoints=DT.prototype.getCuePoints;_.u=ET.prototype;
|
|
15
|
+
_.u.zm=function(a){var b=this;this.a=a.getAdsManager(this.l,GT(this));this.a.isCustomPlaybackUsed()&&!LT(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.sc()):(this.h=new _.Au(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.w=new DT(a),this.m.trigger(new _.L(_.Lc,{adsTimeline:this.w})),FT(this));this.f.resolve()};
|
|
16
|
+
_.u.ym=function(a){KT(this,a.getError());this.f.resolve()};_.u.Gm=function(a){var b=this;return _.I(function(c){switch(c.a){case 1:return b.C=!0,LT(b)?(b.I=b.m.getPosition(),_.y(c,b.m.detach(),5)):_.y(c,b.m.pause(),4);case 4:_.Kq(b.l,{visibility:_.we});c.F(3);break;case 5:var d=b.m;d.a&&d.a.stopForwardingEventsTo(d);case 3:HT(b,_.rc,a),b.h.start(),_.B(c)}})};_.u.pm=function(){var a=this;return _.I(function(b){a.a.start();_.B(b)})};
|
|
17
|
+
_.u.qk=function(a){a.getAd().isLinear()?HT(this,_.Bc,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.m.play()))};_.u.tk=function(a){this.o=a.getAd().getDuration();HT(this,_.Hc,a);this.m.getSurface().show(this.L)};_.u.tm=function(a){a=a.getAdData();KT(this,a?a.adError:null);IT(this)};_.u.rk=function(a){HT(this,_.Ec,a)};_.u.qm=function(a){HT(this,_.tc,a)};_.u.nk=function(a){HT(this,_.wc,a)};_.u.um=function(a){HT(this,_.Cc,a)};_.u.uk=function(a){HT(this,_.Jc,a)};_.u.wm=function(a){HT(this,_.Dc,a)};
|
|
18
|
+
_.u.xm=function(a){HT(this,_.Fc,a)};_.u.mk=function(a){this.pause();HT(this,_.uc,a)};_.u.sk=function(a){HT(this,_.Gc,a);IT(this)};_.u.pk=function(a){HT(this,_.Ac,a)};_.u.rm=function(a){HT(this,_.vc,a);IT(this)};
|
|
19
|
+
_.u.Hm=function(){var a=this;return _.I(function(b){switch(b.a){case 1:a.B=!0;if(!LT(a)||null===a.I){if(!a.C)return b["return"](a.m.play());JT(a);b.F(2);break}var c=a.m;c.a&&c.a.forwardEventsTo(c);return _.y(b,_.ct(a.m),3);case 3:if(a.A){b.F(2);break}return _.y(b,a.m.seek(a.I),2);case 2:a.C=!1;a.h&&a.h.stop();if(a.A){b.F(6);break}return _.y(b,a.m.play(),6);case 6:HT(a,_.sc),_.B(b)}})};_.u.Fm=function(){this.A=!0;this.j.contentComplete()};
|
|
20
|
+
_.u.load=function(){var a=this,b,c,d,e,f;return _.I(function(g){if(1==g.a){b=a.m;c=a.G;try{if(typeof c.adTagUrl!==_.ig)throw new _.O(1,9,10001,{missingKeys:"adTagUrl"});}catch(h){return b.onError(h),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.y(g,a.J.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.y(g,a.J.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);
|
|
21
|
+
return g["return"](a.f)})};_.u.start=function(a){var b=this;return _.I(function(c){return b.a&&b.w&&!b.K?b.w.Ib()?_.y(c,NT(b),0):_.y(c,OT(b,a),0):_.y(c,a.play(),0)})};_.u.Vc=function(){};_.u.Sc=function(){return!0};_.u.resume=function(){this.a&&this.a.resume()};_.u.pause=function(){this.a&&this.a.pause()};_.u.skip=function(){this.a&&this.a.skip()};_.u.getVolume=function(){return this.a?this.a.getVolume():1};_.u.setVolume=function(a){this.a&&this.a.setVolume(a)};
|
|
22
|
+
_.u.getPosition=function(){if(!this.a||null===this.o)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.o-a};_.u.sc=function(){this.a&&(this.a.destroy(),this.a=null);JT(this);this.H.release();this.h&&(this.h.stop(),this.h=null);return Promise.resolve()};ET.prototype.getPosition=ET.prototype.getPosition;ET.prototype.setVolume=ET.prototype.setVolume;ET.prototype.getVolume=ET.prototype.getVolume;ET.prototype.skip=ET.prototype.skip;ET.prototype.pause=ET.prototype.pause;ET.prototype.resume=ET.prototype.resume;_.x(PT,_.Gv);_.u=PT.prototype;_.u.onPlayerCreated=function(a){if(QT())return a.onError(new _.O(1,9,1E4));this.f=_.Iq(_.Xd,{"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(_.ta);this.a.getSettings().setPlayerVersion(_.ha);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
23
|
+
_.u.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)};_.u.xl=function(){return this.a};_.u.vl=function(){return this.h};_.u.cd=function(){return this.f};_.u.id=function(){return"ima"};_.J("clpp.ima.ImaPlugin",PT);PT.prototype.getAdContainer=PT.prototype.cd;PT.prototype.getAdDisplayContainer=PT.prototype.vl;PT.prototype.getAdsLoader=PT.prototype.xl;PT.Id="ima";
|
|
24
|
+
PT.isSdkMissing=QT;RT.prototype.create=function(){return new PT};_.gt(new RT);ST.prototype.name=function(){return AT};ST.prototype.a=function(a,b){return a.namespace()===_.zd?!1:QT()?(this.jd.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};ST.prototype.create=function(a){return new ET(a)};_.Cq(new ST);};
|
|
25
25
|
if(typeof(module)!="undefined"&&module.exports){var x=require("./cl.core.js");_ = x._;(f.call(g,this));module.exports=g;}
|
|
26
26
|
else if (typeof(define)!="undefined"&&define.amd) {define(["./cl.core"], function(c){_=c._;(f.call(g,this));return g;});}
|
|
27
27
|
else{_=this.clpp._;(f.call(g,this));}
|