docs/doc/reference/com/google/android/exoplayer2/SeekParameters.html
Package com.google.android.exoplayer2
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classSeekParametersextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
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.
Parameters that apply to seeking.
The predefined EXACT, CLOSEST_SYNC, PREVIOUS_SYNC and NEXT_SYNC parameters are suitable for most use cases. Seeking to sync points is typically faster but less accurate than exact seeking.
In the general case, an instance specifies a maximum tolerance before (toleranceBeforeUs) and after (toleranceAfterUs) a requested seek position (x). If one or more sync points falls within the window [x - toleranceBeforeUs, x + toleranceAfterUs] then the seek will be performed to the sync point within the window that's closest to x. If no sync point falls within the window then the seek will be performed to x - toleranceBeforeUs. Internally the player may need to seek to an earlier sync point and discard media until this position is reached.
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static SeekParameters | CLOSEST_SYNC |
Deprecated.
Parameters for seeking to the closest sync point.
|
| static SeekParameters | DEFAULT |
Deprecated.
Default parameters.
|
| static SeekParameters | EXACT |
Deprecated.
Parameters for exact seeking.
|
| static SeekParameters | NEXT_SYNC |
Deprecated.
Parameters for seeking to the sync point immediately after a requested seek position.
|
| static SeekParameters | PREVIOUS_SYNC |
Deprecated.
Parameters for seeking to the sync point immediately before a requested seek position.
|
| long | toleranceAfterUs |
Deprecated.
The maximum time that the actual position seeked to may exceed the requested seek position, in microseconds.
|
| long | toleranceBeforeUs |
Deprecated.
The maximum time that the actual position seeked to may precede the requested seek position, in microseconds. |
Constructors | Constructor | Description |
| --- | --- |
| SeekParameters(long toleranceBeforeUs, long toleranceAfterUs) |
Deprecated.
|
All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| boolean | equals(Object obj) |
Deprecated.
|
| int | hashCode() |
Deprecated.
|
| long | resolveSeekPositionUs(long positionUs, long firstSyncUs, long secondSyncUs) |
Deprecated.
Resolves a seek based on the parameters, given the requested seek position and two candidate sync points. |
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
public static final[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")EXACT
Deprecated.
Parameters for exact seeking.
-
public static final[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")CLOSEST_SYNC
Deprecated.
Parameters for seeking to the closest sync point.
-
public static final[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")PREVIOUS_SYNC
Deprecated.
Parameters for seeking to the sync point immediately before a requested seek position.
-
public static final[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")NEXT_SYNC
Deprecated.
Parameters for seeking to the sync point immediately after a requested seek position.
-
public static final[SeekParameters](SeekParameters.html "class in com.google.android.exoplayer2")DEFAULT
Deprecated.
Default parameters.
-
public final long toleranceBeforeUs
Deprecated.
The maximum time that the actual position seeked to may precede the requested seek position, in microseconds.
-
public final long toleranceAfterUs
Deprecated.
The maximum time that the actual position seeked to may exceed the requested seek position, in microseconds.
-
public SeekParameters(long toleranceBeforeUs,
long toleranceAfterUs)
Deprecated.
Parameters:toleranceBeforeUs - The maximum time that the actual position seeked to may precede the requested seek position, in microseconds. Must be non-negative.toleranceAfterUs - The maximum time that the actual position seeked to may exceed the requested seek position, in microseconds. Must be non-negative.
-
public long resolveSeekPositionUs(long positionUs,
long firstSyncUs,
long secondSyncUs)
Deprecated.
Resolves a seek based on the parameters, given the requested seek position and two candidate sync points.
Parameters:positionUs - The requested seek position, in microseocnds.firstSyncUs - The first candidate seek point, in micrseconds.secondSyncUs - The second candidate seek point, in microseconds. May equal firstSyncUs if there's only one candidate.Returns:The resolved seek position, in microseconds.
-
public boolean equals(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")obj)
Deprecated.
Overrides:equals in class Object
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object