mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Working on Media controls
This commit is contained in:
parent
ef18157857
commit
e6fcddae67
8 changed files with 744 additions and 6 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue