Amazon DrmError: MediaKeySession InvalidStateError: Promise still outstanding at MediaKeys shutdown




3 years ago
4 days ago


(Reporter: cpeterson, Assigned: cpearce)


(Blocks: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(firefox46 unaffected, firefox47 affected, firefox48 affected, firefox49 affected)




3 years ago
Amazon reports the following error

DrmError - Failed to update MediaKeySession. caused by: InvalidStateError: Promise still outstanding at MediaKeys shutdown

cpearce says:

This happens when the last reference to the MediaKeys object is dropped, and the MediaKeys object is garbage collected and shutdown. My guess would be that you've somehow dropped your last JavaScript reference to the MediaKeys object while a MediaKeySession.update() is in flight. I will experiment to see if other browsers promises keep the corresponding MediaKeys object alive in this situation.

Comment 1

3 years ago
cpearce says:

I can reproduce the "InvalidStateError: Promise still outstanding at MediaKeys shutdown" error with clearkey if I induce the to CDM crash while there's a MediaKeySession.update() promise waiting to be resolved. I have not been able to reproduce this any other way.

You would see this behaviour if the CDM crashed before you'd called HTMLMediaElement.setMediaKeys(). You can test this theory by checking whether the session's "closed" promise was unexpectedly resolved (i.e. MediaKeySession.closed resolved without you calling MediaKeySession.close() on the session first).

Note that if the CDM process crashes after you've called HTMLMediaElement.setMediaKeys(), you'll also get a decode error event fired at the video element, i.e. there's two ways a CDM crash is observable to you.

Hopefully some of the CDM crashes we've fixed will help reduce this error.

Comment 2

3 years ago
This was mostly an OS X 10.6 issue, which we no longer support. The error count has gone down.

Comment 3

3 years ago
We think Amazon has fixed this problem on their side.
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.