0

I want make the music automatically,but it dosn't work. <embed src="music/1.mp3" autostart="1"> I tried autostart="true";

Deng
  • 1
  • 1

2 Answers2

1

After the policy changes, Chrome doesn't allow autoplaying embed audios.

Discussion about changes in Chrome

What you can do is to autoplay the muted video:

<video controls autoplay muted>
    <source src="music/1.mp3" type="audio/mp3">
</video>

You can find more work arounds here: How to make audio autoplay on chrome

0

You don't want quotes around 1 or true. Adding quotes makes them strings as opposed to boolean.

I would suggest looking into using html5's <audio> element.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio

Rob Moll
  • 3,345
  • 2
  • 9
  • 15