OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "media/base/android/media_player_bridge.h" | 9 #include "media/base/android/media_player_bridge.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // content contains video. Android does not provide any function to do | 139 // content contains video. Android does not provide any function to do |
140 // this. | 140 // this. |
141 // We don't know whether the current media content has video unless | 141 // We don't know whether the current media content has video unless |
142 // the player is prepared. If the player is not prepared, we fall back | 142 // the player is prepared. If the player is not prepared, we fall back |
143 // to the mime-type. There may be no mime-type on a redirect URL. | 143 // to the mime-type. There may be no mime-type on a redirect URL. |
144 // In that case, we conservatively assume it contains video so that | 144 // In that case, we conservatively assume it contains video so that |
145 // enterfullscreen call will not fail. | 145 // enterfullscreen call will not fail. |
146 if (!url_.has_path()) | 146 if (!url_.has_path()) |
147 return false; | 147 return false; |
148 std::string mime; | 148 std::string mime; |
149 if(!net::GetMimeTypeFromFile(FilePath(url_.path()), &mime)) | 149 if(!net::GetMimeTypeFromFile(base::FilePath(url_.path()), &mime)) |
150 return true; | 150 return true; |
151 return mime.find("audio/") == std::string::npos; | 151 return mime.find("audio/") == std::string::npos; |
152 } | 152 } |
153 | 153 |
154 bool WebMediaPlayerAndroid::hasAudio() const { | 154 bool WebMediaPlayerAndroid::hasAudio() const { |
155 // TODO(hclam): Query status of audio and return the actual value. | 155 // TODO(hclam): Query status of audio and return the actual value. |
156 return true; | 156 return true; |
157 } | 157 } |
158 | 158 |
159 bool WebMediaPlayerAndroid::paused() const { | 159 bool WebMediaPlayerAndroid::paused() const { |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 | 417 |
418 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 418 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
419 needs_establish_peer_ = needs_establish_peer; | 419 needs_establish_peer_ = needs_establish_peer; |
420 } | 420 } |
421 | 421 |
422 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 422 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
423 is_playing_ = is_playing; | 423 is_playing_ = is_playing; |
424 } | 424 } |
425 | 425 |
426 } // namespace webkit_media | 426 } // namespace webkit_media |
OLD | NEW |