Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 493253002: [Android] Stop all media on undoable close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased again Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/android/scoped_java_ref.h" 7 #include "base/android/scoped_java_ref.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/browser/android/content_view_core_impl.h" 9 #include "content/browser/android/content_view_core_impl.h"
10 #include "content/browser/media/android/browser_demuxer_android.h" 10 #include "content/browser/media/android/browser_demuxer_android.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 void BrowserMediaPlayerManager::OnSeekRequest( 258 void BrowserMediaPlayerManager::OnSeekRequest(
259 int player_id, 259 int player_id,
260 const base::TimeDelta& time_to_seek) { 260 const base::TimeDelta& time_to_seek) {
261 Send(new MediaPlayerMsg_SeekRequest(RoutingID(), player_id, time_to_seek)); 261 Send(new MediaPlayerMsg_SeekRequest(RoutingID(), player_id, time_to_seek));
262 } 262 }
263 263
264 void BrowserMediaPlayerManager::PauseVideo() { 264 void BrowserMediaPlayerManager::PauseVideo() {
265 Send(new MediaPlayerMsg_PauseVideo(RoutingID())); 265 Send(new MediaPlayerMsg_PauseVideo(RoutingID()));
266 } 266 }
267 267
268 void BrowserMediaPlayerManager::ReleaseAllMediaPlayers() {
269 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin();
270 it != players_.end(); ++it) {
271 if ((*it)->player_id() == fullscreen_player_id_)
272 fullscreen_player_is_released_ = true;
273 (*it)->Release();
274 }
275 }
276
268 void BrowserMediaPlayerManager::OnSeekComplete( 277 void BrowserMediaPlayerManager::OnSeekComplete(
269 int player_id, 278 int player_id,
270 const base::TimeDelta& current_time) { 279 const base::TimeDelta& current_time) {
271 Send(new MediaPlayerMsg_SeekCompleted(RoutingID(), player_id, current_time)); 280 Send(new MediaPlayerMsg_SeekCompleted(RoutingID(), player_id, current_time));
272 } 281 }
273 282
274 void BrowserMediaPlayerManager::OnError(int player_id, int error) { 283 void BrowserMediaPlayerManager::OnError(int player_id, int error) {
275 Send(new MediaPlayerMsg_MediaError(RoutingID(), player_id, error)); 284 Send(new MediaPlayerMsg_MediaError(RoutingID(), player_id, error));
276 if (fullscreen_player_id_ == player_id) 285 if (fullscreen_player_id_ == player_id)
277 video_view_->OnMediaPlayerError(error); 286 video_view_->OnMediaPlayerError(error);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 #if defined(VIDEO_HOLE) 595 #if defined(VIDEO_HOLE)
587 MediaPlayerAndroid* player = GetPlayer(player_id); 596 MediaPlayerAndroid* player = GetPlayer(player_id);
588 if (player && player->IsSurfaceInUse()) 597 if (player && player->IsSurfaceInUse())
589 return; 598 return;
590 if (external_video_surface_container_) 599 if (external_video_surface_container_)
591 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 600 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
592 #endif // defined(VIDEO_HOLE) 601 #endif // defined(VIDEO_HOLE)
593 } 602 }
594 603
595 } // namespace content 604 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.h ('k') | content/browser/web_contents/web_contents_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698