flathub / com.brave.Browser

https://flathub.org/apps/details/com.brave.Browser
Mozilla Public License 2.0
43 stars 18 forks source link

Widevine support seems to be missing #10

Closed Chemrat closed 3 years ago

Chemrat commented 3 years ago

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

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 commented 3 years ago

Same issue here

refi64 commented 3 years ago

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 notifications@github.com wrote:

Same issue here

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/flathub/com.brave.Browser/issues/10#issuecomment-766455140, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM4YSLSKCCLGGGTFQSC23DS3SRELANCNFSM4VNWY5GQ .

barthalion commented 3 years ago

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

Arcitec commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

TheEvilSkeleton commented 3 years ago

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

rany2 commented 3 years ago

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

Arcitec commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

Is it broken on purpose?

Edit: ah, they're empty files xD

refi64 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

Tell me if this works for you or not.

Chemrat commented 3 years ago

@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 commented 3 years ago

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