public class VideoTextureView extends TextureView implements VideoWrapperView.VideoController
| Constructor and Description |
|---|
VideoTextureView(Context context) |
VideoTextureView(Context context,
AttributeSet attrs) |
VideoTextureView(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) |
void |
onPrepared(MediaPlayer mp) |
void |
onSurfaceTextureAvailable(SurfaceTexture surface,
int w,
int h) |
boolean |
onSurfaceTextureDestroyed(SurfaceTexture surface) |
void |
onSurfaceTextureSizeChanged(SurfaceTexture surface,
int w,
int h) |
void |
onSurfaceTextureUpdated(SurfaceTexture surface) |
void |
onVideoSizeChanged(MediaPlayer mp,
int width,
int height) |
void |
pause() |
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 |
updateSize(int viewWidth,
int viewHeight) |
public VideoTextureView(Context context)
public VideoTextureView(Context context,
AttributeSet attrs)
public VideoTextureView(Context context,
AttributeSet attrs,
int defStyle)
public void setVideoPath(java.lang.String path)
public void setVideoURI(Uri uri)
setVideoURI in interface VideoWrapperView.VideoControllerpublic void updateSize(int viewWidth,
int viewHeight)
updateSize 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 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 onSurfaceTextureAvailable(SurfaceTexture surface,
int w,
int h)
public boolean onSurfaceTextureDestroyed(SurfaceTexture surface)
public void onSurfaceTextureSizeChanged(SurfaceTexture surface,
int w,
int h)
public void onSurfaceTextureUpdated(SurfaceTexture surface)