skip to Main Content

AVPlayer / AVAudioPlayer – Play audio fileURL from iCloud Drive (work on simulator but not iPhone) + (OSStatus error -54.) – Ios swift

I'm making Audio Player. Importing file from iCloud Drive using .fileImporter. I get file URL that looks like this: file:///private/var/mobile/Library/Mobile%20Documents/com~apple~CloudDocs/_Storage/Audio-books/%D0%91%D1%80%D0%B5%D0%BD%D0%B4%D1%8F%D1%82%D0%B8%D0%BD%D0%B0/Audiobook.mp3" Then I pass it to audio player (tried AVPlayer and AVAudioPlayer). Both works on iOS simulator. On the device after…

VIEW QUESTION

Getting URL from firebase storage and setting it to an AVAudioPlayer always throws error (swift xcode)

I'm trying to download a URL from Firebase storage and save it to an AVAudioPlayer func loadAudio(post: CompPost, completion: @escaping (AVAudioPlayer) -> ()) { let audioRef = Storage.storage().reference().child("cPosts").child(post.uid).child("Audio").child(post.mp3) audioRef.downloadURL { (url, error) in print("mp3filename: " + post.mp3) guard error ==…

VIEW QUESTION
Back To Top
Search