Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7529)

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 120693002: Fix- WebMediaPlayerAndroid::hasAudio() to query status of audio and return actual value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: recognizing video mime types for audio Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698