<FWContext > Protocol Reference

Protocol for AdManager context. More...

#import <FWProtocols.h>

+ Inheritance diagram for <FWContext >:

Instance Methods

(void) - setVideoDisplayBase:
 Set video display base UIView. More...
 
(void) - setMoviePlayerFullscreen:
 The API is no longer required. More...
 
(void) - setMoviePlayerController:
 
(BOOL) - setCapability::
 
(BOOL) - setCapability:status:
 Set the capabilities supported by the player. More...
 
(void) - addKeyValue::
 
(void) - addValue:forKey:
 Add a key-value pair to ad request. More...
 
(void) - setProfile::::
 
(void) - setPlayerProfile:defaultTemporalSlotProfile:defaultVideoPlayerSlotProfile:defaultSiteSectionSlotProfile:
 Set the profiles names. More...
 
(void) - setVisitor::::
 
(void) - setVisitorId:ipV4Address:bandwidth:bandwidthSource:
 Set the attributes of the visitor. More...
 
(void) - setVisitorHttpHeader::
 
(void) - setVisitorHTTPHeader:withValue:
 Set the HTTP headers of the visitor. More...
 
(void) - setVideoAsset:::::::::
 
(void) - setVideoAssetId:idType:duration:durationType:location:autoPlayType:videoPlayRandom:networkId:fallbackId:
 Set the attributes of the current video asset. More...
 
(void) - setVideoAssetCurrentTimePosition:
 Set the current time position of the content asset. More...
 
(void) - setSiteSection:::::
 
(void) - setSiteSectionId:idType:pageViewRandom:networkId:fallbackId:
 Set the attributes of the site section. More...
 
(void) - addCandidateAd:
 
(void) - addCandidateAdId:
 Add candidate ads into the ad request. More...
 
(void) - addTemporalSlot:::::::::
 
(void) - addTemporalSlot:adUnit:timePosition:slotProfile:cuePointSequence:minDuration:maxDuration:acceptPrimaryContentType:acceptContentType:
 Add a temporal slot. More...
 
(void) - addVideoPlayerNonTemporalSlot::::::::::
 
(void) - addVideoPlayerNonTemporalSlot:adUnit:width:height:slotProfile:acceptCompanion:initialAdOption:acceptPrimaryContentType:acceptContentType:compatibleDimensions:
 Add a video player non-temporal slot. More...
 
(void) - addSiteSectionNonTemporalSlot::::::::::
 
(void) - addSiteSectionNonTemporalSlot:adUnit:width:height:slotProfile:acceptCompanion:initialAdOption:acceptPrimaryContentType:acceptContentType:compatibleDimensions:
 Add a site section non-temporal slot. More...
 
(void) - setVideoState:
 Set the current state of the video. More...
 
(void) - setVideoPlayheadTime:
 Set playhead time of the content video. More...
 
(NSArray */*id< FWSlot > */) - temporalSlots
 Get all temporal slots. More...
 
(NSArray */*id< FWSlot > */) - videoPlayerNonTemporalSlots
 Get all video player non-temporal slots. More...
 
(NSArray */*id< FWSlot > */) - siteSectionNonTemporalSlots
 Get all site section non-temporal slots. More...
 
(NSArray */*id< FWSlot > */) - getSlotsByTimePositionClass:
 Get all slots in specified time position class. More...
 
(id< FWSlot >) - getSlotByCustomId:
 Get a slot by its custom ID. More...
 
(void) - submitRequest:
 
(void) - submitRequestWithTimeout:
 Submit the request to FreeWheel Ad Server. More...
 
(void) - addRendererClass:forContentType:creativeAPI:slotType:baseUnit:adUnit:withParameters:
 Add renderer class to context which takes higher priority than renderers set in renderer manifest returned from server. More...
 
(void) - setParameter:withValue:forLevel:
 Set a parameter on a specified level. More...
 
(id) - getParameter:
 Retrieve a parameter. More...
 
(void) - setVideoDisplayCompatibleSizes:
 Set a list of acceptable alternative dimensions. More...
 
(void) - setRequestMode:
 Set request mode of AdManager. More...
 
