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
Modifier and TypeClassDescriptionstatic interface
Listener of the Pulse Component. -
Field Summary
Fields inherited from class com.brightcove.player.event.AbstractComponent
eventEmitter, listenerTokens
-
Constructor Summary
ConstructorDescriptionPulseComponent
(String pulseHostUrl, EventEmitter eventEmitter, BaseVideoView baseVideoView) Pulse Component constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
PulseComponent
public PulseComponent(@NonNull 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 Details
-
setListener
Sets thePulseComponent.Listener
to report callbacks.- Parameters:
listener
- listener to be set.
-
release
public void release()Releases the Pulse component.
-