mirror of
https://github.com/YusufB5/ASCILINE.git
synced 2026-06-17 22:35:13 +02:00
feat: server-side volume control feature added, playlist & folder video management
This commit is contained in:
parent
fd422b5100
commit
5fad7c5aa9
6 changed files with 344 additions and 101 deletions
16
app.js
16
app.js
|
|
@ -99,7 +99,7 @@ function connectWebSocket() {
|
|||
|
||||
if (audioEl) {
|
||||
audioEl.src = '/audio?' + Date.now();
|
||||
audioEl.volume = volumeSlider ? volumeSlider.value : 0.8;
|
||||
audioEl.volume = volumeSlider ? volumeSlider.value : 1.0;
|
||||
}
|
||||
|
||||
const protocol = location.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
|
|
@ -121,8 +121,18 @@ function connectWebSocket() {
|
|||
frameInterval = 1000 / targetFps;
|
||||
renderMode = parseInt(p[2]);
|
||||
buildCanvas(parseInt(p[3]), parseInt(p[4]));
|
||||
|
||||
if (audioEl) audioEl.play().catch(() => {});
|
||||
|
||||
// Reload audio on every INIT so each video's audio plays correctly.
|
||||
// The server updates current_index BEFORE sending INIT, so /audio
|
||||
// will already serve the new video's audio when we request it here.
|
||||
if (audioEl) {
|
||||
audioEl.pause();
|
||||
audioEl.src = '/audio?' + Date.now();
|
||||
audioEl.volume = volumeSlider ? volumeSlider.value : 1.0;
|
||||
audioEl.load();
|
||||
audioEl.play().catch(() => {});
|
||||
}
|
||||
|
||||
readyToRender = true;
|
||||
state = 'PLAYING';
|
||||
lastRenderTime = performance.now();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue