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/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged, | 212 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged, |
213 weak_factory_.GetWeakPtr())); | 213 weak_factory_.GetWeakPtr())); |
214 } | 214 } |
215 } else { | 215 } else { |
216 info_loader_.reset( | 216 info_loader_.reset( |
217 new MediaInfoLoader( | 217 new MediaInfoLoader( |
218 url, | 218 url, |
219 cors_mode, | 219 cors_mode, |
220 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo, | 220 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo, |
221 weak_factory_.GetWeakPtr()))); | 221 weak_factory_.GetWeakPtr()))); |
| 222 // TODO(qinmin): The url might be redirected when android media player |
| 223 // requests the stream. As a result, we cannot guarantee there is only |
| 224 // a single origin. Remove the following line when b/12573548 is fixed. |
| 225 // Check http://crbug.com/334204. |
| 226 info_loader_->set_single_origin(false); |
222 info_loader_->Start(frame_); | 227 info_loader_->Start(frame_); |
223 } | 228 } |
224 | 229 |
225 url_ = url; | 230 url_ = url; |
226 GURL first_party_url = frame_->document().firstPartyForCookies(); | 231 GURL first_party_url = frame_->document().firstPartyForCookies(); |
227 manager_->Initialize( | 232 manager_->Initialize( |
228 player_type_, player_id_, url, first_party_url, demuxer_client_id); | 233 player_type_, player_id_, url, first_party_url, demuxer_client_id); |
229 | 234 |
230 if (manager_->ShouldEnterFullscreen(frame_)) | 235 if (manager_->ShouldEnterFullscreen(frame_)) |
231 manager_->EnterFullscreen(player_id_, frame_); | 236 manager_->EnterFullscreen(player_id_, frame_); |
(...skipping 1306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 | 1543 |
1539 void WebMediaPlayerAndroid::exitFullscreen() { | 1544 void WebMediaPlayerAndroid::exitFullscreen() { |
1540 manager_->ExitFullscreen(player_id_); | 1545 manager_->ExitFullscreen(player_id_); |
1541 } | 1546 } |
1542 | 1547 |
1543 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1548 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
1544 return manager_->CanEnterFullscreen(frame_); | 1549 return manager_->CanEnterFullscreen(frame_); |
1545 } | 1550 } |
1546 | 1551 |
1547 } // namespace content | 1552 } // namespace content |
OLD | NEW |