How to enable external clear key in android on chrome browser

282 views
Skip to first unread message

pujari gupta

unread,
Jan 8, 2018, 1:40:22 AM1/8/18
to Chromium-dev
Hi,
I want to enable external clear key on android on chrome browser .

Currently the clear play is happening with the default provided with the browser.

Anybody can hep me on this....


Thanks
Pujari

pujari gupta

unread,
Jan 9, 2018, 2:08:07 AM1/9/18
to Chromium-dev
Any one can please help me on this.

Chris Cunningham

unread,
Jan 9, 2018, 2:19:54 PM1/9/18
to pujari...@gmail.com, Chromium-dev, Xiaohan Wang (王消寒), John Rummell
Adding some EME folks.

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/3c8309fb-44fa-48b0-b61b-d308e87f80e0%40chromium.org.

Xiaohan Wang (王消寒)

unread,
Jan 9, 2018, 2:25:45 PM1/9/18
to Chris Cunningham, pujari...@gmail.com, Chromium-dev, John Rummell
Hello Pujari,

Could you please provide more details on why you'd prefer External Clear Key to normal Clear Key key system that's supported natively in the browser? External Clear Key is added only for testing purposes and there's not plan to enable it in production so far.

Best,
Xiaohan

pujari gupta

unread,
Jan 10, 2018, 1:12:53 AM1/10/18
to Chromium-dev, chcunn...@chromium.org, pujari...@gmail.com, jrum...@chromium.org
Hi Xiaohan,
My whole idea is to have OCDM and CDMi like things on android.
But in Android I have read from the blogs we already have the Media Drm support, so OCDM and CDMi pepper plugins are only supported for ubuntu.
And a default clearkey plug-in is also available in android framework.

Now I have build the chromium for android but when playing clearkey content its uses native clearkey so I want to use the clear key provided in the android frame work to understand code flow and the changes required in order to do so.

Though I know it won't be a easy job for me .

Thanks
Pujari

Xiaohan Wang (王消寒)

unread,
Jan 10, 2018, 12:44:26 PM1/10/18
to pujari gupta, Chromium-dev, Chris Cunningham, John Rummell
Thanks for the explanation! Now I get it.

I don't know much about OCDM and CDMi. Do you have more details on them?

You are right that Android MediaDrm should support Clear Key. And we do have a plan to enable it for test-only: https://bugs.chromium.org/p/chromium/issues/detail?id=721935. But we haven't got a chance to work on it given low priority. Note that we do not want to use it in production for security and performance issues.

Also, today External Clear Key on Android is supported by running AesDecryptor in the (remote) GPU process:

You can comment this out, and always create MediaDrmBridge for External Clear Key key system, then update MediaDrmBridge to support Clear Key. It requires some work but shouldn't be too hard I guess.

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/0cce9f57-0a30-491d-9a46-3ba58477404b%40chromium.org.

pujari gupta

unread,
Jan 11, 2018, 7:38:34 AM1/11/18
to Chromium-dev, pujari...@gmail.com, chcunn...@chromium.org, jrum...@chromium.org

Hi Xiaohan,
Thanks for replying.

I am trying to do those changes.

And also what i understand that Android DRM framework uses key UUID rather then key systems to load specific drm, so i understand i need to do those changes in chrome.

But as I am not too much familiar with the chrome code , i am struggling right.

in case you do have any idea it will be really helpful.

And I will keep you updated with my changes in progress.


Thanks
Pujari

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Xiaohan Wang (王消寒)

unread,
Jan 11, 2018, 12:34:10 PM1/11/18
to pujari gupta, Chromium-dev, Chris Cunningham, John Rummell
On Thu, Jan 11, 2018 at 4:38 AM, pujari gupta <pujari...@gmail.com> wrote:

Hi Xiaohan,

Thanks for replying.

I am trying to do those changes.

And also what i understand that Android DRM framework uses key UUID rather then key systems to load specific drm, so i understand i need to do those changes in chrome.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/28eca572-fdc6-4543-8074-dd49cb0320cb%40chromium.org.

pujari gupta

unread,
Jan 12, 2018, 8:41:46 AM1/12/18
to Chromium-dev, pujari...@gmail.com, chcunn...@chromium.org, jrum...@chromium.org
Hi Xiaohan,
For simplicity to debug I have added the UUID of mockDrm inside chromium source where you have pointed :

File : src/media/base/android/media_drm_bridge.cc :

//Code snippet

const char kExternalClearKey[] = "org.chromium.externalclearkey"; // PUJARI


const uint8_t kMockDrmUuid[16] = {
    0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,  //
    0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10};  // PUJARI

KeySystemManager::KeySystemManager() {
  // Widevine is always supported in Android.

  key_system_uuid_map_[kWidevineKeySystem] =
      UUID(kWidevineUuid, kWidevineUuid + arraysize(kWidevineUuid));

  key_system_uuid_map_[kExternalClearKey] =
      UUID(kMockDrmUuid, kMockDrmUuid + arraysize(kMockDrmUuid));
  MediaDrmBridgeClient* client = GetMediaDrmBridgeClient();
  if (client)
    client->AddKeySystemUUIDMappings(&key_system_uuid_map_);
}
**************************************************************



File : src/media/base/android/android_cdm_factory.cc


commented :



//  if (base::FeatureList::IsEnabled(media::kExternalClearKeyForTesting) &&
 //     IsExternalClearKey(key_system))

// N.B => I have given a log here , it seems log is not getting printed may be code is not coming here.
{


*********************************************

But when I am playing the clear key , its still pointing to the default clear key.

Mu understanding is It should load the MockDrm and fail to play the clear key stream.

Please correct me if my understanding is wrong.

Thanks
Pujari

Xiaohan Wang (王消寒)

unread,
Jan 12, 2018, 12:44:39 PM1/12/18
to pujari gupta, Chromium-dev, Chris Cunningham, John Rummell
On Fri, Jan 12, 2018 at 5:41 AM, pujari gupta <pujari...@gmail.com> wrote:
Hi Xiaohan,

"External Clear Key" is a test key system with string "org.chromium.externalclearkey". This is only used for testing in Chromium.

"Clear Key" is a key system defined by the EME spec with the key system string "org.w3.clearkey". It's supported by many browsers including Chromium.

So, for your testing, are you using Clear Key, or External Clear Key?
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/b4849ac7-0c6d-4a62-9cca-7fa31872103f%40chromium.org.

pujari gupta

unread,
Jan 12, 2018, 1:12:32 PM1/12/18
to Chromium-dev, pujari...@gmail.com, chcunn...@chromium.org, jrum...@chromium.org
I am using dash js player for testing the external key , I guess it's using clear key perhaps.

But I have also tried the EME html player inside test folder of chromium where we have the external clear key option but I was not able to play any video.
> To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/b4849ac7-0c6d-4a62-9cca-7fa31872103f%40chromium.org.

Reply all
Reply to author
Forward
0 new messages