You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
I am getting mp3 files from server. And there is al lot of mp3 files that are appended to jukebox player and it takes a lot of time. for example I am getting 25 music files I am adding them to jukebox player via for loop. It takes at least 20 seconds. Any suggestions? my code,
for index in 0...self.musicInfo.count-1{
JukeBoxManager.sharedInstance.jukebox.append(item: JukeboxItem (URL: URL(string: self.musicInfo[index].url)!), loadingAssets: true)
}
The text was updated successfully, but these errors were encountered:
It did also happen with me, what I did was, manage my own playlist array and keep track of next previous song. When one finishes, I start playing the next from my tracked playlist. Didn't get time to figure our why Jukebox is slow.
Yes, sure. In my SongsPlayerViewController, I defined a property like: private var playlist:Array<Song>!
Wrote a method in the same class as: func playSongs(list:Array<Song>,indexToPlay:Int)
Whenever I need to play multiple songs, I just call this method. This method, in its definition, assigns the instance property playlist with list parameter of the method.
The definition of this method does also initialises Jukebox instance with only song item (selects the one based on indexToPlay from the list array) and calls Jukebox's play method.
When the progress of the current song reaches 1, you can call the same playSongs method with next song index and same playlist array.
Let me know if you feel difficulty somewhere. I am using Jukebox's delegate method: jukeboxPlaybackProgressDidChange(_ jukebox : Jukebox) to track progress. jukeboxDidLoadItem( is not handy for playing the next song, I had to use progress method.
I am getting mp3 files from server. And there is al lot of mp3 files that are appended to jukebox player and it takes a lot of time. for example I am getting 25 music files I am adding them to jukebox player via for loop. It takes at least 20 seconds. Any suggestions? my code,
The text was updated successfully, but these errors were encountered: