@castlabs/prestoplay 6.4.0 → 6.5.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 +57 -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 +421 -402
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +72 -72
- package/cjs/cl.externs.js +54 -133
- package/cjs/cl.freewheel.js +24 -24
- package/cjs/cl.hls.js +47 -49
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +31 -32
- package/cjs/cl.ima.js +22 -22
- package/cjs/cl.mse.js +258 -255
- package/cjs/cl.muxdata.js +12 -12
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +14 -14
- package/cjs/cl.playlist.js +6 -6
- package/cjs/cl.smooth.js +69 -69
- package/cjs/cl.thumbnails.js +24 -24
- package/cjs/cl.tizen.js +71 -71
- 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 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +20 -20
- 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 +363 -351
- package/cl.crypto.js +8 -8
- package/cl.dash.js +67 -67
- package/cl.externs.js +49 -132
- package/cl.freewheel.js +19 -19
- package/cl.hls.js +40 -40
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +25 -25
- package/cl.ima.js +16 -16
- package/cl.mse.js +230 -231
- package/cl.muxdata.js +8 -8
- 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 -14
- package/cl.vtt.js +12 -12
- package/cl.youbora.js +15 -16
- package/package.json +8 -2
package/cl.ima.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var
|
|
2
|
-
_.
|
|
3
|
-
a.
|
|
4
|
-
a.m&&a.l.getSurface().hide(a.m)},
|
|
5
|
-
b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c}
|
|
6
|
-
this.f.getIsBumper():!1}
|
|
7
|
-
1}
|
|
8
|
-
V.prototype.getPodTimeOffset=V.prototype.
|
|
9
|
-
V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.
|
|
10
|
-
this.
|
|
11
|
-
this.l.trigger(new _.C(_.
|
|
12
|
-
_.
|
|
13
|
-
_.
|
|
14
|
-
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=>{this.
|
|
15
|
-
a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{
|
|
16
|
-
(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 RG="clpp.ima.AdsManagerFactory",SG=function(a){a=a.K;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.p&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.fc?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.p&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.p&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===
|
|
2
|
+
_.fc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},TG=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.V.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.jc.bind(a));c.on(b,d.STARTED,a.X.bind(a));c.on(b,d.LOG,a.Ia.bind(a));c.on(b,d.AD_PROGRESS,a.Ya.bind(a));c.on(b,d.AD_BUFFERING,a.ea.bind(a));c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Wa.bind(a));c.on(b,d.THIRD_QUARTILE,a.$.bind(a));c.on(b,d.PAUSED,
|
|
3
|
+
a.Xa.bind(a));c.on(b,d.RESUMED,a.Za.bind(a));c.on(b,d.CLICK,a.O.bind(a));c.on(b,d.SKIPPED,a.W.bind(a));c.on(b,d.IMPRESSION,a.T.bind(a));c.on(b,d.COMPLETE,a.ja.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.mc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Pb.bind(a))},UG=function(a,b){const c=b?a.ca.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},b))},VG=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.L)});a.l.trigger(new _.C(b,d))},WG=function(a){a.A=null;VG(a,_.Ib);
|
|
4
|
+
a.m&&a.l.getSurface().hide(a.m)},XG=function(a){_.im(a.j,{visibility:"visible"})},ZG=function(a){return _.w(function*(){a.J.initialize();const b=!!a.l.getConfiguration().muted;(yield a.G.canPlay(b))?YG(a):(VG(a,_.dc),a.M.warn(_.ia))})},$G=function(a,b){return _.w(function*(){a.J.initialize();yield b.play();YG(a)})},YG=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},aH=function(){return!window.google||!google.ima||!google.ima.AdsLoader},V=class{constructor(a,
|
|
5
|
+
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()}Zb(){return this.f?
|
|
6
|
+
this.f.getIsBumper():!1}Eb(){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()}Pa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Fb(){return this.f?this.f.getTimeOffset():0}Gb(){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()}};V.prototype.getWrapperCreativeIds=V.prototype.getWrapperCreativeIds;V.prototype.getWrapperAdSystems=V.prototype.getWrapperAdSystems;V.prototype.getWrapperAdIds=V.prototype.getWrapperAdIds;V.prototype.getSequenceLength=V.prototype.sb;V.prototype.getPositionInSequence=V.prototype.Gb;
|
|
8
|
+
V.prototype.getPodTimeOffset=V.prototype.Fb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Pa;V.prototype.getMediaBitrate=V.prototype.eb;V.prototype.getMediaHeight=V.prototype.pb;V.prototype.getMediaWidth=V.prototype.qb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.Eb;V.prototype.isBumper=V.prototype.Zb;V.prototype.getSkipTimeOffset=V.prototype.getSkipTimeOffset;V.prototype.getDuration=V.prototype.getDuration;
|
|
9
|
+
V.prototype.getTitle=V.prototype.getTitle;V.prototype.getAdvertiserName=V.prototype.getAdvertiserName;V.prototype.getAdSystem=V.prototype.getAdSystem;V.prototype.getApiFramework=V.prototype.getApiFramework;V.prototype.getCreativeId=V.prototype.getCreativeId;V.prototype.getId=V.prototype.getId;V.prototype.getTechnology=V.prototype.tb;V.prototype.getAdManagerVersion=V.prototype.ob;V.prototype.getAdManagerName=V.prototype.nb;var bH=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 cH=class{constructor(a){this.a=a}getCuePoints(){return this.a}Hb(){return 0<=this.a.indexOf(0)||0===this.a.length}fb(){return 0<=this.a.indexOf(-1)}};cH.prototype.hasPostroll=cH.prototype.fb;cH.prototype.hasPreroll=cH.prototype.Hb;cH.prototype.getCuePoints=cH.prototype.getCuePoints;var dH=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=a=_.jf(a.ima||{});this.m=this.l.Vb("ima").nc();this.J=this.l.Vb("ima").g;this.o=this.l.Vb("ima").a;this.G=new _.Xp;this.M=new _.O("clpp.ima");this.h=this.a=null;this.f=new _.Sk;this.F=!1;this.w=new _.po;this.ca=new bH;this.A=null;this.I=this.C=this.L=this.B=!1;this.g=null;{a=this.w;const b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
10
|
+
this.Ob.bind(this));a.on(this.o,b,this.Bb.bind(this));a.one(this.j,_.Wc,this.Qb.bind(this))}}Ob(a){this.a=a.getAdsManager(this.j,SG(this));this.a.isCustomPlaybackUsed()?(this.M.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.h=new _.Vp(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.g=new cH(a),
|
|
11
|
+
this.l.trigger(new _.C(_.Lb,{adsTimeline:this.g})),TG(this));this.f.resolve()}Bb(a){UG(this,a.getError());this.f.resolve()}jc(a){const b=this;return _.w(function*(){b.C=!0;yield b.l.pause();_.im(b.j,{visibility:_.ad});VG(b,_.ub,a);b.h.start()})}V(a){a.getAd().isLinear()?VG(this,_.Bb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}X(a){this.A=a.getAd().getDuration();VG(this,_.Hb,a);this.l.getSurface().show(this.m)}Ia(a){a=a.getAdData();UG(this,a?a.adError:null);WG(this)}Ya(a){VG(this,
|
|
12
|
+
_.Eb,a)}ea(a){VG(this,_.wb,a)}S(a){VG(this,_.zb,a)}Wa(a){VG(this,_.Cb,a)}$(a){VG(this,_.Jb,a)}Xa(a){VG(this,_.Db,a)}Za(a){VG(this,_.Fb,a)}O(a){this.pause();VG(this,_.xb,a)}W(a){VG(this,_.Gb,a);WG(this)}T(a){VG(this,_.Ab,a)}ja(a){VG(this,_.yb,a);WG(this)}mc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();VG(this,_.vb);XG(this)}Pb(){this.I=!0}Qb(){this.L=!0;this.o.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.l;const c=a.K;try{if(typeof c.adTagUrl!==
|
|
13
|
+
_.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.G.canPlay(!1);const d=yield a.G.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);a.o.requestAds(e);return a.f})}start(a){const b=this;return _.w(function*(){b.a&&b.g&&!b.F?b.g.Hb()?yield ZG(b):yield $G(b,a):yield a.play()})}resume(){this.a&&this.a.resume()}pause(){this.a&&this.a.pause()}skip(){this.a&&
|
|
14
|
+
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=>{this.F&&this.g&&this.g.fb()&&!this.I?(this.w.one(this.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,()=>{a();this.m&&this.l.getSurface().hide(this.m)}),_.Pf(this.w,this.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],()=>{this.a&&this.a.discardAdBreak()})):
|
|
15
|
+
a();this.a.discardAdBreak();this.o.contentComplete()})).then(()=>{XG(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};dH.prototype.getPosition=dH.prototype.getPosition;dH.prototype.setVolume=dH.prototype.setVolume;dH.prototype.getVolume=dH.prototype.getVolume;dH.prototype.skip=dH.prototype.skip;dH.prototype.pause=dH.prototype.pause;dH.prototype.resume=dH.prototype.resume;var eH=class extends _.bq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(aH())return a.onError(new _.H(1,9,1E4));this.f=_.gm(_.Nc,{"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(_.pa);this.a.getSettings().setPlayerVersion(_.da);this.a.getSettings().setAutoPlayAdBreaks(!0)}onPlayerWillDestroy(a){this.a&&
|
|
16
|
+
(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)}rf(){return this.a}pf(){return this.g}nc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",eH);eH.prototype.getAdContainer=eH.prototype.nc;eH.prototype.getAdDisplayContainer=eH.prototype.pf;eH.prototype.getAdsLoader=eH.prototype.rf;eH.Id="ima";eH.isSdkMissing=aH;_.Nm(new class{create(){return new eH}});var fH=class{constructor(){this.a=new _.O(RG)}name(){return RG}ba(a,b){return a.namespace()===_.xc?!1:aH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new dH(a)}};fH.prototype.create=fH.prototype.create;fH.prototype.isSupported=fH.prototype.ba;fH.prototype.name=fH.prototype.name;_.dm(new fH);};f.call(g, window);
|