[WinCairo][MediaFoundation] Videos are always autoplaying.
authorpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2016 20:41:48 +0000 (20:41 +0000)
committerpeavo@outlook.com <peavo@outlook.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Apr 2016 20:41:48 +0000 (20:41 +0000)
commit8325f845578663fe011105f362ebd7d3fd24f5e7
tree76f529190073d5ad4278787709e590d542a7ba73
parent0463b3aef27f4ae8af372b74387932f2c76a773e
[WinCairo][MediaFoundation] Videos are always autoplaying.
https://bugs.webkit.org/show_bug.cgi?id=156284

Reviewed by Alex Christensen.

Videos are autoplaying because the MediaFoundation implementation always starts playback
after the load method has been called. When the load method has been called, we should
only start buffering data, not automatically start the playback. This has been fixed by
implementing the prepareToPlay method, and calling this instead of the play method.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
(WebCore::MediaPlayerPrivateMediaFoundation::load):
(WebCore::MediaPlayerPrivateMediaFoundation::prepareToPlay):
(WebCore::MediaPlayerPrivateMediaFoundation::play):
(WebCore::MediaPlayerPrivateMediaFoundation::networkState):
(WebCore::MediaPlayerPrivateMediaFoundation::startSession):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
(WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
(WebCore::MediaPlayerPrivateMediaFoundation::onBufferingStarted):
(WebCore::MediaPlayerPrivateMediaFoundation::onBufferingStopped):
(WebCore::MediaPlayerPrivateMediaFoundation::onSessionEnded):
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::updateDestRect):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h