The HTMLMediaElement.ended
indicates whether the media element has ended playback.
Syntax
var isEnded = HTMLMediaElement.ended
Value
A Boolean
which is true
if the media contained in the element has finished playing.
If the source of the media is a MediaStream
, this value is true
if the value of the stream's active
property is false
.
Example
var obj = document.createElement('video');
console.log(obj.ended); // false
Specifications
Specification | Status | Comment |
HTML Living StandardThe definition of 'HTMLMediaElement.ended' in that specification. | Living Standard | |
HTML5The definition of 'HTMLMediaElement.ended' in that specification. | Recommendation |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ended
|
Chrome
Full support 43 |
Edge
Full support 12 |
Firefox
Full support 3.5 |
IE
Full support 9 |
Opera
Full support Yes |
Safari
Full support 6 |
WebView Android
Full support 43 |
Chrome Android
Full support 43 |
Firefox Android
Full support Yes |
Opera Android
Full support Yes |
Safari iOS
Full support Yes |
Samsung Internet Android
Full support 4.0 |
Legend
- Full support
- Full support
See also
- The interface defining it,
HTMLMediaElement
. MediaStream
MediaStream.active
HTMLMediaElement.ended by Mozilla Contributors is licensed under CC-BY-SA 2.5.