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
|
// Force play background video
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (videoRef.current) {
|
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 already ready, set loaded immediately
|
||||||
if (videoRef.current.readyState >= 3) {
|
if (videoRef.current.readyState >= 3) {
|
||||||
setIsVideoLoaded(true);
|
setIsVideoLoaded(true);
|
||||||
@ -258,6 +264,8 @@ export function UserHeader({ user, preferences, onModalStateChange }: UserHeader
|
|||||||
muted
|
muted
|
||||||
playsInline
|
playsInline
|
||||||
preload="auto"
|
preload="auto"
|
||||||
|
controls={false}
|
||||||
|
onContextMenu={(e) => e.preventDefault()}
|
||||||
poster="/videos/smoke-poster.jpg"
|
poster="/videos/smoke-poster.jpg"
|
||||||
onCanPlayThrough={() => setIsVideoLoaded(true)}
|
onCanPlayThrough={() => setIsVideoLoaded(true)}
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user