HTML autoplay Attribute
Description
The HTML autoplay attribute is a boolean attribute that, when specified, indicates that the audio or video should start playing as soon as it is ready, without waiting for the entire file to download. It can be used on both <audio> and <video> tags. The primary use of autoplay is to provide a seamless media experience for the user by eliminating the need to manually start playback of a media file. However, its use is subject to various restrictions by browsers, primarily to improve user experience and prevent unexpected audio or video playbacks that could be intrusive. For example, many mobile browsers and some desktop browsers will ignore the autoplay attribute unless the video is muted, or unless the user has interacted with the site in some way. This is because automatic playback with sound can be disruptive or consume data on a mobile plan. To ensure compatibility and adherence to user preferences, developers often need to combine autoplay with other attributes like muted or use JavaScript to control media playback more dynamically.
Syntax
<tagname autoplay>
Values
The autoplay attribute is a boolean attribute, therefore no values are associated with this attribute.
Applies To
Example
Browser Support
The following information will show you the current browser support for the HTML autoplay attribute. Hover over a browser icon to see the version that first introduced support for this HTML attribute.
Desktop





Tablets & Mobile





