Skip to content

Commit 43ee67d

Browse files
ChengaDevclaude
andcommitted
Fix arena video not playing in production
React does not reliably set muted/loop/playsInline DOM attributes via JSX props on video elements. Set them imperatively via ref before calling play() so the browser correctly identifies the video as muted and allows autoplay. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1dee4f0 commit 43ee67d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/LandingPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ const LandingPage: React.FC = () => {
131131
const id = setTimeout(() => {
132132
const v = videoRef.current
133133
if (!v) return
134+
// React doesn't reliably set the muted/loop DOM attributes via props —
135+
// set them imperatively so the browser allows autoplay.
136+
v.muted = true
137+
v.loop = true
138+
v.playsInline = true
134139
v.src = '/arena.mp4'
135140
v.load()
136141
v.play().catch(() => {/* autoplay blocked — video stays hidden */})
@@ -148,7 +153,7 @@ const LandingPage: React.FC = () => {
148153
<PageWrapper>
149154
{/* ── HERO ── */}
150155
<HeroSection>
151-
<ArenaVideo ref={videoRef} muted loop playsInline aria-hidden="true" />
156+
<ArenaVideo ref={videoRef} aria-hidden="true" />
152157
<ArenaOverlay />
153158

154159
<HeroTitle>{locals.landingHeroTitle}</HeroTitle>

0 commit comments

Comments
 (0)