Integration with Ooyala Pulse on Android

What You Need

With the Ooyala SDK for integrating Ooyala Pulse, the same advertising experience you have created on the desktop can be created on mobile devices when supported.

To get started with the integration between your Ooyala Player V4 and ad serving from Ooyala Pulse on Android, you will need the following:

Sample Application

The Ooyala Pulse sample app is available for download at the Ooyala Sample app Git Hub. The location also contains information on how to set up your project and how the sample app works.

Getting Started

The following steps give a rudimentary overview of how to get started with your integration between the Ooyala Player and Ooyala Pulse for ad serving on Android:

  1. Import the Ooyala Video Advertising Android 2.x SDK and the Ooyala SDK for Ooyala Pulse Android into your project.
    import com.ooyala.pulse;
    import com.ooyala.android.pulseintegration;
  2. Create an OoyalaPulseManager object and associate it with your OoyalaPlayer:
    this.manager = new OoyalaPulseManager(this.ooyalaPlayer);
    this.manager.setListener(this);
    
  3. Optionally, set any ad player options through the PulsePlayerOptions object on the OoyalaPulseManager. Possible options are:
    • displayAdTitle: Boolean indicating whether to show the ad title during the ad playback or not. Default value is false, and indicates to not show the ad title.
    this.manager.setOptions(new PulsePlayerOptions(true));
    Note: The ad player options have no influence on the video content player.
  4. Implement the OoyalaPulseManager.Listener method in your delegate. Initial values for all parameters in this method are automatically taken from settings in your Backlot account, but if needed, you may modify the host location of your Ooyala Pulse account, persistent ID, content metadata, request settings and so on, before creating the session. For all possible parameters, refer to Parameters for Ooyala Pulse on Android .
    @Override 
    public PulseSession createPulseSession(OoyalaPulseManager ooyalaPulseManager, Video video, String pulseHost, ContentMetadata contentMetadata, RequestSettings requestSettings) {
      // Set the correct pulse host and options
      Pulse.setPulseHost(pulseHost, nil, nil);
    
      // Set the width and height to that of the view that will contain the ads. 
      requestSettings.width = containerView.getWidth();
      requestSettings.height = containerView.getHeight();
    
      // Implement a way of determining the max bitrate of ads to request. 
      requestSettings.setMaxBitRate(BandwidthChecker.getMaxBitRate());
    
      return Pulse.createSession(contentMetadata, requestSettings);
    }

Essential Parameters, Custom Metadata and Videoplaza Ad Set

To make use of Ooyala Pulse ad serving in the Mobile SDK, you must create an ad set of type Videoplaza in Backlot. See the Backlot User Guide for details. Ooyala allows you to store Ooyala Pulse related parameters in a variety of locations. In order of precedence, Pulse parameters and their values can be defined in:

  1. Your app itself.
  2. In the Backlot MANAGE tab, for each video asset as custom metadata defined in the Custom Metadata tab.
  3. In the Backlot MONETIZE tab, Ad Sets subtab for the Videoplaza type of ad set.
Note: When setting parameters directly in your app, you have to set them before the Ooyala Pulse Session is created.
The following parameter has to be set either directly in your app, in Backlot as custom metadata on the asset, or in the Videoplaza ad set (recommended) associated with the asset:
  • Pulse host: the URL to your Ooyala Pulse account. In the app, you would set this parameter with the Pulse.setPulseHost(pulseHost, deviceContainer, persistentId) method, where you can also set the deviceContainer and the persistentId. It is recommended to set deviceContainer to nil. For example:
    Pulse.setPulseHost("https://pulse-demo.videoplaza.tv", nil, nil);
Other significant parameters are set through the following objects:
  • Request settings object: information about the ad positions and quality of ads you want to request from Ooyala Pulse. The properties of this object are listed on RequestSettings.
  • Content metadata object: information about the video content chosen for playback in the app, which helps in requesting targeted ads from Ooyala Pulse. The properties of this object are listed on ContentMetadata.
For an overview of each parameter, where it can be set, and where the base values are located, see Parameters for Ooyala Pulse on Android.

Was this article helpful?