From 1345dbfe102480d1bd27527a42a4607a5dca1b44 Mon Sep 17 00:00:00 2001 From: Zac Bergquist Date: Wed, 18 Dec 2024 13:49:07 -0700 Subject: [PATCH] Make sure progress bar stops moving when pausing a desktop recording (#50371) 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.