@castlabs/prestoplay 6.6.1 → 6.7.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +6 -6
  5. package/cjs/cl.cast.js +110 -110
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +423 -423
  8. package/cjs/cl.crypto.js +10 -10
  9. package/cjs/cl.dash.js +71 -71
  10. package/cjs/cl.externs.js +47 -41
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +68 -49
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +31 -31
  15. package/cjs/cl.ima.js +24 -23
  16. package/cjs/cl.mse.js +263 -260
  17. package/cjs/cl.muxdata.js +11 -12
  18. package/cjs/cl.onboard.js +3 -3
  19. package/cjs/cl.persistent.js +14 -14
  20. package/cjs/cl.playlist.js +6 -6
  21. package/cjs/cl.smooth.js +71 -71
  22. package/cjs/cl.thumbnails.js +23 -23
  23. package/cjs/cl.tizen.js +71 -71
  24. package/cjs/cl.ttml.js +27 -27
  25. package/cjs/cl.verimatrix.js +5 -5
  26. package/cjs/cl.vimond.js +13 -13
  27. package/cjs/cl.vr.js +19 -19
  28. package/cjs/cl.vtt.js +14 -14
  29. package/cjs/cl.youbora.js +19 -19
  30. package/cl.adobe.js +3 -3
  31. package/cl.airplay.js +3 -3
  32. package/cl.broadpeak.js +5 -5
  33. package/cl.cast.js +88 -88
  34. package/cl.conviva.js +27 -27
  35. package/cl.core.js +346 -344
  36. package/cl.crypto.js +8 -8
  37. package/cl.dash.js +67 -67
  38. package/cl.externs.js +47 -41
  39. package/cl.freewheel.js +19 -19
  40. package/cl.hls.js +57 -40
  41. package/cl.hlssmpte.js +5 -5
  42. package/cl.htmlcue.js +25 -25
  43. package/cl.ima.js +17 -16
  44. package/cl.mse.js +228 -228
  45. package/cl.muxdata.js +9 -8
  46. package/cl.onboard.js +4 -4
  47. package/cl.persistent.js +10 -10
  48. package/cl.playlist.js +5 -5
  49. package/cl.smooth.js +58 -59
  50. package/cl.thumbnails.js +17 -17
  51. package/cl.tizen.js +57 -57
  52. package/cl.ttml.js +22 -22
  53. package/cl.verimatrix.js +4 -4
  54. package/cl.vimond.js +8 -8
  55. package/cl.vr.js +15 -15
  56. package/cl.vtt.js +12 -12
  57. package/cl.youbora.js +14 -14
  58. package/package.json +1 -1
  59. package/typings.d.ts +108 -7
