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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 // We don't know whether the current media content has video unless | 429 // We don't know whether the current media content has video unless |
430 // the player is prepared. If the player is not prepared, we fall back | 430 // the player is prepared. If the player is not prepared, we fall back |
431 // to the mime-type. There may be no mime-type on a redirect URL. | 431 // to the mime-type. There may be no mime-type on a redirect URL. |
432 // In that case, we conservatively assume it contains video so that | 432 // In that case, we conservatively assume it contains video so that |
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; |
vivekg
2013/12/23 12:00:21
Would it make sense to check for specific video mi
| |
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; | |
vivekg
2013/12/23 11:51:12
This change looks suspicious to me! We need to che
| |
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 |