music to web page

cindysei
cindysei used Ask the Experts™
on
I've put in code to the following web page - it works for me locally but not on the server I've uploaded it to. Is it because there is an "embed" tag? I got this code from the internet so don't really understand it. What can I do so it plays "live"? Here's the code for the page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>music</title>
</head>

Thanks, Cindy
<body>
<table width="400" border="1">
  <tr>
    <td><img src="images/background-music.jpg" width="400" height="220" alt="music" /></td>
  </tr>
  <embed src="Amélie.mp3" width=150 height=45 autostart=true repeat=true loop=true>
</table>
</body>
</html>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
An embed tag without a player will use the default media player on the user's computer.  It often has to download completely before it will play.  Most of us use a flash music player.  Also, you are not supposed to put anything between a </tr> and </table>.  That will cause an error in the W3C HTML validator.  If you have Flash, you can make a simple one.  If you don't, I've used the XSPF music player on some web sites.  http://musicplayer.sourceforge.net/   Their directions are a little obscure but it does work.

Author

Commented:
So why does it work for me locally but not when I test it live? If I'm using my computer in both instances - I should already have the player, right? What do you mean :"if I have Flash, I can make a simple one?" - I'm not an expert at all as you might have guessed so any further direction would help. I really didn't think playing music automatically on a page would be so difficult code wise!
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
No browser will automatically play music by itself.  They always require an external program or a plugin to do that.  It's not particularly difficult but it takes a little more than what you are doing.  About Flash, I meant the Adobe Flash compiler program.  I have an old copy that I use strictly for generating music clips that will play on web sites.

Did you upload the MP3 to the server?

Author

Commented:
Yes, I uploaded to the server. Sorry, I get the flash thing now - was having a blond moment. I have flash but it's been years since I've used it so a tad rusty. I was trying to get away with as little coding as possible. In Dreamweaver, can I put in a plug-in code? If so, where in my page should I do that? Thanks for your help! Cindy
Fixer of Problems
Most Valuable Expert 2014
Commented:
This page shows the correct code: http://helpx.adobe.com/flash/kb/object-tag-syntax-flash-professional.html  In Adobe Flash, make a new project.  Import the audio (in WAV format).  Go to the Publish settings and select the audio you want and adjust the level.  Then Publish it.  It should create both the SWF and an HTML file with the code in it.  Use the SWF that is created, substitute that name in the code in the link, and upload it to your web site along with the SWF.   In Flash 4 that I have, it always set the image size and I reset it to 1x1.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial