public class

PlaybackSeekUi.Client

extends java.lang.Object

 java.lang.Object

↳androidx.leanback.widget.PlaybackSeekUi.Client

Overview

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 PlaybackSeekUi.Client.onSeekStarted() event.

Summary

Constructors
publicClient()

Methods
public PlaybackSeekDataProvidergetPlaybackSeekDataProvider()

Called by PlaybackSeekUi asking for PlaybackSeekDataProvider.

public booleanisSeekEnabled()

Called by PlaybackSeekUi to query client if seek is allowed.

public voidonSeekFinished(boolean cancelled)

Called when cancelled or confirmed.

public voidonSeekPositionChanged(long pos)

Called when user seeks to a different location.

public voidonSeekStarted()

Event for start seeking.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Client()

Methods

public boolean isSeekEnabled()

Called by PlaybackSeekUi to query client if seek is allowed.

Returns:

True if allow PlaybackSeekUi to start seek, false otherwise.

public void onSeekStarted()

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

public PlaybackSeekDataProvider getPlaybackSeekDataProvider()

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

Returns:

PlaybackSeekDataProvider or null if no PlaybackSeekDataProvider is available.

public void onSeekPositionChanged(long pos)

Called when user seeks to a different location. This callback is called multiple times between PlaybackSeekUi.Client.onSeekStarted() and PlaybackSeekUi.Client.onSeekFinished(boolean).

Parameters:

pos: Position that user seeks to.

public void onSeekFinished(boolean cancelled)

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

Parameters:

cancelled: True if cancelled false if confirmed.