1 问题
VideoView控件如何配合MediaController使用,就会显示进度条,但是位置摆放在最底部,不是我们想要的结果
2、基本使用
private var mMediaController:MediaController? = nullfun playVedio() {mMediaController = MediaController(this as Activity)trashVideoView.setVisibility(View.VISIBLE)
// trashVideoView.setVideoPath("/storage/emulated/0/tencent/MicroMsg/WeiXin/1582968546437.mp4")
// trashVideoView.setVideoPath("/sdcard/1582968546437.mp4")trashVideoView.setVideoPath(filePath)
// trashVideoView.setVideoPath("/sdcard/test1.mp4")trashVideoView.setMediaController(mMediaController)trashVideoView.start()
}
这里一定要注意,需要把this转Activitiy,不然打开屏幕是黑色,卡死,会感觉日了狗一样。