Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Audio waveform progress bar extends beyond the end of the waveform body #692

Closed
1 task
sarayourfriend opened this issue Jan 24, 2022 · 1 comment · Fixed by #818
Closed
1 task

Audio waveform progress bar extends beyond the end of the waveform body #692

sarayourfriend opened this issue Jan 24, 2022 · 1 comment · Fixed by #818
Assignees
Labels
🕹 aspect: interface Concerns end-users' experience with the software bug Something isn't working 🛠 goal: fix Bug fix good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work

Comments

@sarayourfriend
Copy link
Contributor

Description

When playing an audio file all the way through to the end, the progress bar will extend beyond the end of the waveform body.

I'm not sure what causes this, but it seeems like it would just be a small math issue or more likely we're ignoring something critical when pulling the waveform dimensions from clientWidth.

Reproduction

  1. Run main and go to an audio search that includes a short file (it's easiest and most prominent on short files) like http://localhost:8443/audio/5365bca5-7bd8-4344-b8e4-dad1cf219456
  2. Play the audio file through to the end
  3. Note the progress bar, timestamp, and focus bar (when focused) extending beyond the end of the waveform body.

Expectation

The progress bar should end exactly at the end of the waveform body.

Screenshots

  • 🙋 I would be interested in resolving this bug.
@sarayourfriend sarayourfriend added good first issue New-contributor friendly 🟨 priority: medium Not blocking but should be addressed soon 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work 🛠 goal: fix Bug fix 🕹 aspect: interface Concerns end-users' experience with the software labels Jan 24, 2022
@sarayourfriend sarayourfriend added the help wanted Open to participation from the community label Jan 28, 2022
@zackkrida zackkrida added the bug Something isn't working label Feb 4, 2022
@demophoon
Copy link
Contributor

👋

demophoon added a commit to demophoon/openverse-frontend that referenced this issue Feb 6, 2022
When an audio file is played and the duration from the passed properties
does not match the duration of the actual audio file, e.g. the duration
was rounded, the progress bar drifts outside of the total width of the
VWaveform dimensions.

On smaller width screens or larger tracks it is less noticeable but when
the audio track is small and the screen width is large that percentage
adds up to 10s or more of pixels which is where the bug crops up.

This commit fixes this issue by by using the audio context's duration
parameter and falling back to less specific sources for duration.
demophoon added a commit to demophoon/openverse-frontend that referenced this issue Feb 7, 2022
When an audio file is played and the duration from the passed properties
does not match the duration of the actual audio file, e.g. the duration
was rounded, the progress bar drifts outside of the total width of the
VWaveform dimensions.

On smaller width screens or larger tracks it is less noticeable but when
the audio track is small and the screen width is large that percentage
adds up to 10s or more of pixels which is where the bug crops up.

This commit fixes this issue by by using the audio context's duration
parameter and falling back to less specific sources for duration.
demophoon added a commit to demophoon/openverse-frontend that referenced this issue Feb 18, 2022
Before this commit the duration would be set based on the audio context
state as the page was loaded. Since the audio file is never loaded by
the time we check for the duration of the audio object, it is always
null thus defaulting to the metadata for audio duration always.

This commit adds a `durationchange` listener while initializing the
audio object and sets the duration in a new `audioDuration` property
which the computed `duration` property watches.
demophoon added a commit to demophoon/openverse-frontend that referenced this issue Feb 18, 2022
Before this commit the duration would be set based on the audio context
state as the page was loaded. Since the audio file is never loaded by
the time we check for the duration of the audio object, it is always
null thus defaulting to the metadata for audio duration always.

This commit adds a `durationchange` listener while initializing the
audio object and sets the duration in a new `audioDuration` property
which the computed `duration` property watches.
demophoon added a commit to demophoon/openverse-frontend that referenced this issue Feb 18, 2022
Before this commit the duration would be set based on the audio context
state as the page was loaded. Since the audio file is never loaded by
the time we check for the duration of the audio object, it is always
null thus defaulting to the metadata for audio duration always.

This commit adds a `durationchange` listener while initializing the
audio object and sets the duration in a new `audioDuration` property
which the computed `duration` property watches.
sarayourfriend pushed a commit that referenced this issue Feb 19, 2022
* (#692) Fix duration mismatch between audio and metadata

When an audio file is played and the duration from the passed properties
does not match the duration of the actual audio file, e.g. the duration
was rounded, the progress bar drifts outside of the total width of the
VWaveform dimensions.

On smaller width screens or larger tracks it is less noticeable but when
the audio track is small and the screen width is large that percentage
adds up to 10s or more of pixels which is where the bug crops up.

This commit fixes this issue by by using the audio context's duration
parameter and falling back to less specific sources for duration.

* #692) Set duration after audio is loaded

Before this commit the duration would be set based on the audio context
state as the page was loaded. Since the audio file is never loaded by
the time we check for the duration of the audio object, it is always
null thus defaulting to the metadata for audio duration always.

This commit adds a `durationchange` listener while initializing the
audio object and sets the duration in a new `audioDuration` property
which the computed `duration` property watches.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🕹 aspect: interface Concerns end-users' experience with the software bug Something isn't working 🛠 goal: fix Bug fix good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 🚦 status: awaiting triage Has not been triaged & therefore, not ready for work
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants