# TrackAwareSeekMap

Artifact: [androidx.media3:media3-extractor](https://developer.android.com/jetpack/androidx/releases/media3) [View Source](https://cs.android.com/search?q=file:androidx/media3/extractor/TrackAwareSeekMap.java+class:androidx.media3.extractor.TrackAwareSeekMap)

*** ** * ** ***


```
@UnstableApi
public interface TrackAwareSeekMap extends SeekMap
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/extractor/SeekMap` that also allows seeking based on a specific track ID.

## Summary

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/androidx/media3/extractor/SeekMap.SeekPoints` | `https://developer.android.com/reference/androidx/media3/extractor/TrackAwareSeekMap#getSeekPoints(long,int)(long timeUs, int trackId)` Obtains seek points for the specified seek time in microseconds, using cue points from a specific track. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/media3/extractor/TrackAwareSeekMap#isSeekable(int)(int trackId)` Returns whether seeking is possible for the given track ID. |

| ### Inherited methods |
|---|
| From [androidx.media3.extractor.SeekMap](https://developer.android.com/reference/androidx/media3/extractor/SeekMap) |---|---| | `abstract long` | `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#getDurationUs()()` Returns the duration of the stream in microseconds. | | `abstract https://developer.android.com/reference/androidx/media3/extractor/SeekMap.SeekPoints` | `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#getSeekPoints(long)(long timeUs)` Obtains seek points for the specified seek time in microseconds. | | `default boolean` | `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#isEstimated()()` Returns whether this `https://developer.android.com/reference/androidx/media3/extractor/SeekMap` is based on estimations. | | `abstract boolean` | `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#isSeekable()()` Returns whether seeking is supported. | |

## Public methods

### getSeekPoints

```
abstract SeekMap.SeekPoints getSeekPoints(long timeUs, int trackId)
```

Obtains seek points for the specified seek time in microseconds, using cue points from a specific track.

This method is similar to `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#getSeekPoints(long)`, but allows specifying a `
trackId`. The `trackId` is the same ID passed to `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput#track(int,int)`. If the given `trackId` does not have any associated cue points, the implementation may fall back to using a default or primary track.

| Parameters |
|---|---|
| `long timeUs` | A seek time in microseconds. |
| `int trackId` | The ID of the track to use for finding seek points. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/SeekMap.SeekPoints` | The corresponding seek points. |

### isSeekable

```
abstract boolean isSeekable(int trackId)
```

Returns whether seeking is possible for the given track ID.

This method is similar to `https://developer.android.com/reference/androidx/media3/extractor/SeekMap#isSeekable()`, but allows specifying a `trackId`. The `trackId` is the same ID passed to `https://developer.android.com/reference/androidx/media3/extractor/ExtractorOutput#track(int,int)`.

| Parameters |
|---|---|
| `int trackId` | The ID of the track. |

| Returns |
|---|---|
| `boolean` | Whether seeking is possible for the track. |