How to play audio only ads using Google IMA HTML5

561 Views Asked by At

I'm using Google IMA HTML5 SDK to display audio only ads on my website, I followed this tutorial: https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side But it ends up showing a video player with black screen and playing the audio in the background, what I want to do is to show audio player instead of the video one.

As they claim here: https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/compatibility

The HTML5 SDK supports audio only content.

1

There are 1 best solutions below

0
rabsom On

As detailed here :

The constructor for AdDisplayContainer takes a second argument named videoElement which IMA tracks as the content player. This argument accepts both a or tag. For audio content and ads, this guide recommends using an tag to construct an AdDisplayContainer. If you have video content, you can use a tag for showing a mix of audio and video ads...

Full guide here.