AudioPlayer
AudioPlayer copied to clipboard
Not auto retry when connection lost
I do as following:
let item = AudioItem(mediumQualitySoundURL: radioStation.streamURL) player.playItem(item)
Then I turn off the wifi, the music stops, I put the wifi back on and nothing happens... any idea of what I'm doing wrong?
Thanks!
@lopify have you found how to solve this or another lib that solves? thx
No @sirvon :-(
I know why this happens.
In the code here: https://github.com/delannoyk/AudioPlayer/blob/master/AudioPlayer/AudioPlayer/player/AudioPlayer.swift#L88-L102
AVPlayer is set to nil
which stops all event producers.
Then a .waitingForConnection state is reached and the function returns. But the NetworkEventProducer was never started again, so we will not receive any callbacks when the internet connection returns again.
I have a quickfix for this, that I could PR upstream, but I think we'll need to confer with @delannoyk on why the eventProducers are stopped and started in this manner first.
PS. Included Reachability could also use an update, as it often fails when stopped and started a lot like in AudioPlayer, at least in my tests. The newest version works better for me.
any update @delannoyk
any update?