Fenix: Support for Widevine EME DRM

Created on 25 Mar 2019  ·  20Comments  ·  Source: mozilla-mobile/fenix

Existing EME work:

Why/User Benefit/User Problem

Users would like to be able to watch videos that use DRM.

What / Requirements

Fenix has EME UI to play Widevine DRM videos.

We do not need EME for Fenix MVP or the Fennec/Fenix transition because Fennec does not currently support EME. Fenix EME can wait until FFTV ships its EME UI first (mozilla-mobile/firefox-tv#1698).

Acceptance Criteria (how do I know when I’m done?)

Users can watch YouTube and Amazon Prime videos that use Widevine DRM.

The following YouTube DRM video is a convenient test case for EME because it costs $0 (though you still need a credit card to "purchase" the video): https://www.youtube.com/watch?v=W6E7CGm12tA

feature request 🌟 hershey ac gv

Most helpful comment

Verified as fixed on Firefox Preview Nightly 201214 (Build #2015781291)

Devices used:

  • Google Pixel 3 XL (Android 9)
  • OnePlus 6T (Android 9)

All 20 comments

Widevine support would be great!

The following YouTube DRM video is a convenient test case for EME because it costs $0 (though you still need a credit card to "purchase" the video): https://www.youtube.com/watch?v=W6E7CGm12tA

How about this one for Widevine test instead? (Doesn't require an account)

Note: I think Firefox brand policy would want us to ask or notify the user when DRM is used (even if part of android system). Do we have any fenix Ux started on that front? (Is this the right issue for this topic)

It looks like Starz relies on Widevine: https://github.com/webcompat/web-bugs/issues/52232#issuecomment-620563246

It's been implied above that permission needs to be granted for EME but support is missing.

Can confirm that in the current android beta/nightly, widevine works swimmingly by setting media.eme.enabled to true and media.eme.require-app-approval to false in about:config.

Hi QA, we want to restart this work, so could you test to see if the user's comment above^ allows playing DRM content, on Beta or Nightly with those settings updated?

Possible sites to test (from the comments in this issue):

  • The following YouTube DRM video is a convenient test case for EME because it costs $0 (though you still need a credit card to "purchase" the video): https://www.youtube.com/watch?v=W6E7CGm12tA
  • How about this one for Widevine test instead? (Doesn't require an account)

Specifically, would like to know in what cases this content can be played (if at all). If the technical capabilities are there, perhaps all we need is to add settings in UI.

Hello, checked the following outcomes with Google Pixel 3 XL (Android 9) and Samsung Galaxy S9 (Android 8) on Nightly 7/27.

Scenario 1

  • media.eme.enabled - true
  • media.eme.require-app-approval - false
    1.1 For https://bitmovin.com/demos/drm - error message is displayed "VIdeo decoder or demuxer had an error with the content(Playback video decoding error)"
    1.2 For https://www.starz.com/us/en/play/58958 - error message is displayed "An unknown error occurred. Please try again"
    For this case the GV permission does not need to be present

Scenario 2

  • media.eme.enabled - true
  • media.eme.require-app-approval - true
    2.1 For https://bitmovin.com/demos/drm - detects that "No DRM" is present, audio and video work
    2.2 For https://www.starz.com/us/en/play/58958 - informative message displayed, about missing WidevineCdm component

Scenario 3 - Default Firefox Nightly Settings

  • media.eme.enabled - false
  • media.eme.require-app-approval - true
    3.1 For https://bitmovin.com/demos/drm - detects that the browser has no DRM, audio and video work
    3.2 For https://www.starz.com/us/en/play/58958 - informative message displayed, about missing WidevineCdm component
    No GV permission prompt was present

Scenario 4

  • media.eme.enabled - false
  • media.eme.require-app-approval - false
    4.1 For https://bitmovin.com/demos/drm - detects that the browser has no DRM, audio and video work
    4.2 For https://www.starz.com/us/en/play/58958 - informative message displayed, about missing WidevineCdm component

Scenarios Details

Scenario 1
1.1 For https://bitmovin.com/demos/drm - Screenshot_20200728-115051
1.2 For https://www.starz.com/us/en/play/58958 - Screenshot_20200728-115415

Scenario 2
2.1 For https://bitmovin.com/demos/drm - Screenshot_20200728-111329
2.2 For https://www.starz.com/us/en/play/58958 - Screenshot_20200728-111727

Scenario 3 - Default Firefox Nightly Settings
3.1 For https://bitmovin.com/demos/drm - same outcome is present as for scenario 2
3.2 For https://www.starz.com/us/en/play/58958 - same outcome is present as for scenario 2

Scenario 4
4.1 For https://bitmovin.com/demos/drm - same outcome is present as for scenario 2
4.2 For https://www.starz.com/us/en/play/58958 - same outcome is present as for scenario 2

Notes:

  1. Will the GV issue be treated in this one? media.eme.require-app-approval when is set to true and media.eme.enabled is true, there is no notification or prompt about allowing or disallowing to play DRM content
  2. Does the UI of Fenix be changed other than the Permission module (as described in the Google Doc from description)? Will there be other parts affected in Fenix?
  3. Should the video eme keys be displayed when media.eme.require-app-approval is set to false, or in case from permission level, the user denies the api's request?
  4. Are the error mentioned at scenario 1 supposed to happen?

@liuche - as we discussed on slack, related to the youtube video, i did encounter some problems. I'll check to see for a video that will work in my country. I'll let you know about that.
I'll remove the qa-needed until further information is provided.

@Diana-Rus scenario 1 is the only relevant case. I'm assuming your test devices are able to play the bitmovin widevine test with Chrome?

On my end, I've confirmed working (current beta and nightly):

  • oneplus 7t (Android 10) with widevine L3 (unlocked bootloader)
  • essential ph1 (Android 10) with widevine L1

Screenshot_20200728-142137

DRM Info

Do not have any Android 8/9 devices on hand to test

Google has a streaming video test page for their "Shaka Player" that includes EME/DRM videos. The "Clear Key DRM" and "Widevine DRM" videos should all work in Firefox and Chrome on desktop and mobile. "Fairplay DRM" is only supported in Safari. "PlayReady DRM" is only supported in Edge (including Chromium Edge).

https://shaka-player-demo.appspot.com/demo/#audiolang=en;textlang=en;uilang=en;panel=ALL_CONTENT;build=uncompiled

Hi,
@ziddey - yes, the test devices are able to play the bitmovin widevine test using Chrome(84.0.4147.89).

@cpeterso - thanks Chris, i've looked the videos from https://shaka-player-demo.appspot.com/demo/#audiolang=en;textlang=en;uilang=en;panel=ALL_CONTENT;build=uncompiled with widevine DRM and clear key DRM

@liuche - could you please check the questions form above comment, thank you!!
Could you also look at the outcomes below?

Scenarios have been checked with Google pixel 3 XL (Android 9) and Samsung Galaxy S9 (Android 8) on Nightly 7/27
Scenario 1 - media.eme.enabled - true and media.eme.require-app-approval - false

  • https://shaka-player-demo.appspot.com/demo/#audiolang=en;textlang=en;uilang=en;panel=ALL_CONTENT;build=uncompiled

A) Widevine DRM:

  • Video 1 - Angel One (multicodec, multilingual, Widevine) - audio and video plays correctly,
  • Video 2 - Angel One (HLS, MP4, multilingual, Widevine) - audio and video plays correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 3 - Angel One (HLS, MP4, multilingual, Widevine, single linear ad) - ad is present,audio and video plays correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 4 - Sintel 4k (multicodec, Widevine) - error message is displayed Shaka error MEDIA.VIDEO_ERROR
    Screenshot_20200729-194906❗❗
    Error description https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#value:3016
    This can be played in Chrome❗❗
  • Video 5 - Sintel 4k (multicodec, Widevine, ads) - same error message is displayed but the ad plays(video and audio present for it)❗❗
    This can be played in Chrome❗❗
  • Video 6 - "Dig the Uke"by Stefan Kartenberg (audio only, multicodec, Widevine) - audio plays correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 7 - Multi-DRM - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option) - the video seems to load more slowly than the rest of the cases
  • Video 8 - Multi-DRM, multi-key - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option) - the video seems to load more slowly than the rest of the cases
  • Video 9 - Multi-DRM, multi-key, multi-Period - error message is displayed
    Screenshot_20200729-201528 ❗❗
    Error Description: https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#value:6006
    Same error message is encounter on Chrome as in Fenix❗❗
  • Video 9 - Tears of Steel (Widevine) - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 10 - Multi DRM - 8 Byte IV - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 11 - Multi DRM - MultiPeriod - 8 Byte IV - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video12 - Widevine - 16 Byte IV - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)
  • Video 13 - Widevine - 16 Byte IV - (mix of encrypted and unencrypted periods) - audio and video work correctly, controls work(cancel, video progress bar, volume, full screen, ⋮ (More) option)

