From 9bd61f667da674fb6c50b94d6ce828e2d99a50a7 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Thu, 28 Aug 2025 21:20:16 +0000 Subject: [PATCH] Improve video player controls by keeping them visible longer Extend video player control visibility by sending mouse events to the iframe when the mouse enters or moves over the player. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 2eb1084e-b728-4449-9231-f1665924c8d5 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8cc42625-c1f5-4e43-99bd-77f2c4dedee2/2eb1084e-b728-4449-9231-f1665924c8d5/Skm35EV --- client/src/components/bunny-video-modal.tsx | 35 ++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/client/src/components/bunny-video-modal.tsx b/client/src/components/bunny-video-modal.tsx index 18a115b..927db4e 100644 --- a/client/src/components/bunny-video-modal.tsx +++ b/client/src/components/bunny-video-modal.tsx @@ -258,7 +258,40 @@ export default function BunnyVideoModal({ video, isOpen, onClose, onEdit, videos
{/* Main video player */}
-
+
{ + const iframe = document.querySelector('iframe'); + if (iframe && iframe.contentWindow) { + // Trigger mouse events to keep controls visible longer + try { + iframe.contentWindow.postMessage(JSON.stringify({ method: "mousemove" }), '*'); + } catch (e) { + // Ignore errors + } + } + }} + onMouseEnter={() => { + const iframe = document.querySelector('iframe'); + if (iframe && iframe.contentWindow) { + try { + iframe.contentWindow.postMessage(JSON.stringify({ method: "mouseenter" }), '*'); + } catch (e) { + // Ignore errors + } + } + }} + onClick={() => { + const iframe = document.querySelector('iframe'); + if (iframe && iframe.contentWindow) { + try { + iframe.contentWindow.postMessage(JSON.stringify({ method: "click" }), '*'); + } catch (e) { + // Ignore errors + } + } + }} + > {video.videoUrlIframe ? (