(void) - setRequestDuration:
 Set the duration for which the player is requesting ads. More...
 
(void) - resetExclusivity
 Reset the exclusivity scope. More...
 
(void) - startSubsession:
 
(void) - startSubsessionWithToken:
 Start a subsession in live mode. More...
 
(NSString *) - getVideoLocation
 Get video asset's location URL. More...
 
(id< FWAdManager >) - getAdManager
 Get the AdManager instance for this context. More...
 
(NSNotificationCenter *) - notificationCenter
 Return the object [NSNotificationCenter defaultCenter]. More...
 
(void) - notifyUserAction:
 Notify AdManager about user actions. More...
 
(void) - loadExtension:
 Load player extension by its class name. More...
 
(void) - requestTimelinePause
 Request timeline to pause. More...
 
(void) - requestTimelineResume
 Request timeline to resume. More...
 
(NSString *) - transactionId
 

Detailed Description

Protocol for AdManager context.

Method Documentation

- (void FWContext) addCandidateAd: (NSUInteger)  DEPRECATED_ATTRIBUTE
- (void FWContext) addCandidateAdId: (NSUInteger)  candidateAdId

Add candidate ads into the ad request.

Parameters
candidateAdIdid of the candidate ad
- (void FWContext) addKeyValue: (NSString *)  key
: (NSString *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) addRendererClass: (NSString *)  className
forContentType: (NSString *)  contentType
creativeAPI: (NSString *)  creativeAPI
slotType: (NSString *)  slotType
baseUnit: (NSString *)  baseAdUnit
adUnit: (NSString *)  soldAsAdUnit
withParameters: (NSDictionary *)  parameters 

Add renderer class to context which takes higher priority than renderers set in renderer manifest returned from server.

Parameters
classNameThe class name of the renderer.
contentTypeThe content types that the renderer can support, separated by comma.
creativeAPIThe creative APIs that the renderer can support, separated by comma.
slotTypeThe slot types that the renderer can support, separated by comma.
baseAdUnitThe base ad units that the renderer can support, separated by comma.
soldAsAdUnitThe soldAs ad unit that the renderer can support, separated by comma.
parametersThe parameters set on renderer level.
- (void FWContext) addSiteSectionNonTemporalSlot: (NSString *)  customId
: (NSString *)  adUnit
: (NSUInteger)  width
: (NSUInteger)  height
: (NSString *)  slotProfile
: (BOOL)  acceptCompanion
: (FWInitialAdOption)  initialAdOption
: (NSString *)  acceptPrimaryContentType
: (NSString *)  acceptContentType
: (NSArray *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) addSiteSectionNonTemporalSlot: (NSString *)  customId
adUnit: (NSString *)  adUnit
width: (NSUInteger)  width
height: (NSUInteger)  height
slotProfile: (NSString *)  slotProfile
acceptCompanion: (BOOL)  acceptCompanion
initialAdOption: (FWInitialAdOption)  initialAdOption
acceptPrimaryContentType: (NSString *)  acceptPrimaryContentType
acceptContentType: (NSString *)  acceptContentType
compatibleDimensions: (NSArray *)  compatibleDimensions 

Add a site section non-temporal slot.

Parameters
customIdcustom ID of the slot. If slot with specified ID already exists, the function call will be ignored.
adUnitad unit supported by the slot
widthwidth of the slot
heightheight of the slot
slotProfileprofile name of the slot, nil by default
acceptCompanionwhether companion ads are accepted
initialAdOptionchoice of the initial ad in this slot, should be one of
  • FW_SLOT_OPTION_INITIAL_AD_STAND_ALONE: Display a new ad in this slot
  • FW_SLOT_OPTION_INITIAL_AD_KEEP_ORIGINAL: Keep the original ad in this slot
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_ONLY: Ask ad server to fill this slot with the first companion ad, or keep the original ad if there is no companion ad available
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, or display a new ad if there is no companion ad available
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_THEN_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, or display a new stand alone ad if there is no companion ad
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, but never deliver a stand alone ad if there is no companion ad
  • FW_SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE: Ask ad server to fill this slot only with the PREROLL slot’s companion ad if there is one
  • FW_SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE_IF_TEMPORAL: Ask ad server to fill this slot with a stand alone ad only when no temporal ad will be delivered, if there is any temporal ad selected, let this slot empty
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE_IF_TEMPORAL Ask ad server to fill this slot with a stand alone ad only when no temporal ad will be delivered, if there is any temporal ad selected, let this slot empty, but if there is companion, can use this companion to initial this slot
acceptPrimaryContentTypeaccepted primary content types, comma separated values, use "," as delimiter, nil by default
acceptContentTypeaccepted content types, comma separated values, use "," as delimiter, nil by default
compatibleDimensionsan array of compatible dimensions, The dimension must be a NSDictionary object with key @'width' and @'height', the value of should be a positive integer. Examples:
  • NSArray *keys = [NSArray arrayWithObjects:"width", @"height", nil];
  • NSArray *dimension1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1980], [NSNumber numberWithInt:1080], nil];
  • NSArray *dimension2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1280], [NSNumber numberWithInt:720], nil];
  • NSArray *myDimensions = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjects:dimension1 forKeys:keys], [NSDictionary dictionaryWithObjects:dimension2 forKeys:keys], nil];
- (void FWContext) addTemporalSlot: (NSString *)  customId
: (NSString *)  adUnit
: (NSTimeInterval)  timePosition
: (NSString *)  slotProfile
: (NSUInteger)  cuePointSequence
: (NSTimeInterval)  maxDuration
: (NSString *)  acceptPrimaryContentType
: (NSString *)  acceptContentType
: (NSTimeInterval)  DEPRECATED_ATTRIBUTE 
- (void FWContext) addTemporalSlot: (NSString *)  customId
adUnit: (NSString *)  adUnit
timePosition: (NSTimeInterval)  timePosition
slotProfile: (NSString *)  slotProfile
cuePointSequence: (NSUInteger)  cuePointSequence
minDuration: (NSTimeInterval)  minDuration
maxDuration: (NSTimeInterval)  maxDuration
acceptPrimaryContentType: (NSString *)  acceptPrimaryContentType
acceptContentType: (NSString *)  acceptContentType 

Add a temporal slot.

Parameters
customIdcustom ID of the slot. If slot with specified ID already exists, the function call will be ignored.
adUnitad unit supported by the slot
timePositiontime position of the slot
slotProfileprofile name of the slot, nil by default
cuePointSequenceslot cue point sequence
minDurationminimum duration of the slot allowed, 0 by default
maxDurationmaximum duration of the slot allowed, 0 by default
acceptPrimaryContentTypeaccepted primary content types, comma separated values, use "," as delimiter, nil by default
acceptContentTypeaccepted content types, comma separated values, use "," as delimiter, nil by default
- (void FWContext) addValue: (NSString *)  value
forKey: (NSString *)  key 

Add a key-value pair to ad request.

The key-value pair is used in ad targeting. If called with the same key multiple times, all the values will be added to the same key.

Parameters
keykey of the key-value pair, NSString. Can not be nil or empty
valuevalue of the key-value pair, NSString. Can not be nil
- (void FWContext) addVideoPlayerNonTemporalSlot: (NSString *)  customId
: (NSString *)  adUnit
: (NSUInteger)  width
: (NSUInteger)  height
: (NSString *)  slotProfile
: (BOOL)  acceptCompanion
: (FWInitialAdOption)  initialAdOption
: (NSString *)  acceptPrimaryContentType
: (NSString *)  acceptContentType
: (NSArray *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) addVideoPlayerNonTemporalSlot: (NSString *)  customId
adUnit: (NSString *)  adUnit
width: (NSUInteger)  width
height: (NSUInteger)  height
slotProfile: (NSString *)  slotProfile
acceptCompanion: (BOOL)  acceptCompanion
initialAdOption: (FWInitialAdOption)  initialAdOption
acceptPrimaryContentType: (NSString *)  acceptPrimaryContentType
acceptContentType: (NSString *)  acceptContentType
compatibleDimensions: (NSArray *)  compatibleDimensions 

Add a video player non-temporal slot.

