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

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

Issue 1842763003: Revert of Remove secondary player from Media Sessions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "content/browser/frame_host/render_frame_host_impl.h" 10 #include "content/browser/frame_host/render_frame_host_impl.h"
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( 645 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer(
646 int player_id, media::MediaPlayerAndroid* player) { 646 int player_id, media::MediaPlayerAndroid* player) {
647 media::MediaPlayerAndroid* previous_player = NULL; 647 media::MediaPlayerAndroid* previous_player = NULL;
648 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); 648 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin();
649 it != players_.end(); ++it) { 649 it != players_.end(); ++it) {
650 if ((*it)->player_id() == player_id) { 650 if ((*it)->player_id() == player_id) {
651 previous_player = *it; 651 previous_player = *it;
652 #if defined(VIDEO_HOLE) 652 #if defined(VIDEO_HOLE)
653 ReleaseExternalSurface(player_id); 653 ReleaseExternalSurface(player_id);
654 #endif 654 #endif
655 MediaWebContentsObserverAndroid::FromWebContents(web_contents_)
656 ->DisconnectMediaSession(render_frame_host_,
657 player_id_to_delegate_id_map_[player_id]);
658 players_.weak_erase(it); 655 players_.weak_erase(it);
659 players_.push_back(player); 656 players_.push_back(player);
660 break; 657 break;
661 } 658 }
662 } 659 }
663 return scoped_ptr<media::MediaPlayerAndroid>(previous_player); 660 return scoped_ptr<media::MediaPlayerAndroid>(previous_player);
664 } 661 }
665 662
666 bool BrowserMediaPlayerManager::RequestDecoderResources( 663 bool BrowserMediaPlayerManager::RequestDecoderResources(
667 int player_id, bool temporary) { 664 int player_id, bool temporary) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 if (!player) 740 if (!player)
744 return; 741 return;
745 player->Start(); 742 player->Start();
746 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { 743 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) {
747 video_view_->OpenVideo(); 744 video_view_->OpenVideo();
748 fullscreen_player_is_released_ = false; 745 fullscreen_player_is_released_ = false;
749 } 746 }
750 } 747 }
751 748
752 } // namespace content 749 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698