--- title: 'HTMLMediaElement: ended' slug: Web/API/HTMLMediaElement/ended_event translation_of: Web/API/HTMLMediaElement/ended_event ---

如果playback或者streaming达到了媒体的未尾或者没有更多可用的数据,将会引发一个ended事件。

这个事件将会发生在三个相关但独立的上下文中:

General info

Specification
HTML5 media, Media Capture and Streams and Web Audio API
Interface
{{domxref("Event")}}
Bubbles
No
可取消的
No
Target
Element
默认操作
无。

While this event is defined in more than one specification, at this time they specify this event identically, so we have documented them as if they were one. If at some point that changes, the documentation will be revised.

Properties

Property Type Description
target {{readonlyInline}} {{domxref("EventTarget")}} The event target (the topmost target in the DOM tree).
type {{readonlyInline}} {{domxref("DOMString")}} The type of event.
bubbles {{readonlyInline}} {{jsxref("Boolean")}} Whether the event normally bubbles or not.
cancelable {{readonlyInline}} {{jsxref("Boolean")}} Whether the event is cancellable or not.