Loop keeps playing after stopped, if execution was suspended in debugger for a while #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To reproduce the problem:
Expected: loop stops
Actual: loop keeps merrily looping after the sound.stop() call. An hour-long dive through the app and the library to figure out what can possible be restarting the loop ensues. Actually, nothing does, it's only the interplay between this if and having JavaScript engine paused for a while when the loop was playing.
I'm not sure I completely understand the subtleties of (this.time_offset >= this.end || this.end - this.time_offset < 0.015) condition, so maybe this PR breaks some other case I'm not thinking of. But it surely solves the described problem. :)
Please have a close look.