'Audio won't autoplay
<!DOCTYPE html>
<html>
<body>
<audio controls autoplay>
<source src="Rick Roll.mp3" type="audio/mpeg">
</audio>
</body>
</html>
For some reason, it won't play automatically. Is it because the file is too big?
Solution 1:[1]
Media like video or audio will not play automatically anymore. This is a security thing. In order to play the media, user must interact with the page, like with a click.
Solution 2:[2]
There is a space in your src that is invalid.
<source src="Rick Roll.mp3" type="audio/mpeg">
Try for fix that(if is this):
<source src="RickRoll.mp3" type="audio/mpeg">
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | General Grievance |
| Solution 2 | Arman Ebrahimi |