Parameters
customIdcustom ID of the slot. If slot with specified ID already exists, the function call will be ignored.
adUnitad unit supported by the slot
widthwidth of the slot
heightheight of the slot
slotProfileprofile name of the slot, nil by default
acceptCompanionwhether companion ads are accepted
initialAdOptionchoice of the initial ad in this slot, should be one of
  • FW_SLOT_OPTION_INITIAL_AD_STAND_ALONE: Display a new ad in this slot
  • FW_SLOT_OPTION_INITIAL_AD_KEEP_ORIGINAL: Keep the original ad in this slot
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_ONLY: Ask ad server to fill this slot with the first companion ad, or keep the original ad if there is no companion ad available
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, or display a new ad if there is no companion ad available
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_THEN_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, or display a new stand alone ad if there is no companion ad
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE: Ask ad server to fill this slot with the first companion ad, but never deliver a stand alone ad if there is no companion ad
  • FW_SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE: Ask ad server to fill this slot only with the PREROLL slot’s companion ad if there is one
  • FW_SLOT_OPTION_INITIAL_AD_NO_STAND_ALONE_IF_TEMPORAL: Ask ad server to fill this slot with a stand alone ad only when no temporal ad will be delivered, if there is any temporal ad selected, let this slot empty
  • FW_SLOT_OPTION_INITIAL_AD_FIRST_COMPANION_OR_NO_STAND_ALONE_IF_TEMPORAL Ask ad server to fill this slot with a stand alone ad only when no temporal ad will be delivered, if there is any temporal ad selected, let this slot empty, but if there is companion, can use this companion to initial this slot
acceptPrimaryContentTypeaccepted primary content types, comma separated values, use "," as delimiter, nil by default
acceptContentTypeaccepted content types, comma separated values, use "," as delimiter, nil by default
compatibleDimensionsan array of compatible dimensions, The dimension must be a NSDictionary object with key @'width' and @'height', the value of should be a positive integer. Examples:
  • NSArray *keys = [NSArray arrayWithObjects:"width", @"height", nil];
  • NSArray *dimension1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1980], [NSNumber numberWithInt:1080], nil];
  • NSArray *dimension2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1280], [NSNumber numberWithInt:720], nil];
  • NSArray *myDimensions = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjects:dimension1 forKeys:keys], [NSDictionary dictionaryWithObjects:dimension2 forKeys:keys], nil];
- (id<FWAdManager> FWContext) getAdManager

Get the AdManager instance for this context.

Returns
A id<FWAdManager> instance
- (id FWContext) getParameter: (NSString *)  name

Retrieve a parameter.

Parameters
nameThe name of the parameter
- (id<FWSlot> FWContext) getSlotByCustomId: (NSString *)  customId

Get a slot by its custom ID.

Parameters
customIdcustom ID of the slot
Returns
An id<FWSlot> object, or nil if not found
- (NSArray * /* id<FWSlot> */ FWContext) getSlotsByTimePositionClass: (FWTimePositionClass)  timePositionClass

Get all slots in specified time position class.

Parameters
timePositionClasstime position class, should be one of:
  • FW_TIME_POSITION_CLASS_PREROLL
  • FW_TIME_POSITION_CLASS_MIDROLL
  • FW_TIME_POSITION_CLASS_POSTROLL
  • FW_TIME_POSITION_CLASS_OVERLAY
  • FW_TIME_POSITION_CLASS_DISPLAY
  • FW_TIME_POSITION_CLASS_PAUSE_MIDROLL
Returns
An Array of id<FWSlot> objects
- (NSString * FWContext) getVideoLocation

Get video asset's location URL.

Returns
video asset's URL, nil if not set
- (void FWContext) loadExtension: (NSString *)  extensionName

Load player extension by its class name.

Parameters: extensionName - the class name of the extension

Events: FW_NOTIFICATION_EXTENSION_LOADED will be posted by the FWContext object when an extension succeeds or fails to initialize. If the notification's userInfo dict contains key FW_INFO_KEY_ERROR, it indicate the extension failed to initialize.

- (NSNotificationCenter * FWContext) notificationCenter

Return the object [NSNotificationCenter defaultCenter].

- (void FWContext) notifyUserAction: (FWUserAction)  userAction

