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"]],["上次更新時間: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."]]],[]]