DefaultAudioPlayerAgent

class DefaultAudioPlayerAgent(    mediaPlayer: MediaPlayerInterface,     messageSender: MessageSender,     focusManager: SeamlessFocusManagerInterface,     contextManager: ContextManagerInterface,     playbackRouter: PlaybackRouter,     playSynchronizer: PlaySynchronizerInterface,     directiveSequencer: DirectiveSequencerInterface,     directiveGroupProcessor: DirectiveGroupProcessorInterface,     channelName: String,     enableDisplayLifeCycleManagement: Boolean,     audioPlayerTemplateHandler: AudioPlayerTemplateHandler?) : CapabilityAgent, SupportedInterfaceContextProvider, ChannelObserver, AudioPlayerAgentInterface, PlaybackHandler, MediaPlayerControlInterface.PlaybackEventListener, AudioPlayerLyricsDirectiveHandler.VisibilityController, AudioPlayerLyricsDirectiveHandler.PagingController, PlayStackManagerInterface.PlayContextProvider

Constructors

Link copied to clipboard
fun DefaultAudioPlayerAgent(    mediaPlayer: MediaPlayerInterface,     messageSender: MessageSender,     focusManager: SeamlessFocusManagerInterface,     contextManager: ContextManagerInterface,     playbackRouter: PlaybackRouter,     playSynchronizer: PlaySynchronizerInterface,     directiveSequencer: DirectiveSequencerInterface,     directiveGroupProcessor: DirectiveGroupProcessorInterface,     channelName: String,     enableDisplayLifeCycleManagement: Boolean,     audioPlayerTemplateHandler: AudioPlayerTemplateHandler?)

Types

Link copied to clipboard
inner class AudioInfo(    val payload: DefaultAudioPlayerAgent.PlayPayload,     val directive: Directive,     val playServiceId: String) : PlaySynchronizerInterface.SynchronizeObject
Link copied to clipboard
object Companion
Link copied to clipboard
inner class LifeCycleScheduler

AudioPlayer's release rule:

Link copied to clipboard
enum PauseReason : Enum<DefaultAudioPlayerAgent.PauseReason>
Link copied to clipboard
data class PlayPayload(    val sourceType: DefaultAudioPlayerAgent.SourceType?,     val playServiceId: String,     val cacheKey: String?,     val audioItem: AudioItem,     val playStackControl: PlayStackControl?)
Link copied to clipboard
enum SourceType : Enum<DefaultAudioPlayerAgent.SourceType>

Functions

Link copied to clipboard
open override fun addListener(listener: AudioPlayerAgentInterface.Listener, requestCurrentState: Boolean)

Add a listener to be called when a state changed.

Link copied to clipboard
open override fun addOnDurationListener(listener: AudioPlayerAgentInterface.OnDurationListener, requestCurrentState: Boolean)

Add a listener to be called when duration retrieved

Link copied to clipboard
open override fun addOnPlaybackListener(listener: AudioPlayerAgentInterface.OnPlaybackListener)

Add a playback listener

Link copied to clipboard
open override fun controlPage(playServiceId: String, direction: Direction): Boolean
Link copied to clipboard
open override fun displayCardCleared(templateId: String)

Notifies the display that has been cleared.

Link copied to clipboard
open override fun displayCardRendered(templateId: String, controller: AudioPlayerDisplayInterface.Controller?)

Notifies the display that has been rendered.

Link copied to clipboard
open override fun displayCardRenderFailed(templateId: String)

Notifies the display that has been render failed.

Link copied to clipboard
open override fun getOffset(unit: TimeUnit): Long

Gets the current playback offset

Link copied to clipboard
open override fun getPlayContext(): PlayStackManagerInterface.PlayContext?
Link copied to clipboard
open override fun hide(playServiceId: String): Boolean
Link copied to clipboard
open override fun next()

Starts next playback if available

Link copied to clipboard
open override fun notifyUserInteractionOnDisplay(templateId: String)

This should be called when occur interaction(input event such as touch, drag, etc...) for display

Link copied to clipboard
open override fun onButtonPressed(button: PlaybackButton)

Called on playback button is pressed.

Link copied to clipboard
open override fun onFocusChanged(newFocus: FocusState)
Link copied to clipboard
open override fun onPlaybackError(    id: SourceId,     type: ErrorType,     error: String)
Link copied to clipboard
open override fun onPlaybackFinished(id: SourceId)
Link copied to clipboard
open override fun onPlaybackPaused(id: SourceId)
Link copied to clipboard
open override fun onPlaybackResumed(id: SourceId)
Link copied to clipboard
open override fun onPlaybackStarted(id: SourceId)
Link copied to clipboard
open override fun onPlaybackStopped(id: SourceId)
Link copied to clipboard
open override fun pause()

Pauses playback

Link copied to clipboard
open override fun play()

Starts or resumes playback.

Link copied to clipboard
open override fun prev()

Starts previous playback if available

Link copied to clipboard
open override fun provideState(    contextSetter: ContextSetterInterface,     namespaceAndName: NamespaceAndName,     contextType: ContextType,     stateRequestToken: Int)
Link copied to clipboard
open override fun removeListener(listener: AudioPlayerAgentInterface.Listener)

Remove a listener

Link copied to clipboard
open override fun removeOnDurationListener(listener: AudioPlayerAgentInterface.OnDurationListener)

Remove a listener

Link copied to clipboard
open override fun removeOnPlaybackListener(listener: AudioPlayerAgentInterface.OnPlaybackListener)

Remove a playback listener

Link copied to clipboard
open override fun requestFavoriteCommand(current: Boolean)

Request the favorite command if supported.

Link copied to clipboard
open override fun requestRepeatCommand(current: AudioPlayerAgentInterface.RepeatMode)

Request the repeat command if supported.

Link copied to clipboard
open override fun requestShuffleCommand(current: Boolean)

Request the shuffle command if supported

Link copied to clipboard
open override fun seek(offsetInMilliseconds: Long)

Seeks to specified time position

Link copied to clipboard
open override fun setElementSelected(    templateId: String,     token: String,     postback: String?,     callback: DisplayInterface.OnElementSelectedCallback?): String

Each element has it's own token.

Link copied to clipboard
open override fun setLyricsPresenter(presenter: LyricsPresenter?)

Set a presenter for lyrics

Link copied to clipboard
open override fun setRenderer(renderer: AudioPlayerDisplayInterface.Renderer?)

Set a renderer to interact with the display agent.

Link copied to clipboard
open override fun setRequestCommandHandler(handler: AudioPlayerAgentInterface.RequestCommandHandler)
Link copied to clipboard
open override fun show(playServiceId: String): Boolean
Link copied to clipboard
fun shutdown()
Link copied to clipboard
open override fun stop()

Stops playback

Properties

Link copied to clipboard
var lyricsPresenter: LyricsPresenter? = null
Link copied to clipboard
open override val namespaceAndName: NamespaceAndName