MediaKeySession object
Represents a session with the Digital Rights Management (DRM) key system.
Syntax
var session = oMediaKeys.createSession(type, initData, cdmData);
DOM Information
Inheritance Hierarchy
The MediaKeySession does not inherit from any class or interface.Members
The MediaKeySession object has these types of members:
Events
The MediaKeySession object has these events.
| Event | Description |
|---|---|
| keystatuseschange |
Fired when there has been a change in the keys in the session or their status. |
| message |
Fired when the CDM has generated a message for the session. |
| mskeyadded |
Deprecated. Occurs after a call to update and a key has been added. |
| mskeyerror |
Deprecated. Occurs when a there is an error in the key session. |
| mskeymessage |
Deprecated. Occurs when a key message has been generated. |
Methods
The MediaKeySession object has these methods.
| Method | Description |
|---|---|
| close |
Closes the media key session and release any resources associated with it. |
| generateRequest |
Generates a request based on the initialization data. |
| load |
Loads the data stored for the specified session. |
| remove |
Removes stored session data. |
| update |
Sends messages, including licenses, to the Content Decryption Module. |
Properties
The MediaKeySession object has these properties.
| Property | Access type | Description |
|---|---|---|
|
Read-only |
Signals when a MediaKeySession object closes. | |
|
Read-only |
Deprecated. Gets the error state associated with the media key session. | |
|
Read-only |
The time after which the keys in the current session will expire and can no longer be used to decrypt media data, or NaN if no such time exists. | |
|
Read-only |
A reference to a read-only map of current session's key IDs and their statuses. | |
|
Read-only |
The identification string that identifies the media key session. |
Standards information
Remarks
As of Microsoft Edge, the unprefixed version of MediaKeySession is supported. MSMediaKeySession is still supported in IE11. For more information on EME implementation updates in Microsoft Edge, see Encrypted Media Extensions updates.
An application can potentially have multiple sessions activate with the key system.