From 7b8f1826e730a0839acfa025aa29f6a0e3a3858e Mon Sep 17 00:00:00 2001 From: Zac Bergquist Date: Tue, 17 Dec 2024 18:50:36 -0700 Subject: [PATCH] Make sure progress bar stops moving when pausing a desktop recording Closes #42467 --- web/packages/teleport/src/lib/tdp/playerClient.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/packages/teleport/src/lib/tdp/playerClient.ts b/web/packages/teleport/src/lib/tdp/playerClient.ts index dd32996b5bd79..9adb15ef10038 100644 --- a/web/packages/teleport/src/lib/tdp/playerClient.ts +++ b/web/packages/teleport/src/lib/tdp/playerClient.ts @@ -112,6 +112,11 @@ export class PlayerClient extends Client { } this.lastUpdateTime = Date.now(); + this.send(JSON.stringify({ action: Action.TOGGLE_PLAY_PAUSE })); + + if (this.paused) { + return; + } if (this.isSeekingForward()) { const next = Math.max(this.skipTimeUpdatesUntil, this.lastTimestamp); @@ -119,8 +124,6 @@ export class PlayerClient extends Client { } else { this.scheduleNextUpdate(this.lastTimestamp); } - - this.send(JSON.stringify({ action: Action.TOGGLE_PLAY_PAUSE })); } // setPlaySpeed sets the playback speed of the recording.