Class PulseComponent

  • All Implemented Interfaces:
    Component

    @ListensFor(events={"willChangeVideo","progress","pause","didPause","completed","play","didPlay","seekTo","adBreakStarted","adBreakCompleted"})
    @Emits(events={"adError","adBreakCompleted","willResumeContent","play","registerPlugin"})
    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() {
         @Override
         public PulseSession onCreatePulseSession(@NonNull String pulseHost,
                                                  @NonNull Video video,
                                                  @NonNull ContentMetadata contentMetadata,
                                                  @NonNull RequestSettings requestSettings) {
             Pulse.setPulseHost(pulseHost, null, null);
             return  Pulse.createSession(contentMetadata, requestSettings);
         }
    
         @Override
         public void onOpenClickthrough(@NonNull PulseVideoAd pulseVideoAd) {
             Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(pulseVideoAd.getClickthroughURL().toString()));
             startActivity(intent);
             pulseVideoAd.adClickThroughTriggered();
         }
     });
     ...
     
     
    • 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

      • release

        public void release()
        Releases the Pulse component.