Title: [279313] trunk
- Revision
- 279313
- Author
- [email protected]
- Date
- 2021-06-27 02:32:37 -0700 (Sun, 27 Jun 2021)
Log Message
[GStreamer] SleepDisabler not destroyed when video playback stops
https://bugs.webkit.org/show_bug.cgi?id=219353
Patch by Philippe Normand <[email protected]> on 2021-06-27
Reviewed by Eric Carlson.
Source/WebCore:
In GStreamer ports the SleepDisabler remained active after EOS because
HTMLMediaElement::updateSleepDisabling() was not being triggered. An explicit clean-up upon
the ended event in the media element is better than any other implicit action.
Test: media/video-ended-does-not-hold-sleep-assertion.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::dispatchEvent):
LayoutTests:
* media/video-ended-does-not-hold-sleep-assertion-expected.txt: Added.
* media/video-ended-does-not-hold-sleep-assertion.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (279312 => 279313)
--- trunk/LayoutTests/ChangeLog 2021-06-27 08:55:52 UTC (rev 279312)
+++ trunk/LayoutTests/ChangeLog 2021-06-27 09:32:37 UTC (rev 279313)
@@ -1,3 +1,13 @@
+2021-06-27 Philippe Normand <[email protected]>
+
+ [GStreamer] SleepDisabler not destroyed when video playback stops
+ https://bugs.webkit.org/show_bug.cgi?id=219353
+
+ Reviewed by Eric Carlson.
+
+ * media/video-ended-does-not-hold-sleep-assertion-expected.txt: Added.
+ * media/video-ended-does-not-hold-sleep-assertion.html: Added.
+
2021-06-26 Sam Weinig <[email protected]>
[Modern Media Controls] Modern media controls should not need to know about specific platforms in shared code
Added: trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion-expected.txt (0 => 279313)
--- trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion-expected.txt (rev 0)
+++ trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion-expected.txt 2021-06-27 09:32:37 UTC (rev 279313)
@@ -0,0 +1,12 @@
+
+RUN(video.src = "" "content/test"))
+EVENT(canplaythrough)
+RUN(video.play())
+EVENT(playing)
+EVENT(timeupdate)
+EXPECTED (internals.elementIsBlockingDisplaySleep(video) == 'true') OK
+RUN(video.currentTime = video.duration - 0.05)
+EVENT(ended)
+EXPECTED (internals.elementIsBlockingDisplaySleep(video) == 'false') OK
+END OF TEST
+
Added: trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion.html (0 => 279313)
--- trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion.html (rev 0)
+++ trunk/LayoutTests/media/video-ended-does-not-hold-sleep-assertion.html 2021-06-27 09:32:37 UTC (rev 279313)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>video-ended-does-not-hold-sleep-assertion</title>
+ <script src=""
+ <script src=""
+ <script>
+ window.addEventListener('load', async event => {
+ findMediaElement();
+
+ run('video.src = "" "content/test")');
+ await waitFor(video, 'canplaythrough');
+
+ run('video.play()');
+ await waitFor(video, 'playing');
+ await waitFor(video, 'timeupdate');
+
+ testExpected('internals.elementIsBlockingDisplaySleep(video)', true);
+ run('video.currentTime = video.duration - 0.05');
+ await waitFor(video, 'ended');
+
+ testExpected('internals.elementIsBlockingDisplaySleep(video)', false);
+
+ endTest();
+ }, {once: true});
+ </script>
+ </head>
+ <body>
+ <video controls></video>
+ </body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (279312 => 279313)
--- trunk/Source/WebCore/ChangeLog 2021-06-27 08:55:52 UTC (rev 279312)
+++ trunk/Source/WebCore/ChangeLog 2021-06-27 09:32:37 UTC (rev 279313)
@@ -1,3 +1,19 @@
+2021-06-27 Philippe Normand <[email protected]>
+
+ [GStreamer] SleepDisabler not destroyed when video playback stops
+ https://bugs.webkit.org/show_bug.cgi?id=219353
+
+ Reviewed by Eric Carlson.
+
+ In GStreamer ports the SleepDisabler remained active after EOS because
+ HTMLMediaElement::updateSleepDisabling() was not being triggered. An explicit clean-up upon
+ the ended event in the media element is better than any other implicit action.
+
+ Test: media/video-ended-does-not-hold-sleep-assertion.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::dispatchEvent):
+
2021-06-27 Antoine Quint <[email protected]>
[Model] [iOS] Add support for rendering model resources
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (279312 => 279313)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-06-27 08:55:52 UTC (rev 279312)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2021-06-27 09:32:37 UTC (rev 279313)
@@ -5862,9 +5862,13 @@
{
DEBUG_LOG(LOGIDENTIFIER, event.type());
- if (m_removedBehaviorRestrictionsAfterFirstUserGesture && event.type() == eventNames().endedEvent)
- document().userActivatedMediaFinishedPlaying();
+ if (event.type() == eventNames().endedEvent) {
+ if (m_removedBehaviorRestrictionsAfterFirstUserGesture)
+ document().userActivatedMediaFinishedPlaying();
+ updateSleepDisabling();
+ }
+
HTMLElement::dispatchEvent(event);
// Some pages may change the position/size of an inline video element
@@ -6843,7 +6847,7 @@
#if !PLATFORM(COCOA) && !PLATFORM(GTK) && !PLATFORM(WPE)
return SleepType::None;
#endif
- if (!m_player || m_player->paused() || loop())
+ if (m_sentEndEvent || !m_player || m_player->paused() || loop())
return SleepType::None;
#if ENABLE(WIRELESS_PLAYBACK_TARGET)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes