Results 1 to 6 of 6

Thread: Background Music Script for Website

  1. #1
    Join Date
    Nov 2009
    Posts
    580

    Background Music Script for Website

    Hello, I have recently learn to write script using the Java and PHP. I want to know the script which can be create the background music on your webpage either by making use of the server or with the use of any other website address. If anyone from you know how to achieve this, then please give me details about it and if you have the script then please give that to me.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Background Music Script for Website

    You can make use of the follwoing java script to play the mp3, wav, mid, au files on your web page with the help of browser.
    Code:
    <script language="JavaScript" type="text/javascript">
    if (navigator.appName == "Microsoft Internet Explorer") 
    {
    document.write('<bgsound src="<file name>" LOOP="false">');
    }
    else
    {
    document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src="<file name>" AutoStart="true" ShowStatusBar="0" ShowControls="0" ShowDisplay="0" volume="1" HEIGHT="1" WIDTH="1" loop="false"><br>');
    }
    </script>

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Background Music Script for Website

    Instead of any script if you make use of the following application then also you can able to load background music on your Website. Make use of one of them to give background music to your website:
    • Website Background Music 1
    • Website Baker 2.6.x
    • Lisas Background Script

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Background Music Script for Website

    Hello, I know the following PHP script to for Background Music for website. You can make use of this in your source. This will give you the different music as per the conditions satisfaction. In the path section you need to provide the path of the music file.
    Code:
    <php
    if(rand(0,3)==0) 
    { 
    echo ' 
    <bgsound src="<path>" loop="infinite">'; 
    } 
    elseif(rand(0,2)==0) 
    {  
    echo ' 
    <bgsound src="<path>" loop="infinite">'; 
    } 
    elseif(rand(0,1)==0) 
    { 
    echo ' 
    <bgsound src="<path>" loop="infinite">'; 
    } 
    else
    { 
    echo ' 
    <bgsound src="<path>" loop="infinite">'; 
    }
    ?>

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    Re: Background Music Script for Website

    If you want to set background music on your web page then you can simply use the HTML coding to do it as follows:

    Code:
    <embed name="Name"
    src="<path for the file>"
    loop="false"
    hidden="true"
    autostart="true">
    </embed>

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Background Music Script for Website

    Background Music Script for Website
    Code:
    <script language="JavaScript" type="text/javascript">
    if (navigator.appName == "Microsoft Internet Explorer") 
    {
    document.write('<bgsound src="<name of the file to play with path>" LOOP="false">');
    }
    else
    {
    document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" Name="MediaPlayer" src="<name of the file to play with path>" AutoStart="true" loop="false"><br>');
    }
    </script>

Similar Threads

  1. Dynamic website is desktop background
    By Cale in forum Customize Desktop
    Replies: 5
    Last Post: 26-04-2011, 06:50 AM
  2. Is it possible to play music in the ipad at background?
    By Kasper in forum Portable Devices
    Replies: 4
    Last Post: 23-03-2010, 06:11 PM
  3. Fallout 3 background theme music
    By Finalo in forum Video Games
    Replies: 3
    Last Post: 02-05-2009, 01:27 PM
  4. How do i add background Music to Emails in outlook
    By Kuprin in forum Technology & Internet
    Replies: 3
    Last Post: 20-04-2009, 10:19 PM
  5. Need script for website with firefox only
    By Gap meer in forum Software Development
    Replies: 4
    Last Post: 01-12-2008, 05:44 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,209,459.10921 seconds with 17 queries