com.brightcove.pulse

## Class PulseAdPlayer

- java.lang.Object
- - com.brightcove.pulse.PulseAdPlayer

- All Implemented Interfaces:
    AdPlayer<com.ooyala.pulse.PulseVideoAd>

      public final class PulseAdPlayer
      extends java.lang.Object
      implements AdPlayer<com.ooyala.pulse.PulseVideoAd>

  Represents an `AdPlayer` capable of handling a PulseVideoAd.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.brightcove.player.ads.AdPlayer

      `AdPlayer.AdPlayerSettings, AdPlayer.Listener<T>`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener)` Adds a `AdPlayer.Listener`.
    `static PulseAdPlayer` | `createWithExoplayer(BaseVideoView baseVideoView, com.ooyala.pulse.PulseAdBreak pulseAdBreak, AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener, com.brightcove.pulse.PulseAdPlayer.PulseOnClickListener pulseOnClickListener)` Creates a `PulseAdPlayer` using an `ExoAdPlayer` to delegate playback commands.
    `void` | `loadAd(com.ooyala.pulse.PulseVideoAd pulseVideoAd)` Loads an ad of type T.
    `void` | `pauseAd()` Pauses an ad.
    `void` | `playAd()` Plays an ad.
    `void` | `release()` Releases the `AdPlayer`.
    `void` | `removeListener(AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener)` Removes a `AdPlayer.Listener`.
    `void` | `seekTo(long position)` Seeks to the specified position.
    `void` | `skipAd()` Skips the current ad.

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

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

- - ### Method Detail

    - #### createWithExoplayer

          @NonNull
          public static PulseAdPlayer createWithExoplayer(@NonNull
                                                                   BaseVideoView baseVideoView,
                                                                   @NonNull
                                                                   com.ooyala.pulse.PulseAdBreak pulseAdBreak,
                                                                   @NonNull
                                                                   AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener,
                                                                   @NonNull
                                                                   com.brightcove.pulse.PulseAdPlayer.PulseOnClickListener pulseOnClickListener)

      Creates a `PulseAdPlayer` using an `ExoAdPlayer` to delegate playback commands.
      Parameters:
        `baseVideoView` - the video view where the content video is displayed.
        `pulseAdBreak` - the current pulse ad break.
        `listener` - a listener to receive playback events.
        `pulseOnClickListener` - the listener to receive UI/click events.
      Returns:
        a new instance of a `PulseAdPlayer`.

    - #### addListener

          public void addListener(@NonNull
                                  AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener)

      Description copied from interface: `AdPlayer`
      Adds a `AdPlayer.Listener`.
      Specified by:
        `addListener` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`
      Parameters:
        `listener` - listener to be added.

    - #### removeListener

          public void removeListener(@NonNull
                                     AdPlayer.Listener<com.ooyala.pulse.PulseVideoAd> listener)

      Description copied from interface: `AdPlayer`
      Removes a `AdPlayer.Listener`.
      Specified by:
        `removeListener` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`
      Parameters:
        `listener` - listener to be removed.

    - #### loadAd

          public void loadAd(@NonNull
                             com.ooyala.pulse.PulseVideoAd pulseVideoAd)

      Description copied from interface: `AdPlayer`
      Loads an ad of type T.
      Specified by:
        `loadAd` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`
      Parameters:
        `pulseVideoAd` - ad to be loaded.

    - #### playAd

          public void playAd()

      Description copied from interface: `AdPlayer`
      Plays an ad.
      Specified by:
        `playAd` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`

    - #### pauseAd

          public void pauseAd()

      Description copied from interface: `AdPlayer`
      Pauses an ad.
      Specified by:
        `pauseAd` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`

    - #### seekTo

          public void seekTo(long position)

      Description copied from interface: `AdPlayer`
      Seeks to the specified position.
      Specified by:
        `seekTo` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`

    - #### release

          public void release()

      Description copied from interface: `AdPlayer`
      Releases the `AdPlayer`.
      Specified by:
        `release` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`

    - #### skipAd

          public void skipAd()

      Description copied from interface: `AdPlayer`
      Skips the current ad.
      Specified by:
        `skipAd` in interface `AdPlayer<com.ooyala.pulse.PulseVideoAd>`