SDK는 광고 서버에서 수신하는 광고 응답에 따라 하나 이상의 모드로 작동할 수 있습니다.
단일 광고
메시지가 IMAAdsManager에 전송될 때 언제든지 재생할 수 있는 광고입니다.start 단일 광고를 재생하는 데는 특별한 초기화가 필요하지 않습니다.
광고 모음
start 메시지가 IMAAdsManager에 전송될 때 연속으로 재생되는 여러 광고 단일 광고 포드를 재생하는 데 특별한 초기화가 필요하지 않습니다.
광고 규칙
특정 콘텐츠에 대해 특정 시간에 예약된 광고 시점 재생목록입니다. start 메시지는 광고 규칙 모드에서 무시됩니다. 하나의 재생목록 내에 여러 광고 시점 (예: 프리롤, 미드롤, 포스트롤)이 예약될 수 있습니다. 자세한 구현 내용은 아래의 광고 규칙 섹션을 참고하세요.
광고 규칙
IMA
tvOS SDK는 완전 자동 광고 재생목록을 지원합니다. 이 기능은 광고를 트래피킹할 때 Google Ad Manager에 지정된 대로 콘텐츠에 광고 시점을 삽입합니다. 또한 프리롤, 미드롤, 포스트롤을 비롯한 광고 시간을 지원하는 데 필요한 동영상 플레이어 코드를 크게 간소화합니다.
Ad Manager에서 광고를 트래피킹할 때 '콘텐츠 시작 시 항상 광고 시점 재생' 또는 '30분마다 1분 광고 시점 재생'과 같은 다양한 광고 규칙을 지정할 수 있습니다.
광고가 요청되면 광고 서버는 광고 재생목록을 반환할 수 있습니다. SDK는 재생목록을 처리하고 지정된 광고 시점을 자동으로 예약합니다.
AdsManager를 초기화할 때 initializeWithContentPlayhead:adsRenderingSettings: 호출을 통해 IMAContentPlayhead 객체가 전달됩니다. AVPlayer를 사용하여 콘텐츠를 표시하는 경우 adDisplayContainer를 만들 때 IMAAVPlayerContentPlayhead 인스턴스를 SDK에 전달합니다. 이 객체는 콘텐츠 재생 진행률을 추적하여 광고 시점이 Ad Manager에 지정된 시간에 자동으로 삽입되도록 하는 데 사용됩니다.
참고: 콘텐츠 재생이 완료되거나 사용자가 재생을 중지한 경우 콘텐츠 재생이 완료되었음을 SDK에 알리기 위해 IMAAdsLoader에서 contentComplete를 호출해야 합니다. 그런 다음 SDK는 예정된 광고 시점이 있는 경우 이를 재생합니다.
ALL_ADS_COMPLETED 이벤트는 모든 광고가 재생되면 발생합니다. 또한 콘텐츠 추적은 IMAAdsManager의 initializeWithContentPlayhead:adsRenderingSettings 메서드가 호출될 때 시작되므로 콘텐츠를 재생하기 전에 항상 initializeWithContentPlayhead:adsRenderingSettings를 호출해야 합니다.
[null,null,["최종 업데이트: 2025-09-06(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,["Select platform: [HTML5](/interactive-media-ads/docs/sdks/html5/client-side/ad-rules \"View this page for the HTML5 platform docs.\") [Android](/interactive-media-ads/docs/sdks/android/client-side/ad-rules \"View this page for the Android platform docs.\") [iOS](/interactive-media-ads/docs/sdks/ios/client-side/ad-rules \"View this page for the iOS platform docs.\") [tvOS](/interactive-media-ads/docs/sdks/tvos/client-side/ad-rules \"View this page for the tvOS platform docs.\")\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\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\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."]]