MIDIAccess

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

 

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

属性

MIDIAccess.inputs 只读
返回 MIDIInputMap 的实例,以提供对任何可用的 MIDI 输入端口的访问权限。
MIDIAccess.outputs 只读
返回 MIDIOutputMap 的实例,以提供任何可用的 MIDI 输出端口的访问权限。
MIDIAccess.sysexEnabled 只读
一个布尔型的属性,指明系统是否对现有的 MIDIAccess 实例支持。

事件处理程序

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

例子

标准

Specification Status Comment
Web MIDI API Working Draft Initial definition.

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
MIDIAccess
Experimental
Chrome Full support 43Edge ? Firefox No support NoIE No support NoOpera Full support 33Safari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support 33Safari iOS No support NoSamsung Internet Android Full support 4.0
inputs
Experimental
Chrome Full support 43Edge ? Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes
outputs
Experimental
Chrome Full support 43Edge ? Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes
statechange event
Experimental
Chrome Full support 43Edge ? Firefox No support NoIE No support NoOpera ? Safari No support NoWebView Android Full support 43Chrome Android Full support 43Firefox Android ? Opera Android ? Safari iOS No support NoSamsung Internet Android ?
sysexEnabled
Experimental
Chrome Full support 45Edge ? Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 45Chrome Android Full support 45Firefox Android ? Opera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.