Package tv.danmaku.ijk.media.player
Interface IMediaPlayer
-
- All Known Implementing Classes:
AbstractMediaPlayer,AndroidMediaPlayer,IjkMediaPlayer,MediaPlayerProxy,TextureMediaPlayer
public interface IMediaPlayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIMediaPlayer.OnBufferingUpdateListenerstatic interfaceIMediaPlayer.OnCompletionListenerstatic interfaceIMediaPlayer.OnErrorListenerstatic interfaceIMediaPlayer.OnInfoListenerstatic interfaceIMediaPlayer.OnPreparedListenerstatic interfaceIMediaPlayer.OnSeekCompleteListenerstatic interfaceIMediaPlayer.OnTimedTextListenerstatic interfaceIMediaPlayer.OnVideoSizeChangedListener
-
Field Summary
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description intgetAudioSessionId()longgetCurrentPosition()java.lang.StringgetDataSource()longgetDuration()MediaInfogetMediaInfo()ITrackInfo[]getTrackInfo()intgetVideoHeight()intgetVideoSarDen()intgetVideoSarNum()intgetVideoWidth()booleanisLooping()booleanisPlayable()Deprecated.booleanisPlaying()voidpause()voidprepareAsync()voidrelease()voidreset()voidseekTo(long msec)voidsetAudioStreamType(int streamtype)voidsetDataSource(android.content.Context context, android.net.Uri uri)voidsetDataSource(android.content.Context context, android.net.Uri uri, java.util.Map<java.lang.String,java.lang.String> headers)voidsetDataSource(java.io.FileDescriptor fd)voidsetDataSource(java.lang.String path)voidsetDataSource(IMediaDataSource mediaDataSource)voidsetDisplay(android.view.SurfaceHolder sh)voidsetKeepInBackground(boolean keepInBackground)Deprecated.voidsetLogEnabled(boolean enable)Deprecated.voidsetLooping(boolean looping)voidsetOnBufferingUpdateListener(IMediaPlayer.OnBufferingUpdateListener listener)voidsetOnCompletionListener(IMediaPlayer.OnCompletionListener listener)voidsetOnErrorListener(IMediaPlayer.OnErrorListener listener)voidsetOnInfoListener(IMediaPlayer.OnInfoListener listener)voidsetOnPreparedListener(IMediaPlayer.OnPreparedListener listener)voidsetOnSeekCompleteListener(IMediaPlayer.OnSeekCompleteListener listener)voidsetOnTimedTextListener(IMediaPlayer.OnTimedTextListener listener)voidsetOnVideoSizeChangedListener(IMediaPlayer.OnVideoSizeChangedListener listener)voidsetScreenOnWhilePlaying(boolean screenOn)voidsetSurface(android.view.Surface surface)voidsetVolume(float leftVolume, float rightVolume)voidsetWakeMode(android.content.Context context, int mode)Deprecated.voidstart()voidstop()
-
-
-
Field Detail
-
MEDIA_INFO_UNKNOWN
static final int MEDIA_INFO_UNKNOWN
- See Also:
- Constant Field Values
-
MEDIA_INFO_STARTED_AS_NEXT
static final int MEDIA_INFO_STARTED_AS_NEXT
- See Also:
- Constant Field Values
-
MEDIA_INFO_VIDEO_RENDERING_START
static final int MEDIA_INFO_VIDEO_RENDERING_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_VIDEO_TRACK_LAGGING
static final int MEDIA_INFO_VIDEO_TRACK_LAGGING
- See Also:
- Constant Field Values
-
MEDIA_INFO_BUFFERING_START
static final int MEDIA_INFO_BUFFERING_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_BUFFERING_END
static final int MEDIA_INFO_BUFFERING_END
- See Also:
- Constant Field Values
-
MEDIA_INFO_NETWORK_BANDWIDTH
static final int MEDIA_INFO_NETWORK_BANDWIDTH
- See Also:
- Constant Field Values
-
MEDIA_INFO_BAD_INTERLEAVING
static final int MEDIA_INFO_BAD_INTERLEAVING
- See Also:
- Constant Field Values
-
MEDIA_INFO_NOT_SEEKABLE
static final int MEDIA_INFO_NOT_SEEKABLE
- See Also:
- Constant Field Values
-
MEDIA_INFO_METADATA_UPDATE
static final int MEDIA_INFO_METADATA_UPDATE
- See Also:
- Constant Field Values
-
MEDIA_INFO_TIMED_TEXT_ERROR
static final int MEDIA_INFO_TIMED_TEXT_ERROR
- See Also:
- Constant Field Values
-
MEDIA_INFO_UNSUPPORTED_SUBTITLE
static final int MEDIA_INFO_UNSUPPORTED_SUBTITLE
- See Also:
- Constant Field Values
-
MEDIA_INFO_SUBTITLE_TIMED_OUT
static final int MEDIA_INFO_SUBTITLE_TIMED_OUT
- See Also:
- Constant Field Values
-
MEDIA_INFO_VIDEO_ROTATION_CHANGED
static final int MEDIA_INFO_VIDEO_ROTATION_CHANGED
- See Also:
- Constant Field Values
-
MEDIA_INFO_AUDIO_RENDERING_START
static final int MEDIA_INFO_AUDIO_RENDERING_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_AUDIO_DECODED_START
static final int MEDIA_INFO_AUDIO_DECODED_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_VIDEO_DECODED_START
static final int MEDIA_INFO_VIDEO_DECODED_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_OPEN_INPUT
static final int MEDIA_INFO_OPEN_INPUT
- See Also:
- Constant Field Values
-
MEDIA_INFO_FIND_STREAM_INFO
static final int MEDIA_INFO_FIND_STREAM_INFO
- See Also:
- Constant Field Values
-
MEDIA_INFO_COMPONENT_OPEN
static final int MEDIA_INFO_COMPONENT_OPEN
- See Also:
- Constant Field Values
-
MEDIA_INFO_VIDEO_SEEK_RENDERING_START
static final int MEDIA_INFO_VIDEO_SEEK_RENDERING_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_AUDIO_SEEK_RENDERING_START
static final int MEDIA_INFO_AUDIO_SEEK_RENDERING_START
- See Also:
- Constant Field Values
-
MEDIA_INFO_MEDIA_ACCURATE_SEEK_COMPLETE
static final int MEDIA_INFO_MEDIA_ACCURATE_SEEK_COMPLETE
- See Also:
- Constant Field Values
-
MEDIA_ERROR_UNKNOWN
static final int MEDIA_ERROR_UNKNOWN
- See Also:
- Constant Field Values
-
MEDIA_ERROR_SERVER_DIED
static final int MEDIA_ERROR_SERVER_DIED
- See Also:
- Constant Field Values
-
MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
static final int MEDIA_ERROR_NOT_VALID_FOR_PROGRESSIVE_PLAYBACK
- See Also:
- Constant Field Values
-
MEDIA_ERROR_IO
static final int MEDIA_ERROR_IO
- See Also:
- Constant Field Values
-
MEDIA_ERROR_MALFORMED
static final int MEDIA_ERROR_MALFORMED
- See Also:
- Constant Field Values
-
MEDIA_ERROR_UNSUPPORTED
static final int MEDIA_ERROR_UNSUPPORTED
- See Also:
- Constant Field Values
-
MEDIA_ERROR_TIMED_OUT
static final int MEDIA_ERROR_TIMED_OUT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDisplay
void setDisplay(android.view.SurfaceHolder sh)
-
setDataSource
void setDataSource(android.content.Context context, android.net.Uri uri) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.IllegalStateException- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.lang.SecurityExceptionjava.lang.IllegalStateException
-
setDataSource
void setDataSource(android.content.Context context, android.net.Uri uri, java.util.Map<java.lang.String,java.lang.String> headers) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.IllegalStateException- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.lang.SecurityExceptionjava.lang.IllegalStateException
-
setDataSource
void setDataSource(java.io.FileDescriptor fd) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.IllegalStateException- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.lang.IllegalStateException
-
setDataSource
void setDataSource(java.lang.String path) throws java.io.IOException, java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.IllegalStateException- Throws:
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.lang.SecurityExceptionjava.lang.IllegalStateException
-
getDataSource
java.lang.String getDataSource()
-
prepareAsync
void prepareAsync() throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException
-
start
void start() throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException
-
stop
void stop() throws java.lang.IllegalStateException
- Throws:
java.lang.IllegalStateException
-
pause
void pause() throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException
-
setScreenOnWhilePlaying
void setScreenOnWhilePlaying(boolean screenOn)
-
getVideoWidth
int getVideoWidth()
-
getVideoHeight
int getVideoHeight()
-
isPlaying
boolean isPlaying()
-
seekTo
void seekTo(long msec) throws java.lang.IllegalStateException- Throws:
java.lang.IllegalStateException
-
getCurrentPosition
long getCurrentPosition()
-
getDuration
long getDuration()
-
release
void release()
-
reset
void reset()
-
setVolume
void setVolume(float leftVolume, float rightVolume)
-
getAudioSessionId
int getAudioSessionId()
-
getMediaInfo
MediaInfo getMediaInfo()
-
setLogEnabled
@Deprecated void setLogEnabled(boolean enable)
Deprecated.
-
isPlayable
@Deprecated boolean isPlayable()
Deprecated.
-
setOnPreparedListener
void setOnPreparedListener(IMediaPlayer.OnPreparedListener listener)
-
setOnCompletionListener
void setOnCompletionListener(IMediaPlayer.OnCompletionListener listener)
-
setOnBufferingUpdateListener
void setOnBufferingUpdateListener(IMediaPlayer.OnBufferingUpdateListener listener)
-
setOnSeekCompleteListener
void setOnSeekCompleteListener(IMediaPlayer.OnSeekCompleteListener listener)
-
setOnVideoSizeChangedListener
void setOnVideoSizeChangedListener(IMediaPlayer.OnVideoSizeChangedListener listener)
-
setOnErrorListener
void setOnErrorListener(IMediaPlayer.OnErrorListener listener)
-
setOnInfoListener
void setOnInfoListener(IMediaPlayer.OnInfoListener listener)
-
setOnTimedTextListener
void setOnTimedTextListener(IMediaPlayer.OnTimedTextListener listener)
-
setAudioStreamType
void setAudioStreamType(int streamtype)
-
setKeepInBackground
@Deprecated void setKeepInBackground(boolean keepInBackground)
Deprecated.
-
getVideoSarNum
int getVideoSarNum()
-
getVideoSarDen
int getVideoSarDen()
-
setWakeMode
@Deprecated void setWakeMode(android.content.Context context, int mode)Deprecated.
-
setLooping
void setLooping(boolean looping)
-
isLooping
boolean isLooping()
-
getTrackInfo
ITrackInfo[] getTrackInfo()
-
setSurface
void setSurface(android.view.Surface surface)
-
setDataSource
void setDataSource(IMediaDataSource mediaDataSource)
-
-