TrackAwareSeekMap


@UnstableApi
public interface TrackAwareSeekMap extends SeekMap


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

Summary

Public methods

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.

abstract boolean
isSeekable(int trackId)

Returns whether seeking is possible for the given track ID.

Inherited methods

From androidx.media3.extractor.SeekMap
abstract long

Returns the duration of the stream in microseconds.

abstract SeekMap.SeekPoints
getSeekPoints(long timeUs)

Obtains seek points for the specified seek time in microseconds.

abstract boolean

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 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
long timeUs

A seek time in microseconds.

int trackId

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

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

Parameters
int trackId

The ID of the track.

Returns
boolean

Whether seeking is possible for the track.