Skip to content

Commit

Permalink
Audio player crash issue solved (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhavpulkit authored Jul 10, 2020
1 parent 9b51474 commit fa9f8c8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,23 @@ extension AudioPlayerViewController{
MPNowPlayingInfoCenter.default().nowPlayingInfo = nowPlayingInfo
}

@objc func remotePlayPause(){
@objc func remotePlayPause() -> MPRemoteCommandHandlerStatus{
if isPaused(){
playPlayer()
}else{
pausePlayer()
}
return .success
}

@objc func remoteNext(){
@objc func remoteNext()-> MPRemoteCommandHandlerStatus{
playNextSong()
return .success
}

@objc func remotePrevious(){
@objc func remotePrevious()-> MPRemoteCommandHandlerStatus{
playPreviousSong()
return .success
}

@objc func remoteChangedPlaybackPositionCommand(_ event:MPChangePlaybackPositionCommandEvent) -> MPRemoteCommandHandlerStatus {
Expand Down

0 comments on commit fa9f8c8

Please sign in to comment.