Closed Bug 1900626 Opened 1 year ago Closed 5 months ago

Firefox does not support ClearKey cdm on Android

Categories

(Core :: Audio/Video: Playback, defect, P3)

All
Android
defect

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox144 --- wontfix
firefox145 --- wontfix
firefox146 --- fixed

People

(Reporter: craftspider23, Assigned: aosmond)

References

(Blocks 1 open bug)

Details

(Keywords: webcompat:platform-bug)

User Story

platform-scheduled:2025-12-31
user-impact-score:1930

Attachments

(1 file)

Steps to reproduce:

go on this site:
https://www.gumlet.com/tools/browser-capabilities-checker

go to the "Encrypted Media Extensions support" category and search for "ClearKey".
In the "SUPPORTED" category it will be marked as "no".

This is a defect as it is supported on the windows version and the ios version.

Actual results:

Marked as no ( not supported )

Expected results:

Marked as yes ( be supported )

The severity field is not set for this bug.
:tthibaud, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(tthibaud)

Alastor, do we have any plans for this?

Status: UNCONFIRMED → NEW
Component: Media → Audio/Video: Playback
Ever confirmed: true
Flags: needinfo?(tthibaud) → needinfo?(alwu)
Product: Fenix → Core
Version: Firefox 126 → Trunk

On Android we use MediaDRM, and it seems clearkey is supported. I will let John answer this question.

Flags: needinfo?(alwu) → needinfo?(jolin)
Summary: Firefox does not support ClearKey cdm → Firefox does not support ClearKey cdm on Android

In current implementation, only Widevine is supported. Kilik listed some reasons why clearkey wasn't supported using MediaDrm, but I think are mostly invalid now, except for

  1. InitDataType "keyids" is not supported by AOSP libdrmclearkeyplugin.so.

which needs further investigation.

Flags: needinfo?(jolin)
Severity: -- → S3
Duplicate of this bug: 1839189
Blocks: 1921715

As clearkey is listed as a mandatory key system in the spec, we should probably fix this either H2 this year, or H1 next year, change its priority.

Priority: -- → P2

This should not be prioritized as part of webcompat. ClearKey is largely used for testing purposes, it isn't leveraged by streaming web sites.

Flags: needinfo?(odvarko)
Flags: needinfo?(mreavy)

This appears to be a real issue and is blocking site report (bug 1921715, where the diagnosis indicates that it is using ClearKey)
If this is not the case, we should deprioritize the issue.

Dennis, could you please provide more details? Thank you!

Flags: needinfo?(odvarko)
Flags: needinfo?(mreavy)
Flags: needinfo?(dschubert)

Hey John, can we support this on Android?

Flags: needinfo?(jolin)

