com.ooyala.android.imasdk.OoyalaIMAManager Class Reference

The OoyalaIMAManager works with OoyalaPlayer to manage IMA ads playback. More...

Inheritance diagram for com.ooyala.android.imasdk.OoyalaIMAManager:
com.ooyala.android.plugin.AdPluginInterface com.ooyala.android.plugin.LifeCycleInterface com.ooyala.android.AdsLearnMoreInterface

Public Member Functions

 OoyalaIMAManager (OoyalaPlayer ooyalaPlayer)
 Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset. More...
 
 OoyalaIMAManager (OoyalaPlayer ooyalaPlayer, ViewGroup l)
 Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset. More...
 
 OoyalaIMAManager (OoyalaPlayer ooyalaPlayer, OoyalaIMAConfiguration config)
 Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset. More...
 
 OoyalaIMAManager (OoyalaPlayer ooyalaPlayer, ViewGroup l, OoyalaIMAConfiguration config)
 Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset. More...
 
void onAdError (AdErrorEvent event)
 
void onAdsManagerLoaded (AdsManagerLoadedEvent event)
 
void onAdEvent (AdEvent event)
 
void addCompanionSlot (ViewGroup companionAdView, int width, int height)
 Specify a list of views that the IMA Manager can use to show companion ads. More...
 
void setAdTagParameters (Map< String, String > adTagParameters)
 Specify a map of Ad Tag parameters that will be appended to the ad tag This will not override already set parameters. More...
 
void setAdUrlOverride (String url)
 Manually load an IMA Vast URL to initialize the IMA Manager. More...
 
boolean onInitialPlay ()
 
boolean onContentChanged ()
 Return true if there is a URL to load. More...
 
boolean onPlayheadUpdate (int playhead)
 For Ad-Rules, always return false since we only play ads when IMA SDK sends notification. More...
 
boolean onContentFinished ()
 
boolean onCuePoint (int cuePointIndex)
 Always return false for IMA Ads since we only play ads when IMA SDK sends notification. More...
 
boolean onContentError (int errorCode)
 Fire a IMAAdErrorCallback to IMA SDK. More...
 
void onAdModeEntered ()
 Load current IMA ad if no ad loaded and a IMA ad tag url is available. More...
 
void suspend ()
 Suspend ads playback. More...
 
void suspend (boolean onlyRemoveView)
 This is called when plugin should be suspended. More...
 
void resume ()
 Resume suspended ads playback. More...
 
void resume (int timeInMilliSecond, State stateToResume)
 Resume from given time with given state, but does not work for IMA Ads Playback. More...
 
void destroy ()
 Destroy IMAAdsManager and all related fields. More...
 
void configurationChanged (Configuration newConfig)
 This method is called when the device configuration changes while your component is running. More...
 
void destroyPlayer ()
 
PlayerInterface getPlayerInterface ()
 
void resetAds ()
 Reset all IMA Ads Playback related fields and restart ads Playback. More...
 
void skipAd ()
 Skip current ad playback. More...
 
void reset ()
 Reset all IMA Ads Playback related fields and restart ads Playback. More...
 
Set< Integer > getCuePointsInMilliSeconds ()
 Fetch cue points for current ad tag url. More...
 
void processClickThrough ()
 This is called to process click through. More...
 
void onAdIconClicked (int index)
 This is called when an icon is clicked. More...
 
boolean allADSPlayed ()
 
void setOnAdEventListener (IMAAdEventListener imaAdEventListener)
 Expose AdEventListener for integration with MOAT. More...
 
void setOnAdErrorListener (IMAAdErrorListener imaAdErrorListener)
 Expose AdErrorListener for integration with MOAT. More...
 
void setAdsLoadedListener (IMAAdsLoadedListener imaAdsLoadedListener)
 Expose AdsLoadedListener for integration with MOAT. More...
 
void setContainerUpdatedListener (IMAContainerUpdatedListener imaContainerUpdatedListener)
 Expose AdDisplayContainer for integration with MOAT. More...
 

Public Attributes

boolean _onAdError
 True if encounter error during ad playback. More...
 

Protected Attributes

AdsLoader _adsLoader
 
AdsManager _adsManager
 
AdDisplayContainer _container
 
ImaSdkFactory _sdkFactory
 
AdsRenderingSettings _adRenderingSettings
 
OoyalaPlayerIMAWrapper _ooyalaPlayerWrapper
 
List< CompanionAdSlot > _companionAdSlots
 
List< Integer > _cuePoints
 
Map< String, String > _adTagParameters
 
OoyalaPlayer _player
 
OoyalaIMAConfiguration configuration
 
IMAAdPlayer _adPlayer = null
 

Detailed Description

The OoyalaIMAManager works with OoyalaPlayer to manage IMA ads playback.

