Issue from bug 492204 comment #101

15 views
Skip to first unread message

Reilly Grant

unread,
Nov 17, 2016, 11:56:32 AM11/17/16
to web...@chromium.org, Xander Dumaine
Trying to experiment with this via the --enable-experimental-web-platform-features flag, but I'm always getting the "No devices found" error. I have multiple devices connected to my computer (Mac OS X 10.11.6) and I'm using the API as follows:
navigator.usb.requestDevice({ filters: [ { vendorId: 0x046d } ] }). I've tried with vendor codes 0x05ac, 0x0b0e, 0x0451, 0x046d, 0x045e in both M54.0.2840 and M56.0.2923 - anything else I could do?
The issue you're running into is that the device you are trying to connect to likely doesn't have the WebUSB descriptors as described in the WebUSB API spec. Have you tried programming a device like described in this article:
https://developers.google.com/web/updates/2016/03/access-usb-devices-on-the-web

Reilly Grant

unread,
Nov 17, 2016, 12:17:10 PM11/17/16
to Xander Dumaine, web...@chromium.org
If everything goes right in the system input stack then the media keys on the headset should be available to applications like Chrome. There is a bug open to make them work with Chrome Apps, crbug.com/131612, but I've yet to find something tracking making them work on websites in general. The trick is figuring out which thing on your system should be processing these events. Should they go to the music player you have running in another tab or the page you have in the foreground?

WebUSB is not a good solution for this because a) the headset's media keys are exposed through a HID interface on the USB device so you won't be able to claim the USB interface away from the OS kernel and b) as you said, headset manufacturers would have to make the device WebUSB capable.

On Thu, Nov 17, 2016 at 9:06 AM Xander Dumaine <xan...@xdumaine.com> wrote:
Maybe this isn't what I really want. I'm working on WebRTC applications and want to be able to access the media control keys on USB headsets like this one - http://i.imgur.com/YYIFbgc.jpg. They typically have answer/mute/menu/+/- buttons, and I'd just like to be able to detect those button presses. Would that require that the headset manufacturers make it WebUSB capable before I could do anything?
Reply all
Reply to author
Forward
0 new messages