From 166dafc2178ce008a923d9621bb8c8eb83d2b79e Mon Sep 17 00:00:00 2001 From: Dmitri Date: Thu, 30 Apr 2026 12:14:34 +0200 Subject: [PATCH] Fixed play button appearing for background videos in iPhones. --- .../Constructor/CanvasBackground.tsx | 7 +- .../components/Runtime/RuntimeControls.tsx | 37 +++++-- .../src/components/RuntimePresentation.tsx | 41 +++++-- frontend/src/css/main.css | 70 +++++++++--- frontend/src/hooks/useVideoSoundControl.ts | 100 ++++++++++++++++++ frontend/src/pages/constructor.tsx | 11 +- 6 files changed, 231 insertions(+), 35 deletions(-) create mode 100644 frontend/src/hooks/useVideoSoundControl.ts diff --git a/frontend/src/components/Constructor/CanvasBackground.tsx b/frontend/src/components/Constructor/CanvasBackground.tsx index 1c42966..1a4a773 100644 --- a/frontend/src/components/Constructor/CanvasBackground.tsx +++ b/frontend/src/components/Constructor/CanvasBackground.tsx @@ -176,7 +176,11 @@ const CanvasBackground: React.FC = ({ isFadingIn={isFadingIn} /> - {/* Background video - z-1 keeps it below backdrop blur layer (z-5) */} + {/* Background video - z-1 keeps it below backdrop blur layer (z-5) + Note: muted attribute is always true for iOS autoplay compatibility. + Actual muted state is controlled via useBackgroundVideoPlayback hook + which sets video.muted property via JavaScript (useEffect). + webkit-playsinline is legacy attribute for older iOS versions. */} {backgroundVideoUrl && (