aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/globaleventhandlers/onplaying/index.html
blob: 48d21ccd83784d4f82c94114726b78b0a59ca2d3 (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
---
title: GlobalEventHandlers.onplaying
slug: Web/API/GlobalEventHandlers/onplaying
translation_of: Web/API/GlobalEventHandlers/onplaying
---
<div>{{ApiRef("HTML DOM")}}</div>

<p>The <strong><code>onplaying</code></strong> property of the {{domxref("GlobalEventHandlers")}} mixin is the {{event("Event_handlers", "event handler")}} for processing {{event("playing")}} events.</p>

<p><code>playing</code> 事件将会在媒体做好播放准备后(因暂停或网络延迟而导致媒体数据缺失)触发。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox notranslate"><var>element</var>.onplaying = <var>handlerFunction</var>;
var <var>handlerFunction</var> = <var>element</var>.onplaying;
</pre>

<p><code>handlerFunction</code> 为 <code>null</code> 或一个函数 指定事件处理程序</p>

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

<table class="spectable standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('HTML WHATWG','#handler-onplaying','onplaying')}}</td>
   <td>{{Spec2('HTML WHATWG')}}</td>
   <td></td>
  </tr>
 </tbody>
</table>

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



<p>{{Compat("api.GlobalEventHandlers.onplaying")}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("HTMLMediaElement/playing_event", "playing")}}</li>
 <li><a href="/en-US/docs/Web/Guide/Events/Event_handlers">DOM event handlers</a></li>
</ul>