From e5200f71f3bada21dc6772edcc17f94ed15d91b5 Mon Sep 17 00:00:00 2001 From: bcgov-brwang Date: Wed, 14 Feb 2024 08:49:55 -0800 Subject: [PATCH] DBC22-1520: Preload image when replay the day to prevent strobing DBC22-1520: Preload image when replay the day to prevent strobing --- src/frontend/src/pages/CameraDetailsPage.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/frontend/src/pages/CameraDetailsPage.js b/src/frontend/src/pages/CameraDetailsPage.js index 57116e67..bfd41be0 100644 --- a/src/frontend/src/pages/CameraDetailsPage.js +++ b/src/frontend/src/pages/CameraDetailsPage.js @@ -196,6 +196,15 @@ export default function CameraDetailsPage() { }; const play = () => { + // Pre load images for preventing strobing + // For Firefox, Settings Performance > Use recommended performance settings + // and Performance > Use recommended performance settings > Use hardware acceleration when available in the browser settings + // need to be disabled + replayImages.forEach((img) => { + const cachedImage = new Image(); + cachedImage.src = img.original; + }); + if(hasImageEnded){ setHasImageEnded(true); }