Loading media/java/android/media/MediaPlayer.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,10 @@ import java.util.Vector; * of audio/video files and streams. An example on how to use the methods in * of audio/video files and streams. An example on how to use the methods in * this class can be found in {@link android.widget.VideoView}. * this class can be found in {@link android.widget.VideoView}. * * * <p>MediaPlayer is not thread-safe. Creation of and all access to player instances * should be on the same thread. If registering <a href="#Callbacks">callbacks</a>, * the thread must have a Looper. * * <p>Topics covered here are: * <p>Topics covered here are: * <ol> * <ol> * <li><a href="#StateDiagram">State Diagram</a> * <li><a href="#StateDiagram">State Diagram</a> Loading Loading @@ -554,13 +558,13 @@ import java.util.Vector; * possible runtime errors during playback or streaming. Registration for * possible runtime errors during playback or streaming. Registration for * these events is done by properly setting the appropriate listeners (via calls * these events is done by properly setting the appropriate listeners (via calls * to * to * {@link #setOnPreparedListener(OnPreparedListener)}setOnPreparedListener, * {@link #setOnPreparedListener(OnPreparedListener) setOnPreparedListener}, * {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener)}setOnVideoSizeChangedListener, * {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener) setOnVideoSizeChangedListener}, * {@link #setOnSeekCompleteListener(OnSeekCompleteListener)}setOnSeekCompleteListener, * {@link #setOnSeekCompleteListener(OnSeekCompleteListener) setOnSeekCompleteListener}, * {@link #setOnCompletionListener(OnCompletionListener)}setOnCompletionListener, * {@link #setOnCompletionListener(OnCompletionListener) setOnCompletionListener}, * {@link #setOnBufferingUpdateListener(OnBufferingUpdateListener)}setOnBufferingUpdateListener, * {@link #setOnBufferingUpdateListener(OnBufferingUpdateListener) setOnBufferingUpdateListener}, * {@link #setOnInfoListener(OnInfoListener)}setOnInfoListener, * {@link #setOnInfoListener(OnInfoListener) setOnInfoListener}, * {@link #setOnErrorListener(OnErrorListener)}setOnErrorListener, etc). * {@link #setOnErrorListener(OnErrorListener) setOnErrorListener}, etc). * In order to receive the respective callback * In order to receive the respective callback * associated with these listeners, applications are required to create * associated with these listeners, applications are required to create * MediaPlayer objects on a thread with its own Looper running (main UI * MediaPlayer objects on a thread with its own Looper running (main UI Loading Loading
media/java/android/media/MediaPlayer.java +12 −8 Original line number Original line Diff line number Diff line Loading @@ -89,6 +89,10 @@ import java.util.Vector; * of audio/video files and streams. An example on how to use the methods in * of audio/video files and streams. An example on how to use the methods in * this class can be found in {@link android.widget.VideoView}. * this class can be found in {@link android.widget.VideoView}. * * * <p>MediaPlayer is not thread-safe. Creation of and all access to player instances * should be on the same thread. If registering <a href="#Callbacks">callbacks</a>, * the thread must have a Looper. * * <p>Topics covered here are: * <p>Topics covered here are: * <ol> * <ol> * <li><a href="#StateDiagram">State Diagram</a> * <li><a href="#StateDiagram">State Diagram</a> Loading Loading @@ -554,13 +558,13 @@ import java.util.Vector; * possible runtime errors during playback or streaming. Registration for * possible runtime errors during playback or streaming. Registration for * these events is done by properly setting the appropriate listeners (via calls * these events is done by properly setting the appropriate listeners (via calls * to * to * {@link #setOnPreparedListener(OnPreparedListener)}setOnPreparedListener, * {@link #setOnPreparedListener(OnPreparedListener) setOnPreparedListener}, * {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener)}setOnVideoSizeChangedListener, * {@link #setOnVideoSizeChangedListener(OnVideoSizeChangedListener) setOnVideoSizeChangedListener}, * {@link #setOnSeekCompleteListener(OnSeekCompleteListener)}setOnSeekCompleteListener, * {@link #setOnSeekCompleteListener(OnSeekCompleteListener) setOnSeekCompleteListener}, * {@link #setOnCompletionListener(OnCompletionListener)}setOnCompletionListener, * {@link #setOnCompletionListener(OnCompletionListener) setOnCompletionListener}, * {@link #setOnBufferingUpdateListener(OnBufferingUpdateListener)}setOnBufferingUpdateListener, * {@link #setOnBufferingUpdateListener(OnBufferingUpdateListener) setOnBufferingUpdateListener}, * {@link #setOnInfoListener(OnInfoListener)}setOnInfoListener, * {@link #setOnInfoListener(OnInfoListener) setOnInfoListener}, * {@link #setOnErrorListener(OnErrorListener)}setOnErrorListener, etc). * {@link #setOnErrorListener(OnErrorListener) setOnErrorListener}, etc). * In order to receive the respective callback * In order to receive the respective callback * associated with these listeners, applications are required to create * associated with these listeners, applications are required to create * MediaPlayer objects on a thread with its own Looper running (main UI * MediaPlayer objects on a thread with its own Looper running (main UI Loading