From 1e453e22da965edbc18620ad93781a1432197a31 Mon Sep 17 00:00:00 2001 From: sebastjanartic <45803536-sebastjanartic@users.noreply.replit.com> Date: Fri, 26 Sep 2025 14:00:32 +0000 Subject: [PATCH] Improve live video player initialization logic Update LivePage.tsx to ensure proper video element mounting and initialization of the Video.js player when the element changes. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 45a1dcfc-f8a2-475a-a6b9-96fbb841dc27 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/60d372ff-2c10-46c7-b01b-10c3435136b0/45a1dcfc-f8a2-475a-a6b9-96fbb841dc27/FiYsh04 --- .replit | 4 ++++ client/src/pages/LivePage.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.replit b/.replit index cd990cf..aa0a35f 100644 --- a/.replit +++ b/.replit @@ -23,6 +23,10 @@ externalPort = 3001 localPort = 35637 externalPort = 3000 +[[ports]] +localPort = 45389 +externalPort = 3002 + [env] PORT = "5000" diff --git a/client/src/pages/LivePage.tsx b/client/src/pages/LivePage.tsx index e9ed8cf..29b47d7 100644 --- a/client/src/pages/LivePage.tsx +++ b/client/src/pages/LivePage.tsx @@ -48,8 +48,8 @@ export default function LivePage() { // Callback ref to properly handle video element mounting const videoCallbackRef = (element: HTMLVideoElement | null) => { - if (element) { - videoRef.current = element; + if (element && element !== videoRef.current) { + (videoRef as any).current = element; console.log('🔴 Video element mounted, initializing player...'); initializePlayer(); }