Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer detect lost connection

Tags:

ios

iphone

I am using the AVPlayer object in iOS 6.1. I am currently connecting to an Icecast server to stream a live music feed. However when the stream goes down for any reason (such as a restart or change of signal) the AVPlayer stops playing. I have tried adding an observer for "status" but that only seams to be called whenever I start or stop the player. Is there a way to detect the lost connection so I can reconnect the player?

like image 507
Brianjs Avatar asked Mar 17 '26 13:03

Brianjs


1 Answers

You should use Reachability

this post shows how to implement it iphone-reachability-checking

like image 171
Janub Avatar answered Mar 20 '26 07:03

Janub



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!