tremble 4 years ago
parent
commit
d021604584
3 changed files with 47 additions and 18 deletions
  1. 44 15
      SuperTwo762/js/main_2020_show.js
  2. 2 2
      SuperTwo762/js/myShow.js
  3. 1 1
      ZAJSG/Model.html

+ 44 - 15
SuperTwo762/js/main_2020_show.js

@@ -81,7 +81,7 @@ var loadVideo = ()=>{
     player.model.chunks.splice(1,1) 
     window.videoShow = video 
     playVideo()
-    
+    window.videoPlane.name = 'videoPlane'
     
     video.addEventListener('loadeddata', ()=>{
         console.log( "video loaded!!!") 
@@ -105,11 +105,25 @@ var loadVideo = ()=>{
     
 }
 
-var playVideo = ()=>{
-    window.videoShow && window.videoShow.play()
-    loadedVideo && changeVideoMat()
-    
-}
+
+ 
+var playVideo = (()=>{
+    var shouldPlay = true //只和用户点击有关,不点击时都是true
+    return (state)=>{ 
+        if(state != void 0) shouldPlay = state
+        if(shouldPlay){
+            window.videoShow && window.videoShow.play()
+        }else{
+            window.videoShow && window.videoShow.pause()
+        }
+        
+        loadedVideo && changeVideoMat()
+    } 
+})()
+
+
+
+
 var changeVideoMat = function(){
     window.videoPlane.material = videoMat;
 }
@@ -4502,6 +4516,9 @@ window.Modernizr = function(n, e, t) {
                     i = !1
                 }
                 i && this.emit(u.Move, "key")
+                if(e == 27){
+                    window.player.closePopup()
+                }
             }
             ,
             n.prototype.onKeyUp = function(e) {
@@ -22004,26 +22021,26 @@ window.Modernizr = function(n, e, t) {
                     case p.UPARROW:
                     case p.W:
                     
-                        videoPlane.position.z+=0.01
+                        //videoPlane.position.z+=0.01
                     
-                        //this.flyLocalDirection(d.FORWARD.clone());
+                        this.flyLocalDirection(d.FORWARD.clone());
                         break;
                     case p.DOWNARROW:
                     case p.S:
-                        videoPlane.position.z-=0.01
+                        //videoPlane.position.z-=0.01
                     
-                        //this.flyLocalDirection(d.BACK.clone());
+                        this.flyLocalDirection(d.BACK.clone());
                         break;
                     case p.A:
-                        videoPlane.position.x-=0.01
+                        //videoPlane.position.x-=0.01
                     
                     
-                        //this.flyLocalDirection(d.LEFT.clone());
+                        this.flyLocalDirection(d.LEFT.clone());
                         break;
                     case p.D:
-                        videoPlane.position.x+=0.01
+                        //videoPlane.position.x+=0.01
                     
-                        //this.flyLocalDirection(d.RIGHT.clone())
+                        this.flyLocalDirection(d.RIGHT.clone())
                     }
             }
             ,
@@ -22067,9 +22084,10 @@ window.Modernizr = function(n, e, t) {
                         overlay.overlayType == "video" &&  overlay.plane.material.map.image.play()
                     })
                     this.overlayInitedPlay = true
+                    playVideo()//add
                 }
                 
-                playVideo()//add
+                
                 
                 
             }
@@ -22606,6 +22624,11 @@ window.Modernizr = function(n, e, t) {
             
             n.prototype.clickOverlay = function(overlay){
                 if(this.openOverlay && !overlay)return;
+                if(overlay == window.videoPlane){
+                    if(overlay.material.map.image.paused) playVideo(true)
+                    else playVideo(false)
+                    return  
+                }
                 var plane = overlay.plane;
                 
                 if(overlay.overlayType == "video"){
@@ -22662,6 +22685,12 @@ window.Modernizr = function(n, e, t) {
                 
 				this.intersectHot = null;
                 
+                if(o.object == window.videoPlane){
+                    this.hoveringPlane = window.videoPlane;
+                    $("#player").css("cursor","pointer");	
+                    return
+                }
+                
                 var intersect = this.hoverOverlay(this.overlayGroup && o && o.object.parent.parent == this.overlayGroup && o.object)
                 
        

+ 2 - 2
SuperTwo762/js/myShow.js

@@ -1,7 +1,7 @@
 var g_ProjectName=window.location.pathname.substring(window.location.pathname.indexOf("/")+1,window.location.pathname.lastIndexOf("/"));
-// var g_Prefix="https://super.4dage.com/";
+var g_Prefix="https://super.4dage.com/";
 // var g_Prefix=window.location.href.substring(0,window.location.href.indexOf("/index.html")+1);
-var g_Prefix=window.location.origin+'/';
+// var g_Prefix=window.location.origin+'/';
 
 var s = window.location.href.split('/');
 s.pop();

+ 1 - 1
ZAJSG/Model.html

@@ -40,7 +40,7 @@
                 <span>文物介绍</span>
             </div>
         </div> -->
-        <span id="companyText" class="loading animated ">四维时代提供技术支持</span>
+        <!-- <span id="companyText" class="loading animated ">四维时代提供技术支持</span> -->
     </div>
     <script src="js/jquery.js"></script>
     <!-- <script src="js/constant.js"></script> -->