Chromium Code Reviews| 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..92608730571bccb17d35f647a07e3db683c0386f 100644 |
| --- a/content/renderer/media/android/webmediaplayer_android.cc |
| +++ b/content/renderer/media/android/webmediaplayer_android.cc |
| @@ -441,7 +441,17 @@ 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) |
|
qinmin
2014/01/08 20:09:20
nit: {} is needed for if statement that spans mult
amogh.bihani
2014/01/09 03:43:41
Done.
|
| + return true; |
| + return false; |
| } |
| bool WebMediaPlayerAndroid::paused() const { |