معماری SDK را یاد بگیرید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
پلتفرم را انتخاب کنید: HTML5 Android iOS tvOS این راهنما یک نمای کلی از چرخه عمر SDK و تعاملات بین پخش کننده ویدیوی شما، IMA SDK و سرور تبلیغات ارائه می دهد.
تعاملات اساسی
نمودار زیر تعاملات بین پخش کننده ویدیوی شما، IMA SDK و سرور تبلیغات را نشان می دهد و حاشیه نویسی می کند. سرور آگهی میتواند از Ad Manager، AdSense برای ویدیو (AFV) یا Ad Exchange (AdX) استفاده کند.

صفحه وب یا برنامه IMA SDK را با استفاده از:
- یک تگ اسکریپت جاسازی شده برای HTML5
- یک برنامه برای Android، Google Cast، iOS یا tvOS
IMA SDK یک پاسخ VAST برای واحد تبلیغات خاص در سرور آگهی درخواست میکند. سرور تبلیغ نامیده شده، که می تواند Ad Manager در مقابل AFV یا AdX باشد، توسط URL تگ آگهی تعیین می شود.
سرور تبلیغات بهترین تبلیغ را انتخاب می کند و پاسخ VAST را به IMA SDK ارسال می کند. تبلیغات با استفاده از یکی از روش های زیر انتخاب می شوند:
- واحد تبلیغات Ad Manager نامزدهای مورد خط را فیلتر می کند
- AdSense یا Ad Exchange یک حراج را اجرا می کند
IMA SDK پاسخ VAST را تجزیه میکند، نوع رسانه صحیح را بر اساس محیط تعیین میکند و خلاقیت ویدیوی درون خطی (و در صورت نیاز تبلیغات همراه) را به صفحه وب یا برنامه ارائه میکند.
پخش کننده ویدیو جزئیات پخش را با IMA SDK مذاکره می کند و تبلیغات را پخش می کند.
IMA SDK یک پینگ برداشت و رویدادهای ردیابی VAST را در صورت لزوم اجرا میکند.
چرخه زندگی
این نمودار چرخه عمر کامل IMA SDK را نشان می دهد. فراخوانی سازنده و متد با رنگ آبی، رویدادها با رنگ قرمز برجسته می شوند و شرایط خطا با رابط های قرمز و متن قرمز نشان داده می شوند.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThis guide outlines the lifecycle of the Interactive Media Ads (IMA) SDK and how it interacts with your video player and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting and parsing ad responses, delivering ads to the player, and managing playback and tracking events.\u003c/p\u003e\n"],["\u003cp\u003eAd selection is handled either through Ad Manager's Ad Unit filters or via auctions in AdSense or Ad Exchange.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers integrate the IMA SDK using script tags for HTML5 or dedicated apps for various platforms including Android, iOS, and tvOS.\u003c/p\u003e\n"],["\u003cp\u003eThe guide also highlights potential error conditions within the SDK lifecycle.\u003c/p\u003e\n"]]],[],null,["Select platform: [HTML5](/interactive-media-ads/docs/sdks/html5/client-side/architecture \"View this page for the HTML5 platform docs.\") [Android](/interactive-media-ads/docs/sdks/android/client-side/architecture \"View this page for the Android platform docs.\") [iOS](/interactive-media-ads/docs/sdks/ios/client-side/architecture \"View this page for the iOS platform docs.\") [tvOS](/interactive-media-ads/docs/sdks/tvos/client-side/architecture \"View this page for the tvOS platform docs.\")\n\n\u003cbr /\u003e\n\nThis guide provides an overview of the SDK lifecycle and the interactions\nbetween your video player, the IMA SDK, and an ad server.\n\nBasic interactions\n\nThe following diagram illustrates and annotates the interactions between\nyour video player, the IMA SDK, and an ad server. The ad server can use\nAd Manager, AdSense for Video (AFV), or Ad Exchange (AdX).\n\n1. The web page or app loads the IMA SDK using:\n\n - an embedded script tag for HTML5\n - an app for Android, Google Cast, iOS, or tvOS\n2. The IMA SDK requests a VAST Response for the specific Ad Unit on the ad\n server. The ad server called, which can be either Ad Manager versus AFV or\n AdX, is determined by the ad tag URL.\n\n3. The ad server selects the best ad and sends a VAST response to the IMA SDK.\n Ads are selected using one of the following methods:\n\n - Ad Manager Ad Unit filters Line Item candidates\n - AdSense or Ad Exchange runs an auction\n4. The IMA SDK parses the VAST response, determines the correct media type based\n on environment, and delivers the inline video creative (and\n companion ads if needed) to the web page or app.\n\n5. The video player negotiates the playback details with the IMA SDK and plays\n the ads.\n\n6. The IMA SDK fires an impression ping and VAST tracking events, as needed.\n\nLifecycle\n\nThis diagram shows the full lifecycle of the IMA SDK. Constructor and method\ncalls are highlighted in blue, events are highlighted in red, and error\nconditions are shown with red connectors and red text."]]