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

Load persistent sessions #2451

Conversation

bbert
Copy link
Contributor

@bbert bbert commented Mar 2, 2018

This PR adds support for persistent MediaKeySession loading.
This can be operated on chrome since chrome and Widevine CDM now support persistent sessions.

With this PR, if your license server can deliver persistent licences, you can configure the stream protection data to setup key system access with support of persistent licenses:

  protData = {
    "com.widevine.alpha": {
      "sessionType": "persistent-license"
    }
  }

Once such kind of stream is loaded and a persistent license is obtained, the session ID can be reused, when playing the same stream, to load a MediaKeySession with the persistent session ID, instead of creating a new MediaKeySession and request again the license.

The dash-if-reference sample provides functionnality to playback a session with a persistent session ID.
Once a protected stream has been playback with a persistent license, the application stores the persistent session ID for the stream. Then, in the same browser tab instance, if the same stream is loaded, the persistent session ID will be reused and loaded, avoiding requesting a new license.

A sample test stream is provided: "Other samples / Unified Streaming (Widevine, persistent)"

Bertrand Berthelot added 13 commits March 1, 2018 16:56
…persistent session id from protectionData or contentProtection
- create session token before loading the session
- provide initData associated with sessionId to enable checking if initData has already been seen before loading the same session ID
…already loaded or loading session ID (to avoid QuotaExceededError)
@bbert
Copy link
Contributor Author

bbert commented Mar 2, 2018

Please note that in this PR, the dash-if-reference sample provides a new button 'Stop' in order to properly stop and reset the protection module (i.e. close the MediaKeySessions), before loading the same stream and same persistent session.
Indeed, when loading a new stream, dash.js does not wait for MediaKeySessions of previous stream to be fully closed. Then if we a load the same stream with same persistent session ID before MediaKeySession is closed, the MediaKeySession will fail to open (QuotaExceededError).

Maybe we should modify dash.js to wait for MediaKeySession to be closed before loading a new stream. This can be subject to another PR.

@epiclabsDASH epiclabsDASH modified the milestones: v2.6.7, 2.6.8 Mar 5, 2018
@epiclabsDASH
Copy link
Contributor

@bbert, would it make sense moving the new stop button to the DRM options section? Other than that PR looks nice.

@bbert
Copy link
Contributor Author

bbert commented Apr 3, 2018

@epiclabsDASH the new stop button can be useful for other needs.
We had no mean until then to stop/reset the current stream, without loading a new stream.
Moving it to DRM options section would disturb the understanding of the meaning of this button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants