live and export fix
This commit is contained in:
@ -407,33 +407,33 @@
|
||||
|
||||
flvPlayers.push(flvPlayer);
|
||||
|
||||
let hasStarted = false;
|
||||
// let hasStarted = false;
|
||||
|
||||
const checkStarted = () => {
|
||||
if (!hasStarted && videoElement.readyState >= 2) {
|
||||
hasStarted = true;
|
||||
console.log(`Трансляция началась для камеры ${i}`);
|
||||
}
|
||||
};
|
||||
// const checkStarted = () => {
|
||||
// if (!hasStarted && videoElement.readyState >= 2) {
|
||||
// hasStarted = true;
|
||||
// console.log(`Трансляция началась для камеры ${i}`);
|
||||
// }
|
||||
// };
|
||||
|
||||
const checkInterval = setInterval(checkStarted, 1000);
|
||||
// const checkInterval = setInterval(checkStarted, 10000);
|
||||
|
||||
setTimeout(() => {
|
||||
clearInterval(checkInterval);
|
||||
if (!hasStarted) {
|
||||
console.log(`Трансляция для камеры ${i} не началась, запрашиваем повторно...`);
|
||||
flvPlayer.unload();
|
||||
flvPlayer.load();
|
||||
flvPlayer.play();
|
||||
// if (i > 0) {
|
||||
// i--;
|
||||
// }
|
||||
}
|
||||
}, 3000);
|
||||
// setTimeout(() => {
|
||||
// clearInterval(checkInterval);
|
||||
// if (!hasStarted) {
|
||||
// console.log(`Трансляция для камеры ${i} не началась, запрашиваем повторно...`);
|
||||
// flvPlayer.unload();
|
||||
// flvPlayer.load();
|
||||
// flvPlayer.play();
|
||||
// // if (i > 0) {
|
||||
// // i--;
|
||||
// // }
|
||||
// }
|
||||
// }, 10000);
|
||||
|
||||
videoElementIndex++;
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
await new Promise(resolve => setTimeout(resolve, 3000));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user