As of Chrome 53 and iOS 10, Android and iPhone support inline video playback and muted autoplay. This guide walks you through the modifications to the simple sample required for this functionality.
<video id="contentElement" playsinline> <source src="https://s0.2mdn.net/4253510/google_ddm_animation_480P.mp4"></source> <source src="https://s0.2mdn.net/4253510/google_ddm_animation_480P.webm"></source> </video>
google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true); adDisplayContainer = new google.ima.AdDisplayContainer(containerElement, contentVideoElement); adsLoader = new google.ima.AdsLoader(adDisplayContainer);
The change to the HTML ensures that your content plays in an inline video player on
iPhone, instead of iPhone's default fullscreen player, and starts in a muted state.
instead of reusing your content player as it normally would on iPhone.
If you have a fullscreen implementation that relies on setting the player to native
fullscreen (i.e., calling
videoPlayer.requestFullscreen()), this change
will break your fullscreen implementation. We do not currently support
fullscreen on iPhone with skippable ads. For more information on which features are
supported in our different configurations, see our
New Custom Playback APIs