public interface

AudioPlaybackController

com.pspdfkit.ui.audio.AudioPlaybackController

Class Overview

Controller given when entering audio playback mode.

Summary

Nested Classes
interface AudioPlaybackController.AudioPlaybackListener Listener for audio playback events. 
Public Methods
abstract void addAudioPlaybackListener(AudioPlaybackController.AudioPlaybackListener listener)
Registers a AudioPlaybackController.AudioPlaybackListener to get notified when audio playback state changes.
abstract void exitAudioPlaybackMode()
Leaves playback mode.
abstract AudioModeManager getAudioModeManager()
Returns the audio mode manager from this controller.
abstract int getCurrentPosition()
Returns current playback position in milliseconds.
abstract int getDuration()
Returns total playback duration in milliseconds.
abstract boolean isReady()
Checks whether the media is ready to be played.
abstract boolean isResumed()
Checks whether the media playback is currently resumed.
abstract void pause()
Pauses playback of the media.
abstract void removeAudioPlaybackListener(AudioPlaybackController.AudioPlaybackListener listener)
Removes a previously registered AudioPlaybackController.AudioPlaybackListener.
abstract void resume()
Resumes playback of the media.
abstract void seekTo(int offsetMillis)
Seeks to a specified offset in the media.
abstract void toggle()
Toggles audio playback state.

Public Methods

public abstract void addAudioPlaybackListener (AudioPlaybackController.AudioPlaybackListener listener)

Registers a AudioPlaybackController.AudioPlaybackListener to get notified when audio playback state changes. If the provider has been registered previously, this method will be a no-op.

Parameters
listener Listener to register. Must be non-null.

public abstract void exitAudioPlaybackMode ()

Leaves playback mode.

public abstract AudioModeManager getAudioModeManager ()

Returns the audio mode manager from this controller.

Returns
  • Audio mode manager.

public abstract int getCurrentPosition ()

Returns current playback position in milliseconds.

public abstract int getDuration ()

Returns total playback duration in milliseconds.

public abstract boolean isReady ()

Checks whether the media is ready to be played.

public abstract boolean isResumed ()

Checks whether the media playback is currently resumed.

public abstract void pause ()

Pauses playback of the media.

public abstract void removeAudioPlaybackListener (AudioPlaybackController.AudioPlaybackListener listener)

Removes a previously registered AudioPlaybackController.AudioPlaybackListener. If the provider hasn't been registered previously, this method will be a no-op.

Parameters
listener Listener to unregister. Must be non-null.

public abstract void resume ()

Resumes playback of the media.

public abstract void seekTo (int offsetMillis)

Seeks to a specified offset in the media.

Parameters
offsetMillis Offset to seek to in milliseconds.

public abstract void toggle ()

Toggles audio playback state.