Title: [201164] trunk/Source/WebCore
Revision
201164
Author
[email protected]
Date
2016-05-19 09:03:21 -0700 (Thu, 19 May 2016)

Log Message

Playback controls still valid after navigating back after watching YouTube video.
https://bugs.webkit.org/show_bug.cgi?id=157874
<rdar://problem/25993063>

Reviewed by Eric Carlson.

YouTube uses window.onpopstate to "navigate" backwards from a video page to the main page
(or other video page). This causes the playback controls to not be cleared (since no
navigation actually occured). Instead, clear the playback controls when we clear our
MediaPlayer due to load() being called, when the src= "" is changed, or when a
<source> element is added to the <video>.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::createMediaPlayer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201163 => 201164)


--- trunk/Source/WebCore/ChangeLog	2016-05-19 14:33:34 UTC (rev 201163)
+++ trunk/Source/WebCore/ChangeLog	2016-05-19 16:03:21 UTC (rev 201164)
@@ -1,3 +1,21 @@
+2016-05-18  Jer Noble  <[email protected]>
+
+        Playback controls still valid after navigating back after watching YouTube video.
+        https://bugs.webkit.org/show_bug.cgi?id=157874
+        <rdar://problem/25993063>
+
+        Reviewed by Eric Carlson.
+
+        YouTube uses window.onpopstate to "navigate" backwards from a video page to the main page
+        (or other video page). This causes the playback controls to not be cleared (since no
+        navigation actually occured). Instead, clear the playback controls when we clear our
+        MediaPlayer due to load() being called, when the src= "" is changed, or when a
+        <source> element is added to the <video>.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::clearMediaPlayer):
+        (WebCore::HTMLMediaElement::createMediaPlayer):
+
 2016-05-19  Philippe Normand  <[email protected]>
 
         [GStreamer] unrelated codecs required to play videos

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (201163 => 201164)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-05-19 14:33:34 UTC (rev 201163)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-05-19 16:03:21 UTC (rev 201164)
@@ -5008,6 +5008,9 @@
         document().removeMediaCanStartListener(this);
     }
 
+    if (document().page())
+        document().page()->chrome().client().clearPlaybackControlsManager(*this);
+
     m_player = nullptr;
 
     stopPeriodicTimers();
@@ -5887,6 +5890,10 @@
 #if ENABLE(VIDEO_TRACK)
     forgetResourceSpecificTracks();
 #endif
+
+    if (document().page())
+        document().page()->chrome().client().clearPlaybackControlsManager(*this);
+
     m_player = std::make_unique<MediaPlayer>(static_cast<MediaPlayerClient&>(*this));
 
 #if ENABLE(WEB_AUDIO)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to