PageSourceSearch

https://www.audacy.com/assets-a2/videojs.ima.es-BBTmRBOo.js

js audacy.com collected 2026-10-09 22:40:00 UTC 49,306 bytes, 3 lines download raw bytes

1import{v as m}from"./video.es-BjAfamXU.js";import"./index-BgcUcd2q.js";function v(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function A(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P(t,e,i){return Object.defineProperty(t,"prototype",{writable:!1}),t}function k(t,e){var i=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=E(t))||e){i&&(t=i);var n=0,l=function(){};return{s:l,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(c){throw c},f:l}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var g,u=!0,y=!1;return{s:function(){i=i.call(t)},n:function(){var c=i.next();return u=c.done,c},e:function(c){y=!0,g=c},f:function(){try{u||i.return==null||i.return()}finally{if(y)throw g}}}}function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(t)}function E(t,e){if(t){if(typeof t=="string")return v(t,e);var i={}.toString.call(t).slice(8,-1);return i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set"?Array.from(t):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?v(t,e):void 0}}var o=function(e,i,n){this.vjsPlayer=e,this.controller=n,this.contentTrackingTimer=null,this.contentComplete=!1,this.updateTimeIntervalHandle=null,this.updateTimeInterval=1e3,this.seekCheckIntervalHandle=null,this.seekCheckInterval=1e3,this.resizeCheckIntervalHandle=null,this.resizeCheckInterval=250,this.seekThreshold=100,this.contentEndedListeners=[],this.contentSource="",this.contentSourceType="",this.contentPlayheadTracker={currentTime:0,previousTime:0,seeking:!1,duration:0},this.vjsPlayerDimensions={width:this.getPlayerWidth(),height:this.getPlayerHeight()},this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this)),this.boundContentEndedListener=this.localContentEndedListener.bind(this),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("readyforpreroll",this.onReadyForPreroll.bind(this)),this.vjsPlayer.on("adtimeout",this.onAdTimeout.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.controller.getSettings().requestMode==="onPlay"&&this.vjsPlayer.one("play",this.controller.requestAds.bind(this.controller)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(i)};o.prototype.setUpPlayerIntervals=function(){this.updateTimeIntervalHandle&&clearInterval(this.updateTimeIntervalHandle),this.seekCheckIntervalHandle&&clearInterval(this.seekCheckIntervalHandle),this.resizeCheckIntervalHandle&&clearInterval(this.resizeCheckIntervalHandle),this.updateTimeIntervalHandle=setInterval(this.updateCurrentTime.bind(this),this.updateTimeInterval),this.seekCheckIntervalHandle=setInterval(this.checkForSeeking.bind(this),this.seekCheckInterval),this.resizeCheckIntervalHandle=setInterval(this.checkForResize.bind(this),this.resizeCheckInterval)};o.prototype.updateCurrentTime=function(){this.contentPlayheadTracker.seeking||(this.contentPlayheadTracker.currentTime=this.vjsPlayer.currentTime())};o.prototype.checkForSeeking=function(){var t=this.vjsPlayer.currentTime(),e=(t-this.contentPlayheadTracker.previousTime)*1e3;Math.abs(e)>this.seekCheckInterval+this.seekThreshold?this.contentPlayheadTracker.seeking=!0:this.contentPlayheadTracker.seeking=!1,this.contentPlayheadTracker.previousTime=this.vjsPlayer.currentTime()};o.prototype.checkForResize=function(){var t=this.getPlayerWidth(),e=this.getPlayerHeight();(t!=this.vjsPlayerDimensions.width||e!=this.vjsPlayerDimensions.height)&&(this.vjsPlayerDimensions.width=t,this.vjsPlayerDimensions.height=e,this.controller.onPlayerResize(t,e))};o.prototype.localContentEndedListener=function(){this.contentComplete||(this.contentComplete=!0,this.controller.onContentComplete());for(var t in this.contentEndedListeners)typeof this.contentEndedListeners[t]=="function"&&this.contentEndedListeners[t]();
2this.vjsPlayer.el()&&this.vjsPlayer.one("play",this.setUpPlayerIntervals.bind(this))};o.prototype.onNoPostroll=function(){this.vjsPlayer.trigger("nopostroll")};o.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.controller.onPlayerDisposed(),this.contentComplete=!0,this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.adTimeoutTimeout&&clearTimeout(this.vjsPlayer.ads.adTimeoutTimeout);var t=[this.updateTimeIntervalHandle,this.seekCheckIntervalHandle,this.resizeCheckIntervalHandle];for(var e in t)t[e]&&clearInterval(t[e])};o.prototype.onReadyForPreroll=function(){this.controller.onPlayerReadyForPreroll()};o.prototype.onAdTimeout=function(){this.controller.onAdTimeout()};o.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.h5Player.hasAttribute("autoplay")&&this.controller.setSetting("adWillAutoPlay",!0),this.onVolumeChange(),this.vjsPlayer.on("fullscreenchange",this.onFullscreenChange.bind(this)),this.vjsPlayer.on("volumechange",this.onVolumeChange.bind(this)),this.controller.onPlayerReady()};o.prototype.onFullscreenChange=function(){this.vjsPlayer.isFullscreen()?this.controller.onPlayerEnterFullscreen():this.controller.onPlayerExitFullscreen()};o.prototype.onVolumeChange=function(){var t=this.vjsPlayer.muted()?0:this.vjsPlayer.volume();this.controller.onPlayerVolumeChanged(t)};o.prototype.injectAdContainerDiv=function(t){this.vjsControls.el().parentNode.appendChild(t)};o.prototype.getContentPlayer=function(){return this.h5Player};o.prototype.getVolume=function(){return this.vjsPlayer.muted()?0:this.vjsPlayer.volume()};o.prototype.setVolume=function(t){this.vjsPlayer.volume(t),t==0?this.vjsPlayer.muted(!0):this.vjsPlayer.muted(!1)};o.prototype.unmute=function(){this.vjsPlayer.muted(!1)};o.prototype.mute=function(){this.vjsPlayer.muted(!0)};o.prototype.play=function(){this.vjsPlayer.play()};o.prototype.togglePlayback=function(){this.vjsPlayer.paused()?this.vjsPlayer.play():this.vjsPlayer.pause()};o.prototype.getPlayerWidth=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).width;return(!t||parseFloat(t)===0)&&(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).width),parseFloat(t)||this.vjsPlayer.width()};o.prototype.getPlayerHeight=function(){var t=(getComputedStyle(this.vjsPlayer.el())||{}).height;return(!t||parseFloat(t)===0)&&(t=(this.vjsPlayer.el().getBoundingClientRect()||{}).height),parseFloat(t)||this.vjsPlayer.height()};o.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_};o.prototype.getPlayerId=function(){return this.vjsPlayer.id()};o.prototype.toggleFullscreen=function(){this.vjsPlayer.isFullscreen()?this.vjsPlayer.exitFullscreen():this.vjsPlayer.requestFullscreen()};o.prototype.getContentPlayheadTracker=function(){return this.contentPlayheadTracker};o.prototype.onAdError=function(t){this.vjsControls.show();var e=t.getError!==void 0?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})};o.prototype.onAdLog=function(t){var e=t.getAdData(),i=e.adError!==void 0?e.adError.getMessage():void 0;this.vjsPlayer.trigger({type:"adslog",data:{AdError:i,AdEvent:t}})};o.prototype.onAdBreakStart=function(){this.contentSource=this.vjsPlayer.currentSrc(),this.contentSourceType=this.vjsPlayer.currentType(),this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.startLinearAdMode(),this.vjsControls.hide(),this.vjsPlayer.pause()};o.prototype.onAdBreakEnd=function(){this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.vjsControls.show()};o.prototype.onAdStart=function(){this.vjsPlayer.trigger("ads-ad-started")};o.prototype.onAllAdsCompleted=function(){this.contentComplete==!0&&(this.contentSource&&this.vjsPlayer.currentSrc()!=this.contentSource&&this.vjsPlayer.src({src:this.contentSource,type:this.contentSourceType}),this.controller.onContentAndAdsCompleted())};o.prototype.onAdsReady=function(){this.vjsPlayer.trigger("adsready")};o.prototype.changeSource=function(t){this.vjsPlayer.currentSrc()&&(this.vjsPlayer.currentTime(0),this.vjsPlayer.pause()),t&&this.vjsPlayer.src(t),this.vjsPlayer.one("loadedmetadata",this.seekContentToZero.bind(this))};o.prototype.seekContentToZero=function(){this.vjsPlayer.currentTime(0)};o.prototype.triggerPlayerEvent=function(t,e){this.vjsPlayer.trigger(t,e)};o.prototype.addContentEndedListener=function(t){this.contentEndedListeners.push(t)};o.prototype.reset=function(){this.vjsPlayer.off("readyforpostroll",this.boundContentEndedListener),this.vjsPlayer.on("readyforpostroll",this.boundContentEndedListener),this.vjsControls.show(),this.vjsPlayer.ads.inAdBreak()&&this.vjsPlayer.ads.endLinearAdMode(),this.contentPlayheadTracker.currentTime=0,this.contentComplete=!1};var a=function(e){this.controller=e,this.adContainerDiv=document.createElement("div"),this.controlsDiv=document.createElement("div"),this.countdownDiv=document.createElement("div"),this.seekBarDiv=document.createElement("div"),this.progressDiv=document.createElement("div"),this.playPauseDiv=document.createElement("div"),this.muteDiv=document.createElement("div"),this.sliderDiv
2=document.createElement("div"),this.sliderLevelDiv=document.createElement("div"),this.fullscreenDiv=document.createElement("div"),this.boundOnMouseUp=this.onMouseUp.bind(this),this.boundOnMouseMove=this.onMouseMove.bind(this),this.adPlayheadTracker={currentTime:0,duration:0,isPod:!1,adPosition:0,totalAds:0},this.controlPrefix=this.controller.getPlayerId()+"_",this.showCountdown=!0,this.controller.getSettings().showCountdown===!1&&(this.showCountdown=!1),this.isAdNonlinear=!1,this.createAdContainer()};a.prototype.createAdContainer=function(){this.assignControlAttributes(this.adContainerDiv,"ima-ad-container"),this.adContainerDiv.classList.add("hide-ad-container"),this.adContainerDiv.addEventListener("mouseenter",this.showAdControls.bind(this),!1),this.adContainerDiv.addEventListener("mouseleave",this.hideAdControls.bind(this),!1),this.adContainerDiv.addEventListener("click",this.onAdContainerClick.bind(this),!1),this.createControls(),this.controller.injectAdContainerDiv(this.adContainerDiv)};a.prototype.createControls=function(){this.assignControlAttributes(this.controlsDiv,"ima-controls-div"),this.controlsDiv.style.width="100%",this.controller.getIsMobile()?this.countdownDiv.style.display="none":(this.assignControlAttributes(this.countdownDiv,"ima-countdown-div"),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel,this.countdownDiv.style.display=this.showCountdown?"block":"none"),this.assignControlAttributes(this.seekBarDiv,"ima-seek-bar-div"),this.seekBarDiv.style.width="100%",this.assignControlAttributes(this.progressDiv,"ima-progress-div"),this.assignControlAttributes(this.playPauseDiv,"ima-play-pause-div"),this.addClass(this.playPauseDiv,"ima-playing"),this.playPauseDiv.addEventListener("click",this.onAdPlayPauseClick.bind(this),!1),this.assignControlAttributes(this.muteDiv,"ima-mute-div"),this.addClass(this.muteDiv,"ima-non-muted"),this.muteDiv.addEventListener("click",this.onAdMuteClick.bind(this),!1),this.assignControlAttributes(this.sliderDiv,"ima-slider-div"),this.sliderDiv.addEventListener("mousedown",this.onAdVolumeSliderMouseDown.bind(this),!1),this.controller.getIsIos()&&(this.sliderDiv.style.display="none"),this.assignControlAttributes(this.sliderLevelDiv,"ima-slider-level-div"),this.assignControlAttributes(this.fullscreenDiv,"ima-fullscreen-div"),this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.fullscreenDiv.addEventListener("click",this.onAdFullscreenClick.bind(this),!1),this.adContainerDiv.appendChild(this.controlsDiv),this.controlsDiv.appendChild(this.countdownDiv),this.controlsDiv.appendChild(this.seekBarDiv),this.controlsDiv.appendChild(this.playPauseDiv),this.controlsDiv.appendChild(this.muteDiv),this.controlsDiv.appendChild(this.sliderDiv),this.controlsDiv.appendChild(this.fullscreenDiv),this.seekBarDiv.appendChild(this.progressDiv),this.sliderDiv.appendChild(this.sliderLevelDiv)};a.prototype.onAdPlayPauseClick=function(){this.controller.onAdPlayPauseClick()};a.prototype.onAdMuteClick=function(){this.controller.onAdMuteClick()};a.prototype.onAdFullscreenClick=function(){this.controller.toggleFullscreen()};a.prototype.onAdsPaused=function(){this.controller.sdkImpl.adPlaying=!1,this.addClass(this.playPauseDiv,"ima-paused"),this.removeClass(this.playPauseDiv,"ima-playing"),this.showAdControls()};a.prototype.onAdsResumed=function(){this.onAdsPlaying(),this.showAdControls()};a.prototype.onAdsPlaying=function(){this.controller.sdkImpl.adPlaying=!0,this.addClass(this.playPauseDiv,"ima-playing"),this.removeClass(this.playPauseDiv,"ima-paused")};a.prototype.updateAdUi=function(t,e,i,n,l){var g=Math.floor(e/60),u=Math.floor(e%60);u.toString().length<2&&(u="0"+u);var y=": ";l>1&&(y=" ("+n+" "+this.controller.getSettings().adLabelNofN+" "+l+"): "),this.countdownDiv.innerHTML=this.controller.getSettings().adLabel+y+g+":"+u;var c=t/i,S=c*100;this.progressDiv.style.width=S+"%"};a.prototype.unmute=function(){this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=this.controller.getPlayerVolume()*100+"%"};a.prototype.mute=function(){this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"};a.prototype.onAdVolumeSliderMouseDown=function(){document.addEventListener("mouseup",this.boundOnMouseUp,!1),document.addEventListener("mousemove",this.boundOnMouseMove,!1)};a.prototype.onMouseMove=function(t){this.changeVolume(t)};a.prototype.onMouseUp=function(t){this.changeVolume(t),document.removeEventListener("mouseup",this.boundOnMouseUp),document.removeEventListener("mousemove",this.boundOnMouseMove)};a.prototype.changeVolume=function(t){var e=(t.clientX-this.sliderDiv.getBoundingClientRect().left)/this.sliderDiv.offsetWidth;e*=100,e=Math.min(Math.max(e,0),100),this.sliderLevelDiv.style.width=e+"%",this.percent==0?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted")):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted")),this.controller.setVolume(e/100)};a.prototype.showAdContainer=function(){this.adContainerDiv.classList.remove("hide-ad-container")};a.prototype.hideAdContainer=function(){this.adContainerDiv.classList.add("hide-ad-container")};a.prototype.onAdContainerClick=function(){this.isAdNonlinear&&this.controller.togglePlayback()};a.prototype.reset=function(){this.hideAdContainer()};a.prototype.onAdError=function(){this.hideAdContainer()};a.prototype.onAdBreakStart=function(t){this.showAdContainer();var e=t.getAd().getContentType();e==="application/javascript"&&!this.controller.getSettings().showControlsForJSAds?this.controlsDiv.style.display="none":this.controlsDiv.style.display="block",this.onAdsPlaying(),this.hideAdControls()};a.prototype.onAdBreakEnd=function(){var t=this.controller.getCurrentAd();(t==null||t.isLinear())&&this.hideAdContainer(),this.controlsDiv.style.display="none",this.countdownDiv.innerHTML=""};a.prototype.onAllAdsCompleted=function(){this.hideAdContainer()};a.prototype.onLinearAdStart=function(){this.removeClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!1};a.prototype.onNonLinearAdLoad=function(){this.addClass(this.adContainerDiv,"bumpable-ima-ad-container"),this.isAdNonlinear=!0};a.prototype.onPlayerEnterFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-non-fullscreen")};a.prototype.onPlayerExitFullscreen=function(){this.addClass(this.fullscreenDiv,"ima-non-fullscreen"),this.removeClass(this.fullscreenDiv,"ima-fullscreen")};a.prototype.onPlayerVolumeChanged=function(t){t==0?(this.addClass(this.muteDiv,"ima-muted"),this.removeClass(this.muteDiv,"ima-non-muted"),this.sliderLevelDiv.style.width="0%"):(this.addClass(this.muteDiv,"ima-non-muted"),this.removeClass(this.muteDiv,"ima-muted"),this.sliderLevelDiv.style.width=t*100+"%")};a.prototype.showAdControls=function(){var t=this.controller.getSettings(),e=t.disableAdControls;e||this.addClass(this.controlsDiv,"ima-controls-div-showing")};a.prototype.hideAdControls=function(){this.removeClass(this.controlsDiv,"ima-controls-div-showing")};a.prototype.assignControlAttributes=function(t,e){t.id=this.controlPrefix+e,t.className=this.controlPrefix+e+" "+e};a.prototype.getClassRegexp=function(t){return new RegExp("(^|[^A-Za-z-])"+t+"((?![A-Za-z-])|$)","gi")};a.prototype.elementHasClass=function(t,e){var i=this.getClassRegexp(e);return i.test(t.className)};a.prototype.addClass=function(t,e){t.className=t.className.trim()+" "+e};a.prototype.removeClass=function(t,e){var i=this.getClassRegexp(e);t.className=t.className.trim().replace(i,"")};a.prototype.getAdContainerDiv=function(){return this.adContainerDiv};a.prototype.setShowCountdown=function(t){this.showCountdown=t,this.countdownDiv.style.display=this.showCountdown?"block":"none"};var D="2.5.0",L={version:D},r=function(e){this.controller=e,this.adDisplayContainer=null,this.adDisplayContainerInitialized=!1,this.adsLoader=null,this.adsManager=null,this.adsRenderingSettings=null,this.adsResponse=null,this.currentAd=null,this.adTrackingTimer=null,this.allAdsCompleted=!1,this.adsActive=!1,this.adPlaying=!1,this.adMuted=!1,this.adBreakReadyListener=void 0,this.contentCompleteCalled=!1,this.isAdTimedOut=!1,this.adsManagerDimensions={width:0,height:0},this.autoPlayAdBreaks=!0,this.controller.getSettings().autoPlayAdBreaks===!1&&(this.autoPlayAdBreaks=!1),this.controller.getSettings().locale&&google.ima.settings.setLocale(this.controller.getSettings().locale),this.controller.getSettings().disableFlashAds&&google.ima.settings.setDisableFlashAds(this.controller.getSettings().disableFlashAds),this.controller.getSettings().disableCustomPlaybackForIOS10Plus&&google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.controller.getSettings().disableCustomPlaybackForIOS10Plus),this.controller.getSettings().ppid&&google.ima.settings.setPpid(this.controller.getSettings().ppid),this.controller.getSettings().featureFlags&&google.ima.settings.setFeatureFlags(this.controller.getSettings().featureFlags)};r.prototype.initAdObjects=function(){this.adDisplayContainer=new google.ima.AdDisplayContainer(this.controller.getAdContainerDiv(),this.controller.getContentPlayer()),this.adsLoader=new google.ima.AdsLoader(this.adDisplayContainer),this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),this.controller.getSettings().vpaidAllowed==!1&&this.adsLoader.getSettings().setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.DISABLED),this.controller.getSettings().vpaidMode!==void 0&&this.adsLoader.getSettings().setVpaidMode(this.controller.getSettings().vpaidMode),this.controller.getSettings().locale&&this.adsLoader.getSettings().setLocale(this.controller.getSettings().locale),this.controller.getSettings().numRedirects&&this.adsLoader.getSettings().setNumRedirects(this.controller.getSettings().numRedirects),this.controller.getSettings().sessionId&&this.adsLoader.getSettings().setSessionId(this.controller.getSettings().sessionId),this.adsLoader.getSettings().setPlayerType("videojs-ima"),this.adsLoader.getSettings().setPlayerVersion(L.version),this.adsLoader.getSettings().setAutoPlayAdBreaks(this.autoPlayAdBreaks),this.adsLoader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,this.onAdsManagerLoaded.bind(this),!1),this.adsLoader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdsLoaderError.bind(this),!1),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-loader",adsLoader:this.adsLoader})};r.prototype.requestAds=function(){var t=new google.ima.AdsRequest;if(this.controller.getSettings().adTagUrl?t.adTagUrl=this.controller.getSettings().adTagUrl:t.adsResponse=this.controller.getSettings().adsResponse,this.controller.getSettings().forceNonLinearFullSlot&&(t.forceNonLinearFullSlot=!0),this.controller.getSettings().vastLoadTimeout&&(t.vastLoadTimeout=this.controller.getSettings().vastLoadTimeout),this.controller.getSettings().omidMode&&window.console.warn("The additional setting `omidMode` has been removed. Use `omidVendorAccess` instead."),this.controller.getSettings().omidVendorAccess){t.omidAccessModeRules={};var e=this.controller.getSettings().omidVendorAccess;Object.keys(e).forEach(function(n){t.omidAccessModeRules[n]=e[n]})}t.linearAdSlotWidth=this.controller.getPlayerWidth(),t.linearAdSlotHeight=this.controller.getPlayerHeight(),t.nonLinearAdSlotWidth=this.controller.getSettings().nonLinearWidth||this.controller.getPlayerWidth(),t.nonLinearAdSlotHeight=this.controller.getSettings().nonLinearHeight||this.controller.getPlayerHeight(),t.setAdWillAutoPlay(this.controller.adsWillAutoplay()),t.setAdWillPlayMuted(this.controller.adsWillPlayMuted());var i=this.controller.getSettings().adsRequest;
2i&&f(i)==="object"&&Object.keys(i).forEach(function(n){t[n]=i[n]}),this.adsLoader.requestAds(t),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-request",AdsRequest:t})};r.prototype.onAdsManagerLoaded=function(t){this.createAdsRenderingSettings(),this.adsManager=t.getAdsManager(this.controller.getContentPlayheadTracker(),this.adsRenderingSettings),this.adsManager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,this.onAdError.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.AD_BREAK_READY,this.onAdBreakReady.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED,this.onContentPauseRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,this.onContentResumeRequested.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.ALL_ADS_COMPLETED,this.onAllAdsCompleted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOADED,this.onAdLoaded.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.STARTED,this.onAdStarted.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.COMPLETE,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.SKIPPED,this.onAdComplete.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.LOG,this.onAdLog.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.PAUSED,this.onAdPaused.bind(this)),this.adsManager.addEventListener(google.ima.AdEvent.Type.RESUMED,this.onAdResumed.bind(this)),this.controller.playerWrapper.vjsPlayer.trigger({type:"ads-manager",adsManager:this.adsManager}),this.autoPlayAdBreaks||this.initAdsManager();var e=this.controller.getSettings(),i=e.preventLateAdStart;i?i&&!this.isAdTimedOut&&this.controller.onAdsReady():this.controller.onAdsReady(),this.controller.getSettings().adsManagerLoadedCallback&&this.controller.getSettings().adsManagerLoadedCallback()};r.prototype.onAdsLoaderError=function(t){window.console.warn("AdsLoader error: "+t.getError()),this.controller.onErrorLoadingAds(t),this.adsManager&&this.adsManager.destroy()};r.prototype.initAdsManager=function(){try{var t=this.controller.getPlayerWidth(),e=this.controller.getPlayerHeight();this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.init(t,e),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.initializeAdDisplayContainer()}catch(i){this.onAdError(i)}};r.prototype.createAdsRenderingSettings=function(){if(this.adsRenderingSettings=new google.ima.AdsRenderingSettings,this.adsRenderingSettings.restoreCustomPlaybackStateOnAdBreakComplete=!0,this.controller.getSettings().adsRenderingSettings)for(var t in this.controller.getSettings().adsRenderingSettings)t!==""&&(this.adsRenderingSettings[t]=this.controller.getSettings().adsRenderingSettings[t])};r.prototype.onAdError=function(t){var e=t.getError!==void 0?t.getError():t.stack;window.console.warn("Ad error: "+e),this.adsManager.destroy(),this.controller.onAdError(t),this.adsActive=!1,this.adPlaying=!1};r.prototype.onAdBreakReady=function(t){this.adBreakReadyListener(t)};r.prototype.onContentPauseRequested=function(t){this.adsActive=!0,this.adPlaying=!0,this.controller.onAdBreakStart(t)};r.prototype.onContentResumeRequested=function(t){this.adsActive=!1,this.adPlaying=!1,this.controller.onAdBreakEnd()};r.prototype.onAllAdsCompleted=function(t){this.allAdsCompleted=!0,this.controller.onAllAdsCompleted()};r.prototype.onAdLoaded=function(t){t.getAd().isLinear()||(this.controller.onNonLinearAdLoad(),this.controller.playContent())};r.prototype.onAdStarted=function(t){this.currentAd=t.getAd(),this.currentAd.isLinear()?(this.adTrackingTimer=setInterval(this.onAdPlayheadTrackerInterval.bind(this),250),this.controller.onLinearAdStart()):this.controller.onNonLinearAdStart()};r.prototype.onAdPaused=function(){this.controller.onAdsPaused()};r.prototype.onAdResumed=function(t){this.controller.onAdsResumed()};r.prototype.onAdComplete=function(){this.currentAd.isLinear()&&clearInterval(this.adTrackingTimer)};r.prototype.onAdLog=function(t){this.controller.onAdLog(t)};r.prototype.onAdPlayheadTrackerInterval=function(){if(this.adsManager!==null){var t=this.adsManager.getRemainingTime(),e=this.currentAd.getDuration(),i=e-t;i=i>0?i:0;var n=0,l;this.currentAd.getAdPodInfo()&&(l=this.currentAd.getAdPodInfo().getAdPosition(),n=this.currentAd.getAdPodInfo().getTotalAds()),this.controller.onAdPlayheadUpdated(i,t,e,l,n)}};r.prototype.onContentComplete=function(){this.adsLoader&&(this.adsLoader.contentComplete(),this.contentCompleteCalled=!0),(this.adsManager&&this.adsManager.getCuePoints()&&!this.adsManager.getCuePoints().includes(-1)||!this.adsManager)&&this.controller.onNoPostroll(),this.allAdsCompleted&&this.controller.onContentAndAdsCompleted()};r.prototype.onPlayerDisposed=function(){this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null)};r.prototype.onPlayerReadyForPreroll=function(){if(this.autoPlayAdBreaks){this.initAdsManager();try{this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start()}catch(t){this.onAdError(t)}}};r.prototype.onAdTimeout=function(){this.isAdTimedOut=!0};r.prototype.onPlayerReady=function(){this.initAdObjects(),(this.controller.getSettings().adTagUrl||this.controller.getSettings().adsResponse)&&this.controller.getSettings().requestMode==="onLoad"&&this.requestAds()};r.prototype.onPlayerEnterFullscreen=function(){this.adsManager&&this.adsManager.resize(window.screen.width,window.screen.height)};r.prototype.onPlayerExitFullscreen=function(){this.adsManager&&this.adsManager.resize(this.controller.getPlayerWidth(),this.controller.getPlayerHeight())};r.prototype.onPlayerVolumeChanged=function(t){this.adsManager&&this.adsManager.setVolume(t),t==0?this.adMuted=!0:this.adMuted=!1};r.prototype.onPlayerResize=function(t,e){this.adsManager&&(this.adsManagerDimensions.width=t,this.adsManagerDimensions.height=e,this.adsManager.resize(t,e))};r.prototype.getCurrentAd=function(){return this.currentAd};r.prototype.setAdBreakReadyListener=function(t){this.adBreakReadyListener=t};r.prototype.isAdPlaying=function(){return this.adPlaying};r.prototype.isAdMuted=function(){return this.adMuted};r.prototype.pauseAds=function(){this.adsManager.pause(),this.adPlaying=!1};r.prototype.resumeAds=function(){this.adsManager.resume(),this.adPlaying=!0};r.prototype.unmute=function(){this.adsManager.setVolume(1),this.adMuted=!1};r.prototype.mute=function(){this.adsManager.setVolume(0),this.adMuted=!0};r.prototype.setVolume=function(t){this.adsManager.setVolume(t),t==0?this.adMuted=!0:this.adMuted=!1};r.prototype.initializeAdDisplayContainer=function(){this.adDisplayContainer&&(this.adDisplayContainerInitialized||(this.adDisplayContainer.initialize(),this.adDisplayContainerInitialized=!0))};r.prototype.playAdBreak=function(){this.autoPlayAdBreaks||(this.controller.showAdContainer(),this.adsManager.setVolume(this.controller.getPlayerVolume()),this.adsManager.start())};r.prototype.addEventListener=function(t,e){this.adsManager&&this.adsManager.addEventListener(t,e)};r.prototype.getAdsManager=function(){return this.adsManager};r.prototype.reset=function(){this.adsActive=!1,this.adPlaying=!1,this.adTrackingTimer&&clearInterval(this.adTrackingTimer),this.adsManager&&(this.adsManager.destroy(),this.adsManager=null),this.adsLoader&&!this.contentCompleteCalled&&this.adsLoader.contentComplete(),this.contentCompleteCalled=!1,this.allAdsCompleted=!1};var s=function(e,i){this.settings={},this.contentAndAdsEndedListeners=[],this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(i);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},l=Object.assign({},n,i.contribAdsSettings||{});this.playerWrapper=new o(e,l,this),this.adUi=new a(this),this.sdkImpl=new r(this)};s.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,prerollTimeout:1e3,preventLateAdStart:!1,requestMode:"onLoad",showControlsForJSAds:!0,timeout:5e3};s.prototype.initWithSettings=function(t){this.settings=Object.assign({},s.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)};s.prototype.warnAboutDeprecatedSettings=function(){var t=this,e=["adWillAutoplay","adsWillAutoplay","adWillPlayMuted","adsWillPlayMuted"];e.forEach(function(i){t.settings[i]!==void 0&&console.warn("WARNING: videojs.ima setting "+i+" is deprecated")})};s.prototype.getSettings=function(){return this.settings};s.prototype.getIsMobile=function(){return this.isMobile};
2s.prototype.getIsIos=function(){return this.isIos};s.prototype.injectAdContainerDiv=function(t){this.playerWrapper.injectAdContainerDiv(t)};s.prototype.getAdContainerDiv=function(){return this.adUi.getAdContainerDiv()};s.prototype.getContentPlayer=function(){return this.playerWrapper.getContentPlayer()};s.prototype.getContentPlayheadTracker=function(){return this.playerWrapper.getContentPlayheadTracker()};s.prototype.requestAds=function(){this.sdkImpl.requestAds()};s.prototype.setSetting=function(t,e){this.settings[t]=e};s.prototype.onErrorLoadingAds=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)};s.prototype.onAdPlayPauseClick=function(){this.sdkImpl.isAdPlaying()?(this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()):(this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds())};s.prototype.onAdMuteClick=function(){this.sdkImpl.isAdMuted()?(this.playerWrapper.unmute(),this.adUi.unmute(),this.sdkImpl.unmute()):(this.playerWrapper.mute(),this.adUi.mute(),this.sdkImpl.mute())};s.prototype.setVolume=function(t){this.playerWrapper.setVolume(t),this.sdkImpl.setVolume(t)};s.prototype.getPlayerVolume=function(){return this.playerWrapper.getVolume()};s.prototype.toggleFullscreen=function(){this.playerWrapper.toggleFullscreen()};s.prototype.onAdError=function(t){this.adUi.onAdError(),this.playerWrapper.onAdError(t)};s.prototype.onAdBreakStart=function(t){this.playerWrapper.onAdBreakStart(),this.adUi.onAdBreakStart(t)};s.prototype.showAdContainer=function(){this.adUi.showAdContainer()};s.prototype.onAdBreakEnd=function(){this.playerWrapper.onAdBreakEnd(),this.adUi.onAdBreakEnd()};s.prototype.onAllAdsCompleted=function(){this.adUi.onAllAdsCompleted(),this.playerWrapper.onAllAdsCompleted()};s.prototype.onAdsPaused=function(){this.adUi.onAdsPaused()};s.prototype.onAdsResumed=function(){this.adUi.onAdsResumed()};s.prototype.onAdPlayheadUpdated=function(t,e,i,n,l){this.adUi.updateAdUi(t,e,i,n,l)};s.prototype.onAdLog=function(t){this.playerWrapper.onAdLog(t)};s.prototype.getCurrentAd=function(){return this.sdkImpl.getCurrentAd()};s.prototype.playContent=function(){this.playerWrapper.play()};s.prototype.onLinearAdStart=function(){this.adUi.onLinearAdStart(),this.playerWrapper.onAdStart()};s.prototype.onNonLinearAdLoad=function(){this.adUi.onNonLinearAdLoad()};s.prototype.onNonLinearAdStart=function(){this.adUi.onNonLinearAdLoad(),this.playerWrapper.onAdStart()};s.prototype.getPlayerWidth=function(){return this.playerWrapper.getPlayerWidth()};s.prototype.getPlayerHeight=function(){return this.playerWrapper.getPlayerHeight()};s.prototype.onAdsReady=function(){this.playerWrapper.onAdsReady()};s.prototype.onPlayerResize=function(t,e){this.sdkImpl.onPlayerResize(t,e)};s.prototype.onContentComplete=function(){this.sdkImpl.onContentComplete()};s.prototype.onNoPostroll=function(){this.playerWrapper.onNoPostroll()};s.prototype.onContentAndAdsCompleted=function(){for(var t in this.contentAndAdsEndedListeners)typeof this.contentAndAdsEndedListeners[t]=="function"&&this.contentAndAdsEndedListeners[t]()};s.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()};s.prototype.onPlayerReadyForPreroll=function(){this.sdkImpl.onPlayerReadyForPreroll()};s.prototype.onAdTimeout=function(){this.sdkImpl.onAdTimeout()};s.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()};s.prototype.onPlayerEnterFullscreen=function(){this.adUi.onPlayerEnterFullscreen(),this.sdkImpl.onPlayerEnterFullscreen()};s.prototype.onPlayerExitFullscreen=function(){this.adUi.onPlayerExitFullscreen(),this.sdkImpl.onPlayerExitFullscreen()};s.prototype.onPlayerVolumeChanged=function(t){this.adUi.onPlayerVolumeChanged(t),this.sdkImpl.onPlayerVolumeChanged(t)};s.prototype.setContentWithAdTag=function(t,e){this.reset(),this.settings.adTagUrl=e||this.settings.adTagUrl,this.playerWrapper.changeSource(t)};s.prototype.setContentWithAdsResponse=function(t,e){this.reset(),this.settings.adsResponse=e||this.settings.adsResponse,this.playerWrapper.changeSource(t)};s.prototype.setContentWithAdsRequest=function(t,e){this.reset(),this.settings.adsRequest=e||this.settings.adsRequest,this.playerWrapper.changeSource(t)};s.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset(),this.adUi.reset()};s.prototype.addContentEndedListener=function(t){this.playerWrapper.addContentEndedListener(t)};s.prototype.addContentAndAdsEndedListener=function(t){this.contentAndAdsEndedListeners.push(t)};s.prototype.setAdBreakReadyListener=function(t){this.sdkImpl.setAdBreakReadyListener(t)};s.prototype.setShowCountdown=function(t){this.adUi.setShowCountdown(t),this.showCountdown=t,this.adUi.countdownDiv.style.display=this.showCountdown?"block":"none"};s.prototype.initializeAdDisplayContainer=function(){this.sdkImpl.initializeAdDisplayContainer()};s.prototype.playAdBreak=function(){this.sdkImpl.playAdBreak()};s.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)};s.prototype.getAdsManager=function(){return this.sdkImpl.getAdsManager()};s.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()};s.prototype.changeAdTag=function(t){this.reset(),this.settings.adTagUrl=t};s.prototype.pauseAd=function(){this.adUi.onAdsPaused(),this.sdkImpl.pauseAds()};s.prototype.resumeAd=function(){this.adUi.onAdsPlaying(),this.sdkImpl.resumeAds()};s.prototype.togglePlayback=function(){this.playerWrapper.togglePlayback()};s.prototype.adsWillAutoplay=function(){return this.settings.adsWillAutoplay!==void 0?this.settings.adsWillAutoplay:this.settings.adWillAutoplay!==void 0?this.settings.adWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay};s.prototype.adsWillPlayMuted=function(){return this.settings.adsWillPlayMuted!==void 0?this.settings.adsWillPlayMuted:this.settings.adWillPlayMuted!==void 0?this.settings.adWillPlayMuted:this.playerWrapper.getPlayerOptions().muted!==void 0?this.playerWrapper.getPlayerOptions().muted:this.playerWrapper.getVolume()==0};s.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var p=function(e,i,n){this.vjsPlayer=e,this.daiController=n,this.vjsControls=this.vjsPlayer.getChild("controlBar"),this.h5Player=null,this.vjsPlayer.on("dispose",this.playerDisposedListener.bind(this)),this.vjsPlayer.on("pause",this.onPause.bind(this)),this.vjsPlayer.on("play",this.onPlay.bind(this)),this.vjsPlayer.on("seeked",this.onSeekEnd.bind(this)),this.vjsPlayer.ready(this.onPlayerReady.bind(this)),this.vjsPlayer.ads||window.console.warn("You may be using a version of videojs-contrib-ads that is not compatible with your version of video.js."),this.vjsPlayer.ads(i)};p.prototype.playerDisposedListener=function(){this.contentEndedListeners=[],this.daiController.onPlayerDisposed()};p.prototype.onPause=function(){this.daiController.isInAdBreak()&&this.vjsControls.show()};p.prototype.onPlay=function(){this.daiController.isInAdBreak()&&this.vjsControls.hide()};p.prototype.onSeekEnd=function(){this.daiController.onSeekEnd(this.vjsPlayer.currentTime())};p.prototype.onPlayerReady=function(){this.h5Player=document.getElementById(this.getPlayerId()).getElementsByClassName("vjs-tech")[0],this.daiController.onPlayerReady()};p.prototype.getStreamPlayer=function(){return this.h5Player};p.prototype.getVjsPlayer=function(){return this.vjsPlayer};p.prototype.getPlayerOptions=function(){return this.vjsPlayer.options_};p.prototype.getPlayerId=function(){return this.vjsPlayer.id()};p.prototype.onAdError=function(t){this.vjsControls.show();var e=t.getError!==void 0?t.getError():t.stack;this.vjsPlayer.trigger({type:"adserror",data:{AdError:e,AdErrorEvent:t}})};p.prototype.onAdBreakStart=function(){this.vjsControls.hide()};p.prototype.onAdBreakEnd=function(){this.vjsControls.show()};p.prototype.reset=function(){this.vjsControls.show()};var h=function(e){this.daiController=e,this.streamPlayer=null,this.vjsPlayer=null,this.streamManager=null,this.uiSettings=new google.ima.dai.api.UiSettings,this.isAdBreak=!1,this.isSnapback=!1,this.snapForwardTime=0,this.timedMetadata,this.metadataLoaded={},this.SOURCE_TYPES={hls:"application/x-mpegURL",dash:"application/d
2ash+xml"}};h.prototype.initImaDai=function(){var t=this;this.streamPlayer=this.daiController.getStreamPlayer(),this.vjsPlayer=this.daiController.getVjsPlayer(),this.createAdUiDiv(),this.daiController.getSettings().locale&&this.uiSettings.setLocale(this.daiController.getSettings().locale),this.streamManager=new google.ima.dai.api.StreamManager(this.streamPlayer,this.adUiDiv,this.uiSettings),this.streamPlayer.addEventListener("pause",this.onStreamPause),this.streamPlayer.addEventListener("play",this.onStreamPlay);var e=[google.ima.dai.api.StreamEvent.Type.LOADED,google.ima.dai.api.StreamEvent.Type.ERROR,google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED,google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED];e.forEach(function(i){t.streamManager.addEventListener(i,t.onStreamEvent.bind(t))}),this.vjsPlayer.textTracks().onaddtrack=this.onAddTrack.bind(this),this.vjsPlayer.trigger({type:"stream-manager",StreamManager:this.streamManager}),this.requestStream()};h.prototype.onAddTrack=function(t){var e=this,i=t.track;i.kind==="metadata"&&(i.mode="hidden",i.addEventListener("cuechange",function(n){var l=k(i.activeCues),g;try{for(l.s();!(g=l.n()).done;){var u=g.value,y={};y[u.value.key]=u.value.data,e.streamManager.onTimedMetadata(y)}}catch(c){l.e(c)}finally{l.f()}}))};h.prototype.createAdUiDiv=function(){var t=document.createElement("div");t.id="ad-ui",t.style.height="calc(100% - 3em)",this.streamPlayer.parentNode.appendChild(t),this.adUiDiv=t};h.prototype.onStreamPause=function(){this.isAdBreak&&(this.adUiDiv.style.display="none")};h.prototype.onStreamPlay=function(){this.isAdBreak&&(this.adUiDiv.style.display="block")};h.prototype.onSeekEnd=function(t){var e=this.daiController.getSettings().streamType;if(e!=="live"){if(this.isSnapback){this.isSnapback=!1;return}var i=this.streamManager.previousCuePointForStreamTime(t);i&&!i.played&&(this.isSnapback=!0,this.snapForwardTime=t,this.vjsPlayer.currentTime(i.start))}};h.prototype.onStreamEvent=function(t){switch(t.type){case google.ima.dai.api.StreamEvent.Type.LOADED:this.loadUrl(t.getStreamData().url);break;case google.ima.dai.api.StreamEvent.Type.ERROR:window.console.warn("Error loading stream, attempting to play backup stream. "+t.getStreamData().errorMessage),this.daiController.onErrorLoadingAds(t),this.daiController.getSettings().fallbackStreamUrl&&this.loadUrl(this.daiController.getSettings().fallbackStreamUrl);break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_STARTED:this.isAdBreak=!0,this.adUiDiv.style.display="block",this.daiController.onAdBreakStart();break;case google.ima.dai.api.StreamEvent.Type.AD_BREAK_ENDED:this.isAdBreak=!1,this.adUiDiv.style.display="none",this.daiController.onAdBreakEnd(),this.snapForwardTime&&this.snapForwardTime>this.vjsPlayer.currentTime()&&(this.vjsPlayer.currentTime(this.snapForwardTime),this.snapForwardTime=0);break}};h.prototype.loadUrl=function(t){this.vjsPlayer.ready((function(){var e=this.daiController.getSettings().streamFormat;this.vjsPlayer.src({src:t,type:this.SOURCE_TYPES[e]});var i=this.daiController.getSettings().bookmarkTime;if(i){var n=this.streamManager.streamTimeForContentTime(i);this.isSnapback=!0,this.vjsPlayer.currentTime(n)}}).bind(this))};h.prototype.requestStream=function(){var t,e=this.daiController.getSettings().streamType;if(e==="vod"?(t=new google.ima.dai.api.VODStreamRequest,t.contentSourceId=this.daiController.getSettings().cmsId,t.videoId=this.daiController.getSettings().videoId):e==="live"?(t=new google.ima.dai.api.LiveStreamRequest,t.assetKey=this.daiController.getSettings().assetKey):window.console.warn("No valid stream type selected"),t.format=this.daiController.getSettings().streamFormat,this.daiController.getSettings().apiKey&&(t.apiKey=this.daiController.getSettings().apiKey),this.daiController.getSettings().authToken&&(t.authToken=this.daiController.getSettings().authToken),this.daiController.getSettings().adTagParameters&&(t.adTagParameters=this.daiController.getSettings().adTagParameters),this.daiController.getSettings().streamActivityMonitorId&&(t.streamActivityMonitorId=this.daiController.getSettings().streamActivityMonitorId),this.daiController.getSettings().omidMode){t.omidAccessModeRules={};var i=this.daiController.getSettings().omidMode;i.FULL&&(t.omidAccessModeRules[google.ima.OmidAccessMode.FULL]=i.FULL),i.DOMAIN&&(t.omidAccessModeRules[google.ima.OmidAccessMode.DOMAIN]=i.DOMAIN),i.LIMITED&&(t.omidAccessModeRules[google.ima.OmidAccessMode.LIMITED]=i.LIMITED)}this.streamManager.requestStream(t),this.vjsPlayer.trigger({type:"stream-request",StreamRequest:t})};h.prototype.onPlayerReady=function(){this.initImaDai()};h.prototype.onPlayerDisposed=function(){this.streamManager&&this.streamManager.reset()};h.prototype.addEventListener=function(t,e){this.streamManager&&this.streamManager.addEventListener(t,e)};h.prototype.getStreamManager=function(){return this.streamManager};h.prototype.reset=function(){this.streamManager&&this.streamManager.reset()};var d=function(e,i){this.inAdBreak=!1,this.settings={},this.isMobile=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i)||navigator.userAgent.match(/Android/i),this.isIos=navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPad/i),this.initWithSettings(i);var n={debug:this.settings.debug,timeout:this.settings.timeout,prerollTimeout:this.settings.prerollTimeout},l=Object.assign({},n,i.contribAdsSettings||{});this.playerWrapper=new p(e,l,this),this.sdkImpl=new h(this)};d.IMA_DEFAULTS={adLabel:"Advertisement",adLabelNofN:"of",debug:!1,disableAdControls:!1,showControlsForJSAds:!0};d.prototype.initWithSettings=function(t){this.settings=Object.assign({},d.IMA_DEFAULTS,t||{}),this.warnAboutDeprecatedSettings(),this.showCountdown=!0,this.settings.showCountdown===!1&&(this.showCountdown=!1)};d.prototype.warnAboutDeprecatedSettings=function(){var t=this,e=[];e.forEach(function(i){t.settings[i]!==void 0&&console.warn("WARNING: videojs.imaDai setting "+i+" is deprecated")})};d.prototype.getSettings=function(){return this.settings};d.prototype.getIsMobile=function(){return this.isMobile};d.prototype.getIsIos=function(){return this.isIos};d.prototype.getStreamPlayer=function(){return this.playerWrapper.getStreamPlayer()};d.prototype.getVjsPlayer=function(){return this.playerWrapper.getVjsPlayer()};d.prototype.requestStream=function(){this.sdkImpl.requestStream()};d.prototype.setSetting=function(t,e){this.settings[t]=e};d.prototype.onErrorLoadingAds=function(t){this.playerWrapper.onAdError(t)};d.prototype.onAdError=function(t){this.playerWrapper.onAdError(t)};d.prototype.onAdBreakStart=function(){this.inAdBreak=!0,this.playerWrapper.onAdBreakStart()};d.prototype.onAdBreakEnd=function(){this.inAdBreak=!1,this.playerWrapper.onAdBreakEnd()};d.prototype.onPlayerDisposed=function(){this.contentAndAdsEndedListeners=[],this.sdkImpl.onPlayerDisposed()};d.prototype.isInAdBreak=function(){return this.inAdBreak};d.prototype.onSeekEnd=function(t){this.sdkImpl.onSeekEnd(t)};d.prototype.onPlayerReady=function(){this.sdkImpl.onPlayerReady()};d.prototype.reset=function(){this.sdkImpl.reset(),this.playerWrapper.reset()};d.prototype.addEventListener=function(t,e){this.sdkImpl.addEventListener(t,e)};d.prototype.getStreamManager=function(){return this.sdkImpl.getStreamManager()};d.prototype.getPlayerId=function(){return this.playerWrapper.getPlayerId()};d.prototype.streamWillAutoplay=function(){return this.settings.streamWillAutoplay!==void 0?this.settings.streamWillAutoplay:!!this.playerWrapper.getPlayerOptions().autoplay};d.prototype.triggerPlayerEvent=function(t,e){this.playerWrapper.triggerPlayerEvent(t,e)};var b=function(e,i){this.controller=new s(e,i),this.addContentAndAdsEndedListener=(function(n){this.controller.addContentAndAdsEndedListener(n)}).bind(this),this.addContentEndedListener=(function(n){this.controller.addContentEndedListener(n)}).bind(this),this.addEventListener=(function(n,l){this.controller.addEventListener(n,l)}).bind(this),this.changeAdTag=(function(n){this.controller.changeAdTag(n)}).bind(this),this.getAdsManager=(function(){return this.controller.getAdsManager()}).bind(this),this.initializeAdDisplayContainer=(function(){this.controller.initializeAdDisplayContainer()}).bind(this),this.pauseAd=(function(){this.controller.pauseAd()}).bind(this),this.playAdBreak=(function(){this.controller.playAdBreak()}).bind(this),this.requestAds=(function(){this.controller.requestAds()}).bind(this),this.resumeAd=(function(){this.controller.resumeAd()}).bind(this),this.setAdBreakReadyListener=(function(n){this.controller.setAdBreakReadyListener(n)}).bind(this),this.setContentWithAdTag=(function(n,l){this.controller.setContentWithAdTag(n,l)}).bind(this),this.setContentWithAdsResponse=(function(n,l){this.controller.setContentWithAdsResponse(n,l)}).bind(this),this.setContentWithAdsRequest=(function(n,l){this.controller.setContentWithAdsRequest(n,l)}).bind(this),this.setShowCountdown=(function(n){this.controller.setShowCountdown(n)}).bind(this)},M=function(e,i){this.controller=new d(e,i),this.streamEndedListener=(function(n){this.controller.addStreamEndedListener(n)}).bind(this),this.addEventListener=(function(n,l){this.controller.addEventListener(n,l)}
2).bind(this),this.getStreamManager=(function(){return this.controller.getStreamManager()}).bind(this)},T=function(e){this.ima=new b(this,e)},w=P(function t(e,i){if(A(this,t),e=e.toLowerCase(),e!=="hls"&&e!=="dash"){window.console.error("VodStream error: incorrect streamFormat.");return}else if(e==="dash"){window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin.");return}else if(typeof i!="string"){window.console.error("assetKey error: value must be string.");return}this.streamFormat=e,this.assetKey=i}),I=P(function t(e,i,n){if(A(this,t),e=e.toLowerCase(),e!=="hls"&&e!=="dash"){window.console.error("VodStream error: incorrect streamFormat.");return}else if(e==="dash"){window.console.error("streamFormat error: DASH streams are notcurrently supported by this plugin.");return}else if(typeof i!="string"){window.console.error("cmsId error: value must be string.");return}else if(typeof n!="string"){window.console.error("videoId error: value must be string.");return}this.streamFormat=e,this.cmsId=i,this.videoId=n}),j=function(e,i){if(e instanceof w)i.streamType="live",i.assetKey=e.assetKey;else if(e instanceof I)i.streamType="vod",i.cmsId=e.cmsId,i.videoId=e.videoId;else{window.console.error("initDai() first parameter must be an instance of LiveStream or VodStream.");return}i.streamFormat=e.streamFormat,this.imaDai=new M(this,i)},C=m.registerPlugin||m.plugin;C("ima",T);C("imaDai",j);export{w as LiveStream,I as VodStream,b as default};
3//# sourceMappingURL=videojs.ima.es-BBTmRBOo.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.