Para analizar nuestros productos y proporcionar comentarios sobre ellos, únete al canal oficial de Discord de Ad Manager en el servidor de la Comunidad de Publicidad y Medición de Google.
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Modos de operación del SDK
El SDK puede funcionar en uno o más modos, según la respuesta que reciba del anuncio.
servidor.
Anuncio único
Un anuncio que se puede reproducir en cualquier momento cuando start
el mensaje se envía a IMAAdsManager. Sin inicialización especial
para reproducir un solo anuncio.
Grupo de anuncios
Varios anuncios que se reproducen de manera consecutiva cuando se envía el mensaje start a
el IMAAdsManager. No se necesita una inicialización especial para
reproducir un solo grupo de anuncios.
Reglas de anuncios
Una lista de reproducción de pausas publicitarias programadas en determinados momentos en comparación con determinadas
contenido. El mensaje start se ignora en el modo de reglas de anuncios. Puede
Existen varias pausas publicitarias programadas dentro de una sola playlist (p.ej., anuncios previos al video,
anuncios durante el video o al final del video). Para obtener más detalles sobre la implementación, consulta el
Reglas de anuncios a continuación.
Reglas de anuncios
IMA
El SDK de tvOS admite playlists de anuncios completamente automatizadas. Esta función
Inserta pausas publicitarias en el contenido según se especifica en
Google Ad Manager
cuando coordines anuncios. También simplifica en gran medida el código del reproductor de video
necesarios para respaldar las pausas publicitarias, incluidos los anuncios previos al video, durante el video y al final del video.
Cuando se coordina el tráfico de anuncios en Ad Manager, es posible especificar varias reglas de anuncios
como "Reproducir siempre la pausa publicitaria al comienzo del contenido" o "reproducir una pausa publicitaria de un minuto
cada 30 minutos de contenido".
Cuando se solicitan anuncios, el servidor de anuncios puede mostrar una playlist de anuncios. El SDK
procesa la playlist y programa automáticamente las pausas publicitarias que se han
especificada.
Cuando se inicializa AdsManager, se genera un IMAContentPlayhead
El objeto se pasa a través de initializeWithContentPlayhead:adsRenderingSettings:.
llamada. Si usas AVPlayer para mostrar tu contenido, pasas un
de IMAAVPlayerContentPlayhead al SDK cuando creas tu
adDisplayContainer Este objeto se usa para seguir el progreso de la reproducción de contenido
se insertan automáticamente en los momentos especificados en Ad Manager.
Implementa currentTime para mostrar la hora actual de tu
reproductor de video.
Cambia la llamada de inicialización IMAAdsManager a
usa initializeWithContentPlayhead:self.
La función IMAAdsManagerDelegate
se usa para pausar y reanudar el contenido mientras se reproducen las pausas publicitarias.
Nota: Cuando el contenido se haya terminado de reproducir o
el usuario detuvo la reproducción, asegúrate de llamar a contentComplete
en el IMAAdsLoader para indicarle al SDK que el contenido
ha terminado de reproducirse. Luego, el SDK reproduce la pausa publicitaria al final del video, si se programó una.
El evento ALL_ADS_COMPLETED se genera cuando todas las pausas publicitarias tienen
se reprodujeron. Además, ten en cuenta que el seguimiento de contenido comienza cuando
initializeWithContentPlayhead:adsRenderingSettings de IMAAdsManager
siempre debes llamar a initializeWithContentPlayhead:adsRenderingSettings
antes de reproducir el contenido.
[null,null,["Última actualización: 2025-08-31 (UTC)"],[[["\u003cp\u003eThe tvOS SDK utilizes a WebView for ad requests, parsing responses, tracking, and rendering the ad UI.\u003c/p\u003e\n"],["\u003cp\u003eIt supports various ad formats including single ads, ad pods, and ad rules (playlists of ad breaks).\u003c/p\u003e\n"],["\u003cp\u003eAd rules, managed through Google Ad Manager, allow for automated ad insertion at designated times within the content.\u003c/p\u003e\n"],["\u003cp\u003eThe SDK uses \u003ccode\u003eIMAContentPlayhead\u003c/code\u003e, which integrates with AVPlayer or a custom implementation, to synchronize ad breaks with content playback.\u003c/p\u003e\n"],["\u003cp\u003eUpon content completion, calling \u003ccode\u003econtentComplete\u003c/code\u003e on \u003ccode\u003eIMAAdsLoader\u003c/code\u003e triggers any scheduled post-roll ads and signals the completion of all ads.\u003c/p\u003e\n"]]],[],null,["# Automate ad playlists\n\n| **Note:** The tvOS SDK uses a WebView to load a JavaScript back end. This WebView is used to make ad requests, parse responses, ping tracking URLs, and render the ad UI.\n\nSDK operation modes\n-------------------\n\nThe SDK can operate in one or more modes, depending on the ad response it receives from the ad\nserver.\n\nSingle ad\n: An ad that can be played at any time when the `start`\n message is sent to the `IMAAdsManager`. No special initialization\n is necessary to play a single ad.\n:\n\nAd pod\n: Several ads that play back to back when the `start` message is sent to\n the `IMAAdsManager`. No special initialization is necessary to\n play a single ad pod.\n\nAd rules\n: A playlist of ad breaks scheduled at certain times against particular\n content. The `start` message is ignored in ad rules mode. There can\n be several ad breaks scheduled within a single playlist (e.g., pre-roll,\n mid-roll, post-roll). For further implementation details, see the\n [Ad Rules](#ad-rules) section below.\n\nAd rules\n--------\n\nIMA\ntvOS SDK supports fully automated ad playlists. This feature\ninserts ad breaks into the content as specified in\n[Google Ad Manager](//admanager.google.com/)\nwhen trafficking your ads. It also greatly simplifies the video player code\nnecessary to support ad breaks, including pre-rolls, mid-rolls, and post-rolls.\n\n- When trafficking ads in Ad Manager, it is possible to specify various ad rules like \"always play ad break at the beginning of the content\" or \"play a one-minute ad break every 30 minutes of content\".\n- When ads are requested, the ad server can return an ad playlist. The SDK processes the playlist and automatically schedules the ad breaks that have been specified.\n- When initializing the `AdsManager`, an `IMAContentPlayhead` object is passed in via the `initializeWithContentPlayhead:adsRenderingSettings:` call. If you are using an AVPlayer to display your content, you pass an instance of `IMAAVPlayerContentPlayhead` to the SDK when you create your `adDisplayContainer`. This object is used to track the progress of the content playback so ad breaks are automatically inserted at the times specified in Ad Manager. \n\n **With AVPlayer:** \n\n ```objective-c\n IMAContentPlayhead *contentPlayhead =\n [[IMAAVPlayerContentPlayhead alloc] initWithAVPlayer:self.contentAVPlayer];\n IMAAdsRequest *request = [[IMAAdsRequest alloc] initWithAdTagUrl:adTagUrl\n adDisplayContainer:adDisplayContainer\n contentPlayhead:contentPlayhead\n userContext:nil];\n ```\n\n **Without AVPlayer:**\n 1. Implement the `IMAContentPlayhead` interface.\n 2. Implement `currentTime` to return the current time of your video player.\n 3. Change the `IMAAdsManager` initialization call to use `initializeWithContentPlayhead:self`.\n- The [IMAAdsManagerDelegate](/interactive-media-ads/docs/sdks/tvos/client-side/reference/Protocols/IMAAdsManagerDelegate) is used to pause and resume the content as ad breaks are played.\n\n**Note:** When the content has finished playing or\nthe user has stopped playback, be sure to call `contentComplete`\non the `IMAAdsLoader` in order to signal to the SDK that the content\nhas finished playing. The SDK then plays the post-roll ad break, if one has been scheduled.\nThe `ALL_ADS_COMPLETED` event is raised when all ad breaks have\nbeen played. In addition, note that content tracking begins when\n`IMAAdsManager`'s `initializeWithContentPlayhead:adsRenderingSettings`\nmethod is called and you should always call `initializeWithContentPlayhead:adsRenderingSettings`\nbefore playing content."]]