Back to Exoplayer

TimeBar (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/ui/TimeBar.html

latest5.7 KB
Original Source

Package com.google.android.exoplayer2.ui

Interface TimeBar

  • All Known Implementing Classes:DefaultTimeBar

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public interfaceTimeBar

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Interface for time bar views that can display a playback position, buffered position, duration and ad markers, and that have a listener for scrubbing (seeking) events.

Nested Class Summary

Nested Classes | Modifier and Type | Interface | Description | | --- | --- | --- | | static interface | TimeBar.OnScrubListener | Deprecated.

Listener for scrubbing events. |

Method Summary

All Methods Instance Methods Abstract Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | addListener​(TimeBar.OnScrubListener listener) | Deprecated.

Adds a listener for scrubbing events. | | long | getPreferredUpdateDelay() | Deprecated.

Returns the preferred delay in milliseconds of media time after which the time bar position should be updated. | | void | removeListener​(TimeBar.OnScrubListener listener) | Deprecated.

Removes a listener for scrubbing events. | | void | setAdGroupTimesMs​(long[] adGroupTimesMs, boolean[] playedAdGroups, int adGroupCount) | Deprecated.

Sets the times of ad groups and whether each ad group has been played. | | void | setBufferedPosition​(long bufferedPosition) | Deprecated.

Sets the buffered position. | | void | setDuration​(long duration) | Deprecated.

Sets the duration. | | void | setEnabled​(boolean enabled) | Deprecated. | | void | setKeyCountIncrement​(int count) | Deprecated.

Sets the position increment for key presses and accessibility actions, as a number of increments that divide the duration of the media. | | void | setKeyTimeIncrement​(long time) | Deprecated.

Sets the position increment for key presses and accessibility actions, in milliseconds. | | void | setPosition​(long position) | Deprecated.

Sets the current position. |

Method Detail

- 

addListener

void addListener​([TimeBar.OnScrubListener](TimeBar.OnScrubListener.html "interface in com.google.android.exoplayer2.ui")listener)

Deprecated.

Adds a listener for scrubbing events. Parameters:listener - The listener to add.

- 

removeListener

void removeListener​([TimeBar.OnScrubListener](TimeBar.OnScrubListener.html "interface in com.google.android.exoplayer2.ui")listener)

Deprecated.

Removes a listener for scrubbing events. Parameters:listener - The listener to remove.

- 

setEnabled

void setEnabled​(boolean enabled)

Deprecated. See Also:View.isEnabled()

- 

setKeyTimeIncrement

void setKeyTimeIncrement​(long time)

Deprecated.

Sets the position increment for key presses and accessibility actions, in milliseconds.

Clears any increment specified in a preceding call to setKeyCountIncrement(int).

Parameters:time - The time increment, in milliseconds.

- 

setKeyCountIncrement

void setKeyCountIncrement​(int count)

Deprecated.

Sets the position increment for key presses and accessibility actions, as a number of increments that divide the duration of the media. For example, passing 20 will cause key presses to increment/decrement the position by 1/20th of the duration (if known).

Clears any increment specified in a preceding call to setKeyTimeIncrement(long).

Parameters:count - The number of increments that divide the duration of the media.

- 

setPosition

void setPosition​(long position)

Deprecated.

Sets the current position. Parameters:position - The current position to show, in milliseconds.

- 

setBufferedPosition

void setBufferedPosition​(long bufferedPosition)

Deprecated.

Sets the buffered position. Parameters:bufferedPosition - The current buffered position to show, in milliseconds.

- 

setDuration

void setDuration​(long duration)

Deprecated.

Sets the duration. Parameters:duration - The duration to show, in milliseconds.

- 

getPreferredUpdateDelay

long getPreferredUpdateDelay()

Deprecated.

Returns the preferred delay in milliseconds of media time after which the time bar position should be updated. Returns:Preferred delay, in milliseconds of media time.

- 

setAdGroupTimesMs

void setAdGroupTimesMs​(@Nullable
                       long[] adGroupTimesMs,
                       @Nullable
                       boolean[] playedAdGroups,
                       int adGroupCount)

Deprecated.

Sets the times of ad groups and whether each ad group has been played. Parameters:adGroupTimesMs - An array where the first adGroupCount elements are the times of ad groups in milliseconds. May be null if there are no ad groups.playedAdGroups - An array where the first adGroupCount elements indicate whether the corresponding ad groups have been played. May be null if there are no ad groups.adGroupCount - The number of ad groups.