The answer to this question will never be the same for all devices or for all videos.
Whether a given video file will play in this player depends on three things:
- Video container format (file type).
- Codecs in which video (and possibly audio) streams are encoded
- Your player supports this combination of container format and codec
Support for the codec and player / device is almost certainly the cause of the conflicting results you saw. (A codec, if you didn’t know, is essentially a repeatable mathematical formula that tells your system how to convert bits and bytes packed into a file into moving images (and vice versa, for that matter))
There is a wide variety of video codecs in video files. Support for these codecs is extremely controversial due to the history of video distribution. Many devices do not support streams encoded using certain codecs. There are many reasons for this, but the most common are the ambiguity or cost of licensing.
For example, a few years ago, almost everything was encoded in a .FLV container with the On2 VP6 / VP7 / VP8 codec. Today it causes a headache, because although On2 owned these codecs, they carefully controlled the licenses. This did not weaken until .FLV no longer began to lose its relevance, and therefore there are not so many (legitimate) software that could work with content encoded On2.
All this means that there is no silver bullet. All videos will never work on all devices, at least without the help of video players who install and use their own codecs to decode streams.
Needless to say, this does not apply to the libraries provided to you and your end users by the Android libraries installed at the factory.
So what are you doing? Well, if you do not produce a video player with your own codecs, you can most effectively solve the problem using a two-step approach:
- Target specific devices where you want your app to run
- Encode your content to use a video codec that works on all the devices you want to target. You may need to create two copies of your video if you find that there is no codec that works on all the devices that you plan to support.
Today, the broadest support is available with an MP4 container and video stream encoded using the H.264 codec (AVC). As I said, there is no silver bullet, and H.264 support is by no means universal, but this format will be played by more potential users than any other choice you can make, due to its popularity and wide support in modern desktop and mobile environments.
Some tools you may find useful:
- MediaInfo lets you peer into MPEG-style video containers to see which codecs are in use. This will be useful in determining which devices have problems with which codecs.
- FFmpeg is an encoding application that can convert your content to MP4 / H.264.
- Android Supported media formats List of supported media audio / video formats.
Good luck