com.brightcove.pulse

## Class PulseComponent

- java.lang.Object
- - com.brightcove.player.event.AbstractComponent
  - - com.brightcove.pulse.PulseComponent

- All Implemented Interfaces:
    Component

      @ListensFor(events={"willChangeVideo","progress","pause","didPause","completed","play","didPlay","seekTo","adBreakStarted","adBreakCompleted"})
       @Emits(events={"adError","adBreakCompleted","willResumeContent","play"})
      public class PulseComponent
      extends AbstractComponent

  Pulse Component Plugin. This plugin facilitates displaying ads from the Pulse ad service.

  The main code to be implemented from this class:

       ...
       mPulseComponent = new PulseComponent("YourPulseHostUrl", getEventEmitter(), brightcoveVideoView);
       mPulseComponent.setListener(new PulseComponent.Listener() {
           &#64;Override
           public PulseSession onCreatePulseSession(&#64;NonNull String pulseHost,
                                                    &#64;NonNull Video video,
                                                    &#64;NonNull ContentMetadata contentMetadata,
                                                    &#64;NonNull RequestSettings requestSettings) {
               Pulse.setPulseHost(pulseHost, null, null);
               return  Pulse.createSession(contentMetadata, requestSettings);
           }

           &#64;Override
           public void onOpenClickthrough(@NonNull PulseVideoAd pulseVideoAd) {
               Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(pulseVideoAd.getClickthroughURL().toString()));
               startActivity(intent);
               pulseVideoAd.adClickThroughTriggered();
           }
       });
       ...

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `PulseComponent.Listener` Listener of the Pulse Component.

  - ### Field Summary

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

      `eventEmitter, listenerTokens`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PulseComponent(java.lang.String pulseHostUrl, EventEmitter eventEmitter, BaseVideoView baseVideoView)` Pulse Component constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `release()` Releases the Pulse component.
    `void` | `setListener(PulseComponent.Listener listener)` Sets the `PulseComponent.Listener` to report callbacks.

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

      `addListener, addOnceListener, getEventEmitter, removeListener, removeListeners`

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

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

- - ### Constructor Detail

    - #### PulseComponent

          public PulseComponent(@NonNull
                                java.lang.String pulseHostUrl,
                                @NonNull
                                EventEmitter eventEmitter,
                                @NonNull
                                BaseVideoView baseVideoView)

      Pulse Component constructor.
      Parameters:
        `pulseHostUrl` - url of the Pulse Host
        `eventEmitter` - event emitter from the content player.
        `baseVideoView` - VideoView of the content player.

  - ### Method Detail

    - #### setListener

          public void setListener(PulseComponent.Listener listener)

      Sets the `PulseComponent.Listener` to report callbacks.
      Parameters:
        `listener` - listener to be set.

    - #### release

          public void release()

      Releases the Pulse component.