美文网首页
Videoview的简单使用

Videoview的简单使用

作者: 流水线上的程序员 | 来源:发表于2017-02-07 12:30 被阅读0次

videoView用于播放视频的android控件,使用步骤:

String path = Environment.getExternalStorageDirectory().getAbsolutePath()+"/dd.mp4";//获取本地视频的绝对路径
String url =""; //网络视频的路径

1.使用系统自带的MediaControll|er类来控制播放开始和暂停

videoView.setMediaController(new MediaController(this));//添加播放控制

videoview.setvideoPath(path);// 播放本地视频

videoView.setVideoURI(Uri.parse(url));// 播放网络视频

相关文章

网友评论

      本文标题:Videoview的简单使用

      本文链接:https://www.haomeiwen.com/subject/jwwpittx.html