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/android/build_info.h" | 9 #include "base/android/build_info.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
979 if (!needs_external_surface_) | 979 if (!needs_external_surface_) |
980 SetNeedsEstablishPeer(true); | 980 SetNeedsEstablishPeer(true); |
981 } | 981 } |
982 | 982 |
983 void WebMediaPlayerAndroid::OnDestruct() { | 983 void WebMediaPlayerAndroid::OnDestruct() { |
984 NOTREACHED() << "WebMediaPlayer should be destroyed before any " | 984 NOTREACHED() << "WebMediaPlayer should be destroyed before any " |
985 "RenderFrameObserver::OnDestruct() gets called when " | 985 "RenderFrameObserver::OnDestruct() gets called when " |
986 "the RenderFrame goes away."; | 986 "the RenderFrame goes away."; |
987 } | 987 } |
988 | 988 |
989 void WebMediaPlayerAndroid::InitializePlayer( | 989 void WebMediaPlayerAndroid::InitializePlayer( |
scherkus (not reviewing)
2014/08/28 21:09:08
in the regular HTTP case this may not get called i
qinmin
2014/08/28 21:29:50
I am concerned about url redirections and we may g
| |
990 const GURL& url, | 990 const GURL& url, |
991 const GURL& first_party_for_cookies, | 991 const GURL& first_party_for_cookies, |
992 bool allow_stored_credentials, | 992 bool allow_stored_credentials, |
993 int demuxer_client_id) { | 993 int demuxer_client_id) { |
994 UMA_HISTOGRAM_BOOLEAN( | |
995 "Media.MSE.Playback", player_type_ == MEDIA_PLAYER_TYPE_MEDIA_SOURCE); | |
996 if (player_type_ == MEDIA_PLAYER_TYPE_URL) { | |
997 UMA_HISTOGRAM_BOOLEAN("Media.Android.IsHttpLiveStreamingMedia", | |
998 IsHLSStream()); | |
999 } | |
994 allow_stored_credentials_ = allow_stored_credentials; | 1000 allow_stored_credentials_ = allow_stored_credentials; |
995 player_manager_->Initialize( | 1001 player_manager_->Initialize( |
996 player_type_, player_id_, url, first_party_for_cookies, demuxer_client_id, | 1002 player_type_, player_id_, url, first_party_for_cookies, demuxer_client_id, |
997 frame_->document().url(), allow_stored_credentials); | 1003 frame_->document().url(), allow_stored_credentials); |
998 if (player_manager_->ShouldEnterFullscreen(frame_)) | 1004 if (player_manager_->ShouldEnterFullscreen(frame_)) |
999 player_manager_->EnterFullscreen(player_id_, frame_); | 1005 player_manager_->EnterFullscreen(player_id_, frame_); |
1000 } | 1006 } |
1001 | 1007 |
1002 void WebMediaPlayerAndroid::Pause(bool is_media_related_action) { | 1008 void WebMediaPlayerAndroid::Pause(bool is_media_related_action) { |
1003 player_manager_->Pause(player_id_, is_media_related_action); | 1009 player_manager_->Pause(player_id_, is_media_related_action); |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1740 } | 1746 } |
1741 | 1747 |
1742 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1748 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1743 std::string mime; | 1749 std::string mime; |
1744 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) | 1750 if (!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) |
1745 return false; | 1751 return false; |
1746 return !mime.compare("application/x-mpegurl"); | 1752 return !mime.compare("application/x-mpegurl"); |
1747 } | 1753 } |
1748 | 1754 |
1749 } // namespace content | 1755 } // namespace content |
OLD | NEW |