diff --git a/apps/web/components/hero-video.tsx b/apps/web/components/hero-video.tsx index 8649050..4b34ee2 100644 --- a/apps/web/components/hero-video.tsx +++ b/apps/web/components/hero-video.tsx @@ -1,72 +1,84 @@ 'use client'; -import { Play, Volume2, VolumeX } from 'lucide-react'; +import { ExternalLink, Play, Volume2, VolumeX } from 'lucide-react'; import { useCallback, useEffect, useRef, useState } from 'react'; /** - * Hero video player with two controls: + * Hero video player tuned for the stubborn-autoplay cases we hit in + * the field (Chrome with prefers-reduced-motion, data saver, etc.). * - * 1. Big PLAY overlay shown while the video is paused. Browsers - * block autoplay for users with `prefers-reduced-motion`, on data - * saver, or with strict autoplay policies — so the poster sits - * there forever and the visitor thinks the page is broken. The - * overlay gives them an explicit, unmissable affordance to start - * it. We also wire `onClick` on the - {/* Centre PLAY button — shown only while paused. Covers the - whole video so clicking anywhere starts playback; the inner - circle is the visual affordance. */} + {/* PLAY overlay — visible while paused. Full-frame so clicking + anywhere starts playback (YouTube / Vimeo pattern). */} {!playing && ( )} - {/* Mute toggle — always visible, top of z-stack so it stays - clickable even when the play overlay is up. */} + {/* Fallback escape hatch — surfaces only if .play() rejects even + after a user gesture (extension sandbox, hardware-decoder + failures, etc.). One-line link to the raw MP4 so the visitor + isn't trapped staring at a poster forever. */} + {playFailed && !playing && ( + + your browser blocked playback — open the video directly + + + )} + + {/* Mute toggle — always visible, top of z-stack. */}