|
@@ -11,6 +11,7 @@ import configuration from 'src/config/configuration';
|
|
|
|
|
|
const MaxDelayTime = 80; //超过这个值就需要干预(操作杆)
|
|
const MaxDelayTime = 80; //超过这个值就需要干预(操作杆)
|
|
const MaxBufferCameraInfo = 3; //超过这个值就需要干预(操作杆)
|
|
const MaxBufferCameraInfo = 3; //超过这个值就需要干预(操作杆)
|
|
|
|
+const MaxNet = 3;
|
|
|
|
|
|
const seqExeAsyncFn = (asyncFn) => {
|
|
const seqExeAsyncFn = (asyncFn) => {
|
|
let runPromise = null;
|
|
let runPromise = null;
|
|
@@ -798,14 +799,19 @@ export class MoveService implements OnModuleInit {
|
|
|
|
|
|
console.log('20220708_延时->'+time_delay);
|
|
console.log('20220708_延时->'+time_delay);
|
|
// //网络延迟的情况下,就暂时不推流
|
|
// //网络延迟的情况下,就暂时不推流
|
|
- // if(time_delay && time_delay>MaxDelayTime){
|
|
|
|
- // console.log('20220708_cameraInfos不取值');
|
|
|
|
- // return this.reply;
|
|
|
|
- // }
|
|
|
|
- // if(user.lastJoyStickMediaSrc){
|
|
|
|
- // user.lastJoyStickMediaSrc = false;
|
|
|
|
- // return this.reply;
|
|
|
|
- // }
|
|
|
|
|
|
+ if(time_delay && time_delay>MaxDelayTime){
|
|
|
|
+ user.netQua = 0;
|
|
|
|
+ }
|
|
|
|
+ else if(time_delay && time_delay<MaxDelayTime && user.netQua<MaxNet){
|
|
|
|
+ ++user.netQua
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(user.netQua<MaxNet){
|
|
|
|
+ if(user.lastJoyStickMediaSrc){
|
|
|
|
+ user.lastJoyStickMediaSrc = false;
|
|
|
|
+ return this.reply;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
const cameraInfo = this.getCameraInfo();
|
|
const cameraInfo = this.getCameraInfo();
|
|
if (cameraInfo != null) {
|
|
if (cameraInfo != null) {
|
|
console.log(
|
|
console.log(
|
|
@@ -1269,7 +1275,7 @@ export class MoveService implements OnModuleInit {
|
|
chooseBreakPointId,
|
|
chooseBreakPointId,
|
|
index,
|
|
index,
|
|
);
|
|
);
|
|
- this.setCameraInfo(appId, moveFrames, breakPointId, chooseBreakPointId);
|
|
|
|
|
|
+ this.setCameraInfo(appId, userId, moveFrames, breakPointId, chooseBreakPointId);
|
|
|
|
|
|
user.breakPointId = chooseBreakPointId;
|
|
user.breakPointId = chooseBreakPointId;
|
|
|
|
|
|
@@ -1308,18 +1314,22 @@ export class MoveService implements OnModuleInit {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- setCameraInfo(appId, moveFrames, startBreakPointId, endBreakPointId) {
|
|
|
|
|
|
+ setCameraInfo(appId, userId,moveFrames, startBreakPointId, endBreakPointId) {
|
|
// let moveInterval = 1;
|
|
// let moveInterval = 1;
|
|
// console.log('20220708_cameraInfos设置->'+this.cameraInfos.length);
|
|
// console.log('20220708_cameraInfos设置->'+this.cameraInfos.length);
|
|
// if(this.cameraInfos.length>MaxBufferCameraInfo){
|
|
// if(this.cameraInfos.length>MaxBufferCameraInfo){
|
|
// moveInterval = 1;
|
|
// moveInterval = 1;
|
|
// }
|
|
// }
|
|
|
|
+ const user = this.users[userId];
|
|
let moveInterval = 2;
|
|
let moveInterval = 2;
|
|
let flag = false;
|
|
let flag = false;
|
|
for (let i = 0; i < moveFrames.length; ++i) {
|
|
for (let i = 0; i < moveFrames.length; ++i) {
|
|
- if(i!= 0 && i!= moveFrames.length-1 && i%moveInterval == 0){
|
|
|
|
- continue;
|
|
|
|
|
|
+ if(user.netQua<MaxNet){
|
|
|
|
+ if(i!= 0 && i!= moveFrames.length-1 && i%moveInterval == 0){
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
moveFrames[i].startBreakPointId = startBreakPointId;
|
|
moveFrames[i].startBreakPointId = startBreakPointId;
|
|
moveFrames[i].endBreakPointId = endBreakPointId;
|
|
moveFrames[i].endBreakPointId = endBreakPointId;
|
|
moveFrames[i].mediaSrc =
|
|
moveFrames[i].mediaSrc =
|