This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* (#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.
- Loading branch information