[go: nahoru, domu]

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

Is it necessary to specify C.CLEARKEY_UUID to play DASH ClearKey streams? #1500

Closed
hakonschia opened this issue Jun 26, 2024 · 4 comments
Closed
Assignees
Labels

Comments

@hakonschia
Copy link
Contributor

I'm trying to play a DASH ClearKey stream. We currently create our media item as such player.setMediaItem(MediaItem.fromUri("...")). This results in no video being shown, but the stream is playing (in the sense that the scrubber moves and no playback error occurs, and also subtitles are shown at the correct timestamps)

If I add a DrmConfiguration specifying C.CLEARKEY_UUID it plays as expected:

player.setMediaItem(
    MediaItem.Builder()
        .setUri("...")
        .setDrmConfiguration(
            DrmConfiguration.Builder(C.CLEARKEY_UUID)
                .build()
        )
        .build()
)

It looks like DashManifestParser already parses out the ClearKey UUID. It also parses out the license server URL correctly so I don't have to call setLicenseUri() on the DrmConfiguration builder

So my question is: Is it necessary to specify the DRM type when building the media item, or is there something I'm missing here?

We're on version 1.3.1. Here's a stream URL (it should be available globally, please let me know if it isn't)

https://static.nrk.no/dev/streamtests/scalcast/clearkey/dash.mpd

@icbaker
Copy link
Collaborator
icbaker commented Jun 26, 2024

Yes, this is needed so that the MediaSource is configured for the right type of DRM playback. This is mentioned at https://developer.android.com/media/media3/exoplayer/drm

@hakonschia
Copy link
Contributor Author

Thanks for the quick reply.

The docs you linked also say

and the license server URI should be specified when building a media item.

Is this a general rule that doesn't apply to DASH ClearKey? As I mentioned it seems to play without having to specify this and it uses the one found in the manifest. I'm just wondering if there is some sort of condition that will make it not use the URI in the manifest which results in video being displayed if I don't specify the URI manually in the DrmConfiguration

@icbaker
Copy link
Collaborator
icbaker commented Jun 27, 2024

Ah fair point, that wording is a bit confusing, the javadoc on MediaItem.DrmConfiguration.Builder#setLicenseUri is maybe a bit more clear that it's a 'default' (i.e. only used if the media doesn't specify a license URI [1]) and 'optional'.

I've sent a change to tighten up the wording on the docs page I linked, and also to make it clear that the code snippet in https://developer.android.com/media/media3/exoplayer/media-items#protected-content is just an example showing some fields that can be set, but not all of them need to be in all cases.

[1] WIth the caveat of this can be over-ridden with MediaItem.DrmConfiguration.Builder#setForceDefaultLicenseUri

@hakonschia
Copy link
Contributor Author

Got it, thanks!

@androidx androidx locked and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants