IMA ad disappears from screen if autoplay is rejected on Shaka Player

311 views
Skip to first unread message

Gustavo Salles

unread,
May 13, 2022, 10:32:40 AM5/13/22
to Interactive Media Ads SDK
You can reproduce this issue here by simply refreshing the page and not interacting with it.
Here's a video showing this behaviour on Chrome 100 (notice how the ad "flashes" in and out of the screen).

With autoplay on, my preroll ad gets an AdError 1205 and disappears from the screen.
I know the browser might reject the promise if the user hasn't interacted yet, but why does it disappear instead of just pausing the ad?

I've opened an issue on Shaka Player's GitHub about this. They told me their implementation simply creates a <div> tag, and it is IMA who inserts the ad.

Additionally, disabling autoplay seems to have no effect on this, since the ad tries to autoplay anyway. To disable it, I've called AdsRequest.setAdWillAutoPlay(false) and set autoplay="false" on my video tag. I'm not sure if that is Shaka's responsibility or if that's an issue with IMA itself.

IMA SDK

unread,
May 17, 2022, 2:56:35 AM5/17/22
to salles....@gmail.com, ima...@googlegroups.com

Hello Gustavo,

 

Michael here from IMA SDK Team. Thank you for reaching out to us.

 

For clarification, the setAdWillAutoPlay is used to ensure that the ad server only returns ads that are allowed to be autoplayed (if set to true).

 

Additionally, some browsers will allow video playback without user interactions if the video is muted. For this behavior, use 

AdsRequest.setAdWillPlayMuted(true) and call this method before AdsManager.start().

 

Lastly, kindly check our Attempt to Autoplay code sample which demonstrates how to attempt to autoplay a video and fall back to click-to-play if autoplay fails. You may find this sample useful when integrating your own implementation.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2ase7y:ref

Gustavo Salles

unread,
May 17, 2022, 11:14:48 AM5/17/22
to Interactive Media Ads SDK
Thank you so much for the response! The code sample solved it.

IMA SDK

unread,
May 19, 2022, 3:50:10 AM5/19/22
to salles....@gmail.com, ima...@googlegroups.com

Hello Gustavo,

 

Thank you for updating us. Glad that the issue has been resolved. Should you encounter any issues with the SDK in the future do not hesitate to come back to us and we will be happy to assist you.

Regards,

Reply all
Reply to author
Forward
0 new messages