Notify AdManager about user actions.

Parameters
userActionuser actions, must be one of:
  • FW_USER_ACTION_PAUSE_BUTTON_CLICKED
  • FW_USER_ACTION_RESUME_BUTTON_CLICKED
- (void FWContext) requestTimelinePause

Request timeline to pause.

The timeline consists of the content video and all linear slots. When the renderer or extension requires the timeline to be temporarily paused, e.g. when expanding to a fullscreen view that covers the whole player and other ads, calling this method will result in the notification FW_NOTIFICATION_CONTENT_PAUSE_REQUEST being dispatched from the current FWContext instance if content video is currently playing, and send pause requests to all active temporal slots.

- (void FWContext) requestTimelineResume

Request timeline to resume.

The timeline consists of the content video and all linear slots. When the renderer or extension requires the timeline to be resumed, e.g. when dismissing a fullscreen view that covers the whole player and other ads, calling this method will result in the notification FW_NOTIFICATION_CONTENT_RESUME_REQUEST being dispatched from the current FWContext instance if content video is currently paused, and send resume requests to all active temporal slots.

- (void FWContext) resetExclusivity

Reset the exclusivity scope.

- (BOOL FWContext) setCapability: (NSString *)  capability
: (FWCapabilityStatus)  DEPRECATED_ATTRIBUTE 
- (BOOL FWContext) setCapability: (NSString *)  capability
status: (FWCapabilityStatus)  status 

Set the capabilities supported by the player.

Parameters
capabilitycapability name, should be one of FW_CAPABILITY_* in FWConstants.h
statusindicates whether to enable this capability, should be one of:
  • FW_CAPABILITY_STATUS_ON: enable
  • FW_CAPABILITY_STATUS_OFF: disable
  • FW_CAPABILITY_STATUS_DEFAULT: leave it unset, follow the network settings
Returns
Boolean value, indicating whether the capability is set successfully
- (void FWContext) setMoviePlayerController: (MPMoviePlayerController *)  DEPRECATED_ATTRIBUTE
- (void FWContext) setMoviePlayerFullscreen: (BOOL)  DEPRECATED_ATTRIBUTE

The API is no longer required.

You only need to set your player to the correct state by calling [player setFullscreen:(BOOL)fullscreen] before temporal slot starts. Prior to AdManager 5.3.0, when the content MPMoviePlayerController enters or exits from fullscreen, it is required to call this method with the updated fullscreen status so that AdManager gets notified about the change. Existing apps could remove the calls if they make sure to call setVideoDisplayBase and [player setFullscreen:(BOOL)fullscreen] before temporal slot starts.

- (void FWContext) setParameter: (NSString *)  name
withValue: (id)  value
forLevel: (FWParameterLevel)  level 

Set a parameter on a specified level.

Parameters
nameparameter name
valueparameter value
levellevel of the parameter, must be one of:
  • FW_PARAMETER_LEVEL_GLOBAL
  • FW_PARAMETER_LEVEL_OVERRIDE
- (void FWContext) setPlayerProfile: (NSString *)  playerProfile
defaultTemporalSlotProfile: (NSString *)  defaultTemporalSlotProfile
defaultVideoPlayerSlotProfile: (NSString *)  defaultVideoPlayerSlotProfile
defaultSiteSectionSlotProfile: (NSString *)  defaultSiteSectionSlotProfile 

Set the profiles names.

Consult your FreeWheel sale engineer for available values.

Parameters
playerProfilename of the global profile
defaultTemporalSlotProfilename of the temporal slot default profile, nil by default
defaultVideoPlayerSlotProfilename of the video player slot default profile, nil by default
defaultSiteSectionSlotProfilename of the site section slot default profile, nil by default
- (void FWContext) setProfile: (NSString *)  playerProfile
: (NSString *)  defaultTemporalSlotProfile
: (NSString *)  defaultVideoPlayerSlotProfile
: (NSString *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) setRequestDuration: (NSTimeInterval)  requestDuration

Set the duration for which the player is requesting ads.

Optional.

Parameters
requestDurationrequesting duration value, in seconds.
- (void FWContext) setRequestMode: (FWRequestMode)  mode

