Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widevine support seems to be missing #10

Closed
Chemrat opened this issue Dec 29, 2020 · 21 comments · Fixed by #16
Closed

Widevine support seems to be missing #10

Chemrat opened this issue Dec 29, 2020 · 21 comments · Fixed by #16

Comments

@Chemrat
Copy link

Chemrat commented Dec 29, 2020

Something strange is going on with Widevine support in flatpak version, for me it just doesn't work:

  • I checked that I have it enabled in settings -> extensions
  • I open a site using widevine, i.e. netflix, netflix says I'm missing widevine but I see no popup to install it
  • It's not in brave://components/ either

This isn't the case with stable flatpak version of Chromium, works there just fine. Is brave flatpak built with Widevine support if that's an option? Or maybe there's a difference in how Chromium and Brave install Widevine?

@PapyElGringo
Copy link

Same issue here

@refi64
Copy link
Collaborator

refi64 commented Jan 25, 2021 via email

@barthalion
Copy link
Member

It's supposedly downloaded, or so I've been told during initial review.

@Arcitec
Copy link

Arcitec commented Jan 26, 2021

Does Widevine work if you install Brave normally via its official ppa/deb file?

Edit: Tested official Brave deb installer (non-flatpak version) at https://bitmovin.com/demos/drm and Netflix and it (Widevine) works.

@Spacesurfer
Copy link

Installed the Brave Beta from Flatpak today. Went to https://www.disneyplus.com/home and it prompted to install widevine. I said agree, prompted again, checked the box saying to not ask again and hit agree. Brave restarted, went back to Disney+ and got this message when trying to watch a video:

Screenshot_20210206_141400

@x80486
Copy link

x80486 commented Feb 7, 2021

Same here. Chromium and Chrome works fine though 🤷🏻‍♂️

@TheEvilSkeleton
Copy link
Collaborator

TheEvilSkeleton commented Feb 7, 2021

I'm guessing because it's because they use different DRM technologies? I'm having the same issue with the Microsoft Edge flatpak.

@rany2
Copy link
Collaborator

rany2 commented Feb 7, 2021

@TheEvilSkeleton Nope, all Chromium-based browsers and Firefox use widevine (even Microsoft Edge)

@Arcitec
Copy link

Arcitec commented Feb 7, 2021

My guess is because the sandboxing prevents the Widevine plugin from analyzing the system properly. It's a DRM plugin. It's gonna try to do things like look at all other PIDs and analyze them to see if you're capturing the video, etc.

@rany2
Copy link
Collaborator

rany2 commented Feb 7, 2021

@Bananaman I've managed to get Widevine working on the ungoogled flatpak. So I don't think thats it

Edit: I don't have Netflix but i tested DRM with bitmovin's demo

@rany2
Copy link
Collaborator

rany2 commented Feb 7, 2021

Does Brave normally come with Widevine ootb, or is it auto downloaded from chrome://components?

On Sun, Jan 24, 2021 at 5:01 PM PapyElGringo @.***> wrote: Same issue here — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#10 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4YSLSKCCLGGGTFQSC23DS3SRELANCNFSM4VNWY5GQ .

While making the flatpak I've been told that it is downloaded but it turns out it's bundled just like Chrome

@refi64
Copy link
Collaborator

refi64 commented Feb 8, 2021

Widevine definitely does not come with Brave, you can find the downloaded files in ~/.var/app/com.brave.Browser/config/BraveSoftware/Brave-Browser/WidevineCdm..

The problem here is basically that the Widevine .so files were not exposed into the sandbox, which mostly "fixes" the issue...but it doesn't work in the mimic sandbox (Widevine is found, but the actual media player never loads) and I'm still trying to figure out why.

@rany2
Copy link
Collaborator

rany2 commented Feb 8, 2021

@refi64 Extract the deb file and then extract data.tar.xz. Now go to opt/brave.com/brave/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so. Brave does come with Widevine

@refi64
Copy link
Collaborator

refi64 commented Feb 8, 2021

Oh gosh their bundled widevine is completely broken 😅 manifest.json is entirely empty, so I guess that's why it's never used. An easier fix for now might be to fix the manifest file, I'll take a look.

