Spaces:
Running
Running
Update index.html
Browse files- index.html +254 -161
index.html
CHANGED
@@ -38,7 +38,6 @@
|
|
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,7 +291,6 @@
|
|
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;
|
@@ -421,16 +419,17 @@
|
|
421 |
|
422 |
/* フレームプレビュー */
|
423 |
.frame-preview {
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
|
|
434 |
}
|
435 |
|
436 |
.frame-preview img {
|
@@ -458,7 +457,7 @@
|
|
458 |
background-color: #0f0f1a;
|
459 |
border: 1px solid #0066ff;
|
460 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
461 |
-
z-index:
|
462 |
display: none;
|
463 |
min-width: 200px;
|
464 |
}
|
@@ -589,6 +588,10 @@
|
|
589 |
<track id="subtitleTrackElement" kind="subtitles" src="v.vtt" srclang="ja" label="日本語" default>
|
590 |
</track>
|
591 |
</video>
|
|
|
|
|
|
|
|
|
592 |
<div class="custom-controls">
|
593 |
<div class="progress-container" id="progressContainer">
|
594 |
<div class="progress-bar" id="progressBar">
|
@@ -610,9 +613,11 @@
|
|
610 |
</div>
|
611 |
</div>
|
612 |
</div>
|
613 |
-
<canvas id="canvas"
|
|
|
614 |
<!-- サムネイル用の非表示video要素 -->
|
615 |
-
<video id="video-for-thumbnail" src="v.mp4" preload="auto" style="display:none;"
|
|
|
616 |
<script>
|
617 |
const video = document.getElementById('videoPlayer');
|
618 |
const videoSelect = document.getElementById('videoSelect');
|
@@ -640,6 +645,9 @@
|
|
640 |
const frameTime = document.getElementById('frameTime');
|
641 |
const audioOnlyModeIndicator = document.getElementById('audioOnlyModeIndicator');
|
642 |
const contextMenu = document.getElementById('contextMenu');
|
|
|
|
|
|
|
643 |
const VideoForThumbnail = document.getElementById('video-for-thumbnail');
|
644 |
const canvas = document.getElementById('canvas');
|
645 |
const ctx = canvas.getContext('2d');
|
@@ -791,87 +799,87 @@
|
|
791 |
}
|
792 |
hideContextMenu();
|
793 |
}
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
// 字幕関連の関数
|
876 |
function toggleSubtitles() {
|
877 |
subtitlesEnabled = !subtitlesEnabled;
|
@@ -916,29 +924,61 @@
|
|
916 |
toggleSubtitles();
|
917 |
}
|
918 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
919 |
// 右クリックメニュー関連
|
920 |
function showContextMenu(e) {
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
const y = e.clientY || e.touches?.[0]?.clientY;
|
926 |
-
|
927 |
-
if (!x || !y) return;
|
928 |
-
|
929 |
-
contextMenu.style.display = 'block';
|
930 |
-
contextMenu.style.left = `${x}px`;
|
931 |
-
contextMenu.style.top = `${y}px`;
|
932 |
-
|
933 |
-
// 全画面時は document にイベントリスナーを追加
|
934 |
-
if (document.fullscreenElement) {
|
935 |
-
document.addEventListener('click', hideContextMenu);
|
936 |
-
}
|
937 |
}
|
938 |
|
939 |
function hideContextMenu() {
|
940 |
-
|
941 |
-
document.removeEventListener('click', hideContextMenu);
|
942 |
}
|
943 |
|
944 |
// 音声/字幕のみモード
|
@@ -985,29 +1025,66 @@
|
|
985 |
progressContainer.addEventListener('click', setProgress);
|
986 |
progressContainer.addEventListener('mousedown', () => isDragging = true);
|
987 |
document.addEventListener('mouseup', () => isDragging = false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
988 |
|
989 |
volumeBtn.addEventListener('click', toggleMute);
|
990 |
volumeSlider.addEventListener('input', handleVolumeChange);
|
991 |
fullscreenBtn.addEventListener('click', goFullscreen);
|
992 |
|
993 |
// 全画面変更イベントを監視
|
994 |
-
document.addEventListener('fullscreenchange',
|
995 |
-
document.addEventListener('webkitfullscreenchange',
|
996 |
-
document.addEventListener('mozfullscreenchange',
|
997 |
-
document.addEventListener('MSFullscreenChange',
|
998 |
-
|
999 |
-
function updateFullscreenEventListeners() {
|
1000 |
-
updateSubtitleScaleForFullscreen();
|
1001 |
-
if (document.fullscreenElement) {
|
1002 |
-
// 全画面時は document にイベントリスナーを設定
|
1003 |
-
document.addEventListener('contextmenu', showContextMenu);
|
1004 |
-
videoContainer.removeEventListener('contextmenu', showContextMenu);
|
1005 |
-
} else {
|
1006 |
-
// 通常時は videoContainer に戻す
|
1007 |
-
videoContainer.addEventListener('contextmenu', showContextMenu);
|
1008 |
-
document.removeEventListener('contextmenu', showContextMenu);
|
1009 |
-
}
|
1010 |
-
}
|
1011 |
|
1012 |
// 右クリックメニューイベント
|
1013 |
videoContainer.addEventListener('contextmenu', showContextMenu);
|
@@ -1025,37 +1102,53 @@
|
|
1025 |
updateProgress();
|
1026 |
normalVideoWidth = videoContainer.clientWidth;
|
1027 |
});
|
1028 |
-
|
1029 |
video.addEventListener("loadeddata", async () => {
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
document.addEventListener('
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1059 |
// CSS変数を設定
|
1060 |
document.documentElement.style.setProperty('--subtitle-scale', '1');
|
1061 |
document.documentElement.style.setProperty('--subtitle-border-radius', '10px');
|
|
|
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 |
.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;
|
|
|
419 |
|
420 |
/* フレームプレビュー */
|
421 |
.frame-preview {
|
422 |
+
position: absolute;
|
423 |
+
bottom: 30px;
|
424 |
+
transform: translateX(-50%);
|
425 |
+
width: 160px;
|
426 |
+
height: 90px;
|
427 |
+
background: #000;
|
428 |
+
border: 2px solid #00aaff;
|
429 |
+
box-shadow: 0 0 10px rgba(0, 170, 255, 0.7);
|
430 |
+
display: none;
|
431 |
+
z-index: 100;
|
432 |
+
pointer-events: none;
|
433 |
}
|
434 |
|
435 |
.frame-preview img {
|
|
|
457 |
background-color: #0f0f1a;
|
458 |
border: 1px solid #0066ff;
|
459 |
box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
|
460 |
+
z-index: 1000;
|
461 |
display: none;
|
462 |
min-width: 200px;
|
463 |
}
|
|
|
588 |
<track id="subtitleTrackElement" kind="subtitles" src="v.vtt" srclang="ja" label="日本語" default>
|
589 |
</track>
|
590 |
</video>
|
591 |
+
<div class="preview-container" id="previewContainer">
|
592 |
+
<img id="preview" style="max-width: 200px; max-height: 150px;">
|
593 |
+
<div class="preview-time" id="previewTime"></div>
|
594 |
+
</div>
|
595 |
<div class="custom-controls">
|
596 |
<div class="progress-container" id="progressContainer">
|
597 |
<div class="progress-bar" id="progressBar">
|
|
|
613 |
</div>
|
614 |
</div>
|
615 |
</div>
|
616 |
+
<canvas id="canvas">
|
617 |
+
</canvas>
|
618 |
<!-- サムネイル用の非表示video要素 -->
|
619 |
+
<video id="video-for-thumbnail" src="v.mp4" preload="auto" style="display:none;">
|
620 |
+
</video>
|
621 |
<script>
|
622 |
const video = document.getElementById('videoPlayer');
|
623 |
const videoSelect = document.getElementById('videoSelect');
|
|
|
645 |
const frameTime = document.getElementById('frameTime');
|
646 |
const audioOnlyModeIndicator = document.getElementById('audioOnlyModeIndicator');
|
647 |
const contextMenu = document.getElementById('contextMenu');
|
648 |
+
const previewContainer = document.getElementById('previewContainer');
|
649 |
+
const preview = document.getElementById('preview');
|
650 |
+
const previewTime = document.getElementById('previewTime');
|
651 |
const VideoForThumbnail = document.getElementById('video-for-thumbnail');
|
652 |
const canvas = document.getElementById('canvas');
|
653 |
const ctx = canvas.getContext('2d');
|
|
|
799 |
}
|
800 |
hideContextMenu();
|
801 |
}
|
802 |
+
function setupFullscreenContextMenu() {
|
803 |
+
const fullscreenElement = document.fullscreenElement ||
|
804 |
+
document.webkitFullscreenElement ||
|
805 |
+
document.msFullscreenElement;
|
806 |
+
|
807 |
+
if (fullscreenElement) {
|
808 |
+
fullscreenElement.addEventListener('contextmenu', showContextMenu);
|
809 |
+
}
|
810 |
+
}
|
811 |
+
function updateSubtitleScaleForFullscreen() {
|
812 |
+
if (document.fullscreenElement || document.webkitFullscreenElement ||
|
813 |
+
document.mozFullScreenElement || document.msFullscreenElement) {
|
814 |
+
// 全画面モード
|
815 |
+
const fullscreenWidth = window.innerWidth;
|
816 |
+
const scaleFactor = fullscreenWidth / normalVideoWidth;
|
817 |
+
document.documentElement.style.setProperty('--fullscreen-scale', scaleFactor);
|
818 |
+
|
819 |
+
// 全画面要素にイベントリスナーを追加
|
820 |
+
const fsElement = document.fullscreenElement || document.webkitFullscreenElement ||
|
821 |
+
document.mozFullScreenElement || document.msFullscreenElement;
|
822 |
+
fsElement.addEventListener('contextmenu', showContextMenu);
|
823 |
+
} else {
|
824 |
+
// 通常モード
|
825 |
+
document.documentElement.style.setProperty('--fullscreen-scale', 1);
|
826 |
+
}
|
827 |
+
}
|
828 |
+
function setupFramePreview() {
|
829 |
+
let previewTimeout;
|
830 |
+
|
831 |
+
progressContainer.addEventListener('mousemove', (e) => {
|
832 |
+
if (!videoBlob || !video.duration) return;
|
833 |
+
|
834 |
+
clearTimeout(previewTimeout);
|
835 |
+
|
836 |
+
const progressRect = progressContainer.getBoundingClientRect();
|
837 |
+
const clickX = Math.max(0, Math.min(e.clientX - progressRect.left, progressRect.width));
|
838 |
+
const previewTime = (clickX / progressRect.width) * video.duration;
|
839 |
+
|
840 |
+
// 時間表示を更新
|
841 |
+
const previewMinutes = Math.floor(previewTime / 60);
|
842 |
+
const previewSeconds = Math.floor(previewTime % 60).toString().padStart(2, '0');
|
843 |
+
frameTime.textContent = `${previewMinutes}:${previewSeconds}`;
|
844 |
+
|
845 |
+
// プレビュー位置を更新
|
846 |
+
framePreview.style.left = `${e.clientX - 80}px`; // 中央寄せ
|
847 |
+
framePreview.style.display = 'block';
|
848 |
+
|
849 |
+
// キャッシュがあればそれを使う
|
850 |
+
const cacheKey = Math.floor(previewTime);
|
851 |
+
if (frameCache[cacheKey]) {
|
852 |
+
previewImage.src = frameCache[cacheKey];
|
853 |
+
return;
|
854 |
+
}
|
855 |
+
|
856 |
+
// フレームを取得
|
857 |
+
VideoForThumbnail.currentTime = previewTime;
|
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() {
|
885 |
subtitlesEnabled = !subtitlesEnabled;
|
|
|
924 |
toggleSubtitles();
|
925 |
}
|
926 |
|
927 |
+
// フレームプレビュー関連
|
928 |
+
function showFramePreview(e) {
|
929 |
+
if (!videoBlob) return;
|
930 |
+
|
931 |
+
const progressRect = progressContainer.getBoundingClientRect();
|
932 |
+
const clickX = e.clientX - progressRect.left;
|
933 |
+
const duration = video.duration;
|
934 |
+
const previewTime = (clickX / progressRect.width) * duration;
|
935 |
+
|
936 |
+
// 時間表示を更新
|
937 |
+
const previewMinutes = Math.floor(previewTime / 60);
|
938 |
+
const previewSeconds = Math.floor(previewTime % 60).toString().padStart(2, '0');
|
939 |
+
frameTime.textContent = `${previewMinutes}:${previewSeconds}`;
|
940 |
+
|
941 |
+
// プレビュー位置を更新
|
942 |
+
framePreview.style.left = `${e.clientX}px`;
|
943 |
+
framePreview.style.display = 'block';
|
944 |
+
|
945 |
+
// キャッシュがあればそれを使う
|
946 |
+
const cacheKey = Math.floor(previewTime);
|
947 |
+
if (frameCache[cacheKey]) {
|
948 |
+
previewImage.src = frameCache[cacheKey];
|
949 |
+
return;
|
950 |
+
}
|
951 |
+
|
952 |
+
// フレームを取得
|
953 |
+
videoFrames({
|
954 |
+
url: URL.createObjectURL(videoBlob),
|
955 |
+
count: 1,
|
956 |
+
startTime: previewTime,
|
957 |
+
endTime: previewTime + 0.1
|
958 |
+
}).then((frames) => {
|
959 |
+
if (frames.length > 0) {
|
960 |
+
previewImage.src = frames[0].image;
|
961 |
+
frameCache[cacheKey] = frames[0].image; // キャッシュに保存
|
962 |
+
}
|
963 |
+
}).catch(err => {
|
964 |
+
console.error('Error getting video frame:', err);
|
965 |
+
});
|
966 |
+
}
|
967 |
+
|
968 |
+
function hideFramePreview() {
|
969 |
+
framePreview.style.display = 'none';
|
970 |
+
}
|
971 |
+
|
972 |
// 右クリックメニュー関連
|
973 |
function showContextMenu(e) {
|
974 |
+
e.preventDefault();
|
975 |
+
contextMenu.style.display = 'block';
|
976 |
+
contextMenu.style.left = `${e.clientX}px`;
|
977 |
+
contextMenu.style.top = `${e.clientY}px`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
978 |
}
|
979 |
|
980 |
function hideContextMenu() {
|
981 |
+
contextMenu.style.display = 'none';
|
|
|
982 |
}
|
983 |
|
984 |
// 音声/字幕のみモード
|
|
|
1025 |
progressContainer.addEventListener('click', setProgress);
|
1026 |
progressContainer.addEventListener('mousedown', () => isDragging = true);
|
1027 |
document.addEventListener('mouseup', () => isDragging = false);
|
1028 |
+
// マウスホバー時のプレビュー表示
|
1029 |
+
progressContainer.addEventListener('mousemove', function(e) {
|
1030 |
+
if (isDragging) {
|
1031 |
+
const width = progressContainer.clientWidth;
|
1032 |
+
const clickX = e.offsetX;
|
1033 |
+
const duration = video.duration;
|
1034 |
+
const previewTime = (clickX / width) * duration;
|
1035 |
+
|
1036 |
+
// プレビュー位置を更新
|
1037 |
+
previewContainer.style.left = `${e.clientX - 100}px`;
|
1038 |
+
previewContainer.style.bottom = '60px';
|
1039 |
+
previewContainer.style.display = 'block';
|
1040 |
+
|
1041 |
+
// 時間表示を更新
|
1042 |
+
const minutes = Math.floor(previewTime / 60);
|
1043 |
+
const seconds = Math.floor(previewTime % 60).toString().padStart(2, '0');
|
1044 |
+
document.getElementById('previewTime').textContent = `${minutes}:${seconds}`;
|
1045 |
+
|
1046 |
+
// サムネイル画像を更新
|
1047 |
+
updateThumbnail(previewTime);
|
1048 |
+
} else {
|
1049 |
+
previewContainer.style.display = 'none';
|
1050 |
+
}
|
1051 |
+
});
|
1052 |
+
|
1053 |
+
// サムネイル画像更新関数
|
1054 |
+
function updateThumbnail(time) {
|
1055 |
+
VideoForThumbnail.currentTime = time;
|
1056 |
+
|
1057 |
+
VideoForThumbnail.addEventListener('seeked', function() {
|
1058 |
+
canvas.width = VideoForThumbnail.videoWidth;
|
1059 |
+
canvas.height = VideoForThumbnail.videoHeight;
|
1060 |
+
ctx.drawImage(VideoForThumbnail, 0, 0, canvas.width, canvas.height);
|
1061 |
+
preview.src = canvas.toDataURL('image/jpeg');
|
1062 |
+
}, { once: true });
|
1063 |
+
}
|
1064 |
+
|
1065 |
+
|
1066 |
+
// プログレスバーのホバーイベント
|
1067 |
+
progressContainer.addEventListener('mouseenter', () => {
|
1068 |
+
isHoveringProgress = true;
|
1069 |
+
clearTimeout(hoverTimeout);
|
1070 |
+
});
|
1071 |
+
|
1072 |
+
progressContainer.addEventListener('mouseleave', () => {
|
1073 |
+
isHoveringProgress = false;
|
1074 |
+
hoverTimeout = setTimeout(() => {
|
1075 |
+
if (!isDragging) hideFramePreview();
|
1076 |
+
}, 300);
|
1077 |
+
});
|
1078 |
|
1079 |
volumeBtn.addEventListener('click', toggleMute);
|
1080 |
volumeSlider.addEventListener('input', handleVolumeChange);
|
1081 |
fullscreenBtn.addEventListener('click', goFullscreen);
|
1082 |
|
1083 |
// 全画面変更イベントを監視
|
1084 |
+
document.addEventListener('fullscreenchange', updateSubtitleScaleForFullscreen);
|
1085 |
+
document.addEventListener('webkitfullscreenchange', updateSubtitleScaleForFullscreen);
|
1086 |
+
document.addEventListener('mozfullscreenchange', updateSubtitleScaleForFullscreen);
|
1087 |
+
document.addEventListener('MSFullscreenChange', updateSubtitleScaleForFullscreen);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1088 |
|
1089 |
// 右クリックメニューイベント
|
1090 |
videoContainer.addEventListener('contextmenu', showContextMenu);
|
|
|
1102 |
updateProgress();
|
1103 |
normalVideoWidth = videoContainer.clientWidth;
|
1104 |
});
|
|
|
1105 |
video.addEventListener("loadeddata", async () => {
|
1106 |
+
const response = await fetch(video.src);
|
1107 |
+
videoBlob = await response.blob();
|
1108 |
+
});
|
1109 |
+
|
1110 |
+
// 保存
|
1111 |
+
video.addEventListener('timeupdate', () => {
|
1112 |
+
localStorage.setItem('radioTaisoTime', video.currentTime);
|
1113 |
+
});
|
1114 |
+
|
1115 |
+
// 復元
|
1116 |
+
window.addEventListener('load', () => {
|
1117 |
+
setupFramePreview();
|
1118 |
+
setupFullscreenContextMenu();
|
1119 |
+
const savedTime = parseFloat(localStorage.getItem('radioTaisoTime'));
|
1120 |
+
if (!isNaN(savedTime)) {
|
1121 |
+
video.currentTime = savedTime;
|
1122 |
+
}
|
1123 |
+
|
1124 |
+
document.addEventListener('fullscreenchange', () => {
|
1125 |
+
updateSubtitleScaleForFullscreen();
|
1126 |
+
setupFullscreenContextMenu();
|
1127 |
+
});
|
1128 |
+
document.addEventListener('webkitfullscreenchange', () => {
|
1129 |
+
updateSubtitleScaleForFullscreen();
|
1130 |
+
setupFullscreenContextMenu();
|
1131 |
+
});
|
1132 |
+
document.addEventListener('mozfullscreenchange', () => {
|
1133 |
+
updateSubtitleScaleForFullscreen();
|
1134 |
+
setupFullscreenContextMenu();
|
1135 |
+
});
|
1136 |
+
document.addEventListener('MSFullscreenChange', () => {
|
1137 |
+
updateSubtitleScaleForFullscreen();
|
1138 |
+
setupFullscreenContextMenu();
|
1139 |
+
});
|
1140 |
+
});
|
1141 |
+
document.addEventListener('keydown', (e) => {
|
1142 |
+
if (e.target.tagName === 'INPUT') return; // 入力中は無視
|
1143 |
+
switch (e.key.toLowerCase()) {
|
1144 |
+
case ' ': e.preventDefault(); togglePlayPause(); break;
|
1145 |
+
case 'f': goFullscreen(); break;
|
1146 |
+
case 'm': toggleMute(); break;
|
1147 |
+
case 'arrowright': video.currentTime += 5; break;
|
1148 |
+
case 'arrowleft': video.currentTime -= 5; break;
|
1149 |
+
}
|
1150 |
+
});
|
1151 |
+
|
1152 |
// CSS変数を設定
|
1153 |
document.documentElement.style.setProperty('--subtitle-scale', '1');
|
1154 |
document.documentElement.style.setProperty('--subtitle-border-radius', '10px');
|