public class VideoSurfaceView extends SurfaceView implements VideoWrapperView.VideoController
| Constructor and Description |
|---|
VideoSurfaceView(Context context) |
VideoSurfaceView(Context context,
AttributeSet attrs) |
VideoSurfaceView(Context context,
AttributeSet attrs,
int defStyle) |
| Modifier and Type | Method and Description |
|---|---|
int |
getBufferPercentage() |
int |
getCurrentPosition() |
int |
getDuration() |
boolean |
isPlaying() |
void |
onBufferingUpdate(MediaPlayer mp,
int percent) |
void |
onCompletion(MediaPlayer mp) |
boolean |
onError(MediaPlayer mp,
int framework_err,
int impl_err) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onPrepared(MediaPlayer mp) |
void |
onVideoSizeChanged(MediaPlayer mp,
int width,
int height) |
void |
pause() |
int |
resolveAdjustedSize(int desiredSize,
int measureSpec) |
void |
seekTo(int msec) |
void |
setOnCompletionListener(OnCompletionListener l)
Register a callback to be invoked when the end of a media file has been
reached during playback.
|
void |
setOnErrorListener(OnErrorListener l)
Register a callback to be invoked when an error occurs during playback or
setup.
|
void |
setOnPreparedListener(MediaPlayer.OnPreparedListener l)
Register a callback to be invoked when the media file is loaded and ready
to go.
|
void |
setVideoPath(java.lang.String path) |
void |
setVideoURI(Uri uri) |
void |
setVideoURI(Uri uri,
java.util.Map<java.lang.String,java.lang.String> headers) |
void |
start() |
void |
stopPlayback() |
void |
surfaceChanged(SurfaceHolder holder,
int format,
int w,
int h) |
void |
surfaceCreated(SurfaceHolder holder) |
void |
surfaceDestroyed(SurfaceHolder holder) |
void |
updateSize(int viewWidth,
int viewHeight) |
public VideoSurfaceView(Context context)
public VideoSurfaceView(Context context,
AttributeSet attrs)
public VideoSurfaceView(Context context,
AttributeSet attrs,
int defStyle)
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
public int resolveAdjustedSize(int desiredSize,
int measureSpec)
public void setVideoPath(java.lang.String path)
public void setVideoURI(Uri uri)
setVideoURI in interface VideoWrapperView.VideoControllerpublic void setVideoURI(Uri uri,
java.util.Map<java.lang.String,java.lang.String> headers)
public void stopPlayback()
public void onVideoSizeChanged(MediaPlayer mp,
int width,
int height)
public void onPrepared(MediaPlayer mp)
public void onCompletion(MediaPlayer mp)
public boolean onError(MediaPlayer mp,
int framework_err,
int impl_err)
public void onBufferingUpdate(MediaPlayer mp,
int percent)
public void setOnPreparedListener(MediaPlayer.OnPreparedListener l)
setOnPreparedListener in interface VideoWrapperView.VideoControllerl - The callback that will be runpublic void setOnCompletionListener(OnCompletionListener l)
setOnCompletionListener in interface VideoWrapperView.VideoControllerl - The callback that will be runpublic void setOnErrorListener(OnErrorListener l)
setOnErrorListener in interface VideoWrapperView.VideoControllerl - The callback that will be runpublic void surfaceChanged(SurfaceHolder holder,
int format,
int w,
int h)
public void surfaceCreated(SurfaceHolder holder)
public void surfaceDestroyed(SurfaceHolder holder)
public void start()
start in interface VideoWrapperView.VideoControllerpublic void pause()
pause in interface VideoWrapperView.VideoControllerpublic int getDuration()
getDuration in interface VideoWrapperView.VideoControllerpublic int getCurrentPosition()
getCurrentPosition in interface VideoWrapperView.VideoControllerpublic void seekTo(int msec)
seekTo in interface VideoWrapperView.VideoControllerpublic boolean isPlaying()
isPlaying in interface VideoWrapperView.VideoControllerpublic int getBufferPercentage()
public void updateSize(int viewWidth,
int viewHeight)
updateSize in interface VideoWrapperView.VideoController