Report continuous play

  • The IMA SDK for tvOS allows you to set the continuousPlayback property on ad requests to indicate if content videos will play continuously, influencing the types of ads returned.

  • Setting continuousPlayback to true signals that videos will play one after another, similar to a TV broadcast, and retrieves ads designated for continuous play.

  • The adWillAutoPlay property determines whether ads will start playing automatically or require user interaction to begin.

  • Refer to the provided table to align continuousPlayback and adWillAutoPlay settings with your specific video content behavior, such as single videos or playlists with autoplay functionality.

Select platform: HTML5 Android iOS tvOS
The IMA SDK for tvOS allows for setting the continuous play context for an ads request. The continuousPlayback property notifies the SDK whether the player intends to continuously play the content videos one after another, similar to a TV broadcast. When set to true, the ads returned from the request are those designated by the ads server as suitable for continuous play. Not specifying a value for this property leaves the setting as unknown. The following sample demonstrates how to set continuous play in an ads request.

Objective-C

IMAAdsRequest *request = [[IMAAdsRequest alloc]
           initWithAdTagUrl:adTagUrl
         adDisplayContainer:[self createAdDisplayContainer]
       avPlayerVideoDisplay:[[IMAAVPlayerVideoDisplay alloc] initWithAVPlayer:self.contentPlayer]
      pictureInPictureProxy:self.pictureInPictureProxy
                userContext:nil];
  request.continuousPlayback = true;
  [self.adsLoader requestAdsWithRequest:request];

Swift

let request = IMAAdsRequest(
    adTagUrl: adTagUrl,
    adDisplayContainer: createAdDisplayContainer(),
    avPlayerVideoDisplay: IMAAVPlayerVideoDisplay(avPlayer: contentPlayer),
    pictureInPictureProxy: pictureInPictureProxy,
    userContext: nil)
request.continuousPlayback = true;
adsLoader!.requestAds(with: request)

How continuous play differs from ad auto-play

The IMA SDK for tvOS also allows for setting whether the player will start playing automatically or wait for user action to begin playing. This is done using the adWillAutoPlay property. When set to true, the ads returned are those designated by the ads server as suitable for an auto-play environment.

This table details when to request ads for continuous play and auto-play, based on the video content the ads are paired with.

Video Content Value for continuousPlayback Value for adWillAutoPlay
A single content video that plays upon user interaction false false
A single content video that autoplays false true
A video playlist that plays the first video upon user interaction but autoplays the following videos true false
A video playlist that autoplays the first video and autoplays the following videos true true