WordPress.org

Ready to get started?Download WordPress

Forums

Background Music (11 posts)

  1. horizon1976
    Member
    Posted 9 years ago #

    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.

  2. anthonymcg
    Member
    Posted 9 years ago #

    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.

  3. oriecat
    Member
    Posted 9 years ago #

    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.

  4. davincim
    Member
    Posted 9 years ago #

    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. :)

  5. vkaryl
    Member
    Posted 9 years ago #

    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....

  6. evelynpoh
    Member
    Posted 9 years ago #

    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

  7. Mark (podz)
    Support Maven
    Posted 9 years ago #

    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.

  8. evelynpoh
    Member
    Posted 9 years ago #

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

  9. Triple6demon
    Member
    Posted 8 years ago #

    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

  10. beccalouise
    Member
    Posted 8 years ago #

    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.

  11. babyluv2
    Member
    Posted 7 years ago #

    where do i put this?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags