|
Posted by Dung Ping on 12/28/05 17:09
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.
Following your proposal, I changed the code to following:
<embed
src='http://www.ibiblio.org/chinese-music/Taiwan_Ceremonial/J02.Plums_March.au'
loop='true' hidden='true' autostart='true'></embed>
It works well on both IE and FF. I put a </embed> tag at the end, but
understand it is not necessary. I wonder that since each opening tag
needs to be corresponded by a closing one or close itself by </>, why
is <embed> an exception, that is, no closing tag or self-closing slash
is needed?
I've also read your next posting, but would like to read and test more,
as there are quite a few embed tags to play remote au files in my web
site. Will post results this evening (U.S. east time).
Thank you very much for your help.
Dung Ping
Navigation:
[Reply to this message]
|