开发者

iPhone headphone click detection

开发者 https://www.devze.com 2022-12-13 12:30 出处:网络
I\'ve tried looking开发者_Python百科 through the documentation, but I can\'t seem to find (or recognize) what I\'m looking for.

I've tried looking开发者_Python百科 through the documentation, but I can't seem to find (or recognize) what I'm looking for.

The iPhone and iPod Touch have a momentary switch on the headphones, which I believe is called the "remote" (please correct me if I'm wrong). It is used to start/stop/forward/back for music or to pickup/end a phone call. I'd like to know when this switch is clicked in my native application.

In which framework and classes would I find this?


I don't believe this functionality is supported by any current framework.

If your application has iPod playback during execution you could register for MPMusicPlayerController notifications - Music Player Notifications

This will notify you of the playback state changes you mention above. However, it will not tell you whether the state was changed via the remote or the UI. But it's the only way that I know of to 'guess' if the remote button was clicked - I use this method in one of my own apps.

0

精彩评论

暂无评论...
验证码 换一张
取 消