mirror of
https://github.com/androidx/media.git
synced 2025-05-06 23:20:42 +08:00
Clarify threading requirements for the player in the doc.
This makes the requirement that all calls are made on one thread more explicit and also mentions this in the Getting Started guide. Issue:#4278 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=198694579
This commit is contained in:
parent
2bbfc84242
commit
cd65cc85e2
@ -89,12 +89,12 @@ import com.google.android.exoplayer2.video.MediaCodecVideoRenderer;
|
|||||||
* model">
|
* model">
|
||||||
*
|
*
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>It is strongly recommended that ExoPlayer instances are created and accessed from a single
|
* <li>ExoPlayer instances must be accessed from a single application thread. This must be the
|
||||||
* application thread. The application's main thread is ideal. Accessing an instance from
|
* thread the player is created on if that thread has a {@link Looper}, or the application's
|
||||||
* multiple threads is discouraged as it may cause synchronization problems.
|
* main thread otherwise.
|
||||||
* <li>Registered listeners are called on the thread that created the ExoPlayer instance, unless
|
* <li>Registered listeners are called on the thread the player is created on if that thread has a
|
||||||
* the thread that created the ExoPlayer instance does not have a {@link Looper}. In that
|
* {@link Looper}, or the application's main thread otherwise. Note that this means registered
|
||||||
* case, registered listeners will be called on the application's main thread.
|
* listeners are called on the same thread which must be used to access the player.
|
||||||
* <li>An internal playback thread is responsible for playback. Injected player components such as
|
* <li>An internal playback thread is responsible for playback. Injected player components such as
|
||||||
* Renderers, MediaSources, TrackSelectors and LoadControls are called by the player on this
|
* Renderers, MediaSources, TrackSelectors and LoadControls are called by the player on this
|
||||||
* thread.
|
* thread.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user