Skip to content

feat/nonzero audio start time#19

Open
vasarhelyi wants to merge 3 commits into
mainfrom
feat/nonzero-audio-start-time
Open

feat/nonzero audio start time#19
vasarhelyi wants to merge 3 commits into
mainfrom
feat/nonzero-audio-start-time

Conversation

@vasarhelyi
Copy link
Copy Markdown
Contributor

@vasarhelyi vasarhelyi commented May 7, 2026

This PR adds handling of nonzero start time for an audio file inside skyc

Prerequisites before merge:

@vasarhelyi vasarhelyi self-assigned this May 7, 2026
@vasarhelyi vasarhelyi marked this pull request as draft May 8, 2026 13:42
@vasarhelyi vasarhelyi requested a review from ntamas May 11, 2026 13:46
@vasarhelyi vasarhelyi marked this pull request as ready for review May 11, 2026 13:46
@vasarhelyi vasarhelyi changed the title WIP: Feat/nonzero audio start time feat/nonzero audio start time May 11, 2026
}

if (playing) {
if (timeoutIdRef.current) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

2 participants