PlaybackSeekUi.Client


class PlaybackSeekUi.Client


Client (e.g. PlaybackGlue) to register on PlaybackSeekUi so that it can interact with Seeking UI. For example client(PlaybackGlue) will pause media when PlaybackSeekUi emits onSeekStarted event.

Summary

Public constructors

Public functions

PlaybackSeekDataProvider!

Called by PlaybackSeekUi asking for PlaybackSeekDataProvider.

Boolean

Called by PlaybackSeekUi to query client if seek is allowed.

Unit
onSeekFinished(cancelled: Boolean)

Called when cancelled or confirmed.

Unit

Called when user seeks to a different location.

Unit

Event for start seeking.

Public constructors

Client

Added in 1.1.0
Client()

Public functions

getPlaybackSeekDataProvider

Added in 1.1.0
fun getPlaybackSeekDataProvider(): PlaybackSeekDataProvider!

Called by PlaybackSeekUi asking for PlaybackSeekDataProvider. This method will be called after isSeekEnabled returns true. If client does not provide a PlaybackSeekDataProvider, client may directly seek media in onSeekPositionChanged.

Returns
PlaybackSeekDataProvider!

PlaybackSeekDataProvider or null if no PlaybackSeekDataProvider is available.

isSeekEnabled

Added in 1.1.0
fun isSeekEnabled(): Boolean

Called by PlaybackSeekUi to query client if seek is allowed.

Returns
Boolean

True if allow PlaybackSeekUi to start seek, false otherwise.

onSeekFinished

Added in 1.1.0
fun onSeekFinished(cancelled: Boolean): Unit

Called when cancelled or confirmed. When cancelled, client should restore playing from the position before onSeekStarted. When confirmed, client should seek to last updated onSeekPositionChanged.

Parameters
cancelled: Boolean

True if cancelled false if confirmed.

onSeekPositionChanged

Added in 1.1.0
fun onSeekPositionChanged(pos: Long): Unit

Called when user seeks to a different location. This callback is called multiple times between onSeekStarted and onSeekFinished.

Parameters
pos: Long

Position that user seeks to.

onSeekStarted

Added in 1.1.0
fun onSeekStarted(): Unit

Event for start seeking. Client will typically pause media and save the current position in the callback.