From fa4d8ae091e51f0414c3c7a287457350e4f4f188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Tue, 5 Mar 2024 13:33:29 -0300 Subject: [PATCH] Fix: External video starting at wrong time --- .../external-video-player-graphql/component.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/external-video-player/external-video-player-graphql/component.tsx b/bigbluebutton-html5/imports/ui/components/external-video-player/external-video-player-graphql/component.tsx index b0ee433547..269e30b00c 100644 --- a/bigbluebutton-html5/imports/ui/components/external-video-player/external-video-player-graphql/component.tsx +++ b/bigbluebutton-html5/imports/ui/components/external-video-player/external-video-player-graphql/component.tsx @@ -37,6 +37,7 @@ import { EXTERNAL_VIDEO_UPDATE } from '../mutations'; import PeerTube from '../custom-players/peertube'; import { ArcPlayer } from '../custom-players/arc-player'; +import { is } from 'ramda'; const AUTO_PLAY_BLOCK_DETECTION_TIMEOUT_SECONDS = 5; @@ -288,6 +289,7 @@ const ExternalVideoPlayer: React.FC = ({ } const rate = playerRef.current?.getInternalPlayer()?.getPlaybackRate() as number ?? 1; const currentTime = playerRef.current?.getCurrentTime() ?? 0; + console.log(currentTime, 'currentTime'); sendMessage('play', { rate, time: currentTime, @@ -505,13 +507,14 @@ const ExternalVideoPlayerContainer: React.FC = () => { const currentDate = new Date(Date.now() + timeSync); const currentTime = (((currentDate.getTime() - playerUpdatedAtDate.getTime()) / 1000) + playerCurrentTime) * playerPlaybackRate; + const isPresenter = currentUser.presenter ?? false; return ( { layoutContextDispatch={layoutContextDispatch} fullscreenContext={fullscreenContext} externalVideo={externalVideo} - currentTime={currentTime} + currentTime={isPresenter ? playerCurrentTime : currentTime} key={key} setKey={setKey} />