瀏覽代碼

Fix footer and playing when closed bug

niels 4 年之前
父節點
當前提交
f56ef57911
共有 3 個文件被更改,包括 7 次插入3 次删除
  1. 0 1
      chube.py
  2. 1 0
      static/css/main.css
  3. 6 2
      static/js/main.js

+ 0 - 1
chube.py

@@ -1,4 +1,3 @@
-import re
 from threading import RLock
 from typing import Optional, Iterator, Dict, List
 

+ 1 - 0
static/css/main.css

@@ -108,6 +108,7 @@ input, select, textarea, button {
     bottom: 0;
     width: 100%;
     text-align: center;
+    z-index: -1;
 }
 
 .footer, .footer a {

+ 6 - 2
static/js/main.js

@@ -473,10 +473,14 @@ function mediaActionProcessor(ws, data) {
     const { action, ended_id, current_id, enable } = data;
     if (action === MediaAction.PLAY && state === PlayerState.PAUSED) {
         state = PlayerState.PLAYING
-        player.playVideo();
+        if (playerActive) {
+            player.playVideo();
+        }
     } else if (action === MediaAction.PAUSE && state === PlayerState.PLAYING) {
         state = PlayerState.PAUSED
-        player.pauseVideo();
+        if (playerActive) {
+            player.pauseVideo();
+        }
     } else if (action === MediaAction.NEXT) {
         if (videoPlaying !== null && videoPlaying.id === ended_id) {
             const vid = popVideo()