mirror of
https://github.com/YusufB5/ASCILINE.git
synced 2026-06-20 22:38:06 +02:00
Improve error handling and translate messages to English
This commit is contained in:
parent
95a3029679
commit
e7002173c2
3 changed files with 26 additions and 8 deletions
9
app.js
9
app.js
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue