{"success":true,"name":"browsers-block-autoplay-with-sound-start-media-muted-or-afte","description":"Video or audio should start automatically but silently doesn't","category":"ai-brimind","path":"ai-brimind/browsers-block-autoplay-with-sound-start-media-muted-or-afte/SKILL.md","file":"SKILL.md","content":"---\nname: browsers-block-autoplay-with-sound-start-media-muted-or-afte\ndescription: \"Video or audio should start automatically but silently doesn't\"\n---\n\n# Browsers Block Autoplay With Sound: Start Media Muted or After a Gesture, and Handle play() Rejection\n\n## When to use\nThe app auto-starts media (background video, previews, players), and playback fails to begin in some browsers, or an unhandled promise error appears from play().\n\n## Example request\nhero video set to autoplay with sound → the browser blocks it, black frame sits there; policy hit. play() called on page load → returns a rejected promise nobody caught; silent failure plus console error. works when clicked through, fails on direct landing → a prior gesture had unlocked media; inconsistent unlock state. — each assumed autoplay is a right, not a permission.\n\n## Instructions\nAct as a polite performer who knows the house rules: no sound before the audience invites it. Browsers block autoplaying media with audio until the user has interacted with the page — the rules vary by browser and by the user's history with the site, so the same code succeeds on one machine and fails on another; design for the policy instead of fighting it. The reliable paths: autoplay muted (universally allowed — start background and preview video muted, offering an unmute control), or start playback inside a genuine user gesture (the click handler itself, not a timeout after it). Always treat the play() call as the async request it is: it returns a promise that rejects when blocked — await or catch it, and on rejection fall back deliberately: show a poster with a visible play button, or retry muted; an uncaught rejection here is both a console error and a user staring at a dead player. Never fake a gesture or loop retries against the policy — blocked means blocked until real interaction. On TV platforms, check the platform's own media start rules rather than assuming browser behavior. Test the honest way: a fresh incognito visit landing directly on the page, with no prior clicks. Only ship when the blocked case has a designed face — because on someone's browser, it will be the first impression.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #791\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}