blob: 74bdb5f3ffdf1978f568a7cf9358ee13c6d93135 (
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
---
title: 'OfflineAudioContext: complete event'
slug: Web/API/OfflineAudioContext/complete
translation_of: Web/API/OfflineAudioContext/complete_event
---
<p><font><font>{{DefaultAPISidebar("Web Audio API")}}</font></font></p>
<p><code>complete</code><font><font>当离线音频上下文的呈现完成时,将触发{{domxref("OfflineAudioContext")}}接口</font><font>的</font><font>事件。</font></font></p>
<table class="properties">
<tbody>
<tr>
<th scope="row"><font><font>泡泡</font></font></th>
<td><font><font>没有</font></font></td>
</tr>
<tr>
<th scope="row"><font><font>取消</font></font></th>
<td><font><font>没有</font></font></td>
</tr>
<tr>
<th scope="row"><font><font>默认操作</font></font></th>
<td><font><font>没有</font></font></td>
</tr>
<tr>
<th scope="row"><font><font>接口</font></font></th>
<td><font><font>{{domxref( "OfflineAudioCompletionEvent")}}</font></font></td>
</tr>
<tr>
<th scope="row"><font><font>事件处理程序属性</font></font></th>
<td><font><font>{{domxref( "OfflineAudioContext.oncomplete")}}</font></font></td>
</tr>
</tbody>
</table>
<h2 id="例子"><font><font>例子</font></font></h2>
<p><font><font>处理完成后,您可能希望使用</font></font><code>oncomplete</code><font><font>处理程序提示用户现在可以播放音频,并启用播放按钮:</font></font></p>
<pre class="brush: js"><font><font>offlineAudioCtx.addEventListener('complete',()=> {</font></font>
console.log('Offline audio processing now complete');
showModalDialog('Song processed and ready to play');
playBtn.disabled = false;
})</pre>
<p>You can also set up the event handler using the {{domxref("OfflineAudioContext.oncomplete")}} property:</p>
<pre class="brush: js">offlineAudioCtx.oncomplete = function() {
console.log('Offline audio processing now complete');
showModalDialog('Song processed and ready to play');
playBtn.disabled = false;
}</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Web Audio API', '#OfflineAudioCompletionEvent-section', 'OfflineAudioCompletionEvent')}}</td>
<td>{{Spec2('Web Audio API')}}</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat("api.OfflineAudioContext.complete_event")}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><font><font>{{domxref( "离线音频上下文.oncomplete")}}</font></font></li>
<li><a href="/en-US/docs/Web_Audio_API" title="/en-US/docs/CSS/Using_CSS_animations"><font><font>Web Audio API</font></font></a></li>
</ul>
|