MediaChunkIterator


@UnstableApi
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

const MediaChunkIterator!

An empty media chunk iterator without available data.

Public functions

Long

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

Long

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

DataSpec!

Returns the DataSpec used to load the media chunk.

Boolean

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

Boolean

Moves the iterator to the next media chunk.

Unit

Resets the iterator to the initial position.

Constants

EMPTY

const val EMPTYMediaChunkIterator!

An empty media chunk iterator without available data.

Public functions

getChunkEndTimeUs

fun getChunkEndTimeUs(): Long

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

fun getChunkStartTimeUs(): Long

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

fun getDataSpec(): DataSpec!

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

fun isEnded(): Boolean

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

next

fun next(): Boolean

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

fun reset(): Unit

Resets the iterator to the initial position.