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 |
|---|
Client() |
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 |
onSeekPositionChanged(long pos)Called when user seeks to a different location. |
void |
Event for start seeking. |
Public constructors
Public methods
getPlaybackSeekDataProvider
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
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
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
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
public void onSeekStarted()
Event for start seeking. Client will typically pause media and save the current position in the callback.