It also provides methods configure IMA ads playback, including companion ad slot and custom ad tag url.

The OoyalaIMAManager will play back all IMA ads affiliated with any playing Ooyala asset. This will automatically be configured, as long as the VAST URL is properly configured in Third Module Metadata.

The OoyalaIMAManager works most completely with an OptimizedOoyalaPlayerLayoutController. If you do not use this layout controller, you will not see IMA's "Learn More" button when in fullscreen mode.

The OoyalaIMAManager assumes that either there will be only a single Ad-Rules Ad Tag, or any number of Non Ad-Rules Ad Tags. No combination of the two.

Constructor & Destructor Documentation

com.ooyala.android.imasdk.OoyalaIMAManager.OoyalaIMAManager ( OoyalaPlayer  ooyalaPlayer)

Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset.

This will automatically be configured, as long as the VAST URL is properly configured in Third Module Metadata.

Parameters
ooyalaPlayercurrent OoyalaPlayer
com.ooyala.android.imasdk.OoyalaIMAManager.OoyalaIMAManager ( OoyalaPlayer  ooyalaPlayer,
ViewGroup  l 
)

Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset.

This will automatically be configured, as long as the VAST URL is properly configured in Third Module Metadata.

Parameters
ooyalaPlayercurrent OoyalaPlayer
lthe ViewGroup used for the rendering of Google IMA
com.ooyala.android.imasdk.OoyalaIMAManager.OoyalaIMAManager ( OoyalaPlayer  ooyalaPlayer,
OoyalaIMAConfiguration  config 
)

Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset.

This will automatically be configured, as long as the VAST URL is properly configured in Third Module Metadata.

Parameters
ooyalaPlayercurrent OoyalaPlayer
configan OoyalaIMAConfiguration
com.ooyala.android.imasdk.OoyalaIMAManager.OoyalaIMAManager ( OoyalaPlayer  ooyalaPlayer,
ViewGroup  l,
OoyalaIMAConfiguration  config 
)

Initialize the Ooyala IMA Manager, which will play back all IMA ads affiliated with any playing Ooyala asset.

This will automatically be configured, as long as the VAST URL is properly configured in Third Module Metadata.

Parameters
ooyalaPlayercurrent OoyalaPlayer
lthe ViewGroup used for the rendering of Google IMA
configan OoyalaIMAConfiguration

Member Function Documentation

void com.ooyala.android.imasdk.OoyalaIMAManager.addCompanionSlot ( ViewGroup  companionAdView,
int  width,
int  height 
)

Specify a list of views that the IMA Manager can use to show companion ads.

Parameters
companionAdViewThe AdView to hold the companion ad slot
widththe width of companion ad view
heightthe height of companion ad view
boolean com.ooyala.android.imasdk.OoyalaIMAManager.allADSPlayed ( )
Returns
true if all ads were played

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.configurationChanged ( Configuration  newConfig)

This method is called when the device configuration changes while your component is running.

Parameters
newConfigThe new device configuration.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.destroy ( )

Destroy IMAAdsManager and all related fields.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.destroyPlayer ( )
Set<Integer> com.ooyala.android.imasdk.OoyalaIMAManager.getCuePointsInMilliSeconds ( )

Fetch cue points for current ad tag url.

Implements com.ooyala.android.plugin.AdPluginInterface.

PlayerInterface com.ooyala.android.imasdk.OoyalaIMAManager.getPlayerInterface ( )
void com.ooyala.android.imasdk.OoyalaIMAManager.onAdError ( AdErrorEvent  event)
void com.ooyala.android.imasdk.OoyalaIMAManager.onAdEvent ( AdEvent  event)
void com.ooyala.android.imasdk.OoyalaIMAManager.onAdIconClicked ( int  index)

This is called when an icon is clicked.

Parameters
indexthe icon index

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.onAdModeEntered ( )

Load current IMA ad if no ad loaded and a IMA ad tag url is available.

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.onAdsManagerLoaded ( AdsManagerLoadedEvent  event)
boolean com.ooyala.android.imasdk.OoyalaIMAManager.onContentChanged ( )

Return true if there is a URL to load.

Returns
true if an adTagURL exists

Implements com.ooyala.android.plugin.AdPluginInterface.

boolean com.ooyala.android.imasdk.OoyalaIMAManager.onContentError ( int  errorCode)

Fire a IMAAdErrorCallback to IMA SDK.

Parameters
errorCode(never used)
Returns
false

Implements com.ooyala.android.plugin.AdPluginInterface.

boolean com.ooyala.android.imasdk.OoyalaIMAManager.onContentFinished ( )
Returns
true if has post-roll, false otherwise

Implements com.ooyala.android.plugin.AdPluginInterface.

boolean com.ooyala.android.imasdk.OoyalaIMAManager.onCuePoint ( int  cuePointIndex)

