diff --git a/frontend-tools/chapters-editor/client/src/components/IOSVideoPlayer.tsx b/frontend-tools/chapters-editor/client/src/components/IOSVideoPlayer.tsx index e5bd3f48..b67093e0 100644 --- a/frontend-tools/chapters-editor/client/src/components/IOSVideoPlayer.tsx +++ b/frontend-tools/chapters-editor/client/src/components/IOSVideoPlayer.tsx @@ -13,6 +13,7 @@ const IOSVideoPlayer = ({ videoRef, currentTime, duration }: IOSVideoPlayerProps const [videoUrl, setVideoUrl] = useState(''); const [iosVideoRef, setIosVideoRef] = useState(null); const [posterImage, setPosterImage] = useState(undefined); + const [isAudioFile, setIsAudioFile] = useState(false); // Refs for hold-to-continue functionality const incrementIntervalRef = useRef(null); @@ -41,12 +42,13 @@ const IOSVideoPlayer = ({ videoRef, currentTime, duration }: IOSVideoPlayerProps setVideoUrl(url); // Check if the media is an audio file and set poster image - const isAudioFile = url.match(/\.(mp3|wav|ogg|m4a|aac|flac)$/i) !== null; + const audioFile = url.match(/\.(mp3|wav|ogg|m4a|aac|flac)$/i) !== null; + setIsAudioFile(audioFile); // Get posterUrl from MEDIA_DATA, or use audio-poster.jpg as fallback for audio files when posterUrl is empty, null, or "None" const mediaPosterUrl = (typeof window !== 'undefined' && (window as any).MEDIA_DATA?.posterUrl) || ''; const isValidPoster = mediaPosterUrl && mediaPosterUrl !== 'None' && mediaPosterUrl.trim() !== ''; - setPosterImage(isValidPoster ? mediaPosterUrl : (isAudioFile ? AUDIO_POSTER_URL : undefined)); + setPosterImage(isValidPoster ? mediaPosterUrl : (audioFile ? AUDIO_POSTER_URL : undefined)); }, [videoRef]); // Function to jump 15 seconds backward @@ -128,22 +130,34 @@ const IOSVideoPlayer = ({ videoRef, currentTime, duration }: IOSVideoPlayerProps - {/* iOS-optimized Video Element with Native Controls */} - + {/* Video container with persistent background for audio files */} +
+ {/* Persistent background image for audio files (Safari fix) */} + {isAudioFile && posterImage && ( + {/* iOS Video Skip Controls */}
diff --git a/frontend-tools/chapters-editor/client/src/components/VideoPlayer.tsx b/frontend-tools/chapters-editor/client/src/components/VideoPlayer.tsx index 1fc874d2..75dc6515 100644 --- a/frontend-tools/chapters-editor/client/src/components/VideoPlayer.tsx +++ b/frontend-tools/chapters-editor/client/src/components/VideoPlayer.tsx @@ -353,8 +353,18 @@ const VideoPlayer: React.FC = ({ return (
+ {/* Persistent background image for audio files (Safari fix) */} + {isAudioFile && posterImage && ( + - {/* iOS-optimized Video Element with Native Controls */} - + {/* Video container with persistent background for audio files */} +
+ {/* Persistent background image for audio files (Safari fix) */} + {isAudioFile && posterImage && ( + {/* iOS Video Skip Controls */}
diff --git a/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx b/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx index 36fcacfe..1c238ea7 100644 --- a/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx +++ b/frontend-tools/video-editor/client/src/components/VideoPlayer.tsx @@ -353,8 +353,18 @@ const VideoPlayer: React.FC = ({ return (
+ {/* Persistent background image for audio files (Safari fix) */} + {isAudioFile && posterImage && ( +