播放本地视频
Intent intent = new Intent(Intent.ACTION_VIEW);
String type = "Video/mp4";
Uri uri = Uri.parse("file:///sdcard/test.mp4");
intent.setDataAndType(uri,type);
startActivity(intent);
播放网络视频
1.方法一
Intent intent =newIntent(Intent.ACTION_VIEW);
String type ="video/*";
Uri uri = Uri.parse("http://github.liaoxuefeng.com/sinaweibopy/video/git-add-changes.mp4");
intent.setDataAndType(uri,type);
startActivity(intent);
2.方法二
Intent intent1 = new Intent(Intent.ACTION_VIEW);
Uri uri1 = Uri.parse("http://github.liaoxuefeng.com/sinaweibopy/video/git-add-changes.mp4");
intent.setData(uri1);
startActivity(intent);