Always return false for IMA Ads since we only play ads when IMA SDK sends notification.

Parameters
cuePointIndex(never used)
Returns
false

Implements com.ooyala.android.plugin.AdPluginInterface.

boolean com.ooyala.android.imasdk.OoyalaIMAManager.onInitialPlay ( )
Returns
true if no pre-roll, false otherwise

Implements com.ooyala.android.plugin.AdPluginInterface.

boolean com.ooyala.android.imasdk.OoyalaIMAManager.onPlayheadUpdate ( int  playhead)

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
false for Ad-Rules. true if Non Ad-Rules should play an ad and false otherwise.

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.processClickThrough ( )

This is called to process click through.

Implements com.ooyala.android.AdsLearnMoreInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.reset ( )

Reset all IMA Ads Playback related fields and restart ads Playback.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.resetAds ( )

Reset all IMA Ads Playback related fields and restart ads Playback.

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.resume ( )

Resume suspended ads playback.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.resume ( int  timeInMilliSecond,
State  stateToResume 
)

Resume from given time with given state, but does not work for IMA Ads Playback.

Parameters
timeInMilliSecond(never used)
stateToResume(never used)

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.setAdsLoadedListener ( IMAAdsLoadedListener  imaAdsLoadedListener)

Expose AdsLoadedListener for integration with MOAT.

Parameters
imaAdsLoadedListenercallback implementer
void com.ooyala.android.imasdk.OoyalaIMAManager.setAdTagParameters ( Map< String, String >  adTagParameters)

Specify a map of Ad Tag parameters that will be appended to the ad tag This will not override already set parameters.

This will not query-string encode parameters. If you call this method twice, you override the parameters originally sent

Parameters
adTagParametersthe keys and values for ad tag parameters to be appended
void com.ooyala.android.imasdk.OoyalaIMAManager.setAdUrlOverride ( String  url)

Manually load an IMA Vast URL to initialize the IMA Manager.

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.

Parameters
urlVAST url for IMA
void com.ooyala.android.imasdk.OoyalaIMAManager.setContainerUpdatedListener ( IMAContainerUpdatedListener  imaContainerUpdatedListener)

Expose AdDisplayContainer for integration with MOAT.

Parameters
imaContainerUpdatedListenercallback implementer
void com.ooyala.android.imasdk.OoyalaIMAManager.setOnAdErrorListener ( IMAAdErrorListener  imaAdErrorListener)

Expose AdErrorListener for integration with MOAT.

Parameters
imaAdErrorListenercallback implementer
void com.ooyala.android.imasdk.OoyalaIMAManager.setOnAdEventListener ( IMAAdEventListener  imaAdEventListener)

Expose AdEventListener for integration with MOAT.

Parameters
imaAdEventListenercallback implementer
void com.ooyala.android.imasdk.OoyalaIMAManager.skipAd ( )

Skip current ad playback.

Implements com.ooyala.android.plugin.AdPluginInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.suspend ( )

Suspend ads playback.

Implements com.ooyala.android.plugin.LifeCycleInterface.

void com.ooyala.android.imasdk.OoyalaIMAManager.suspend ( boolean  onlyRemoveView)

This is called when plugin should be suspended.

Parameters
onlyRemoveViewTo remove video view

Implements com.ooyala.android.plugin.LifeCycleInterface.

Member Data Documentation

IMAAdPlayer com.ooyala.android.imasdk.OoyalaIMAManager._adPlayer = null
protected
AdsRenderingSettings com.ooyala.android.imasdk.OoyalaIMAManager._adRenderingSettings
protected
AdsLoader com.ooyala.android.imasdk.OoyalaIMAManager._adsLoader
protected
AdsManager com.ooyala.android.imasdk.OoyalaIMAManager._adsManager
protected
Map<String,String> com.ooyala.android.imasdk.OoyalaIMAManager._adTagParameters
protected
List<CompanionAdSlot> com.ooyala.android.imasdk.OoyalaIMAManager._companionAdSlots
protected
AdDisplayContainer com.ooyala.android.imasdk.OoyalaIMAManager._container
protected
List<Integer> com.ooyala.android.imasdk.OoyalaIMAManager._cuePoints
protected
boolean com.ooyala.android.imasdk.OoyalaIMAManager._onAdError

True if encounter error during ad playback.

OoyalaPlayerIMAWrapper com.ooyala.android.imasdk.OoyalaIMAManager._ooyalaPlayerWrapper
protected
OoyalaPlayer com.ooyala.android.imasdk.OoyalaIMAManager._player
protected
ImaSdkFactory com.ooyala.android.imasdk.OoyalaIMAManager._sdkFactory
protected
OoyalaIMAConfiguration com.ooyala.android.imasdk.OoyalaIMAManager.configuration
protected