@castlabs/prestoplay 6.7.0 → 6.8.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 +23 -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 +110 -110
- package/cjs/cl.conviva.js +33 -33
- package/cjs/cl.core.js +416 -417
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +26 -26
- package/cjs/cl.freewheel.js +23 -23
- package/cjs/cl.hls.js +67 -67
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -31
- package/cjs/cl.ima.js +23 -23
- package/cjs/cl.mse.js +270 -259
- package/cjs/cl.muxdata.js +15 -11
- 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 +70 -70
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +69 -69
- 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 +18 -18
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +86 -86
- package/cl.conviva.js +27 -27
- package/cl.core.js +355 -360
- package/cl.crypto.js +8 -8
- package/cl.dash.js +66 -66
- package/cl.externs.js +26 -26
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +58 -57
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +17 -17
- package/cl.mse.js +237 -227
- package/cl.muxdata.js +12 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +5 -5
- package/cl.smooth.js +58 -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 +15 -15
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +14 -14
- package/package.json +1 -1
- package/typings.d.ts +47 -20
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
|
-
|
|
4
|
-
b
|
|
5
|
-
|
|
6
|
-
this.f.getIsBumper():!1}
|
|
7
|
-
1}sb(){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.
|
|
11
|
-
|
|
12
|
-
(this
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 xI="clpp.ima.AdsManagerFactory",yI=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===_.hc?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
|
+
_.hc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},zI=function(a){return!1===a.H.disableCustomPlayback&&a.a.isCustomPlaybackUsed()&&_.bi()},AI=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.oc.bind(a));c.on(b,d.STARTED,a.aa.bind(a));c.on(b,d.LOG,a.Xa.bind(a));c.on(b,d.AD_PROGRESS,a.Bb.bind(a));c.on(b,d.AD_BUFFERING,a.Ka.bind(a));
|
|
3
|
+
c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Ya.bind(a));c.on(b,d.THIRD_QUARTILE,a.ba.bind(a));c.on(b,d.PAUSED,a.Za.bind(a));c.on(b,d.RESUMED,a.Ob.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.U.bind(a));c.on(b,d.COMPLETE,a.Wa.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.pc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.jc.bind(a))},BI=function(a,b){const c=b?a.ga.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},CI=function(a,
|
|
4
|
+
b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new W(c,a.C,a.B)});a.l.trigger(new _.F(b,d))},DI=function(a){a.A=null;CI(a,_.Kb);a.m&&a.l.getSurface().hide(a.m)},EI=function(a){_.cm(a.w,{visibility:"visible"})},GI=function(a){return _.y(function*(){a.L.initialize();const b=!!a.l.getConfiguration().muted;(yield a.J.canPlay(b))||zI(a)?FI(a):(CI(a,_.fc),a.N.warn(_.ia))})},HI=function(a,b){return _.y(function*(){a.L.initialize();yield b.play();FI(a)})},FI=function(a){a.a.init(a.w.offsetWidth,a.w.offsetHeight,
|
|
5
|
+
google.ima.ViewMode.NORMAL);a.G=!0},II=function(){return!window.google||!google.ima||!google.ima.AdsLoader},W=class{constructor(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}nb(){return"Google IMA SDK"}ob(){return google.ima.VERSION}tb(){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()}Yb(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Fb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.me);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}qb(){return this.a.getVastMediaWidth()}pb(){return this.a.getVastMediaHeight()}eb(){return this.a.getVastMediaBitrate()}Qa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Gb(){return this.f?this.f.getTimeOffset():0}Hb(){return this.f?this.f.getAdPosition():
|
|
7
|
+
1}sb(){return this.f?this.f.getTotalAds():1}getWrapperAdIds(){return this.a.getWrapperAdIds()}getWrapperAdSystems(){return this.a.getWrapperAdSystems()}getWrapperCreativeIds(){return this.a.getWrapperCreativeIds()}};W.prototype.getWrapperCreativeIds=W.prototype.getWrapperCreativeIds;W.prototype.getWrapperAdSystems=W.prototype.getWrapperAdSystems;W.prototype.getWrapperAdIds=W.prototype.getWrapperAdIds;W.prototype.getSequenceLength=W.prototype.sb;W.prototype.getPositionInSequence=W.prototype.Hb;
|
|
8
|
+
W.prototype.getPodTimeOffset=W.prototype.Gb;W.prototype.getPodIndex=W.prototype.getPodIndex;W.prototype.getPodType=W.prototype.Qa;W.prototype.getMediaBitrate=W.prototype.eb;W.prototype.getMediaHeight=W.prototype.pb;W.prototype.getMediaWidth=W.prototype.qb;W.prototype.getMediaUrl=W.prototype.getMediaUrl;W.prototype.getClickThroughUrl=W.prototype.Fb;W.prototype.isBumper=W.prototype.Yb;W.prototype.getSkipTimeOffset=W.prototype.getSkipTimeOffset;W.prototype.getDuration=W.prototype.getDuration;
|
|
9
|
+
W.prototype.getTitle=W.prototype.getTitle;W.prototype.getAdvertiserName=W.prototype.getAdvertiserName;W.prototype.getAdSystem=W.prototype.getAdSystem;W.prototype.getApiFramework=W.prototype.getApiFramework;W.prototype.getCreativeId=W.prototype.getCreativeId;W.prototype.getId=W.prototype.getId;W.prototype.getTechnology=W.prototype.tb;W.prototype.getAdManagerVersion=W.prototype.ob;W.prototype.getAdManagerName=W.prototype.nb;var JI=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 KI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Ib(){return 0<=this.a.indexOf(0)||0===this.a.length}fb(){return 0<=this.a.indexOf(-1)}};KI.prototype.hasPostroll=KI.prototype.fb;KI.prototype.hasPreroll=KI.prototype.Ib;KI.prototype.getCuePoints=KI.prototype.getCuePoints;var LI=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();a=_.kf(a.ima||{});this.H=a=_.jf({disableCustomPlayback:!1},a);this.m=this.l.Ub("ima").qc();this.L=this.l.Ub("ima").g;this.j=this.l.Ub("ima").a;this.J=new _.Vp;this.N=new _.P("clpp.ima");this.g=this.a=null;this.f=new _.Mk;this.G=!1;this.o=new _.jo;this.ga=new JI;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.Qb.bind(this));a.on(this.j,b,this.Pb.bind(this));a.on(this.l,_.Zc,this.nc.bind(this))}}Qb(a){this.a=a.getAdsManager(this.w,yI(this));this.a.isCustomPlaybackUsed()&&!zI(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 _.Tp(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 KI(a),this.l.trigger(new _.F(_.Nb,
|
|
11
|
+
{adsTimeline:this.h})),AI(this));this.f.resolve()}Pb(a){BI(this,a.getError());this.f.resolve()}oc(a){const b=this;return _.y(function*(){b.F=!0;zI(b)||(yield b.l.pause(),_.cm(b.w,{visibility:_.dd}));CI(b,_.wb,a);b.g.start()})}ma(){const a=this;return _.y(function*(){if(zI(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()?CI(this,_.Db,a):(this.a.discardAdBreak(),this.C||(this.C=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();
|
|
12
|
+
CI(this,_.Jb,a);this.l.getSurface().show(this.m)}Xa(a){a=a.getAdData();BI(this,a?a.adError:null);DI(this)}Bb(a){CI(this,_.Gb,a)}Ka(a){CI(this,_.yb,a)}S(a){CI(this,_.Bb,a)}Ya(a){CI(this,_.Eb,a)}ba(a){CI(this,_.Lb,a)}Za(a){CI(this,_.Fb,a)}Ob(a){CI(this,_.Hb,a)}R(a){this.pause();CI(this,_.zb,a)}Y(a){CI(this,_.Ib,a);DI(this)}U(a){CI(this,_.Cb,a)}Wa(a){CI(this,_.Ab,a);DI(this)}pc(){const a=this;return _.y(function*(){a.C=!0;if(zI(a)&&null!==a.I){var b=a.l;b.a&&b.a.addDelegate(b);yield _.Vm(a.l);a.B||(yield a.l.seek(a.I))}else{if(!a.F)return a.l.play();
|
|
13
|
+
EI(a)}a.F=!1;a.g&&a.g.stop();a.B||(yield a.l.play());CI(a,_.xb)})}jc(){this.K=!0}nc(){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!==_.me)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.Ib()?yield GI(b):yield HI(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.fb()&&!this.K?(this.o.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Nf(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(()=>{EI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};LI.prototype.getPosition=LI.prototype.getPosition;
|
|
16
|
+
LI.prototype.setVolume=LI.prototype.setVolume;LI.prototype.getVolume=LI.prototype.getVolume;LI.prototype.skip=LI.prototype.skip;LI.prototype.pause=LI.prototype.pause;LI.prototype.resume=LI.prototype.resume;var MI=class extends _.aq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(II())return a.onError(new _.H(1,9,1E4));this.f=_.am(_.Qc,{"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)}Cf(){return this.a}Af(){return this.g}qc(){return this.f}id(){return"ima"}};_.A("clpp.ima.ImaPlugin",MI);MI.prototype.getAdContainer=MI.prototype.qc;MI.prototype.getAdDisplayContainer=MI.prototype.Af;MI.prototype.getAdsLoader=MI.prototype.Cf;MI.Id="ima";MI.isSdkMissing=II;_.Hm(new class{create(){return new MI}});var NI=class{constructor(){this.a=new _.P(xI)}name(){return xI}da(a,b){return a.namespace()===_.zc?!1:II()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new LI(a)}};NI.prototype.create=NI.prototype.create;NI.prototype.isSupported=NI.prototype.da;NI.prototype.name=NI.prototype.name;_.Yl(new NI);};f.call(g, window);
|