Explorar el Código

(省博-线上展馆)热点视频和屏幕视频可以同时播放

xzw hace 4 años
padre
commit
ba4c293c48

+ 47 - 37
web/public/static/js/main_2020_show.js

@@ -16351,6 +16351,48 @@ window.Modernizr = function(n, e, t) {
             return src
             
         }
+        
+        
+        hot.prototype.closePopup = function(){
+            
+              
+            if(!g_currentHot) return;
+            
+            
+            if(this.overlayPausedByThis){
+                this.overlayPausedByThis.forEach(e=>e.videoControl(true))
+                
+                this.overlayPausedByThis = null
+            }
+            
+            g_currentHot = null;
+            
+            
+            return;
+            
+            
+            var hotPop = document.getElementById('popup'); 
+            hotPop.style.display = "none";
+            document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
+            $("#popup iframe:last").remove();
+            var _bgaudio = document.getElementById("bgaudio");
+            //判断音乐是否暂停或者是否存在
+            /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
+            {
+                //g_bgAudio.play();
+                manage.switchBgmState(true)
+            }; */
+            
+            if(g_bgAudio && g_bgAudio.pauseByHot){
+                manage.switchBgmState(true)
+            }
+            
+            
+            //$('#player').off("click",this.closePopup);
+            return false
+        }
+         
+        
 		hot.prototype.examine = function(e, options) { 
             options = options || {}
         
@@ -16370,7 +16412,7 @@ window.Modernizr = function(n, e, t) {
                 if(this.infoAttribute.video.length){//add
                     var playedOverlay = player.overlayGroup.children.filter(e=>e.hasSound && e.overlayType == 'video' && !e.plane.material.map.image.paused)
                     playedOverlay.forEach(e=>e.videoControl(false))
-                    
+                    this.overlayPausedByThis = playedOverlay;
                 }
                  
               
@@ -22318,39 +22360,7 @@ window.Modernizr = function(n, e, t) {
 				return str; 
 			}
 			//------end	 
-			n.prototype.closePopup = function() {//xzw  关闭热点页面
-            
-            
-            
-            
-              
-				if(!g_currentHot) return;
-				g_currentHot = null;
-                
-                
-                return;
-                
-                
-				var hotPop = document.getElementById('popup'); 
-				hotPop.style.display = "none";
-				document.querySelector(".popup-content").removeChild(document.getElementById("id1"));
-				$("#popup iframe:last").remove();
-                var _bgaudio = document.getElementById("bgaudio");
-                //判断音乐是否暂停或者是否存在
-                /* if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0 && g_play === 1)
-                {
-                    //g_bgAudio.play();
-                    manage.switchBgmState(true)
-                }; */
-                
-                if(g_bgAudio && g_bgAudio.pauseByHot){
-                    manage.switchBgmState(true)
-                }
-                
-                
-				//$('#player').off("click",this.closePopup);
-                return false
-			}  
+			 
 				 
 			 
 			
@@ -22522,12 +22532,12 @@ window.Modernizr = function(n, e, t) {
                 // lzb
                 window.getSeft && getSeft(this);
 
-                //判断是否是移动端,如果是给关闭按钮添加touchstart事件
+                /* //判断是否是移动端,如果是给关闭按钮添加touchstart事件
                 if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
                     $('.hotspotcon').on("touchstart",this.closePopup.bind(this)); 
                 }else{
                     $('.hotspotcon').on("click",this.closePopup.bind(this)); 
-                }
+                } */
             }
             ,
             n.prototype.onMouseDown = function(e) {
@@ -23959,7 +23969,7 @@ window.Modernizr = function(n, e, t) {
             }
             ,
             n.prototype.flyDirection = function(e, t, i) {
-				this.closePopup();//xzw add
+				window.g_currentHot  && g_currentHot.closePopup();//xzw add
                 var n = $.Deferred();
                 this.history.invalidate();
                 var r = this.closestPanoInDirection(e, t, i);

+ 1 - 0
web/public/static/js/overlay.js

@@ -328,6 +328,7 @@ var initOverlay = function(THREE) {
                
             if(state == 'stop'){
                 video.currentTime = 0; //需要至少触发两次,保证停在第一帧画面,否则是黑屏
+               
             }
             video.shouldPlay = false
             //console.log("pause")

+ 5 - 1
web/src/components/hotspot/index.vue

@@ -33,7 +33,11 @@ export default {
   methods:{
     close(){
       this.$hideHotspot()
-      g_currentHot = null
+      
+      g_currentHot.closePopup()
+    
+       
+      
       if(g_bgAudio && g_bgAudio.pauseByHot){
         window.manage.switchBgmState(true);
       }