adsManager.init(stage.stageWidth, stage.stageHeight, ViewModes.NORMAL);
private function adLoadedHandler(event:AdEvent):void { // A linear ad had loaded. It's time to remove spinner animation. if (!_autoPlayAdBreaks && _adtimeout) { adsManager.stop(); }}
private function contentPauseRequestedHandler(event:AdEvent):void { //we haven't timed out always start it if (!_adtimeout) { playerCall('ads.startLinearAdMode'); adPlayerTrigger('play'); }}
private function adBreakReadyHandler(event:AdEvent):void { //If we've timed out, don't start the adManager and ignore the ad all-together. if(adtimeout) { console('adBreakReadyHandler: skipping preroll ad due to timeout, not starting ads manager'); return; } adsManager.start();}try { player.ima3.adsManager.init(player.width(), player.height(), ima.ViewMode.NORMAL);} catch (adError) { player.trigger('adserror');}
adBreakReadyHandler = function(event) { // if this is not a pre-roll or the timeout has not expired, play it immediately. if (adtimeout) { console.log('Skipping preroll ad because the timeout has elapsed and autoPlayAdBreaks was set false.'); console.log('Set autoPlayAdBreaks true if you want prerolls to always play.'); } else { try { player.ima3.adsManager.start(); } catch (adError) { player.trigger('adserror'); } }};
contentPauseRequestedHandler function(event) { //If we are not autoplaying ad breaks and the ad has timed out, //stop the adManager to skip it. if (!player.ima3.adsLoader.getSettings().isAutoPlayAdBreak() && adstimeout) { player.ima3.adsManager.stop(); } else { player.ads.startLinearAdMode(); }});Pauses the current ad that is playing. This function will be no-op when a static overlay is being shown or if the ad is not loaded yet or is done playing.
Stop playing the ads. Calling this will get publisher back to the content.