From 929d7ceeebdbd09005325a212e29fe5696e49b9d Mon Sep 17 00:00:00 2001 From: Glenn Thompson Date: Sat, 6 Dec 2025 10:13:42 +0300 Subject: [PATCH] perf: Reduce reconnect delay from 500ms to 200ms for faster response Optimized the timeout after stream reconnection to make the pause/unpause experience more responsive. The 200ms delay is sufficient for the browser to clear buffers and start the fresh stream while minimizing perceived lag. --- static/js/front-page.js | 2 +- static/js/player.js | 2 +- template/audio-player-frame.ctml | 2 +- template/popout-player.ctml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/front-page.js b/static/js/front-page.js index b719ce8..91d37b2 100644 --- a/static/js/front-page.js +++ b/static/js/front-page.js @@ -158,7 +158,7 @@ window.addEventListener('DOMContentLoaded', function() { } isReconnecting = false; - }, 500); + }, 200); } }); diff --git a/static/js/player.js b/static/js/player.js index 8d8dae4..15cb520 100644 --- a/static/js/player.js +++ b/static/js/player.js @@ -74,7 +74,7 @@ document.addEventListener('DOMContentLoaded', function() { } isReconnecting = false; - }, 500); + }, 200); } }); } diff --git a/template/audio-player-frame.ctml b/template/audio-player-frame.ctml index ea6f7b3..1890fab 100644 --- a/template/audio-player-frame.ctml +++ b/template/audio-player-frame.ctml @@ -94,7 +94,7 @@ } isReconnecting = false; - }, 500); + }, 200); } else { console.log('Audio playing'); } diff --git a/template/popout-player.ctml b/template/popout-player.ctml index 136addf..737c75b 100644 --- a/template/popout-player.ctml +++ b/template/popout-player.ctml @@ -181,7 +181,7 @@ } isReconnecting = false; - }, 500); + }, 200); } });