Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error closing session DOMException: The session is not callable #664

Closed
sanbornhilland opened this issue Jan 25, 2017 · 1 comment
Closed
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly

Comments

@sanbornhilland
Copy link
Contributor

sanbornhilland commented Jan 25, 2017

Reproduced using v2.0.3.
I have not tried reproducing with v2.0.4.

This is reproducible consistently in our app but I have not yet been able to reproduce this in the Shaka sample app.

OSX 10.12, Chrome 55.0.2883.95

This appears to happen when rapidly loading Widevine protected content.

  1. Load some WV protected content. Wait for playback to begin.
  2. Rapidly load the same content (2-5x)
  3. Content is loaded but player stalls and nothing plays. This is unrecoverable.

What appears to be happening is that we can get the player into a state where the unloadPromise in shaka.Player.prototype.load never resolves and therefore the load process never gets initiated.

I've traced this back to the drmEngine not shutting down properly. Occasionally for some reason activeSession.session.close() gets rejected with the error: "Error closing session DOMException: The session is not callable". When this happens, activeSession.session.closed never resolves and the whole unload chain just hangs.

I made the following change:

    activeSession.session.close().catch(Functional.noop);
    goog.asserts.assert(activeSession.session.closed, 'Bad EME implementation');
    return activeSession.session.closed;
    var p = activeSession.session.close().catch(Functional.noop);
    goog.asserts.assert(activeSession.session.closed, 'Bad EME implementation');
    return p;

This seems to solve the issue but it's unclear to me why. I can see that p !== activeSession.session.closed but I'm not yet familiar with this activeSession.session.closed promise or what it is so I'm not sure if it is appropriate to return p or not.

I'll try to come up with reliable reproduction steps for the sample app but so far I have not been able to. Something about the specific timing of the shaka.load() calls in our app seems to be hitting a sweet spot.

@TheModMaker TheModMaker self-assigned this Jan 26, 2017
@TheModMaker TheModMaker added the type: bug Something isn't working correctly label Jan 26, 2017
@TheModMaker
Copy link
Contributor

TheModMaker commented Jan 26, 2017

I was able to reproduce by modifying the demo app. Using the uncompiled version and making the demo reload inside DrmEngine caused the problem. Thanks for the report and the solution.

Basically both session.closed and session.close() refer to the same event but are different Promise objects. So in this case they can be used interchangeably.

joeyparrish pushed a commit that referenced this issue Jan 28, 2017
If a session has been created but the license request hasn't been sent,
the session is not "callable".  This will cause the |session.close()|
to be rejected and the |session.closed| Promise to never resolve.  So
in DrmEngine.destroy, we should be using the Promise returned from
|session.close()| instead of |session.closed|.  The |session.close()|
Promise will only resolve once the |session.closed| Promise is resolved
so they are effectively the same.

Closes #664

Change-Id: Ia619740d1eb3fa8ca1bdf121574d1efb1ddbea26
@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

3 participants