Title: [214407] trunk/Source/WebCore
Revision
214407
Author
[email protected]
Date
2017-03-25 20:52:40 -0700 (Sat, 25 Mar 2017)

Log Message

REGRESSION(r214195): zillow.com header video doesn't resume when switching to another tab and back
https://bugs.webkit.org/show_bug.cgi?id=170080
<rdar://problem/31252522>

Reviewed by Eric Carlson.

The video header on zillow.com would pause when switching to another tab after r214195. On
switching back to the zillow.com tab, we would resume the video but fail to take the poster
away, making it look like the video is still paused.

We normally take the poster away when HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable()
is called. However, mediaPlayerFirstVideoFrameAvailable() was only ever called once because of
the m_haveReportedFirstVideoFrame flag in MediaPlayerPrivateAVFoundation::updateStates().
We now reset m_haveReportedFirstVideoFrame to false in updateStates() if hasAvailableVideoFrame()
return false, so that we call mediaPlayerFirstVideoFrameAvailable() again when the return
value of asAvailableVideoFrame() becomes true again (e.g. after the media session interruption
has ended).

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (214406 => 214407)


--- trunk/Source/WebCore/ChangeLog	2017-03-26 00:53:24 UTC (rev 214406)
+++ trunk/Source/WebCore/ChangeLog	2017-03-26 03:52:40 UTC (rev 214407)
@@ -1,3 +1,26 @@
+2017-03-25  Chris Dumez  <[email protected]>
+
+        REGRESSION(r214195): zillow.com header video doesn't resume when switching to another tab and back
+        https://bugs.webkit.org/show_bug.cgi?id=170080
+        <rdar://problem/31252522>
+
+        Reviewed by Eric Carlson.
+
+        The video header on zillow.com would pause when switching to another tab after r214195. On
+        switching back to the zillow.com tab, we would resume the video but fail to take the poster
+        away, making it look like the video is still paused.
+
+        We normally take the poster away when HTMLMediaElement::mediaPlayerFirstVideoFrameAvailable()
+        is called. However, mediaPlayerFirstVideoFrameAvailable() was only ever called once because of
+        the m_haveReportedFirstVideoFrame flag in MediaPlayerPrivateAVFoundation::updateStates().
+        We now reset m_haveReportedFirstVideoFrame to false in updateStates() if hasAvailableVideoFrame()
+        return false, so that we call mediaPlayerFirstVideoFrameAvailable() again when the return
+        value of asAvailableVideoFrame() becomes true again (e.g. after the media session interruption
+        has ended).
+
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
+
 2017-03-24  Wenson Hsieh  <[email protected]>
 
         [WK2] Add a UI delegate SPI hook to enable or disable navigation on drop

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (214406 => 214407)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2017-03-26 00:53:24 UTC (rev 214406)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2017-03-26 03:52:40 UTC (rev 214407)
@@ -561,7 +561,8 @@
             newReadyState = MediaPlayer::HaveCurrentData;
         m_haveReportedFirstVideoFrame = true;
         m_player->firstVideoFrameAvailable();
-    }
+    } else if (!hasAvailableVideoFrame())
+        m_haveReportedFirstVideoFrame = false;
 
 #if !LOG_DISABLED
     if (m_networkState != newNetworkState || m_readyState != newReadyState) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to