Stay organized with collections
Save and categorize content based on your preferences.
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.
Skippable ads require that your video player play content inline (not fullscreen),
and that you disable custom playback on iPhone. Custom playback is always disabled
on Android Chrome. Modify the simple sample's HTML and JavaScript as follows:
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.
The JavaScript change causes the IMA SDK to use its own video player to play ads,
instead of reusing your content player as it normally would on iPhone.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-21 UTC."],[[["Starting with Chrome 53 and iOS 10, inline video playback and muted autoplay are supported on Android and iPhone."],["This guide provides modifications for the simple sample to enable this functionality, requiring inline video player use for skippable ads and disabling custom playback on iPhones."],["Updates include adding `playsinline` attribute to the video element in HTML and calling `google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true)` in JavaScript."],["These changes ensure content plays inline on iPhone, preventing default fullscreen and utilizing IMA SDK's video player for ad playback instead of the content player."],["Note that fullscreen implementations relying on `videoPlayer.requestFullscreen()` will break with this change as fullscreen with skippable ads on iPhone is currently unsupported by IMA SDK."]]],[]]