feat(02-01): implement functional handleSeek

Replace placeholder handleSeek with functional implementation that
calls jamClient.SessionTrackSeekMs(). Uses optimistic UI update for
responsive UX, then seeks the native client. Polling useEffect will
sync actual position within 500ms to correct any drift.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Nuwan 2026-01-13 23:40:08 +05:30
parent 491c0a68e0
commit 18afc9370a
1 changed files with 12 additions and 3 deletions

View File

@ -153,9 +153,18 @@ const JKSessionBackingTrackPlayer = ({
};
const handleSeek = async (e) => {
// Placeholder for seek functionality
// This would need to be implemented based on available jamClient methods
console.log('Seek to:', e.target.value);
const seekPositionMs = parseInt(e.target.value);
try {
// Update local state immediately for responsive UI
setCurrentPositionMs(seekPositionMs);
setCurrentTime(formatTime(seekPositionMs));
// Seek the native client to the new position
await jamClient.SessionTrackSeekMs(seekPositionMs);
} catch (error) {
console.error('Error seeking:', error);
}
};
const handleClose = async () => {