Title: [261550] trunk
Revision
261550
Author
[email protected]
Date
2020-05-12 01:49:57 -0700 (Tue, 12 May 2020)

Log Message

[GStreamer] Audio messages in web.whatsapp.com only play once.
https://bugs.webkit.org/show_bug.cgi?id=211627

Patch by Philippe Normand <[email protected]> on 2020-05-12
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Test: media/video-src-blob-replay.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag): Make sure on-disk
buffering is disabled for blob URIs, because it messes up the pipeline for replays, and it's
useless for that use-case anyway.

LayoutTests:

* media/video-src-blob-replay-expected.txt: Added.
* media/video-src-blob-replay.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261549 => 261550)


--- trunk/LayoutTests/ChangeLog	2020-05-12 08:49:10 UTC (rev 261549)
+++ trunk/LayoutTests/ChangeLog	2020-05-12 08:49:57 UTC (rev 261550)
@@ -1,3 +1,13 @@
+2020-05-12  Philippe Normand  <[email protected]>
+
+        [GStreamer] Audio messages in web.whatsapp.com only play once.
+        https://bugs.webkit.org/show_bug.cgi?id=211627
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        * media/video-src-blob-replay-expected.txt: Added.
+        * media/video-src-blob-replay.html: Added.
+
 2020-05-12  Said Abou-Hallawa  <[email protected]>
 
         Need to advertise support for WebP in the Accept header

Added: trunk/LayoutTests/media/video-src-blob-replay-expected.txt (0 => 261550)


--- trunk/LayoutTests/media/video-src-blob-replay-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/media/video-src-blob-replay-expected.txt	2020-05-12 08:49:57 UTC (rev 261550)
@@ -0,0 +1,8 @@
+OPEN FILE PANEL
+This tests the ability of the <video> element to load blob URLs, play to the end, and replay. In the browser, select a video file:  
+
+EVENT(change)
+EVENT(playing)
+EVENT(seeked)
+END OF TEST
+

Added: trunk/LayoutTests/media/video-src-blob-replay.html (0 => 261550)


--- trunk/LayoutTests/media/video-src-blob-replay.html	                        (rev 0)
+++ trunk/LayoutTests/media/video-src-blob-replay.html	2020-05-12 08:49:57 UTC (rev 261550)
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <script src=""
+        <script src=""
+        <script src=''></script>
+        <script>
+
+         if (window.testRunner)
+             testRunner.waitUntilDone();
+
+         function finish()
+         {
+             video.removeEventListener("ended", finish);
+
+             video.currentTime = 0;
+             waitForEvent('playing');
+             waitForEventAndEnd('seeked');
+
+             video.play();
+             video.currentTime = video.duration - 0.05;
+         }
+
+         function playing()
+         {
+             video.removeEventListener("playing", playing);
+
+             video.addEventListener("ended", finish);
+             video.currentTime = video.duration - 0.05;
+         }
+
+         function inputFileChanged(e) {
+             findMediaElement();
+             var file = e.target.files[0];
+             video.src = ""
+             video.addEventListener("playing", playing);
+             video.play();
+         }
+
+         function runTest() {
+             var inputFile = document.getElementById('file');
+             var centerX = inputFile.offsetLeft + inputFile.offsetWidth / 2;
+             var centerY = inputFile.offsetTop + inputFile.offsetHeight / 2;
+             waitForEvent('change', inputFileChanged, false, false, inputFile);
+
+             if (window.testRunner) {
+                 testRunner.setOpenPanelFiles([findMediaFile("video", "content/test")]);
+                 UIHelper.activateAt(centerX, centerY);
+             }
+         }
+        </script>
+    </head>
+    <body _onload_="runTest()">
+        <div>
+            This tests the ability of the &lt;video&gt; element to load blob URLs, play to the end, and replay. In the browser, select a video file:
+            <input type="file" name="file" id="file">
+        </div>
+        <video></video>
+    </body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (261549 => 261550)


--- trunk/Source/WebCore/ChangeLog	2020-05-12 08:49:10 UTC (rev 261549)
+++ trunk/Source/WebCore/ChangeLog	2020-05-12 08:49:57 UTC (rev 261550)
@@ -1,3 +1,17 @@
+2020-05-12  Philippe Normand  <[email protected]>
+
+        [GStreamer] Audio messages in web.whatsapp.com only play once.
+        https://bugs.webkit.org/show_bug.cgi?id=211627
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Test: media/video-src-blob-replay.html
+        
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag): Make sure on-disk
+        buffering is disabled for blob URIs, because it messes up the pipeline for replays, and it's
+        useless for that use-case anyway.
+
 2020-05-12  Said Abou-Hallawa  <[email protected]>
 
         Need to advertise support for WebP in the Accept header

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (261549 => 261550)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-05-12 08:49:10 UTC (rev 261549)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-05-12 08:49:57 UTC (rev 261550)
@@ -2701,6 +2701,13 @@
 
     unsigned flagDownload = getGstPlayFlag("download");
 
+    if (m_url.protocolIsBlob()) {
+        GST_DEBUG_OBJECT(pipeline(), "Blob URI detected. Disabling on-disk buffering");
+        g_object_set(m_pipeline.get(), "flags", flags & ~flagDownload, nullptr);
+        m_fillTimer.stop();
+        return;
+    }
+
     // We don't want to stop downloading if we already started it.
     if (flags & flagDownload && m_readyState > MediaPlayer::ReadyState::HaveNothing && !m_shouldResetPipeline) {
         GST_DEBUG_OBJECT(pipeline(), "Download already started, not starting again");
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to