Interface PulseSession


public interface PulseSession
This interface is used to interact with an ad session.

You must notify this object of the following events:

The session will notify you through the listener provided to startSession(PulseSessionListener).

  • Method Details

    • 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 through PulseSessionListener.startContentPlayback().

      Parameters:
      listener - The PulseSessionListener 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 - the PulseSessionExtensionListener 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 to contentPaused().

    • 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.