MIDIAccess

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

实验性: 这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

Web MIDI APIMIDIAccess 接口提供查询 MIDI 输入和输出设备的列表以及获取这些设备的使用权限。

属性

MIDIAccess.inputs 只读

返回 MIDIInputMap 的实例,以提供对任何可用的 MIDI 输入端口的访问权限。

MIDIAccess.outputs 只读

返回 MIDIOutputMap 的实例,以提供任何可用的 MIDI 输出端口的访问权限。

MIDIAccess.sysexEnabled 只读

一个布尔型的属性,指明系统是否对现有的 MIDIAccess 实例支持。

事件处理程序

MIDIAccess.onstatechange

当添加新的 MIDI 端口或者一个存在的端口状态发生改变时被调用。

例子

规范

Specification
Web MIDI API
# midiaccess-interface

浏览器兼容性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
MIDIAccess
inputs
outputs
statechange event
sysexEnabled

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.