Title: [223902] trunk/Source/WebCore
Revision
223902
Author
[email protected]
Date
2017-10-24 11:40:17 -0700 (Tue, 24 Oct 2017)

Log Message

[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 <[email protected]> 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:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (223901 => 223902)


--- trunk/Source/WebCore/ChangeLog	2017-10-24 18:19:00 UTC (rev 223901)
+++ trunk/Source/WebCore/ChangeLog	2017-10-24 18:40:17 UTC (rev 223902)
@@ -1,3 +1,20 @@
+2017-10-24  Konstantin Tokarev  <[email protected]>
+
+        [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  <[email protected]>
 
         Unreviewed, rolling out r223889.

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp (223901 => 223902)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2017-10-24 18:19:00 UTC (rev 223901)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp	2017-10-24 18:40:17 UTC (rev 223902)
@@ -535,6 +535,15 @@
         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 @@
     updateReadyState();
 }
 
+void MediaPlayerPrivateMediaFoundation::onSessionStarted()
+{
+    updateReadyState();
+}
+
 void MediaPlayerPrivateMediaFoundation::onSessionEnded()
 {
     m_networkState = MediaPlayer::Loaded;

Modified: trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h (223901 => 223902)


--- trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h	2017-10-24 18:19:00 UTC (rev 223901)
+++ trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h	2017-10-24 18:40:17 UTC (rev 223902)
@@ -151,6 +151,7 @@
     void onTopologySet();
     void onBufferingStarted();
     void onBufferingStopped();
+    void onSessionStarted();
     void onSessionEnded();
 
     LPCWSTR registerVideoWindowClass();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to