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