Widevine DRM InvalidResponseCodeException: Response code: 404
See original GitHub issueSearched documentation and issues
I was looking to the ExoPlayer documentations and on GitHub’s issues.
Introduction
The problem occurs on a custom made device, which name I can’t tell (and I can’t tell you if it is certified or not), the device run Android 9, it’s new stick device. ExoPlayer version 2.9.6. We play content with Widevine’s DRM solution and it works on every other “production ready” devices (TVs) with DRM support like Sony 4K TVs. But on our “custom device” we have an error and don’t understand the real cause of it.
On the code level we can’t see execution of method executeKeyRequest
, but only executeProvisionRequest
(same as in ExoPlayer example project, in class HttpMediaDrmCallback), where the request.getDefaultUrl()
is equal to https://www.googleapis.com/certificateprovisioning/v1/devicecertificates/create?key=xxx
.
Question
Why is it happening? Does the device missing the Widevine certification on a factory level, or certification missed for our app x.y.z
? What should we do and where to read about Android Pie Widevide DRM support/implementation?
We can’t provide manifest, but it’s Dash.
A full bug report captured from the device
E/ExoPlayerImplInternal: Playback error.
com.google.android.exoplayer2.ExoPlaybackException: com.google.android.exoplayer2.drm.DrmSession$DrmSessionException: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.shouldWaitForKeys(MediaCodecRenderer.java:1039)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.feedInputBuffer(MediaCodecRenderer.java:990)
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.render(MediaCodecRenderer.java:665)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:529)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:300)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.drm.DrmSession$DrmSessionException: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404
at com.google.android.exoplayer2.drm.DefaultDrmSession.onError(DefaultDrmSession.java:447)
at com.google.android.exoplayer2.drm.DefaultDrmSession.onProvisionError(DefaultDrmSession.java:240)
at com.google.android.exoplayer2.drm.DefaultDrmSessionManager.onProvisionError(DefaultDrmSessionManager.java:610)
at com.google.android.exoplayer2.drm.DefaultDrmSession.onProvisionResponse(DefaultDrmSession.java:312)
at com.google.android.exoplayer2.drm.DefaultDrmSession.access$000(DefaultDrmSession.java:45)
at com.google.android.exoplayer2.drm.DefaultDrmSession$PostResponseHandler.handleMessage(DefaultDrmSession.java:474)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
Caused by: com.google.android.exoplayer2.upstream.HttpDataSource$InvalidResponseCodeException: Response code: 404
at com.google.android.exoplayer2.ext.okhttp.OkHttpDataSource.open(OkHttpDataSource.java:176)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.checkOpened(DataSourceInputStream.java:102)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:82)
at com.google.android.exoplayer2.upstream.DataSourceInputStream.read(DataSourceInputStream.java:76)
at com.google.android.exoplayer2.util.Util.toByteArray(Util.java:140)
at com.massiveinteractive.mdk.video.exoplayer.drm.AdvancedHttpMediaDrmCallback.executePost(AdvancedHttpMediaDrmCallback.java:135)
at com.massiveinteractive.mdk.video.exoplayer.drm.AdvancedHttpMediaDrmCallback.executeProvisionRequest(AdvancedHttpMediaDrmCallback.java:67)
at com.google.android.exoplayer2.drm.DefaultDrmSession$PostRequestHandler.handleMessage(DefaultDrmSession.java:508)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.os.HandlerThread.run(HandlerThread.java:65)
D/SurfaceUtils: disconnecting from surface 0x805fc808, reason disconnectFromSurface
E/libc: Access denied finding property "media.metrics.enabled"
E/libc: Access denied finding property "media.metrics.enabled"
I/ExoPlayerImpl: Release d8e3767 [ExoPlayerLib/2.9.6] [DV6067Y, OTT-G1, SDMC, 28] [goog.exo.core, goog.exo.ui, goog.exo.dash, goog.exo.okhttp]
And code from where exception is fired: AdvancedHttpMediaDrmCallback.java:135 is the same as in example ExoPlayer project in class HttpMediaDrmCallback:
return Util.toByteArray(inputStream);
Issue Analytics
- State:
- Created 4 years ago
- Comments:26 (5 by maintainers)
Top GitHub Comments
In my initial response I was asking @rrfrias to take a look at this. Burying this under three further posts on the issue likely confused things.
@rrfrias , @fredgc - Please could you respond to my question above? Thanks!
We found the problem and fixed the issue. It was because of the second parameter in
executePost(url, null, null);
inexecuteProvisionRequest
, thedata
parameter, had valuenull
, but it has to beUtil.EMPTY_BYTE_ARRAY
, not sure why it’s an issue on Android 9.