Let streamers set how long messages stay on screen
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 29s
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 29s
Adds display_duration_seconds to the streamers table (default 10s, with an idempotent migration for existing rows), a dashboard control to change it, and wires the value through to the overlay via the display_message payload instead of a hardcoded 10s. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
fab55cde1d
commit
f4d023c695
4 changed files with 87 additions and 4 deletions
|
|
@ -42,7 +42,7 @@ function playNotificationSound() {
|
|||
}
|
||||
}
|
||||
|
||||
function showMessage(text, from) {
|
||||
function showMessage(text, from, durationMs) {
|
||||
clearTimeout(hideTimer);
|
||||
|
||||
fromEl.textContent = from || '';
|
||||
|
|
@ -54,10 +54,9 @@ function showMessage(text, from) {
|
|||
|
||||
playNotificationSound();
|
||||
|
||||
const durationMs = 10000;
|
||||
hideTimer = setTimeout(() => {
|
||||
box.classList.remove('visible');
|
||||
}, durationMs);
|
||||
}, durationMs || 10000);
|
||||
}
|
||||
|
||||
function playSpeech(base64Audio, mimeType) {
|
||||
|
|
@ -66,7 +65,7 @@ function playSpeech(base64Audio, mimeType) {
|
|||
}
|
||||
|
||||
socket.on('display_message', (payload) => {
|
||||
showMessage(payload.text, payload.from);
|
||||
showMessage(payload.text, payload.from, payload.durationMs);
|
||||
});
|
||||
|
||||
socket.on('display_audio', (payload) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue