WordPress.org

Support

Support » How-To and Troubleshooting » Background Music

Background Music

  • To have a music on my blog, I used below code:
    <!– Begin Music Section –>
    <script language=”javascript”>
    function BeginMusic(){
    if(document.MusicForm.snd.value == ‘Music on’)
    {
    document.all.music.src=’http://www.sharemation.com/parsa1976/Zebigniew%20Preisner%20-%20Dekalog%20VIII%20-%203.WMA’;
    document.MusicForm.snd.value = ‘Music off’;
    }
    else
    {
    document.all.music.src=”;
    document.MusicForm.snd.value = ‘Music on’;
    }
    }
    </script>

    <center><form name=”MusicForm”>
    <input name=”snd” type=”button” value=”Music on” OnClick=”BeginMusic()”>
    </form></center>
    <bgsound id=music loop=-1 autostart=”true” >

    <!– End Music Section –>
    It works when the visitor clicks on it. How will it work automatically? Meanwhile, if there is an easier way to have a music on the blog, don’t hesitate and write it down please.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Starting music automatically is generally considered bad practice. The visitor won’t be expecting it and the results are largely negative. I’d leave it up to them to a click a link to start it.

    I agree! I absolutely detest webpages that start playing music and I will leave as quick as my back button will take me out of there.

    I have to second what anthonymcg says. Predicting how your visitors will react to hearing music played upon entering your site is dicey, but chances are high that it won’t be a positive experience. For example, maybe their volume is set high (after playing something earlier). They’re sitting down to enjoy a little quiet surfing and WHAM! — the music plays and they’re scrambling to find the volume control.

    I’m sure you have good intentions with playing music to set the atmosphere, but perhaps allowing the user the choice of playing the music would be the better solution. 🙂

    If you really MUST start music without the user’s approval, use a search engine for “embed background music”.

    However, I tend to agree with both anthonymcg and oriecat: it’s pretty well considered very bad practice to foist music on the unsupecting user….

    Can someone guide me on how to create background music for my site?

    I’m new in WordPress, pls assist in full detail and steps. tks

    evelynpoh – there is no special technique to embedding music into your page just because it runs on WordPress. If you do a web search you will find the necessary information.

    I also agree with the posters above about music on a page – any page – so bear in mind how this will affect your traffic.

    how about create a Window Media Player at my site to play songs? how to do that?

    Triple6demon

    @triple6demon

    To add windows media player music files, the best DTD approach I’ve personally found was one at filebunker.net, which is

    <object><param name=”autostart” value=”true” />
    <param name=”src” value=”./audio/songname.wma” />
    <embed src=”./audio/songname.wma” autostart=”true”>
    </embed></object>

    Good luck

    regarding the post above with this code:

    To have a music on my blog, I used below code:
    <!– Begin Music Section –>
    <script language=”javascript”>
    function BeginMusic(){
    if(document.MusicForm.snd.value == ‘Music on’)
    {
    document.all.music.src=’http://www.sharemation.com/parsa1976/Zebigniew%20Preisner%20-%20Dekalog%20VIII%20-%203.WMA’;
    document.MusicForm.snd.value = ‘Music off’;
    }
    else
    {
    document.all.music.src=”;
    document.MusicForm.snd.value = ‘Music on’;
    }
    }
    </script>

    <center><form name=”MusicForm”>
    <input name=”snd” type=”button” value=”Music on” OnClick=”BeginMusic()”>
    </form></center>
    <bgsound id=music loop=-1 autostart=”true” >

    <!– End Music Section –>

    where do you fill in the information for the song? please help, I am a little clueless.

    where do i put this?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Background Music’ is closed to new replies.
Skip to toolbar