1

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

4

1 回答 1

1

Android Supported Media Formats读取文档,它告诉android支持哪种媒体文件。

对于崩溃问题,请将您的代码放在 try...catch 块中,如下所示,

try
{
      // Code to play media file.
}
catch ( Exception e )
{
      // Display a Toast message, "File format doesn't support"
}
于 2012-05-26T13:20:26.740 回答