I\'m using the following code to play a sound off a URL from the internet:
var audioPlayer = AVPlayer()
...
let audioSessio
Open your app info.plist as Source code (to edit in text mode) and add the following just after dict:
UIBackgroundModes audio