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

Side by Side 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: adding {} to if statement 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 // enterfullscreen call will not fail. 433 // enterfullscreen call will not fail.
434 if (!url_.has_path()) 434 if (!url_.has_path())
435 return false; 435 return false;
436 std::string mime; 436 std::string mime;
437 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) 437 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime))
438 return true; 438 return true;
439 return mime.find("audio/") == std::string::npos; 439 return mime.find("audio/") == std::string::npos;
440 } 440 }
441 441
442 bool WebMediaPlayerAndroid::hasAudio() const { 442 bool WebMediaPlayerAndroid::hasAudio() const {
443 // TODO(hclam): Query status of audio and return the actual value. 443 if (!url_.has_path())
444 return true; 444 return false;
445 std::string mime;
446 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime))
447 return true;
448
449 if (mime.find("audio/") != std::string::npos ||
450 mime.find("video/") != std::string::npos ||
451 mime.find("application/ogg") != std::string::npos) {
452 return true;
453 }
454 return false;
445 } 455 }
446 456
447 bool WebMediaPlayerAndroid::paused() const { 457 bool WebMediaPlayerAndroid::paused() const {
448 return !is_playing_; 458 return !is_playing_;
449 } 459 }
450 460
451 bool WebMediaPlayerAndroid::seeking() const { 461 bool WebMediaPlayerAndroid::seeking() const {
452 return seeking_; 462 return seeking_;
453 } 463 }
454 464
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 1455
1446 void WebMediaPlayerAndroid::exitFullscreen() { 1456 void WebMediaPlayerAndroid::exitFullscreen() {
1447 manager_->ExitFullscreen(player_id_); 1457 manager_->ExitFullscreen(player_id_);
1448 } 1458 }
1449 1459
1450 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 1460 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
1451 return manager_->CanEnterFullscreen(frame_); 1461 return manager_->CanEnterFullscreen(frame_);
1452 } 1462 }
1453 1463
1454 } // namespace content 1464 } // namespace content
OLDNEW
« 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