I remember the keyword audio route changes and believe there was a notification for this. What's the easiest way to intercept that the user unplugged headphones or plugged headphones in?
            Asked
            
        
        
            Active
            
        
            Viewed 334 times
        
    1
            
            
        - 
                    are you currently playing music? – nycynik Nov 30 '12 at 21:38
 - 
                    Yes, when the AVAudioPlayer is playing music I want to pause it when the user unplugs the headphone. – openfrog Dec 01 '12 at 15:42
 
1 Answers
2
            You want to read this piece of Apple documentation. It's not a notification (as in send by NSNotificationCenter), but it notifies on audio route changes.
        JustSid
        
- 25,168
 - 7
 - 79
 - 97
 
- 
                    @openfrog Not that I was aware of, but here is a small class that abstracts some of the stuff: https://gist.github.com/4183012 – JustSid Dec 01 '12 at 16:04