@rany2
Copy link
Collaborator

rany2 commented Feb 8, 2021

Is it broken on purpose?

Edit: ah, they're empty files xD

@refi64
Copy link
Collaborator

refi64 commented Feb 12, 2021

Yeah I'm not sure why it's broken like that at all tbh, if I had to guess, based on Brave's own policies, it's the fact that it's present at all that's a mistake.

@x80486
Copy link

x80486 commented Feb 13, 2021

With the last update I can see the Widevine Content Decryption Module - Version: 4.10.1610.0 on brave://components/ — it wasn't there before

Yet...doesn't work 🙄

image

The link to test the DRM business says: Unable to instantiate a key system supporting the required combinations (DRM_NO_KEY_SYSTEM).

@rany2
Copy link
Collaborator

rany2 commented Feb 13, 2021

@Chemrat You need wget, mktemp and unzip before you continue. Save the following as a shell script and execute it with bash:

#!/bin/bash

set -eux

# Get latest WideVine Version
_widevine_ver="$(wget -qO- https://dl.google.com/widevine-cdm/versions.txt | tail -n1)"

# Make temporary directory for download
_mktemp_dir="$(mktemp -d)"
cd "$_mktemp_dir"

# Use the architecture of the current machine
ARCH="$(uname -m)"
case "$ARCH" in
  x86_64) WIDEVINE_ARCH="x64";  CHROMIUM_ARCH="x64" ;;
    i?86) WIDEVINE_ARCH="ia32"; CHROMIUM_ARCH="x86" ;;
       *) echo "The architecture $ARCH is not supported." >&2 ; exit 1 ;;
esac

# Download and unzip widevine
wget -c -O widevine.zip "https://dl.google.com/widevine-cdm/${_widevine_ver}-linux-${WIDEVINE_ARCH}.zip"
unzip      widevine.zip

# Install to Brave flatpak
_install_prefix="$HOME/.var/app/com.brave.Browser/config/BraveSoftware/Brave-Browser/WidevineCdm/${_widevine_ver}"
install -Dm644 libwidevinecdm.so   "${_install_prefix}/_platform_specific/linux_$CHROMIUM_ARCH/libwidevinecdm.so"
install  -m644       manifest.json "${_install_prefix}/manifest.json"
install  -m644        LICENSE.txt  "${_install_prefix}/LICENSE.txt"

# Remove temporary directory
cd / && rm -rf "$_mktemp_dir"

@rany2
Copy link
Collaborator

rany2 commented Feb 13, 2021

Tell me if this works for you or not.

@Chemrat
Copy link
Author

Chemrat commented Feb 13, 2021

@rany2 this doesn't seem to help

Strangily Brave already downloads 4.10.1610.0 from somewhere.
Even if I remove it and unpack 4.10.1582.2, which seems to be the latest official in versions.txt, after launch Brave creates latest-component-updated-widevine-cdm with 4.10.1582.2, which lasts a few seconds, after that it downloads 4.10.1610.0 again and overrides the 1582 ver (funnily enough, even if i don't consent to the popup confirmation to update widevine).
In this state widevine in brave doesn't work at all (netflix fails, https://bitmovin.com/demos/drm says no widevine).

After I close Brave and start it again, Brave removes 4.10.1582.2 folder, netflix still fails, but https://bitmovin.com/demos/drm says widevine is present but broken (DRM_NO_KEY_SYSTEM)

refi64 added a commit to refi64/zypak that referenced this issue Feb 13, 2021
This only partly fixed #4, since the fd would be valid until the caller
closed it. Then, if another caller tried to open /dev/urandom, the
now-closed fd would still be returned, leading to EBADF errors.

In particular, this was mistake discovered while working on
flathub/com.brave.Browser#10, since Widevine also needs to open
/dev/urandom.
refi64 added a commit to refi64/com.brave.Browser that referenced this issue Feb 13, 2021
@refi64
Copy link
Collaborator

refi64 commented Feb 13, 2021

Please try the build in #16, it should work now.

@rany2 rany2 closed this as completed in #16 Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants