|
Posted by cwdjrxyz@yahoo.com on 12/27/05 23:15
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.
[Back to original message]
|