Jump to content

How To Automatically Play Audio On Webpage Using HTML Or Javascript?

I need to find a way to autoplay a song on my webpage, that doesnt need vlc player. The audio format is .M4A

 

But I also need a way to toggle it in the header, but not a player just a button, also with some effects from css. 

Link to post
Share on other sites

[CPU: AMD FX-6100 @3.3GHz ] [MoBo: Asrock 970 Extreme4] [GPU: Gigabyte 770 OC ] [RAM: 8GB] [sSD: 64gb for OS] [PSU: 550Watt Be Quiet!] [HDD: 1TB] [CPU cooler: Be Quiet! Shadow Rock Pro Sr1]  -Did i solve your question/problem? Please click 'Marked Solved'-

Link to post
Share on other sites

Don't. Sites that automatically play music are the worst thing in the land. I want to break my computer every time I come across this.

Its just for assignment for class. Im the teacher start student so I wonna show what I can really do with Javascript, html, and css.  

Link to post
Share on other sites

for html 

 

<audio controls autoplay>
  <source src="path-to-file" type="audio/mpeg">
  <source src="path-to-file" type="audio/ogg">
  Your browser does not support this audio format.
</audio>
 
this works for me :)
 
this only works with html 5

PooKloo For Slick

Link to post
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

×