From 4b30c5536bb6b11878e907a1f83d566f77368f31 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Thu, 14 Mar 2024 20:19:04 -0600 Subject: [PATCH] Fix react race condition --- web/src/components/player/dynamic/DynamicVideoController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/components/player/dynamic/DynamicVideoController.ts b/web/src/components/player/dynamic/DynamicVideoController.ts index 2b3956db7..c6771a11c 100644 --- a/web/src/components/player/dynamic/DynamicVideoController.ts +++ b/web/src/components/player/dynamic/DynamicVideoController.ts @@ -81,7 +81,8 @@ export class DynamicVideoController { this.playerController.currentTime = seekSeconds; if (play) { - this.playerController.play(); + // use timeout to avoid race condition with other data loading + setTimeout(() => this.playerController.play()), 1; } else { this.playerController.pause(); }