change fetch to AJAX in archive
This commit is contained in:
parent
20f2053a86
commit
d3706c7a49
@ -543,24 +543,28 @@ function playVideo(channel) {
|
|||||||
const selectedDate = formatDate(selectedDateInput.value);
|
const selectedDate = formatDate(selectedDateInput.value);
|
||||||
const serial = selectedDevice.value;
|
const serial = selectedDevice.value;
|
||||||
|
|
||||||
const url = `http://localhost:8081/?url=http%3A%2F%2Fkrbl.ru%3A8080%2Fhttp%2Fplayback.flv%3Fserial%3D${serial}%26channel%3D${channel}%26quality%3D1%26queryTime%3D${selectedDate}%26startTime%3D${startTime}%26endTime%3D130000`;
|
const url = `http://localhost:7081/?url=http%3A%2F%2Fkrbl.ru%3A8080%2Fhttp%2Fplayback.flv%3Fserial%3D${serial}%26channel%3D${channel}%26quality%3D1%26queryTime%3D${selectedDate}%26startTime%3D${startTime}%26endTime%3D130000`;
|
||||||
|
|
||||||
fetch(url)
|
const xhr = new XMLHttpRequest();
|
||||||
.then(response => {
|
|
||||||
if (response.status === 200) {
|
xhr.onreadystatechange = function () {
|
||||||
|
if (xhr.readyState === 4) {
|
||||||
|
if (xhr.status === 200) {
|
||||||
console.log('Запрос выполнен успешно.');
|
console.log('Запрос выполнен успешно.');
|
||||||
} else {
|
} else {
|
||||||
console.error('Произошла ошибка при выполнении запроса.');
|
console.error('Произошла ошибка при выполнении запроса.');
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.catch(error => {
|
};
|
||||||
console.error('Произошла ошибка при выполнении запроса:', error);
|
|
||||||
});
|
xhr.open('GET', url, true);
|
||||||
|
xhr.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user