feat/nonzero audio start time#19
Open
vasarhelyi wants to merge 3 commits into
Open
Conversation
WIP: not fully functional yet on continuous playback with positive start time
ntamas
reviewed
May 12, 2026
| } | ||
|
|
||
| if (playing) { | ||
| if (timeoutIdRef.current) { |
Member
There was a problem hiding this comment.
This block here is the same as the cleanup function of the effect. The cleanup function is called whenever the effect dependencies change so there should be no need to cancel here explicitly - if we got here, it means that the effect callback was called, which also means that the cleanup function of the previous effect callback should have also been called by React.
Did you notice anything specific while testing that made it necessary to put the cleanup here as well? If not, please remove it.
| timeoutIdRef.current = setTimeout(tryPlayAudio, delay); | ||
| } else { | ||
| audioRef.current.pause(); | ||
| if (timeoutIdRef.current) { |
Member
There was a problem hiding this comment.
Same comment here as the one above: in theory, if we get here, the cleanup of the previous effect should have been called and the timeout should have been cleared.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds handling of nonzero start time for an audio file inside skyc
Prerequisites before merge:
skybrush.jsneeds to be merged and linked feat: add startTime field to AudioData skybrush.js#16skybrushneeds to be updated to export the starttime into .skyc files