适用于 iPhone 应用程序的 UIAudioPickerController?
不知道该怎么称呼它,但我想为用户提供一种从我的应用程序中选择和控制他们的音乐的方法。我见过一些提供“iPod”按钮的应用程序,该按钮似乎可以调出 iPod 应用程序。这是像 UIImagePickerController 这样的内置控件还是只是复制了所有功能?
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 iPod app. Is this a built in control like the UIImagePickerController or have they simply duplicated all the functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 MediaPlayer 框架。特别是,您正在谈论 MPMediaPickerController
Check out the MediaPlayer framework. In particular, you're talking about the MPMediaPickerController
我在 Couch to 5k 中所做的是插入一个带有工具栏、标签和图像视图的 UIView 。工具栏有用于控制 iPod 音乐播放器的标准按钮。然后我使用
MPMusicPlayerController
来控制 iPod 音乐播放。下面是一些获取 iPod 音乐播放器和正在播放的内容的示例代码:
然后我使用 Apple 文档中关于
MPMusicPlayerController
提供的代码注册 NSNotification。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:
And then I register for NSNotification using the code provided in Apple's documentation on
MPMusicPlayerController
.