diff --git a/android/src/services/audio.ts b/android/src/services/audio.ts index ebea3c3..e6bfa82 100644 --- a/android/src/services/audio.ts +++ b/android/src/services/audio.ts @@ -1191,6 +1191,12 @@ class AudioService { /** Laufende Wiedergabe stoppen + Queue leeren */ stopPlayback(): void { + // Idempotent: wenn nichts mehr aktiv ist, NICHT noch einen Focus-Release/ + // Kick-Cycle anstossen — Re-Renders triggern setMuted oft mehrfach hinter- + // einander, und jeder weitere Kick lässt Spotify nochmal kurz pausieren. + const hasAnything = !!(this.currentSound || this.resumeSound || this.preloadedSound + || this.pcmStreamActive || this.audioQueue.length || this.isPlaying); + if (!hasAnything) return; console.log('[Audio] stopPlayback: currentSound=%s queue=%d pcm=%s', this.currentSound ? 'aktiv' : 'null', this.audioQueue.length, this.pcmStreamActive); // Foreground-Service auch stoppen — sonst bleibt die Notification haengen