Jump to content
mrmagoo8870

Trying To Make A Browser Juke Box

Recommended Posts

Hello all,I have been looking for a way to use <embed>, <bgsound> or <object> to creat a browser juke box player that will allow the most comon browsers to use it and I'd like it to be able to play multiple .mid, .wav, and .mp3 files by selecting their choice. I've found nothing that works properly in all browsers. For MSIE I used <bgsound> and used a JavaScript and a <form> with buttons to change the src="file.wav" and stop the sound. I can't seem to figure out how to change the src of <embed> and I'm completely lost on <object>. Right now I simply have 5 <embed>'s on my page and it doesn't feel right, but I understand that it at least works in the majority of browsers. The page is: http://www.realmodyssey.com/bgmusic.htmlAny help would be greatly apreciated. Thanks!

Share this post


Link to post
Share on other sites

Well, no replys so I went back and brushed up on the HTML DOM, namely the 'getElementById()' and 'innerHTML' properties. I believe I can do something like this.

<html><head><title> dHTML Browser Jukebox </title><script type="text/javascript"><!--var name;function change(name)	 {	 document.getElementById('music').innerHTML="<a href='" + name + "' title='Click here to play in your Media Player. Right click here to save the file to your computer.'>" + name + "</a><br /><embed src=" + name + " autostart='true' loop='false' height='50px' />";	 }//--></script></head><body onload="change('song1.mp3')"><a href="#" onclick=change('song1.mp3');>Song1</a> | <a href="#" onclick=change('song2.mp3');>Song2</a> | <a href="#" onclick=change('song3.mp3');>Song3</a> | <a href="#" onclick=change('song4.mp3');>Song4</a> | <a href="#" onclick=change('song5.mp3');>Song5</a><br /><br /><div id="music"></div></body></html>

Edited to fix the code and to tel y'all I did the above and it works!

Edited by MrMagoo

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...