fix: connect MiniPlayer controls and improve playback synchronization

- Connect MiniPlayer play/pause buttons to audioService
- Improve audio context management with fallback creation
- Fix state synchronization with interval-based readiness checks
- Add error handling and user feedback for playback issues
- Enhance mobile browser support with better audio context handling

Fixes playback issues in SongView where controls were not working and
state synchronization between UI and player was unreliable.
This commit is contained in:
Mistral Vibe
2026-04-08 15:19:30 +02:00
parent b5c84ec58c
commit a0769721d6
5 changed files with 137 additions and 20 deletions

View File

@@ -1,5 +1,6 @@
import { usePlayerStore } from "../stores/playerStore";
import { useNavigate } from "react-router-dom";
import { audioService } from "../services/audioService";
export function MiniPlayer() {
const { currentSongId, currentBandId, isPlaying, currentTime, duration } = usePlayerStore();
@@ -90,8 +91,11 @@ export function MiniPlayer() {
<button
onClick={() => {
// This would need to be connected to actual play/pause functionality
// For now, it's just a visual indicator
if (isPlaying) {
audioService.pause();
} else {
audioService.play();
}
}}
style={
{