Jump to content

Background Music


Sigord
 Share

Recommended Posts

By using <bgsound src=Pics\N.mp3 loop="1"> which does not seem to be mentioned in the Learn HTML and CSS book, I can play a MP3 or smaller MID file while viewing the images. But as soon as I click on an image to enlarge, the music stops and only restarts at the beginning again. Is there a way of allowing the music to continue without interruption when enlarging images?Thanks Gordon<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>An XHTML 1.0 Strict standard template</title><meta http-equiv="content-type"content="text/html;charset=utf-8" /></head><b><center><font face=arial><font size=3><font color=000000><br><bgsound src=Pics\N.mp3 loop="1"><font color=000000><br>000DG.<br><a href="Pics\000DG.jpg"/a><img src="Pics\000DG.jpg" width="500 "/><p><br>040PIC.<br><a href="Pics\040PIC.jpg"/a><img src="Pics\040PIC.jpg" width="500 "/><p></center></b></body></html>

Link to comment
Share on other sites

I wish to enlarge on the subject.<bgsound> works only in IE. That command is deprecated and is supposed to be replaced by CSS. But how?HTML5 has a new command <audio> which works in Firefox when using OGG, but not MP3 files.Both MP3 and OGG are old compression routines that are supposedly superceded by MP4/M4A/M4V.However, I cannot get M4A to work, either, in IE or Firefox.Could somebody give me code that plays background music on a majority of browsers?Thank you

Link to comment
Share on other sites

<bgsound> is not standard HTML. It isn't "deprecated" because you can't deprecate something that wasn't a standard to begin with. The standards don't have a substitute for it because sound is degrading towards a user's experience. A user should be able to choose whether they want audio or not on the page, so an interface is necessary.Clicking a link changes the page, so any media that was on the page has to be reloaded. If you want to enlarge an image without reloading the page you'll have to modify the DOM with Javascript.

Link to comment
Share on other sites

<bgsound> is not standard HTML. It isn't "deprecated" because you can't deprecate something that wasn't a standard to begin with. The standards don't have a substitute for it because sound is degrading towards a user's experience. A user should be able to choose whether they want audio or not on the page, so an interface is necessary.Clicking a link changes the page, so any media that was on the page has to be reloaded. If you want to enlarge an image without reloading the page you'll have to modify the DOM with Javascript.
Link to comment
Share on other sites

I am not sure why some people think that they know what is good for others. CSS guys, take note.Background music may be a distraction for some but for others, namely History- and Music students, it becomes a necessity.Please post coding that actually plays in HTML5 for most browsers and preferably without any add-ins. I tried several add-ins and one of them clobbered my Win-7 system, creating a severe one-week pain.Thank you

Link to comment
Share on other sites

Background music may be a distraction for some but for others, namely History- and Music students, it becomes a necessity.
Hence, the reason it should be optional. Some may like it, but others (in this case I think most) may not. I personally find it very distracting and degrading.As to the question at hand, I'm not very experienced with audio/video in websites, but I don't think there is one single way where it will play in all browsers. (Depending on your definition of 'most browsers', you may not even be able to achieve that.) It is likely to involve a combination of <object>, <embed>, and the HTML5 <audio> tags.EDIT: Now that I think about it, Flash would probably work in all browsers, but that requires a plugin. Edited by ShadowMage
Link to comment
Share on other sites

You can use a Flash music player. You'll have to look around for them, or program one yourself. HTML5 isn't supported by all browsers yet, so you can't count on it.

Link to comment
Share on other sites

Now that I think about it, Flash would probably work in all browsers, but that requires a plugin.
Most (I think it is 98%...?) browsers do have the Flash plugin which is why it is the most popular choice for websites playing background music. HTML5 has potential in the future.
Link to comment
Share on other sites

Thanks everyone for your interest. I will have to ask my pal who uses Firefox and is one of the regular contributors and visitors to the daily pages of my site, if music can be heard when I opt to use background music. If anyone is interested in my attempts at creating free programs to help novices to construct such pages visit http://www.sigord.co.uk/Submits/Software.htm and try HTML CODER etc. The code can be found on another page. Being strictly an Amateur all my life comments are always welcome if not too involved.I often wonder if Windows Media Player could be invoked the same way when <a href="Short.mp3">Play a MP3<a> or<a href="Short.mid">Play a MIDi<a> are used but without displaying WMP. Then since WMP will play continuosly while many other programs are running a web page should not interfere with it.Gordon

Link to comment
Share on other sites

Thanks everyone for your interest. I will have to ask my pal who uses Firefox and is one of the regular contributors and visitors to the daily pages of my site, if music can be heard when I opt to use background music. If anyone is interested in my attempts at creating free programs to help novices to construct such pages visit http://www.sigord.co.uk/Submits/Software.htm and try HTML CODER etc. The code can be found on another page. Being strictly an Amateur all my life comments are always welcome if not too involved.I often wonder if Windows Media Player could be invoked the same way when <a href="Short.mp3">Play a MP3<a> or<a href="Short.mid">Play a MIDi<a> are used but without displaying WMP. Then since WMP will play continuosly while many other programs are running a web page should not interfere with it.Gordon
Link to comment
Share on other sites

Thanks for the idea of using Flash. Yes, almost everybody has Flash. The problem with Flash is that the user needs click-permission to use it. Talking about "annoyance".Gordon, IE plays MP3 as <bgsound>. As we now know, bgsound is Microsoft non-standard although my book desclares it is deprecated. By-the-way: IE-9 is full of holes. Some Web pages display only partially, others not at all. My computer repair shop confirmed this and I had to pay money to get back to IE-8.Firefox wants <audio> with OGG. Does not play MP3 with Media Player, or QickTime, or others that I forgot about. Later I learned that it is a matter of patent rights. Also had no luck with M4A (MP4). Maybe later when this mess gets sorted out.

Link to comment
Share on other sites

I have never heard of anybody having problems with bugs in Internet Explorer 9. There are no commonly known glitches with it.Users don't need "click permission" to use flash documents. Along time ago Microsoft had some patent trouble with the Opera developers and had to add a "click-to-activate" feature to Flash to get around it. They already fixed that years ago and no other browser has ever had and "click-permission" problems.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...