com.brightcove.ssai

## Class SSAIComponent

- java.lang.Object
- - com.brightcove.player.event.AbstractComponent
  - - com.brightcove.ssai.SSAIComponent

- All Implemented Interfaces:
    Component

      @ListensFor(events={"didSetSource","didSelectSource"})
       @Emits(events={"adDataReady","error"})
      public class SSAIComponent
      extends AbstractComponent

  Provide a class to support the Brightcove Server Side Ad Insertion (SSAI) functionality.

- - ### Field Summary

    - ### Fields inherited from class com.brightcove.player.event.AbstractComponent

      `eventEmitter, listenerTokens`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSAIComponent(android.content.Context context, BaseVideoView baseVideoView)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCompanionContainer(android.view.ViewGroup companionContainer)` Add an additional companion ad container.
    `void` | `clearCompanionContainers()` Clear all companion ad containers currently being used in the plugin.
    `void` | `processVideo(java.lang.String adDataUrl)` Process a video given an ad metadata URL and a content URL.
    `void` | `processVideo(Video video)` Process a video that has a VMAP url in at least one if its sources.
    `void` | `removeListeners()` Removes all set listeners from the EventEmitter.
    `void` | `updateAdTargetingValues(java.util.Map<java.lang.String,java.lang.String> adTargetingValues)` Updates the key/value pairs used for audience segment targeting.

    - ### Methods inherited from class com.brightcove.player.event.AbstractComponent

      `addListener, addOnceListener, getEventEmitter, removeListener`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SSAIComponent

          public SSAIComponent(@NonNull
                               android.content.Context context,
                               @NonNull
                               BaseVideoView baseVideoView)

  - ### Method Detail

    - #### processVideo

          public void processVideo(@NonNull
                                   Video video)

      Process a video that has a VMAP url in at least one if its sources.
      Parameters:
        `video` - the video to play.
      See Also:
        `Source`, `SourceCollection`

    - #### processVideo

          public void processVideo(@NonNull
                                   java.lang.String adDataUrl)

      Process a video given an ad metadata URL and a content URL. Default to using the VMAP technology and XML data bindings.
      Parameters:
        `adDataUrl` - The given VMAP ad server URL.

    - #### updateAdTargetingValues

          public void updateAdTargetingValues(@NonNull
                                              java.util.Map<java.lang.String,java.lang.String> adTargetingValues)

      Updates the key/value pairs used for audience segment targeting. These values will be appended to the VMAP Url. For example, if you provide the following map:

           Map<String, String> audienceSegmentTargetingValues = new HashMap<>();
           audienceSegmentTargetingValues.put("section", "sports");
           audienceSegmentTargetingValues.put("multi", "baseball,tennis");

      The following string will be appended to the provided VMAP Url:

      "§ion=sports&multi=baseball%2Ctennis"

    - #### addCompanionContainer

          public void addCompanionContainer(android.view.ViewGroup companionContainer)

      Add an additional companion ad container.
      Parameters:
        `companionContainer` - The new companion ad container.

    - #### clearCompanionContainers

          public void clearCompanionContainers()

      Clear all companion ad containers currently being used in the plugin.

    - #### removeListeners

          public void removeListeners()

      Description copied from class: `AbstractComponent`
      Removes all set listeners from the EventEmitter.
      Overrides:
        `removeListeners` in class `AbstractComponent`