Reply to Re: Background music not working??

Your name:

Reply:


Posted by cwdjrxyz on 12/12/06 22:44

sally jo wrote:
> Here's the code I'm using:
>
> <script language="Javascript">
> if (navigator.userAgent.indexOf('MSIE') > -1)
> {
> document.write('<bgsound src="Norah Jones - Sunrise.mp3"
> loop="1">');
> } else {
> document.write('<embed src="Norah Jones - Sunrise.mp3"
> autostart=TRUE hidden=true loop="1">');
> }
> </script>
>
> and here's the site:
>
> http://cc.usu.edu/~cassia/index.html
>
> Am I supposed to add that code to all the pages on the site?

That script comes from the very early browser war era and will fail on
many modern browsers for several reasons that I will not bore you with.

I suggest using an m3u play list. For an example, see
http://www.cwdjr.net/mpg/NGdemo.html . This is your main page on which
you want some sound. I include only sound on this page to make it
simple. The code for this page with the url above is:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>NGDemo.html</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
</head>
<body>
<p><a href="http://www.cwdjr.net/mpg/playlist1.m3u">Play Music</a></p>
</body>
</html>

The important part is the paragraph with the link to the playlist,
which you would use on every page for which you want sound.

Since the above page calls a playlist, we need one. The address, which
is the url for the playlist page, is:
http://www.cwdjr.net/mpg/playlist1.m3u . The code for the playlist page
with this url is just a list of urls of one or more songs you have
stored somewhere on your site. They can be in a mixture of mp3, wav,
and several other formats, depending on the players you have on your
computer. The code I used on this playlist page is:


http://www.cwdjr.net/mpg/MackieMesser.mp3
http://www.cwdjr.net/largesou/cat3.wav

Since several different players will play a m3u playlist, I don't know
which player will come up for you. You can configure players to make
one primary for m3u playlists, if you want to, or just take what you
get. I use Winamp for m3u playlists. The demo I give above works for me
on current versions of IE6, Opera, and the Mozilla
family(Firefox,Netscape, Mozilla, Seamonkey).

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация