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

Side by Side Diff: webkit/media/android/webmediaplayer_impl_android.cc

Issue 11442056: Add external surface rendering mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add getPersonality() Created 8 years 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
OLDNEW
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_impl_android.h" 5 #include "webkit/media/android/webmediaplayer_impl_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.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 "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 void WebMediaPlayerImplAndroid::OnMediaPlayerPlay() { 117 void WebMediaPlayerImplAndroid::OnMediaPlayerPlay() {
118 UpdatePlayingState(true); 118 UpdatePlayingState(true);
119 client()->playbackStateChanged(); 119 client()->playbackStateChanged();
120 } 120 }
121 121
122 void WebMediaPlayerImplAndroid::OnMediaPlayerPause() { 122 void WebMediaPlayerImplAndroid::OnMediaPlayerPause() {
123 UpdatePlayingState(false); 123 UpdatePlayingState(false);
124 client()->playbackStateChanged(); 124 client()->playbackStateChanged();
125 } 125 }
126 126
127 void WebMediaPlayerImplAndroid::OnDidEnterVideoView() {
128 SetIsInVideoView(true);
129 SetNeedsEstablishPeer(false);
130 }
131
132 void WebMediaPlayerImplAndroid::OnDidExitVideoView() {
133 SetIsInVideoView(false);
134 SetNeedsEstablishPeer(true);
135 // We had the video view surface connected to Android MediaPlayer,
qinmin 2012/12/17 19:34:06 so if i have 2 videos on the page, one is playing,
wonsik2 2013/02/14 14:56:38 I thought we only allow one MediaPlayer instance t
136 // so reconnect our surface texture for embedded playback.
137 if (!paused())
138 EstablishSurfaceTexturePeer();
139 }
140
127 void WebMediaPlayerImplAndroid::Destroy() { 141 void WebMediaPlayerImplAndroid::Destroy() {
128 proxy_->DestroyPlayer(player_id()); 142 proxy_->DestroyPlayer(player_id());
129 proxy_ = NULL; 143 proxy_ = NULL;
130 } 144 }
131 145
132 void WebMediaPlayerImplAndroid::SetVideoSurface(jobject j_surface) {} 146 void WebMediaPlayerImplAndroid::SetVideoSurface(jobject j_surface) {}
133 147
134 } // namespace webkit_media 148 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698