Jump to content

music on webpage?


shek
 Share

Recommended Posts

how can we put music on our webpage??I tried it with tag "embed src", but whenever I open that webpage it is asking to download music.....and then only we can hear it.I want to as,can we put music that person who opens that can directly hear the music, without downloading it?When I uploaded my page only then it is giving download option,otherwise when I see webpage on my PC & the music I can hear... without any problem.

Link to comment
Share on other sites

Sounds to me as if your computer doesn't have a browser plugin to actually play the music directly from the page. Try downloading some, just google it up. Another person will have the same problem if they don't have a plugin as well. Just as well, three simple words of advice. Post some code.There is a secondary method, but it involves JavaScript, can be annoying, and it crudely fit for IE users only.

Link to comment
Share on other sites

Guest FirefoxRocks

Try using this cross-browser compatible method:

<!--[if !IE]--><div><object data="YOURSOUNDFILE" type="MIME TYPE OF YOUR MUSIC"><param name="autostart" value="true" /><param name="src" value="YOUR SOUND FILE" /><param name="autoplay" value="true" /><param name="controller" value="true" /></object></div><!--[end if]--><!--[if IE]><embed src="YOURSOUNDFILE" controller="true" autoplay="true" autostart="true" type="MIME TYPE OF YOUR MUSIC" /><![end if]-->

I think that will work, but I'm uncertain about the Internet Explorer thing. Could someone please check that for me?

Link to comment
Share on other sites

i think you can put music in your page by this tag

<bgsound src="yoursound.wav" loop="5">
just put your music src there and put this code in your page ..and change loop as you wish ..----------------------------hope it help you
Link to comment
Share on other sites

i think you can put music in your page by this tagjust put your music src there and put this code in your page ..and change loop as you wish ..----------------------------hope it help you
That is an old IE only tag. Won't work cross-browser, especially the newer, more standards compliant browsers like FF2, Opera, netscape.
Link to comment
Share on other sites

Try using this cross-browser compatible method:
<!--[if !IE]--><div><object data="YOURSOUNDFILE" type="MIME TYPE OF YOUR MUSIC"><param name="autostart" value="true" /><param name="src" value="YOUR SOUND FILE" /><param name="autoplay" value="true" /><param name="controller" value="true" /></object></div><!--[end if]--><!--[if IE]><embed src="YOURSOUNDFILE" controller="true" autoplay="true" autostart="true" type="MIME TYPE OF YOUR MUSIC" /><![end if]-->

I think that will work, but I'm uncertain about the Internet Explorer thing. Could someone please check that for me?

As I told it I tried with "embed src" tag..I want to know is it possible by using only html?
Link to comment
Share on other sites

Yes, but only if the person viewing it has the correct browser plugins associated with whatever you are providing them with. Just use the <embed> tag like you did previously. It's always courteous to provide links to some plugin sites if you do decide to do this.

Link to comment
Share on other sites

  • 4 weeks later...

Am a noob at creating websites so if am no help then it don't matter just thought I try to help.

Note: The <embed> element is supported by both Internet Explorer and Netscape, but it is not a standard HTML or XHTML element. The World Wide Web Consortium (W3C) recommend using the <object> element instead.
The above has been taken from here...http://www.w3schools.com/media/media_browsersounds.aspExample of a object tag would be:-.
<objectclassid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"><param name="FileName" value="This Is Where Your Sound Goes.mid "/></object>
I hope I have helped you, if not, then don't matter like I said I am trying to help even though am a noob.
Link to comment
Share on other sites

I would use Javascript to check the browser, and use alternat methods according to the result.Tryit For Javascript & BrowsersOtherwise (and this probably the better option) use the object method above.

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...