Interface PulseSession
-
public interface PulseSessionThis interface is used to interact with an ad session.You must notify this object of the following events:
- The content has started:
contentStarted(). - The content playback position has changed:
contentPositionChanged(float). - The content has been paused:
contentPaused(). - The content has played to completion:
contentFinished().
The session will notify you through the listener provided to
startSession(PulseSessionListener). - The content has started:
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcontentFinished()Notify the session that the content has played to completion.voidcontentPaused()Notify the session that content playback has been paused by the user.voidcontentPositionChanged(float position)Notify the session that the content playback position has changed, either as a result of seeking or normal playback.voidcontentStarted()Notify the session that content playback has started.voidextendSession(ContentMetadata contentMetadata, RequestSettings requestSettings, PulseSessionExtensionListener listener)Request additional ads for the ad session.voidstartSession(PulseSessionListener listener)Start the ad session.voidstopSession()Forcefully stop the session.
-
-
-
Method Detail
-
startSession
void startSession(PulseSessionListener listener)
Start the ad session. The provided listener will be notified when to play the content/ads.This will trigger an ad break through
PulseSessionListener.startAdBreak(PulseAdBreak). if any prerolls ads are available, otherwise it will trigger the start of the content throughPulseSessionListener.startContentPlayback().- Parameters:
listener- ThePulseSessionListenerlistener that will be notified.
-
extendSession
void extendSession(ContentMetadata contentMetadata, RequestSettings requestSettings, PulseSessionExtensionListener listener)
Request additional ads for the ad session.- Parameters:
contentMetadata- Information about the content which a requested ad session is to be played with, as well as information targeting the desired campaign(s).requestSettings- Information about the environment in which the requested ad(s) will play.listener- thePulseSessionExtensionListenerthat will be called when the session extension completes.
-
stopSession
void stopSession()
Forcefully stop the session.This may be called at any time during a session. No further listener methods will be called after the session is stopped.
-
contentStarted
void contentStarted()
Notify the session that content playback has started.This should only be called after your listener has been instructed to play the content through
PulseSessionListener.startContentPlayback(), or if you have previously paused it with a call tocontentPaused().
-
contentPositionChanged
void contentPositionChanged(float position)
Notify the session that the content playback position has changed, either as a result of seeking or normal playback.This may trigger an ad break through
PulseSessionListener.startAdBreak(PulseAdBreak)if any midroll ads are available.- Parameters:
position- The content position in seconds since start.
-
contentPaused
void contentPaused()
Notify the session that content playback has been paused by the user.This may trigger a pause ad to display through
PulseSessionListener.showPauseAd(PulsePauseAd), if such an ad is available.
-
contentFinished
void contentFinished()
Notify the session that the content has played to completion.This may trigger an ad break through
PulseSessionListener.startAdBreak(PulseAdBreak)if any postroll ads are available.
-
-