diff --git a/server/src/plugins/watch-together/index.ts b/server/src/plugins/watch-together/index.ts index 66363ea..9601dc8 100644 --- a/server/src/plugins/watch-together/index.ts +++ b/server/src/plugins/watch-together/index.ts @@ -459,7 +459,12 @@ async function handleMessage(client: WtClient, msg: any): Promise { if (!client.roomId) return; const room = rooms.get(client.roomId); if (!room) return; + // Only accept time reports from the host to avoid conflicts + // when multiple users report different times if (room.hostId !== client.id) return; + // Ignore if a seek happened recently (within 2s) to prevent overwriting + const timeSinceSync = Date.now() - room.lastSyncAt; + if (timeSinceSync < 2000) return; room.currentTime = Number(msg.time) || 0; room.lastSyncAt = Date.now(); break; diff --git a/web/src/plugins/watch-together/WatchTogetherTab.tsx b/web/src/plugins/watch-together/WatchTogetherTab.tsx index 317a53f..1655031 100644 --- a/web/src/plugins/watch-together/WatchTogetherTab.tsx +++ b/web/src/plugins/watch-together/WatchTogetherTab.tsx @@ -690,7 +690,7 @@ export default function WatchTogetherTab({ data }: { data: any }) { dmPlayerRef.current.contentWindow.postMessage(`seek?to=${time}`, 'https://www.dailymotion.com'); } setCurrentTime(time); - setTimeout(() => { seekingRef.current = false; }, 1000); + setTimeout(() => { seekingRef.current = false; }, 3000); }, [wsSend]); // ── Host time reporting ──