B) ClearKey DRM:

  • there is only one video for this and is not available-after tapping on it will displays informative message that "Browser does not support the required key systems."
    This can be played in Chrome❗❗
1. Will the GV issue be treated in this one? media.eme.require-app-approval when is set to true and media.eme.enabled is true, there is no notification or prompt about allowing or disallowing to play DRM content

Okay, I think this requires us to use the GeckoView APIs that exist for EME, and once we implement handling that permission, then the notification will show up.

2. Does the UI of Fenix be changed other than the Permission module (as described in the Google Doc from description)? Will there be other parts affected in Fenix?

I don't think that we will need to change the Fenix UX, beyond showing a dialog asking the user to accept/reject.

3. Should the video eme keys be displayed when media.eme.require-app-approval is set to false, or in case from permission level, the user denies the api's request?

If the approval is set to false, or the user does not approve the api request, then I do not believe the key should show.

4. Are the error mentioned at scenario 1 supposed to happen?

Interesting, if we never hit that code path, we shouldn't have to hit the permission, so now that you mention it, that doesn't seem quite right.

EDIT: I tested this on my Nightly Fenix version with the bitmovin, and I did not see that error. Is the error still present if refreshing the bitmovin page?


Thank you @Diana-Rus for the thorough testing, and helping us understand the current state of EME in Fenix. We will do some more work, and then re-request QA.

