From f1c22d2a6c7eef260b4f9f9052519ba89ccc7609 Mon Sep 17 00:00:00 2001 From: Chaphasilor Date: Sun, 12 Apr 2020 15:09:08 +0200 Subject: [PATCH] removed repositioning loop - replaced it with simple delay to prevent 'buggy' behaviour on early drag --- public/js/chat.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/public/js/chat.js b/public/js/chat.js index 05a45ab..dd23f41 100644 --- a/public/js/chat.js +++ b/public/js/chat.js @@ -310,16 +310,17 @@ var VideoChat = { VideoChat.connected = true; // Hide caption status text captionText.fadeOut(); - // Reposition local video repeatedly, as there is often a delay + // Reposition local video after a second, as there is often a delay // between adding a stream and the height of the video div changing - var timesRun = 0; - var interval = setInterval(function () { - timesRun += 1; - if (timesRun === 10) { - clearInterval(interval); - } - rePositionLocalVideo(); - }, 300); + setTimeout(() => rePositionLocalVideo(), 500); + // var timesRun = 0; + // var interval = setInterval(function () { + // timesRun += 1; + // if (timesRun === 10) { + // clearInterval(interval); + // } + // rePositionLocalVideo(); + // }, 300); }, }; @@ -363,7 +364,7 @@ function rePositionLocalVideo() { navigator.userAgent ) ) { - bounds.top = $(window).height() * 0.75; + bounds.top = $(window).height() * 0.7; bounds.left += 10; } else { bounds.top += 10;