我是靠谱客的博主 忧虑人生,这篇文章主要介绍android 用VideoView播放本地视频文件,现在分享给大家,希望可以做个参考。

在VideoView设置uri的时候,加上"android:resource//你的应用包名"+视频文件在R文件中的ID名称


videoView = (VideoView) this.findViewById(R.id.VideoView01);
MediaController controller = new MediaController(this);
this.videoView.setMediaController(controller);
//下面android:resource://是固定的,org.dengzh是我的包名,不是.java文件package名称,R.raw.movie_1是id名称
videoView.setVideoURI(Uri.parse("android.resource://org.dengzh/"+R.raw.movie_1));

最后

以上就是忧虑人生最近收集整理的关于android 用VideoView播放本地视频文件的全部内容,更多相关android内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(122)

评论列表共有 0 条评论

立即
投稿
返回
顶部