Spaces:
Running
Running
Update index.html
Browse files- index.html +16 -16
index.html
CHANGED
@@ -700,22 +700,22 @@
|
|
700 |
let normalVideoWidth = videoContainer.clientWidth;
|
701 |
let audioOnlyMode = false;
|
702 |
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
|
720 |
progressContainer.addEventListener('mouseleave', () => {
|
721 |
hoverTime.style.display = 'none';
|
|
|
700 |
let normalVideoWidth = videoContainer.clientWidth;
|
701 |
let audioOnlyMode = false;
|
702 |
|
703 |
+
const previewVideo = document.getElementById("previewVideo");
|
704 |
+
previewVideo.src = video.src;
|
705 |
+
previewVideo.preload = "auto";
|
706 |
+
|
707 |
+
progressContainer.addEventListener("mousemove", (e) => {
|
708 |
+
if (!video.duration) return;
|
709 |
+
|
710 |
+
const rect = progressContainer.getBoundingClientRect();
|
711 |
+
const hoverTimeSec = (e.clientX - rect.left) / rect.width * video.duration;
|
712 |
+
|
713 |
+
// プレビュー用video設定
|
714 |
+
previewVideo.currentTime = hoverTimeSec;
|
715 |
+
previewVideo.style.display = "block";
|
716 |
+
previewVideo.style.left = `${e.clientX - 80}px`; // 中央揃え調整
|
717 |
+
previewVideo.style.top = `${rect.top - 100}px`; // 上に配置(必要に応じて調整)
|
718 |
+
});
|
719 |
|
720 |
progressContainer.addEventListener('mouseleave', () => {
|
721 |
hoverTime.style.display = 'none';
|