3

我正在开发一个应用程序,我需要从 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();
4

1 回答 1

0
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

}
于 2013-05-08T09:15:49.990 回答