Integrating 3rd Party Ad Plugins
Learn how to quickly create your own ad plugins for the Ooyala Player.
The Ooyala Android Mobile SDK allows you to create an ad player and add it as a plugin to the Ooyala Player.
- To get started, create an ad plugin, which provides the player with information about the ads. To create the plugin, you must implement the com.ooyala.android.plugin.AdPluginInterface interface. You may optionally implement the com.ooyala.android.StateNotifierListener interface: Start by modifying a copy of the SampleAdPlugin, and override the methods in the required and optional interfaces.
- Now you can create an ad player that handles ad playback. To create the ad player, you must implement the com.ooyala.android.player.PlayerInterface and com.ooyala.android.plugin.LifeCycleInterface. Start by modifying a copy of the SampleAdPlayer, and override the methods in the required interfaces.
The final step is to register the plugin with the Ooyala Player.
To do this, invoke the
com.ooyala.android.OoyalaPlayer.registerPlugin() method, passing a
reference to your plugin object (for example, SampleAdPlugin), as shown
in the following
player = new OoyalaPlayer(PCODE, new PlayerDomain(DOMAIN)); SampleAdPlugin plugin = new SampleAdPlugin(this, player); player.registerPlugin(plugin);
To view a complete example, see PluginPlayerActivity.