The problem I'm trying to solve is I would like to have a way to measure network latency and notify users when high latency situations occur. My app allows users to stream audio or video content from online sources and while playback is possible on 3g and even EDGE speeds in my testing, spikes in latency can cause hangups in usability. When this occurs I'd like to be able to alert the user the cause of these problems.
I've gone back to looking into Apple's Reachability sample code and it still does not help. I'll refer back to an issue filed over a year ago (http://openradar.appspot.com/13982938)
Assuming I start with a strong connection, I can set a custom profile in the network link conditioner that would drop 100% of packets sent, and the reachability code in the sample app does not change the positive result. It still tells me I have a connection even though no packets get through.
Are there any reliable values I can KVO or otherwise listen to, in order to get this information?
Some built-in ways of streaming tell you what's going on. If you're using AVPlayerItem, properties such as
playbackLikelyToKeepUp
and theaccessLog
, along with notifications such asAVPlayerItemPlaybackStalledNotification
, can be helpful in keeping you abreast of any issues.