From 697f7b371391ff3ef3f4d8b867a5efe6073a9661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Ma=C5=82ecki?= <92953623+p-malecki@users.noreply.github.com> Date: Tue, 19 Nov 2024 11:38:02 +0100 Subject: [PATCH 1/3] Change rewind time to 0.6 sec --- .../vscode-extension/src/webview/components/ReplayOverlay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx index 3ef344795..91f2d2aa9 100644 --- a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx +++ b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx @@ -18,7 +18,7 @@ function acceleratedRewind( setTimeCallback: (time: number) => void, readyCallback: () => void ) { - const rewindTimeSec = 1.6; + const rewindTimeSec = 0.6; const v0 = 0.1; const vFinal = 2 / rewindTimeSec - v0; From ecf40dbaf7b4384ac0b9ac00c8a874c60dc24d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Ma=C5=82ecki?= <92953623+p-malecki@users.noreply.github.com> Date: Tue, 19 Nov 2024 13:09:35 +0100 Subject: [PATCH 2/3] Add replay rewind introduction --- .../src/webview/components/ReplayOverlay.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx index 91f2d2aa9..c4bc1b808 100644 --- a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx +++ b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx @@ -18,8 +18,13 @@ function acceleratedRewind( setTimeCallback: (time: number) => void, readyCallback: () => void ) { - const rewindTimeSec = 0.6; + // If REPLAY_REWIND_INTRODUCE_KEY is missing in global state, we assume that the + // replay rewind feature has not been introduced. In this case, we use a longer + // rewind time to help users more easily understand the rewind feature. + const REPLAY_REWIND_INTRODUCE_KEY = "wasReplayRewindIntroduced"; + const wasRewindIntroduced = localStorage.getItem(REPLAY_REWIND_INTRODUCE_KEY) ?? false; + const rewindTimeSec = wasRewindIntroduced ? 0.6 : 1.6; const v0 = 0.1; const vFinal = 2 / rewindTimeSec - v0; const acc = (vFinal - v0) / rewindTimeSec; @@ -47,6 +52,10 @@ function acceleratedRewind( } } requestAnimationFrame(frame); + + if (!wasRewindIntroduced) { + localStorage.setItem(REPLAY_REWIND_INTRODUCE_KEY, "true"); + } } function isVideoPlaying(videoElement: HTMLVideoElement) { From 8679fc6060950c450ace1456f9a469b513b287ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Ma=C5=82ecki?= <92953623+p-malecki@users.noreply.github.com> Date: Tue, 19 Nov 2024 21:21:51 +0100 Subject: [PATCH 3/3] Revert "Add replay rewind introduction" This reverts commit ecf40dbaf7b4384ac0b9ac00c8a874c60dc24d0f. --- .../src/webview/components/ReplayOverlay.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx index c4bc1b808..91f2d2aa9 100644 --- a/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx +++ b/packages/vscode-extension/src/webview/components/ReplayOverlay.tsx @@ -18,13 +18,8 @@ function acceleratedRewind( setTimeCallback: (time: number) => void, readyCallback: () => void ) { - // If REPLAY_REWIND_INTRODUCE_KEY is missing in global state, we assume that the - // replay rewind feature has not been introduced. In this case, we use a longer - // rewind time to help users more easily understand the rewind feature. - const REPLAY_REWIND_INTRODUCE_KEY = "wasReplayRewindIntroduced"; - const wasRewindIntroduced = localStorage.getItem(REPLAY_REWIND_INTRODUCE_KEY) ?? false; + const rewindTimeSec = 0.6; - const rewindTimeSec = wasRewindIntroduced ? 0.6 : 1.6; const v0 = 0.1; const vFinal = 2 / rewindTimeSec - v0; const acc = (vFinal - v0) / rewindTimeSec; @@ -52,10 +47,6 @@ function acceleratedRewind( } } requestAnimationFrame(frame); - - if (!wasRewindIntroduced) { - localStorage.setItem(REPLAY_REWIND_INTRODUCE_KEY, "true"); - } } function isVideoPlaying(videoElement: HTMLVideoElement) {