AudioPlayerManager
AudioPlayerManager copied to clipboard
Loading song in background
hi,
AudioPlayerManager.shared.play(urlStrings: urls, at: 0)
method actually blocks the UI,
how about doing it in background?
actually using this snippet this can be achieved for now, but I think it may be better if it was embedded in library
DispatchQueue.global().async {
DispatchQueue.main.async(execute: {
AudioPlayerManager.shared.play(urlStrings: urls, at: 0)
})
}
I think using AVURLAsset will run the risk of blocking the current thread (the main UI thread) whilst I/O happens to populate the properties. https://developer.apple.com/documentation/avfoundation/avasynchronouskeyvalueloading