aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/midiconnectionevent/index.html
blob: 20341c86d9db998e9dee80e5c23c95a9fc8e17ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: MIDIConnectionEvent
slug: Web/API/MIDIConnectionEvent
tags:
  - API
  - Draft
  - MIDI
  - 接口
translation_of: Web/API/MIDIConnectionEvent
---
<p>{{APIRef("Web MIDI API")}}{{SeeCompatTable}}</p>

<p>The <strong><code>MIDIConnectionEvent</code></strong> interface of the <a href="/en-US/docs/Web/API/Web_MIDI_API">Web MIDI API</a> is the event passed to the {{domxref("MIDIAccess.onstatechange","onstatechange")}} event of the {{domxref("MIDIAccess")}} interface and the {{domxref("MIDIPorts.onstatechange","onstatechange")}} event of the {{domxref("MIDIPorts")}} interface. This occurs any time a new port becomes available, or when a previously available port becomes unavailable. 例如,这个事件无论是在一个 MIDI 设备插入或拔出设备时都会触发。</p>

<h2 id="构造函数">构造函数</h2>

<dl>
 <dt>{{domxref("MIDIConnectionEvent.MIDIConnectionEvent")}}</dt>
 <dd>创建一个新的 <code>MIDIConnectionEvent</code> 对象。</dd>
</dl>

<h2 id="属性">属性</h2>

<dl>
 <dt>{{domxref("MIDIConnectionEvent.port")}}</dt>
 <dd>返回一个 {{domxref("MIDIPort")}} 实例的引用,指明其端口是否已经连接。</dd>
</dl>

<h2 id="举例">举例</h2>

<p> </p>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">规范</th>
   <th scope="col">状态</th>
   <th scope="col">备注</th>
  </tr>
  <tr>
   <td>{{SpecName('WebMIDI API','#midiconnectionevent-interface')}}</td>
   <td>{{Spec2('WebMIDI API')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容">浏览器兼容</h2>

<div>


<p>{{Compat("api.MIDIConnectionEvent")}}</p>
</div>