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

Getting Widevine to work on all platforms with Electron 5.0.0 #20

Open
Scrumplex opened this issue Apr 27, 2019 · 26 comments
Open

Getting Widevine to work on all platforms with Electron 5.0.0 #20

Scrumplex opened this issue Apr 27, 2019 · 26 comments
Labels

Comments

@Scrumplex
Copy link
Contributor

@Scrumplex Scrumplex commented Apr 27, 2019

I have searched for a way to implement Widevine with modern Electron versions and found out, that the best way would be to package it ourselves. We would need to obtain versions of the Chrome Browser for each platform we build for and extract the widevinecdm library files. There are instructions here.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

I got maintainer on the electron-widevine plugin I am already using and would like to release it again once I get it working to help the community, not just this project. I have Widevine working on MacOS with the latest Electron release but it doesn't work on any other platform. Linux is a requirement (obviously) and Windows is something I would like but I am willing to ignore if need be. My progress can be seen in issue #2 , this playground repo and the Travis build status for that repo here. My repo downloads it directly from Google for the platform of the current system. I have been tracking the upstream issue here and still no progress on getting Linux working. This is something I am really hoping a fix can be found for soon as possible as the old Electron version probably has minor security vulnerabilities and is limiting other issues like adding Hulu as a service (issue #9).

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

Please give getting it working on Linux with the latest Electron a shot and see if you can get it to work cause I am out of ideas or am just missing something, somewhere.

@Scrumplex

This comment has been minimized.

Copy link
Contributor Author

@Scrumplex Scrumplex commented Apr 27, 2019

I think the files from the dl.google.com server might be for Firefox. As Google Chrome also has a widevinecdmadapter library, that is not included in the zip archive. Afaik Firefox ships with it's own adapter library.

Edit: looks like it is not included anymore? Hmm. This needs further investigation

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

It might be worth testing that then. I just find it annoying and weird that the Widevine works on Mac while not on Linux. I also tried extracting the Widevine from Chromium on my Linux machine and I could not get that working along with the direct Google download. The documentation page you linked (which I have read hundreds of time) is also outdated since the only working way (for Mac) requires setting the folder as the Widevine path and not the specific files. You can't set it as the same files as the documentation because Widevine (at least in Chrome) is not distributed with the same files anymore. If it is even possible and we get this working it might be worth doing a PR upstream to that documentation, to help people in the future as this seem like something quite a few people have struggled with throughout the versions of Electron.

@Scrumplex

This comment has been minimized.

Copy link
Contributor Author

@Scrumplex Scrumplex commented Apr 27, 2019

It actually seems like the command line flag for widevine is ignored. As even invalid paths don't cause any errors. I also extracted the widevine library from Google Chrome and tried using that instead, but with no success. This may very well be an upstream bug.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

It is really annoying that it doesn't produce errors when you mismatch versions or set an invalid path. The only way to tell if it is working is to test content or a DRM feature test website. It looks like nothing much is happening upstream which is quite annoying.

@Scrumplex

This comment has been minimized.

Copy link
Contributor Author

@Scrumplex Scrumplex commented Apr 27, 2019

This older project (using Electron 1.6.x) uses this adapter lib, too. So i am unsure, if it is actually required.

@Scrumplex

This comment has been minimized.

Copy link
Contributor Author

@Scrumplex Scrumplex commented Apr 27, 2019

But that can't be it, as the macOS package does not contain any adapter lib either.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

I don't know if it is required. I am leaning on the side of it not being required because the new working Mac version is missing one its files like Linux but this is only a guess and there aren't many public docs to help, thanks DRM!!!! All the other projects I searched for were using super old versions of Electron and did not help me much.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

Cool, thanks for putting that upstream. Hopefully, someone comes back with a solution or something that leads us in the correct direction!

@Scrumplex

This comment has been minimized.

Copy link
Contributor Author

@Scrumplex Scrumplex commented Apr 27, 2019

Looks like I overlooked something in the official documentation:

As of Electron v1.8.0 (Chrome v59),
the below steps are may only be some of the necessary steps to enable Widevine;
any app on or after that version intending to use the Widevine CDM may need to
be signed using a license obtained from Widevine
itself.

Looks like there is more to it than just loading that one library. They later refer to an Electron fork that is signed like this called castLabs Electron. Using that fork instead of the official Electron enables Widevine. I have a branch on my fork, where I use the fork instead.
Although they do say the following:

