...

View Full Version : Kind of new, need help with Music Player



I'm That Dude
12-01-2005, 02:48 AM
Ok, so im kind of new to coding and im getting ready to do some "music sites". Well I tried to code a music player into a site on my own, and failed. I couldnt get the player positioned on the page correctly and I couldnt get the music to play. Can someone please help me? Either with information or possibly a script for a music player and instructions on what to do.

I would appreaciate it very much.

Thank You.

_Aerospace_Eng_
12-01-2005, 03:36 AM
This thread (http://www.codingforums.com/showthread.php?t=50666) has some info that may be of interest to you. Happy reading.

I'm That Dude
12-01-2005, 03:58 AM
Thank you for the reply, im going to read that right now. Thanks again

I'm That Dude
12-01-2005, 04:45 AM
Hey Aerospace well i tried the music player, and it worked to the extent that i saw the music player and song list, just no music was being played. I used this code maybe i did something wrong.


<div align=center>
<OBJECT id=music height=44 width=230 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95>
<param name="AudioStream" value="-1">
<param name="AutoSize" value="0">
<param name="AutoStart" value="-1">
<param name="AnimationAtStart" value="-1">
<param name="AllowScan" value="-1">
<param name="AllowChangeDisplaySize" value="-1">
<param name="AutoRewind" value="-1">
<param name="Balance" value="0">
<param name="BaseURL" value>
<param name="BufferingTime" value="5">
<param name="CaptioningID" value>
<param name="ClickToPlay" value="-1">
<param name="CursorType" value="0">
<param name="CurrentPosition" value="-1">
<param name="CurrentMarker" value="0">
<param name="DefaultFrame" value>
<param name="DisplayBackColor" value="0">
<param name="DisplayForeColor" value="16777215">
<param name="DisplayMode" value="0">
<param name="DisplaySize" value="0">
<param name="Enabled" value="-1">
<param name="EnableContextMenu" value="-1">
<param name="EnablePositionControls" value="-1">
<param name="EnableFullScreenControls" value="0">
<param name="EnableTracker" value="-1">
<param name="Filename" value>
<param name="InvokeURLs" value="-1">
<param name="Language" value="-1">
<param name="Mute" value="0">
<param name="PlayCount" value="1">
<param name="PreviewMode" value="0">
<param name="Rate" value="1">
<param name="SAMILang" value>
<param name="SAMIStyle" value>
<param name="SAMIFileName" value>
<param name="SelectionStart" value="-1">
<param name="SelectionEnd" value="-1">
<param name="SendOpenStateChangeEvents" value="-1">
<param name="SendWarningEvents" value="-1">
<param name="SendErrorEvents" value="-1">
<param name="SendKeyboardEvents" value="0">
<param name="SendMouseClickEvents" value="0">
<param name="SendMouseMoveEvents" value="0">
<param name="SendPlayStateChangeEvents" value="-1">
<param name="ShowCaptioning" value="0">
<param name="ShowControls" value="-1">
<param name="ShowAudioControls" value="-1">
<param name="ShowDisplay" value="0">
<param name="ShowGotoBar" value="0">
<param name="ShowPositionControls" value="-1">
<param name="ShowStatusBar" value="0">
<param name="ShowTracker" value="-1">
<param name="TransparentAtStart" value="-1">
<param name="VideoBorderWidth" value="0">
<param name="VideoBorderColor" value="0">
<param name="VideoBorder3D" value="0">
<param name="Volume" value="0">
<param name="WindowlessVideo" value="0">
</OBJECT>
</div>
<p>
<a href="yoursong.mp3" onclick="document.all.music.filename='yoursong.mp3';return false">Play Song</a>
</p>
<p><a href="yoursong.mp3" onclick="document.all.music.filename='yoursong.mp3';return false">Play Song</a>
</p>
<p>
<a href="yoursong.mp3" onclick="document.all.music.filename='yoursong.mp3';return false">Play Song</a></p>

where do i need to insert the links??? an would a link like "http://www.soundclick.com/bands/songInfo.cfm?bandID=362617&songID=2558331" work? Thank You Again

_Aerospace_Eng_
12-01-2005, 05:24 AM
Keep reading that thread, there is an updated version of the script.

I'm That Dude
12-01-2005, 07:07 AM
well i read most of that thread and used all of the scripts that seem to fit my need, but none worked. Thank you for trying to help though.

Will

_Aerospace_Eng_
12-01-2005, 07:11 AM
Post a link to a song you want to use. Make sure the song is on your own site and you do have the permission to play it.

I'm That Dude
12-01-2005, 07:17 AM
http://www.soundclick.com/pro/view/02/default.cfm?bandID=342941&content=song&songID=3139600

^theres the link, and yes i do have permission to play it.

Im heading to bed for tonight I have been at this for 3 hours straight. I will check back in the morning. Again, thank you very much

_Aerospace_Eng_
12-01-2005, 07:21 AM
<object width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="http://www.soundclick.com/util/downloadSong.cfm?ID=3139600">
<param name="uiMode" value="none">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="1" uimode="none" width="300" height="44"
src="http://www.soundclick.com/util/downloadSong.cfm?ID=3139600" autostart="true" loop="true"></embed>
</object>

I'm That Dude
12-01-2005, 05:29 PM
THANK YOU!!! thats perfect, now how would i adjust that to have a playlist on it as well. So that there is more then one song. thank you SO much though for helping.

Gambit2537
12-01-2005, 06:16 PM
I'm trying to put background music into a site a designed, but seem to have trouble getting it to work with Firefox and IE. In playing around with it, I found that FF likes the <object> tag, where IE likes the <bgsound> tag. Is there a way around this in using a css so that it is W3C compliant?

_Aerospace_Eng_
12-01-2005, 08:05 PM
Umm, css isn't html, it doesn't do what you are trying to do. I referred I'm That Dude to a thread that has a lot of information on what you are trying to do. I suggest you read it as well.

_Aerospace_Eng_
12-01-2005, 08:10 PM
THANK YOU!!! thats perfect, now how would i adjust that to have a playlist on it as well. So that there is more then one song. thank you SO much though for helping.
You didn't say that earlier. In the future be clearer in what it is that you want, it saves us both time.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
text-align:center;
}
</style>
<script type="text/javascript">
function PlayIt(what){
player.document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="44" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
</script>
</head>

<body>
<select name="player" onchange="PlayIt(this.value)">
<option value="none">::Choose a Song::</option>
<option value="http://urltosong1.mp3">Song 1</option>
<option value="http://urltosong2.mp3">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
</select><br>
<div id="music">
<object width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="300" height="44"
src="" autostart="true" loop="true">
</object>
</div>
</html>
The places in bold is what you change to match the location of your song.

I'm That Dude
12-01-2005, 08:57 PM
Sorry about the confusion, and thank you very much for the help. Now i know where to come with any problems, thanks again

Will

I'm That Dude
12-01-2005, 09:08 PM
Wow i feel like im being a pest, but here is the current problem.

With the code above i entered the URL i wished to use, saved it as a .htm file, went to the folder and opened the .htm file. The music player came up with the list of songs, but when i clicked a song no music would be played. Is there a fault in the code? Sorry again if im being a pest, but music player is just something i cant seem to grasp yet. All help is appreaciated again.

Code is used

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
text-align:center;
}
</style>
<script type="text/javascript">
function PlayIt(what){
player.document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="44" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
</script>
</head>

<body>
<select name="player" onchange="PlayIt(this.value)">
<option value="none">::Choose a Song::</option>
<option value="http://www.soundclick.com/pro/view/02/default.cfm?bandID=342941&content=song&songID=3155940.mp3">Song 1</option>
<option value="http://www.soundclick.com/pro/view/02/default.cfm?bandID=342941&content=song&songID=3139600.mp3">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
</select><br>
<div id="music">
<object width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="true" uimode="full" width="300" height="44"
src="" autostart="true" loop="true">
</object>
</div>
</html>

Again, thank you for the help Aerospace

_Aerospace_Eng_
12-01-2005, 11:10 PM
Those aren't valid links to the songs.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<style type="text/css">
body {
text-align:center;
}
</style>
<script type="text/javascript">
function PlayIt(what){
player.document.getElementById('music').innerHTML='<object width="300" height="44" '
+'classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" '
+'codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" '
+'standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">'
+'<param name="url" value="'+what+'">'
+'<param name="uiMode" value="full">'
+'<param name="autoStart" value="true">'
+'<param name="loop" value="true">'
+'<embed type="application/x-mplayer2" '
+'pluginspage="http://microsoft.com/windows/mediaplayer/en/download/" '
+'showcontrols="true" uimode="full" width="300" height="44" '
+'src="'+what+'" autostart="true" loop="true">'
+'</object>';
}
</script>
</head>

<body>
<select name="player" onchange="PlayIt(this.value)">
<option value="none">::Choose a Song::</option>
<option value="http://www.soundclick.com/util/downloadSong.cfm?ID=3155940">Song 1</option>
<option value="http://www.soundclick.com/util/downloadSong.cfm?ID=3139600">Song 2</option>
<option value="http://urltosong3.mp3">Song 3</option>
<option value="http://urltosong4.mp3">Song 4</option>
<option value="http://urltosong5.mp3">Song 5</option>
</select><br>
<div id="music">
<object width="300" height="44"
classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">
<param name="url" value="">
<param name="uiMode" value="full">
<param name="autoStart" value="true">
<param name="loop" value="true">
<embed type="application/x-mplayer2"
pluginspage="http://microsoft.com/windows/mediaplayer/en/download/"
showcontrols="1" uimode="full" width="300" height="44"
src="" autostart="true" loop="true">
</object>
</div>
</html>

I'm That Dude
12-02-2005, 12:30 AM
Aerospace thank you very much. One last thing, if you could give me links on other threads that help with designing/coding HTML/css and PHP sites I would appreciate it, because im looking to read up on those a lot more. Again thank you for all your help.

Will

_Aerospace_Eng_
12-02-2005, 12:37 AM
www.w3schools.com is a good place to start. www.htmldog.com is another good place and www.php.net is a good place for php.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum