ExoPlayer
ExoPlayer copied to clipboard
Issue playing HLS CMAF with Widevine
ExoPlayer Version
2.18.1
Devices that reproduce the issue
OnePlus 6 A6003 - Android 11 Samsung SM-A405FN - Android 10
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Yes
Reproduction steps
In the demo app I added an HLS CMAF stream and the correct DRM License URI. (info sent by mail) (I also added a dash stream with the same configuration from the same packager)
Expected result
The media should play properly
Actual result
Playback fails and the log shows:
E/EventLogger: playerFailed [eventTime=2.13, mediaPos=48.00, window=0, period=0, errorCode=ERROR_CODE_DRM_SYSTEM_ERROR com.google.android.exoplayer2.ExoPlaybackException: MediaCodecAudioRenderer error, index=1, format=Format(audio_0:français, français, null, audio/mp4a-latm, mp4a.40.2, -1, fr, [-1, -1, -1.0], [2, 48000]), format_supported=YES at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:566) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:233) at android.os.HandlerThread.run(HandlerThread.java:67) Caused by: android.media.MediaCodec$CryptoException: Crypto key not available at android.media.MediaCodec.native_queueSecureInputBuffer(Native Method) at android.media.MediaCodec.queueSecureInputBuffer(MediaCodec.java:2830) at com.google.android.exoplayer2.mediacodec.SynchronousMediaCodecAdapter.queueSecureInputBuffer(SynchronousMediaCodecAdapter.java:149) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:1358) at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:794) at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:989) at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:490) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:233) at android.os.HandlerThread.run(HandlerThread.java:67) ]
Media
info sent by mail
I do not think it is a dupliacte of https://github.com/google/ExoPlayer/issues/10462 as the error messages are different.
Bug Report
- [X] You will email the zip file produced by
adb bugreportto [email protected] after filing this issue.
I can reproduce the issue. @rrfrias Would you mind taking a look to see where the DRM error is coming from? The stream link and license server setup has been sent via email.
Quick update, if I change the packager setup to SPEKEv1, it plays for a while (about 3 chunks it seems) then fails with the same error.
It seems the issue is https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/MediaItem.DrmConfiguration.Builder.html#setMultiSession(boolean) When it s set to true it seems to work.
So my stream had a different init vector for the video and audio encryption, in this case I had to manually set MultiSession to true. Could you improve that so that Exoplayer does that automatically?
Sorry, i lost track of this. @tonihei based on the last two responses is this something that you can handle? Let us know if you need assistance from us.
Could you improve that so that Exoplayer does that automatically?
That's unfortunately not that easy because it may cause additional work in some scenarios. https://github.com/google/ExoPlayer/issues/8367 has some good explanations for these cases. If you know how your media is produced, you can likely choose the most appropriate setting for your media.