Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop replay takes a while to start #7

Open
normanr opened this issue Jan 18, 2021 · 0 comments
Open

Loop replay takes a while to start #7

normanr opened this issue Jan 18, 2021 · 0 comments

Comments

@normanr
Copy link

normanr commented Jan 18, 2021

If the loop is 10s long, then it only starts playing 10s after recordStop. This is because window.setInterval doesn't run the function immediately, but rather only after interval.

So I would recommend changing recordStop to have:

if (data.length) {
    loopInterval = window.setInterval(playLoop, totalTime, data);
    playLoop(data);
}

and remove the setInterval logic from playLoop, so that the loop is played as soon as the recording is stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant