test pc 3 лет назад
Родитель
Сommit
a215f69819
1 измененных файлов с 17 добавлено и 12 удалено
  1. 17 12
      src/move/move.service.ts

+ 17 - 12
src/move/move.service.ts

@@ -797,9 +797,13 @@ export class MoveService implements OnModuleInit {
         this.reply.actionResponses[0].actionType = actionType;
 
         console.log('20220708_延时->'+time_delay);
-        //网络延迟的情况下,就暂时不推流
-        if(time_delay && time_delay>MaxDelayTime){
-          console.log('20220708_cameraInfos不取值');
+        // //网络延迟的情况下,就暂时不推流
+        // if(time_delay && time_delay>MaxDelayTime){
+        //   console.log('20220708_cameraInfos不取值');
+        //   return this.reply;
+        // }
+        if(user.lastJoyStickMediaSrc){
+          user.lastJoyStickMediaSrc = false;
           return this.reply;
         }
         const cameraInfo = this.getCameraInfo();
@@ -815,6 +819,7 @@ export class MoveService implements OnModuleInit {
           if (cameraInfo.mediaSrc) {
             this.reply.mediaSrc = cameraInfo.mediaSrc;
             this.reply.isIDR = cameraInfo.isIDR;
+            user.lastJoyStickMediaSrc = true;
           }
 
           user.camera.position = JSON.parse(
@@ -1303,17 +1308,17 @@ export class MoveService implements OnModuleInit {
   }
 
   setCameraInfo(appId, moveFrames, startBreakPointId, endBreakPointId) {
-    let moveInterval = 1;
-    console.log('20220708_cameraInfos设置->'+this.cameraInfos.length);
-    if(this.cameraInfos.length>MaxBufferCameraInfo){
-      moveInterval = 1;
-    }
-
+    // let moveInterval = 1;
+    // console.log('20220708_cameraInfos设置->'+this.cameraInfos.length);
+    // if(this.cameraInfos.length>MaxBufferCameraInfo){
+    //   moveInterval = 1;
+    // }
+    let moveInterval = 4;
     let flag = false;
     for (let i = 0; i < moveFrames.length; ++i) {
-      // if(i!=0 && i%moveInterval == 0){
-      //   continue;
-      // }
+      if(i!=0 && i%moveInterval == 0){
+        continue;
+      }
       moveFrames[i].endBreakPointId = endBreakPointId;
       moveFrames[i].mediaSrc =
         '/' +