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

  1. Call navigator.requestMediaKeySystemAccess() with com.widevine.alpha and a list of supported configurations (codecs, robustness levels).
  2. On success, call access.createMediaKeys() to get a MediaKeys instance and attach it to the video element with setMediaKeys().
  3. Create a MediaKeySession, listen for the encrypted event on the media element, and call generateRequest() with the init data to produce a license request.
  4. Send the license request message to your license proxy/server and pass the returned response into session.update().
  5. Handle waitingforkey and session keystatuseschange events to react to expired or unusable keys during playback.

Known gotchas

Related routes

Integrate Widevine license acquisition into a browser EME player
widevine · 5 steps · unrated
Build a multi-DRM license proxy that routes FairPlay SPC, Widevine license challenge, and PlayReady license requests to the correct backend based on the requesting CDM
w3.org · 6 steps · unrated
Exchange multi-DRM content keys using CPIX 2.3 / AWS SPEKE 2.0
aws-mediapackage · 5 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans