@castlabs/prestoplay 6.2.7 → 6.2.8
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 +31 -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 +101 -101
- package/cjs/cl.conviva.js +31 -31
- package/cjs/cl.core.js +367 -366
- package/cjs/cl.crypto.js +9 -9
- package/cjs/cl.dash.js +68 -67
- package/cjs/cl.externs.js +30 -30
- package/cjs/cl.freewheel.js +23 -23
- package/cjs/cl.hls.js +44 -43
- package/cjs/cl.hlssmpte.js +6 -6
- package/cjs/cl.htmlcue.js +29 -29
- package/cjs/cl.ima.js +21 -21
- package/cjs/cl.mse.js +249 -249
- package/cjs/cl.muxdata.js +11 -11
- package/cjs/cl.onboard.js +3 -3
- package/cjs/cl.persistent.js +13 -13
- package/cjs/cl.playlist.js +5 -5
- package/cjs/cl.smooth.js +68 -68
- package/cjs/cl.thumbnails.js +22 -22
- package/cjs/cl.tizen.js +68 -68
- package/cjs/cl.ttml.js +26 -26
- package/cjs/cl.verimatrix.js +5 -5
- package/cjs/cl.vimond.js +11 -11
- package/cjs/cl.vr.js +18 -18
- package/cjs/cl.vtt.js +14 -14
- package/cjs/cl.youbora.js +15 -15
- package/cl.adobe.js +3 -3
- package/cl.airplay.js +3 -3
- package/cl.broadpeak.js +5 -5
- package/cl.cast.js +81 -81
- package/cl.conviva.js +27 -27
- package/cl.core.js +326 -323
- package/cl.crypto.js +8 -8
- package/cl.dash.js +64 -62
- package/cl.externs.js +30 -30
- package/cl.freewheel.js +17 -17
- package/cl.hls.js +37 -36
- package/cl.hlssmpte.js +5 -5
- package/cl.htmlcue.js +24 -24
- package/cl.ima.js +14 -14
- package/cl.mse.js +218 -218
- package/cl.muxdata.js +9 -9
- package/cl.onboard.js +4 -4
- package/cl.persistent.js +9 -9
- package/cl.playlist.js +4 -4
- package/cl.smooth.js +57 -57
- package/cl.thumbnails.js +17 -17
- package/cl.tizen.js +57 -57
- package/cl.ttml.js +21 -21
- 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/cjs/cl.ima.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
(function(){var g={}; var _ = _ || {}
|
|
2
|
-
var f=function(window){var
|
|
3
|
-
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ii.bind(this));a.on(this.o,b,this.Hi.bind(this));a.one(this.j,_.
|
|
4
|
-
a.oh.bind(a));c.on(b,d.MIDPOINT,a.Ci.bind(a));c.on(b,d.THIRD_QUARTILE,a.th.bind(a));c.on(b,d.PAUSED,a.Ei.bind(a));c.on(b,d.RESUMED,a.Gi.bind(a));c.on(b,d.CLICK,a.nh.bind(a));c.on(b,d.SKIPPED,a.rh.bind(a));c.on(b,d.IMPRESSION,a.ph.bind(a));c.on(b,d.COMPLETE,a.zi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Si.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ki.bind(a))},
|
|
5
|
-
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.
|
|
6
|
-
|
|
7
|
-
c.a)return a.J.initialize(),_.v(c,b.play(),2)
|
|
8
|
-
_.h.getCreativeId=function(){return this.a.getCreativeId()};_.h.getApiFramework=function(){return this.a.getApiFramework()};_.h.getAdSystem=function(){return this.a.getAdSystem()};_.h.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.h.getTitle=function(){return this.a.getTitle()};_.h.getDuration=function(){return this.a.getDuration()};_.h.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.h.
|
|
9
|
-
_.h.Hb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ad&&typeof b[d].clickThroughUrl===_.
|
|
2
|
+
var f=function(window){var dH="clpp.ima.AdsManagerFactory",X=function(a,b,c){this.a=a;this.f=a.getAdPodInfo();this.h=b;this.g=c},eH=function(){},fH=function(a){this.a=a},gH=function(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.K=_.H.ya(a.ima||{});this.m=this.l.Yb("ima").Ac();this.J=this.l.Yb("ima").g;this.o=this.l.Yb("ima").a;this.G=new _.oo;this.O=new _.D("clpp.ima");this.h=this.a=null;this.f=new _.Qh;this.D=!1;this.w=new _.Yf;this.T=new eH;this.A=null;this.I=this.C=this.M=this.B=!1;this.g=
|
|
3
|
+
null;a=this.w;var b=google.ima.AdErrorEvent.Type.AD_ERROR;a.one(this.o,google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.Ii.bind(this));a.on(this.o,b,this.Hi.bind(this));a.one(this.j,_.Wc,this.Qi.bind(this))},hH=function(a){var b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.qh.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.Ri.bind(a));c.on(b,d.STARTED,a.sh.bind(a));c.on(b,d.LOG,a.Bi.bind(a));c.on(b,d.AD_PROGRESS,a.Fi.bind(a));c.on(b,d.AD_BUFFERING,a.yi.bind(a));c.on(b,d.FIRST_QUARTILE,
|
|
4
|
+
a.oh.bind(a));c.on(b,d.MIDPOINT,a.Ci.bind(a));c.on(b,d.THIRD_QUARTILE,a.th.bind(a));c.on(b,d.PAUSED,a.Ei.bind(a));c.on(b,d.RESUMED,a.Gi.bind(a));c.on(b,d.CLICK,a.nh.bind(a));c.on(b,d.SKIPPED,a.rh.bind(a));c.on(b,d.IMPRESSION,a.ph.bind(a));c.on(b,d.COMPLETE,a.zi.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.Si.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ki.bind(a))},iH=function(a){a=a.K;var b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.zd&&(b.bitrate=
|
|
5
|
+
a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.ic?a.enablePreloading:!0;typeof a.loadVideoTimeout===_.zd&&(b.loadVideoTimeout=a.loadVideoTimeout);Array.isArray(a.mimeTypes)&&(b.mimeTypes=a.mimeTypes);typeof a.playAdsAfterTime===_.zd&&(b.playAdsAfterTime=a.playAdsAfterTime);typeof a.useStyledLinearAds===_.ic&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},kH=function(a){a.A=null;jH(a,_.Jb);a.m&&a.l.getSurface().hide(a.m)},
|
|
6
|
+
lH=function(a){_.wm(a.j,{visibility:"visible"})},jH=function(a,b,c){c=c&&c.getAd();var d=null;c&&(d={ad:new X(c,a.B,a.M)});a.l.trigger(new _.E(b,d))},mH=function(a,b){var c=b?a.T.create(b.getErrorCode()):null;a.l.onError(new _.J(1,9,10003,{errorType:c},b))},oH=function(a){var b,c;return _.z(function(d){if(1==d.a)return a.J.initialize(),b=!!a.l.getConfiguration().muted,_.v(d,a.G.canPlay(b),2);c=d.f;if(!c)return jH(a,_.fc),a.O.warn(_.ja),d["return"]();nH(a);_.w(d)})},pH=function(a,b){return _.z(function(c){if(1==
|
|
7
|
+
c.a)return a.J.initialize(),_.v(c,b.play(),2);nH(a);_.w(c)})},nH=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.D=!0},qH=function(){this.a=this.g=this.f=null},rH=function(){return!window.google||!google.ima||!google.ima.AdsLoader},sH=function(){},tH=function(){this.a=new _.D(dH)};_.h=X.prototype;_.h.mb=function(){return"Google IMA SDK"};_.h.nb=function(){return google.ima.VERSION};_.h.sb=function(){return 0};_.h.ba=function(){return this.a.getAdId()};
|
|
8
|
+
_.h.getCreativeId=function(){return this.a.getCreativeId()};_.h.getApiFramework=function(){return this.a.getApiFramework()};_.h.getAdSystem=function(){return this.a.getAdSystem()};_.h.getAdvertiserName=function(){return this.a.getAdvertiserName()};_.h.getTitle=function(){return this.a.getTitle()};_.h.getDuration=function(){return this.a.getDuration()};_.h.getSkipTimeOffset=function(){return this.a.getSkipTimeOffset()};_.h.bc=function(){return this.f?this.f.getIsBumper():!1};
|
|
9
|
+
_.h.Hb=function(){var a=null,b=this.a,c=Object.keys(b).find(function(d){return typeof b[d]===_.Ad&&typeof b[d].clickThroughUrl===_.me});c&&(a=b[c].clickThroughUrl);return a};_.h.getMediaUrl=function(){return this.a.getMediaUrl()};_.h.pb=function(){return this.a.getVastMediaWidth()};_.h.ob=function(){return this.a.getVastMediaHeight()};_.h.ab=function(){return this.a.getVastMediaBitrate()};_.h.Qa=function(){return this.g?2:this.h?1:0};_.h.getPodIndex=function(){return this.f?this.f.getPodIndex():0};
|
|
10
10
|
_.h.Ib=function(){return this.f?this.f.getTimeOffset():0};_.h.Jb=function(){return this.f?this.f.getAdPosition():1};_.h.rb=function(){return this.f?this.f.getTotalAds():1};_.h.getWrapperAdIds=function(){return this.a.getWrapperAdIds()};_.h.getWrapperAdSystems=function(){return this.a.getWrapperAdSystems()};_.h.getWrapperCreativeIds=function(){return this.a.getWrapperCreativeIds()};X.prototype.getWrapperCreativeIds=X.prototype.getWrapperCreativeIds;X.prototype.getWrapperAdSystems=X.prototype.getWrapperAdSystems;
|
|
11
|
-
X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.rb;X.prototype.getPositionInSequence=X.prototype.Jb;X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Qa;X.prototype.getMediaBitrate=X.prototype
|
|
12
|
-
X.prototype.isBumper=X.prototype.
|
|
13
|
-
X.prototype.getAdManagerVersion=X.prototype.nb;X.prototype.getAdManagerName=X.prototype.mb;
|
|
14
|
-
_.h.Ii=function(a){var b=this;this.a=a.getAdsManager(this.j,
|
|
15
|
-
_.h.Hi=function(a){
|
|
16
|
-
_.h.Fi=function(a){
|
|
17
|
-
_.h.Si=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();
|
|
18
|
-
_.h.load=function(){var a=this,b,c,d,e,f;return _.z(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.
|
|
19
|
-
_.h.start=function(a){var b=this;return _.z(function(c){return b.a&&b.g&&!b.D?b.g.Kb()?_.v(c,
|
|
11
|
+
X.prototype.getWrapperAdIds=X.prototype.getWrapperAdIds;X.prototype.getSequenceLength=X.prototype.rb;X.prototype.getPositionInSequence=X.prototype.Jb;X.prototype.getPodTimeOffset=X.prototype.Ib;X.prototype.getPodIndex=X.prototype.getPodIndex;X.prototype.getPodType=X.prototype.Qa;X.prototype.getMediaBitrate=X.prototype.ab;X.prototype.getMediaHeight=X.prototype.ob;X.prototype.getMediaWidth=X.prototype.pb;X.prototype.getMediaUrl=X.prototype.getMediaUrl;X.prototype.getClickThroughUrl=X.prototype.Hb;
|
|
12
|
+
X.prototype.isBumper=X.prototype.bc;X.prototype.getSkipTimeOffset=X.prototype.getSkipTimeOffset;X.prototype.getDuration=X.prototype.getDuration;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.ba;X.prototype.getTechnology=X.prototype.sb;
|
|
13
|
+
X.prototype.getAdManagerVersion=X.prototype.nb;X.prototype.getAdManagerName=X.prototype.mb;eH.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}};fH.prototype.getCuePoints=function(){return this.a};fH.prototype.Kb=function(){return 0<=this.a.indexOf(0)||0===this.a.length};fH.prototype.bb=function(){return 0<=this.a.indexOf(-1)};fH.prototype.hasPostroll=fH.prototype.bb;fH.prototype.hasPreroll=fH.prototype.Kb;fH.prototype.getCuePoints=fH.prototype.getCuePoints;_.h=gH.prototype;
|
|
14
|
+
_.h.Ii=function(a){var b=this;this.a=a.getAdsManager(this.j,iH(this));this.a.isCustomPlaybackUsed()?(this.O.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.J(1,9,10002)),this.dispose()):(this.h=new _.mo(this.l.getSurface(),function(c,d,e){b.a.resize(c,d,e?google.ima.ViewMode.FULLSCREEN:google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.g=new fH(a),this.l.trigger(new _.E(_.Mb,{adsTimeline:this.g})),hH(this));this.f.resolve()};
|
|
15
|
+
_.h.Hi=function(a){mH(this,a.getError());this.f.resolve()};_.h.Ri=function(a){var b=this;return _.z(function(c){if(1==c.a)return b.C=!0,_.v(c,b.l.pause(),2);_.wm(b.j,{visibility:_.ad});jH(b,_.vb,a);b.h.start();_.w(c)})};_.h.qh=function(a){a.getAd().isLinear()?jH(this,_.Cb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))};_.h.sh=function(a){this.A=a.getAd().getDuration();jH(this,_.Ib,a);this.l.getSurface().show(this.m)};_.h.Bi=function(a){a=a.getAdData();mH(this,a?a.adError:null);kH(this)};
|
|
16
|
+
_.h.Fi=function(a){jH(this,_.Fb,a)};_.h.yi=function(a){jH(this,_.xb,a)};_.h.oh=function(a){jH(this,_.Ab,a)};_.h.Ci=function(a){jH(this,_.Db,a)};_.h.th=function(a){jH(this,_.Kb,a)};_.h.Ei=function(a){jH(this,_.Eb,a)};_.h.Gi=function(a){jH(this,_.Gb,a)};_.h.nh=function(a){this.pause();jH(this,_.yb,a)};_.h.rh=function(a){jH(this,_.Hb,a);kH(this)};_.h.ph=function(a){jH(this,_.Bb,a)};_.h.zi=function(a){jH(this,_.zb,a);kH(this)};
|
|
17
|
+
_.h.Si=function(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();jH(this,_.wb);lH(this)};_.h.Ki=function(){this.I=!0};_.h.Qi=function(){this.M=!0;this.o.contentComplete()};
|
|
18
|
+
_.h.load=function(){var a=this,b,c,d,e,f;return _.z(function(g){if(1==g.a){b=a.l;c=a.K;try{if(typeof c.adTagUrl!==_.me)throw new _.J(1,9,10001,{missingKeys:"adTagUrl"});}catch(k){return b.onError(k),a.f.resolve(),g["return"](a.f)}return c.adTagUrl?_.v(g,a.G.canPlay(!1),2):(a.f.resolve(),g["return"](a.f))}if(3!=g.a)return d=g.f,_.v(g,a.G.canPlay(!0),3);e=g.f;f=new google.ima.AdsRequest;f.adTagUrl=c.adTagUrl;f.setAdWillAutoPlay(d);f.setAdWillPlayMuted(e);a.o.requestAds(f);return g["return"](a.f)})};
|
|
19
|
+
_.h.start=function(a){var b=this;return _.z(function(c){return b.a&&b.g&&!b.D?b.g.Kb()?_.v(c,oH(b),0):_.v(c,pH(b,a),0):_.v(c,a.play(),0)})};_.h.resume=function(){this.a&&this.a.resume()};_.h.pause=function(){this.a&&this.a.pause()};_.h.skip=function(){this.a&&this.a.skip()};_.h.getVolume=function(){return this.a?this.a.getVolume():1};_.h.setVolume=function(a){this.a&&this.a.setVolume(a)};
|
|
20
20
|
_.h.getPosition=function(){if(!this.a||null===this.A)return-1;var a=this.a.getRemainingTime();return 0>a?0:this.A-a};
|
|
21
|
-
_.h.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.
|
|
22
|
-
|
|
23
|
-
_.h.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.h.fi=function(){return this.a};_.h.di=function(){return this.g};_.h.
|
|
24
|
-
|
|
21
|
+
_.h.dispose=function(){var a=this;return(new Promise(function(b){a.D&&a.g&&a.g.bb()&&!a.I?(a.w.one(a.a,google.ima.AdEvent.Type.ALL_ADS_COMPLETED,function(){b();a.m&&a.l.getSurface().hide(a.m)}),_.Zf(a.w,a.a,[google.ima.AdEvent.Type.LOADED,google.ima.AdEvent.Type.STARTED],function(){a.a&&a.a.discardAdBreak()})):b();a.a.discardAdBreak();a.o.contentComplete()})).then(function(){lH(a);a.w.release();a.h&&(a.h.stop(),a.h=null);a.a&&(a.a.destroy(),a.a=null)})};gH.prototype.getPosition=gH.prototype.getPosition;
|
|
22
|
+
gH.prototype.setVolume=gH.prototype.setVolume;gH.prototype.getVolume=gH.prototype.getVolume;gH.prototype.skip=gH.prototype.skip;gH.prototype.pause=gH.prototype.pause;gH.prototype.resume=gH.prototype.resume;_.u(qH,_.ap);_.h=qH.prototype;_.h.onPlayerCreated=function(a){if(rH())return a.onError(new _.J(1,9,1E4));this.f=_.um(_.Mc,{"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(_.na);this.a.getSettings().setPlayerVersion(_.ea);this.a.getSettings().setAutoPlayAdBreaks(!0)};
|
|
23
|
+
_.h.onPlayerWillDestroy=function(a){this.a&&(this.a.destroy(),this.a=null);this.g&&(this.g.destroy(),this.g=null);this.f&&(a.getSurface().removeElementFromContainer(this.f),this.f=null)};_.h.fi=function(){return this.a};_.h.di=function(){return this.g};_.h.Ac=function(){return this.f};_.h.id=function(){return"ima"};_.A("clpp.ima.ImaPlugin",qH);qH.prototype.getAdContainer=qH.prototype.Ac;qH.prototype.getAdDisplayContainer=qH.prototype.di;qH.prototype.getAdsLoader=qH.prototype.fi;qH.Id="ima";
|
|
24
|
+
qH.isSdkMissing=rH;sH.prototype.create=function(){return new qH};_.pn(new sH);tH.prototype.name=function(){return dH};tH.prototype.W=function(a,b){return a.namespace()===_.xc?!1:rH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)};tH.prototype.create=function(a){return new gH(a)};tH.prototype.create=tH.prototype.create;tH.prototype.isSupported=tH.prototype.W;tH.prototype.name=tH.prototype.name;_.rm(new tH);};
|
|
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));}
|