我使用了具有400x760分辨率(30fps)的mp4视频,并使用VideoView和MediaController将其集成到应用程序中
MediaController mediac;
VideoView video1;
mediac = new MediaController(this);
mediac.setAnchorView(video1);
video1 = (VideoView) findViewById(R.id.videoView1);
video1.setMediaController(mediac);
video1.setVideoPath("android.resource://video.test/raw/vid");
它在我的中兴刀片上运行正常,但在Evo,GS2和Galaxy S上,它表示soryy,无法播放此视频
答案 0 :(得分:0)
尝试
video_view.setVideoURI(Uri.parse(path));
有时直接作为字符串路径传递在某些设备上不起作用。代码对我来说很好:
path = Environment.getExternalStorageDirectory() + "/file_name";
// Add controls to a MediaPlayer like play, pause.
MediaController mc = new MediaController(this);
video_view.setMediaController(mc);
// Set the path of Video or URI.
video_view.setVideoURI(Uri.parse(path));
// Set the focus.
video_view.requestFocus();
video_view.start();