Commit 6cb029d8 by ojw28

Merge pull request #818 from pakerfeldt/on-drm-session-ready

Add onDrmSessionReady callback
parents 765d1659 95db1eac
......@@ -51,6 +51,12 @@ public class StreamingDrmSessionManager implements DrmSessionManager {
public interface EventListener {
/**
* Invoked when DRM keys have been loaded. Depending on license setup, this might occur multiple
* times during playback.
*/
void onKeysLoaded();
/**
* Invoked when a drm error occurs.
*
* @param e The corresponding exception.
......@@ -386,6 +392,14 @@ public class StreamingDrmSessionManager implements DrmSessionManager {
try {
mediaDrm.provideKeyResponse(sessionId, (byte[]) response);
state = STATE_OPENED_WITH_KEYS;
if (eventHandler != null && eventListener != null) {
eventHandler.post(new Runnable() {
@Override
public void run() {
eventListener.onKeysLoaded();
}
});
}
} catch (Exception e) {
onKeysError(e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment