OOIMAManager Class Reference

#import "OOIMAManager.h"

+ Inheritance diagram for OOIMAManager:

Instance Methods

(instancetype) - initWithOoyalaPlayer:
 Initialize a OOIMAManager using the OOOoyalaPlayer. More...
 
(instancetype) - initWithOoyalaPlayer:configuration:
 Initialize a OOIMAManager using the OOOoyalaPlayer and an Ooyala IMA Configuration. More...
 
(void) - addCompanionSlot:
 Add a compnanionSlot to AdsPlayer. More...
 
(void) - setAdTagParameters:
 Add tag parameters to the end of the original URL for ads request. More...
 
(void) - play
 Play, or queue up automatic playing of ads if they are still loading. More...
 
(void) - pause
 Pause currently playing ad. More...
 
(OOAdSpotManager *) - parseAllAdsMetadata:
 Parse all_ads metadata obtained in https://player.ooyala.com/player_api/v1/metadata/embed_code/. More...
 
(void) - dealloc [implementation]
 
(void) - setup:configuration: [implementation]
 
(void) - requestAds: [implementation]
 
(NSString *) - replaceOOMacrosForAdTag: [implementation]
 
(void) - timeout [implementation]
 
(void) - exitAdModeIfNecessary [implementation]
 
(void) - resetAdMode [implementation]
 
(void) - resetState [implementation]
 
(void) - setupFromCurrentItem [implementation]
 
(NSString *) - imaUrl [implementation]
 
(NSString *) - formatImaUrl [implementation]
 
(void) - startIMALoadingWithTag: [implementation]
 
(NSString *) - formatTagUrl: [implementation]
 
(BOOL) - processContentFinished [implementation]
 
(BOOL) - hasPostroll [implementation]
 This checks if last ad of manager is a postroll If last ad position is greater than video duration, will return YES. More...
 
(void) - markCuePointAsPlayedupdate: [implementation]
 mark an cue point as played More...
 
(void) - initCuePoints: [implementation]
 
(void) - imaInitializeAdsManager [implementation]
 
(void) - onAdEventLoaded [implementation]
 
(void) - updateCurrentPlaybackTime [implementation]
 
(void) - adsLoader:adsLoadedWithData: [implementation]
 Called when ads are successfully loaded from the ad servers by the loader. More...
 
(void) - adsLoader:failedWithErrorData: [implementation]
 Error reported by the ads loader when loading or requesting an ad fails. More...
 
(void) - willOpenExternalBrowser [implementation]
 
(void) - willOpenInAppBrowser [implementation]
 
(void) - didOpenInAppBrowser [implementation]
 
(void) - willCloseInAppBrowser [implementation]
 
(void) - didCloseInAppBrowser [implementation]
 
(void) - adsManager:didReceiveAdEvent: [implementation]
 Called when there is an IMAAdEvent. More...
 
(void) - adsManager:didReceiveAdError: [implementation]
 Called when there was an error playing the ad. More...
 
(void) - adsManagerDidRequestContentPause: [implementation]
 Called when an ad is ready to play. More...
 
(void) - adsManagerDidRequestContentResume: [implementation]
 Called when an ad has finished or an error occurred during the playback. More...
 
(BOOL) - onContentChanged [implementation]
 This is called when content changed Setup current item and send the ads reuqest. More...
 
(BOOL) - onInitialPlay [implementation]
 This is called before start playing content so plugin can play preroll. More...
 
(BOOL) - onPlayheadUpdate: [implementation]
 This is called when playhead is updated so plugin can play midroll. More...
 
(BOOL) - onContentFinished [implementation]
 This is called before finishing playing content so plugin can play postroll. More...
 
(BOOL) - onCuePoint: [implementation]
 This is called when a cue point is reached so plugin can play midroll. More...
 
(BOOL) - onContentError: [implementation]
 This is called when an error occured when playing back content. More...
 
(void) - onAdModeEntered [implementation]
 This is called when control is handed over to the plugin. More...
 
(id< OOPlayerProtocol >) - player [implementation]
 This is called ooyala UI pass down UI related events. More...
 
(void) - resetAds [implementation]
 This is called to reset all ads to unplayed. More...
 
(void) - skipAd [implementation]
 This is called to skip the current ad. More...
 
(void) - clickAd [implementation]
 This is called when the ad is clicked. More...
 
(NSSet *) - getCuePointsAtSeconds [implementation]
 
(void) - onAdIconClicked: [implementation]
 Called when an icon is clicked. More...
 
(BOOL) - hasNotNilAds [implementation]
 
(void) - reset [implementation]
 This is called when plugin should be reset. More...
 
(void) - suspend [implementation]
 This is called when plugin should be suspended. More...
 
(void) - resume [implementation]
 This is called when plugin should be resumed. More...
 
