بدءًا من 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 إلى استخدام حزمة تطوير البرامج لإعلانات الوسائط التفاعلية لمشغّل الفيديو لتشغيل الإعلانات
بدلاً من إعادة استخدام مشغّل المحتوى كما هو معتاد على iPhone.
تاريخ التعديل الأخير: 2024-10-15 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 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."]]],[]]