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
[null,null,["อัปเดตล่าสุด 2024-10-15 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."]]],[]]