Set request mode of AdManager.

Parameters
moderequest mode, must be one of:
  • FW_REQUEST_MODE_ON_DEMAND (default)
  • FW_REQUEST_MODE_LIVE

Notes: AdManager runs in On-Demand mode(_FW_REQUEST_MODE_ON_DEMAND) by default. If your video asset is a live stream, invoke this method to set the player to live mode. This method should be called (if needed) right after a new FWContext instance is created.

- (void FWContext) setSiteSection: (NSString *)  siteSectionId
: (NSUInteger)  pageViewRandom
: (NSUInteger)  networkId
: (FWIdType)  idType
: (NSUInteger)  DEPRECATED_ATTRIBUTE 
- (void FWContext) setSiteSectionId: (NSString *)  siteSectionId
idType: (FWIdType)  idType
pageViewRandom: (NSUInteger)  pageViewRandom
networkId: (NSUInteger)  networkId
fallbackId: (NSUInteger)  fallbackId 

Set the attributes of the site section.

Parameters
siteSectionIdid of the site section
idTypetype of the ID, should be one of
  • FW_ID_TYPE_CUSTOM
  • FW_ID_TYPE_FW
  • FW_ID_TYPE_FWGROUP
pageViewRandomrandom number generated everytime a user visits current site section
networkIdid of the network the site section belongs to, 0 by default
fallbackIdsite section ID to fallback to. When ad server fails to find the site section specified by siteSectionId, this ID will be used. 0 by default
- (void FWContext) setVideoAsset: (NSString *)  videoAssetId
: (NSTimeInterval)  duration
: (NSString *)  location
: (FWVideoAssetAutoPlayType)  autoPlayType
: (NSUInteger)  videoPlayRandom
: (NSUInteger)  networkId
: (FWIdType)  idType
: (NSUInteger)  fallbackId
: (FWVideoAssetDurationType)  DEPRECATED_ATTRIBUTE 
- (void FWContext) setVideoAssetCurrentTimePosition: (NSTimeInterval)  timePosition

Set the current time position of the content asset.

Parameters
timePositiontime position value in seconds.

Notes: If the stream is broken into multiple distinct files, this should be the time position within the asset as a whole.

- (void FWContext) setVideoAssetId: (NSString *)  videoAssetId
idType: (FWIdType)  idType
duration: (NSTimeInterval)  duration
durationType: (FWVideoAssetDurationType)  durationType
location: (NSString *)  location
autoPlayType: (FWVideoAssetAutoPlayType)  autoPlayType
videoPlayRandom: (NSUInteger)  videoPlayRandom
networkId: (NSUInteger)  networkId
fallbackId: (NSUInteger)  fallbackId 

Set the attributes of the current video asset.

Parameters
videoAssetIdid of the video asset
idTypetype of video id, should be one of
  • FW_ID_TYPE_CUSTOM
  • FW_ID_TYPE_FW
  • FW_ID_TYPE_FWGROUP
durationduration of the video in seconds
durationTypetype of duration, should be one of
  • FW_VIDEO_ASSET_DURATION_TYPE_EXACT default
  • FW_VIDEO_ASSET_DURATION_TYPE_VARIABLE for live video
locationlocation(URI) of the video, nil by default
autoPlayTypewhether the video starts playing automatically without user interaction
  • FW_VIDEO_ASSET_AUTO_PLAY_TYPE_NONE
  • FW_VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED (default)
  • FW_VIDEO_ASSET_AUTO_PLAY_TYPE_UNATTENDED
videoPlayRandomrandom number generated everytime a user watches the video asset
networkIdid of the network the video belongs to, 0 by default
fallbackIdvideo ID to fallback to. When ad server fails to find the video asset specified by videoAssetId, this ID will be used. 0 by default
- (void FWContext) setVideoDisplayBase: (UIView *)  value

Set video display base UIView.

