I'm trying to make web page in which there will be music playing in background.
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Website </title>
</head>
<body>
<h2>Welcome to my website</h2>
<audio src="sound.mp3" controls autoplay>
<p>If you are reading this, it is because your browser does not support the audio element. </p>
</audio>
</body>
</html>
You can see audio player, so web page can find mp3 file for sure.(https://i.stack.imgur.com/4GERM.png)
I tried many different approaches (audio tag, embed tag, iframe, some js scripts) but I can only make audio player and I have to turn on music manually, and I can't find way to start playing music, when i enter web page. My browser is opera gx, but i tried also do this in edge with same results. Do you have any ideas how to make it work?