如何在android中检查媒体的MimeType

时间:2017-01-31 09:37:39

标签: android video

如何检查android中媒体的MimeType?

public boolean isVideoFile(String path) {

     String mimeType = URLConnection.guessContentTypeFromName(path);
     return mimeType != null && mimeType.indexOf("video") == 0 || mimeType.indexOf("audio")== 0;

}

0 个答案:

没有答案