ui: fix audioplayer time comp (#2636)

This commit is contained in:
Delirium 2024-10-07 16:43:00 +02:00 committed by GitHub
parent e95611c1a6
commit e3f6a8fadc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,9 +102,11 @@ function DropdownAudioPlayer({
const file = files.find((f) => f.url === key);
if (file) {
const targetTime = (timeMs + delta * 1000 - file.start) / 1000;
console.log(targetTime, audio.currentTime, timeMs)
const fileLength = fileLengths.current[key];
if (targetTime < 0 || (fileLength && targetTime > fileLength)) {
audio.pause();
audio.currentTime = 0;
return;
} else {
audio.currentTime = targetTime;