Pause Ads
What are Pause Ads
Pause Ads display brand messages during natural breaks in playback. When a viewer pauses live or on-demand content, an ad appears on-screen after a brief delay. This format provides a high-visibility, static canvas that integrates naturally with the viewing experience. Pause Ads are effective for driving awareness, shoppability, and branded interactions.
Key Characteristics
- Trigger: The viewer pauses live or on-demand content.
- Delay: The ad appears after approximately 5 seconds.
- Display: A static brand creative fills the screen or appears in a sidebar overlay.
- Resume: Resuming playback automatically dismisses the ad.
Configure ads to appear when the user pauses video. Set up the SDK as described in the tvOS Integration Guide first.
// Call these methods only in response to the Play/Pause button.
func handlePlayingState() {
StreamLayer.stopADBreak()
}
func handlePausedState() {
StreamLayer.startADBreak()
}Delay pause ads
Delay displaying pause ads to avoid brief or accidental pauses. Typically show a pause ad 3–5 seconds after the user pauses playback. If playback doesn’t resume within this window, treat the pause as intentional and start an ad break. The example below schedules the ad after 5 seconds.
Use a DispatchWorkItem to defer the ad break and cancel it when playback resumes.
private var adBreakWorkItem: DispatchWorkItem?
func handlePlayingState() {
StreamLayer.stopADBreak()
adBreakWorkItem?.cancel()
adBreakWorkItem = nil
}
func handlePausedState() {
let adBreakWorkItem = DispatchWorkItem { [weak self] in
guard self?.adBreakWorkItem?.isCancelled == false else { return }
StreamLayer.startADBreak()
}
DispatchQueue.main.asyncAfter(deadline: .now() + 5, execute: adBreakWorkItem)
self.adBreakWorkItem = adBreakWorkItem
}Updated about 1 month ago
