Jump to content

music background with mute


houssam_ballout

Recommended Posts

it would be easier to explain to your friend that websites simply do not do this anymore.  The only site that still plays embedded music is myspace, and nobody goes there.

 

However, if you really must do this, use an <embed> tag to load the music, then to mute it you:

 

var player = document.getElementById("theEmbedObjectId");
player.stop();

-Dan

You should just put a meta redirect that will send them back to where they came from after about 2-3 seconds. It will save the users the trouble of clicking the back button themselves, since that's what people do as soon as uninvited music starts playing anyhow.

The question you asked was for the mute functionality, which I've now given you.  Auto-playing music does not "give life to the website," it makes users leave.  I won't help any further than this.  If you wanted play/pause functionality then asking for it from the beginning would have been good, since then I wouldn't have closed the documentation page that I got the answer from.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.