View Full Version : play music thats on your computer...

12-31-2006, 09:49 PM
Hi i would like to let people play the music on there computer on my website.
you see i have finished a site that is very much like windows media center, the only thing it is missing is letting the using watch his or video and listen to there music on there computer. i was wondering if any one would be able to help.


01-02-2007, 06:37 PM
<iframe src="http://mburt.mb.funpic.org/player/media_player.htm" width="450" height="200" scrolling="no" frameborder="0"></iframe>
... well sort of. I'm trying to work out the kinks. As of now, it only works for internet explorer :( . Giving <bgsound> an ID tag doesn't want to work in firefox

01-02-2007, 07:09 PM
Also, if anyone could give me an alternative for the <bgsound> tag for playing music it would be greatly appreciated. Here's the script:

<bgsound id="sound">
<script type="text/javascript">
var i = 0
var stringedData = ""
var record = new Array
function add() {
var ext = data.value.substring(data.value.length-4,data.value.length)
if (ext == ".mp3" || ext == ".wav") {
i = i + 1
var space = "<br>"
if (i == 1) {
space = ""
else {
space = "<br>"
var html = space+"<a href=\"#\" title=\"play "+stringedData+"\" onclick=\"play(this)\">"+i+". "+stringedData+"</a>"
var store1 = document.getElementById("store")
store1.innerHTML += html
else {
alert("Invalid music file. Data may be corrupted.")
function strData() {
for (x = 0;x < data.value.length;x++) {
if (data.value.charAt(x) == "\\") {
stringedData = data.value.substring(x+1,data.value.length)
function play(id) {
document.getElementById("sound").src = record[id.innerText.substring(0,1)-1]
id.className = "hilite"
id.style.color = "white"
id.onblur = function() {
player.onclick = function() {
id.className = "lolite"
id.style.color = "black"
function stop() {
document.getElementById("sound").src = ""
function showplaying() {
nowplaying.innerHTML = "Now Playing: " + stringedData
<style type="text/css">
<div id="player">
<img src="header.png" style="float:left"><div style="float:left;font:11px verdana" id="nowplaying"></div>
<input type="file" id="data">
<input type="button" id="confirm" value="Add to Playlist" onclick="add()">
<div id="store">
<div id="header">playlist</div>
<div id="outer">
<a href="#" onclick="stop()">[stop]</a>

01-02-2007, 07:34 PM

However, I don't think this is what was being asked. I can't see a way to do that, due to security precautions.

01-03-2007, 02:05 AM
However, I don't think this is what was being asked.
Ah, sorry about that, I missed read the OP's original question. I thought I was on a roll... lol

01-04-2007, 02:52 PM

I like your first script http://mburt.mb.funpic.org/player/media_player.htm however is there anyway it can get any music in a persons computer that is in the my music folder if they are using windows and if it could also get the mac osx music? i don't know what folder that is in.

Also can the script work in firefox

01-04-2007, 03:04 PM
Not everyone has a "My Music" folder (i do) so I'm not sure if that method is reliable.
I'm trying to work out the bugs for firefox. :)
I'll get back to you as soon as I can.

01-04-2007, 03:12 PM
also about your script why not make it play in a embeded player?
I think that way it would be great also if you could get it to scan the computer for songs

01-04-2007, 03:20 PM
Actually, that's funny, because Im working on an embedded music function now. All that's to it is to get it to switch songs.

01-04-2007, 03:37 PM
Your whole layout is completely messed up in Konqueror, too.

01-04-2007, 06:37 PM
Ok. Layout fixed, design fixed. It should work in both IE and FF (the two browsers I have) and it uses <embed> now too. (Same link as above)

01-04-2007, 07:52 PM
Oh crap... more layout issues! As I said before the same link was used, so I'll keep posting here for updates.

01-05-2007, 09:59 PM
where is the script

01-05-2007, 11:33 PM
The link is dead... Umm... I don't have any more space on my current ftp host. Sorry, but I'll post the code instead.

01-06-2007, 05:49 AM
whats the script?