teodorpatras / Jukebox

Player for streaming local and remote audio files. Written in Swift.
MIT License
552 stars 122 forks source link

Real device bug #84

Closed danialepaco closed 4 years ago

danialepaco commented 6 years ago

When I use my app on emulator works really perfect but on a real device is very slow... anybody with the same issue??

vivekathilkar commented 6 years ago

Yes I am facing same issue with this library Have You found any solution on this ?

danialepaco commented 6 years ago

let url = URL(string: canciones[currentSong].url) playerItem = AVPlayerItem(url: url!) player = AVPlayer(playerItem: playerItem) self.player?.automaticallyWaitsToMinimizeStalling = false self.playerItem?.preferredForwardBufferDuration = 0

This the objects I use its different from this library but it will help you, I use AVPlayer object.. the trick is use these two lines in that object jukebox use the same object

self.player?.automaticallyWaitsToMinimizeStalling = false self.playerItem?.preferredForwardBufferDuration = 0

And that it your music should start immediately... its beacuase AVPlayer by defect download the whole file, that why we set “automaticallyWaitsToMinimizeStalling“ to false

vivekathilkar commented 6 years ago

Thanks for quick reply. But it's not working for me.Takes longer timer to load audio file on real device. device stuck when I changes audio Thanks