Inside a Python GTK+ 3 application I have a simple WebKit2.WebView (no customization) to display a set html string (no live browsing). The html contains a javascript lightbox with some youtube videos. When I open them, the youtube video box shows up but the content doesn’t play and I get a black screen saying (“An error occurred. Please try again later. (Playback ID: …”).
Similar image found on the web: https://i.redd.it/gwqswatndiy11.png
I then tried browsing the YouTube website with the Gnome Web browser (v 3.18.11 on Linux Mint 18.3) [based on WebKit] and the same problem occured with every video.
Of course everything works with other browsers (Chromium and Firefox).
Moreover, everything works if I use WebKit1 instead of WebKit2 in my PyGtk+ 3 app. So I think the problem lies in the Webkit2 options configuration.
Does anyone know how to solve this problem?
Here is an extract of my code. As you can see, I have already tried to set some options but nothing worked.
[Side note: browser_settings.set_enable_media(True) gives me the error AttributeError: 'Settings' object has no attribute 'set_enable_media'; I don’t understand why since in the documentation the method exists]
I just tested on Fedora 33 with Epiphany (GNOME Web) 3.38.2, and Youtube videos played OK. (Seemed to take a huge amount of CPU, but I guess that’s a separate issue).
You mentioned v3.18.11, this is a very old version and may not have some thing that’s needed to work with current Youtube.
If it’s impossible for you to use a recent version for some reason, I’d suggest opening the developer console in Web by pressing F12, and look in the console for any errors that might give a clue what’s wrong.
First of all, thank you very much for taking the time to assist other users like me. It’s much appreciated.
I run Linux Mint 18.3 (which is a LTS version with support until 2021) with everything updated, so apparently the only available package for Gnome Web browser is quite old. Can that happen in a LTS version?
That is reassuring. At least updating the package (by upgrading distro) is one solution.
I also think that more than Gnome Web browser / Epiphany versions, we should compare WebKit2 versions.
In the software manager I found that I have installed the following package:
gir1.2-webkit2-4.0, version 2.20.5
I have version 2.30.4 of the webkit2gtk3 Fedora package.
I run Linux Mint 18.3 (which is a LTS version with support until 2021) with everything updated, so apparently the only available package for Gnome Web browser is quite old. Can that happen in a LTS version?
Very much so. LTS distributions deliberately avoid updating to newer versions of components, which is a tradeoff that sometimes pays off and sometimes doesn’t.
Have you looked at Flatpak? This provides a nice way to use up-to-date apps and libraries on older distros, by running the app in a special container. You can try GNOME Web from Flatpak and see if it works any better.
That makes sense. I just saw that the “current” WebKit2 version in Mint 18.3 was actually released in August 13th, 2018.
Since Mint 18.3 is coming to end-of-life I’ll just install Mint 20 (or Fedora) on another ssd disk and check if this issue is solved (I’ll need to upgrade the system anyway in a few months, so no harm starting now).
Thank you very much. I will mark the topic as closed as soon as I verify everyting on the new system (at most in a few days).