iPhone iOS4:AVRCP API(蓝牙耳机上的快进/快退命令)

发布于 2024-09-29 12:23:14 字数 181 浏览 3 评论 0原文

我知道 iOS 4.1 中添加了 AVRCP 功能(在 iPod 应用程序中,现在您可以使用支持耳机上的硬件按钮来前进和后退歌曲)。

我正在尝试找到任何 API 来在我开发的音乐应用程序中使用这些功能。

要求是从耳机捕获播放/停止、前进和后退按钮事件。

任何信息都将受到欢迎。

谢谢。

I know that AVRCP abilities were added to iOS 4.1 (in iPod application now you can forward and rewind songs by using hardware buttons on supporting headsets).

I am trying to find any API for using these abilities in a music application that I work on.

The requirement is to catch play/stop, forward and rewind buttons events from the headset.

Any information will be more than welcome.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

茶花眉 2024-10-06 12:23:14

我一直在寻找类似的东西——有关如何捕获远程控制事件的信息。如果您有权访问 https://developer.apple.com,请查找 UIEvent 类和“iOS 事件处理指南”文档中的“多媒体远程控制”。这里有适合您需要的所有媒体的活动。

仅当 iOS 为您抽象远程事件时这才会有帮助,因此它只是一个“远程事件”,无论它是有线还是蓝牙。我还没有硬件来尝试这个。

如果您尝试自己对蓝牙驱动程序进行低级别访问,我认为您不走运。

希望这有帮助...

I've been looking for something similar -- info on how to catch remote control events. If you have access to https://developer.apple.com, look up the UIEvent class and "Remote Control of Multimedia" in the "Event Handling Guide for iOS" doc. There are events for all the presses you need.

This will help ONLY IF iOS abstracts remote events for you so it is just a "remote event" regardless of whether it is wired or bluetooth. I don't have the hardware to try this yet.

If you're trying to get low level access to the bluetooth drivers yourself I think you're out of luck.

Hope this helps...

落日海湾 2024-10-06 12:23:14

我的猜测是,只要您注册并侦听这些事件(尽管我不知道 iOS 中的语法),您的应用程序就应该获取这些事件。

系统通常会小心地将事件路由到您的应用程序,无论事件是本地生成(通过本地操作)还是从蓝牙 AVRCP 控制设备远程生成,都没有关系。

希望这有帮助。

My guess is that as long as you register and listen for these events (although I am not aware of the syntax for that in iOS) your application should get these events.

The system will normally take care to route the events to your application and it will not matter if it is generated locally (via local action) or remotely from a bluetooth AVRCP control device.

Hope this helps.

月下伊人醉 2024-10-06 12:23:14

以下是上述 Apple 文档的直接链接:

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/RemoteControl/RemoteControl.html

启动时注册以接收事件
[[UIApplication shareApplication] beginReceivingRemoteControlEvents];

然后实现 (void)remoteControlReceivedWithEvent:(UIEvent *)receivedEvent 来处理事件。

Here's a direct link to Apple's documentation mentioned above:

http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/RemoteControl/RemoteControl.html

At launch, register to receive events

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];

Then implement (void)remoteControlReceivedWithEvent:(UIEvent *)receivedEvent to deal with the events.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文