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

Player not parsing Clearkey license acquisition url. #10246

Closed
1 task
sr1990 opened this issue May 7, 2022 · 3 comments
Closed
1 task

Player not parsing Clearkey license acquisition url. #10246

sr1990 opened this issue May 7, 2022 · 3 comments
Assignees

Comments

@sr1990
Copy link
Contributor

sr1990 commented May 7, 2022

ExoPlayer Version

2.17.1

Devices that reproduce the issue

Pixel 5

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Yes

Reproduction steps

Added

      {
        "name": "CLEARKEY (cenc)",
        "uri": "https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd",
        "drm_scheme": "clearkey"
      },

to media.exolist.json.

Works if I specify the drm license uri

      {
        "name": "CLEARKEY (cenc)",
        "uri": "https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd",
        "drm_scheme": "clearkey",
        "drm_license_uri": "https://drm-clearkey-testvectors.axtest.net/AcquireLicense"
      },

Expected result

The media plays successfully.

Actual result

Playback crashes with the following error:
E/EventLogger: playerFailed [eventTime=4.38, mediaPos=0.00, window=0, period=0, errorCode=ERROR_CODE_DRM_LICENSE_ACQUISITION_FAILED

One workaround is
in DashManifestParser.java

  1. in parseContentProtection(),
  • add the case to parse clearkey
case "urn:uuid:e2719d58-a985-b3c9-781a-b030af78d30e":
          uuid = C.CLEARKEY_UUID;
          schemeType = "clearkey";
          break;
  • Parse the clearkey url in the same method
if (XmlPullParserUtil.isStartTag(xpp, "clearkey:Laurl")) {
        if (xpp.next() == XmlPullParser.TEXT) {
          licenseServerUrl = xpp.getText();
        }
 } 
  1. In parseAdaptationSet(), after line 416 while parsing the Content Protection, add
     } else if (XmlPullParserUtil.isStartTag(xpp, "ContentProtection")) {
        Pair<String, SchemeData> contentProtection = parseContentProtection(xpp);
        if (contentProtection.first != null) {
          drmSchemeType = contentProtection.first;
        }
        if (contentProtection.second != null) {
          if (drmSchemeType != null && drmSchemeType == "clearkey") {
            // update the license url of cenc
            for (int i = 0;i<drmSchemeDatas.size();i++) {
              if (drmSchemeDatas.get(i).uuid == C.COMMON_PSSH_UUID &&
                  drmSchemeDatas.get(i).licenseServerUrl == null)
                drmSchemeDatas.get(i).licenseServerUrl = contentProtection.second.licenseServerUrl;
            }
          }
          drmSchemeDatas.add(contentProtection.second);
        }

Please let me know what you think OR if I am missing anything.
Thanks.

Media

https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_1080p_ClearKey.mpd

Bug Report

@sr1990 sr1990 changed the title Player not parsing Clearkey license acquisition url string. Player not parsing Clearkey license acquisition url. May 7, 2022
@tonihei
Copy link
Collaborator

tonihei commented May 13, 2022

I think the content is configured as expected (see #3138 (comment) as a verification that both ContentProtection tags are expected, and Dash-Industry-Forum/dash.js#3343 for another example where parsing the license url is requested).

And the proposed solution also looks sensible to me. Would you be willing to send a PR with the suggested changes?

I'll mark the issue as an enhancement in the meantime (because it's not a bug, more a new feature to detect Clearkey LicenseURLs).

@tonihei
Copy link
Collaborator

tonihei commented Jul 15, 2022

This is now supported after merging a modified version of #10260.

@tonihei tonihei closed this as completed Jul 15, 2022
@sr1990
Copy link
Contributor Author

sr1990 commented Jul 16, 2022

Thanks @tonihei !

@google google locked and limited conversation to collaborators Sep 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants