# TrackAwareSeekMap

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/media3/extractor/TrackAwareSeekMap "View this page in Java")

<br />

```
@UnstableApi
interface TrackAwareSeekMap : SeekMap
```

<br />

*** ** * ** ***

A[SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap)that also allows seeking based on a specific track ID.

## Summary

|                                                 ### Public functions                                                 |
|----------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [SeekMap.SeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap.SeekPoints)`!` | [getSeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackAwareSeekMap#getSeekPoints(long,int))`(timeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`, trackId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Obtains seek points for the specified seek time in microseconds, using cue points from a specific track. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                  | [isSeekable](https://developer.android.com/reference/kotlin/androidx/media3/extractor/TrackAwareSeekMap#isSeekable(int))`(trackId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns whether seeking is possible for the given track ID.                                                                                                                                                  |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ### Inherited functions                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From[androidx.media3.extractor.SeekMap](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap) |----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                        | [getDurationUs](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap#getDurationUs())`()` Returns the duration of the stream in microseconds.                                                                                                         | | [SeekMap.SeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap.SeekPoints)`!` | [getSeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap#getSeekPoints(long))`(timeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`)` Obtains seek points for the specified seek time in microseconds. | | [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                  | [isSeekable](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap#isSeekable())`()` Returns whether seeking is supported.                                                                                                                             | |

## Public functions

### getSeekPoints

```
fun getSeekPoints(timeUs: Long, trackId: Int): SeekMap.SeekPoints!
```

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

This method is similar to[getSeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap#getSeekPoints(long)), but allows specifying a`
trackId`. The`trackId`is the same ID passed to[track](https://developer.android.com/reference/kotlin/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                                        |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------|
| `timeUs: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | A seek time in microseconds.                        |
| `trackId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | The ID of the track to use for finding seek points. |

|                                                       Returns                                                        |
|----------------------------------------------------------------------------------------------------------------------|--------------------------------|
| [SeekMap.SeekPoints](https://developer.android.com/reference/kotlin/androidx/media3/extractor/SeekMap.SeekPoints)`!` | The corresponding seek points. |

### isSeekable

```
fun isSeekable(trackId: Int): Boolean
```

Returns whether seeking is possible for the given track ID.

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

|                                       Parameters                                       |
|----------------------------------------------------------------------------------------|----------------------|
| `trackId: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | The ID of the track. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|--------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | Whether seeking is possible for the track. |