(In reply to Jan Honza Odvarko [:Honza] (always need-info? me) from comment #8)

Dennis, could you please provide more details? Thank you!

Yeah, it looks like eurosport.de uses this, according to that bug. I can't actually verify this - if Eurosport is using ClearKey and video playback is broken because of us not supporting it, then this is a valid WebCompat platform bug. If Eurosport is broken because of something else, we can remove the tracking here.

Flags: needinfo?(dschubert)
Blocks: clearkey
Priority: P2 → P3
Blocks: 1963559
User Story: (updated)
User Story: (updated)
User Story: (updated)
Depends on: 1970152

There are two ways to support ClearKey on Android:

  1. use Android system ClearKey plugin like what we did for Widevine L3 support.
  2. enable Gecko ClearKey CDM like desktop platforms do.

Bug 1267141 comment 13 pointed out some cons of 1. and I think some are already out of date now. However, the latest Android ClearKey plugin still support only cenc scheme but not cbcs, so it still doesn't work as well as Gecko ClearKey CDM. Chrome doesn't use Android implementation either.

Flags: needinfo?(jolin)

Per offline discussion, bug 1970152 will enable Android system ClearKey plugin and we'll check if there is any compatibility issues.

Blocks: 1904580
User Story: (updated)
User Story: (updated)

[:jhlin]
Hi, I look into this issue in the context of webcompat.
While bug 1904580 seems fixed, bug 1985053, bug 1921715 and bug 1963559 are still reproducible. (I didn't try bug 1957360, because I couldn't create an account)
If you have any update, could you please share it?

User Story: (updated)
Flags: needinfo?(jolin)
Flags: needinfo?(jolin)
User Story: (updated)
Blocks: media-triage
User Story: (updated)

On Slack, :aosmond asked:

Can anyone provide me guidance on the best strategy here? can the lib folder contain subfolders with both shared libraries and manifest files? if not, are we able to use lib files stored in another asset folder and if so how could I go about that? and if not either of those, I guess my only recourse is to store the manifest file in one place, libclearkey.so in the root lib folder, and teach the GMP plugin loading code how to deal with that?

Generally no, the lib folder is not controlled by the integrator; it's controlled by the Android-Gradle Plugin. Trying to monkey with it is sometimes possible and almost always a bad idea.

Generally yes, it is possible to load libraries from the assets/ folder. We used to implement a custom linker that loaded libraries directly from the APK file; we don't do that any more, but I don't see why it shouldn't be possible. However, there's a reason we don't do this: it's almost always the wrong approach and the Android linker does a better job than we can these days.

So: the happy path on Android is definitely to put your library in libs and your manifest in assets. On Slack you suggest hardcoding to avoid the manifest; I don't see why you need a manifest since you can't meaningfully update anything without updating the APK, so I'd suggest pursuing this. But if you do need to read from the assets, we have code in Gecko to do that gracefully (see resource://android and its implementation) that probably teaches you enough to to manage it at a lower level as needed.

User Story: (updated)
Assignee: nobody → aosmond
Status: NEW → ASSIGNED

This patch makes it so that we include libclearkey.so with our APK and
so that our existing GMP plumbing can launch using that library on
Android. On other platforms we have a specific plugin file system layout
that we follow and unfortunately that is not easy to do on Android. As
such we manually setup the plugin and force the GMP plugin process to
find/load the library from our environment instead of using the absolute
path.

Pushed by aosmond@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1874c449662a https://hg.mozilla.org/integration/autoland/rev/848aecd1697f Allow Android to use our bundled clearkey CDM. r=geckoview-reviewers,media-playback-reviewers,jolin,nalexander,tcampbell
Pushed by csabou@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/890c15b8464a https://hg.mozilla.org/integration/autoland/rev/171f065df6a6 Revert "Bug 1900626 - Allow Android to use our bundled clearkey CDM. r=geckoview-reviewers,media-playback-reviewers,jolin,nalexander,tcampbell" for causing wpt failures on encrypted-media-report-only.https.html.

Backed out for causing wpt failures on encrypted-media-report-only.https.html.

Push with failures

Failure log

Backout link

Flags: needinfo?(aosmond)

Looks like we expect the test to timeout on all platforms except Android:
https://searchfox.org/firefox-main/rev/f6385e6644d5d4343d33b692810275c434122199/testing/web-platform/meta/permissions-policy/reporting/encrypted-media-report-only.https.html.ini#3

Android must have thrown before, so I think we can just timeout like the other targets.

Flags: needinfo?(aosmond)
Pushed by aosmond@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2fed715f7f03 https://hg.mozilla.org/integration/autoland/rev/c6fe6faa151c Allow Android to use our bundled clearkey CDM. r=geckoview-reviewers,media-playback-reviewers,jolin,nalexander,tcampbell
No longer blocks: media-triage
User Story: (updated)
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch
No longer blocks: 1921715
Duplicate of this bug: 1921715

We don't build ESR for Android and we can otherwise just let this ride the train.

QA Whiteboard: [qa-triage-done-c147/b146]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: