Chromium libwidevine and other DRM

Hello,

Does anyone know how to enable widevine and other DRM support for chromium snaps?

I have noticed and traversed launchpad for possible solutions along with this site. This includes putting libwidevinecdm.so in $SNAP_USER_DATA and $SNAP_USER_COMMON. I have had to look at the diff for chromium-browser 63 to see that one of the locations is $HOME/.local/lib which didn’t even exist for my install.

Then I noticed in the chromium changelog on launchpad that again the file changed in version 72.0.3626.81-0ubuntu1.

At the moment the available documentation for the Chromium snap seems to be rather lacking with little information as to how to enable the flash plugin, how to enable widevine/other DRM. This is rather important information as people would probably like to access sites like Netflix, Prime Video and other DRM content.

On a side note, it is remarkably difficult for someone to get the source code or diff patches for chromium on Launchpad. It saying “diff from 71.0.3578.98-0ubuntu1 to 72.0.3626.81-0ubuntu1 (pending)” isn’t that useful imho.

Kind regards,
Krish

EDIT: Nevermind Youtube Movies seem to work with libwidevine in $HOME/.local/lib. In stats it seems to show that it is using widevine lib. Netflix and Prime Video don’t seem to work even if i change user agent strings.

Netflix probably requires a chrome UA string, you can use e.g. the “User-Agent Switcher for Chrome” extension.

This cannot be considered proper documentation, but it explains where the flash plugin so file can be found and should be copied.

Hi oSoMon,

I tried switching the user agent String by going to Developer Console -> burger menu-> more tools -> Network Conditions -> User agent -> Chrome Windows. I also tried the extension listed.

I also tried an edge user string, and a custom defined one for the latest google chrome stable. All solutions led to the same issue. Google Play movies seems to work fine, but netflix and Amazon prime seems to fail.

Netflix works for me here, with chromium 73.0.3683.103 from the stable channel, and libwidevinecdm.so in ~/snap/chromium/current/.local/lib/. Can you share the error message you’re getting?

2 Likes

I have attached three images. In this case one using the network agent to change the user agent, and second using the extension. I have also added a image from a purchased video from youtube showing that the Wildevine extension is working.

I am currently working on Chromium stable.
installed: 73.0.3683.103 (691) 161MB -

My libwidevinecdm.so is currently located in $HOME/snap/chromium/current/.local/lib.

My current plugs are as follows:
:browser-support chromium:browser-sandbox
:cups-control chromium
:desktop chromium
:gsettings chromium
:network chromium
:network-bind chromium
:opengl chromium
:password-manager-service chromium
:personal-files chromium:chromium-config
:pulseaudio chromium
:screen-inhibit-control chromium
:u2f-devices chromium
:unity7 chromium
:upower-observe chromium
:x11 chromium
gtk-common-themes:gtk-3-themes chromium
gtk-common-themes:icon-themes chromium
gtk-common-themes:sound-themes chromium
_- chromium:camera
_- chromium:home
_- chromium:mount-observe
_- chromium:network-manager
_- chromium:removable-media

This is my argument for spawning.
env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/chromium_chromium.desktop /snap/bin/chromium %U --enable-features=“CheckerImaging” --enable-native-gpu-memory-buffers --password-store=kwallet

I also have a fair number of flags and extensions set such as ublock origin, umatrix and ublock origin extra.

Any particular thing that could be unusual with my setup? My setup is identical to the one used for chrome in Firejail and that seemed to work perfectly fine.

Does Netflix work if you disable the ublock extensions? Try opening it in a private browsing window.

Nope I am still getting the same error.
Error Code: M7121-1331

Could you run sha256sum on your libwildevine.so?
8342f9e152f3096dfd6623b448917657e04079d0ae9a6ba43371df05538d9a2d libwidevinecdm.so

Also what is your user agent specifically?

Same SHA256 checksum here.
The UA string is “Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.40 Safari/537.36”, as set by the “User-Agent Switcher for Chrome” extension (“chrome (not chromium)”).

Hi oSoMon,

That user agent seems to work.

Kind regards,
Krish

Looking at the patch manually in launchpad, I think it’s expecting the file to be in a specific folder.

$HOME/.local/lib/WidevineCdm/

Try putting the file in a WidevineCdm folder, maybe that would work.

ie ~/snap/chromium/current/.local/lib/WidevinCdm/

Specifically the patch which talks about ‘widevine other locations’.

Putting the plugin in $HOME/.local/lib/WidevineCdm/ did not work. Changing user agent string suggested in this post also did not work.

you want to put it into $HOME/snap/chromium/current/.local/lib/WidevineCdm …

Sorry for the typo but the directory you suggest is where I placed the plugin.

Actually, it has to go in $HOME/snap/chromium/current/.local/lib/WidevineCdm/.

Can you check whether the Sintel video is available and plays at https://shaka-player-demo.appspot.com/demo/ ?

1 Like

OMG, someone hasn’t added DRM to Sintel?! :-o

1 Like

Netflix, Prime Video, and TSN Sports Canada do not work.

Same here. Error M7121-1331 after installing Widevine and changing the user agent to Chrome on Windows using the --user-agent flag.

I have Chromium 92.0.4515 and libwidevinecdm on rpi arm64 and no luck getting the widevine to show in components. Has anyone had any luck?

Using latest Chromium Snap beta Version 117.0.5938.48 on Ubuntu 23.04 . Trying to watch ITVx in the UK and use spotify compained that I needed to enable protected content. For me, the fix was to copy the following file libwidevinecdm.so from google git or elsewhere into ~/snap/chromium/current/.local/lib/ and the browser restarted.