SwiftAudioPlayer icon indicating copy to clipboard operation
SwiftAudioPlayer copied to clipboard

how to play audio background, when switch to another app or lock screen

Open assmdx opened this issue 2 years ago • 1 comments

currently my code is:

let url = URL(string: msg!)!
SAPlayer.shared.startRemoteAudio(withRemoteUrl: url)
SAPlayer.shared.play()

assmdx avatar Jul 21 '23 18:07 assmdx

this package just plays the audio. you need to set a few options to continue playing when your app is not open. see: https://stackoverflow.com/a/30280699

also see this, if you also want the lockscreen music controls

demenik avatar Jan 19 '24 09:01 demenik