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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 291163004: Implement media cast buttons (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tidy up button name Created 6 years, 4 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "config.h" 5 #include "config.h"
6 #include "web/WebMediaPlayerClientImpl.h" 6 #include "web/WebMediaPlayerClientImpl.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/html/HTMLMediaElement.h" 9 #include "core/html/HTMLMediaElement.h"
10 #include "core/html/TimeRanges.h" 10 #include "core/html/TimeRanges.h"
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 void WebMediaPlayerClientImpl::requestFullscreen() 185 void WebMediaPlayerClientImpl::requestFullscreen()
186 { 186 {
187 m_client->mediaPlayerRequestFullscreen(); 187 m_client->mediaPlayerRequestFullscreen();
188 } 188 }
189 189
190 void WebMediaPlayerClientImpl::requestSeek(double time) 190 void WebMediaPlayerClientImpl::requestSeek(double time)
191 { 191 {
192 m_client->mediaPlayerRequestSeek(time); 192 m_client->mediaPlayerRequestSeek(time);
193 } 193 }
194 194
195 void WebMediaPlayerClientImpl::remoteRouteAvailabilityChanged(bool routesAvailab le)
196 {
197 m_client->mediaPlayerRemoteRouteAvailabilityChanged(routesAvailable);
198 }
199
200 void WebMediaPlayerClientImpl::connectedToRemoteDevice()
201 {
202 m_client->mediaPlayerConnectedToRemoteDevice();
203 }
204
205 void WebMediaPlayerClientImpl::disconnectedFromRemoteDevice()
206 {
207 m_client->mediaPlayerDisconnectedFromRemoteDevice();
208 }
209
195 // MediaPlayer ------------------------------------------------- 210 // MediaPlayer -------------------------------------------------
196 void WebMediaPlayerClientImpl::load(WebMediaPlayer::LoadType loadType, const WTF ::String& url, WebMediaPlayer::CORSMode corsMode) 211 void WebMediaPlayerClientImpl::load(WebMediaPlayer::LoadType loadType, const WTF ::String& url, WebMediaPlayer::CORSMode corsMode)
197 { 212 {
198 ASSERT(!m_webMediaPlayer); 213 ASSERT(!m_webMediaPlayer);
199 214
200 // FIXME: Remove this cast 215 // FIXME: Remove this cast
201 LocalFrame* frame = mediaElement().document().frame(); 216 LocalFrame* frame = mediaElement().document().frame();
202 217
203 WebURL poster = m_client->mediaPlayerPosterURL(); 218 WebURL poster = m_client->mediaPlayerPosterURL();
204 219
205 KURL kurl(ParsedURLString, url); 220 KURL kurl(ParsedURLString, url);
206 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame); 221 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame);
207 if (!m_webMediaPlayer) 222 if (!m_webMediaPlayer)
208 return; 223 return;
209 224
210 #if ENABLE(WEB_AUDIO) 225 #if ENABLE(WEB_AUDIO)
211 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper. 226 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper.
212 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); 227 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider());
213 #endif 228 #endif
214 229
215 m_webMediaPlayer->setVolume(mediaElement().playerVolume()); 230 m_webMediaPlayer->setVolume(mediaElement().playerVolume());
216 231
217 m_webMediaPlayer->setPoster(poster); 232 m_webMediaPlayer->setPoster(poster);
218 233
219 // Tell WebMediaPlayer about any connected CDM (may be null). 234 // Tell WebMediaPlayer about any connected CDM (may be null).
220 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement())); 235 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement()));
221 m_webMediaPlayer->load(loadType, kurl, corsMode); 236 m_webMediaPlayer->load(loadType, kurl, corsMode);
222 } 237 }
223 238
239 void WebMediaPlayerClientImpl::requestRemotePlayback()
240 {
241 if (m_webMediaPlayer)
242 m_webMediaPlayer->requestRemotePlayback();
243 }
244
245 void WebMediaPlayerClientImpl::requestRemotePlaybackControl()
246 {
247 if (m_webMediaPlayer)
248 m_webMediaPlayer->requestRemotePlaybackControl();
249 }
224 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) 250 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload)
225 { 251 {
226 m_preload = preload; 252 m_preload = preload;
227 253
228 if (m_webMediaPlayer) 254 if (m_webMediaPlayer)
229 m_webMediaPlayer->setPreload(static_cast<WebMediaPlayer::Preload>(preloa d)); 255 m_webMediaPlayer->setPreload(static_cast<WebMediaPlayer::Preload>(preloa d));
230 } 256 }
231 257
232 #if ENABLE(WEB_AUDIO) 258 #if ENABLE(WEB_AUDIO)
233 AudioSourceProvider* WebMediaPlayerClientImpl::audioSourceProvider() 259 AudioSourceProvider* WebMediaPlayerClientImpl::audioSourceProvider()
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 328
303 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate) 329 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate)
304 { 330 {
305 if (m_client) 331 if (m_client)
306 m_client->setFormat(numberOfChannels, sampleRate); 332 m_client->setFormat(numberOfChannels, sampleRate);
307 } 333 }
308 334
309 #endif 335 #endif
310 336
311 } // namespace blink 337 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698