Tap the dock to expand; open فهرست for the current surah list with ±15s skips and remaining time, without interrupting the single audio session. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -59,5 +59,24 @@ window.tqAudio = {
|
||||
seek: (audio, value) => {
|
||||
if (!audio) return;
|
||||
audio.currentTime = Number(value) || 0;
|
||||
},
|
||||
|
||||
seekBy: (audio, deltaSeconds) => {
|
||||
if (!audio) return 0;
|
||||
const dur = Number.isFinite(audio.duration) ? audio.duration : 0;
|
||||
let next = (audio.currentTime || 0) + (Number(deltaSeconds) || 0);
|
||||
if (next < 0) next = 0;
|
||||
if (dur > 0 && next > dur) next = dur;
|
||||
audio.currentTime = next;
|
||||
return next;
|
||||
},
|
||||
|
||||
getState: (audio) => {
|
||||
if (!audio) return { time: 0, duration: 0, playing: false };
|
||||
return {
|
||||
time: audio.currentTime || 0,
|
||||
duration: audio.duration || 0,
|
||||
playing: !audio.paused
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user