Index: content/renderer/media/android/webmediaplayer_android.cc |
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc |
index 6a0d2fc7a1a723312fec80f6f8c97013b0ad9611..bdb2d6997572e46f174f8e89e827249f76a5c790 100644 |
--- a/content/renderer/media/android/webmediaplayer_android.cc |
+++ b/content/renderer/media/android/webmediaplayer_android.cc |
@@ -440,8 +440,18 @@ bool WebMediaPlayerAndroid::hasVideo() const { |
} |
bool WebMediaPlayerAndroid::hasAudio() const { |
- // TODO(hclam): Query status of audio and return the actual value. |
- return true; |
+ if (!url_.has_path()) |
+ return false; |
+ std::string mime; |
+ if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) |
+ return true; |
+ |
+ if (mime.find("audio/") != std::string::npos || |
+ mime.find("video/") != std::string::npos || |
+ mime.find("application/ogg") != std::string::npos) { |
+ return true; |
+ } |
+ return false; |
} |
bool WebMediaPlayerAndroid::paused() const { |