Browse Source

fix: 热点视频声音在背景音不播时播

xzw 1 year ago
parent
commit
23802501f7
2 changed files with 10 additions and 2 deletions
  1. 6 2
      js/Hot.js
  2. 4 0
      js/manage.js

+ 6 - 2
js/Hot.js

@@ -355,7 +355,7 @@ window.initHot = function(model){
                 
                 
                 video.volume = 0
-                video.muted = true
+                video.muted = !!manage.bgmShouldPlay//true
                 video.currentTime = 0
                 
                 this.material_.map = new THREE.VideoTexture(video) 
@@ -989,7 +989,11 @@ window.initHot = function(model){
         }     
         
         
-                    
+        updateMute(){
+            if(this.texType == 'video'){
+                this.texMedia.muted = !!manage.bgmShouldPlay//true
+            }
+        }        
                 
             
             

+ 4 - 0
js/manage.js

@@ -1190,6 +1190,10 @@ Manage.prototype.switchBgmState = function(state){//按钮的状态完全代表
         SoundManager.pause('bgm')
     }
     
+    player.model.hotGroup.children.forEach(hot=>{
+        hot.updateMute()
+    })
+    
     
     /* if(!g_bgAudio || !g_bgAudio.src) return;