<?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>225144</bug_id>
          
          <creation_ts>2021-04-28 02:00:18 -0700</creation_ts>
          <short_desc>External hole punch player not working on WPE Webkit</short_desc>
          <delta_ts>2021-04-28 07:56:37 -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>WPE WebKit</component>
          <version>WebKit Local Build</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jean Dupond">jdupond016</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>magomez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1754963</commentid>
    <comment_count>0</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 02:00:18 -0700</bug_when>
    <thetext>Hello,</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754964</commentid>
    <comment_count>1</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 02:05:54 -0700</bug_when>
    <thetext>Hello,

I compiled WPE port of Webkit on PC/Linux Ubuntu 20.04 with Wayland:

Tools/gtk/install-dependencies
Tools/Scripts/update-webkitgtk-libs
Tools/Scripts/build-webkit --gtk --debug

I activated the external hole punch player:

diff --git a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h
index 3b34bfa92abb..595e2a386c60 100644
--- a/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h
+++ b/Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h
@@ -53,7 +53,7 @@ public:
 
     void load(const String&amp;) final { };
 #if ENABLE(MEDIA_SOURCE)
-    void load(const String&amp;, MediaSourcePrivateClient*) final { };
+    void load(const URL&amp;, const ContentType&amp;, MediaSourcePrivateClient*) final { };
 #endif
 #if ENABLE(MEDIA_STREAM)
     void load(MediaStreamPrivate&amp;) final { };
diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake
index d8c2c251f3ea..9ca42847ca36 100644
--- a/Source/cmake/OptionsWPE.cmake
+++ b/Source/cmake/OptionsWPE.cmake
@@ -80,7 +80,7 @@ WEBKIT_OPTION_DEFINE(USE_LCMS &quot;Whether to enable support for image color managem
 
 # Private options specific to the WPE port.
 WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH &quot;Whether to enable GStreamer holepunch&quot; PRIVATE OFF)
-WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH &quot;Whether to enable external holepunch&quot; PRIVATE OFF)
+WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH &quot;Whether to enable external holepunch&quot; PRIVATE ON)
 
 if (CMAKE_SYSTEM_NAME MATCHES &quot;Linux&quot;)
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)

I recompiled.

I created a page with HTML5 video player with type=&quot;video/holepunch&quot;, but the created video player is a black opaque rectangle and not a transparent one.

Best regards,
Riadh</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754969</commentid>
    <comment_count>2</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2021-04-28 02:28:33 -0700</bug_when>
    <thetext>
&gt; Tools/gtk/install-dependencies
&gt; Tools/Scripts/update-webkitgtk-libs
&gt; Tools/Scripts/build-webkit --gtk --debug

You are building the gtk port

&gt; diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake
&gt; index d8c2c251f3ea..9ca42847ca36 100644
&gt; --- a/Source/cmake/OptionsWPE.cmake
&gt; +++ b/Source/cmake/OptionsWPE.cmake
&gt; @@ -80,7 +80,7 @@ WEBKIT_OPTION_DEFINE(USE_LCMS &quot;Whether to enable support
&gt; for image color managem
&gt;  
&gt;  # Private options specific to the WPE port.
&gt;  WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH &quot;Whether to enable GStreamer
&gt; holepunch&quot; PRIVATE OFF)
&gt; -WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH &quot;Whether to enable external
&gt; holepunch&quot; PRIVATE OFF)
&gt; +WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH &quot;Whether to enable external
&gt; holepunch&quot; PRIVATE ON)
&gt;  

But you enabled the holepunch option for the wpe port, so you&apos;re not really using it, and what you&apos;re getting is a video player with a content that can&apos;t be played.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754973</commentid>
    <comment_count>3</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 02:57:26 -0700</bug_when>
    <thetext>Hi Miguel,

Sorry I copied the wrong command when I filled this bug report. Actually I used the wpe port:

Tools/Scripts/build-webkit --wpe --debug

Best regards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754974</commentid>
    <comment_count>4</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 02:58:51 -0700</bug_when>
    <thetext>I mean I used all these commands for WPE port:

Tools/wpe/install-dependencies
Tools/Scripts/update-webkitwpe-libs
Tools/Scripts/build-webkit --wpe --debug

Best regards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754983</commentid>
    <comment_count>5</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2021-04-28 04:02:58 -0700</bug_when>
    <thetext>I&apos;ve just given it a test and it works perfectly for me.

My bet is that you&apos;re not properly specifying the type to the video element. It needs to be done using a &lt;source&gt; tag. For example:

&lt;video autoplay loop&gt;
    &lt;source src=&quot;720.mp4&quot; type=&quot;video/holepunch&quot;&gt;
    Your browser does not support the video tag.
&lt;/video&gt; 

I have a page I use for testing that creates a video element of 640x480 at the top left corner of the window. You can try it here:

https://people.igalia.com/magomez/video/index-holepunch.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1754991</commentid>
    <comment_count>6</comment_count>
    <who name="Miguel Gomez">magomez</who>
    <bug_when>2021-04-28 05:27:02 -0700</bug_when>
    <thetext>BTW I&apos;ve just fixed the build error with external holepunch enabled, so just update and you won&apos;t need to fix it manually.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1755015</commentid>
    <comment_count>7</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 07:30:09 -0700</bug_when>
    <thetext>Hi Miguel,

How do you launch Webkit on Linux Wayland?

I use this command:

Tools/Scripts/run-minibrowser --wpe https://people.igalia.com/magomez/video/index-holepunch.html

But I am seeing just a single white rectangle with all your page. May be I missed some argument?

Best regards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1755016</commentid>
    <comment_count>8</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 07:39:06 -0700</bug_when>
    <thetext>I also have an alert when I launch mini browser:

Cog not found 😢. If you wish to enable it, rebuild with `-DENABLE_COG=ON`. Falling back to good old MiniBrowser


What is Cog? Do I need to enable it?

Best regards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1755023</commentid>
    <comment_count>9</comment_count>
    <who name="Jean Dupond">jdupond016</who>
    <bug_when>2021-04-28 07:56:37 -0700</bug_when>
    <thetext>Hi Miguel,

I found the solution. Since by build is a debug build, I should add --debug:

Tools/Scripts/run-minibrowser --wpe --debug https://people.igalia.com/magomez/video/index-holepunch.html

Thank you for the build fix that you committed.

Best regards</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>