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:
@@ -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={
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user