The provided builds are VMP-signed for development use, i.e. using Widevine UAT or servers accepting development clients. For production use a license agreement with Google Widevine is needed to get production certificates for re-signing the final package.
In the worst case you would need to request a VMP certificate from Google.

They also say that they support Windows and macOS, but I can confirm that it also works on Linux.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 27, 2019

I originally assumed that was the issue until MacOS was working on the latest Electron then I ruled it out cause it wouldn't make sense for a DRM feature like that to act differently between platforms (but I could be wrong). I applied for a VMP cert and unsurprising haven't got a reply and am not expecting one but it was worth a shot, in the Electron issues about Widevine people have reported it taking years to get certs and being an open source and small project we probably can't get them. The other thing about the message in the documentation is the Electron version being v1.8.0 but it is working on 4.x.x which also doesn't make sense.

@Scrumplex Scrumplex changed the title Considering bundling widevine manually Getting Widevine to work on all platforms with Electron 5.0.0 Apr 27, 2019
@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 28, 2019

Brave has working Widevine (If you enable it in the browser), it's not Electron but it is javascript and they are only loading a single file as can be seen here. I am going to try the Widevine they are downloading it and see if it works in Electron.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 28, 2019

Nope that didn't help they use another URL but it seems to redirect to the Google downloads page that is already being used.

@dbklabs

This comment has been minimized.

Copy link

@dbklabs dbklabs commented Apr 29, 2019

@oscartbeaumont How did you get this node module to work on macOS? I'm not able to get it to work using electron 5.0.0 (but I probably just did something wrong).

I did npm install oscartbeaumont-ext/electron-widevinecdm-dev, then const widevine = require('electron-widevinecdm-dev');, then widevine.load(app); before app is ready

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Apr 29, 2019

Look at the example code but you probably forgot to enable plugins and disable node integration on the browser window. Please also be aware that module is temporary and I will publish a proper node module once I get it working on Linux.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Jun 13, 2019

This is now a top priority with issue #31 which means without this update the app is currently not functional. This may mean sadly having to push the new version mac app (which is the only platform supporting the update) and ignoring other platforms until they can be fixed. I really don't want to do that (especially with the ~5000 active installs from snapcraft) but it may be the only option.

@Jiab77

This comment has been minimized.

Copy link

@Jiab77 Jiab77 commented Jun 15, 2019

Anything could be done to make the app working again for linux? I just noticed the issue now...

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Jun 16, 2019

The Linux version is now Electron 5.0.4 but the Mac version is 4.2.4 so it still needs some work before closing the issue. This was caused by the recent mess of a fix I implemented for fixing the broken Netflix player.

@Jiab77

This comment has been minimized.

Copy link

@Jiab77 Jiab77 commented Jun 16, 2019

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Jun 16, 2019

  1. Mac is not Electron 5.0.0 the entire point of the issue. 2) In the process of doing that get both versions on the same Electron as the difference in versions is possibly going to cause issues. It is only using different versions cause I needed a quick fix for Netflix and haven't had to time to fix it yet.
@ivanov35

This comment has been minimized.

Copy link

@ivanov35 ivanov35 commented Aug 22, 2019

I am using electron 6 and can get working Netflix and Amazon prime under linux because of the widevine configuration. Is there a working solution or it is under development ?

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Aug 22, 2019

Which platform are you on and if you got it working can you share code? I will look into this today and get back to you.

@ivanov35

This comment has been minimized.

Copy link

@ivanov35 ivanov35 commented Aug 23, 2019

Hi, sorry, it was my error in the previous post.
I am with electron 6 with ubuntu 18 and CANNOT make working winedev in order to play netflix or amazon prime.
I tried different configurations described in some tutorials but without success.
Do you know if there is actually a working solution for electron 6 under ubuntu 18 ?

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Sep 1, 2019

I have been working really hard but am not aware of a solution for Mac (or Windows) that works above 4.2.4. Linux is working with electron 5.0.4 and I think the upgrade to 6.x.x will be really easy and I am planning on doing that very soon.
This restriction to version 4.2.4 is worrying me because when Netflix drop support for that version of Chromium I will probably have to end development on this app as I mainly use it on my Mac.
I am sort of considering moving ElectronPlayer to a PWA which is similar to how Metastream is dealing with this same issue.

@oscartbeaumont

This comment has been minimized.

Copy link
Owner

@oscartbeaumont oscartbeaumont commented Sep 1, 2019

If you have questions about implementing Widevine in your own app look at this apps codebase or reach out via email. You can find it on my profile or website.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.