(void) - resume:stateToResume: [implementation]
 This is called when plugin should be resumed. More...
 
(void) - destroy [implementation]
 This is called when plugin should be destryed. More...
 
- Instance Methods inherited from <IMAAdsManagerDelegate>
(void) - adsManager:adDidProgressToTime:totalTime:
 Called every 200ms to provide time updates for the current ad. More...
 
(void) - adsManagerAdPlaybackReady:
 Called when the current ad is sufficiently buffered and playback is likely to keep up. More...
 
(void) - adsManagerAdDidStartBuffering:
 Called when the current ad media buffer is empty and playback did stall. More...
 
(void) - adsManager:adDidBufferToMediaTime:
 Called as the current ad media buffers. More...
 
- Instance Methods inherited from <IMAWebOpenerDelegate>
(void) - webOpenerWillOpenExternalBrowser:
 Called when Safari is about to be opened. More...
 
(void) - webOpenerWillOpenInAppBrowser:
 Called before in-app browser opens. More...
 
(void) - webOpenerDidOpenInAppBrowser:
 Called when the in app browser is shown on the screen. More...
 
(void) - webOpenerWillCloseInAppBrowser:
 Called when in-app browser is about to close. More...
 
(void) - webOpenerDidCloseInAppBrowser:
 Called when in-app browser finishes closing. More...
 

Class Methods

(NSString *) + IMAAdEventTypeName: [implementation]
 

Properties

id< OOIMAManagerDelegatedelegate
 
id< IMAAdPlaybackInfoadPlaybackInfo
 
IMAAdDisplayContaineradDisplayContainer
 
OOStateNotifier * stateNotifier
 
id< OOIMAAdsManagerDelegateimaAdsManagerDelegate
 
NSString * adUrlOverride
 Configure IMA ads from given URL. More...
 
float vastLoadTimeout
 Configure VAST load timeout in milliseconds for Google IMA AdRequests. More...
 
OOOoyalaPlayer * ooyalaPlayer [implementation]
 OOOoyalaPlayer to play the content. More...
 
NSMutableArray * companionSlots [implementation]
 Map CGRect to relevant companion ad slots. More...
 
ManagedImaAdsManagermanagedImaAdsManager [implementation]
 
OOIMAPlayheadDelegateplayheadDelegate [implementation]
 
NSString * tagParameters [implementation]
 
BOOL playQueued [implementation]
 
int tid [implementation]
 
OOIMAAdPlayeradPlayer [implementation]
 
NSMutableSet * unplayedCuePoints [implementation]
 
BOOL allAdsCompleted [implementation]
 
NSTimer * timer [implementation]
 
UIView * imaAdView [implementation]
 
BOOL contentCompletionCached [implementation]
 
NSString * embedcode [implementation]
 
OOIMAConfigurationimaConfiguration [implementation]
 
OOAdSpotManager * adSpotManager [implementation]
 
OOIMAAdPlayMetadatatobeLoadedNonRulesAd [implementation]
 
OOAdMode lastRequestedAdMode [implementation]
 
BOOL isUsingAdRules [implementation]
 

Detailed Description

Method Documentation

- (void) addCompanionSlot: (UIView *)  slot

Add a compnanionSlot to AdsPlayer.

Parameters
[in]slotthe UIView the user wants to use to hold the slot NOTE: this UIView cannot be changed to fit the screen automatically so the companion slots may be located inappropriately when the orientation changed
- (void) adsLoader: (IMAAdsLoader *)  loader
adsLoadedWithData: (IMAAdsLoadedData *)  adsLoadedData 
implementation

Called when ads are successfully loaded from the ad servers by the loader.

Parameters
loaderthe IMAAdsLoader that received the loaded ad data
adsLoadedDatathe IMAAdsLoadedData instance containing ad data

Reimplemented from <IMAAdsLoaderDelegate>.

- (void) adsLoader: (IMAAdsLoader *)  loader
failedWithErrorData: (IMAAdLoadingErrorData *)  adErrorData 
implementation

Error reported by the ads loader when loading or requesting an ad fails.

Parameters
loaderthe IMAAdsLoader that received the error
adErrorDatathe IMAAdLoadingErrorData instance with error information

Reimplemented from <IMAAdsLoaderDelegate>.

- (void) adsManager: (IMAAdsManager *)  adsManager
didReceiveAdError: (IMAAdError *)  error 
implementation

Called when there was an error playing the ad.

Log the error and resume playing content.

Parameters
adsManagerthe IMAAdsManager that errored
errorthe IMAAdError received

Reimplemented from <IMAAdsManagerDelegate>.

- (void) adsManager: (IMAAdsManager *)  adsManager
didReceiveAdEvent: (IMAAdEvent *)  event 
implementation

Called when there is an IMAAdEvent.

Parameters
adsManagerthe IMAAdsManager receiving the event
eventthe IMAAdEvent received

Reimplemented from <IMAAdsManagerDelegate>.

- (void) adsManagerDidRequestContentPause: (IMAAdsManager *)  adsManager
implementation

Called when an ad is ready to play.

The implementing code should pause the content playback and prepare the UI for ad playback.

Parameters
adsManagerthe IMAAdsManager requesting content pause

Reimplemented from <IMAAdsManagerDelegate>.

- (void) adsManagerDidRequestContentResume: (IMAAdsManager *)  adsManager
implementation

Called when an ad has finished or an error occurred during the playback.

The implementing code should resume the content playback.

Parameters
adsManagerthe IMAAdsManager requesting content resume

Reimplemented from <IMAAdsManagerDelegate>.

- (void) clickAd
implementation

This is called when the ad is clicked.

- (void) dealloc
implementation
- (void) destroy
implementation

This is called when plugin should be destryed.

- (void) didCloseInAppBrowser
implementation
- (void) didOpenInAppBrowser
implementation
- (void) exitAdModeIfNecessary
implementation
- (NSString *) formatImaUrl
implementation
- (NSString *) formatTagUrl: (NSString *)  tagUrl
implementation
- (NSSet *) getCuePointsAtSeconds
implementation
- (BOOL) hasNotNilAds
implementation
- (BOOL) hasPostroll
implementation

This checks if last ad of manager is a postroll If last ad position is greater than video duration, will return YES.

Returns
YES if a postroll exists
+ (NSString *) IMAAdEventTypeName: (IMAAdEventType)  type
implementation
- (void) imaInitializeAdsManager
implementation
- (NSString *) imaUrl
implementation
- (void) initCuePoints: (NSArray *)  adCuePoints
implementation
- (instancetype) initWithOoyalaPlayer: (OOOoyalaPlayer *)  player

Initialize a OOIMAManager using the OOOoyalaPlayer.

Parameters
[in]playerthe OOOoyalaPlayer
Returns
the initialized OOIMAManager
- (instancetype) initWithOoyalaPlayer: (OOOoyalaPlayer *)  player
configuration: (OOIMAConfiguration *)  configuration 

Initialize a OOIMAManager using the OOOoyalaPlayer and an Ooyala IMA Configuration.

Parameters
[in]playerthe OOOoyalaPlayer
[in]configurationthe OOIMAConfiguration to configure the Ooyala IMA Integration. can be nil
Returns
the initialized OOIMAManager
- (void) markCuePointAsPlayedupdate: (NSTimeInterval)  timeOffset
implementation

mark an cue point as played

Parameters
timeOffsetthe time position in the content of the cue point
- (void) onAdEventLoaded
implementation
- (void) onAdIconClicked: (NSInteger)  index
implementation

Called when an icon is clicked.

Parameters
indexthe index of the icon
- (void) onAdModeEntered
implementation

This is called when control is handed over to the plugin.

- (BOOL) onContentChanged
implementation

This is called when content changed Setup current item and send the ads reuqest.

Returns
true if plugin want to enter admode, NO otherwise
- (BOOL) onContentError: (int)  errorCode
implementation

This is called when an error occured when playing back content.

Returns
YES if plugin want to enter admode, NO otherwise
- (BOOL) onContentFinished
implementation

This is called before finishing playing content so plugin can play postroll.

Returns
YES if plugin want to enter admode, NO otherwise
- (BOOL) onCuePoint: (int)  cuePointIndex
implementation

This is called when a cue point is reached so plugin can play midroll.

Returns
YES if plugin want to enter admode, NO otherwise
- (BOOL) onInitialPlay
implementation

This is called before start playing content so plugin can play preroll.

Returns
true if video has ima ads to enter admode, false otherwise
- (BOOL) onPlayheadUpdate: (Float64)  playhead
implementation

This is called when playhead is updated so plugin can play midroll.

For Ad-Rules, always return false since we only play ads when IMA SDK sends notification. For Non Ad-Rules, return true when the playhead has passed an ad that should play.

Parameters
playheadcurrent playhead time
Returns
YES if plugin want to enter admode, NO otherwise
- (OOAdSpotManager *) parseAllAdsMetadata: (NSMutableArray *)  adsMetadata

Parse all_ads metadata obtained in https://player.ooyala.com/player_api/v1/metadata/embed_code/.

Parse the JSON array corresponding to the "all_ads" field in the metadata and extract this data into a Array with data about position and the ad tag URL.

Parameters
adsMetadataas NSMutableArray
Returns
ad spot as OOAdSpotManager
Parameters
allAdsJSONArraythe JSON array corresponding to the "all_ads" field in the metadata
Returns
a OOAdSpotManager of ad play metadata sorted in ascending order by ad position
- (void) pause

Pause currently playing ad.

This is meant to be called only by the OOIMAAdPlayer.

- (void) play

Play, or queue up automatic playing of ads if they are still loading.

This is meant to be called only by the OOIMAAdPlayer.

- (id< OOPlayerProtocol >) player
implementation

This is called ooyala UI pass down UI related events.

Returns
an object that implements PlayerInterface if plugin needs to process ui events, null if these events should be ignored.
- (BOOL) processContentFinished
implementation
- (NSString *) replaceOOMacrosForAdTag: (NSString *)  adTagUrl
implementation
- (void) requestAds: (NSString *)  adTagUrl
implementation
- (void) reset
implementation

This is called when plugin should be reset.

- (void) resetAdMode
implementation
- (void) resetAds
implementation

This is called to reset all ads to unplayed.

- (void) resetState
implementation
- (void) resume
implementation

This is called when plugin should be resumed.

- (void) resume: (Float64)  time
stateToResume: (OOOoyalaPlayerState)  state 
implementation

This is called when plugin should be resumed.

Parameters
timethe playhead time to set
statethe player state after resume
- (void) setAdTagParameters: (NSDictionary*)  adTagParameters

Add tag parameters to the end of the original URL for ads request.

The parameters will be overridden by the latest call if this method get called multiple times

Parameters
[in]adTagParametersA dictionary of the key-value pairs to be appended to the tag as query string parameters
- (void) setup: (OOOoyalaPlayer *)  player
configuration: (OOIMAConfiguration *)  configuration 
implementation
- (void) setupFromCurrentItem
implementation
- (void) skipAd
implementation

This is called to skip the current ad.

Does not support by Google IMA iOS-SDK

- (void) startIMALoadingWithTag: (NSString *)  tagUrl
implementation
- (void) suspend
implementation

This is called when plugin should be suspended.

- (void) timeout
implementation
- (void) updateCurrentPlaybackTime
implementation
- (void) willCloseInAppBrowser
implementation
- (void) willOpenExternalBrowser
implementation
- (void) willOpenInAppBrowser
implementation

Property Documentation

- (IMAAdDisplayContainer*) adDisplayContainer
readatomicassign
- (id< IMAAdPlaybackInfo >) adPlaybackInfo
readnonatomicassign
- (OOIMAAdPlayer*) adPlayer
readwritenonatomicassignimplementation
- (OOAdSpotManager*) adSpotManager
readwritenonatomicassignimplementation
- (NSString*) adUrlOverride
readwritenonatomicassign

Configure IMA ads from given URL.

You do not need to do this if a VAST URL is properly configured in Third Party Module Metadata. It is not advised usage to manually load an IMA VAST URL while any IMA URL is configured in Third Party Module Metadata.

- (BOOL) allAdsCompleted
readwritenonatomicassignimplementation
- (NSMutableArray*) companionSlots
readwritenonatomicassignimplementation

Map CGRect to relevant companion ad slots.

- (BOOL) contentCompletionCached
readwriteatomicimplementation
- (id<OOIMAManagerDelegate>) delegate
readwritenonatomicweak
- (NSString*) embedcode
readwritenonatomicassignimplementation
- (id<OOIMAAdsManagerDelegate>) imaAdsManagerDelegate
readwritenonatomicweak
- (UIView*) imaAdView
readwritenonatomicassignimplementation
- (OOIMAConfiguration*) imaConfiguration
readwritenonatomicassignimplementation
- (BOOL) isUsingAdRules
readwritenonatomicassignimplementation
- (OOAdMode) lastRequestedAdMode
readwritenonatomicassignimplementation
- (ManagedImaAdsManager*) managedImaAdsManager
readwritenonatomicassignimplementation
- (OOOoyalaPlayer*) ooyalaPlayer
readwritenonatomicweakimplementation

OOOoyalaPlayer to play the content.

- (OOIMAPlayheadDelegate*) playheadDelegate
readwritenonatomicassignimplementation
- (BOOL) playQueued
readwritenonatomicassignimplementation
- (OOStateNotifier*) stateNotifier
readatomicassign
- (NSString*) tagParameters
readwritenonatomicassignimplementation
- (int) tid
readwritenonatomicassignimplementation
- (NSTimer*) timer
readwritenonatomicassignimplementation
- (OOIMAAdPlayMetadata*) tobeLoadedNonRulesAd
readwritenonatomicassignimplementation
- (NSMutableSet*) unplayedCuePoints
readwritenonatomicassignimplementation
- (float) vastLoadTimeout
readwritenonatomicassign

Configure VAST load timeout in milliseconds for Google IMA AdRequests.

This parameter will override the default timeout set by Google IMA.


The documentation for this class was generated from the following files: