xzw 4 yıl önce
ebeveyn
işleme
83da273a38

+ 26 - 11
web/public/static/js/main_2020_show.js

@@ -213,18 +213,22 @@ var backToOriginVideo = function(ifPause){
     rightScreen.originVideoMap.image.currentTime = 0 
     
     if(leftScreen.visible && !ifPause){
-        video.oncanplaythrough = function() {
+        video.shouldPlay = true
+        /* video.oncanplaythrough = function() {
             video.play();
-        } 
+        } */ 
     }else{
-        video.oncanplaythrough = null
+        //video.oncanplaythrough = null
+        video.shouldPlay = false
         video.pause()  
     }
     
     
     if(rightScreen.visible && !ifPause){
+        rightScreen.originVideoMap.image.shouldPlay = true
         rightScreen.originVideoMap.image.play()
     }else{
+        rightScreen.originVideoMap.image.shouldPlay = false
         rightScreen.originVideoMap.image.pause()
     }
     
@@ -297,8 +301,8 @@ var switchToOrigin = function(){
   
 /* var textarea = document.createElement('textarea');
 textarea.id = "consoleLog";
-textarea.style.width = "140px";
-textarea.style.height = "300px";
+textarea.style.width = "70px";
+textarea.style.height = "100px";
 textarea.style.position = "absolute";
 textarea.style.right = "0px";
 textarea.style.bottom = "0px";
@@ -18363,7 +18367,13 @@ window.Modernizr = function(n, e, t) {
                     } 
                     
                 })  
-
+                video.oncanplaythrough = function() {
+                    if(video.shouldPlay){
+                        video.play()
+                    }else{
+                        video.currentTime = 0 //防止停在上一个视频
+                    }
+                }
                 
                 //////////历史影像左右两侧    
                 c = player.overlayGroup.children.find(e=>e.sid == '1626743604266') 
@@ -22620,9 +22630,10 @@ window.Modernizr = function(n, e, t) {
                     window.Hotpoint && new Hotpoint().state(this,Hot);
                 }
                
-                /* this.overlayGroup.children.forEach((overlay)=>{
-                    overlay.overlayType == "video" && overlay.visible && overlay.inSight() && overlay.videoControl(true)
-                }) */
+                this.overlayGroup.children.forEach((overlay)=>{
+                    //overlay.overlayType == "video" && overlay.visible && overlay.inSight() && overlay.videoControl(true)
+                    overlay.overlayType == "video" && overlay.plane.material.map.image.shouldPlay && overlay.videoControl(true)
+                })
                  
                 
             }
@@ -50441,8 +50452,12 @@ window.Modernizr = function(n, e, t) {
         n.DataTexture.prototype.constructor = n.DataTexture,
         n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
             function h() {
-                requestAnimationFrame(h),
-                e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
+                requestAnimationFrame(h) 
+                if( (!e.paused /* || window.browser && !browser.isMobile() */)   && e.readyState === e.HAVE_ENOUGH_DATA){
+                    //textarea.value += "updatevideo ";
+                    u.needsUpdate = !0
+                }
+                //e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
             }
             n.Texture.call(this, e, t, i, r, o, a, s, l, c),
             this.generateMipmaps = !1;

+ 18 - 6
web/public/static/js/overlay.js

@@ -70,6 +70,14 @@ var initOverlay = function(THREE) {
                 //禁止右键点击出
 
                 video.src = manage.dealURL(info.file);
+                
+                video.oncanplaythrough = function() {
+                    plane.material.map.needsUpdate = !0
+                    if(video.shouldPlay){
+                        video.play()
+                    }
+                }
+                
                 info.media = video;
                 info.type = "video"
 
@@ -287,24 +295,28 @@ var initOverlay = function(THREE) {
         }
     }
 
-    Overlay.prototype.videoControl = function(state){
+    Overlay.prototype.videoControl = function(state){ 
         if(this.overlayType != "video")return
+        
+        var video = this.plane.material.map.image
+        
         if(!state || state == 'stop'){
             
-            if(!this.plane.material.map.image.paused){
-                this.plane.material.map.image.pause()
+            if(!video.paused){
+                video.pause()
                 if(this.hasSound && g_bgAudio.pauseByVideo){
                     manage.switchBgmState(true)
                 }
             }
                
             if(state == 'stop'){
-                this.plane.material.map.image.currentTime = 0; 
+                video.currentTime = 0; 
             }
-            
+            video.shouldPlay = false
             //console.log("pause")
         }else if(state){ 
-            this.plane.material.map.image.paused && this.plane.material.map.image.play()
+            video.shouldPlay = true
+            video.paused && video.play()
             if(this.hasSound && !g_bgAudio.paused){
                 manage.switchBgmState(false)
                 g_bgAudio.pauseByVideo = true