Back to Exoplayer

Loader.Loadable (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/upstream/Loader.Loadable.html

latest2.3 KB
Original Source

Package com.google.android.exoplayer2.upstream

Interface Loader.Loadable

  • All Known Implementing Classes:BaseMediaChunk, Chunk, ContainerMediaChunk, DataChunk, FakeMediaChunk, InitializationChunk, MediaChunk, ParsingLoadable, SingleSampleMediaChunkEnclosing class:Loader

public static interfaceLoader.Loadable

An object that can be loaded using a Loader.

Method Summary

All Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description | | --- | --- | --- | | void | cancelLoad() | Cancels the load. | | void | load() | Performs the load, returning on completion or cancellation. |

Method Detail

- 

cancelLoad

void cancelLoad()

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

void load()
   throws[IOException](https://developer.android.com/reference/java/io/IOException.html "class or interface in java.io")

Performs the load, returning on completion or cancellation. Throws:IOException - If the input could not be loaded.