mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 01:54:33 +02:00
Merge branch 'master' into iosChapterTrack
This commit is contained in:
commit
73d70dd480
37 changed files with 1060 additions and 48 deletions
|
@ -589,12 +589,34 @@ class AudioPlayer: NSObject {
|
|||
|
||||
commandCenter.playCommand.isEnabled = true
|
||||
commandCenter.playCommand.addTarget { [weak self] event in
|
||||
self?.play(allowSeekBack: true)
|
||||
guard let strongSelf = self else { return .commandFailed }
|
||||
if strongSelf.isPlaying() {
|
||||
strongSelf.pause()
|
||||
} else {
|
||||
strongSelf.play(allowSeekBack: true)
|
||||
}
|
||||
return .success
|
||||
}
|
||||
|
||||
commandCenter.pauseCommand.isEnabled = true
|
||||
commandCenter.pauseCommand.addTarget { [weak self] event in
|
||||
self?.pause()
|
||||
guard let strongSelf = self else { return .commandFailed }
|
||||
if strongSelf.isPlaying() {
|
||||
strongSelf.pause()
|
||||
} else {
|
||||
strongSelf.play(allowSeekBack: true)
|
||||
}
|
||||
return .success
|
||||
}
|
||||
|
||||
commandCenter.togglePlayPauseCommand.isEnabled = true
|
||||
commandCenter.togglePlayPauseCommand.addTarget { [weak self] event in
|
||||
guard let strongSelf = self else { return .commandFailed }
|
||||
if strongSelf.isPlaying() {
|
||||
strongSelf.pause()
|
||||
} else {
|
||||
strongSelf.play(allowSeekBack: true)
|
||||
}
|
||||
return .success
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue