Skip to content

Commit

Permalink
Fix the problem where the buffered time display on the wave preview i…
Browse files Browse the repository at this point in the history
…s not updated correctly.
  • Loading branch information
okaxaki committed Dec 16, 2023
1 parent 49d898a commit feb20bb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "m3disp",
"private": true,
"version": "0.11.0",
"version": "0.11.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
4 changes: 1 addition & 3 deletions src/contexts/PlayerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function applyPlayStateChange(
return play(state.currentEntry);
}
} else {
console.warn('Missing current entry.');
console.warn("Missing current entry.");
return;
}
}
Expand Down Expand Up @@ -247,5 +247,3 @@ export function PlayerContextProvider(props: React.PropsWithChildren) {
</PlayerContext.Provider>
);
}


4 changes: 2 additions & 2 deletions src/widgets/WavePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ export function WaveSlider() {
const [progress, setProgress] = useState({ currentTime: 0, bufferedTime: 0 });

useEffect(() => {
const timerId = setTimeout(() => {
const timerId = setInterval(() => {
const progress = context.player.progress.renderer;
setProgress(progress);
}, 100);
return () => {
clearTimeout(timerId);
};
});
}, []);

return (
<Box sx={{ display: "flex", flexDirection: "column", padding: 2 }}>
Expand Down

0 comments on commit feb20bb

Please sign in to comment.