<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>242156</bug_id>
          
          <creation_ts>2022-06-29 19:09:15 -0700</creation_ts>
          <short_desc>REGRESSION(243836@main): [GStreamer] Broke videos in yelp</short_desc>
          <delta_ts>2022-07-22 15:29:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugzilla.redhat.com/show_bug.cgi?id=2099334</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Catanzaro">mcatanzaro</reporter>
          <assigned_to name="Michael Catanzaro">mcatanzaro</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>jer.noble</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>philn</cc>
    
    <cc>pnormand</cc>
    
    <cc>tpopela</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1879216</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-29 19:09:15 -0700</bug_when>
    <thetext>243836@main &quot;[iOS] AVAssetResourceLoadingRequest.request does not include a Range: header on iOS 15&quot; broke video playback in yelp (the GNOME help viewer, not yelp.com).

The GStreamer debug log contains several errors:

0:00:00.146036288  4822 0x561c5fcb4600 DEBUG      webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1840:operator(): got missing plugin installation callback with result 203
0:00:00.146095073  4822 0x561c5fcb4600 WARN               structure gststructure.c:1863:priv_gst_structure_append_to_gstring: No value transform to serialize field &apos;gerror&apos; of type &apos;GError&apos;
0:00:00.146122003  4822 0x561c5fcb4600 ERROR           webkitcommon GStreamerCommon.cpp:466:operator():&lt;media-player-0&gt; Got message: error message: 0x561c60385cb0, time 99:99:99.999999999, seq-num 59, element &apos;uridecodebin0&apos;, GstMessageError, gerror=(GError)NULL, debug=(string)&quot;gsturidecodebin.c\(1409\):\ gen_source_element\ \(\):\ /GstPlayBin:media-player-0/GstURIDecodeBin:uridecodebin0&quot;;
0:00:00.146147649  4822 0x561c5fcb4600 LOG        webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1708:handleMessage:&lt;media-player-0&gt; Message error received from element uridecodebin0
0:00:00.146180206  4822 0x561c5fcb4600 WARN               structure gststructure.c:1863:priv_gst_structure_append_to_gstring: No value transform to serialize field &apos;gerror&apos; of type &apos;GError&apos;
0:00:00.146202578  4822 0x561c5fcb4600 ERROR           webkitcommon GStreamerCommon.cpp:466:operator():&lt;media-player-1&gt; Got message: error message: 0x561c603a0a30, time 99:99:99.999999999, seq-num 139, element &apos;uridecodebin1&apos;, GstMessageError, gerror=(GError)NULL, debug=(string)&quot;gsturidecodebin.c\(1409\):\ gen_source_element\ \(\):\ /GstPlayBin:media-player-1/GstURIDecodeBin:uridecodebin1&quot;;
0:00:00.146224398  4822 0x561c5fcb4600 LOG        webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1708:handleMessage:&lt;media-player-1&gt; Message error received from element uridecodebin1
0:00:00.146254924  4822 0x561c5fcb4600 ERROR      webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1714:handleMessage: Error 12: No URI handler implemented for &quot;bogus-help&quot;. (url=bogus-help:/gnome-help/figures/gnome-task-switching.webm)
0:00:00.146349303  4822 0x561c5fcb4600 WARN               structure gststructure.c:1863:priv_gst_structure_append_to_gstring: No value transform to serialize field &apos;gerror&apos; of type &apos;GError&apos;
0:00:00.146389031  4822 0x561c5fcb4600 ERROR           webkitcommon GStreamerCommon.cpp:466:operator():&lt;media-player-2&gt; Got message: error message: 0x561c603b21c0, time 99:99:99.999999999, seq-num 219, element &apos;uridecodebin2&apos;, GstMessageError, gerror=(GError)NULL, debug=(string)&quot;gsturidecodebin.c\(1409\):\ gen_source_element\ \(\):\ /GstPlayBin:media-player-2/GstURIDecodeBin:uridecodebin2&quot;;
0:00:00.146428686  4822 0x561c5fcb4600 LOG        webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1708:handleMessage:&lt;media-player-2&gt; Message error received from element uridecodebin2
0:00:00.146452332  4822 0x561c5fcb4600 ERROR      webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1714:handleMessage: Error 12: No URI handler implemented for &quot;bogus-help&quot;. (url=bogus-help:/gnome-help/figures/gnome-windows-and-workspaces.webm)

I tried to throw together a minimal reproducer, but wound up hitting strange errors because I&apos;m not familiar with mallard syntax. So instead my hacky test case is: clone gnome-user-doc, then hack up gnome-help/C/display-dual-monitors.page accordingly:

diff --git a/gnome-help/C/display-dual-monitors.page b/gnome-help/C/display-dual-monitors.page
index 6f74da61..b5d779db 100644
--- a/gnome-help/C/display-dual-monitors.page
+++ b/gnome-help/C/display-dual-monitors.page
@@ -29,10 +29,9 @@
 
 &lt;title&gt;Connect another monitor to your computer&lt;/title&gt;
 
-&lt;!-- TODO: update video
 &lt;section id=&quot;video-demo&quot;&gt;
   &lt;title&gt;Video Demo&lt;/title&gt;
-  &lt;media its:translate=&quot;no&quot; type=&quot;video&quot; width=&quot;500&quot; mime=&quot;video/webm&quot; src=&quot;figures/display-dual-monitors.webm&quot;&gt;
+  &lt;media its:translate=&quot;no&quot; type=&quot;video&quot; width=&quot;500&quot; mime=&quot;video/webm&quot; src=&quot;/home/mcatanzaro/big-buck-bunny_trailer.webm&quot;&gt;
     &lt;p its:translate=&quot;yes&quot;&gt;Demo&lt;/p&gt;
     &lt;tt:tt its:translate=&quot;yes&quot; xmlns:tt=&quot;http://www.w3.org/ns/ttml&quot;&gt;
       &lt;tt:body&gt;
@@ -69,7 +68,6 @@
     &lt;/tt:tt&gt;
   &lt;/media&gt;
 &lt;/section&gt;
---&gt;
 
   &lt;comment&gt;
     &lt;cite date=&quot;2018-07-29&quot; href=&quot;mailto:mdhillca@gmail.com&quot;&gt;Michael Hill&lt;/cite&gt;

Note the hardcoded path to my home directory, which would need to be changed. I used the video from https://dl8.webmfiles.org/big-buck-bunny_trailer.webm but I doubt that matters. Then run:

$ yelp gnome-help/C/display-dual-monitors.page

Before 243836@main, the big buck bunny video will play. With 243836@main it no longer plays. Note that all of the changes in this commit are platform-specific except for the change to HTMLMediaElement.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879218</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-29 19:17:20 -0700</bug_when>
    <thetext>BTW this hack was needed because I failed to find any documentation with videos remaining so that I could give an easy reproducer. We only noticed because RHEL 8 still has some videos.

Anyway, the change that broke things is:

diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index ff346f25f75e..345a7e310251 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -1472,10 +1472,12 @@ void HTMLMediaElement::loadResource(const URL&amp; initialURL, ContentType&amp; contentT
     }
 
     URL url = initialURL;
-    if (!url.isEmpty() &amp;&amp; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {
+#if PLATFORM(COCOA)
+    if (url.isLocalFile() &amp;&amp; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {
         mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         return;
     }
+#endif
 
 #if ENABLE(CONTENT_EXTENSIONS)
     if (RefPtr documentLoader = frame-&gt;loader().documentLoader()) {

Jer&apos;s changelog contains reasoning for making this Cocoa-specific:

&quot;&quot;&quot;
Drive-by fix: to allow this change to be testable, we must revert a change which calls all the
network delegate callbacks with empty data. This was necessary at the time because (at least for
Cocoa ports) media loading happened outside WebCore&apos;s loader path. Currently, all http(s), data,
blob, and custom protocol schemes are loaded through WebCore, leaving file:// URLs as the
remaining protocol type that needs custom handling, and only on Cocoa ports.
&quot;&quot;&quot;

Notice the GStreamer log contains errors related to the URI scheme:

0:00:00.146452332  4822 0x561c5fcb4600 ERROR      webkitmediaplayer MediaPlayerPrivateGStreamer.cpp:1714:handleMessage: Error 12: No URI handler implemented for &quot;bogus-help&quot;. (url=bogus-help:/gnome-help/figures/gnome-windows-and-workspaces.webm)

yelp seems to be using this bogus-help URI scheme to trick WebKit into... something something, I don&apos;t understand. It was added here:

https://gitlab.gnome.org/GNOME/yelp/-/commit/04683e89cef14f56e4c3d1595424e109f12f5d06</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879451</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-06-30 11:21:42 -0700</bug_when>
    <thetext>This fixes yelp:

diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 97f855b6b592..95c10e228b81 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -1503,12 +1503,10 @@ void HTMLMediaElement::loadResource(const URL&amp; initialURL, ContentType&amp; contentT
     }
 
     URL url = initialURL;
-#if PLATFORM(COCOA)
-    if (url.isLocalFile() &amp;&amp; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {
+    if (!url.isEmpty() &amp;&amp; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {
         mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         return;
     }
-#endif
 
 #if ENABLE(CONTENT_EXTENSIONS)
     if (RefPtr documentLoader = frame-&gt;loader().documentLoader()) {

Phil, Jer, do you want a pull request for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879743</commentid>
    <comment_count>3</comment_count>
    <who name="Philippe Normand">philn</who>
    <bug_when>2022-07-01 07:20:14 -0700</bug_when>
    <thetext>&quot;&quot;&quot;
Drive-by fix: to allow this change to be testable, we must revert a change which calls all the
network delegate callbacks with empty data. This was necessary at the time because (at least for
Cocoa ports) media loading happened outside WebCore&apos;s loader path. Currently, all http(s), data,
blob, and custom protocol schemes are loaded through WebCore, leaving file:// URLs as the
remaining protocol type that needs custom handling, and only on Cocoa ports.
&quot;&quot;&quot;

Well, IIUC, GStreamer ports also apply here, file loading doesn&apos;t go through WebCore, but with a pure-GStreamer filesrc element.

Can you try this test?

if ((!url.isEmpty() || url.isLocalFile()) &amp;&amp; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879750</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-07-01 07:50:44 -0700</bug_when>
    <thetext>(In reply to Philippe Normand from comment #3)
&gt; if ((!url.isEmpty() || url.isLocalFile()) &amp;&amp;
&gt; !frame-&gt;loader().willLoadMediaElementURL(url, *this)) {

That works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1879767</commentid>
    <comment_count>5</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2022-07-01 08:42:02 -0700</bug_when>
    <thetext>well actually an empty url can&apos;t be local I suppose, so my suggestion doesn&apos;t make much sense.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1880517</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-07-04 06:54:02 -0700</bug_when>
    <thetext>Created a yelp bug: https://gitlab.gnome.org/GNOME/yelp/-/issues/193</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1885818</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2022-07-21 14:22:12 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/2635</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886123</commentid>
    <comment_count>8</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-07-22 15:28:53 -0700</bug_when>
    <thetext>Committed 252746@main (6cbee1cfa19b): &lt;https://commits.webkit.org/252746@main&gt;

Reviewed commits have been landed. Closing PR #2635 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886124</commentid>
    <comment_count>9</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-22 15:29:17 -0700</bug_when>
    <thetext>&lt;rdar://problem/97459127&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>