--- title: HTMLMediaElement.autoplay slug: Web/API/HTMLMediaElement/autoplay translation_of: Web/API/HTMLMediaElement/autoplay ---
HTMLMediaElement.autoplay 属性等同于HTML属性中的 {{htmlattrxref("autoplay", "video")}}, 它表示当player下载到足够可以播放的媒体文件时,是否自动播放视频。
注意: 一些版本的Chrome只支持autostart, 不支持autoplay
...
{{domxref("Boolean")}}
...
<...></...>
...
Xxx.xxx()
| 规范 | 状态 | 备注 |
|---|---|---|
| {{SpecName('HTML WHATWG', "the-video-element.html#htmlmediaelement", "HTMLMediaElement.autoplay")}} | {{Spec2('HTML WHATWG')}} | No change from {{SpecName('HTML5 W3C')}} |
| {{SpecName('HTML5 W3C', "embedded-content-0.html#htmlmediaelement", "HTMLMediaElement.autoplay")}} | {{Spec2('HTML5 W3C')}} | Initial definition. |