@castlabs/prestoplay 6.17.1 → 6.19.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 (64) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/cjs/cl.adobe.js +3 -3
  3. package/cjs/cl.airplay.js +3 -3
  4. package/cjs/cl.broadpeak.js +7 -7
  5. package/cjs/cl.cast.js +115 -114
  6. package/cjs/cl.conviva.js +33 -33
  7. package/cjs/cl.core.js +575 -565
  8. package/cjs/cl.crypto.js +9 -9
  9. package/cjs/cl.dash.js +77 -74
  10. package/cjs/cl.externs.js +175 -293
  11. package/cjs/cl.freewheel.js +24 -24
  12. package/cjs/cl.hls.js +70 -69
  13. package/cjs/cl.hlssmpte.js +6 -6
  14. package/cjs/cl.htmlcue.js +29 -29
  15. package/cjs/cl.ima.js +24 -24
  16. package/cjs/cl.mse.js +315 -314
  17. package/cjs/cl.muxdata.js +15 -15
  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.sessions.js +16 -15
  22. package/cjs/cl.simid.js +15 -15
  23. package/cjs/cl.smooth.js +72 -72
  24. package/cjs/cl.thumbnails.js +26 -26
  25. package/cjs/cl.tizen.js +71 -71
  26. package/cjs/cl.ttml.js +29 -28
  27. package/cjs/cl.verimatrix.js +5 -5
  28. package/cjs/cl.vimond.js +13 -13
  29. package/cjs/cl.vr.js +19 -19
  30. package/cjs/cl.vtt.js +14 -14
  31. package/cjs/cl.youbora.js +18 -18
  32. package/cl.adobe.js +3 -3
  33. package/cl.airplay.js +3 -3
  34. package/cl.broadpeak.js +5 -5
  35. package/cl.cast.js +90 -89
  36. package/cl.conviva.js +27 -27
  37. package/cl.core.js +473 -466
  38. package/cl.crypto.js +9 -9
  39. package/cl.dash.js +72 -70
  40. package/cl.externs.js +172 -294
  41. package/cl.freewheel.js +19 -19
  42. package/cl.hls.js +74 -72
  43. package/cl.hlssmpte.js +5 -5
  44. package/cl.htmlcue.js +26 -26
  45. package/cl.ima.js +17 -17
  46. package/cl.mse.js +276 -273
  47. package/cl.muxdata.js +13 -13
  48. package/cl.onboard.js +4 -4
  49. package/cl.persistent.js +11 -11
  50. package/cl.playlist.js +5 -5
  51. package/cl.sessions.js +10 -10
  52. package/cl.simid.js +13 -13
  53. package/cl.smooth.js +59 -59
  54. package/cl.thumbnails.js +19 -19
  55. package/cl.tizen.js +57 -57
  56. package/cl.ttml.js +22 -22
  57. package/cl.verimatrix.js +4 -4
  58. package/cl.vimond.js +8 -8
  59. package/cl.vr.js +15 -15
  60. package/cl.vtt.js +12 -12
  61. package/cl.youbora.js +15 -15
  62. package/clpp.styles.css +14 -0
  63. package/package.json +2 -2
  64. package/typings.d.ts +406 -377
