@castlabs/prestoplay 6.9.0 → 6.10.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 +39 -0
- package/cjs/cl.adobe.js +3 -3
- package/cjs/cl.airplay.js +3 -3
- package/cjs/cl.broadpeak.js +6 -6
- package/cjs/cl.cast.js +105 -104
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +420 -417
- package/cjs/cl.crypto.js +10 -9
- package/cjs/cl.dash.js +71 -71
- package/cjs/cl.externs.js +11 -12
- package/cjs/cl.freewheel.js +21 -21
- package/cjs/cl.hls.js +72 -71
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -31
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +273 -272
- package/cjs/cl.muxdata.js +14 -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.smooth.js +71 -71
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +27 -27
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +13 -13
- package/cjs/cl.vr.js +19 -19
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +16 -16
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +87 -87
- package/cl.conviva.js +27 -27
- package/cl.core.js +363 -359
- package/cl.crypto.js +9 -9
- package/cl.dash.js +67 -67
- package/cl.externs.js +11 -12
- package/cl.freewheel.js +17 -17
- package/cl.hls.js +61 -61
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +26 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +235 -236
- package/cl.muxdata.js +12 -12
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +59 -58
- package/cl.thumbnails.js +17 -17
- 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 +14 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +13 -13
- package/package.json +1 -1
- package/typings.d.ts +47 -2
package/cl.ima.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},
|
|
4
|
-
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new
|
|
5
|
-
google.ima.ViewMode.NORMAL);a.G=!0},
|
|
6
|
-
this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.
|
|
7
|
-
1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_
|
|
11
|
-
{adsTimeline:this.h})),
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield
|
|
15
|
-
{this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.
|
|
16
|
-
|
|
17
|
-
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}
|
|
1
|
+
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var SI="clpp.ima.AdsManagerFactory",TI=function(a){a=a.H;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.jc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.r&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.r&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
|
|
2
|
+
_.jc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},UI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.gi()},VI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.ma.bind(a));c.on(b,d.LOADED,a.W.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.pc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Za.bind(a));c.on(b,d.AD_PROGRESS,a.Db.bind(a));c.on(b,d.AD_BUFFERING,a.Na.bind(a));
|
|
3
|
+
c.on(b,d.FIRST_QUARTILE,a.T.bind(a));c.on(b,d.MIDPOINT,a.$a.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.ab.bind(a));c.on(b,d.RESUMED,a.Qb.bind(a));c.on(b,d.CLICK,a.R.bind(a));c.on(b,d.SKIPPED,a.Y.bind(a));c.on(b,d.IMPRESSION,a.V.bind(a));c.on(b,d.COMPLETE,a.Ya.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.qc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.kc.bind(a))},WI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},XI=function(a,
|
|
4
|
+
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new X(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},YI=function(a){a.A=null;XI(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},ZI=function(a){_.im(a.w,{visibility:"visible"})},aJ=function(a){return _.y(function*(){a.M.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||UI(a)?$I(a):(XI(a,_.fc),a.N.warn(_.ia))})},bJ=function(a,b){return _.y(function*(){a.M.initialize();yield b.play();$I(a)})},$I=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
|
|
5
|
+
google.ima.ViewMode.NORMAL);a.G=!0},cJ=function(){return!window.google||!google.ima||!google.ima.AdsLoader},X=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}pb(){return"Google IMA SDK"}qb(){return google.ima.VERSION}vb(){return 0}getId(){return this.a.getAdId()}getCreativeId(){return this.a.getCreativeId()}getApiFramework(){return this.a.getApiFramework()}getAdSystem(){return this.a.getAdSystem()}getAdvertiserName(){return this.a.getAdvertiserName()}getTitle(){return this.a.getTitle()}getDuration(){return this.a.getDuration()}getSkipTimeOffset(){return this.a.getSkipTimeOffset()}$b(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Hb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Dd&&typeof b[d].clickThroughUrl===_.pe);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}sb(){return this.a.getVastMediaWidth()}rb(){return this.a.getVastMediaHeight()}gb(){return this.a.getVastMediaBitrate()}Sa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Ib(){return this.f?this.f.getTimeOffset():0}Jb(){return this.f?this.f.getAdPosition():
|
|
7
|
+
1}ub(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.ub;X.prototype.getPositionInSequence=X.prototype.Jb;
|
|
8
|
+
X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Sa;X.prototype.getMediaBitrate=X.prototype.gb;X.prototype.getMediaHeight=X.prototype.rb;X.prototype.getMediaWidth=X.prototype.sb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Hb;X.prototype.isBumper=X.prototype.$b;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;
|
|
9
|
+
X.prototype.getTitle=X.prototype.getTitle;X.prototype.getAdvertiserName=X.prototype.getAdvertiserName;X.prototype.getAdSystem=X.prototype.getAdSystem;X.prototype.getApiFramework=X.prototype.getApiFramework;X.prototype.getCreativeId=X.prototype.getCreativeId;X.prototype.getId=X.prototype.getId;X.prototype.getTechnology=X.prototype.vb;X.prototype.getAdManagerVersion=X.prototype.qb;X.prototype.getAdManagerName=X.prototype.pb;var dJ=class{create(a){const 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}}};var eJ=class{constructor(a){this.a=a}getCuePoints(){return this.a}Kb(){return 0<=this.a.indexOf(0)||0===this.a.length}hb(){return 0<=this.a.indexOf(-1)}};eJ.prototype.hasPostroll=eJ.prototype.hb;eJ.prototype.hasPreroll=eJ.prototype.Kb;eJ.prototype.getCuePoints=eJ.prototype.getCuePoints;var fJ=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.lf(a.ima||{});this.H=a=_.kf({disableCustomPlayback:!1},a);this.m=this.l.Wb("ima").rc();this.M=this.l.Wb("ima").g;this.j=this.l.Wb("ima").a;this.J=new _.$p;this.N=new _.Q("clpp.ima");this.g=this.a=null;this.f=new _.Sk;this.G=!1;this.o=new _.po;this.ga=new dJ;this.A=null;this.K=this.F=this.B=this.C=!1;this.I=this.h=null;{a=this.o;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.j,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
10
|
+
this.Sb.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.$c,this.oc.bind(this))}}Sb(a){this.a=a.getAdsManager(this.w,TI(this));this.a.isCustomPlaybackUsed()&&!UI(this)?(this.N.warn("IMA plugin is disabled for this platform with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.Yp(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.h=new eJ(a),this.l.trigger(new _.F(_.Nb,
|
|
11
|
+
{adsTimeline:this.h})),VI(this));this.f.resolve()}Rb(a){WI(this,a.getError());this.f.resolve()}pc(a){const b=this;return _.y(function*(){b.F=!0;UI(b)||(yield b.l.pause(),_.im(b.w,{visibility:_.ed}));XI(b,_.wb,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(UI(a)){a.I=a.l.getPosition();yield a.l.detach();var b=a.l;b.a&&b.a.removeDelegate(b)}a.a.start()})}W(a){a.getAd().isLinear()?XI(this,_.Db,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
|
|
12
|
+
XI(this,_.Jb,a);this.l.getSurface().show(this.m)}Za(a){a=a.getAdData();WI(this,a?a.adError:null);YI(this)}Db(a){XI(this,_.Gb,a)}Na(a){XI(this,_.yb,a)}T(a){XI(this,_.Bb,a)}$a(a){XI(this,_.Eb,a)}ba(a){XI(this,_.Lb,a)}ab(a){XI(this,_.Fb,a)}Qb(a){XI(this,_.Hb,a)}R(a){this.pause();XI(this,_.zb,a)}Y(a){XI(this,_.Ib,a);YI(this)}V(a){XI(this,_.Cb,a)}Ya(a){XI(this,_.Ab,a);YI(this)}qc(){const a=this;return _.y(function*(){a.C=!0;if(UI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.an(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
|
|
13
|
+
ZI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());XI(a,_.xb)})}kc(){this.K=!0}oc(){this.B=!0;this.j.contentComplete()}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.H;try{if(typeof c.adTagUrl!==_.pe)throw new _.H(1,9,10001,{missingKeys:"adTagUrl"});}catch(f){return b.onError(f),a.f.resolve(),a.f}if(!c.adTagUrl)return a.f.resolve(),a.f;b=yield a.J.canPlay(!1);const d=yield a.J.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);
|
|
14
|
+
a.j.getSettings().setAutoPlayAdBreaks(!1);a.j.requestAds(e);return a.f})}start(a){const b=this;return _.y(function*(){b.a&&b.h&&!b.G?b.h.Kb()?yield aJ(b):yield bJ(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&this.a.skip()}getVolume(){return this.a?this.a.getVolume():1}setVolume(a){this.a&&this.a.setVolume(a)}getPosition(){if(!this.a||null===this.A)return-1;const a=this.a.getRemainingTime();return 0>a?0:this.A-a}dispose(){return(new Promise(a=>
|
|
15
|
+
{this.G&&this.h&&this.h.hb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Of(this.o,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):a();this.a.discardAdBreak();this.j.contentComplete()})).then(()=>{ZI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};fJ.prototype.getPosition=fJ.prototype.getPosition;
|
|
16
|
+
fJ.prototype.setVolume=fJ.prototype.setVolume;fJ.prototype.getVolume=fJ.prototype.getVolume;fJ.prototype.skip=fJ.prototype.skip;fJ.prototype.pause=fJ.prototype.pause;fJ.prototype.resume=fJ.prototype.resume;var gJ=class extends _.fq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(cJ())return a.onError(new _.H(1,9,1E4));this.f=_.gm(_.Rc,{"class":"clpp-ima clpp-hidden"});a.getSurface().addElementToContainer(this.f);this.g=new google.ima.AdDisplayContainer(this.f,a.getSurface().getMedia());this.a=new google.ima.AdsLoader(this.g);this.a.getSettings().setPlayerType(_.ma);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
|
|
17
|
+
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}Lf(){return this.a}Jf(){return this.g}rc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",gJ);gJ.prototype.getAdContainer=gJ.prototype.rc;gJ.prototype.getAdDisplayContainer=gJ.prototype.Jf;gJ.prototype.getAdsLoader=gJ.prototype.Lf;gJ.Id="ima";gJ.isSdkMissing=cJ;_.Nm(new class{create(){return new gJ}});var hJ=class{constructor(){this.a=new _.Q(SI)}name(){return SI}ea(a,b){return a.namespace()===_.Bc?!1:cJ()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new fJ(a)}};hJ.prototype.create=hJ.prototype.create;hJ.prototype.isSupported=hJ.prototype.ea;hJ.prototype.name=hJ.prototype.name;_.dm(new hJ);};f.call(g, window);
|