This commit is contained in:
arussac
2025-03-10 14:20:16 +01:00
parent bfd77bc843
commit f17e4d330c
2 changed files with 61 additions and 1 deletions

View File

@@ -176,4 +176,44 @@ async function renderVideo(id){
console.error("Error rendering video:", error);
throw error;
}
}
async function start_timelapse(id,frequency){
try {
const mydata = JSON.stringify({
frequency:frequency
});
const response = await $.ajax({
url: api_url.concat(`/procedure/start/`+id),
method: "POST",
dataType: "json",
contentType: "application/json",
data: mydata
});
console.log("data retrieval started:", response);
} catch (error) {
console.error("Error starting the retrieval:", error);
throw error;
}
}
async function stopCamera(id){
try {
const mydata = JSON.stringify({
info:"None"
});
const response = await $.ajax({
url: api_url.concat(`/procedure/stop`+id),
method: "POST",
dataType: "json",
contentType: "application/json",
data: mydata
});
console.log("Camera stopped succesfully :", response);
} catch (error) {
console.error("Error stopping the camera :", error);
throw error;
}
}