Package 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","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(); } }); ...
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 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 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 Description void
release()
Releases the Pulse component.void
setListener(PulseComponent.Listener listener)
Sets thePulseComponent.Listener
to report callbacks.-
Methods inherited from class com.brightcove.player.event.AbstractComponent
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
-
-
-
-
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 HosteventEmitter
- event emitter from the content player.baseVideoView
- VideoView of the content player.
-
-
Method Detail
-
setListener
public void setListener(PulseComponent.Listener listener)
Sets thePulseComponent.Listener
to report callbacks.- Parameters:
listener
- listener to be set.
-
release
public void release()
Releases the Pulse component.
-
-