You are here: Re: Background sound for IE and FF « HTML « IT news, forums, messages
Re: Background sound for IE and FF

Posted by cwdjrxyz@yahoo.com on 12/28/05 09:35

cwdjrxyz@yahoo.com wrote:
> Dung Ping wrote:
> > I placed following code in a page to play background sound on IE and FF
> > respectively:
> >
> > <bgsound
> > src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
> > loop='-1' />
> >
> > <object>
> > <embed
> > src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
> > loop='5'></embed>
> > </object>
> >
> > However, when opened online with IE, there are double sounds, sounding
> > that both pieces of code are working one after the other, with fraction
> > of a second in between. But opened offline, there are no double
> > sounds. Nor opened with FF.
> >
> > Following is the page. But the song is in Chinese. It may not be easy
> > to detect the double sounds without some knowledge about the language.
> >
> > http://www.pinyinology.com/music/meihua.html
> >
> > Is there any problem with the code? Expertise is greatly appreciated.
>
> The problem with the code is that both bgsound and embed are hangovers
> from the browser war era, and neither have ever been part of official
> W3C html. Adding an object around embed does not make the code correct.
> There are ways to handle the code correctly for modern html and media
> players, but they can be a bit complicated.
>
> The bgsound tag is an IE(and close relatives) thing only, and would not
> work on old Netscape or on the new Mozilla family browsers including
> Firefox, Mozilla, and Netscape. An exception is that Opera may handle
> bgsound, as it does many other Microsoft things, but I am not certain
> about this.
>
> The embed tag(skip the object around it, and it does not need to be
> closed) worked on the old Netscape. Early on it would not work on IE,
> but at some point Microsoft added embed support for their browsers, so
> today IE usually supports embed. Thus on Microsoft you likely have two
> players working that are playing the same song with slightly different
> start times. If you remove the bgsound code, operation likely will be
> normal.
>
> I did not hear the song on my Firefox, but the problem was not the
> code. Rather I just do not have a plugin assigned to play the .au
> soundfile you use, so Firefox complained about that.. The .au sound
> file is not used much anymore, so you may find a few others who do not
> have a plugin set up for it on some or all of their browsers.

It is easy to convert the Sun .au format to a .wma format using the
free Windows Media Encoder. It also is easy to convert the .au to a
Real .rm sound file. These are the two formats most often used to
stream audio on the web today. You have to write a .ram redirector file
to connect to the .rm for streaming, and you write a .wax redirector
file to connect to the .wma to make it stream. Please see
http://www.cwdjr.info/PlumsMarch/ . Here you will find the sound and
redirector files that I mentioned as well as text versions of the
redirector files. Notice that if you click on the .wax redirector file
you bring up the big WMP player, and streaming starts. If you click on
the .ram redirector file, this brings up the Real player and streaming
starts. You can also embed the players on a page in many different
ways. Click on the WMP embed link to see one way this can be done. The
mime file on the page is an include and does nothing by itself - it
must link to a web page to work.

If you try to click it on, you will either get no display or you will
get an XML error message from browsers that can handle the mime type
application/xhtml+xml. I am using a php include to serve the page as
true xhtml 1.1 when the browser will accept the mentioned mime type and
as html 4.01 strict when the mime type is not supported, such as for
IE6.

You are welcome to copy any of the files in this directory if you think
they might be of use. I will take this directory down in a few days,
because I do not host streaming media files for others, since they can
use up quite a bit of bandwidth.

 

Navigation:

[Reply to this 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

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