Spaces:
Running
Running
Update index.html
Browse files- index.html +28 -18
index.html
CHANGED
|
@@ -419,7 +419,7 @@
|
|
| 419 |
|
| 420 |
/* フレームプレビュー */
|
| 421 |
.frame-preview {
|
| 422 |
-
position:
|
| 423 |
bottom: 30px;
|
| 424 |
transform: translateX(-50%);
|
| 425 |
width: 160px;
|
|
@@ -838,18 +838,21 @@ function setupFramePreview() {
|
|
| 838 |
document.webkitFullscreenElement ||
|
| 839 |
document.msFullscreenElement;
|
| 840 |
|
| 841 |
-
//
|
| 842 |
-
|
|
|
|
|
|
|
|
|
|
| 843 |
if (isFullscreen) {
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
const clickX = Math.max(0, Math.min(clientX - progressRect.left, progressRect.width));
|
| 847 |
} else {
|
| 848 |
-
|
| 849 |
-
clientX = e.clientX;
|
| 850 |
-
const clickX = Math.max(0, Math.min(e.clientX - progressRect.left, progressRect.width));
|
| 851 |
}
|
| 852 |
|
|
|
|
|
|
|
|
|
|
| 853 |
const previewTime = (clickX / progressRect.width) * video.duration;
|
| 854 |
|
| 855 |
// 時間表示を更新
|
|
@@ -858,8 +861,14 @@ function setupFramePreview() {
|
|
| 858 |
frameTime.textContent = `${previewMinutes}:${previewSeconds}`;
|
| 859 |
|
| 860 |
// プレビュー位置を更新(全画面モードに合わせて調整)
|
| 861 |
-
|
| 862 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
framePreview.style.display = 'block';
|
| 864 |
|
| 865 |
// キャッシュがあればそれを使う
|
|
@@ -1165,16 +1174,17 @@ document.addEventListener('MSFullscreenChange', handleFullscreenChange);
|
|
| 1165 |
}
|
| 1166 |
});
|
| 1167 |
|
| 1168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1169 |
updateSubtitleScaleForFullscreen();
|
| 1170 |
setupFullscreenContextMenu();
|
| 1171 |
-
|
| 1172 |
-
// 全画面モード時にプログレスバーのサイズが変わる可能性があるので再計算
|
| 1173 |
normalVideoWidth = videoContainer.clientWidth;
|
| 1174 |
-
|
| 1175 |
-
|
| 1176 |
-
setupFramePreview();
|
| 1177 |
-
}
|
| 1178 |
|
| 1179 |
// CSS変数を設定
|
| 1180 |
document.documentElement.style.setProperty('--subtitle-scale', '1');
|
|
|
|
| 419 |
|
| 420 |
/* フレームプレビュー */
|
| 421 |
.frame-preview {
|
| 422 |
+
position: fixed;
|
| 423 |
bottom: 30px;
|
| 424 |
transform: translateX(-50%);
|
| 425 |
width: 160px;
|
|
|
|
| 838 |
document.webkitFullscreenElement ||
|
| 839 |
document.msFullscreenElement;
|
| 840 |
|
| 841 |
+
// プログレスバーの位置とサイズを取得
|
| 842 |
+
const progressRect = progressContainer.getBoundingClientRect();
|
| 843 |
+
|
| 844 |
+
// マウス座標を正しく計算(全画面モードに対応)
|
| 845 |
+
let clickX;
|
| 846 |
if (isFullscreen) {
|
| 847 |
+
// 全画面モードではe.offsetXが正しくない場合があるので、clientXを使用
|
| 848 |
+
clickX = e.clientX - progressRect.left;
|
|
|
|
| 849 |
} else {
|
| 850 |
+
clickX = e.offsetX;
|
|
|
|
|
|
|
| 851 |
}
|
| 852 |
|
| 853 |
+
// クリック位置をプログレスバーの範囲内に制限
|
| 854 |
+
clickX = Math.max(0, Math.min(clickX, progressRect.width));
|
| 855 |
+
|
| 856 |
const previewTime = (clickX / progressRect.width) * video.duration;
|
| 857 |
|
| 858 |
// 時間表示を更新
|
|
|
|
| 861 |
frameTime.textContent = `${previewMinutes}:${previewSeconds}`;
|
| 862 |
|
| 863 |
// プレビュー位置を更新(全画面モードに合わせて調整)
|
| 864 |
+
const previewLeft = isFullscreen ?
|
| 865 |
+
(e.clientX - framePreview.offsetWidth / 2) :
|
| 866 |
+
(progressRect.left + clickX - framePreview.offsetWidth / 2);
|
| 867 |
+
|
| 868 |
+
framePreview.style.left = `${previewLeft}px`;
|
| 869 |
+
framePreview.style.top = isFullscreen ?
|
| 870 |
+
`${progressRect.top - framePreview.offsetHeight - 10}px` :
|
| 871 |
+
`${progressRect.top - framePreview.offsetHeight - 10}px`;
|
| 872 |
framePreview.style.display = 'block';
|
| 873 |
|
| 874 |
// キャッシュがあればそれを使う
|
|
|
|
| 1174 |
}
|
| 1175 |
});
|
| 1176 |
|
| 1177 |
+
document.addEventListener('fullscreenchange', handleFullscreenChange);
|
| 1178 |
+
document.addEventListener('webkitfullscreenchange', handleFullscreenChange);
|
| 1179 |
+
document.addEventListener('mozfullscreenchange', handleFullscreenChange);
|
| 1180 |
+
document.addEventListener('MSFullscreenChange', handleFullscreenChange);
|
| 1181 |
+
|
| 1182 |
+
function handleFullscreenChange() {
|
| 1183 |
updateSubtitleScaleForFullscreen();
|
| 1184 |
setupFullscreenContextMenu();
|
|
|
|
|
|
|
| 1185 |
normalVideoWidth = videoContainer.clientWidth;
|
| 1186 |
+
setupFramePreview(); // フレームプレビューを再設定
|
| 1187 |
+
}
|
|
|
|
|
|
|
| 1188 |
|
| 1189 |
// CSS変数を設定
|
| 1190 |
document.documentElement.style.setProperty('--subtitle-scale', '1');
|