Working on Media controls

This commit is contained in:
Hariharan Mudaliar 2025-11-21 01:51:01 +05:30
commit e6fcddae67
8 changed files with 744 additions and 6 deletions

View file

@ -486,8 +486,20 @@ class MusicManager: ObservableObject {
}
func togglePlay() {
let controller = activeController
Task {
await activeController?.togglePlay()
await MainActor.run {
let newState = !isPlaying
withAnimation(.smooth(duration: 0.18)) {
isPlaying = newState
if newState {
isPlayerIdle = false
}
}
}
await controller?.togglePlay()
}
}