Put a breakpoint on sound.stop call (or anywhere else, really)
Trigger the breakpoint
Wait for a bit, then resume execution.
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. :)
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.