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

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

Issue 314413003: Revert 175546 "Eliminate MediaPlayer & MediaPlayerClient abstrac..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « trunk/Source/web/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 #if OS(ANDROID) 199 #if OS(ANDROID)
200 m_usePaintOnAndroid = (loadType != WebMediaPlayer::LoadTypeMediaStream); 200 m_usePaintOnAndroid = (loadType != WebMediaPlayer::LoadTypeMediaStream);
201 #endif 201 #endif
202 202
203 // Tell WebMediaPlayer about any connected CDM (may be null). 203 // Tell WebMediaPlayer about any connected CDM (may be null).
204 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement())); 204 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia: :contentDecryptionModule(mediaElement()));
205 m_webMediaPlayer->load(loadType, kurl, corsMode); 205 m_webMediaPlayer->load(loadType, kurl, corsMode);
206 } 206 }
207 207
208 double WebMediaPlayerClientImpl::duration() const
209 {
210 if (m_webMediaPlayer)
211 return m_webMediaPlayer->duration();
212 return 0.0;
213 }
214
215 double WebMediaPlayerClientImpl::currentTime() const
216 {
217 if (m_webMediaPlayer)
218 return m_webMediaPlayer->currentTime();
219 return 0.0;
220 }
221
222 void WebMediaPlayerClientImpl::seek(double time)
223 {
224 if (m_webMediaPlayer)
225 m_webMediaPlayer->seek(time);
226 }
227
228 bool WebMediaPlayerClientImpl::seeking() const
229 {
230 if (m_webMediaPlayer)
231 return m_webMediaPlayer->seeking();
232 return false;
233 }
234
208 double WebMediaPlayerClientImpl::rate() const 235 double WebMediaPlayerClientImpl::rate() const
209 { 236 {
210 return m_rate; 237 return m_rate;
211 } 238 }
212 239
213 void WebMediaPlayerClientImpl::setRate(double rate) 240 void WebMediaPlayerClientImpl::setRate(double rate)
214 { 241 {
215 m_rate = rate; 242 m_rate = rate;
216 if (m_webMediaPlayer) 243 if (m_webMediaPlayer)
217 m_webMediaPlayer->setRate(rate); 244 m_webMediaPlayer->setRate(rate);
218 } 245 }
219 246
247 void WebMediaPlayerClientImpl::setPoster(const KURL& poster)
248 {
249 if (m_webMediaPlayer)
250 m_webMediaPlayer->setPoster(WebURL(poster));
251 }
252
220 MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const 253 MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const
221 { 254 {
222 if (m_webMediaPlayer) 255 if (m_webMediaPlayer)
223 return static_cast<MediaPlayer::NetworkState>(m_webMediaPlayer->networkS tate()); 256 return static_cast<MediaPlayer::NetworkState>(m_webMediaPlayer->networkS tate());
224 return MediaPlayer::Empty; 257 return MediaPlayer::Empty;
225 } 258 }
226 259
227 MediaPlayer::ReadyState WebMediaPlayerClientImpl::readyState() const 260 MediaPlayer::ReadyState WebMediaPlayerClientImpl::readyState() const
228 { 261 {
229 if (m_webMediaPlayer) 262 if (m_webMediaPlayer)
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 434
402 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate) 435 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate)
403 { 436 {
404 if (m_client) 437 if (m_client)
405 m_client->setFormat(numberOfChannels, sampleRate); 438 m_client->setFormat(numberOfChannels, sampleRate);
406 } 439 }
407 440
408 #endif 441 #endif
409 442
410 } // namespace blink 443 } // namespace blink
OLDNEW
« no previous file with comments | « trunk/Source/web/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698