Improve error handling and translate messages to English

This commit is contained in:
YusufB5 2026-05-03 21:36:14 +03:00
parent 95a3029679
commit e7002173c2
3 changed files with 26 additions and 8 deletions

9
app.js
View file

@ -85,6 +85,15 @@ function startStream() {
if (state !== 'PLAYING') return;
if (typeof event.data === 'string') {
if (event.data.startsWith('Error:')) {
statusEl.textContent = event.data;
statusEl.style.color = '#ff0000';
state = 'IDLE';
if (ws) ws.close();
setTimeout(() => resetToIdle(), 3000);
return;
}
if (event.data.startsWith('INIT:')) {
const p = event.data.split(':');
targetFps = parseFloat(p[1]);