Open stevemayhew opened 1 week ago
Note, the API would allow the MultiDRM License Server to implement an HTTP Challenge like scheme for authentication
FWIW Shaka Player provides this via a relatively low level API, Shaka License Server Authentication. It should be possible to do something in ExoPlayer's HttpMediaDrmCallback
that is as versatile without being as invasive.
Use case description
Access to MultiDRM license servers is prudently protected by client authentication headers. With Widevine Proxy server the proxy is able to authenticate the caller and reject it or respond by forwarding the request to Google's widevine server. One common use case would be signaling a HTTP 401 status.
ExoPlayer provides for error recovery via the
LoadErrorHandlingPolicy
, calling thegetRetryDelayMsFor()
when the request fails, however there is no provision for returning anything other than a delay value.Note this license request is often issued while there is significant buffered content, so being able to recover in-place saves a lot of time.
Proposed solution
Add an optional method to
LoadErrorHandlingPolicy
interface, like:This would be used, for example to update any short-lived login token in the request headers. Obviously this is just an idea to riff on, as the ultimate source of the header values is the
MediaItem.DrmConfiguration
. TheMediaItem
is far distanced from the point of the load error detectionAlternatives considered
The only alternative with the current code base (that I can see) is to not retry, and completely restart playback with an updated
MediaItem
from outside of ExoPlayer code.