Skip to content

Commit

Permalink
DBC22-1520: Preload image when replay the day to prevent strobing
Browse files Browse the repository at this point in the history
DBC22-1520: Preload image when replay the day to prevent strobing
  • Loading branch information
bcgov-brwang authored and fatbird committed Feb 14, 2024
1 parent f063a72 commit e5200f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/frontend/src/pages/CameraDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e5200f7

Please sign in to comment.