Bug 45263

Summary: Add mediaPlayerPlaybackStateChanged to MediaPlayerClient
Product: WebKit Reporter: Tor Arne Vestbø <vestbo>
Component: MediaAssignee: Tor Arne Vestbø <vestbo>
Status: RESOLVED FIXED    
Severity: Normal CC: ademar, eric.carlson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 51249    
Attachments:
Description Flags
Patch eric.carlson: review+

Tor Arne Vestbø
Reported 2010-09-06 06:53:00 PDT
Add mediaPlayerPlaybackStateChanged to MediaPlayerClient
Attachments
Patch (6.51 KB, patch)
2010-09-06 06:54 PDT, Tor Arne Vestbø
eric.carlson: review+
Tor Arne Vestbø
Comment 1 2010-09-06 06:54:28 PDT
Tor Arne Vestbø
Comment 2 2010-09-06 07:01:25 PDT
(In reply to comment #1) > Created an attachment (id=66635) [details] > Patch Tried to keep the logic of updatePlayState() in the refactor, but wondering about if (playerPaused && couldPlayIfEnoughData()), should this check be moved out of the play/not-playing block? Or perhaps be done like this? if (!playerPaused) m_player->pause(); if (couldPlayIfEnoughData()) m_player->prepareToPlay();
Eric Carlson
Comment 3 2010-09-07 08:21:50 PDT
Comment on attachment 66635 [details] Patch > + updatePlayState() is then refactored to take into account the > + situation where the backend is already in the correct state but > + WebCore is not, so that we update thee playback progress timer Typo - "thee" > > +void HTMLMediaElement::mediaPlayerPlaybackStateChanged(MediaPlayer*) > +{ > + beginProcessingMediaPlayerCallback(); > + if (m_player) { > + if (m_player->paused()) > + pauseInternal(); > + else > + playInternal(); > + } > + endProcessingMediaPlayerCallback(); > +} > + Might as well return early if m_player is NULL. > + // Set rate before calling play in case the rate was set before the media engine wasn't setup. Old typo you might as well fix, "wasn't" should be "was". > Tried to keep the logic of updatePlayState() in the refactor, but wondering about if (playerPaused && > couldPlayIfEnoughData()), should this check be moved out of the play/not-playing block? Or perhaps be > done like this? > > if (!playerPaused) > m_player->pause(); > > if (couldPlayIfEnoughData()) > m_player->prepareToPlay(); Good idea, this seems much clearer. Thanks! r=me
Tor Arne Vestbø
Comment 4 2010-09-08 02:22:27 PDT
Ademar Reis
Comment 5 2011-01-24 07:42:16 PST
Revision r66961 cherry-picked into qtwebkit-2.2 with commit b9014dd <http://gitorious.org/webkit/qtwebkit/commit/b9014dd>
Note You need to log in before you can comment on or make changes to this bug.