ui: fix audioplayer time comp

This commit is contained in:
nick-delirium 2024-10-07 16:41:23 +02:00
parent e189ff8b09
commit 4d0730f394
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

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;