IMAAdsRequest Class Reference

IMAAdsRequest Class Reference

Overview

Data class describing the ad request.

Inherits NSObject.

Instance Methods

(instancetype) - initWithAdsResponse:adDisplayContainer:contentPlayhead:userContext:
 Initializes an ads request instance with the given canned ads response and ad display container. More...
 
(instancetype) - initWithAdTagUrl:adDisplayContainer:contentPlayhead:userContext:
 Initializes an ads request instance with the given ad tag URL and ad display container. More...
 
(instancetype) - NS_UNAVAILABLE
 :nodoc: More...
 

Properties

NSString * adTagUrl
 Specifies the full URL to use for ads loading from an ad server. More...
 
NSString * adsResponse
 Specifies a VAST, VMAP, or ad rules response to be used instead of making a request via an ad tag URL. More...
 
UIView * adDisplayContainer
 The ad display container. More...
 
id userContext
 The user context. More...
 
BOOL adWillAutoPlay
 Specifies whether the player intends to start the content and ad in response to a user action or whether they will be automatically played. More...
 
BOOL adWillPlayMuted
 Specifies whether the player intends to start the content and ad with no volume. More...
 
float contentDuration
 Specifies the duration of the content in seconds to be shown. More...
 
NSArray< NSString * > * contentKeywords
 Specifies the keywords used to describe the content to be shown. More...
 
NSString * contentTitle
 Specifies the title of the content to be shown. More...
 
float vastLoadTimeout
 Specifies the VAST load timeout in milliseconds for the initial request and any subsequent wrappers. More...
 
float liveStreamPrefetchSeconds
 Specifies the maximum amount of time to wait in seconds, after calling requestAds, before requesting the ad tag URL. More...
 

Method Documentation

- (instancetype) initWithAdsResponse: (NSString *)  adsResponse
adDisplayContainer: (UIView *)  adDisplayContainer
contentPlayhead: (NSObject< IMAContentPlayhead > *)  contentPlayhead
userContext: (id)  NS_DESIGNATED_INITIALIZER 

Initializes an ads request instance with the given canned ads response and ad display container.

Serial ad requests may reuse the same IMAAdDisplayContainer by first calling [IMAAdsManager destroy] on its current adsManager. Concurrent requests must use different ad containers. Does not support Picture-in-Picture.

Parameters
adsResponsethe canned ads response
adDisplayContainerthe IMAAdDisplayContainer for rendering the ad UI
contentPlayheadthe IMAContentPlayhead for the content player (optional)
userContextthe user context for tracking requests (optional)
Returns
the IMAAdsRequest instance
- (instancetype) initWithAdTagUrl: (NSString *)  adTagUrl
adDisplayContainer: (UIView *)  adDisplayContainer
contentPlayhead: (NSObject< IMAContentPlayhead > *)  contentPlayhead
userContext: (id)  NS_DESIGNATED_INITIALIZER 

Initializes an ads request instance with the given ad tag URL and ad display container.

Serial ad requests may reuse the same IMAAdDisplayContainer by first calling [IMAAdsManager destroy] on its current adsManager. Concurrent requests must use different ad containers. Does not support Picture-in-Picture.

Parameters
adTagUrlthe ad tag URL
adDisplayContainerthe IMAAdDisplayContainer for rendering the ad UI
contentPlayheadthe IMAContentPlayhead for the content player (optional)
userContextthe user context for tracking requests (optional)
Returns
the IMAAdsRequest instance
- (instancetype) NS_UNAVAILABLE

:nodoc:

Property Documentation

- (NSString*) adTagUrl
readnonatomiccopy

Specifies the full URL to use for ads loading from an ad server.

Required for any adsRequest. For details on constructing the ad tag url, see Create a master video tag manually.

- (NSString*) adsResponse
readnonatomiccopy

Specifies a VAST, VMAP, or ad rules response to be used instead of making a request via an ad tag URL.

This can be useful for debugging and other situations in which an ad response is already available.

- (UIView*) adDisplayContainer
readnonatomicstrong

The ad display container.

- (id) userContext
readnonatomicstrong

The user context.

- (BOOL) adWillAutoPlay
readwritenonatomicassign

Specifies whether the player intends to start the content and ad in response to a user action or whether they will be automatically played.

Changing this setting will have no impact on ad playback.

- (BOOL) adWillPlayMuted
readwritenonatomicassign

Specifies whether the player intends to start the content and ad with no volume.

Changing this setting will have no impact on ad playback.

- (float) contentDuration
readwritenonatomicassign

Specifies the duration of the content in seconds to be shown.

Used in AdX requests. This parameter is optional.

- (NSArray<NSString *>*) contentKeywords
readwritenonatomiccopy

Specifies the keywords used to describe the content to be shown.

Used in AdX requests. This parameter is optional.

- (NSString*) contentTitle
readwritenonatomiccopy

Specifies the title of the content to be shown.

Used in AdX requests. This parameter is optional.

- (float) vastLoadTimeout
readwritenonatomicassign

Specifies the VAST load timeout in milliseconds for the initial request and any subsequent wrappers.

This parameter is optional and will override the default timeout.

- (float) liveStreamPrefetchSeconds
readwritenonatomicassign

Specifies the maximum amount of time to wait in seconds, after calling requestAds, before requesting the ad tag URL.

This can be used to stagger requests during a live-stream event, in order to mitigate spikes in the number of requests.

Send feedback about...

IMA Client-Side SDK for tvOS
Need help? Visit our support page.