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

Side by Side Diff: content/renderer/media/android/renderer_media_player_manager.h

Issue 103583005: Restart fullscreen video playback when switching back from background (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 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 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 void UnregisterMediaPlayer(int player_id); 108 void UnregisterMediaPlayer(int player_id);
109 109
110 // Registers a ProxyMediaKeys object. There must be a WebMediaPlayerAndroid 110 // Registers a ProxyMediaKeys object. There must be a WebMediaPlayerAndroid
111 // object already registered for this id, and it is unregistered when the 111 // object already registered for this id, and it is unregistered when the
112 // player is unregistered. For now |media_keys_id| is the same as player_id 112 // player is unregistered. For now |media_keys_id| is the same as player_id
113 // used in other methods. 113 // used in other methods.
114 void RegisterMediaKeys(int media_keys_id, ProxyMediaKeys* media_keys); 114 void RegisterMediaKeys(int media_keys_id, ProxyMediaKeys* media_keys);
115 115
116 // Releases the media resources managed by this object when a video 116 // Releases the media resources managed by this object when a video
117 // is playing. 117 // is playing.
118 void ReleaseVideoResources(); 118 void PauseVideo();
119 void ResumeVideo();
qinmin 2013/12/06 00:10:13 s/rResumeVideo/ResumeFullscreenVideo/
119 120
120 // Checks whether a player can enter fullscreen. 121 // Checks whether a player can enter fullscreen.
121 bool CanEnterFullscreen(blink::WebFrame* frame); 122 bool CanEnterFullscreen(blink::WebFrame* frame);
122 123
123 // Called when a player entered or exited fullscreen. 124 // Called when a player entered or exited fullscreen.
124 void DidEnterFullscreen(blink::WebFrame* frame); 125 void DidEnterFullscreen(blink::WebFrame* frame);
125 void DidExitFullscreen(); 126 void DidExitFullscreen();
126 127
127 // Checks whether the Webframe is in fullscreen. 128 // Checks whether the Webframe is in fullscreen.
128 bool IsInFullscreen(blink::WebFrame* frame); 129 bool IsInFullscreen(blink::WebFrame* frame);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Info for all available WebMediaPlayerAndroid on a page; kept so that 178 // Info for all available WebMediaPlayerAndroid on a page; kept so that
178 // we can enumerate them to send updates about tab focus and visibility. 179 // we can enumerate them to send updates about tab focus and visibility.
179 std::map<int, WebMediaPlayerAndroid*> media_players_; 180 std::map<int, WebMediaPlayerAndroid*> media_players_;
180 181
181 // Info for all available ProxyMediaKeys. There must be at most one 182 // Info for all available ProxyMediaKeys. There must be at most one
182 // ProxyMediaKeys for each available WebMediaPlayerAndroid. 183 // ProxyMediaKeys for each available WebMediaPlayerAndroid.
183 std::map<int, ProxyMediaKeys*> media_keys_; 184 std::map<int, ProxyMediaKeys*> media_keys_;
184 185
185 int next_media_player_id_; 186 int next_media_player_id_;
186 187
188 // ID of the player that entered fullscreen.
189 int fullscreen_player_id_;
190
191 // Preserves the value of fullscreen_player_id_ between PauseVideo
192 // and ResumeVideo.
193 int paused_fullscreen_player_id_;
194
187 // WebFrame of the fullscreen video. 195 // WebFrame of the fullscreen video.
188 blink::WebFrame* fullscreen_frame_; 196 blink::WebFrame* fullscreen_frame_;
189 197
190 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); 198 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager);
191 }; 199 };
192 200
193 } // namespace content 201 } // namespace content
194 202
195 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ 203 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698