تفعيل الإعلانات القابلة للتخطّي على الأجهزة الجوّالة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بدءًا من 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.
تاريخ التعديل الأخير: 2025-08-10 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-10 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eStarting with Chrome 53 and iOS 10, inline video playback and muted autoplay are supported on Android and iPhone.\u003c/p\u003e\n"],["\u003cp\u003eThis 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.\u003c/p\u003e\n"],["\u003cp\u003eUpdates include adding \u003ccode\u003eplaysinline\u003c/code\u003e attribute to the video element in HTML and calling \u003ccode\u003egoogle.ima.settings.setDisableCustomPlaybackForIOS10Plus(true)\u003c/code\u003e in JavaScript.\u003c/p\u003e\n"],["\u003cp\u003eThese 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.\u003c/p\u003e\n"],["\u003cp\u003eNote that fullscreen implementations relying on \u003ccode\u003evideoPlayer.requestFullscreen()\u003c/code\u003e will break with this change as fullscreen with skippable ads on iPhone is currently unsupported by IMA SDK.\u003c/p\u003e\n"]]],[],null,["# Enable skippable ads on mobile\n\nAs of Chrome 53 and iOS 10, Android and iPhone support inline video playback and\nmuted autoplay. This guide walks you through the modifications to the\n[simple sample](//github.com/googleads/googleads-ima-html5/tree/master/simple)\nrequired for this functionality.\n\nSkippable ads require that your video player play content inline (not fullscreen),\nand that you disable custom playback on iPhone. Custom playback is always disabled\non Android Chrome. Modify the simple sample's HTML and JavaScript as follows:\n\n#### index.html\n\n \u003cvideo id=\"contentElement\" playsinline\u003e\n \u003csource src=\"https://storage.googleapis.com/gvabox/media/samples/stock.mp4\"\u003e\n \u003c/video\u003e\n\n#### ads.js\n\n google.ima.settings.setDisableCustomPlaybackForIOS10Plus(true);\n adDisplayContainer =\n new google.ima.AdDisplayContainer(containerElement, contentVideoElement);\n adsLoader = new google.ima.AdsLoader(adDisplayContainer);\n\nThe change to the HTML ensures that your content plays in an inline video player on\niPhone, instead of iPhone's default fullscreen player, and starts in a muted state.\nThe JavaScript change causes the IMA SDK to use its own video player to play ads,\ninstead of reusing your content player as it normally would on iPhone.\n| **Note:** If you have a fullscreen implementation that relies on setting the player to native fullscreen (i.e., calling `videoPlayer.requestFullscreen()`), this change breaks your fullscreen implementation. The IMA SDK does not currently support fullscreen on iPhone with skippable ads. For more information on which features are supported in different configurations, see [New Custom Playback APIs](//ads-developers.googleblog.com/2017/06/new-custom-playback-apis-for-ima-html5.html)."]]