zhouenguang 3 rokov pred
rodič
commit
38887d48b9
2 zmenil súbory, kde vykonal 11 pridanie a 14 odobranie
  1. 3 2
      modules/Charactor.js
  2. 8 12
      modules/index.js

+ 3 - 2
modules/Charactor.js

@@ -106,8 +106,9 @@ export default class Charactor {
         charactor.walkData.currentPoint++
 
         // 更新房间的视频贴图
-        let video = charactor.walkData.pathArr[charactor.walkData.currentPoint].video
-        charactorManager.app.updateHouseVideo(video)
+        // let video = charactor.walkData.pathArr[charactor.walkData.currentPoint].video
+        let video = charactor.walkData.pathArr[1].video
+        charactor.walkData.currentPoint == 1 && charactorManager.app.updateHouseVideo(video)
 
         let newPos = charactor.walkData.pathArr[charactor.walkData.currentPoint].point
 

+ 8 - 12
modules/index.js

@@ -172,23 +172,19 @@ export default class App {
             console.log("[3D] getSocketVideo: ", data)
 
             if(this.getWalkVideo) {
-                // 获得行走视频
-                let dataArr = [data]
-                let path = this.currentPoints.map( (point, index) => { 
                     
-                    const blob = new Blob( dataArr.slice(
-                        index / this.currentPoints.length * dataArr.length,
-                        (index + 1) / this.currentPoints.length * dataArr.length
-                    ), { type: 'application/video' })
+                const blob = new Blob( [data], { type: 'application/video' })
 
-                    const url = URL.createObjectURL(blob)
-                    setTimeout(function () {
-                        URL.revokeObjectURL(url)
-                    }, 3000)
+                const url = URL.createObjectURL(blob)
+                setTimeout(function () {
+                    URL.revokeObjectURL(url)
+                }, 3000)
 
+                // 获得行走视频
+                let path = this.currentPoints.map( (point, index) => { 
                     return { 
                         point: new BABYLON.Vector3(point.location.x, 0, point.location.z), 
-                        video: common.createVideoElement0(url)
+                        video: index == 1 && common.createVideoElement0(url)
                     } 
                 })