Disable autoplay of video Ad

679 views
Skip to first unread message

Raunak Yadav

unread,
Jul 20, 2018, 5:10:32 AM7/20/18
to Interactive Media Ads SDK
Hi,

Data :
 SDK : Android, v3.8.7
 Tag: sample tags from IMA
 
(Scenario : I have added a mediaplayer between two paragraphs of an article. So depending on length of first paragraph, the video may not be in viewable area)

We are rendering our direct sold inventory via IMA sdk. But as soon as AdsManager.init() is called, media is loaded and video autoplay starts.
I want to break this into two. Just load the media and call play only when my mediaplayer is on screen.
I am using an exoplayer for custom playback. But not allowing the  player to play ad initially is causing ALL_ADS_COMPLETE to trigger in sometime.

Please suggest a solution.
Thanks



ima-sdk-adv...@google.com

unread,
Jul 20, 2018, 3:08:48 PM7/20/18
to ima...@googlegroups.com
Hi,

Thank you for reaching out to support. Are you using VMAP ad tags? The Android SDK will start VMAP ad breaks automatically without waiting for the call to adsManager.start (link). To disable this behavior, I would suggest using manual ad break playback.

Regards,
Chris Feldman
IMA SDK Team

--
You received this message because you are subscribed to the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ima-sdk+unsubscribe@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.

Raunak Yadav

unread,
Jul 23, 2018, 2:50:05 AM7/23/18
to Interactive Media Ads SDK
Hello Chris,

I am not using VMAP. Using Single Inline Linear ad from IMA samples.

 I do call adsManager.start() on AD_LOADED event and understand this is what must be loading the media and causing the autoplay. Problem is that AD_LOADED event is only for Vast load success and not media load event. I am just looking for a way to be ready with media but play it only later when I require.

ima-sdk-adv...@google.com

unread,
Jul 23, 2018, 12:16:20 PM7/23/18
to ima...@googlegroups.com
Hi,

Once LOADED has fired, you can wait to call adsManager.start() for as long as you need. It is not required to call start in the LOADED callback.

Regards,
Chris Feldman
IMA SDK Team

Raunak Yadav

unread,
Jul 24, 2018, 1:32:12 AM7/24/18
to Interactive Media Ads SDK
Yes, of course I can call adsManager.start() some time later but that will mean that media file load will start only after that. Have I got this right?

If yes, then delaying will give me no advantage as when player comes into view, it will show loader. I want media to be ready in advance and playable later.

ima-sdk-adv...@google.com

unread,
Jul 24, 2018, 3:14:01 PM7/24/18
to ima...@googlegroups.com
Hi,

I have a better understanding now of what you're trying to do. If you'd like to begin loading your media on init instead of start, you can enable preloading via setEnablePreloading on your adsRenderingSettings object. For more information, you can check out our preloading guide (link). That guide focuses on HTML5, but you should be able to apply the same concepts to Android.

Regards,
Chris Feldman
IMA SDK Team

Raunak Yadav

unread,
Jul 31, 2018, 6:26:47 AM7/31/18
to Interactive Media Ads SDK
Hi Chris,

Method setEnablePreloading worked perfectly.

Till now my implementation was to autoplay the ad and it works well. But now I am also giving click-to-play setting. In this case, I am listening for the TAPPED event to call adsManager.start(). But I do not receive TAPPED event at all on clicking the mediaPlayer. Is it a bug that TAPPED event will be called only after the ad starts playing?

Please help.

ima-sdk-adv...@google.com

unread,
Jul 31, 2018, 1:08:08 PM7/31/18
to ima...@googlegroups.com
Hi,

The TAPPED event will trigger when a non-clickable portion of an ad is pressed. This cannot trigger before an ad is visible. I would recommend adding a play button to your layout and wiring it up to your adsManager.start() call.

Regards,
Chris Feldman
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages