diff --git a/docs/listening-to-player-events.md b/docs/listening-to-player-events.md index 99af0b6678..3de8bde96b 100644 --- a/docs/listening-to-player-events.md +++ b/docs/listening-to-player-events.md @@ -31,7 +31,8 @@ Changes in player state can be received by implementing `Player.Listener`. The player can be in one of four playback states: * `Player.STATE_IDLE`: This is the initial state, the state when the player is - stopped, and when playback failed. + stopped, and when playback failed. The player will hold only limited resources + in this state. * `Player.STATE_BUFFERING`: The player is not able to immediately play from its current position. This mostly happens because more data needs to be loaded. * `Player.STATE_READY`: The player is able to immediately play from its current diff --git a/library/common/src/main/java/com/google/android/exoplayer2/Player.java b/library/common/src/main/java/com/google/android/exoplayer2/Player.java index 406398e39f..28aa61057d 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/Player.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/Player.java @@ -1087,7 +1087,10 @@ public interface Player { @Target({FIELD, METHOD, PARAMETER, LOCAL_VARIABLE, TYPE_USE}) @IntDef({STATE_IDLE, STATE_BUFFERING, STATE_READY, STATE_ENDED}) @interface State {} - /** The player is idle, and must be {@link #prepare() prepared} before it will play the media. */ + /** + * The player is idle, meaning it holds only limited resources. The player must be {@link + * #prepare() prepared} before it will play the media. + */ int STATE_IDLE = 1; /** * The player is not able to immediately play the media, but is doing work toward being able to do @@ -1669,7 +1672,12 @@ public interface Player { */ Commands getAvailableCommands(); - /** Prepares the player. */ + /** + * Prepares the player. + * + *

This will move the player out of {@link #STATE_IDLE idle state} and the player will start + * loading media and acquire resources needed for playback. + */ void prepare(); /** @@ -2001,12 +2009,13 @@ public interface Player { PlaybackParameters getPlaybackParameters(); /** - * Stops playback without resetting the player. Use {@link #pause()} rather than this method if + * Stops playback without resetting the playlist. Use {@link #pause()} rather than this method if * the intention is to pause playback. * - *

Calling this method will cause the playback state to transition to {@link #STATE_IDLE}. The - * player instance can still be used, and {@link #release()} must still be called on the player if - * it's no longer required. + *

Calling this method will cause the playback state to transition to {@link #STATE_IDLE} and + * the player will release the loaded media and resources required for playback. The player + * instance can still be used by calling {@link #prepare()} again, and {@link #release()} must + * still be called on the player if it's no longer required. * *

Calling this method does not clear the playlist, reset the playback position or the playback * error.