diff --git a/frontend/lib/watch-session.mjs b/frontend/lib/watch-session.mjs index 49feac2..c09cec8 100644 --- a/frontend/lib/watch-session.mjs +++ b/frontend/lib/watch-session.mjs @@ -9,7 +9,7 @@ import { setupChat, logEventToChat } from "./chat.mjs?v=2"; const createWebSocket = (sessionId, nickname) => { const wsUrl = new URL( `/sess/${sessionId}/subscribe` + - `?nickname=${encodeURIComponent(nickname)}`, + `?nickname=${encodeURIComponent(nickname)}`, window.location.href ); wsUrl.protocol = { "http:": "ws:", "https:": "wss:" }[wsUrl.protocol]; @@ -73,7 +73,7 @@ const setupIncomingEvents = (video, socket) => { } logEventToChat(event); - } catch (_err) {} + } catch (_err) { } }); }; @@ -162,6 +162,13 @@ export const joinSession = async (nickname, sessionId) => { is_playing ); + // By default, we should disable video controls if the video is already playing. + // This solves an issue where Safari users join and seek to 00:00:00 because of + // outgoing events. + if (current_time_ms != 0) { + video.controls = false; + } + setupOutgoingEvents(video, socket); setupIncomingEvents(video, socket); setupChat(socket);