OLD | NEW |
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 | 218 |
219 #if OS(ANDROID) | 219 #if OS(ANDROID) |
220 m_usePaintOnAndroid = (loadType != WebMediaPlayer::LoadTypeMediaStream); | 220 m_usePaintOnAndroid = (loadType != WebMediaPlayer::LoadTypeMediaStream); |
221 #endif | 221 #endif |
222 | 222 |
223 // Tell WebMediaPlayer about any connected CDM (may be null). | 223 // Tell WebMediaPlayer about any connected CDM (may be null). |
224 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia:
:contentDecryptionModule(mediaElement())); | 224 m_webMediaPlayer->setContentDecryptionModule(HTMLMediaElementEncryptedMedia:
:contentDecryptionModule(mediaElement())); |
225 m_webMediaPlayer->load(loadType, kurl, corsMode); | 225 m_webMediaPlayer->load(loadType, kurl, corsMode); |
226 } | 226 } |
227 | 227 |
228 double WebMediaPlayerClientImpl::duration() const | |
229 { | |
230 if (m_webMediaPlayer) | |
231 return m_webMediaPlayer->duration(); | |
232 return 0.0; | |
233 } | |
234 | |
235 double WebMediaPlayerClientImpl::currentTime() const | |
236 { | |
237 if (m_webMediaPlayer) | |
238 return m_webMediaPlayer->currentTime(); | |
239 return 0.0; | |
240 } | |
241 | |
242 void WebMediaPlayerClientImpl::seek(double time) | |
243 { | |
244 if (m_webMediaPlayer) | |
245 m_webMediaPlayer->seek(time); | |
246 } | |
247 | |
248 bool WebMediaPlayerClientImpl::seeking() const | |
249 { | |
250 if (m_webMediaPlayer) | |
251 return m_webMediaPlayer->seeking(); | |
252 return false; | |
253 } | |
254 | |
255 void WebMediaPlayerClientImpl::setPoster(const KURL& poster) | |
256 { | |
257 if (m_webMediaPlayer) | |
258 m_webMediaPlayer->setPoster(WebURL(poster)); | |
259 } | |
260 | 228 |
261 MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const | 229 MediaPlayer::NetworkState WebMediaPlayerClientImpl::networkState() const |
262 { | 230 { |
263 if (m_webMediaPlayer) | 231 if (m_webMediaPlayer) |
264 return static_cast<MediaPlayer::NetworkState>(m_webMediaPlayer->networkS
tate()); | 232 return static_cast<MediaPlayer::NetworkState>(m_webMediaPlayer->networkS
tate()); |
265 return MediaPlayer::Empty; | 233 return MediaPlayer::Empty; |
266 } | 234 } |
267 | 235 |
268 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re
ct) | 236 void WebMediaPlayerClientImpl::paint(GraphicsContext* context, const IntRect& re
ct) |
269 { | 237 { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 | 383 |
416 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) | 384 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) |
417 { | 385 { |
418 if (m_client) | 386 if (m_client) |
419 m_client->setFormat(numberOfChannels, sampleRate); | 387 m_client->setFormat(numberOfChannels, sampleRate); |
420 } | 388 } |
421 | 389 |
422 #endif | 390 #endif |
423 | 391 |
424 } // namespace blink | 392 } // namespace blink |
OLD | NEW |