package/cl.ima.js CHANGED
@@ -1,16 +1,17 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var aH="clpp.ima.AdsManagerFactory",bH=function(a){a=a.J;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.p&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.lc?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
- _.lc&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},cH=function(a){const b=a.a,c=a.w,d=google.ima.AdEvent.Type;c.on(b,d.LOADED,a.U.bind(a));c.on(b,d.CONTENT_PAUSE_REQUESTED,a.hc.bind(a));c.on(b,d.STARTED,a.W.bind(a));c.on(b,d.LOG,a.Ha.bind(a));c.on(b,d.AD_PROGRESS,a.Xa.bind(a));c.on(b,d.AD_BUFFERING,a.ca.bind(a));c.on(b,d.FIRST_QUARTILE,a.R.bind(a));c.on(b,d.MIDPOINT,a.Va.bind(a));c.on(b,d.THIRD_QUARTILE,a.Z.bind(a));c.on(b,d.PAUSED,
3
- a.Wa.bind(a));c.on(b,d.RESUMED,a.Ya.bind(a));c.on(b,d.CLICK,a.N.bind(a));c.on(b,d.SKIPPED,a.V.bind(a));c.on(b,d.IMPRESSION,a.S.bind(a));c.on(b,d.COMPLETE,a.ka.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.lc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.Ob.bind(a))},dH=function(a,b){const c=b?a.aa.create(b.getErrorCode()):null;a.l.onError(new _.G(1,9,10003,{errorType:c},b))},eH=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.K)});a.l.trigger(new _.C(b,d))},fH=function(a){a.A=null;eH(a,_.Lb);
4
- a.m&&a.l.getSurface().hide(a.m)},gH=function(a){_.nm(a.j,{visibility:"visible"})},iH=function(a){return _.w(function*(){a.I.initialize();const b=!!a.l.getConfiguration().muted;(yield a.G.canPlay(b))?hH(a):(eH(a,_.gc),a.L.warn(_.ja))})},jH=function(a,b){return _.w(function*(){a.I.initialize();yield b.play();hH(a)})},hH=function(a){a.a.init(a.j.offsetWidth,a.j.offsetHeight,google.ima.ViewMode.NORMAL);a.a.start();a.F=!0},kH=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}mb(){return"Google IMA SDK"}nb(){return google.ima.VERSION}sb(){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()}Xb(){return this.f?
6
- this.f.getIsBumper():!1}Db(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.ne);c&&(a=b[c].clickThroughUrl);return a}getMediaUrl(){return this.a.getMediaUrl()}pb(){return this.a.getVastMediaWidth()}ob(){return this.a.getVastMediaHeight()}cb(){return this.a.getVastMediaBitrate()}Oa(){return this.g?2:this.h?1:0}getPodIndex(){return this.f?this.f.getPodIndex():0}Eb(){return this.f?this.f.getTimeOffset():0}Fb(){return this.f?this.f.getAdPosition():
7
- 1}rb(){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.rb;V.prototype.getPositionInSequence=V.prototype.Fb;
8
- V.prototype.getPodTimeOffset=V.prototype.Eb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Oa;V.prototype.getMediaBitrate=V.prototype.cb;V.prototype.getMediaHeight=V.prototype.ob;V.prototype.getMediaWidth=V.prototype.pb;V.prototype.getMediaUrl=V.prototype.getMediaUrl;V.prototype.getClickThroughUrl=V.prototype.Db;V.prototype.isBumper=V.prototype.Xb;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.sb;V.prototype.getAdManagerVersion=V.prototype.nb;V.prototype.getAdManagerName=V.prototype.mb;var lH=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 mH=class{constructor(a){this.a=a}getCuePoints(){return this.a}Gb(){return 0<=this.a.indexOf(0)||0===this.a.length}eb(){return 0<=this.a.indexOf(-1)}};mH.prototype.hasPostroll=mH.prototype.eb;mH.prototype.hasPreroll=mH.prototype.Gb;mH.prototype.getCuePoints=mH.prototype.getCuePoints;var nH=class{constructor(a){this.l=a;this.j=a.getSurface().getMedia();a=this.l.getConfiguration();this.J=a=_.kf(a.ima||{});this.m=this.l.Tb("ima").mc();this.I=this.l.Tb("ima").g;this.o=this.l.Tb("ima").a;this.G=new _.dq;this.L=new _.O("clpp.ima");this.h=this.a=null;this.f=new _.Xk;this.F=!1;this.w=new _.uo;this.aa=new lH;this.A=null;this.H=this.C=this.K=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.Nb.bind(this));a.on(this.o,b,this.Ab.bind(this));a.one(this.j,_.Zc,this.Pb.bind(this))}}Nb(a){this.a=a.getAdsManager(this.j,bH(this));this.a.isCustomPlaybackUsed()?(this.L.warn("IMA plugin does not work correctly right now on platforms with single video element. Disposing."),this.l.onError(new _.G(1,9,10002)),this.dispose()):(this.h=new _.bq(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 mH(a),
11
- this.l.trigger(new _.C(_.Ob,{adsTimeline:this.g})),cH(this));this.f.resolve()}Ab(a){dH(this,a.getError());this.f.resolve()}hc(a){const b=this;return _.w(function*(){b.C=!0;yield b.l.pause();_.nm(b.j,{visibility:_.dd});eH(b,_.wb,a);b.h.start()})}U(a){a.getAd().isLinear()?eH(this,_.Eb,a):(this.a.discardAdBreak(),this.B||(this.B=!0,this.l.play()))}W(a){this.A=a.getAd().getDuration();eH(this,_.Kb,a);this.l.getSurface().show(this.m)}Ha(a){a=a.getAdData();dH(this,a?a.adError:null);fH(this)}Xa(a){eH(this,
12
- _.Hb,a)}ca(a){eH(this,_.zb,a)}R(a){eH(this,_.Cb,a)}Va(a){eH(this,_.Fb,a)}Z(a){eH(this,_.Mb,a)}Wa(a){eH(this,_.Gb,a)}Ya(a){eH(this,_.Ib,a)}N(a){this.pause();eH(this,_.Ab,a)}V(a){eH(this,_.Jb,a);fH(this)}S(a){eH(this,_.Db,a)}ka(a){eH(this,_.Bb,a);fH(this)}lc(){this.B=!0;if(!this.C)return this.l.play();this.C=!1;this.h.stop();this.l.isEnded()||this.l.play();eH(this,_.xb);gH(this)}Ob(){this.H=!0}Pb(){this.K=!0;this.o.contentComplete()}load(){const a=this;return _.w(function*(){var b=a.l;const c=a.J;try{if(typeof c.adTagUrl!==
13
- _.ne)throw new _.G(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.Gb()?yield iH(b):yield jH(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.eb()&&!this.H?(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(()=>{gH(this);this.w.release();this.h&&(this.h.stop(),this.h=null);this.a&&(this.a.destroy(),this.a=null)})}};nH.prototype.getPosition=nH.prototype.getPosition;nH.prototype.setVolume=nH.prototype.setVolume;nH.prototype.getVolume=nH.prototype.getVolume;nH.prototype.skip=nH.prototype.skip;nH.prototype.pause=nH.prototype.pause;nH.prototype.resume=nH.prototype.resume;var oH=class extends _.jq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(kH())return a.onError(new _.G(1,9,1E4));this.f=_.lm(_.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(_.oa);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)}qf(){return this.a}nf(){return this.g}mc(){return this.f}id(){return"ima"}};_.x("clpp.ima.ImaPlugin",oH);oH.prototype.getAdContainer=oH.prototype.mc;oH.prototype.getAdDisplayContainer=oH.prototype.nf;oH.prototype.getAdsLoader=oH.prototype.qf;oH.Id="ima";oH.isSdkMissing=kH;_.Sm(new class{create(){return new oH}});var pH=class{constructor(){this.a=new _.O(aH)}name(){return aH}da(a,b){return a.namespace()===_.Ac?!1:kH()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new nH(a)}};pH.prototype.create=pH.prototype.create;pH.prototype.isSupported=pH.prototype.da;pH.prototype.name=pH.prototype.name;_.im(new pH);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var jI="clpp.ima.AdsManagerFactory",kI=function(a){a=a.G;const b=new google.ima.AdsRenderingSettings;b.restoreCustomPlaybackStateOnAdBreakComplete=!1;typeof a.bitrate===_.r&&(b.bitrate=a.bitrate);b.enablePreloading=typeof a.enablePreloading===_.ic?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
+ _.ic&&(b.useStyledLinearAds=a.useStyledLinearAds);b.uiElements=Array.isArray(a.uiElements)?a.uiElements:[];return b},lI=function(a){return a.a.isCustomPlaybackUsed()&&!1===a.G.disableCustomPlayback&&(_.ci()||_.fi())},mI=function(a){const b=a.a,c=a.o,d=google.ima.AdEvent.Type;c.on(b,d.AD_BREAK_READY,a.Ka.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.Ya.bind(a));c.on(b,d.AD_PROGRESS,a.Pb.bind(a));c.on(b,d.AD_BUFFERING,
3
+ a.Wa.bind(a));c.on(b,d.FIRST_QUARTILE,a.S.bind(a));c.on(b,d.MIDPOINT,a.Za.bind(a));c.on(b,d.THIRD_QUARTILE,a.da.bind(a));c.on(b,d.PAUSED,a.Cb.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.X.bind(a));c.on(b,d.IMPRESSION,a.U.bind(a));c.on(b,d.COMPLETE,a.Xa.bind(a));c.on(b,d.CONTENT_RESUME_REQUESTED,a.pc.bind(a));c.on(b,d.ALL_ADS_COMPLETED,a.nc.bind(a))},nI=function(a,b){const c=b?a.ma.create(b.getErrorCode()):null;a.l.onError(new _.H(1,9,10003,{errorType:c},
4
+ b))},oI=function(a,b,c){c=c&&c.getAd();let d=null;c&&(d={ad:new V(c,a.B,a.M)});a.l.trigger(new _.F(b,d))},pI=function(a){a.A=null;oI(a,_.Lb);a.m&&a.l.getSurface().hide(a.m)},qI=function(a){_.nm(a.w,{visibility:"visible"})},sI=function(a){return _.y(function*(){a.K.initialize();const b=!!a.l.getConfiguration().muted;(yield a.I.canPlay(b))||lI(a)?rI(a):(oI(a,_.gc),a.O.warn(_.ia))})},tI=function(a,b){return _.y(function*(){a.K.initialize();yield b.play();rI(a)})},rI=function(a){a.a.init(a.w.offsetWidth,
5
+ a.w.offsetHeight,google.ima.ViewMode.NORMAL);a.F=!0},uI=function(){return!window.google||!google.ima||!google.ima.AdsLoader},V=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()}Zb(){return this.f?
6
+ this.f.getIsBumper():!1}Gb(){let a=null;const b=this.a,c=Object.keys(b).find(d=>typeof b[d]===_.Bd&&typeof b[d].clickThroughUrl===_.ne);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}Hb(){return this.f?this.f.getTimeOffset():0}Ib(){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.Ib;
8
+ V.prototype.getPodTimeOffset=V.prototype.Hb;V.prototype.getPodIndex=V.prototype.getPodIndex;V.prototype.getPodType=V.prototype.Qa;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.Gb;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 vI=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 wI=class{constructor(a){this.a=a}getCuePoints(){return this.a}Jb(){return 0<=this.a.indexOf(0)||0===this.a.length}fb(){return 0<=this.a.indexOf(-1)}};wI.prototype.hasPostroll=wI.prototype.fb;wI.prototype.hasPreroll=wI.prototype.Jb;wI.prototype.getCuePoints=wI.prototype.getCuePoints;var xI=class{constructor(a){this.l=a;this.w=a.getSurface().getMedia();a=this.l.getConfiguration();this.G=a=_.lf(a.ima||{});this.m=this.l.Vb("ima").qc();this.K=this.l.Vb("ima").g;this.j=this.l.Vb("ima").a;this.I=new _.eq;this.O=new _.O("clpp.ima");this.g=this.a=null;this.f=new _.Xk;this.F=!1;this.o=new _.uo;this.ma=new vI;this.A=null;this.J=this.C=this.M=this.B=!1;this.H=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.jc.bind(this));a.on(this.j,b,this.Rb.bind(this));a.on(this.l,_.ke,this.ga.bind(this))}}ga(a){if(a=a.detail)switch(a.currentState){case _.Hl:this.M=!0,this.j.contentComplete()}}jc(a){this.a=a.getAdsManager(this.w,kI(this));this.a.isCustomPlaybackUsed()&&!lI(this)?(this.O.warn("IMA plugin is disabled for platforms with single video element. Disposing."),this.l.onError(new _.H(1,9,10002)),this.dispose()):(this.g=new _.cq(this.l.getSurface(),(b,c,d)=>{this.a.resize(b,c,d?google.ima.ViewMode.FULLSCREEN:
11
+ google.ima.ViewMode.NORMAL)}),a=this.a.getCuePoints(),this.h=new wI(a),this.l.trigger(new _.F(_.Ob,{adsTimeline:this.h})),mI(this));this.f.resolve()}Rb(a){nI(this,a.getError());this.f.resolve()}oc(a){const b=this;return _.y(function*(){b.C=!0;lI(b)||(yield b.l.pause(),_.nm(b.w,{visibility:_.dd}));oI(b,_.xb,a);b.g.start()})}Ka(){const a=this;return _.y(function*(){lI(a)&&(a.H=a.l.getPosition(),yield a.l.detach());a.a.start()})}W(a){a.getAd().isLinear()?oI(this,_.Eb,a):(this.a.discardAdBreak(),this.B||
12
+ (this.B=!0,this.l.play()))}aa(a){this.A=a.getAd().getDuration();oI(this,_.Kb,a);this.l.getSurface().show(this.m)}Ya(a){a=a.getAdData();nI(this,a?a.adError:null);pI(this)}Pb(a){oI(this,_.Hb,a)}Wa(a){oI(this,_.zb,a)}S(a){oI(this,_.Cb,a)}Za(a){oI(this,_.Fb,a)}da(a){oI(this,_.Mb,a)}Cb(a){oI(this,_.Gb,a)}Qb(a){oI(this,_.Ib,a)}R(a){this.pause();oI(this,_.Ab,a)}X(a){oI(this,_.Jb,a);pI(this)}U(a){oI(this,_.Db,a)}Xa(a){oI(this,_.Bb,a);pI(this)}pc(){const a=this;return _.y(function*(){a.B=!0;if(lI(a)&&null!==
13
+ a.H)yield _.fn(a.l),yield a.l.seek(a.H);else{if(!a.C)return a.l.play();qI(a)}a.C=!1;a.g&&a.g.stop();a.l.isEnded()||(yield a.l.play());oI(a,_.yb)})}nc(){this.J=!0}load(){const a=this;return _.y(function*(){var b=a.l;const c=a.G;try{if(typeof c.adTagUrl!==_.ne)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.I.canPlay(!1);const d=yield a.I.canPlay(!0),e=new google.ima.AdsRequest;e.adTagUrl=c.adTagUrl;
14
+ e.setAdWillAutoPlay(b);e.setAdWillPlayMuted(d);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.F?b.h.Jb()?yield sI(b):yield tI(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>
15
+ a?0:this.A-a}dispose(){return(new Promise(a=>{this.F&&this.h&&this.h.fb()&&!this.J?(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(()=>{qI(this);this.o.release();this.g&&(this.g.stop(),this.g=null);this.a&&(this.a.destroy(),this.a=null)})}};
16
+ xI.prototype.getPosition=xI.prototype.getPosition;xI.prototype.setVolume=xI.prototype.setVolume;xI.prototype.getVolume=xI.prototype.getVolume;xI.prototype.skip=xI.prototype.skip;xI.prototype.pause=xI.prototype.pause;xI.prototype.resume=xI.prototype.resume;var yI=class extends _.kq{constructor(){super();this.a=this.g=this.f=null}onPlayerCreated(a){if(uI())return a.onError(new _.H(1,9,1E4));this.f=_.lm(_.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(_.oa);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)}Bf(){return this.a}zf(){return this.g}qc(){return this.f}id(){return"ima"}};_.z("clpp.ima.ImaPlugin",yI);yI.prototype.getAdContainer=yI.prototype.qc;yI.prototype.getAdDisplayContainer=yI.prototype.zf;yI.prototype.getAdsLoader=yI.prototype.Bf;yI.Id="ima";yI.isSdkMissing=uI;_.Sm(new class{create(){return new yI}});var zI=class{constructor(){this.a=new _.O(jI)}name(){return jI}ba(a,b){return a.namespace()===_.Ac?!1:uI()?(this.a.warn("IMA SDK is not loaded."),!1):!(!b||!b.ima)}create(a){return new xI(a)}};zI.prototype.create=zI.prototype.create;zI.prototype.isSupported=zI.prototype.ba;zI.prototype.name=zI.prototype.name;_.im(new zI);};f.call(g, window);