How can I use pause and resume google.ima.AdsManager functions

1,048 views
Skip to first unread message

Arun Kumar

unread,
May 12, 2021, 11:01:54 AM5/12/21
to Interactive Media Ads SDK
Hi Team,

I'm Using Videojs Player with google ima SDK and confused how can I pause and resume the ads.

Actually, I'm using an event where I pause my player with player.pause(); but it only pauses the player not ads. and I can't find how can use the google.ima.AdsManager pause functions to pause the current running ads.


Regards 
@run Kumar

IMA SDK

unread,
May 12, 2021, 12:53:44 PM5/12/21
to arunkum...@gmail.com, ima...@googlegroups.com
Hi Arun,

You can get support for that from IMA Plugin for VideoJS. This forum supports native integrations. In the native Advanced Sample App (download all native samples),  in the ads.js file, if you add in the function 'Ads.prototype.onAdEvent_ = function(adEvent)' the following 'else if'':

else if (adEvent.type == google.ima.AdEvent.Type.FIRST_QUARTILE) {
this.adsManager_.pause();
}

the ad pauses by first quartile event.

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 
 

ref:_00D1U1174p._5004Q2HALB4:ref

Arun Kumar

unread,
May 13, 2021, 4:01:06 AM5/13/21
to Interactive Media Ads SDK
Thanks for the reply, As in the advanced example of Ima HTML SDK you are using html5 player but here I'm using videojs library for using Ima Ads and I'm can't find out how can i use the adsManager function, I tried with from 

player.on('ads-manager', function(response){ 
  var adsManager = response.adsManager;
// Your code in response to the `ads-manager` event. 
 adsManager.pause();
}) 
and 
google.ima.AdsManager.pause();

But getting adsManager and pause function is not defined.

Hope you understand my query.

IMA SDK

unread,
May 13, 2021, 8:55:35 AM5/13/21
to arunkum...@gmail.com, ima...@googlegroups.com
Hi Arun,

This forum only supports native implementations of the IMA SDK. You can get support for the VideoJS IMA Plugin from IMA Plugin for VideoJS

With that being said, you can sneak a peek at their sample implementations by checking in devtools network tab how their sample implementations of the plugin are wired up.
Reply all
Reply to author
Forward
0 new messages