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 #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 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 // Sets the poster image. | 67 // Sets the poster image. |
68 void SetPoster(int player_id, const GURL& poster); | 68 void SetPoster(int player_id, const GURL& poster); |
69 | 69 |
70 // Releases resources for the player. | 70 // Releases resources for the player. |
71 void ReleaseResources(int player_id); | 71 void ReleaseResources(int player_id); |
72 | 72 |
73 // Destroys the player in the browser process | 73 // Destroys the player in the browser process |
74 void DestroyPlayer(int player_id); | 74 void DestroyPlayer(int player_id); |
75 | 75 |
| 76 // Requests remote playback if possible |
| 77 void RequestRemotePlayback(int player_id); |
| 78 |
| 79 // Requests control of remote playback |
| 80 void RequestRemotePlaybackControl(int player_id); |
| 81 |
76 // Requests the player to enter fullscreen. | 82 // Requests the player to enter fullscreen. |
77 void EnterFullscreen(int player_id, blink::WebFrame* frame); | 83 void EnterFullscreen(int player_id, blink::WebFrame* frame); |
78 | 84 |
79 // Requests the player to exit fullscreen. | 85 // Requests the player to exit fullscreen. |
80 void ExitFullscreen(int player_id); | 86 void ExitFullscreen(int player_id); |
81 | 87 |
82 // Requests the player with |player_id| to use the CDM with |cdm_id|. | 88 // Requests the player with |player_id| to use the CDM with |cdm_id|. |
83 // Does nothing if |cdm_id| is kInvalidCdmId. | 89 // Does nothing if |cdm_id| is kInvalidCdmId. |
84 // TODO(xhwang): Update this when we implement setCdm(0). | 90 // TODO(xhwang): Update this when we implement setCdm(0). |
85 void SetCdm(int player_id, int cdm_id); | 91 void SetCdm(int player_id, int cdm_id); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 base::TimeTicks current_time_ticks); | 146 base::TimeTicks current_time_ticks); |
141 void OnMediaPlayerReleased(int player_id); | 147 void OnMediaPlayerReleased(int player_id); |
142 void OnConnectedToRemoteDevice(int player_id, | 148 void OnConnectedToRemoteDevice(int player_id, |
143 const std::string& remote_playback_message); | 149 const std::string& remote_playback_message); |
144 void OnDisconnectedFromRemoteDevice(int player_id); | 150 void OnDisconnectedFromRemoteDevice(int player_id); |
145 void OnDidExitFullscreen(int player_id); | 151 void OnDidExitFullscreen(int player_id); |
146 void OnDidEnterFullscreen(int player_id); | 152 void OnDidEnterFullscreen(int player_id); |
147 void OnPlayerPlay(int player_id); | 153 void OnPlayerPlay(int player_id); |
148 void OnPlayerPause(int player_id); | 154 void OnPlayerPause(int player_id); |
149 void OnRequestFullscreen(int player_id); | 155 void OnRequestFullscreen(int player_id); |
| 156 void OnRemoteRouteAvailabilityChanged(int player_id, bool routes_available); |
150 void OnPauseVideo(); | 157 void OnPauseVideo(); |
151 | 158 |
152 // Release all video player resources. | 159 // Release all video player resources. |
153 // If something is in progress the resource will not be freed. It will | 160 // If something is in progress the resource will not be freed. It will |
154 // only be freed once the tab is destroyed or if the user navigates away | 161 // only be freed once the tab is destroyed or if the user navigates away |
155 // via WebMediaPlayerAndroid::Destroy. | 162 // via WebMediaPlayerAndroid::Destroy. |
156 void ReleaseVideoResources(); | 163 void ReleaseVideoResources(); |
157 | 164 |
158 // Info for all available WebMediaPlayerAndroid on a page; kept so that | 165 // Info for all available WebMediaPlayerAndroid on a page; kept so that |
159 // we can enumerate them to send updates about tab focus and visibility. | 166 // we can enumerate them to send updates about tab focus and visibility. |
160 std::map<int, WebMediaPlayerAndroid*> media_players_; | 167 std::map<int, WebMediaPlayerAndroid*> media_players_; |
161 | 168 |
162 int next_media_player_id_; | 169 int next_media_player_id_; |
163 | 170 |
164 // WebFrame of the fullscreen video. | 171 // WebFrame of the fullscreen video. |
165 blink::WebFrame* fullscreen_frame_; | 172 blink::WebFrame* fullscreen_frame_; |
166 | 173 |
167 // WebFrame of pending fullscreen request. | 174 // WebFrame of pending fullscreen request. |
168 blink::WebFrame* pending_fullscreen_frame_; | 175 blink::WebFrame* pending_fullscreen_frame_; |
169 | 176 |
170 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); | 177 DISALLOW_COPY_AND_ASSIGN(RendererMediaPlayerManager); |
171 }; | 178 }; |
172 | 179 |
173 } // namespace content | 180 } // namespace content |
174 | 181 |
175 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ | 182 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_MEDIA_PLAYER_MANAGER_H_ |
OLD | NEW |