I am working on an iOS app that, among other things, plays streaming audio from an internet source and I am wondering if there are ways to deal with a spotty network that reflects the actual state of the network.
Right now, I am using AVPlayer (initialized with the URL of the source). Mostly, it works OK, but it has problems dealing with areas with no network connectivity and transitioning back to areas with connectivity. After entering the area of no network connectivity and then re-entering areas with connectivity, the player does not resume playing. The status of the player remains ReadyToPlay. I have tried toggling pause/play and the player does not resume playing. When I detect that the player gets into this state, I will destroy the AVPlayer object and create a new one.
BTW, the Reachability bit in the SCNetworkReachability flag remains set, despite being in a spot with no connectivity.
Is there a better way to handle this?
alan