public class

KSYVideoView

extends FrameLayout
implements IMediaController.MediaPlayerControl
java.lang.Object
   ↳ FrameLayout
     ↳ com.ksyun.media.player.KSYVideoView

Class Overview

金山云提供的播放控件,对SurfaceView和KSYMediaPlayer进行封装,接口定义与KSYMediaPlayer保持一直,支持控件IMediaController,具体接口定义可参见KSYMediaPlayer

Summary

Constants
int STATE_PLAYBACK_COMPLETED
Fields
protected final IMediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener
protected final IMediaPlayer.OnCompletionListener mCompletionListener
protected int mCurrentBufferPercentage
public int mCurrentState
protected final IMediaPlayer.OnErrorListener mErrorListener
protected final IMediaPlayer.OnInfoListener mInfoListener
protected final IMediaPlayer.OnMessageListener mInternalMessageListener
protected final IMediaPlayer.OnLogEventListener mLogEventListener
protected MediaInfo mMediaInfo
protected final IMediaPlayer.OnSeekCompleteListener mSeekCompleteListener
Public Constructors
KSYVideoView(Context context)
KSYVideoView(Context context, AttributeSet attrs)
KSYVideoView(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
void addVideoRawBuffer(byte[] rawBuffer)
int bufferEmptyCount()
float bufferEmptyDuration()
boolean canPause()
boolean canSeekBackward()
boolean canSeekForward()
void deselectTrack(int track)
long getAudioCachedBytes()
long getAudioCachedDuration()
long getAudioCachedPackets()
int getAudioSessionId()
int getBufferPercentage()
float getBufferTimeMax()
String getClientIP()
long getCurrentPosition()
long getCurrentPts()
String getDataSource()
long getDecodedDataSize()
long getDownloadDataSize()
long getDuration()
String getLocalDnsIP()
MediaInfo getMediaInfo()
Bundle getMediaMeta()
Bitmap getScreenShot()
int getSelectedTrack(int trackType)
String getServerAddress()
float getSpeed()
KSYQosInfo getStreamQosInfo()
long getStreamStartTime()
KSYTrackInfo[] getTrackInfo()
String getVersion()
long getVideoCachedBytes()
long getVideoCachedDuration()
long getVideoCachedPackets()
float getVideoDecodeFramesPerSecond()
int getVideoDecoder()
int getVideoHeight()
float getVideoOutputFramesPerSecond()
int getVideoSarDen()
int getVideoSarNum()
int getVideoWidth()
boolean isLooping()
boolean isPlayable()
boolean isPlaying()
boolean onKeyDown(int keyCode, KeyEvent event)
boolean onTouchEvent(MotionEvent ev)
boolean onTrackballEvent(MotionEvent ev)
void pause()
void prepareAsync()
void release()
void reload(String path, boolean flushBuffer, KSYMediaPlayer.KSYReloadMode mode)
void reload(String url, boolean flushBuffer)
void reset()
void seekTo(long l)
void seekTo(long pos, boolean accurate)
void selectTrack(int track)
void setBufferSize(int size)
void setBufferTimeMax(float timeSecond)
void setDataSource(FileDescriptor fd, long offset, long length)
void setDataSource(FileDescriptor fd)
void setDataSource(String path)
void setDataSource(Context context, Uri uri)
void setDataSource(Context context, Uri uri, Map<String, String> headers)
void setDecodeMode(KSYMediaPlayer.KSYDecodeMode mode)
void setDeinterlaceMode(KSYMediaPlayer.KSYDeinterlaceMode mode)
void setLooping(boolean looping)
void setMediaController(IMediaController controller)
void setMirror(boolean mirror)
void setOnAudioPCMAvailableListener(KSYMediaPlayer.OnAudioPCMListener listener)
void setOnBufferingUpdateListener(IMediaPlayer.OnBufferingUpdateListener l)
void setOnCompletionListener(IMediaPlayer.OnCompletionListener l)
void setOnErrorListener(IMediaPlayer.OnErrorListener l)
void setOnInfoListener(IMediaPlayer.OnInfoListener l)
void setOnLogEventListener(IMediaPlayer.OnLogEventListener l)
void setOnMessageListener(IMediaPlayer.OnMessageListener l)
void setOnPreparedListener(IMediaPlayer.OnPreparedListener l)
void setOnSeekCompleteListener(IMediaPlayer.OnSeekCompleteListener l)
void setOnVideoSizeChangedListener(IMediaPlayer.OnVideoSizeChangedListener l)
void setPlayableRanges(long startTime, long endTime)
void setPlayerMute(int mute)
boolean setRotateDegree(int degree)
void setRotation(float rotation)
void setScreenOnWhilePlaying(boolean screenOn)
void setSpeed(float speed)
void setTimeout(int prepareTimeout, int readTimeout)
void setVideoOffset(float horizontal, float vertical)
void setVideoRawDataListener(KSYMediaPlayer.OnVideoRawDataListener listener)
void setVideoRenderingState(int mode)
void setVideoScalingMode(int mode)
void setVolume(float leftVolume, float rightVolume)
void setWakeMode(Context context, int mode)
void shouldAutoPlay(boolean state)
void softReset()
void start()
void stop()
void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
void surfaceCreated(SurfaceHolder holder)
void surfaceDestroyed(SurfaceHolder holder)
Protected Methods
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.ksyun.media.player.IMediaController.MediaPlayerControl

Constants

protected static final int STATE_PLAYBACK_COMPLETED

Constant Value: 8 (0x00000008)

Fields

protected final IMediaPlayer.OnBufferingUpdateListener mBufferingUpdateListener

protected final IMediaPlayer.OnCompletionListener mCompletionListener

protected int mCurrentBufferPercentage

public int mCurrentState

protected final IMediaPlayer.OnErrorListener mErrorListener

protected final IMediaPlayer.OnInfoListener mInfoListener

protected final IMediaPlayer.OnMessageListener mInternalMessageListener

protected final IMediaPlayer.OnLogEventListener mLogEventListener

protected MediaInfo mMediaInfo

protected final IMediaPlayer.OnSeekCompleteListener mSeekCompleteListener

Public Constructors

public KSYVideoView (Context context)

public KSYVideoView (Context context, AttributeSet attrs)

public KSYVideoView (Context context, AttributeSet attrs, int defStyleAttr)

Public Methods

public void addVideoRawBuffer (byte[] rawBuffer)

public int bufferEmptyCount ()

public float bufferEmptyDuration ()

public boolean canPause ()

public boolean canSeekBackward ()

public boolean canSeekForward ()

public void deselectTrack (int track)

public long getAudioCachedBytes ()

public long getAudioCachedDuration ()

public long getAudioCachedPackets ()

public int getAudioSessionId ()

public int getBufferPercentage ()

public float getBufferTimeMax ()

public String getClientIP ()

public long getCurrentPosition ()

public long getCurrentPts ()

public String getDataSource ()

public long getDecodedDataSize ()

public long getDownloadDataSize ()

public long getDuration ()

public String getLocalDnsIP ()

public MediaInfo getMediaInfo ()

public Bundle getMediaMeta ()

public Bitmap getScreenShot ()

public int getSelectedTrack (int trackType)

public String getServerAddress ()

public float getSpeed ()

public KSYQosInfo getStreamQosInfo ()

public long getStreamStartTime ()

public KSYTrackInfo[] getTrackInfo ()

public String getVersion ()

public long getVideoCachedBytes ()

public long getVideoCachedDuration ()

public long getVideoCachedPackets ()

public float getVideoDecodeFramesPerSecond ()

public int getVideoDecoder ()

public int getVideoHeight ()

public float getVideoOutputFramesPerSecond ()

public int getVideoSarDen ()

public int getVideoSarNum ()

public int getVideoWidth ()

public boolean isLooping ()

public boolean isPlayable ()

public boolean isPlaying ()

public boolean onKeyDown (int keyCode, KeyEvent event)

public boolean onTouchEvent (MotionEvent ev)

public boolean onTrackballEvent (MotionEvent ev)

public void pause ()

public void prepareAsync ()

public void release ()

public void reload (String path, boolean flushBuffer, KSYMediaPlayer.KSYReloadMode mode)

public void reload (String url, boolean flushBuffer)

public void reset ()

public void seekTo (long l)

public void seekTo (long pos, boolean accurate)

public void selectTrack (int track)

public void setBufferSize (int size)

public void setBufferTimeMax (float timeSecond)

public void setDataSource (FileDescriptor fd, long offset, long length)

Throws
IOException
IllegalArgumentException
IllegalStateException

public void setDataSource (FileDescriptor fd)

Throws
IOException

public void setDataSource (String path)

Throws
IOException

public void setDataSource (Context context, Uri uri)

Throws
IOException

public void setDataSource (Context context, Uri uri, Map<String, String> headers)

Throws
IOException

public void setDecodeMode (KSYMediaPlayer.KSYDecodeMode mode)

public void setDeinterlaceMode (KSYMediaPlayer.KSYDeinterlaceMode mode)

public void setLooping (boolean looping)

public void setMediaController (IMediaController controller)

public void setMirror (boolean mirror)

public void setOnAudioPCMAvailableListener (KSYMediaPlayer.OnAudioPCMListener listener)

public void setOnBufferingUpdateListener (IMediaPlayer.OnBufferingUpdateListener l)

public void setOnCompletionListener (IMediaPlayer.OnCompletionListener l)

public void setOnErrorListener (IMediaPlayer.OnErrorListener l)

public void setOnInfoListener (IMediaPlayer.OnInfoListener l)

public void setOnLogEventListener (IMediaPlayer.OnLogEventListener l)

public void setOnMessageListener (IMediaPlayer.OnMessageListener l)

public void setOnPreparedListener (IMediaPlayer.OnPreparedListener l)

public void setOnSeekCompleteListener (IMediaPlayer.OnSeekCompleteListener l)

public void setOnVideoSizeChangedListener (IMediaPlayer.OnVideoSizeChangedListener l)

public void setPlayableRanges (long startTime, long endTime)

public void setPlayerMute (int mute)

public boolean setRotateDegree (int degree)

public void setRotation (float rotation)

public void setScreenOnWhilePlaying (boolean screenOn)

public void setSpeed (float speed)

public void setTimeout (int prepareTimeout, int readTimeout)

public void setVideoOffset (float horizontal, float vertical)

public void setVideoRawDataListener (KSYMediaPlayer.OnVideoRawDataListener listener)

public void setVideoRenderingState (int mode)

public void setVideoScalingMode (int mode)

public void setVolume (float leftVolume, float rightVolume)

public void setWakeMode (Context context, int mode)

public void shouldAutoPlay (boolean state)

public void softReset ()

public void start ()

public void stop ()

public void surfaceChanged (SurfaceHolder holder, int format, int width, int height)

public void surfaceCreated (SurfaceHolder holder)

public void surfaceDestroyed (SurfaceHolder holder)

Protected Methods

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)