REQUIRED. Video ads are rendered within the base view in the same frame. When video display base view changes, app needs to call this method again with the new video display to notify AdManager to render video ads in the updated video display. App does not need to call this method when video display view's frame changes. Prior to AdManager 3.8, renderer assumes main video's MPMoviePlayerController view is the video display base. Starting from AdManager 3.8, for iOS>=3.2, app must invoke this method to specify video display base explicitly. For iOS3.0-3.1, app does not need to invoke this method since the legacy MPMoviePlayerController is always played in fullscreen.

- (void FWContext) setVideoDisplayCompatibleSizes: (NSArray *)  compatibleDimensions

Set a list of acceptable alternative dimensions.

Parameters
compatibleDimensionsan array of compatible dimensions, The dimension must be a NSDictionary object with key @'width' and @'height', the value of should be a positive integer. Examples:
  • NSArray *keys = [NSArray arrayWithObjects:"width", @"height", nil];
  • NSArray *dimension1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1980], [NSNumber numberWithInt:1080], nil];
  • NSArray *dimension2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1280], [NSNumber numberWithInt:720], nil];
  • NSArray *myDimensions = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjects:dimension1 forKeys:keys], [NSDictionary dictionaryWithObjects:dimension2 forKeys:keys], nil];
  • [context setVideoDisplayCompatibleSizes:myDimensions];
- (void FWContext) setVideoPlayheadTime: (NSTimeInterval *)  playheadTime

Set playhead time of the content video.

Parameters
playheadTimevideo playhead time
- (void FWContext) setVideoState: (FWVideoState)  videoState

Set the current state of the video.

Parameters
videoStatevideo state, should be one of:
  • FW_VIDEO_STATE_PLAYING
  • FW_VIDEO_STATE_PAUSED
  • FW_VIDEO_STATE_STOPPED
  • FW_VIDEO_STATE_COMPLETED
- (void FWContext) setVisitor: (NSString *)  customId
: (NSString *)  ipV4Address
: (NSUInteger)  bandwidth
: (NSString *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) setVisitorHttpHeader: (NSString *)  name
: (NSString *)  DEPRECATED_ATTRIBUTE 
- (void FWContext) setVisitorHTTPHeader: (NSString *)  name
withValue: (NSString *)  value 

Set the HTTP headers of the visitor.

Parameters
namename of the header
valuevalue of the header. If set to nil, the original value of the HTTP header name will be removed.
- (void FWContext) setVisitorId: (NSString *)  customId
ipV4Address: (NSString *)  ipV4Address
bandwidth: (NSUInteger)  bandwidth
bandwidthSource: (NSString *)  bandwidthSource 

Set the attributes of the visitor.

Parameters
customIdcustom ID of the visitor
ipV4Addressip address of the visitor
bandwidthbandwidth of the visitor
bandwidthSourcebandwidth source of the visitor
- (NSArray * /* id<FWSlot> */ FWContext) siteSectionNonTemporalSlots

Get all site section non-temporal slots.

Returns
An NSArray of id<FWSlot> objects
- (void FWContext) startSubsession: (NSUInteger)  DEPRECATED_ATTRIBUTE
- (void FWContext) startSubsessionWithToken: (NSUInteger)  subsessionToken

Start a subsession in live mode.

Subsequent requests will be in the same subsession, until this method is called again with a different token.

Parameters
subsessionTokena token to identify the subsession, should be unique across different subsessions. Use a different token to start a new subsession.

Note: Calling this method multiple times with the same token will have no effect. Subsession only works when FW_CAPABILITY_SYNC_MULTI_REQUESTS is on, calling this method will turn on this capability.

- (void FWContext) submitRequest: (NSTimeInterval)  DEPRECATED_ATTRIBUTE
- (void FWContext) submitRequestWithTimeout: (NSTimeInterval)  timeoutInterval

Submit the request to FreeWheel Ad Server.

Parameters
timeoutIntervalad request timeout value in seconds. 3 by default.
- (NSArray * /* id<FWSlot> */ FWContext) temporalSlots

Get all temporal slots.

Returns
An NSArray of id<FWSlot> objects
- (NSString * FWContext) transactionId
- (NSArray * /* id<FWSlot> */ FWContext) videoPlayerNonTemporalSlots

Get all video player non-temporal slots.

Returns
An NSArray of id<FWSlot> objects

The documentation for this protocol was generated from the following file: