| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 } | 328 } |
| 329 | 329 |
| 330 void WebMediaPlayerAndroid::requestRemotePlayback() { | 330 void WebMediaPlayerAndroid::requestRemotePlayback() { |
| 331 player_manager_->RequestRemotePlayback(player_id_); | 331 player_manager_->RequestRemotePlayback(player_id_); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void WebMediaPlayerAndroid::requestRemotePlaybackControl() { | 334 void WebMediaPlayerAndroid::requestRemotePlaybackControl() { |
| 335 player_manager_->RequestRemotePlaybackControl(player_id_); | 335 player_manager_->RequestRemotePlaybackControl(player_id_); |
| 336 } | 336 } |
| 337 | 337 |
| 338 void WebMediaPlayerAndroid::requestRemotePlaybackStop() { |
| 339 player_manager_->RequestRemotePlaybackStop(player_id_); |
| 340 } |
| 341 |
| 338 void WebMediaPlayerAndroid::seek(double seconds) { | 342 void WebMediaPlayerAndroid::seek(double seconds) { |
| 339 DCHECK(main_thread_checker_.CalledOnValidThread()); | 343 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 340 DVLOG(1) << __FUNCTION__ << "(" << seconds << ")"; | 344 DVLOG(1) << __FUNCTION__ << "(" << seconds << ")"; |
| 341 | 345 |
| 342 playback_completed_ = false; | 346 playback_completed_ = false; |
| 343 base::TimeDelta new_seek_time = base::TimeDelta::FromSecondsD(seconds); | 347 base::TimeDelta new_seek_time = base::TimeDelta::FromSecondsD(seconds); |
| 344 | 348 |
| 345 if (seeking_) { | 349 if (seeking_) { |
| 346 if (new_seek_time == seek_time_) { | 350 if (new_seek_time == seek_time_) { |
| 347 pending_seek_ = false; | 351 pending_seek_ = false; |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1312 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 1309 switches::kDisableMediaSuspend)) { | 1313 switches::kDisableMediaSuspend)) { |
| 1310 return false; | 1314 return false; |
| 1311 } | 1315 } |
| 1312 | 1316 |
| 1313 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && | 1317 return base::FeatureList::IsEnabled(media::kResumeBackgroundVideo) && |
| 1314 hasAudio() && !isRemote() && delegate_ && delegate_->IsHidden(); | 1318 hasAudio() && !isRemote() && delegate_ && delegate_->IsHidden(); |
| 1315 } | 1319 } |
| 1316 | 1320 |
| 1317 } // namespace content | 1321 } // namespace content |
| OLD | NEW |