Skip to content
Permalink
Browse files
[MediaFoundation] Videos are always autoplaying for local files
https://bugs.webkit.org/show_bug.cgi?id=178693

Patch by Doug Massay.
Patch by Konstantin Tokarev <annulen@yandex.ru> on 2017-10-24
Reviewed by Alex Christensen.

r199114 fixes autoplay issue only if starting session invokes
buffering stage. However when local files are played, onBufferingStarted
and onBufferingStopped are not called, and video is not paused.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

Canonical link: https://commits.webkit.org/194898@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
annulen authored and webkit-commit-queue committed Oct 24, 2017
1 parent ff17a82 commit c1b8c01a07179fbfefaf61153d5fb9b25294d44b
@@ -1,3 +1,20 @@
2017-10-24 Konstantin Tokarev <annulen@yandex.ru>

[MediaFoundation] Videos are always autoplaying for local files
https://bugs.webkit.org/show_bug.cgi?id=178693

Patch by Doug Massay.
Reviewed by Alex Christensen.

r199114 fixes autoplay issue only if starting session invokes
buffering stage. However when local files are played, onBufferingStarted
and onBufferingStopped are not called, and video is not paused.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
(WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

2017-10-24 Matt Lewis <jlewis3@apple.com>

Unreviewed, rolling out r223889.
@@ -535,6 +535,15 @@ bool MediaPlayerPrivateMediaFoundation::endGetEvent(IMFAsyncResult* asyncResult)
break;
}

case MESessionStarted: {
callOnMainThread([weakPtr = m_weakPtrFactory.createWeakPtr(*this)] {
if (!weakPtr)
return;
weakPtr->onSessionStarted();
});
break;
}

case MEBufferingStarted: {
callOnMainThread([weakPtr = m_weakPtrFactory.createWeakPtr(*this)] {
if (!weakPtr)
@@ -921,6 +930,11 @@ void MediaPlayerPrivateMediaFoundation::onBufferingStopped()
updateReadyState();
}

void MediaPlayerPrivateMediaFoundation::onSessionStarted()
{
updateReadyState();
}

void MediaPlayerPrivateMediaFoundation::onSessionEnded()
{
m_networkState = MediaPlayer::Loaded;
@@ -151,6 +151,7 @@ class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface {
void onTopologySet();
void onBufferingStarted();
void onBufferingStopped();
void onSessionStarted();
void onSessionEnded();

LPCWSTR registerVideoWindowClass();

0 comments on commit c1b8c01

Please sign in to comment.