PlaybackSeekUi.Client

public 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 methods

PlaybackSeekDataProvider

Called by PlaybackSeekUi asking for PlaybackSeekDataProvider.

boolean

Called by PlaybackSeekUi to query client if seek is allowed.

void
onSeekFinished(boolean cancelled)

Called when cancelled or confirmed.

void

Called when user seeks to a different location.

void

Event for start seeking.

Public constructors

Client

Added in 1.1.0
public Client()

Public methods

getPlaybackSeekDataProvider

Added in 1.1.0
public PlaybackSeekDataProvider getPlaybackSeekDataProvider()

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
public boolean isSeekEnabled()

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
public void onSeekFinished(boolean cancelled)

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
boolean cancelled

True if cancelled false if confirmed.

onSeekPositionChanged

Added in 1.1.0
public void onSeekPositionChanged(long pos)

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

Parameters
long pos

Position that user seeks to.

onSeekStarted

Added in 1.1.0
public void onSeekStarted()

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