Set up ad insertion metadata

Use the helper class AuditudeSettings to set up Adobe Primetime ad decisioning metadata.

TIP

Adobe Primetime ad decisioning was previously known as Auditude .

  1. Build the AuditudeSettings instance.

    AuditudeSettings auditudeSettings = new AuditudeSettings();
    
  2. Set the Adobe Primetime ad decisioning mediaID, zoneID, domain, and the optional targeting parameters.

    auditudeSettings.domain = "yourdomain";
    auditudeSettings.mediaId = "mediaid";
    auditudeSettings.zoneId = "zoneid";
    
  3. Create a MediaResource instance by using the media stream URL and the previously created advertising metadata.

    mediaResource = new AdobePSDK.MediaResource (
          resourceUrl,
          resourceType,
          auditudeSettings);
    
  4. Load the MediaResource object through the MediaPlayer.replaceCurrentResource(resource) method.

    The MediaPlayer starts loading and processing the media stream manifest.

  5. When the MediaPlayer transitions to the INITIALIZED status, get the media stream characteristics in the form of a MediaPlayerItem instance through the MediaPlayer.CurrentItem attribute.

  6. (Optional) Query the MediaPlayerItem instance to see whether the stream is live, regardless of whether it has alternate audio tracks.

    This information can help you prepare the UI for the playback. For example, if you know there are two audio tracks, you can include a UI control that toggles between these tracks.

  7. Call MediaPlayer.prepareToPlay to start the advertising workflow.

    After the ads have been resolved and placed on the timeline, the MediaPlayer transitions to the PREPARED state.

  8. Call MediaPlayer.play to start the playback.
    Browser TVSDK now includes ads when your media plays.

On this page