iPhone ios4 - Replacing iPod dock icon whilst playing background audio stream -
I have found out how to play audio in the background on ios4, but I've found that some apps also have their own Instead of the iPod dock icon with the app icon (for example, Last.fm and Spotify).
They are able to use Dock Media Control to stop and resume their streams.
Does anyone know how to do this?
It is easy that you respond to remote control events. This lets you control your app with headset.
The viewDidLoad call says in:
[[UIApplication ShareApp] begins RecivingRemoteControlEvents]; [Self-made first responder];
and you have to answer both
- (BOOL) can first return the first responder; }
and
- (zero) Remote control reception with avenues: (UIEvent *) event {switch (event.subtype) {case UIEventSubtypeRemoteControlTogglePause: if (Audio.rate == 0.0) {[audio play]; } And {[audio pauses}; } break; Case UIEventSubtypeRemoteControlPlay: [Audio Play]; break; Case UIEventSubtypeRemoteControlPause: [audio pauses]; break; Default: Break; }}
Comments
Post a Comment