Add mediaPlayerPlaybackStateChanged to MediaPlayerClient
authorTor Arne Vestbø <vestbo@webkit.org>
Wed, 8 Sep 2010 09:18:27 +0000 (09:18 +0000)
committerAdemar de Souza Reis Jr <ademar.reis@openbossa.org>
Thu, 20 Jan 2011 19:55:56 +0000 (16:55 -0300)
commitb9014dd51ca4aa1e19d1a548f00c65361e417925
treef0dfe73710dca9273fc8645917d8eb674abfda30
parentc8a799fd1b443157b10aa36c30dcc7d9e742a086
Add mediaPlayerPlaybackStateChanged to MediaPlayerClient

Reviewed by Eric Carlson.

https://bugs.webkit.org/show_bug.cgi?id=45263

The platform backend may change state, for example as a result
of an external plugin controlling the backend, so we need to
react to this situation by syncing up the WebCore state with the
platform backend.

We call playInternal()/pauseInternal() depending on the backend
state, to trigger the corresponding DOM events to match the state.

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 the playback progress timer
and set m_playing correctly.

updatePlayState() changes Should be covered by existing tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
(WebCore::HTMLMediaElement::updatePlayState):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::playbackStateChanged):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerPlaybackStateChanged):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/html/HTMLMediaElement.cpp
WebCore/html/HTMLMediaElement.h
WebCore/platform/graphics/MediaPlayer.cpp
WebCore/platform/graphics/MediaPlayer.h