Fix History Page audio playback and duration handling
Overview
This MR fixes the audio playback and duration issues in the History page by implementing proper audio metadata handling and synchronized playback controls.
Changes Implemented
- Added real audio duration fetching using
loadedmetadata - Fixed duration display logic to show correct
mm:ssvalues - Implemented real-time playback timer updates
- Synced progress slider with audio
currentTime - Improved play/pause handling for each history entry
- Prevented simultaneous playback of multiple recordings
- Added fallback/loading handling for audio metadata
- Fixed invalid and
NaNduration rendering issues
Technical Details
- Refactored audio state management
- Improved audio event listener handling
- Added cleanup for active audio instances
- Optimized rendering to avoid repeated metadata fetching
Testing Done
- Verified duration rendering for multiple recordings
- Tested play/pause functionality
- Tested progress slider synchronization
- Tested refresh/re-render persistence
- Verified single active playback behavior
Result
History page now correctly displays real audio durations and provides stable, synchronized audio playback controls for all recordings.
closes #29 (closed) #30 (closed)