soiz1 commited on
Commit
5c90552
·
verified ·
1 Parent(s): d3c9dcb

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +35 -13
index.html CHANGED
@@ -460,7 +460,7 @@
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
  }
@@ -619,8 +619,7 @@
619
  <canvas id="canvas">
620
  </canvas>
621
  <!-- サムネイル用の非表示video要素 -->
622
- <video id="video-for-thumbnail" src="v.mp4" preload="auto" style="display:none;">
623
- </video>
624
  <script>
625
  const video = document.getElementById('videoPlayer');
626
  const videoSelect = document.getElementById('videoSelect');
@@ -974,12 +973,24 @@ function setupFramePreview() {
974
  }
975
 
976
  // 右クリックメニュー関連
977
- function showContextMenu(e) {
978
- e.preventDefault();
979
- contextMenu.style.display = 'block';
980
- contextMenu.style.left = `${e.clientX}px`;
981
- contextMenu.style.top = `${e.clientY}px`;
982
- }
 
 
 
 
 
 
 
 
 
 
 
 
983
 
984
  function hideContextMenu() {
985
  contextMenu.style.display = 'none';
@@ -1085,10 +1096,21 @@ function setupFramePreview() {
1085
  fullscreenBtn.addEventListener('click', goFullscreen);
1086
 
1087
  // 全画面変更イベントを監視
1088
- document.addEventListener('fullscreenchange', updateSubtitleScaleForFullscreen);
1089
- document.addEventListener('webkitfullscreenchange', updateSubtitleScaleForFullscreen);
1090
- document.addEventListener('mozfullscreenchange', updateSubtitleScaleForFullscreen);
1091
- document.addEventListener('MSFullscreenChange', updateSubtitleScaleForFullscreen);
 
 
 
 
 
 
 
 
 
 
 
1092
 
1093
  // 右クリックメニューイベント
1094
  videoContainer.addEventListener('contextmenu', showContextMenu);
 
460
  background-color: #0f0f1a;
461
  border: 1px solid #0066ff;
462
  box-shadow: 0 0 15px rgba(0, 102, 255, 0.5);
463
+ z-index: 2147483647 !important;
464
  display: none;
465
  min-width: 200px;
466
  }
 
619
  <canvas id="canvas">
620
  </canvas>
621
  <!-- サムネイル用の非表示video要素 -->
622
+ <video id="video-for-thumbnail" src="v.mp4" preload="auto" style="display:none;"></video>
 
623
  <script>
624
  const video = document.getElementById('videoPlayer');
625
  const videoSelect = document.getElementById('videoSelect');
 
973
  }
974
 
975
  // 右クリックメニュー関連
976
+ function showContextMenu(e) {
977
+ e.preventDefault();
978
+
979
+ // メニューの位置を計算
980
+ const x = e.clientX || e.touches?.[0]?.clientX;
981
+ const y = e.clientY || e.touches?.[0]?.clientY;
982
+
983
+ if (!x || !y) return;
984
+
985
+ contextMenu.style.display = 'block';
986
+ contextMenu.style.left = `${x}px`;
987
+ contextMenu.style.top = `${y}px`;
988
+
989
+ // 全画面時は document にイベントリスナーを追加
990
+ if (document.fullscreenElement) {
991
+ document.addEventListener('click', hideContextMenu);
992
+ }
993
+ }
994
 
995
  function hideContextMenu() {
996
  contextMenu.style.display = 'none';
 
1096
  fullscreenBtn.addEventListener('click', goFullscreen);
1097
 
1098
  // 全画面変更イベントを監視
1099
+ document.addEventListener('fullscreenchange', updateFullscreenEventListeners);
1100
+ document.addEventListener('webkitfullscreenchange', updateFullscreenEventListeners);
1101
+ document.addEventListener('mozfullscreenchange', updateFullscreenEventListeners);
1102
+ document.addEventListener('MSFullscreenChange', updateFullscreenEventListeners);
1103
+
1104
+ function updateFullscreenEventListeners() {
1105
+ if (document.fullscreenElement) {
1106
+ // 全画面時は document にイベントリスナーを設定
1107
+ document.addEventListener('contextmenu', showContextMenu);
1108
+ } else {
1109
+ // 通常時は videoContainer に戻す
1110
+ videoContainer.addEventListener('contextmenu', showContextMenu);
1111
+ document.removeEventListener('contextmenu', showContextMenu);
1112
+ }
1113
+ }
1114
 
1115
  // 右クリックメニューイベント
1116
  videoContainer.addEventListener('contextmenu', showContextMenu);