PageSourceSearch

https://premiumstroi-ufa.ru/local/templates/guten/js/components/video.js?17465297521718

js premiumstroi-ufa.ru collected 2026-10-09 21:28:12 UTC 1,718 bytes, 48 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2  document.querySelectorAll(".video-slide__wrapper").forEach((wrapper) => {
3    const videoSrc = wrapper.dataset.video;
4    const timeElement = wrapper.querySelector(".video-slide__time");
5
6    // Подгружаем длительность видео
7    if (videoSrc && timeElement) {
8      const tempVideo = document.createElement("video");
9      tempVideo.src = videoSrc;
10      tempVideo.preload = "metadata";
11
12      tempVideo.addEventListener("loadedmetadata", function () {
13        const duration = tempVideo.duration;
14        const minutes = Math.floor(duration / 60);
15        const seconds = Math.floor(duration % 60);
16        timeElement.textContent = `${minutes}:${seconds
17          .toString()
18          .padStart(2, "0")}`;
19      });
20    }
21
22    wrapper.addEventListener("click", function () {
23      // Если видео уже вставлено — ничего не делаем
24      if (wrapper.classList.contains("video-active")) return;
25
26      // Добавляем класс
27      wrapper.classList.add("video-active");
28
29      // Сохраняем высоту/ширину, если нужно
30      const wrapperStyles = getComputedStyle(wrapper);
31      const height = wrapperStyles.height;
32      const width = wrapperStyles.width;
33
34      // Очищаем
35      wrapper.innerHTML = "";
36
37      // Создаем видео
38      const video = document.createElement("video");
39      video.src = videoSrc;
40      video.controls = true;
41      video.autoplay = true;
42      video.style.width = width;
43      video.style.height = height;
44
45      wrapper.appendChild(video);
46    });
47  });
48});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.