Spaces:
Running
Running
Update index.html
Browse files- index.html +68 -64
index.html
CHANGED
@@ -38,6 +38,7 @@
|
|
38 |
border: 2px solid #0066ff;
|
39 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
40 |
background: #000;
|
|
|
41 |
}
|
42 |
|
43 |
video {
|
@@ -291,6 +292,7 @@
|
|
291 |
.video-container:-moz-full-screen video::cue,
|
292 |
.video-container:-ms-fullscreen video::cue {
|
293 |
font-size: calc(16px * var(--subtitle-scale) * var(--fullscreen-scale, 1)) !important;
|
|
|
294 |
}
|
295 |
body {
|
296 |
margin: 0;
|
@@ -418,19 +420,20 @@
|
|
418 |
}
|
419 |
|
420 |
/* フレームプレビュー */
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
|
|
434 |
|
435 |
.frame-preview img {
|
436 |
width: 100%;
|
@@ -457,7 +460,7 @@
|
|
457 |
background-color: #0f0f1a;
|
458 |
border: 1px solid #0066ff;
|
459 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
460 |
-
z-index:
|
461 |
display: none;
|
462 |
min-width: 200px;
|
463 |
}
|
@@ -825,60 +828,61 @@ function updateSubtitleScaleForFullscreen() {
|
|
825 |
document.documentElement.style.setProperty('--fullscreen-scale', 1);
|
826 |
}
|
827 |
}
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
progressContainer.addEventListener('mousemove', (e) => {
|
832 |
-
if (!videoBlob || !video.duration) return;
|
833 |
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
844 |
|
845 |
-
|
846 |
-
|
847 |
-
|
|
|
|
|
848 |
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
previewImage.src = frameCache[cacheKey];
|
853 |
-
return;
|
854 |
-
}
|
855 |
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
VideoForThumbnail.addEventListener('seeked', function() {
|
860 |
-
canvas.width = VideoForThumbnail.videoWidth;
|
861 |
-
canvas.height = VideoForThumbnail.videoHeight;
|
862 |
-
ctx.drawImage(VideoForThumbnail, 0, 0, canvas.width, canvas.height);
|
863 |
-
const imageData = canvas.toDataURL('image/jpeg');
|
864 |
-
previewImage.src = imageData;
|
865 |
-
frameCache[cacheKey] = imageData; // キャッシュに保存
|
866 |
-
}, { once: true });
|
867 |
-
});
|
868 |
-
|
869 |
-
progressContainer.addEventListener('mouseleave', () => {
|
870 |
-
previewTimeout = setTimeout(() => {
|
871 |
-
framePreview.style.display = 'none';
|
872 |
-
}, 300);
|
873 |
-
});
|
874 |
-
|
875 |
-
framePreview.addEventListener('mouseenter', () => {
|
876 |
-
clearTimeout(previewTimeout);
|
877 |
-
});
|
878 |
-
|
879 |
-
framePreview.addEventListener('mouseleave', () => {
|
880 |
-
framePreview.style.display = 'none';
|
881 |
-
});
|
882 |
}
|
883 |
// 字幕関連の関数
|
884 |
function toggleSubtitles() {
|
|
|
38 |
border: 2px solid #0066ff;
|
39 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
40 |
background: #000;
|
41 |
+
z-index: 2147483640;
|
42 |
}
|
43 |
|
44 |
video {
|
|
|
292 |
.video-container:-moz-full-screen video::cue,
|
293 |
.video-container:-ms-fullscreen video::cue {
|
294 |
font-size: calc(16px * var(--subtitle-scale) * var(--fullscreen-scale, 1)) !important;
|
295 |
+
z-index: 2147483647;
|
296 |
}
|
297 |
body {
|
298 |
margin: 0;
|
|
|
420 |
}
|
421 |
|
422 |
/* フレームプレビュー */
|
423 |
+
.frame-preview {
|
424 |
+
position: absolute;
|
425 |
+
bottom: 50px; /* プログレスバーの上に表示 */
|
426 |
+
transform: translateX(-50%);
|
427 |
+
width: 160px;
|
428 |
+
height: 90px;
|
429 |
+
background: #000;
|
430 |
+
border: 2px solid #00aaff;
|
431 |
+
box-shadow: 0 0 10px rgba(0, 170, 255, 0.7);
|
432 |
+
display: none;
|
433 |
+
z-index: 1000; /* 高いz-indexを設定 */
|
434 |
+
pointer-events: none;
|
435 |
+
}
|
436 |
+
|
437 |
|
438 |
.frame-preview img {
|
439 |
width: 100%;
|
|
|
460 |
background-color: #0f0f1a;
|
461 |
border: 1px solid #0066ff;
|
462 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
463 |
+
z-index: 100000;
|
464 |
display: none;
|
465 |
min-width: 200px;
|
466 |
}
|
|
|
828 |
document.documentElement.style.setProperty('--fullscreen-scale', 1);
|
829 |
}
|
830 |
}
|
831 |
+
function setupFramePreview() {
|
832 |
+
let previewTimeout;
|
|
|
|
|
|
|
833 |
|
834 |
+
progressContainer.addEventListener('mousemove', (e) => {
|
835 |
+
if (!videoBlob || !video.duration) return;
|
836 |
+
|
837 |
+
clearTimeout(previewTimeout);
|
838 |
+
|
839 |
+
const progressRect = progressContainer.getBoundingClientRect();
|
840 |
+
const clickX = Math.max(0, Math.min(e.clientX - progressRect.left, progressRect.width));
|
841 |
+
const previewTime = (clickX / progressRect.width) * video.duration;
|
842 |
+
|
843 |
+
// 時間表示を更新
|
844 |
+
const previewMinutes = Math.floor(previewTime / 60);
|
845 |
+
const previewSeconds = Math.floor(previewTime % 60).toString().padStart(2, '0');
|
846 |
+
frameTime.textContent = `${previewMinutes}:${previewSeconds}`;
|
847 |
+
|
848 |
+
// プレビュー位置を更新(プログレスバーの上に表示)
|
849 |
+
framePreview.style.left = `${e.clientX}px`;
|
850 |
+
framePreview.style.bottom = `${progressContainer.offsetHeight + 10}px`; // プログレスバーの上
|
851 |
+
framePreview.style.display = 'block';
|
852 |
+
|
853 |
+
// キャッシュがあればそれを使う
|
854 |
+
const cacheKey = Math.floor(previewTime);
|
855 |
+
if (frameCache[cacheKey]) {
|
856 |
+
previewImage.src = frameCache[cacheKey];
|
857 |
+
return;
|
858 |
+
}
|
859 |
+
|
860 |
+
// フレームを取得
|
861 |
+
VideoForThumbnail.currentTime = previewTime;
|
862 |
+
|
863 |
+
VideoForThumbnail.addEventListener('seeked', function() {
|
864 |
+
canvas.width = VideoForThumbnail.videoWidth;
|
865 |
+
canvas.height = VideoForThumbnail.videoHeight;
|
866 |
+
ctx.drawImage(VideoForThumbnail, 0, 0, canvas.width, canvas.height);
|
867 |
+
const imageData = canvas.toDataURL('image/jpeg');
|
868 |
+
previewImage.src = imageData;
|
869 |
+
frameCache[cacheKey] = imageData; // キャッシュに保存
|
870 |
+
}, { once: true });
|
871 |
+
});
|
872 |
|
873 |
+
progressContainer.addEventListener('mouseleave', () => {
|
874 |
+
previewTimeout = setTimeout(() => {
|
875 |
+
framePreview.style.display = 'none';
|
876 |
+
}, 300);
|
877 |
+
});
|
878 |
|
879 |
+
framePreview.addEventListener('mouseenter', () => {
|
880 |
+
clearTimeout(previewTimeout);
|
881 |
+
});
|
|
|
|
|
|
|
882 |
|
883 |
+
framePreview.addEventListener('mouseleave', () => {
|
884 |
+
framePreview.style.display = 'none';
|
885 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
886 |
}
|
887 |
// 字幕関連の関数
|
888 |
function toggleSubtitles() {
|