post your comment   print   send to a friend
Rate:  75% | Views: 1765
Question categories:  Web Design

How do i embed background music (audio files) in my web site?

Answer by: Stuart Pierce, Aplus.Net Knowledge Base Support.

You can use the HTML EMBED tag to publish an audio file to your web site and play it in the background. The first thing to do will be to upload the audio file to your FTP space on the shared hosting server. Usually audio file size is large, that’s why we recommend that you use a local FTP client. Upload to the /html folder for the Unix-based plans and to the /WWWROOT folder for the Windows-based plans.

Then, you will need to insert into the appropriate place of your HTML page the following code:    

<EMBED SRC="http://yourdomain.com/music.mp3" autostart=true loop=false hidden=true>
</EMBED>

Please replace “http://yourdomain.com/music.mp3” with the actual domain and name of the file you have uploaded. Please have in mind that in the example above the audio file is located in the /html or /WWWROOT directory.

The above example will automatically play the mp3 file one time in the browser's default player while hiding the player from view. If you do not want it to be invisible, you can specify "weight" and "height" parameters using pixels or percentages. Here is a brief explanation of the available parameters for the EMBED tag:

  • src="http://yourdomain.com/music.mp3" - the URL path and the name of the music file to play.
  • autostart=true (or false) - if true, will play the music automatically when the page is loaded.
  • loop=false (or true, or a number) - if false, will play the music file only once. If true, will play the file infinitely. If number, the music file will be played that number of times.
  • hidden=true (or false) - if true, the browser's player will not be seen on the page. Otherwise, you have to specify:
    • height=100 (this is an example, placing the player at 100 pixels height)
    • width=100

It is possible that some browsers will not support the EMBED tag. For those, you will have to add the NOEMBED and BGSOUND tags as shown in the example below:

<NOEMBED>
<BGSOUND src="http://yourdomain.com/music.mp3" loop=false></BGSOUND>
</NOEMBED>

Used together, the EMBED and NOEMBED tags should cover most browsers on the internet today.

Related link:

Customer Feedback
Rate:  75% | Views: 1765 | Please Rate:  
 
If you have other comments or ideas for future technical tips, please type them here:

Email: (optional)

Comments: (optional)

 Domain Name Registration | Web Page Design    Back to serch results
Browse the Base
Knowledge Base
Web Design
  Trellix SiteBuilder
  FrontPage
  Professional Design
  Do It Yourself
  WSC Website Builder
Messages
 

$75 Free Google AdWords

Free $75 Google AdWords when you sign up for WebImage! Target by location, create your own, or let Google create your ads for you. Check out http://www.aplus.net/google.html to see how AdWords works for you.

Private Area
 
Ask
in Private
   
Personal
Folder
 
Related Questions
 
1. What exactly is HTML?
 
2. What about Hypertext Markup Language?
 
3. What is Body Tag?
 
4. How to place Headings on your page and how to use the Font Tags?
 
5. What is a HYPERLINK?
 
Home Browse Search Ask in Private Personal Folder   Help
powered by web hosting 
  Logged as: Guest