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 | |
450 if (mime.find("audio/") != std::string::npos || | |
451 mime.find("video/") != std::string::npos || | |
452 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.
| |
453 return true; | |
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 |