Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 // TODO(hclam): Query status of audio and return the actual value. |
| 444 return true; | 444 if (!url_.has_path()) |
| 445 return false; | |
| 446 std::string mime; | |
| 447 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) | |
| 448 return true; | |
| 449 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/
| |
| 445 } | 450 } |
| 446 | 451 |
| 447 bool WebMediaPlayerAndroid::paused() const { | 452 bool WebMediaPlayerAndroid::paused() const { |
| 448 return !is_playing_; | 453 return !is_playing_; |
| 449 } | 454 } |
| 450 | 455 |
| 451 bool WebMediaPlayerAndroid::seeking() const { | 456 bool WebMediaPlayerAndroid::seeking() const { |
| 452 return seeking_; | 457 return seeking_; |
| 453 } | 458 } |
| 454 | 459 |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1445 | 1450 |
| 1446 void WebMediaPlayerAndroid::exitFullscreen() { | 1451 void WebMediaPlayerAndroid::exitFullscreen() { |
| 1447 manager_->ExitFullscreen(player_id_); | 1452 manager_->ExitFullscreen(player_id_); |
| 1448 } | 1453 } |
| 1449 | 1454 |
| 1450 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1455 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 1451 return manager_->CanEnterFullscreen(frame_); | 1456 return manager_->CanEnterFullscreen(frame_); |
| 1452 } | 1457 } |
| 1453 | 1458 |
| 1454 } // namespace content | 1459 } // namespace content |
| OLD | NEW |