diff --git a/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx b/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx index d49a7387..36fcacfe 100644 --- a/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx +++ b/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx @@ -47,14 +47,24 @@ const VideoPlayer: React.FC = ({ const isValidPoster = mediaPosterUrl && mediaPosterUrl !== 'None' && mediaPosterUrl.trim() !== ''; const posterImage = isValidPoster ? mediaPosterUrl : (isAudioFile ? AUDIO_POSTER_URL : undefined); - // Detect iOS device + // Detect iOS device and Safari browser useEffect(() => { const checkIOS = () => { const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera; return /iPad|iPhone|iPod/.test(userAgent) && !(window as any).MSStream; }; + const checkSafari = () => { + const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera; + return /Safari/.test(userAgent) && !/Chrome/.test(userAgent) && !/Chromium/.test(userAgent); + }; + setIsIOS(checkIOS()); + + // Store Safari detection globally for other components + if (typeof window !== 'undefined') { + (window as any).isSafari = checkSafari(); + } // Check if video was previously initialized if (typeof window !== 'undefined') { @@ -345,7 +355,7 @@ const VideoPlayer: React.FC = ({
{/* iOS First-play indicator - only shown on first visit for iOS devices when not initialized */}