UI: Critical fix for PWA/Safari video playback - programmatic initialization and 30fps optimization
This commit is contained in:
parent
485f7a1e32
commit
5795fd0468
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
@ -139,6 +139,12 @@ export function UserHeader({ user, preferences, onModalStateChange }: UserHeader
|
||||
// Force play background video
|
||||
useEffect(() => {
|
||||
if (videoRef.current) {
|
||||
// Programmatic attributes for iOS Safari / PWA compatibility
|
||||
videoRef.current.muted = true;
|
||||
videoRef.current.defaultMuted = true;
|
||||
videoRef.current.playsInline = true;
|
||||
videoRef.current.loop = true;
|
||||
|
||||
// If already ready, set loaded immediately
|
||||
if (videoRef.current.readyState >= 3) {
|
||||
setIsVideoLoaded(true);
|
||||
@ -258,6 +264,8 @@ export function UserHeader({ user, preferences, onModalStateChange }: UserHeader
|
||||
muted
|
||||
playsInline
|
||||
preload="auto"
|
||||
controls={false}
|
||||
onContextMenu={(e) => e.preventDefault()}
|
||||
poster="/videos/smoke-poster.jpg"
|
||||
onCanPlayThrough={() => setIsVideoLoaded(true)}
|
||||
className={cn(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user