diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index 9553e584..6a0b86d9 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -906,6 +906,7 @@ export class GameScene extends ResizableScene implements CenterListener { * @param delta The delta time in ms since the last frame. This is a smoothed and capped value based on the FPS rate. */ update(time: number, delta: number) : void { + mediaManager.setLastUpdateScene(); this.currentTick = time; this.CurrentPlayer.moveUser(delta); @@ -959,8 +960,6 @@ export class GameScene extends ResizableScene implements CenterListener { this.CurrentPlayer.x = this.startX; this.CurrentPlayer.y = this.startY; } - - mediaManager.setLastUpdateScene(); } private checkToExit(): {key: string, hash: string} | null { diff --git a/front/src/WebRtc/MediaManager.ts b/front/src/WebRtc/MediaManager.ts index 044a14ee..9dfbf7c4 100644 --- a/front/src/WebRtc/MediaManager.ts +++ b/front/src/WebRtc/MediaManager.ts @@ -661,10 +661,8 @@ export class MediaManager { private pingCameraStatus(){ setTimeout(() => { console.log('ping camera status'); - this.getCamera().then((stream: MediaStream) => { - this.triggerUpdatedLocalStreamCallbacks(stream); - this.pingCameraStatus(); - }); + this.triggerUpdatedLocalStreamCallbacks(this.localStream); + this.pingCameraStatus(); }, 30000); }