navigator.requestMediaKeySystemAccess(keySystem, supportedConfigurations) is the Encrypted Media Extensions (EME) entry point. It returns a Promise that resolves to a MediaKeySystemAccess object used to create keys for decrypting protected media (MDN).
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call navigator.requestMediaKeySystemAccess. Start with this line.
Promise rejects. Name is TypeError (also for empty keySystem).
Validate first. Always send at least one config object.
Separate from NotSupportedError. That means “valid args, but platform cannot satisfy.”
Compatibility
Browser Support
Navigator.requestMediaKeySystemAccess() is part of Encrypted Media Extensions. MDN lists it as Baseline Widely available (since March 2019). Requires a secure context.
✓ Baseline · EME
Navigator.requestMediaKeySystemAccess()
Widely available for Clear Key and platform DRM. Actual commercial key-system ids still vary — feature-detect and catch NotSupportedError.
It asks the browser for access to a media key system (DRM / Clear Key). If a matching configuration is supported, the Promise resolves to a MediaKeySystemAccess object you can use to create MediaKeys for decrypting encrypted media.
No. MDN marks it Baseline Widely available (since March 2019). It is not Deprecated, Experimental, or Non-standard. It does require a secure context (HTTPS / localhost).
Clear Key is a simple key system defined for EME testing and non-proprietary encrypted media. Real streaming services often use commercial systems such as Widevine, PlayReady, or FairPlay (browser-dependent).
Near the time you will create and use MediaKeys — not randomly on page load. The call may trigger user-visible permission or resource prompts.
The Promise rejects with NotSupportedError when the key system is missing or none of the supportedConfigurations can be satisfied (for example unsupported codecs).
Either audioCapabilities or videoCapabilities may be empty, but not both. Each capability needs a valid contentType MIME string (include codecs parameters when required).