-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
I'm seeing a bug where if I let one track play, and then start another track, it begins at the seek point of the previous track instead of starting at the beginning. |
@zackkrida Can you share steps to reproduce? I was seeing that behavior on |
@sarayourfriend If I click the play button of one track, let it play for x seconds, and then click the play button on another track, it will begin at the x seconds point. |
That's really weird. I'm not able to reproduce that behavior at all, but maying I'm doing something different than what you're describing. Here's a video of me trying to reproduce it: Gravacao.de.Tela.2022-01-18.as.15.12.28.movI did notice something happen with the first audio track where the waveform seemed to change size at some point. The playback continued smoothly and the timestamp stays correct, but it moves visibly backwards in the track, as though the track's length had been expanded somehow. |
It's specific to Chrome! I tested in Firefox and Safari and saw the correct behavior. |
Oh how strange! I'm not able to reproduce it on Chrome 97.0.4692.71 (on an Intel mac running macOS 11.6.2). |
I do see one difference in Safari though and that is every time I play an audio track the current time is reset to 0 (which was the original behavior before this PR, but I have no idea why it's doing that on Safari and not Firefox or Chrome for me). These are very strange differences! |
I'm wondering if it's a RAF timing issue for M1 macs or just the arm64 build of Chrome? We're on the same version otherwise. |
Gosh these edge cases are so strange, I really can't pinpoint what is causing them other than a potential difference in how |
9e7e4a8
to
ab445a3
Compare
window.audioEl.src = props.audio.url | ||
// Set the current time of the audio back to the seeked time | ||
// of the waveform/timeline. In the future we might change | ||
// this to reset the audio back to 0 anytime another audio | ||
// is played but for now this is simpler and requires less | ||
// cross-instance communication. | ||
window.audioEl.currentTime = currentTime.value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
window.audioEl.src = props.audio.url | |
// Set the current time of the audio back to the seeked time | |
// of the waveform/timeline. In the future we might change | |
// this to reset the audio back to 0 anytime another audio | |
// is played but for now this is simpler and requires less | |
// cross-instance communication. | |
window.audioEl.currentTime = currentTime.value | |
// Set the current time of the audio back to the seeked time | |
// of the waveform/timeline. In the future we might change | |
// this to reset the audio back to 0 anytime another audio | |
// is played but for now this is simpler and requires less | |
// cross-instance communication. | |
window.audioEl.currentTime = currentTime.value | |
window.audioEl.src = props.audio.url |
@sarayourfriend this one weird trick fixes all of the problems for me! I haven't tested this + removing your other attempts to fix browser bugs but I will do so now.
Edit: Actually, this prevents the current track from being seeked prior to start.
@obulat, just FYI @zackkrida and I ended up pairing on this for a little while to try to resolve the bugs and decided that it might require some significant refactors. @zackkrida how do you feel about merging this PR as is and then trying those refactors in a follow up? Trying to be conscious of the fact that this PR does fix some fundamentally broken flows, even if it's not perfect. The refactors we discussed might fix everything, but so far they've been really difficult to work out how to get right and I'm in a worse spot than this PR is at the moment. |
Fixes
Fixes #628 by @sarayourfriend
Fixes #623 by @sarayourfriend
Replaces #629 which had a coding error fixed in this PR anyway.
Description
Fixes keyboard navigation and both keyboard and mouse based seeking on the waveform.
Testing Instructions
Checkout the branch and run
pnpm dev
. Visit an audio result like http://localhost:8443/audio/632d0076-fdbd-4919-8b8f-b498ef246ee8 and test the keyboard and mouse waveform seeking on the result waveform. Also test this on the related audio.Verify that you can:
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin