Вопрос

I've noticed that some mobile phones are not able to play some video files. Sometimes it's .wav extension, and sometimes some other.

In such cases the app does not crash and no error is generated, but the audio file just silently does not get played.

How to detect such situations? Why is this happening on the first place?

PS. I need to detect this in Java code - programmatically

Это было полезно?

Решение

Android Supported Media Formats read the document, it tells which kind of media files are supported by the android.

For crashing problem please put your code in try...catch block like below,

try
{
      // Code to play media file.
}
catch ( Exception e )
{
      // Display a Toast message, "File format doesn't support"
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top