Aprender sobre a arquitetura do SDK
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Selecione a plataforma:
HTML5
Android
iOS
tvOS
Este guia oferece uma visão geral do ciclo de vida do SDK e das interações
entre o player de vídeo, o SDK do IMA e um servidor de anúncios.
Interações básicas
O diagrama a seguir ilustra e anota as interações entre o player de vídeo, o SDK do IMA e um servidor de anúncios. O servidor de anúncios pode usar o Ad Manager, o AdSense para vídeo (AFV) ou o Ad Exchange (AdX).

A página da Web ou o app carrega o SDK do IMA usando:
- uma tag de script incorporada para HTML5
- um app para Android, Google Cast, iOS ou tvOS
O SDK do IMA solicita uma resposta VAST para o bloco de anúncios específico no servidor de anúncios. O servidor de anúncios chamado, que pode ser o Ad Manager x AFV ou o AdX, é determinado pelo URL da tag de anúncio.
O servidor de anúncios seleciona o melhor anúncio e envia uma resposta VAST para o SDK do IMA.
Os anúncios são selecionados usando um dos seguintes métodos:
- O Ad Manager filtra os candidatos a item de linha
- O Google AdSense ou o Ad Exchange realiza um leilão
O SDK do IMA analisa a resposta VAST, determina o tipo de mídia correto com base no ambiente e entrega o criativo de vídeo InLine (e anúncios complementares, se necessário) à página da Web ou ao app.
O player de vídeo negocia os detalhes da reprodução com o SDK do IMA e veicula os anúncios.
O SDK do IMA aciona um ping de impressão e eventos de rastreamento do VAST, conforme necessário.
Ciclo de vida
Este diagrama mostra o ciclo de vida completo do SDK IMA. As chamadas de construtor e método são destacadas em azul, os eventos em vermelho e as condições de erro são mostradas com conectores e texto em vermelho.
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-08-31 UTC.
[null,null,["Última atualização 2025-08-31 UTC."],[[["\u003cp\u003eThis guide explains the lifecycle of the Interactive Media Ads (IMA) SDK and how it facilitates communication between your video player, the SDK, and an ad server (Ad Manager, AdSense for Video, or Ad Exchange).\u003c/p\u003e\n"],["\u003cp\u003eThe process involves the IMA SDK requesting ads from the ad server based on the provided ad tag URL, the ad server selecting and sending a VAST response, and the SDK parsing this response to display ads within the video player.\u003c/p\u003e\n"],["\u003cp\u003eThe IMA SDK handles playback negotiation with the video player and manages ad impressions and tracking events for accurate reporting.\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."]]