Info Loading Bar

This commit is contained in:
MasterAcnolo
2025-11-17 16:54:11 +01:00
parent 0437cb61a2
commit 3f508da501
4 changed files with 49 additions and 1 deletions

View File

@@ -29,6 +29,8 @@ async function fetchVideoInfo(url) {
document.addEventListener("DOMContentLoaded", () => {
const urlInput = document.getElementById("UrlInput");
const infoDiv = document.getElementById("videoInfo");
const loaderBox = document.getElementById("loaderBox");
let lastFetchedUrl = "";
urlInput.addEventListener("input", async () => {
@@ -45,7 +47,9 @@ document.addEventListener("DOMContentLoaded", () => {
if (url === lastFetchedUrl) return;
lastFetchedUrl = url;
loaderBox.style.display = "flex";
const data = await fetchVideoInfo(url);
loaderBox.style.display = "none";
// Gestion des erreurs
if (data.error) {
@@ -59,6 +63,7 @@ document.addEventListener("DOMContentLoaded", () => {
`;
infoDiv.classList.add("visible");
infoDiv.classList.remove("playlist-mode");
loaderBox.style.display = "none";
return;
}