houssam_ballout Posted February 24, 2012 Share Posted February 24, 2012 Hello, I need help with putting music background on the html page with the mute button. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/ Share on other sites More sharing options...
ManiacDan Posted February 24, 2012 Share Posted February 24, 2012 This practice died out 15 years ago, why do you want to put music on your website? Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320916 Share on other sites More sharing options...
houssam_ballout Posted February 24, 2012 Author Share Posted February 24, 2012 It gives some life to the website & my friend asked me to do this Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320917 Share on other sites More sharing options...
ManiacDan Posted February 24, 2012 Share Posted February 24, 2012 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 Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320920 Share on other sites More sharing options...
houssam_ballout Posted February 24, 2012 Author Share Posted February 24, 2012 but I need help with mute/unmute toggling thanks Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320922 Share on other sites More sharing options...
Pikachu2000 Posted February 24, 2012 Share Posted February 24, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320923 Share on other sites More sharing options...
ManiacDan Posted February 24, 2012 Share Posted February 24, 2012 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. Quote Link to comment https://forums.phpfreaks.com/topic/257718-music-background-with-mute/#findComment-1320927 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.