handle Chrome's autoplay policy for WebRTC audio/video playback

domain: developer.chrome.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Attempt to attach the remote MediaStream to an audio/video element or AudioContext as soon as it's available.
  2. Detect blocked autoplay by checking AudioContext.state (it stays 'suspended' instead of moving to 'running' if blocked) or by catching the play() promise rejection on media elements.
  3. Fall back to a muted state initially if unmuted playback is blocked — muted autoplay is always allowed.
  4. Prompt for, or wait on, a user gesture (click/tap) and call resume()/play() again inside that gesture handler to unblock audio.
  5. Account for per-domain Media Engagement Index behavior — a user who has previously played audio with sound on your domain may not hit the restriction at all.

Known gotchas

Related routes

Enable WebRTC simulcast with VP8 spatial layers in a browser sender using RTCRtpSendParameters
developer.mozilla.org · 5 steps · unrated
Configure WebRTC WHEP egress on a media server for low-latency viewer playback
datatracker.ietf.org · 6 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