package/cl.freewheel.js CHANGED
@@ -1,19 +1,19 @@
1
- import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var UR="clpp-freewheel",VR="clpp.freewheel.AdsManagerFactory",WR="freewheel",YR=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},ZR=function(a){const b=[];typeof a.networkId!==_.t&&b.push("networkId");typeof a.serverUrl!==_.Mf&&b.push("serverUrl");typeof a.profileId!==_.Mf&&b.push("profileId");typeof a.videoAssetId!==_.Mf&&typeof a.videoAssetId!==_.t&&b.push("videoAssetId");
2
- if(b.length)throw new _.H(1,9,12001,{missingKeys:b.join(", ")});},$R=function(){return _.x(function*(){var a=new _.hu;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},aS=function(a){a.g.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.H.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.J.bind(a));a.g.on(a.a,
3
- tv.freewheel.SDK.EVENT_SLOT_ENDED,a.I.bind(a));a.g.on(a.a,tv.freewheel.SDK.EVENT_AD,a.G.bind(a));a.g.on(a.m,_.Tf,a.F.bind(a));a.g.on(a.m,_.Jf,a.C.bind(a))},dS=function(a){return _.x(function*(){a.B.length?(bS(a),a.f=a.B.shift(),a.f.play()):(cS(a),yield a.m.a.play())})},cS=function(a){const b=a.m.cc(WR).xc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},bS=function(a){const b=a.m.cc(WR).xc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(UR),
4
- a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},eS=function(a){a.A.length?(bS(a),a.f=a.A.shift(),a.f.play()):cS(a)},fS=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new Y(a.a,c,d)});a.m.trigger(new _.E(b,d))},gS=class extends _.ru{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.ro(_.Fd,{id:UR}),this.f=_.ro(_.w,{"class":_.dd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
- !0),a.getSurface().hide(this.a);else a.onError(new _.H(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return WR}xc(){return this.a}wg(){return this.f}};_.z("clpp.freewheel.FreeWheelPlugin",gS);gS.prototype.getAdVideo=gS.prototype.wg;gS.prototype.getAdContainer=gS.prototype.xc;gS.Id=WR;gS.AD_CONTAINER_ID=UR;_.ap(new class{create(){return new gS}});var Y=class{constructor(a,b,c){this.g=a;this.f=b;this.a=c}vb(){return"FreeWheel AdManager SDK"}wb(){return tv.freewheel.SDK.version}Cb(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.Mf?a:""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
- 0}getSkipTimeOffset(){return 0}gc(){return!1}Mb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}zb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}yb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}nb(){return 0}ab(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
- case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.ab()){case 0:return 0;case 2:return-1}return this.g.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Nb(){switch(this.ab()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}Ob(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}Bb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
8
- Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.Bb;Y.prototype.getPositionInSequence=Y.prototype.Ob;Y.prototype.getPodTimeOffset=Y.prototype.Nb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.ab;Y.prototype.getMediaBitrate=Y.prototype.nb;Y.prototype.getMediaHeight=Y.prototype.yb;
9
- Y.prototype.getMediaWidth=Y.prototype.zb;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.Mb;Y.prototype.isBumper=Y.prototype.gc;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;Y.prototype.getApiFramework=Y.prototype.getApiFramework;
10
- Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.Cb;Y.prototype.getAdManagerVersion=Y.prototype.wb;Y.prototype.getAdManagerName=Y.prototype.vb;var hS=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Pb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}pb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
- hS.prototype.hasPostroll=hS.prototype.pb;hS.prototype.hasPreroll=hS.prototype.Pb;hS.prototype.getCuePoints=hS.prototype.getCuePoints;var iS=class{constructor(a){this.h=new _.R("clpp.freewheel.AdsManager");this.m=a;this.g=new _.ks;this.w=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.B=[];this.o=[];this.A=[];this.l=new _.an;this.j=null}load(){const a=this;return _.x(function*(){const b=a.m.getConfiguration().freewheel||{};try{ZR(b)}catch(d){return a.m.onError(d),a.l.resolve(),a.l}a.w.setNetwork(b.networkId);a.w.setServer(b.serverUrl);a.a=a.w.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Mf&&typeof b.siteSectionId!==
12
- _.t||a.a.setSiteSection(b.siteSectionId);const c=yield $R();a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,YR(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Ce&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
- if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);aS(a);a.a.submitRequest();return a.l})}start(){const a=this;return _.x(function*(){yield dS(a)})}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}dispose(){const a=this;return _.x(function*(){a.g.release();
14
- a.j&&(a.j.stop(),a.j=null);cS(a);a.a&&(a.a.dispose(),a.a=null)})}H(a){if(a.success)this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.o=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.A=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.E(_.tc,{adsTimeline:new hS(this.a)})),this.j=new _.fu(this.m.getSurface(),(b,c)=>this.a.resize(b,c),this.m.cc(WR).f);else this.m.onError(new _.H(1,
15
- 9,10003,{errorType:0},void 0));this.l.resolve()}J(a){fS(this,_.bc,a);this.j.start()}I(a){this.f=null;a=a.slot;fS(this,_.cc);this.j.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:dS(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:cS(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:eS(this)}}G(a){const b=a.subType;this.h.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:fS(this,_.pc,a);fS(this,
16
- _.hc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:fS(this,_.qc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:fS(this,_.gc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:fS(this,_.jc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:fS(this,_.rc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:fS(this,_.fc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:fS(this,_.ec,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:fS(this,_.lc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:fS(this,
17
- _.nc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:fS(this,_.oc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:fS(this,_.dc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:fS(this,_.mc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.H(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}F(){if(!this.f){var a=this.m.getPosition();if(this.f=this.o.find(b=>
18
- .5>Math.abs(a-b.getTimePosition()))||null){const b=this.o.findIndex(c=>c===this.f);this.o.splice(b,1);this.m.pause();bS(this);this.f.play()}}}C(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.Wn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.Vn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Ln:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);eS(this);break;case _.Tn:case _.Sn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
- iS.prototype.getPosition=iS.prototype.getPosition;iS.prototype.setVolume=iS.prototype.setVolume;iS.prototype.getVolume=iS.prototype.getVolume;iS.prototype.skip=iS.prototype.skip;iS.prototype.pause=iS.prototype.pause;iS.prototype.resume=iS.prototype.resume;iS.prototype.start=iS.prototype.start;var jS=class{constructor(){this.a=new _.R(VR)}name(){return VR}isSupported(a,b){return a.namespace()===_.jd?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.a.warn("FreeWheel SDK is not loaded."),!1)}create(a){return new iS(a)}};jS.prototype.create=jS.prototype.create;jS.prototype.isSupported=jS.prototype.isSupported;jS.prototype.name=jS.prototype.name;_.oo(new jS);};f.call(g, window);
1
+ import {clpp} from "./cl.core.js";let g={};const _ = clpp._;var f=function(window){'use strict';var rS="clpp-freewheel",sS="clpp.freewheel.AdsManagerFactory",tS="freewheel",uS=function(a){switch(a){case 0:return tv.freewheel.SDK.ADUNIT_PREROLL;case 1:return tv.freewheel.SDK.ADUNIT_MIDROLL;case 2:return tv.freewheel.SDK.ADUNIT_POSTROLL;default:return""}},vS=function(a){const b=[];typeof a.networkId!==_.r&&b.push("networkId");typeof a.serverUrl!==_.Pf&&b.push("serverUrl");typeof a.profileId!==_.Pf&&b.push("profileId");typeof a.videoAssetId!==_.Pf&&typeof a.videoAssetId!==_.r&&b.push("videoAssetId");
2
+ if(b.length)throw new _.G(1,9,12001,{missingKeys:b.join(", ")});},wS=function(){return _.w(function*(){var a=new _.tu;let b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_NONE;const c=yield a.canPlay(!1);a=yield a.canPlay(!0);c?b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED:a&&(b=tv.freewheel.SDK.VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED);return b})},xS=function(a){a.j.on(a.a,tv.freewheel.SDK.EVENT_REQUEST_COMPLETE,a.K.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_SLOT_STARTED,a.M.bind(a));a.j.on(a.a,
3
+ tv.freewheel.SDK.EVENT_SLOT_ENDED,a.L.bind(a));a.j.on(a.a,tv.freewheel.SDK.EVENT_AD,a.J.bind(a));a.j.on(a.m,_.Xf,a.I.bind(a));a.j.on(a.m,_.Mf,a.H.bind(a))},AS=function(a){return _.w(function*(){a.G.length?(yS(a),a.f=a.G.shift(),a.f.play()):(zS(a),yield a.m.a.play())})},zS=function(a){const b=a.m.kc(tS).Bc();b&&a.m.getSurface().hide(b);a.m.getSurface().showMediaElement()},yS=function(a){const b=a.m.kc(tS).Bc();b&&(a.m.getSurface().show(b),a.m.getSurface().hideMediaElement(),a.a.registerVideoDisplayBase(rS),
4
+ a.m.isMuted()?a.setVolume(0):a.setVolume(a.m.getVolume()||1))},BS=function(a){a.F.length?(yS(a),a.f=a.F.shift(),a.f.play()):zS(a)},CS=function(a,b,c){var d=null;a.a&&c&&(c.adInstance||c.slot)&&(c=(d=c.adInstance||null)?d.getSlot():c.slot,d={ad:new Y(a.a,c,d)});a.m.trigger(new _.C(b,d))},DS=class extends _.Bu{constructor(){super();this.f=this.a=null}onPlayerCreated(a){if(window.tv&&tv.freewheel&&tv.freewheel.SDK)this.a=_.wo(_.Fd,{id:rS}),this.f=_.wo(_.t,{"class":_.gd}),this.a.appendChild(this.f),a.getSurface().addElementToContainer(this.a,
5
+ !0),a.getSurface().hide(this.a);else a.onError(new _.G(1,9,12E3))}onPlayerWillDestroy(a){this.a&&(a.getSurface().removeElementFromContainer(this.a),this.f=this.a=null)}id(){return tS}Bc(){return this.a}Bg(){return this.f}};_.x("clpp.freewheel.FreeWheelPlugin",DS);DS.prototype.getAdVideo=DS.prototype.Bg;DS.prototype.getAdContainer=DS.prototype.Bc;DS.Id=tS;DS.AD_CONTAINER_ID=rS;_.rq(new class{create(){return new DS}});var Y=class{constructor(a,b,c){this.h=a;this.f=b;this.a=c}hb(){return"FreeWheel AdManager SDK"}ib(){return tv.freewheel.SDK.version}ob(){return 0}getId(){return this.a?this.a.getAdId():""}getCreativeId(){const a=(this.a||{})._creativeId;return typeof a===_.Pf?a:""}getApiFramework(){return this.a?this.a.getActiveCreativeRendition().getCreativeApi():""}getAdSystem(){return""}getAdvertiserName(){return""}getTitle(){return""}getDuration(){return this.a?this.a.getActiveCreativeRendition().getDuration():
6
+ 0}getPosition(){return 0}getSkipTimeOffset(){return 0}Nb(){return!1}xb(){return this.a&&this.a.getEventCallbackUrls(tv.freewheel.SDK.EVENT_AD_CLICK,tv.freewheel.SDK.EVENT_TYPE_CLICK)[0]||""}getMediaUrl(){return this.a?this.a.getActiveCreativeRendition().getPrimaryCreativeRenditionAsset().getUrl():""}lb(){return this.a?this.a.getActiveCreativeRendition().getWidth():0}kb(){return this.a?this.a.getActiveCreativeRendition().getHeight():0}Za(){return 0}Ua(){switch(this.f.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;
7
+ case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return 2;default:return 1}}getPodIndex(){switch(this.Ua()){case 0:return 0;case 2:return-1}return this.h.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL).indexOf(this.f)+1}Bb(){switch(this.Ua()){case 0:return 0;case 2:return-1;default:return this.f.getTimePosition()}}Cb(){return this.a?this.f.getAdInstances().indexOf(this.a)+1:1}nb(){return this.f.getAdCount()}getWrapperAdIds(){return[]}getWrapperAdSystems(){return[]}getWrapperCreativeIds(){return[]}};
8
+ Y.prototype.getWrapperCreativeIds=Y.prototype.getWrapperCreativeIds;Y.prototype.getWrapperAdSystems=Y.prototype.getWrapperAdSystems;Y.prototype.getWrapperAdIds=Y.prototype.getWrapperAdIds;Y.prototype.getSequenceLength=Y.prototype.nb;Y.prototype.getPositionInSequence=Y.prototype.Cb;Y.prototype.getPodTimeOffset=Y.prototype.Bb;Y.prototype.getPodIndex=Y.prototype.getPodIndex;Y.prototype.getPodType=Y.prototype.Ua;Y.prototype.getMediaBitrate=Y.prototype.Za;Y.prototype.getMediaHeight=Y.prototype.kb;
9
+ Y.prototype.getMediaWidth=Y.prototype.lb;Y.prototype.getMediaUrl=Y.prototype.getMediaUrl;Y.prototype.getClickThroughUrl=Y.prototype.xb;Y.prototype.isBumper=Y.prototype.Nb;Y.prototype.getSkipTimeOffset=Y.prototype.getSkipTimeOffset;Y.prototype.getPosition=Y.prototype.getPosition;Y.prototype.getDuration=Y.prototype.getDuration;Y.prototype.getTitle=Y.prototype.getTitle;Y.prototype.getAdvertiserName=Y.prototype.getAdvertiserName;Y.prototype.getAdSystem=Y.prototype.getAdSystem;
10
+ Y.prototype.getApiFramework=Y.prototype.getApiFramework;Y.prototype.getCreativeId=Y.prototype.getCreativeId;Y.prototype.getId=Y.prototype.getId;Y.prototype.getTechnology=Y.prototype.ob;Y.prototype.getAdManagerVersion=Y.prototype.ib;Y.prototype.getAdManagerName=Y.prototype.hb;var ES=class{constructor(a){this.a=a}getCuePoints(){return this.a.getTemporalSlots().map(a=>{switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:return 0;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:return-1;default:return a.getTimePosition()}})}Eb(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL).length}Db(){return 0<this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL).length}};
11
+ ES.prototype.hasPostroll=ES.prototype.Db;ES.prototype.hasPreroll=ES.prototype.Eb;ES.prototype.getCuePoints=ES.prototype.getCuePoints;var FS=class{constructor(a){this.g=new _.R("clpp.freewheel.AdsManager");this.m=a;this.j=new _.Bs;this.C=new tv.freewheel.SDK.AdManager;this.f=this.a=null;this.G=[];this.B=[];this.F=[];this.A=new _.gn;this.l=null}load(){const a=this;return _.w(function*(){const b=a.m.getConfiguration().freewheel||{};try{vS(b)}catch(d){return a.m.onError(d),a.A.resolve(),a.A}a.C.setNetwork(b.networkId);a.C.setServer(b.serverUrl);a.a=a.C.newContext();a.a.setProfile(b.profileId);typeof b.siteSectionId!==_.Pf&&typeof b.siteSectionId!==
12
+ _.r||a.a.setSiteSection(b.siteSectionId);const c=yield wS();a.a.setVideoAsset(b.videoAssetId,a.m.getDuration(),void 0,void 0,c);if(Array.isArray(b.pods))for(const d of b.pods)a.a.addTemporalSlot(d.id,uS(d.type),d.position,d.slotProfile,d.cuepointSequence,d.maxDuration,d.minDuration,d.acceptContentType);b.keyValues&&typeof b.keyValues===_.Fe&&Object.keys(b.keyValues).forEach(d=>a.a.addKeyValue(d,b.keyValues[d]));a.a.setParameter(tv.freewheel.SDK.PARAMETER_EXTENSION_CONTENT_VIDEO_ENABLED,!1,tv.freewheel.SDK.PARAMETER_LEVEL_GLOBAL);
13
+ if(Array.isArray(b.parameters))for(const d of b.parameters)a.a.setParameter(d.name,d.value,d.level);xS(a);a.a.submitRequest();return a.A})}start(){const a=this;return _.w(function*(){yield AS(a)})}w(){}resume(){this.f&&this.f.resume()}pause(){this.f&&this.f.pause()}skip(){this.f&&this.f.skipCurrentAd()}getVolume(){return this.a?this.a.getAdVolume():1}setVolume(a){this.a&&this.a.setAdVolume(a)}getPosition(){return this.f?this.f.getPlayheadTime():-1}o(){return!0}h(){const a=this;return _.w(function*(){a.j.release();
14
+ a.l&&(a.l.stop(),a.l=null);zS(a);a.a&&(a.a.dispose(),a.a=null)})}K(a){if(a.success)this.G=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL),this.B=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL),this.F=this.a.getSlotsByTimePositionClass(tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL),this.m.trigger(new _.C(_.wc,{adsTimeline:new ES(this.a)})),this.l=new _.ru(this.m.getSurface(),(b,c)=>this.a.resize(b,c),this.m.kc(tS).f);else this.m.onError(new _.G(1,
15
+ 9,10003,{errorType:0},void 0));this.A.resolve()}M(a){CS(this,_.cc,a);this.l.start()}L(a){this.f=null;a=a.slot;CS(this,_.dc);this.l.stop();if(a)switch(a.getTimePositionClass()){case tv.freewheel.SDK.TIME_POSITION_CLASS_PREROLL:AS(this);break;case tv.freewheel.SDK.TIME_POSITION_CLASS_MIDROLL:zS(this);this.m.play();break;case tv.freewheel.SDK.TIME_POSITION_CLASS_POSTROLL:BS(this)}}J(a){const b=a.subType;this.g.debug("ad event",b);switch(b){case tv.freewheel.SDK.EVENT_AD_IMPRESSION:CS(this,_.sc,a);CS(this,
16
+ _.lc,a);break;case tv.freewheel.SDK.EVENT_AD_IMPRESSION_END:CS(this,_.tc,a);break;case tv.freewheel.SDK.EVENT_AD_FIRST_QUARTILE:CS(this,_.hc,a);break;case tv.freewheel.SDK.EVENT_AD_MIDPOINT:CS(this,_.nc,a);break;case tv.freewheel.SDK.EVENT_AD_THIRD_QUARTILE:CS(this,_.uc,a);break;case tv.freewheel.SDK.EVENT_AD_COMPLETE:CS(this,_.gc,a);break;case tv.freewheel.SDK.EVENT_AD_CLICK:CS(this,_.fc,a);break;case tv.freewheel.SDK.EVENT_AD_PAUSE:CS(this,_.oc,a);break;case tv.freewheel.SDK.EVENT_AD_RESUME:CS(this,
17
+ _.qc,a);break;case tv.freewheel.SDK.EVENT_AD_SKIPPED:CS(this,_.rc,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_START:CS(this,_.ec,a);break;case tv.freewheel.SDK.EVENT_AD_BUFFERING_END:CS(this,_.pc,a);break;case tv.freewheel.SDK.EVENT_ERROR:this.m.onError(new _.G(1,9,10003,{errorType:1},{fwCode:a[tv.freewheel.SDK.INFO_KEY_ERROR_CODE],fwInfo:a[tv.freewheel.SDK.INFO_KEY_ERROR_INFO],fwModule:a[tv.freewheel.SDK.INFO_KEY_ERROR_MODULE]}))}}I(){if(!this.f){var a=this.m.getPosition();if(this.f=this.B.find(b=>
18
+ .5>Math.abs(a-b.getTimePosition()))||null){const b=this.B.findIndex(c=>c===this.f);this.B.splice(b,1);this.m.pause();yS(this);this.f.play()}}}H(a){if((a=a.detail)&&this.a)switch(a.currentState){case _.bo:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PLAYING);break;case _.ao:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_PAUSED);break;case _.Rn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_COMPLETED);BS(this);break;case _.Zn:case _.Yn:this.a.setVideoState(tv.freewheel.SDK.VIDEO_STATE_STOPPED)}}};
19
+ FS.prototype.getPosition=FS.prototype.getPosition;FS.prototype.setVolume=FS.prototype.setVolume;FS.prototype.getVolume=FS.prototype.getVolume;FS.prototype.skip=FS.prototype.skip;FS.prototype.pause=FS.prototype.pause;FS.prototype.resume=FS.prototype.resume;_.uo(new class{constructor(){this.f=new _.R(sS)}name(){return sS}a(a,b){return a.namespace()===_.kd?!1:window.tv&&tv.freewheel&&tv.freewheel.SDK?!(!b||!b.freewheel):(this.f.warn("FreeWheel SDK is not loaded."),!1)}create(a){return new FS(a)}});};f.call(g, window);