开发者

UIAudioPickerController for iPhone App?

Not sure what to call this, but I'd like to offer a way for users to pick and control their music from within my app. I've seen a few apps that offer an "iPod" button that appears to bring up the iPo开发者_StackOverflow中文版d app. Is this a built in control like the UIImagePickerController or have they simply duplicated all the functionality?


Check out the MediaPlayer framework. In particular, you're talking about the MPMediaPickerController


What I'm doing in Couch to 5k is inserting a UIView with a toolbar, labels, and an image view. The toolbar has the standard buttons for controlling the iPod music player. Then I'm using MPMusicPlayerController to control the iPod music playback.

Here's some sample code to get the iPod music player and what's playing:

musicPlayer = [MPMusicPlayerController iPodMusicPlayer];
item = musicPlayer.nowPlayingItem;

And then I register for NSNotification using the code provided in Apple's documentation on MPMusicPlayerController.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