Bug 225144 - External hole punch player not working on WPE Webkit
Summary: External hole punch player not working on WPE Webkit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WPE WebKit (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-28 02:00 PDT by Jean Dupond
Modified: 2021-04-28 07:56 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean Dupond 2021-04-28 02:00:18 PDT
Hello,
Comment 1 Jean Dupond 2021-04-28 02:05:54 PDT
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&) final { };
 #if ENABLE(MEDIA_SOURCE)
-    void load(const String&, MediaSourcePrivateClient*) final { };
+    void load(const URL&, const ContentType&, MediaSourcePrivateClient*) final { };
 #endif
 #if ENABLE(MEDIA_STREAM)
     void load(MediaStreamPrivate&) 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 "Whether to enable support for image color managem
 
 # Private options specific to the WPE port.
 WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH "Whether to enable GStreamer holepunch" PRIVATE OFF)
-WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external holepunch" PRIVATE OFF)
+WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external holepunch" PRIVATE ON)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Linux")
     WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEMORY_SAMPLER PRIVATE ON)

I recompiled.

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

Best regards,
Riadh
Comment 2 Miguel Gomez 2021-04-28 02:28:33 PDT
> Tools/gtk/install-dependencies
> Tools/Scripts/update-webkitgtk-libs
> Tools/Scripts/build-webkit --gtk --debug

You are building the gtk port

> 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 "Whether to enable support
> for image color managem
>  
>  # Private options specific to the WPE port.
>  WEBKIT_OPTION_DEFINE(USE_GSTREAMER_HOLEPUNCH "Whether to enable GStreamer
> holepunch" PRIVATE OFF)
> -WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external
> holepunch" PRIVATE OFF)
> +WEBKIT_OPTION_DEFINE(USE_EXTERNAL_HOLEPUNCH "Whether to enable external
> holepunch" PRIVATE ON)
>  

But you enabled the holepunch option for the wpe port, so you're not really using it, and what you're getting is a video player with a content that can't be played.
Comment 3 Jean Dupond 2021-04-28 02:57:26 PDT
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.
Comment 4 Jean Dupond 2021-04-28 02:58:51 PDT
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.
Comment 5 Miguel Gomez 2021-04-28 04:02:58 PDT
I've just given it a test and it works perfectly for me.

My bet is that you're not properly specifying the type to the video element. It needs to be done using a <source> tag. For example:

<video autoplay loop>
    <source src="720.mp4" type="video/holepunch">
    Your browser does not support the video tag.
</video> 

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
Comment 6 Miguel Gomez 2021-04-28 05:27:02 PDT
BTW I've just fixed the build error with external holepunch enabled, so just update and you won't need to fix it manually.
Comment 7 Jean Dupond 2021-04-28 07:30:09 PDT
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.
Comment 8 Jean Dupond 2021-04-28 07:39:06 PDT
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.
Comment 9 Jean Dupond 2021-04-28 07:56:37 PDT
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