|
@@ -748,7 +748,10 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
this.holdSteam();
|
|
this.holdSteam();
|
|
|
|
|
|
//console.log('joystickRes有mediaSrc', joystickRes.mediaSrc);
|
|
//console.log('joystickRes有mediaSrc', joystickRes.mediaSrc);
|
|
- console.log('handlejoystick-angle->相机角度-------------------------:'+joystickRes['newUserStates'][0].playerState.camera.angle.yaw);
|
|
|
|
|
|
+ console.log(
|
|
|
|
+ 'handlejoystick-angle->相机角度-------------------------:' +
|
|
|
|
+ joystickRes['newUserStates'][0].playerState.camera.angle.yaw,
|
|
|
|
+ );
|
|
let streamData: StreamFrameType | StreamMetaType;
|
|
let streamData: StreamFrameType | StreamMetaType;
|
|
|
|
|
|
// if (this.joystickFrameCnt === -1) {
|
|
// if (this.joystickFrameCnt === -1) {
|
|
@@ -1062,12 +1065,17 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
this.startSteaming.next(true);
|
|
this.startSteaming.next(true);
|
|
// this.startStream();
|
|
// this.startStream();
|
|
// this.handleStream();
|
|
// this.handleStream();
|
|
|
|
+ this.channel.onBufferedAmountLow(() => {
|
|
|
|
+ console.log('onBufferedAmountLow');
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
handleDataChanelClose(): void {
|
|
handleDataChanelClose(): void {
|
|
|
|
+ this.roQueue.clean();
|
|
this.stopStream();
|
|
this.stopStream();
|
|
this.startSteaming.next(false);
|
|
this.startSteaming.next(false);
|
|
this.streamService.closeChannel();
|
|
this.streamService.closeChannel();
|
|
|
|
+ this.cleanMoveSteam();
|
|
// const exitRequest: ExitRequest = {
|
|
// const exitRequest: ExitRequest = {
|
|
// action_type: 1002,
|
|
// action_type: 1002,
|
|
// user_id: this.user_id,
|
|
// user_id: this.user_id,
|
|
@@ -1132,6 +1140,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
this.requestIFrameQueueSub = this.requestIFrameQueue.subscribe(
|
|
this.requestIFrameQueueSub = this.requestIFrameQueue.subscribe(
|
|
async (frameData: StreamFrameType) => {
|
|
async (frameData: StreamFrameType) => {
|
|
if (frameData) {
|
|
if (frameData) {
|
|
|
|
+ this.globalOptLock = true;
|
|
const nextFrame = this.frameCnt.getValue() + 1;
|
|
const nextFrame = this.frameCnt.getValue() + 1;
|
|
this.logger.warn('lostIframe', nextFrame);
|
|
this.logger.warn('lostIframe', nextFrame);
|
|
frameData.frame = nextFrame;
|
|
frameData.frame = nextFrame;
|
|
@@ -1145,6 +1154,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
clearTimeout(this._packFrameTimeout);
|
|
clearTimeout(this._packFrameTimeout);
|
|
this._packFrameTimeout = setTimeout(() => {
|
|
this._packFrameTimeout = setTimeout(() => {
|
|
this.resumeStream();
|
|
this.resumeStream();
|
|
|
|
+ this.globalOptLock = false;
|
|
}, 100);
|
|
}, 100);
|
|
} else {
|
|
} else {
|
|
console.error('补帧有误:', JSON.stringify(frameData));
|
|
console.error('补帧有误:', JSON.stringify(frameData));
|
|
@@ -1221,6 +1231,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
this.peer.bytesReceived() +
|
|
this.peer.bytesReceived() +
|
|
' bytesSent: ' +
|
|
' bytesSent: ' +
|
|
this.peer.bytesSent(),
|
|
this.peer.bytesSent(),
|
|
|
|
+ ' state: ' + this.peer.state(),
|
|
);
|
|
);
|
|
if (frame === 1) {
|
|
if (frame === 1) {
|
|
// redisData = await this.rotateService.echo(this.user_id, true);
|
|
// redisData = await this.rotateService.echo(this.user_id, true);
|