[bugfix] Restore video playback after view-transition navigation on comfy.org - #15010
Conversation
A Chrome update broke media elements swapped in by Astro's ClientRouter: DOMParser parses the incoming page into an inert document where the media stack is never initialised, so every video/audio reports 'no supported sources' after any soft navigation. Replace swapped-in media elements with fresh live-document copies on astro:after-swap, mirroring the not-yet-released upstream fix (withastro/astro#17603), and carry the muted property across so muted autoplay loops still start.
🌐 Website E2ETip All tests passed.
🔗 Website PreviewWebsite Preview: https://comfy-website-preview-pr-15010.vercel.app This commit: https://website-frontend-29ht5al1a-comfyui.vercel.app Last updated: 2026-08-10T22:10:03Z for |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe change adds ChangesMedia reification after navigation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
blind approving, expectation is it's tested e2e |
Summary
A recent Chrome update broke every
<video>/<audio>on comfy.org when the page is reached via Astro<ClientRouter />soft navigation (e.g. /learning → a tutorial watch page): the router parses the incoming page with DOMParser into an inert document where the media stack is never initialised, so swapped-in media reportsMEDIA_ERR_SRC_NOT_SUPPORTED("no supported sources") despite a validsrc. Hard refresh works; any client-side navigation does not.Changes
reifyMediaElements()(mirrors unreleased upstream fix Fix video and audio elements broken after view transition navigation withastro/astro#17603) that replaces swapped-in media elements with freshdocument.createElement()copies, run onastro:after-swapinBaseLayout.astro— synchronously before Vue island hydration, soVideoPlayer.vuehydrates onto the live elements. Also copies themutedproperty across (setAttribute('muted')only setsdefaultMuted), without which muted autoplay loops stay blocked; upstream's fix has this gap. Unit tests cover attribute/child/muted copying and element position.Review Focus
astro:after-swapfires synchronously after the swap, before island hydration microtasks run, so Vue never binds to the stale elements. Verified in Chromium: watch-page autoplay + custom controls, and home-page scroll-triggered loops all behave identically to a hard load after soft navigation.