Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an event for when the headphones are unplugged?

During a test, a client noticed that video playback in the iPhone pauses when headphones are unplugged. He wanted similar functionality for audio playback, and maybe the ability to pop up a message.

Does anyone know if there's an event of some kind I could hook into to make this possible?

like image 733
Ben Clayton Avatar asked Dec 15 '10 16:12

Ben Clayton


People also ask

Why does my phone say there are headphones plugged in?

Clean the headphone jack When you connect the headphones, the plug pushes the lint further to the bottom of the jack. If the lint is conductive, it may be messing with the electronic circuits inside the jack, causing the phone to register it as a pair of headphones plugged in.

Why does it say I've got headphones in when I don t?

At this point, this problem is being caused by one of two possibilities: Debris stuck inside the headphone jack or Lightning port is fooling your iPhone into thinking that headphones are plugged in. The headphone jack or Lightning port is damaged, either physically or by liquid.


1 Answers

See Responding to Route Changes from the Audio Session Programming Guide.

like image 55
henklein Avatar answered Nov 15 '22 17:11

henklein