feat: add delete button for clearing audio waveform in live streaming
MR Description
Summary
This merge request adds a Delete Audio button to the live streaming audio control section. The button is displayed beside the existing Play button and allows users to remove the current audio recording and waveform without refreshing the page.
Changes Made
- Added a Delete button next to the Play button in the live streaming control box.
- Implemented functionality to stop active audio playback before deletion.
- Cleared the WaveSurfer waveform and associated audio data.
- Reset audio-related states (playback status, progress, duration, etc.).
- Ensured proper cleanup of WaveSurfer resources to prevent memory leaks.
- Restored the audio player to its initial state after deletion.
Problem Solved
Previously, users could not remove an existing audio waveform once it was loaded or recorded. This made it difficult to replace recordings and could leave stale waveform data visible in the UI.
Expected Behavior
- Delete button appears when audio is available.
- Clicking Delete removes the waveform immediately.
- Audio playback stops if currently playing.
- Audio state is reset successfully.
- Users can record or upload a new audio file without page refresh.
Testing Performed
- Verified Delete button visibility when audio is present.
- Verified waveform removal after deletion.
- Verified playback stops on deletion.
- Verified audio state resets correctly.
- Verified new recordings generate a fresh waveform without displaying previous waveform data.
- Verified no UI regressions in the live streaming controls.
Screenshots
N/A
Checklist
-
Code follows project conventions -
Functionality tested locally -
No breaking changes introduced -
WaveSurfer cleanup handled correctly -
UI remains consistent with existing controls
closses #53