FrontEnd angepasst
This commit is contained in:
parent
96674ccf62
commit
f02cf1fa15
1 changed files with 9 additions and 12 deletions
|
|
@ -176,29 +176,26 @@ function updateVideoElement(packet){
|
||||||
let video = packet.data_flow;
|
let video = packet.data_flow;
|
||||||
let container = document.getElementById(video.id);
|
let container = document.getElementById(video.id);
|
||||||
|
|
||||||
container.querySelector(".frames").textContent = video.frames || 0;
|
container.querySelector(".frames").textContent = video.frames ?? 0;
|
||||||
container.querySelector(".size").textContent = video.size[0] || 0;
|
container.querySelector(".size").textContent = video.size[0] || 0;
|
||||||
container.querySelector(".size_unit").textContent = video.size[1] || "KB";
|
container.querySelector(".size_unit").textContent = video.size[1] || "KB";
|
||||||
container.querySelector(".fps").textContent = video.fps || 0;
|
container.querySelector(".fps").textContent = video.fps ?? 0;
|
||||||
container.querySelector(".quantizer").textContent = video.quantizer || 0;
|
container.querySelector(".quantizer").textContent = video.quantizer ?? 0;
|
||||||
container.querySelector(".bitrate").textContent = video.bitrate[0] || 0;
|
container.querySelector(".bitrate").textContent = video.bitrate[0] || 0;
|
||||||
container.querySelector(".bitrate_unit").textContent = video.bitrate[1] || 0;
|
container.querySelector(".bitrate_unit").textContent = video.bitrate[1] || 0;
|
||||||
container.querySelector(".speed").textContent = video.speed || 0;
|
container.querySelector(".speed").textContent = video.speed ?? 0;
|
||||||
container.querySelector(".time_remaining").textContent = video.time_remaining || 0;
|
container.querySelector(".time_remaining").textContent = video.time_remaining ?? "0 Min";
|
||||||
container.querySelector(".time").textContent = video.time || 0;
|
container.querySelector(".time").textContent = video.time ?? "0 Min";
|
||||||
|
|
||||||
let progressBar = container.querySelector(".progress-bar");
|
let progressBar = container.querySelector(".progress-bar");
|
||||||
let progress = video.loading; // Annahme: `loading` kommt als Zahl von 0 bis 100
|
let progress = video.loading; // Annahme: `loading` kommt als Zahl von 0 bis 100
|
||||||
progressBar.style.width = progress + "%"
|
progressBar.style.width = progress + "%"
|
||||||
|
|
||||||
if (videoActive[video.id].status == 3) {
|
if (videoActive[video.id].status === 3) {
|
||||||
progressBar.style.background = "linear-gradient(90deg, #4caf50, #00c853)";
|
progressBar.style.background = "linear-gradient(90deg, #4caf50, #00c853)";
|
||||||
container.querySelector(".finished").textContent = "Läuft";
|
} else if(videoActive[video.id].status === 0) {
|
||||||
} else if(videoActive[video.id].status == 0) {
|
|
||||||
progressBar.style.background = "#4caf50";
|
progressBar.style.background = "#4caf50";
|
||||||
container.querySelector(".finished").textContent = "Fertig";
|
} else if(videoActive[video.id].status === 1) {
|
||||||
} else if(videoActive[video.id].status == 1) {
|
|
||||||
progressBar.style.background = "#ff0000";
|
progressBar.style.background = "#ff0000";
|
||||||
container.querySelector(".finished").textContent = "Fehler";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue