The Navigator.requestMediaKeySystemAccess()
method returns a Promise
for a MediaKeySystemAccess
object.
Syntax
Navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations).then(function(mediaKeySystemAccess) { ... });
Parameters
- keySystem
- A
DOMString
identifier of the key system. For examplecom.example.somesystem
ororg.w3.clearkey
. - supportedConfigurations
- A non-empty
Array
ofMediaKeySystemConfiguration
objects. The first element with a satisfiable configuration will be used.
Return value
A Promise
that resolves to a MediaKeySystemAccess
object. If the given keySystem
is not supported or none of the the requested configurations are satisfiable, the returned Promise
is rejected with a DOMException
whose name is NotSupportedError
.
Specifications
Specification | Status | Comment |
---|---|---|
Encrypted Media Extensions The definition of 'requestMediaKeySystemAccess()' in that specification. |
Working Draft | Initial definition |
Browser compatibility
[1] The spec requires that the passed supportedConfigurations option contain at least one of audioCapabilities or videCapabilities, and that said parameters include a codec string. This was not enforced until Chrome 58/Opera45.