AudioPlayerManager icon indicating copy to clipboard operation
AudioPlayerManager copied to clipboard

Loading song in background

Open muhammad-naderi opened this issue 7 years ago • 1 comments

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)
            })
        }

muhammad-naderi avatar Apr 30 '17 16:04 muhammad-naderi

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

geek1706 avatar Jun 07 '18 08:06 geek1706