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

Provided Chrome browser does not support DRM (widevine) #2098

Open
lemonwhale opened this issue Jul 5, 2018 · 17 comments
Open

Provided Chrome browser does not support DRM (widevine) #2098

lemonwhale opened this issue Jul 5, 2018 · 17 comments
Labels
stage: needs investigating Someone from Cypress needs to look at this type: feature New feature that does not currently exist

Comments

@lemonwhale
Copy link

lemonwhale commented Jul 5, 2018

Current behavior:

When we try to play a DRM protected video in the chrome browser provided by cypress, our video player throws a error (drm/widevine is not supported). The same video in ordinary chrome plays well.

Desired behavior:

The video plays well in the browser

Steps to reproduce:

cy.visit('https://demo.castlabs.com/')

Big buck Bunny > MPEG-DASH > DRM (video should start playing)
We have tried to set chromeWebSecurity: false, but it did not help. A friend of mine is saying that this is most likely caused by the fact that the site is running in a iframe in the cypress chrome browser, so it might have something to do with security in iframes etc.

Versions

Cypress 3.0.1
Chrome 67

@jennifer-shehane jennifer-shehane added the stage: needs investigating Someone from Cypress needs to look at this label Jul 10, 2018
@lemonwhale
Copy link
Author

lemonwhale commented Aug 23, 2018

@jennifer-shehane Did you have a chance to look at this? DRM is critical for us in our testing.

@sternbro
Copy link

sternbro commented Sep 4, 2018

@jennifer-shehane We would appreciate some feedback, will this ticket be investigated anytime soon?

As mentioned above, playback of DRM content is critical for us. So far we have started writing tests for other functions of our application, but at some point of time we will need the DRM playback to work. If the DRM support will continue to be missing in cypress, any test writing efforts will be of waste and we will be forced to use another tool.

@balibou
Copy link

balibou commented Sep 5, 2018

Hello @jennifer-shehane !

I'm lead developer for the web player of myCANAL and it would be awesome to have the DRM support in Cypress ! We just encountered the issue and we would be so disappointed to use another solution just because of that :(

Thanks for your feedback ! You have an awesome product !

@sternbro
Copy link

sternbro commented Sep 6, 2018

"Nice" to hear that we are not the only ones suffering from this issue, let's hope it helps to put prio on the investigation.

@vovacodes
Copy link

We are investigating if we can use cypress at Showmax and right now the absence of DRM support in Chrome is a blocker for us. Is there any development in this regard?

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Dec 27, 2018

I've looked into this issue a bit. Sorry, this is a bit of a brain dump. I think the takeaway is that the solution will not be an easy fix.

Here are the failing tests that should pass when DRM is supported correctly:

it('DRM test 1', () => {
  cy.visit('https://bitmovin.com/demos/drm')
  cy.contains('No DRM').should('not.exist')
})

Chrome 59 (and later) includes support for Verified Media Path (VMP). VMP provides a method to verify the authenticity of a device platform. For browser deployments, this will provide an additional signal to determine if a browser-based implementation is reliable and secure.

The proxy integration guide has been updated with information about VMP and how to issue licenses.

Widevine recommends our browser-based integrations (vendors and browser-based applications) add support for VMP.

Castlabs has a fork of electron that provides VPM support which they seem to have no intention at the moment of pushing back upstream to Electron due to some closed source code.

For production use of the Castlabs fork, a license agreement with Google Widevine is needed to get production certificates for re-signing the final package - this requires filling out a 'Contact Us' form on the widevine site and seems to take a while to hear back from.

Visiting chrome://components/ in Cypress Chrome:
screen shot 2018-12-27 at 2 02 20 pm

Visiting chrome://components/ in non-Cypress Chrome:

screen shot 2018-12-27 at 2 02 47 pm

Resources:

@lemonwhale
Copy link
Author

@jennifer-shehane Sorry for my slow response here. Do you think it is sufficient to to get a VPM compatible electron setup to get DRM support?

@Upatseb
Copy link

Upatseb commented Feb 19, 2020

What about firefox? It could be a workaround but it fails too, it tries to install components and never ends

@flotwig
Copy link
Contributor

flotwig commented Feb 19, 2020

Cypress passes '--disable-component-update' to Chrome on startup. I think that this prevents Widevine from being installed. Try filtering it out in the plugin file:

module.exports = (on, config) => {
  on('before:browser:launch', (browser = {}, launchOptions) => {
    if (browser.family === 'chromium' && browser.name !== 'electron') {
      launchOptions.args = launchOptions.args.filter(arg => arg !== '--disable-component-update')

      console.log('Chrome launch args:', launchOptions.args) // print all args

      return launchOptions
    }
  })
}

Note: this still won't work in headless mode, Chrome --headless doesn't support Widevine: https://bugs.chromium.org/p/chromium/issues/detail?id=788662

@veronicamirada
Copy link

Any updates? We can play videos in chrome, but we will also need drm support for firefox browser.

@DanieleDiLucido
Copy link

Any updates? We can play videos in chrome, but we will also need drm support for firefox browser.

Hi Veronica, you could mock the service and use clear content.
I wrote a quick guide, I hope that this workaround would help you 😃

@jennifer-shehane jennifer-shehane added type: feature New feature that does not currently exist and removed type: bug labels Jan 22, 2021
@murad755
Copy link

Hey. Any updates about this issue? I faced it recently in my project and it looks like there is no solution yet :/

@sternbro
Copy link

There is the workaround by flotwig if that helps.

@todd-alexander-cbsi
Copy link

Hi @flotwig @jennifer-shehane - having issues with DRM in firefox, the workaround that @flotwig mentioned for Chrome helped fix the widevine issue for Chrome, but looks like the Browser settings for Firefox in Cypress Test Runner also incur issues installing widevine components, do you know if there is a browser setting for Firefox that will disable this?

Screenshots below:
Screen Shot 2021-12-03 at 12 58 17 PM
Screen Shot 2021-12-03 at 12 58 31 PM

@todd-alexander-cbsi
Copy link

@flotwig @jennifer-shehane following up here, I tried looking into firefox settings but to no avail, was wondering if you knew of any workarounds for this

@veronicamirada
Copy link

I fixed this by adding the following code at plugins/index.js

module.exports = (on, config) => { on('before:browser:launch', (browser = {}, launchOptions) => { if (browser.family === 'chromium' && browser.name !== 'electron') { launchOptions.args = launchOptions.args.filter((arg) => { return arg !== '--disable-component-update' && arg !== '--headless'; }); return launchOptions; } }); };

But suddenly it stopped working again. Someone knows what happened?

@irgendwasmitfelix
Copy link

Did u fixxed it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs investigating Someone from Cypress needs to look at this type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests