Sorry if this is a silly question or posted in the wrong forum. I'm
adding music to a website and I'd like to have a few tracks (MP3s)
play back to back. I'm using the code below but I can't find the
syntax to play multiple tracks - only a single track. Can this be done
with the <embed src> tag? I know there are others ways to do this but
I am looking for the simpliest way.
<tr>
<td width="100%" colspan="2">
<p align="center">
<noembed>Your broswer does not support embedded music. This site is
best viewed in Internet Explorer 6 or higher.</noembed>
<embed src="song.mp3" width=150 height=25 autostart=true repeat=true
loop=true bgcolor=white></embed>
</td>
</tr>
As Dorayme suggested, you could combine all of the mp3s into one
track.
Do not use embed. It is not, and never has been, an official W3C html
tag, as validation of a page using at the W3C validator will quickly
show. The same is true of bgsound. Both are relics of the browser war
era. Moreover, when used for sound, embed does not now always work for
some modern browsers.
I suggest using a m3u playlist for your case. It can include any
number of mp3 and many other file types if desired. An m3u playlist
will work on many modern players including WMP, Real, Winamp, and
others. In the case of multiple players, the player that is used
depends on the default on the computer or for what player you specify
is primary for playing m3u playlists. I have a page at
http://www.cwdjr.net/souassorted/winamp.php that shows in detail how a
m3u playlist is constructed and how it is used to play. Although I
mention Winamp, as stated above, a m3u playlist will work on several
other players if they happen to be primary for it rather than Winamp.
In cause you include a more obscure file type in the playlist that
some player will not play, usually there is no great harm. That file
just is skipped.You may get a player on the screen when music is
called up. However you can drag and drop it out of the way if
necessary, or it can be minimized. You can, using considerably more
complex code, embed(using an object rather than illegal enbed tag) the
player on a page so that it is any desired size or even hidden.
However, when you have a playlist with several files, it is best to
have at least player controls so that the viewer can start and stop
the music, or skip cuts. Autostarted music that can not be turned off
offends many people. Unless your page is about music with the audio as
an example of what you are discussing, many people will become very
annoyed. if music comes on and can not be turned off. They may not
like the music, may be listening to something else while viewing your
page, or just do not want any noise that might wake up a baby or
whatever.