我正在开发一个应用程序,我需要从SD卡播放视频。除了摩托罗拉2.3.3设备外,我在所有设备上都使用了下面的代码,并且运行良好。
有时它会播放10-15秒的视频,然后黑屏出现,但有时它只显示黑屏,并在视频视图的底部显示持续时间。
所以,请引导我…谢谢你
VideoView vv = (VideoView) this.findViewById(R.id.video_view);
String filepath = "mnt/sdcard/my_video.mp4";
MediaController mc = new MediaController(this);
mc.setAnchorView(vv);
vv.setMediaController(mc);
vv.requestFocus();
vv.start();
最佳答案
if(play the same video using default player in gallery){
//you are doing something wrong in ur code
}else{
//this device has no capabilities to play the provided video with the default codes.
//try to look for any installed app that can play the video for this devices
}