MediaChunkIterator


@UnstableApi
public interface MediaChunkIterator

Known direct subclasses

Iterator for media chunk sequences.

The iterator initially points in front of the first available element. The first call to next moves the iterator to the first element. Check the return value of next or isEnded to determine whether the iterator reached the end of the available data.

Summary

Constants

default static final MediaChunkIterator

An empty media chunk iterator without available data.

Public methods

abstract long

Returns the media end time of the chunk, in microseconds.

abstract long

Returns the media start time of the chunk, in microseconds.

abstract DataSpec

Returns the DataSpec used to load the media chunk.

abstract boolean

Returns whether the iteration has reached the end of the available data.

abstract boolean

Moves the iterator to the next media chunk.

abstract void

Resets the iterator to the initial position.

Constants

EMPTY

default static final MediaChunkIterator EMPTY

An empty media chunk iterator without available data.

Public methods

getChunkEndTimeUs

abstract long getChunkEndTimeUs()

Returns the media end time of the chunk, in microseconds.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.

getChunkStartTimeUs

abstract long getChunkStartTimeUs()

Returns the media start time of the chunk, in microseconds.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.

getDataSpec

abstract DataSpec getDataSpec()

Returns the DataSpec used to load the media chunk.

Throws
java.util.NoSuchElementException

If the method is called before the first call to next or when isEnded is true.

isEnded

abstract boolean isEnded()

Returns whether the iteration has reached the end of the available data.

next

abstract boolean next()

Moves the iterator to the next media chunk.

Check the return value or isEnded to determine whether the iterator reached the end of the available data.

Returns
boolean

Whether the iterator points to a media chunk with available data.

reset

abstract void reset()

Resets the iterator to the initial position.