Fix History Page Audio Duration and Playback Logic
Summary
The History page audio playback system is not functioning correctly. Recorded audio entries are showing incorrect durations (00:00), and playback controls are not properly synced with the actual audio state.
Current Behavior
- All recordings display
00:00duration. - Playback timer does not update correctly.
- Audio progress slider is not synced.
- Multiple recordings can play simultaneously.
- Audio metadata is not loaded properly.
- Duration resets after refresh/re-render.
Expected Behavior
- Display actual audio duration for every recording.
- Properly update playback progress and current time.
- Support functional play/pause controls per item.
- Allow only one audio playback at a time.
- Persist duration and playback state correctly.
- Show loading/fallback state while metadata loads.
Technical Requirements
- Use
loadedmetadatato fetch audio duration. - Format duration into
mm:ss. - Sync slider using
currentTime. - Handle cleanup of previous audio instances.
- Prevent invalid (
NaN) duration values. - Ensure real audio data is used instead of mock values.
Acceptance Criteria
-
Audio duration displays correctly -
Playback works for all history items -
Progress bar updates in real time -
Play/pause buttons function properly -
Only one audio plays at once -
No 00:00placeholder issues remain -
UI remains responsive after refresh
Edited by srilatha bandari