Strange Behavior of Android VideoView - "Can't Play Video"

1)When the message "Can't Play Video" occurs?

Android usually gives out this message, when it is not able to play the media content. The reasons for this to happen can be anything like

  • Unsupported file format
  • Unsupported codecs
  • Erroneous content

to mention a few.

2)What are the Solution for that?

Unless you have your own Media Framework in your app, there is no solution from the application level

3) What could be possible mistakes in my application?

Very unlikely the mistake is in your application. If you read the logs, you will see that the error seems to originate from the DataSource of opencore (Which version of android are you running anyway? It is still using Opencore instead of StageFright). It is recognizing it as a large file (> 2GB) and hence giving out the error "E/OsclDirectFileIO( 2182): [LargeFileSupport] OsclDirectFileIO::OpenFileOrSharedFd Error = -1"

The other thing to note is certain phones have better multimedia capability than the other phones, since OEM's can themselves improve the multimedia capability. So there is no written guarantee that all files can be played on all devices, even though it conforms to the supported formats, codecs mentioned by Android.


Its all about format problem, Some phone record the video in mp4 format and some in 3gp format, but in almost all phones the default mediaplayer support 3gp format. So the solution is you need to convert it into 3gp at the time of playing. This thing is difficult to handle in android, So at server end you can do it easily and hence whatever the format of the video is being uploaded you can download it in one format .3gp and it will work fine.


Make sure that your video is in MP4 format , but if still does not play or shows same error then fault is not with the code. Fault is in the video resolution. just check height and width of you video and match it with you video view component. There are lot of free video compressors Online available. So just compress your video and test it.

It will work. Cheers!!!