android.media
Class MediaPlayer
java.lang.Object
android.media.MediaPlayer
public class MediaPlayer
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MEDIA_ERROR_UNKNOWN
public static final int MEDIA_ERROR_UNKNOWN
- See Also:
- Constant Field Values
MEDIA_ERROR_SERVER_DIED
public static final int MEDIA_ERROR_SERVER_DIED
- See Also:
- Constant Field Values
MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
public static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
- See Also:
- Constant Field Values
MEDIA_INFO_UNKNOWN
public static final int MEDIA_INFO_UNKNOWN
- See Also:
- Constant Field Values
MEDIA_INFO_VIDEO_TRACK_LAGGING
public static final int MEDIA_INFO_VIDEO_TRACK_LAGGING
- See Also:
- Constant Field Values
MEDIA_INFO_BAD_INTERLEAVING
public static final int MEDIA_INFO_BAD_INTERLEAVING
- See Also:
- Constant Field Values
MEDIA_INFO_NOT_SEEKABLE
public static final int MEDIA_INFO_NOT_SEEKABLE
- See Also:
- Constant Field Values
MEDIA_INFO_METADATA_UPDATE
public static final int MEDIA_INFO_METADATA_UPDATE
- See Also:
- Constant Field Values
MediaPlayer
public MediaPlayer()
setDisplay
public void setDisplay(SurfaceHolder sh)
create
public static MediaPlayer create(Context context,
Uri uri)
create
public static MediaPlayer create(Context context,
Uri uri,
SurfaceHolder holder)
create
public static MediaPlayer create(Context context,
int resid)
setDataSource
public void setDataSource(Context context,
Uri uri)
throws java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.SecurityException,
java.lang.IllegalStateException
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
java.lang.SecurityException
java.lang.IllegalStateException
setDataSource
public void setDataSource(java.lang.String path)
throws java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.IllegalStateException
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
java.lang.IllegalStateException
setDataSource
public void setDataSource(java.io.FileDescriptor fd)
throws java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.IllegalStateException
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
java.lang.IllegalStateException
setDataSource
public void setDataSource(java.io.FileDescriptor fd,
long offset,
long length)
throws java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.IllegalStateException
- Throws:
java.io.IOException
java.lang.IllegalArgumentException
java.lang.IllegalStateException
prepare
public void prepare()
throws java.io.IOException,
java.lang.IllegalStateException
- Throws:
java.io.IOException
java.lang.IllegalStateException
prepareAsync
public void prepareAsync()
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
start
public void start()
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
stop
public void stop()
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
pause
public void pause()
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
setWakeMode
public void setWakeMode(Context context,
int mode)
setScreenOnWhilePlaying
public void setScreenOnWhilePlaying(boolean screenOn)
getVideoWidth
public int getVideoWidth()
getVideoHeight
public int getVideoHeight()
isPlaying
public boolean isPlaying()
seekTo
public void seekTo(int msec)
throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
getCurrentPosition
public int getCurrentPosition()
getDuration
public int getDuration()
release
public void release()
reset
public void reset()
setAudioStreamType
public void setAudioStreamType(int streamtype)
setLooping
public void setLooping(boolean looping)
isLooping
public boolean isLooping()
setVolume
public void setVolume(float leftVolume,
float rightVolume)
finalize
protected void finalize()
- Overrides:
finalize in class java.lang.Object
setOnPreparedListener
public void setOnPreparedListener(MediaPlayer.OnPreparedListener listener)
setOnCompletionListener
public void setOnCompletionListener(MediaPlayer.OnCompletionListener listener)
setOnBufferingUpdateListener
public void setOnBufferingUpdateListener(MediaPlayer.OnBufferingUpdateListener listener)
setOnSeekCompleteListener
public void setOnSeekCompleteListener(MediaPlayer.OnSeekCompleteListener listener)
setOnVideoSizeChangedListener
public void setOnVideoSizeChangedListener(MediaPlayer.OnVideoSizeChangedListener listener)
setOnErrorListener
public void setOnErrorListener(MediaPlayer.OnErrorListener listener)
setOnInfoListener
public void setOnInfoListener(MediaPlayer.OnInfoListener listener)
Copyright © 2008-2010. All Rights Reserved.