Changeset 65494 in webkit
- Timestamp:
- Aug 17, 2010 5:15:04 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65492 r65494 1 2010-08-17 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 3 Reviewed by Antonio Gomes. 4 5 [Qt] Pre-roll media when loading media elements 6 7 This ensures we get correct size-hints from QtMultimedia, as well as 8 the media states Buffering and Buffered instead of Loading and Loaded, 9 which we use to transition into MediaPlayer::HaveEnoughData. 10 11 * platform/graphics/qt/MediaPlayerPrivateQt.cpp: 12 * platform/graphics/qt/MediaPlayerPrivateQt.h: 13 1 14 2010-08-16 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 15 -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
r62951 r65494 26 26 #include "HTMLMediaElement.h" 27 27 #include "HTMLVideoElement.h" 28 #include "NotImplemented.h" 28 29 #include "TimeRanges.h" 29 30 #include "Widget.h" … … 107 108 connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), 108 109 this, SLOT(handleError(QMediaPlayer::Error))); 110 connect(m_mediaPlayer, SIGNAL(bufferStatusChanged(int)), 111 this, SLOT(bufferStatusChanged(int))); 109 112 connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)), 110 113 this, SLOT(durationChanged(qint64))); … … 209 212 m_mediaPlayer->setMuted(element->muted()); 210 213 m_mediaPlayer->setVolume(static_cast<int>(element->volume() * 100.0)); 214 215 // Setting a media source will start loading the media, but we need 216 // to pre-roll as well to get video size-hints and buffer-status 217 if (element->paused()) 218 m_mediaPlayer->pause(); 219 else 220 m_mediaPlayer->play(); 211 221 } 212 222 … … 323 333 unsigned MediaPlayerPrivate::bytesLoaded() const 324 334 { 325 unsigned percentage = m_mediaPlayer->bufferStatus();326 327 if (percentage == 100) {328 if (m_networkState != MediaPlayer::Idle) {329 m_networkState = MediaPlayer::Idle;330 m_player->networkStateChanged();331 }332 if (m_readyState != MediaPlayer::HaveEnoughData) {333 m_readyState = MediaPlayer::HaveEnoughData;334 m_player->readyStateChanged();335 }336 }337 338 335 QLatin1String bytesLoadedKey("bytes-loaded"); 339 336 if (m_mediaPlayer->availableExtendedMetaData().contains(bytesLoadedKey)) 340 337 return m_mediaPlayer->extendedMetaData(bytesLoadedKey).toInt(); 341 338 342 return percentage;339 return m_mediaPlayer->bufferStatus(); 343 340 } 344 341 … … 438 435 m_isSeeking = false; 439 436 } 437 } 438 439 void MediaPlayerPrivate::bufferStatusChanged(int) 440 { 441 notImplemented(); 440 442 } 441 443 -
trunk/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
r57819 r65494 104 104 void positionChanged(qint64); 105 105 void durationChanged(qint64); 106 void bufferStatusChanged(int); 106 107 void volumeChanged(int); 107 108 void mutedChanged(bool);
Note: See TracChangeset
for help on using the changeset viewer.