Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 3.1 / Galaxy Tab / VideoView won't play

My app downloads a video file from a server and plays it using VideoView. I am using a H264 (AVC) encoded file in an .mp4 container.

On my Motorola Xoom with 3.0.1, it works perfectly.

On my Samsung Galaxy Tab 10.1 with 3.1, it does not work. I simply get an error message 'Sorry, the video cannot be played'. Trapping the error in code simply gives me 'MEDIA_ERROR_UNKNOWN'.

I suspect a codec problem (despite my codec being valid, according to http://developer.android.com/guide/appendix/media-formats.html). I take the same video file and manually copy it to the device - the device prompts me to convert the video. The resulting file plays fine in the Video app on the device. I take the file back off the device (inspected it in VLC tells me the video codec is now mp4v) and try to play it through my app - same result.

Is there something specific about 3.1, or the Galaxy Tab, that is causing this problem?

like image 965
TheNextman Avatar asked Feb 27 '12 20:02

TheNextman


2 Answers

Double check the download/play location. Since it's a different device manufacture the path to the file might be slightly different

like image 119
Brent Hacker Avatar answered Nov 03 '22 17:11

Brent Hacker


The issue is as described here:

Can a videoview play a video stored on internal storage?

My app stores the files on internal storage. The Xoom I was using to test was rooted, and therefore permissions were not a problem. However the Galaxy is not rooted, so videos would not play.

like image 41
TheNextman Avatar answered Nov 03 '22 17:11

TheNextman