keep loop when audio finish (#193)

This commit is contained in:
an-lee
2024-01-23 15:53:12 +08:00
committed by GitHub
parent 3a98bd9f40
commit 51a71df326

View File

@@ -375,6 +375,12 @@ export const MediaPlayer = (props: {
if (!regions) return;
const subscriptions = [
wavesurfer.on("finish", () => {
if (!isLooping) return;
regions?.getRegions()[0]?.play();
}),
regions.on("region-updated", (region) => {
const from = region.start;
const to = region.end;