3

What I'm trying to do is to make the autoplay video on ios 10 using HTML5 and I did that using:

<video autoplay loop muted playsinline controls>
    <source src="http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4">
</video>

But when using IMA SDK for HTML5 the ad start unmuted and therefore the autoplay will not work.

Is there a way to mute the ads on start (initialize the ads muted)?

Mustafa Dwaikat
  • 3,392
  • 9
  • 27
  • 41
  • Use the setVolume() method: https://developers.google.com/interactive-media-ads/docs/sdks/html5/v3/apis#ima.AdsManager.setVolume. – andzrev Oct 19 '16 at 19:47

1 Answers1

2

You have to mute AdsManager it after google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED event.

loader = new google.ima.AdsLoader(...);
loader.addEventListener(
    google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
    (event) => {
       event.getAdsManager(videoTag).setVolume(0);
    }
mborecki
  • 162
  • 4
  • 1
    thanks for sharing this, also if there a way to unmute ad when the user clicks on the unmute button? – Jp Mohan Oct 04 '18 at 06:05