Android 3.1 / Galaxy Tab / VideoView will not play

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

In my Motorola Xoom with 3.0.1, it works fine.

On my Samsung Galaxy Tab 10.1 with 3.1 it does not work. I just get the error message "Sorry, the video cannot be played." The error trap in the code just gives me "MEDIA_ERROR_UNKNOWN".

I suspect a problem with the codec (even though my codec is 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 offers me to convert the video. The resulting file plays perfectly in the Video application on the device. Iā€™m taking a file from the device (I checked it in VLC, it says that the video codec is now mp4v) and try to play it through my application - the same result.

Is there anything specific around 3.1 or the Galaxy Tab that is causing this problem?

+6
source share
2 answers

The problem is as described here:

Can video video play back video stored in internal storage?

My application stores files on internal memory. The Xoom that I used for testing was implemented, and therefore, permissions were not a problem. However, the Galaxy is not implemented, so the video will not play.

+1
source

Double check the download / playback location. Since this is a different device, the path to the file may be slightly different.

+1
source

Source: https://habr.com/ru/post/909483/


All Articles