展会信息港展会大全

如何使用VideoView播放视频
来源:互联网   发布日期:2016-01-14 11:32:28   浏览:2238次  

导读:private void initVideoPlayer(String filePath) { Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + filePath); VideoView videoView = (VideoView)this.findViewById(R.id.video_view); videoView.setMediaController(new Medi...

private void initVideoPlayer(String filePath) {

Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath() + filePath);

VideoView videoView = (VideoView)this.findViewById(R.id.video_view);

videoView.setMediaController(new MediaController(this));

videoView.setVideoURI(uri);

videoView.start();

videoView.requestFocus();

}

赞助本站

人工智能实验室

相关热词: android开发 android教程

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港