החל מ-Chrome 53 ו-iOS 10, Android ו-iPhone תומכים בהפעלת סרטונים מוטבעים וגם
הפעלה אוטומטית מושתקת. המדריך הזה מסביר איך לבצע את השינויים
דוגמה פשוטה
שנדרש לפונקציונליות הזו.
כדי להשתמש במודעות ניתנות לדילוג, נגן הווידאו שלך יפעיל תוכן בתוך השורה (לא במסך מלא),
ולהשבית את ההפעלה המותאמת אישית ב-iPhone. הפעלה בהתאמה אישית תמיד מושבתת
ב-Android Chrome. משנים את ה-HTML וה-JavaScript של הדוגמה הפשוטה באופן הבא:
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."]]],[]]