@ListensFor(events={"willChangeVideo","progress","pause","didPause","completed","play","didPlay","seekTo","adBreakStarted","adBreakCompleted"}) @Emits(events={"adError","adBreakCompleted","willResumeContent","play"}) public class PulseComponent extends AbstractComponent
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();
}
});
...
Modifier and Type | Class and Description |
---|---|
static interface |
PulseComponent.Listener
Listener of the Pulse Component.
|
eventEmitter, listenerTokens
Constructor and Description |
---|
PulseComponent(java.lang.String pulseHostUrl,
EventEmitter eventEmitter,
BaseVideoView baseVideoView)
Pulse Component constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
release()
Releases the Pulse component.
|
void |
setListener(PulseComponent.Listener listener)
Sets the
PulseComponent.Listener to report callbacks. |
addListener, addOnceListener, getEventEmitter, removeListener, removeListeners
public PulseComponent(@NonNull java.lang.String pulseHostUrl, @NonNull EventEmitter eventEmitter, @NonNull BaseVideoView baseVideoView)
pulseHostUrl
- url of the Pulse HosteventEmitter
- event emitter from the content player.baseVideoView
- VideoView of the content player.public void setListener(PulseComponent.Listener listener)
PulseComponent.Listener
to report callbacks.listener
- listener to be set.public void release()