Interface PulseSession
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)
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Notify the session that the content has played to completion.void
Notify the session that content playback has been paused by the user.void
contentPositionChanged
(float position) Notify the session that the content playback position has changed, either as a result of seeking or normal playback.void
Notify the session that content playback has started.void
extendSession
(ContentMetadata contentMetadata, RequestSettings requestSettings, PulseSessionExtensionListener listener) Request additional ads for the ad session.void
startSession
(PulseSessionListener listener) Start the ad session.void
Forcefully stop the session.
-
Method Details
-
startSession
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
- ThePulseSessionListener
listener 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
- thePulseSessionExtensionListener
that 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.
-