| 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |