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

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: rectifying the typo in comparision Created 7 years 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..9e8fa933eaca8079a7e0fd7855b1324b451300a9 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -441,7 +441,12 @@ 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;
+ return mime.find("audio/") != std::string::npos;
qinmin 2014/01/06 18:23:49 I don't think this is right. If the mime is video/
}
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