<FWSlot > Protocol Reference

Protocol for slot. More...

#import <FWProtocols.h>

+ Inheritance diagram for <FWSlot >:

Instance Methods

(NSString *) - customId
 Get the slot's custom ID. More...
 
(FWSlotType) - type
 Get the slot's type. More...
 
(NSTimeInterval) - timePosition
 Get the slot's time position. More...
 
(FWTimePositionClass) - timePositionClass
 Get slot's time position class. More...
 
(NSTimeInterval) - embeddedAdsDuration
 Get the slot's embedded ads duration. More...
 
(NSTimeInterval) - endTimePosition
 Get the slot's end time position. More...
 
(NSArray */*< id >FWAdInstance */) - adInstances
 Get the ad instances in the slot. More...
 
(NSInteger) - width
 Get the width of the slot in pixels as returned in ad response. More...
 
(NSInteger) - height
 Get the height of the slot in pixels as returned in ad response. More...
 
(void) - processEvent:
 Process slot event. More...
 
(void) - preload
 Preload the slot. More...
 
(void) - play
 Play the slot. More...
 
(void) - stop
 Stop the slot. More...
 
(void) - pause
 Pause the slot. More...
 
(void) - resume
 Resume the slot. More...
 
(BOOL) - visible
 Get slot's visibility. More...
 
(void) - setVisible:
 Set the visibility for a nontemporal slot. More...
 
(UIView *) - slotBase
 Get slot base UIView object. More...
 
(void) - setParameter:withValue:
 Set a parameter on the slot level. More...
 
(id) - getParameter:
 Get the value of a parameter by its name. More...
 
(NSTimeInterval) - totalDuration
 Get the slot's duration. More...
 
(NSTimeInterval) - playheadTime
 Get the slot's playhead. More...
 
(id< FWAdInstance >) - currentAdInstance
 Get the currently playing ad instance. More...
 

Detailed Description

Protocol for slot.

Method Documentation

- (NSArray * /* <id>FWAdInstance */ FWSlot) adInstances

Get the ad instances in the slot.

Returns
An array of id<FWAdInstance>
- (id<FWAdInstance> FWSlot) currentAdInstance

Get the currently playing ad instance.

Returns
the AdInstance object of the currently playing ad in this slot. Return nil if no ad instance is currently playing.
- (NSString * FWSlot) customId

Get the slot's custom ID.

Returns
Custom ID of the slot
- (NSTimeInterval FWSlot) embeddedAdsDuration

Get the slot's embedded ads duration.

Returns
The embeded ads duration of the temporal slot. -1 if not available.
- (NSTimeInterval FWSlot) endTimePosition

Get the slot's end time position.

Returns
The end time position of the temporal slot. -1 if not available.
- (id FWSlot) getParameter: (NSString *)  name

Get the value of a parameter by its name.

Parameters
nameParameter name
Returns
value of the parameter
- (NSInteger FWSlot) height

Get the height of the slot in pixels as returned in ad response.

Returns
Height in pixels
- (void FWSlot) pause

Pause the slot.

- (void FWSlot) play

Play the slot.

Note: If your app uses MPMoviePlayerController for content video playback, you will need to release the player when a midroll video slot is about to start, and re-create a new MPMoviePlayerController after the midroll slot ends, starting from where it was left off. This is due to the limitation that MPMoviePlayerController only supports one active stream at a time. AVPlayer does not have this limitation.

- (NSTimeInterval FWSlot) playheadTime

Get the slot's playhead.

Returns
the playhead time in seconds, greater than or equal to 0
- (void FWSlot) preload

Preload the slot.

The notification FW_NOTIFICATION_SLOT_PRELOADED will be dispatched when the slot has finished preloading.

Note: For ads, the preload behaviour may differ due to different ad types. Based on the current implementation, it only supports VAST Ad.

- (void FWSlot) processEvent: (NSString *)  eventName

Process slot event.

Parameters
eventNameEvent to be processed, one of FW_EVENT_SLOT_* in FWConstants.h
- (void FWSlot) resume

Resume the slot.

- (void FWSlot) setParameter: (NSString *)  name
withValue: (id)  value 

Set a parameter on the slot level.

Parameters
namename of the parameter
valuevalue of the parameter
- (void FWSlot) setVisible: (BOOL)  value

Set the visibility for a nontemporal slot.

If a nontemporal slot view should not be visible, call setVisible:NO before the slot starts. In this case there will be no impression sent to FreeWheel ad server, even if [slot play] has already been called. If a nontemporal slot has started([slot play] has been called) when it is invisible, calling setVisible:YES will display the slot and send an impression.

Note: This method has no effect on temporal slots. This method has no effect anymore if an impression has been sent.

Parameters
valueYES or NO
- (UIView * FWSlot) slotBase

Get slot base UIView object.

For nontemporal slots, the returned UIView should be added to a parent UIView that is already in your apps view hierarchy. For temporal slot, return value is the object set by -[FWContext setVideoDisplayBase:].

- (void FWSlot) stop

Stop the slot.

- (NSTimeInterval FWSlot) timePosition

Get the slot's time position.

Returns
Time position of the slot
- (FWTimePositionClass FWSlot) timePositionClass

Get slot's time position class.

Returns
Time position class of the slot, the value can 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
- (NSTimeInterval FWSlot) totalDuration

Get the slot's duration.

Returns
the duration in seconds, greater than or equal to 0
- (FWSlotType FWSlot) type

Get the slot's type.

Returns
Type of the slot, the value can be one of:
  • FW_SLOT_TYPE_TEMPORAL
  • FW_SLOT_TYPE_VIDEOPLAYER_NONTEMPORAL
  • FW_SLOT_TYPE_SITESECTION_NONTEMPORAL
- (BOOL FWSlot) visible

Get slot's visibility.

Only applicable to non-temporal slots. YES by default.

- (NSInteger FWSlot) width

Get the width of the slot in pixels as returned in ad response.

Returns
Width in pixels

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