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,不然打開屏幕是黑色,卡死,會感覺日了狗一樣。