We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff980c8 commit aebbca5Copy full SHA for aebbca5
1 file changed
server/templates/player.html
@@ -258,12 +258,16 @@
258
259
function reconnect() {
260
if (isPlaying && !useWebRTC) {
261
- reconnectAttempts++;
262
- const delay = Math.min(1000 * Math.pow(1.5, reconnectAttempts), 10000);
+ // Reconnect rate: ~1 second + tiny bit of random (0-200ms)
+ const delay = 1000 + (Math.random() * 200);
263
setTimeout(() => {
264
if (!isPlaying) return;
265
audio.src = mount + '?t=' + new Date().getTime();
266
- audio.play().then(() => reconnectAttempts = 0).catch(reconnect);
+ audio.play().then(() => {
267
+ reconnectAttempts = 0;
268
+ }).catch(() => {
269
+ reconnect();
270
+ });
271
}, delay);
272
}
273
0 commit comments