androidx / media

Jetpack Media3 support libraries for media use cases, including ExoPlayer, an extensible media player for Android
https://developer.android.com/media/media3
Apache License 2.0
1.65k stars 390 forks source link

How to make work Live Dash DRM with rotated keys #1089

Open sergju opened 8 months ago

sergju commented 8 months ago

Version

ExoPlayer 2.18.5

Hello. We are trying to make to work live dash stream with rotated keys. The keys are equal for all resolution, but after some time change in new period. And after some playing time we have error "Crypto key not available". To play we create DashMediaSource and DefaultDrmSessionManager with multiSession=true and with own MediaDrmCallback with overridden executeKeyRequest to get license. So question how to force get new license on new period? Now it get license only on player start.

Taranlayal10 commented 7 months ago

I am also facing similar issues with some contents even if the keys are not rotated at all. We are not able to reproduce the issue at our end but this is being reported on our analytic tools.

Please suggest what could be the reason for this error.

Below is the error reported by Media3 Player and the Version used is 1.1.1

Crypto key not available: ERROR_DRM_NO_LICENSE cdm err: 0, oem err: 0, ctx: 0 ============================== Beginning of DRM Plugin Log ============================== 01-24 12:48:12.995 I found instance=clearkey version=android

icbaker commented 7 months ago

@Taranlayal10 please file a separate issue with as much info as you can provide, though without being able to repro it's unlikely we will be able to offer much help.

sergju commented 6 months ago

Is it possible to play encrypted DASH content with multiple periods? And with new keys in every period. I couldn't find test stream to test and provide manifest The most similar what I've found is this stream. But it contains only audio and it is static, not live. https://media.axprod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest_AudioOnly.mpd And it also failed after 12 minutes playing. May be my issue caption is not very correct. As I understand rotated keys is where different keys in one period, but in different qualities. But we need in multiple periods. I made some experiments and see other drmInitData in representation in newMediaChunk, but old one in trackFormat. So looks like ExoPlayer doesn't detect keys changes in new periods.