This commit is contained in:
arussac
2025-02-12 10:50:28 +01:00
parent 522e5db91e
commit bd4b1ddd2e
5 changed files with 46 additions and 22 deletions

View File

@@ -21,7 +21,6 @@ document.addEventListener("DOMContentLoaded", async () => {
const durationInput = document.getElementById('duration');
const tableImage = document.getElementById("content1");
const numberBoard = document.getElementById('number-board');
let selectedNumbers = [];
choiceSelect.addEventListener('change', toggleContainers);
@@ -208,6 +207,8 @@ function populateImageTable(DataMetrics) {
async function generateViewMetric(projectId) {
const ctx = document.getElementById("metric_viewer").getContext("2d");
const videoPlaceHolder = document.getElementById('video-container')
let Hygrometrie = [];
let Temperature = [];
let datesMeasurement = [];
@@ -225,15 +226,21 @@ async function generateViewMetric(projectId) {
});
const videoId = document.getElementById("video_selector").value;
measurements = await getDataMetrics(projectId);
let samples;
if(videoId!=-1){
currentVideoDatas = await getDataVideoFromApi(videoId);
samples = convertStringToArray(currentVideoDatas[0]["measurement_ids"]);
const pathToVideo = await getVideoFromApi(videoId)
samples = currentVideoDatas[0]["measurement_ids"];
videoPlaceHolder.innerHTML=`
<video width="600" controls>
<source src="path/to/your/video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>`
} else {
samples=measurements.map(measurements => measurements.id);
}
tempoMeasure = filterAndSortMeasurementsByIds(measurements, samples);
tempoMeasure.forEach((measure) => {
datesMeasurement.push(measure.timestamp);