TrackAwareSeekMap


@UnstableApi
interface TrackAwareSeekMap : SeekMap


A SeekMap that also allows seeking based on a specific track ID.

Summary

Public functions

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

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

Boolean
isSeekable(trackId: Int)

Returns whether seeking is possible for the given track ID.

Inherited functions

From androidx.media3.extractor.SeekMap
Long

Returns the duration of the stream in microseconds.

SeekMap.SeekPoints!

Obtains seek points for the specified seek time in microseconds.

Boolean

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, but allows specifying a trackId. The trackId is the same ID passed to track. 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

A seek time in microseconds.

trackId: Int

The ID of the track to use for finding seek points.

Returns
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, but allows specifying a trackId. The trackId is the same ID passed to track.

Parameters
trackId: Int

The ID of the track.

Returns
Boolean

Whether seeking is possible for the track.