HTMLMediaElement.autoplay

HTMLMediaElement.autoplay 属性等同于HTML属性中的 autoplay, 它表示当player下载到足够可以播放的媒体文件时,是否自动播放视频。

注意: 一些版本的Chrome只支持autostart, 不支持autoplay

语法

...

参数类型

Boolean (en-US)

用例

...

<...></...>

...

Xxx.xxx()

规范

规范 状态 备注
HTML Living Standard
HTMLMediaElement.autoplay
Living Standard No change from HTML5
HTML5
HTMLMediaElement.autoplay
Recommendation Initial definition.

浏览器支持

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help! (en-US)

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 3.5 (1.9.1) [1] 9 ? ?
Feature Android Firefox Mobile (Gecko) Firefox OS (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) (Yes) (Yes) ? (Yes) (Yes)

看看这里