FakeMediaChunkIterator
@UnstableApi
public final class FakeMediaChunkIterator extends BaseMediaChunkIterator
| java.lang.Object | ||
| ↳ | androidx.media3.exoplayer.source.chunk.BaseMediaChunkIterator | |
| ↳ | androidx.media3.test.utils.FakeMediaChunkIterator |
Fake MediaChunkIterator.
Summary
Public constructors |
|---|
FakeMediaChunkIterator(Creates a fake |
Public methods |
|
|---|---|
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 |
Inherited Constants |
||
|---|---|---|
|
Inherited fields |
||
|---|---|---|
|
Inherited methods |
||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
FakeMediaChunkIterator
public FakeMediaChunkIterator(
long[] chunkTimeBoundariesSec,
long[] chunkLengths
)
Creates a fake MediaChunkIterator.
| Parameters | |
|---|---|
long[] chunkTimeBoundariesSec |
An array containing the time boundaries where one chunk ends and the next one starts. The first value is the start time of the first chunk and the last value is the end time of the last chunk. The array should be of length (chunk-count + 1). |
long[] chunkLengths |
An array which contains the length of each chunk, should be of length (chunk-count). |
Public methods
getChunkEndTimeUs
public 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 |
getChunkStartTimeUs
public 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 |
getDataSpec
public 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 |