Update watch.js

pull/4062/head
IgorA100 2024-05-31 20:11:43 +03:00 committed by GitHub
parent 6ee8c91fc1
commit 6f7728bf1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 27 additions and 1 deletions

View File

@ -1190,7 +1190,33 @@ function cycleNext() {
}
clearInterval(intervalId);
monitorStream.kill();
window.location.replace('?view=watch&cycle='+cycle+'&mid='+monitorData[monIdx].id+'&mode='+mode);
// +++ Старт следующего монитора
monitorStream = new MonitorStream(monitorData[monIdx]);
const img = document.getElementById('liveStream'+monitorData[monIdx-1].id);
const src = img.src;
if (src) {
const url = new URL(src);
url.searchParams.set('monitor', monitorData[monIdx].id);
url.searchParams.delete('connkey');
url.searchParams.set('mode', 'single');
img.src = '';
img.src = url;
img.id = 'liveStream'+monitorData[monIdx].id;
} else {
// Пока х.з. что делать....
}
if (!monitorStream.started) {
monitorStream.start();
}
cycleStart();
//Изменим активный элемент
document.getElementById('nav-item-cycle'+monitorData[monIdx-1].id).querySelector('a').classList.remove("active");
document.getElementById('nav-item-cycle'+monitorData[monIdx].id).querySelector('a').classList.add("active");
// --- Старт следующего монитора
//window.location.replace('?view=watch&cycle='+cycle+'&mid='+monitorData[monIdx].id+'&mode='+mode);
}
function cyclePrev() {