google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true);
adDisplayContainer =
new google.ima.AdDisplayContainer(containerElement, contentVideoElement);
adsLoader = new google.ima.AdsLoader(adDisplayContainer);
对 HTML 所做的更改可确保您的内容可在
iPhone 而不是 iPhone 的默认全屏播放器,并以静音状态启动。
JavaScript 变更会导致 IMA SDK 使用自己的视频播放器来播放广告,
而不必像在 iPhone 上那样重复使用内容播放器
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-10-15。"],[[["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."]]],[]]