Helpful Information
 
 
Category: Looking for such a script or service
play music thats on your computer...

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.

Thanks

<iframe src="http://mburt.mb.funpic.org/player/media_player.htm" width="450" height="200" scrolling="no" frameborder="0"></iframe>
Tada!
... 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

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


<html>
<head>
<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
record.push(data.value)
var space = "<br>"
if (i == 1) {
space = ""
}
else {
space = "<br>"
}
strData()
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"
}
}
showplaying()
}
function stop() {
document.getElementById("sound").src = ""
}
function showplaying() {
nowplaying.innerHTML = "Now Playing: " + stringedData
}
</script>
<style type="text/css">
...
</style>
</head>
<body>
<div id="player">
<img src="header.png" style="float:left"><div style="float:left;font:11px verdana" id="nowplaying"></div>
<br>
<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>
<div id="outer">
<a href="#" onclick="stop()">[stop]</a>
</div>
</div>
</body>
</html>

http://www.dynamicdrive.com/forums/showthread.php?t=2789

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

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

Mburt,

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

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.

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

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.

Your whole layout is completely messed up in Konqueror, too.

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)

Oh crap... more layout issues! As I said before the same link was used, so I'll keep posting here for updates.

where is the script

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.

whats the script?










privacy (GDPR)