Next steps here:

After talking to Randall Barker from the FxR team in the #geckoview channel, it sounds like the next steps will require a little AC work to trigger the EME notification and permissions.

We'll need to add and handle the GeckoSession.PermissionDelegate.PERMISSION_MEDIA_KEY_SYSTEM_ACCESS permission in GeckoPermissionRequest

See the FxR implementation.

This probably needs some strings for the prompt, but we should be able to at least see if it works (and what context this shows up in).

So this was broken on Nightly from July-17 by bz-1652474. Randal opened bz-1656289 to fix this, we should re-test when this is fixed.

@kbrosnan this seems like it could be a good candidate for Hershey next sprint, what do you think? We'll need strings for the require-app-approval prompt though - if you know what that prompt should ask for, we can pass that on to @betsymi and get strings from her.

Randal's bug fixing EME on Android has been merged into mozilla-central. When we get a GV with a build id greater than 20200804000001 (2020-08-04-000001) this can be tested again.

Hi, with Nightly 8/10 build that contains the eme enabling, the media.eme.enabled is set true as default in comparison with the last tested build.

  • Created 4 new issues: #13445 this one I consider it major as you can't play the videos and marked it as S1 , #13463 , #13461 this one, the last one was clarified by @liuche how it should work and #13497 (mentioned in comment)

  • Updated issue #13249 with results from the GV build - The clear key video from shaka player can't be played, in chrome the video can be played.

  • Updated issue #13243 mentioned in comment, with results for latest Nightly build

  • Verified with Samsung Galaxy S9 (Android 8), Google Pixel 3XL (Android 9) and Sony Xperia Z5 (Android 7)

@kbrosnan i understood from @liuche that there is another eme issue that will be in a later GV build, do you know which one is it?

I'll remove the qa-needed until further information is provided.

Hello @kbrosnan, @liuche , any news for this issue 😊?

With https://github.com/mozilla-mobile/android-components/pull/9121 this works for me on my local build at least :)

Verified as fixed on Firefox Preview Nightly 201214 (Build #2015781291)

Devices used:

  • Google Pixel 3 XL (Android 9)
  • OnePlus 6T (Android 9)
Was this page helpful?
0 / 5 - 0 ratings