Skip to content

Commit

Permalink
small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skier233 committed Feb 11, 2025
1 parent 0dad539 commit e4c4ce8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ui/v2.5/src/components/ScenePlayer/ScenePlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -701,14 +701,15 @@ export const ScenePlayer: React.FC<IScenePlayerProps> = ({
// Ensure markers are added after player is fully ready and sources are loaded
if (player.readyState() >= 1) {
loadMarkers();
return;
} else {
player.on("loadedmetadata", () => {
loadMarkers();
});
return () => {
player.off("loadedmetadata", loadMarkers);
};
}
return () => {
player.off("loadedmetadata", loadMarkers);
};
}, [getPlayer, scene]);

useEffect(() => {
Expand Down

0 comments on commit e4c4ce8

Please sign in to comment.