Søg i Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

html <audio>

  • 3 svar
  • 1 har dette problem
  • 8 visninger
  • Seneste svar af jscher2000

more options

Can anyone tell me why the following html code doesn't work:

<audio autoplay>
  <source src="file.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>

I must say, it does work in Microsoft Edge, but in no other browser, including Firefox. And how could I make it work? I want the audio file to start playing when the page is opened, in the background, no controls, no loops...

Thanks in advance for any help.

Ændret af cor-el den

Alle svar (3)

more options

According to w3schools it works on Firefox: https://www.w3schools.com/html/html5_audio.asp

Nyttig?

more options

You can check the Web Console for media related messages.


Firefox can block autoplay by default, you can check the Autoplay setting for the current tab in "Tools -> Page Info -> Permissions".

Nyttig?

more options

By default, audio does not auto-play on page load in Firefox. Another test:

https://www.jeffersonscher.com/temp/audio.html

Nyttig?

Stil et spørgsmål

Du skal logge ind på din konto for at svare på et indlæg. Start et nyt spørgsmål, hvis du ikke har en konto endnu.