how to play sever url in AVAudioPlayer in swift code example
Example: swift play audio stream from url
func loadRadio(radioURL: String) {
guard let url = URL.init(string: radioURL) else { return }
let playerItem = AVPlayerItem.init(url: url)
player = AVPlayer.init(playerItem: playerItem)
player?.play()
startNowPlayingAnimation(true)
played = true
}