videoview for large video

2019-03-06 14:26发布

问题:

VideoView vv = (VideoView)this.findViewById(R.id.screen_video);
Uri uri = Uri.parse(URL);
vv.setVideoURI(uri);
vv.start();

I use above code to play video file. I play a small video successly. But when I try to play a large video. It was Failure. The file is can be play by my phone. How to play a large video file with videoview? Or what limitation of videoview has?

I didn't see any error in logcat. But it also didn't show the buffering percentage.

回答1:

I don't know (and I could not find) clear specifications for videoview to play a video of a certain size. But to me it depends on the device and on the codecs used. For instance my device plays video encoded with MPEG4 (ASP) successfully whatever the size of the video is but if the video is encoded with H264 (MPEG4 AVC) that does not work if the video is larger than the size of the screen.

I hope it helps!