Jump to content

Why do i get no sound when I added code for autoplay?


WebBuilder

Recommended Posts

Still a real noob here.

 

Here is my code:

<!DOCTYPE html><html><head><style>body{background-color:black}h1{background-color:#00ff00;}p{background-color:rgb(255,0,255);}</style></head><body><center><h1>Welcome to my Cool Website!</h1></center><p>This is a paragraph.</p><audio controls autoplay>  <source src="aroundtheworld.ogg" type="audio/ogg">  <source src="aroundtheworld.mp3" type="audio/mpeg">Your browser does not support the audio element.</audio></body></html>

As far as I can tell the paths are ok on my hard drive but when I hit refresh nothing happens. If i hit refresh again the player does show up (whereas it didnt before) but the track listing shows 0.00 and nothing plays.

 

Edit:

 

hmm jsut tried it with:

<audio src="aroundtheworld.mp3" autoplay></audio>

and put in root so I guess the folders were wrong somehow.

Edited by WebBuilder
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...