Closed neilgandhi95 closed 6 years ago
The following code freezes the whole main thread until the state is changed to .playing. Any idea why?
if (jukeboxPlayer.jukebox != nil) { if let playingURL = jukeboxPlayer.jukebox?.currentItem?.URL { jukeboxPlayer.jukebox?.removeItems(withURL: playingURL) } jukeboxPlayer.jukebox?.append(item: JukeboxItem(URL: url), loadingAssets: false) } else { jukeboxPlayer.jukebox = Jukebox(delegate: self, items: [ JukeboxItem(URL: url) ]) } jukeboxPlayer.jukebox?.play(atIndex: 0)
nvm solved it, just load the avurlasset in the background thread async in jukeboxitem
The following code freezes the whole main thread until the state is changed to .playing. Any idea why?