Refactor audio playback logic in FakeAdminResponder to ensure that audio plays on start
All checks were successful
Build and push image / docker-build (push) Successful in 4m55s

This commit is contained in:
2025-12-10 23:17:34 +03:00
parent f2a297f77b
commit dae4f32293

View File

@@ -208,11 +208,15 @@ public class FakeAdminResponder {
}; };
if (audioEl) { if (audioEl) {
const ensurePlaying = () => {
if (!audioEl.dataset.started) {
audioEl.dataset.started = '1';
audioEl.volume = 0.4; audioEl.volume = 0.4;
const keepPlaying = () => { }
audioEl.play().catch(() => setTimeout(keepPlaying, 500)); audioEl.play().catch(() => {});
}; };
keepPlaying();
ensurePlaying();
setInterval(() => { setInterval(() => {
if (audioEl.paused) { if (audioEl.paused) {
audioEl.play().catch(() => {}); audioEl.play().catch(() => {});