2

I just came across the limitation of VideoView of not being able to play mp4 video files that are wider than 320 pixels. I was wondering how can we overcome these limitations. I am trying to make my app as forgiving as possible, so other than using VideoViews is there another way to play these mp4 videos?

Chris

Chris
  • 3,787
  • 13
  • 42
  • 49
  • I have seen this limitation talked about before, but I have had success in displaying a video 480px wide running on a Nexus One and Motorola Droid. – sgarman May 27 '10 at 19:13

1 Answers1

9

I am not aware of a 320px wide limit on VideoView, though I haven't tried it.

You can use MediaPlayer and a SurfaceView to play back videos. In fact, that's pretty much all VideoView is. Last I looked at the VideoView source code, it was only ~200 lines.

Here is a sample project that implements a video player using MediaPlayer and SurfaceView, with screen taps to bring up some pop-up panels (e.g., timeline).

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • I tried playing the video with MediaPlayer and SurfaceView, still no luck! Also, if VideoView is just an abstraction of MediaPlayer and SurfaceView, then wouldn't the limitation have come from there? – Chris May 29 '10 at 17:17
  • 4
    I have played videos wider than 320px using `MediaPlayer` and `SurfaceView`. So have millions of other people with Android devices, using the Gallery (which uses `VideoView`, as it turns out) or third-party video players. I suspect that you are having some other problem than a built-in "limitation of VideoView of not being able to play mp4 video files that are wider than 320 pixels". – CommonsWare May 29 '10 at 18:27