Affiliated Business
Home Building Hosting Promotion Make Money Advanced Tools Homebusiness Resources
Webmaster Tools | Graphic Editors | Guides & Tutorials | Promotional Software | Site Builders | Site Templates | E-Books | Google | SEO  
ONLINE BUSINESS RESOURCES
  Affiliated Buisness Blog
  Affiliate Program      Directory
  Affiliate Marketing      Web2.0 Directory
  e-Commerce Software
  Google AdSence
  Graphic Editors
  InfoProduct MallInfoProduct Mall
  Internet Marketing
  Merchant Account
  Newsletter & e-Zine
  Offshore Incorporation
  Online Site Builder
  Online Store Builder
  Payment Processing
  Search Engines
  Site Templates
  Success Stories
  Web Programming
  Web Directories
  Web Design
  Web Design Software
  Web Marketing Guides &     Tools
  Web Promotion     Strategies
  Webmaster Tools
AFFILIATED BUSINESS TOOLS
Adword Equalizer

Site Build It!


Web Site Development Strategies And Tricks

How to Add Background Music to Your Web Page?

If you code your web pages using a text editor (as opposed to using one of those specialized web editors that give you a toolbar button for everything), you may be wondering how you might go about adding background music to your web pages. While this is not a question I encounter often at Affiliated-Business.com, I do get the occasional music aficionado sending me this query, hence this article.

Issues Surrounding Background Music

Before you start, you should be aware that background music that automatically starts playing when a web page is loaded may not be appreciated by a large number of your visitors. Some of them, when greeted with the sudden blaring of music from their speakers, may immediately hit the BACK button of their browsers. This may occur even if you're playing a piece of music that you think is well loved by everyone: remember, there are people who surf the Internet in public libraries, at work, or in the dead of the night when others are asleep. Others may already have their favourite piece of music playing on their computer speakers, and your auto-playing music file will only cause them to be annoyed.

Even if you are satisfied that your website has the type of target audience that will enjoy your background music, there are alternatives to automatically playing music that you might want to consider. For example, giving visitors a link which they can click to play music would allow you to showcase your music while remaining sensitive to your visitors' preferences. Instructions on how to accomplish this, as well as how to implement autoplaying music, are given below.

Playing Music Only When a Link is Clicked

If you have a MIDI file that you want played when a visitor clicks a link, put HTML code like the following on your page:

<a href="yourmusicfile.mid">Play background music</a>

Replace the "yourmusicfile.mid" with the appropriate filename. Note that the above HTML code works for ".wav" and ".mp3" files as well (or anything else for that matter).

How to Embed Background Music on Your Web Site

The problem with embedding background music is that the different browsers out there have their own methods of implementing embedded music files.

For all versions of Netscape, as well as IE 3.0 and above, you can use the following code:

<embed src="yourmusicfile.mid" autostart="true" loop="true"
width="2" height="0">
</embed>

The width and height attribute given above causes the player to be invisible. If you do not want it to be invisible, you can specify your own dimensions to suit your site decor.

For Opera and all IE versions, the following code works:

<bgsound src="yourmusicfile.mid" loop="infinite">

As you probably have noticed, IE 3.0 and above support both methods, so you cannot simply put both those tags into your web document in the hope of supporting all browsers. It will work on Netscape and early versions of IE, but the newer versions of IE will recognize both tags, leading to problems when IE tries to load the music file twice.

The workaround that I've seen on some sites, that seems to work for me, is to enclose the BGSOUND tag inside NOEMBED tags, thus preventing IE from interpreting the second tag.

<embed src="yourmusicfile.mid" autostart="true" loop="true"
width="2" height="0">
</embed>
<noembed>
<bgsound src="yourmusicfile.mid" loop="infinite">
</noembed>

This code appears to be compatible with all versions of IE, Netscape and Opera.

Fixing Your Web Server's MIME Types

If, after putting the above code on your site and uploading your music file, your music does not automatically play in IE, Netscape or Opera, it is possible that your web server is not sending the browser the correct MIME type. In order for the browser to know how to handle the file, your web server needs to be configured to send the correct information about the file. For example, for MIDI files, the web server should send the browser a "Content-Type" header of "audio/midi".

You can find out if your server has been correctly configured by starting up Netscape, invoking the "View" menu and selecting the "Page Info" item on that menu. (I'm referring to version 4.7x of Netscape - the item may be labelled differently on other versions of Netscape.) The MIME type of your music file will be displayed (among other things).

If the MIME type is incorrect, contact your web host to have them fix it. If your website runs on an Apache web server, and your host has configured it to allow you to override its settings using a .htaccess file, you can set up the MIME type yourself. For example, if you have MIDI files with a file extension of ".midi", you might add the following line to your .htaccess file:

AddType audio/midi .midi

If you don't have any existing .htaccess file, you can simply create one using an ASCII text editor and upload it to the top directory of your website. Remember, Microsoft Word and Wordpad are *not* ASCII text editors. Also note that this method only works for Apache servers configured to allow .htaccess overrides. If this is not the case for you (for example, if your site runs on a Windows machine running IIS), you will probably have to get your web host to fix the problem.

Browser Plug-in Problems

Sometimes you may encounter a situation where the embedded code works for you but not for others using the same version of the same browser.

This situation may occur when the person has installed some other software that has replaced the default browser plug-in to handle the music file type. For example, various multimedia players (like QuickTime) replace the browser's default plugins when they are installed. The replacement plugins may not function in quite the same way as the default plugin for the browser, leading to your code not working as expected.

There's probably little you can do to prevent this from happening, short of posting notices everywhere on your site telling people not to install such-and-such a software, which is of course ludicrous. If you insist on putting auto-playing sound files on your web page, my recommendation is that you ensure that your page makes sense whether or not those sounds are played on your visitor's machine. That is, don't auto-play a sound file that provides vital information that the visitor needs to understand your web page - unless of course you also provide a clickable link on the page that allows him to hear the information should his browser not autoplay the sound file.

Like many other aspects of coding for the web, putting music on the web requires a certain amount of defensive coding. Even then, there will probably be a percentage of visitors who will not be able to view/hear your site the way you intended.

 

How to create RSS feeds easily - with this simple guide !

By Lakhya Phukan

Creating Rss feeds is easy !

Follow these simple steps to create feeds of your site.

1) Decide which page(s) you want to use as feed. Usually such pages qualify which contain the latest updates on product or service information of that site. Remember that requirements vary from site to site. Decide your own feed carefully.

2)Open notepad and write down the following lines:

<?xml version="1.0">

<rss version="2.0">

<channel>

<title>[channel title]</title>

<description>[channel description]</description>

<link>[channel link]</link>

<item>

<title>[item title]</title>

<description>[item description]</description>

<link>[item link]</link>

</item>

[more items here]

</channel>

</rss>

3.Replace [channel title] with your site title.

4.Replace [channel description] with your site description.

5.Replace [channel link] with your site url.

6.Replace [item title] with the title of the page you want to show up as feed .

7. Replace [item description] with description of that item page.

8. Replace [item link] with the url of the item page.

9. Repeat steps 6 to 8 to create multiple items for your feed and replace [more items here].

Save the file with extension .rss or .xml (there are other extensions also , but for beginners it is best to keep it simple)

Now use this tool to verify that your feed is ok to use. Once it is verified to be ok , upload the file to your server. Thats it !
You are now ready to distribute your content to anyone who thinks it worthy !!

About the Author
Lakhya Phukan is the webmaster of http://www.hedir.com Join Hedir Forum http://www.hedir.com/groupthink/index.html to discuss RSS and other internet marketing issues. Do you have a website ? Submit your site to Hedir Web Directory.

 

AddThis Social Bookmark Button

 
INTERNET MARKETING TOOLS
1MerchantCart - eCommerce Automation
1MerchantCart - eCommerce Automation

The All-in-One Merchant Shopping Cart and Affiliate Processing Software


Get Google Ads Free
Get Google Ads Free

"Internet Marketer Gets $87 Million in Google Pay-Per-Click Ads FREE! ... And Makes Over $314 Million as a Result! ... And Now He's Going to Give You This Same Secret for Next to Nothing!"


The Millionaire League


Web site Top Affiliated-Business.com: The art of making money online... Web site Top
Home | Building | Hosting | Promotion | Make Money | Tools | Homebusiness | Resources | Tell A Friend | Add To Favorities | Link To Us | Partner With Us | Site Map |
About Affiliated-Business.com  |  Privacy Policy  |  Disclaimer  |  Copyright  |  Terms of Service  |  Collection Of Links  |
©2004-2007 Affiliated-Business.com® - All rights reserved.