FakeMediaChunk
@UnstableApi
class FakeMediaChunk : MediaChunk
| kotlin.Any | |||
| ↳ | androidx.media3.exoplayer.source.chunk.Chunk | ||
| ↳ | androidx.media3.exoplayer.source.chunk.MediaChunk | ||
| ↳ | androidx.media3.test.utils.FakeMediaChunk |
Fake MediaChunk.
Summary
Public constructors |
|---|
FakeMediaChunk(trackFormat: Format!, startTimeUs: Long, endTimeUs: Long)Creates a fake media chunk. |
FakeMediaChunk(Creates a fake media chunk. |
Public functions |
|
|---|---|
Unit |
Cancels the load. |
Boolean |
Returns whether the chunk has been fully loaded. |
Unit |
load()Performs the load, returning on completion or cancellation. |
Inherited functions |
||
|---|---|---|
|
Inherited properties |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||
|
Public constructors
FakeMediaChunk
FakeMediaChunk(trackFormat: Format!, startTimeUs: Long, endTimeUs: Long)
Creates a fake media chunk.
FakeMediaChunk
FakeMediaChunk(
trackFormat: Format!,
startTimeUs: Long,
endTimeUs: Long,
@C.SelectionReason selectionReason: Int
)
Creates a fake media chunk.
| Parameters | |
|---|---|
trackFormat: Format! |
The |
startTimeUs: Long |
The start time of the media, in microseconds. |
endTimeUs: Long |
The end time of the media, in microseconds. |
@C.SelectionReason selectionReason: Int |
One of the |
Public functions
cancelLoad
fun cancelLoad(): Unit
Cancels the load.
Loadable implementations should ensure that a currently executing load call will exit reasonably quickly after this method is called. The load call may exit either by returning or by throwing an IOException.
If there is a currently executing load call, then the thread on which that call is being made will be interrupted immediately after the call to this method. Hence implementations do not need to (and should not attempt to) interrupt the loading thread themselves.
Although the loading thread will be interrupted, Loadable implementations should not use the interrupted status of the loading thread in load to determine whether the load has been canceled. This approach is not robust [Internal ref: b/79223737]. Instead, implementations should use their own flag to signal cancelation (for example, using AtomicBoolean).
load
fun load(): Unit
Performs the load, returning on completion or cancellation.
| Throws | |
|---|---|
java.io.IOException |
If the input could not be loaded. |