Implement client-side DRM license requests for Widevine-protected playback using the Encrypted Media Extensions (EME) API
domain: developer.mozilla.org · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Call navigator.requestMediaKeySystemAccess() with com.widevine.alpha and a list of supported configurations (codecs, robustness levels).
On success, call access.createMediaKeys() to get a MediaKeys instance and attach it to the video element with setMediaKeys().
Create a MediaKeySession, listen for the encrypted event on the media element, and call generateRequest() with the init data to produce a license request.
Send the license request message to your license proxy/server and pass the returned response into session.update().
Handle waitingforkey and session keystatuseschange events to react to expired or unusable keys during playback.
Known gotchas
requestMediaKeySystemAccess() must be called from a secure context (HTTPS) or the promise rejects immediately.
Widevine has multiple security levels (hardware-backed vs. software-only); content restricted to a higher level won't play on devices that only support a lower one.
The license request/response payloads are opaque binary blobs from the CDM; the application only relays them between the browser and the license server.
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?