Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Web Design & Development
Tag Cloud
access audio black screen blue screen bsod connection crash desktop drivers dvd email error excel excel 2003 firefox google hard drive hardware hdmi hijackthis internet itunes keyboard laptop malware monitor motherboard network networking outlook problem ram recovery router screen slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Java Music Player Code

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

Closed Thread
 
Thread Tools
Mike46's Avatar
Computer Specs
Senior Member with 238 posts.
 
Join Date: Jul 2005
Location: Extraterrestrial Highway
Experience: Intermediate
30-Jul-2008, 07:20 PM #1
Cool Solved: Java Music Player Code
I have found this to work very well on one of my websites, however I do not want it to auto start the music the page. I want to have the user start it.

I have tried to edit the code on this line
Code:
<param NAME="Autostart" VALUE="1">
I have tried changing the value = to false which didn't work, I trying to find what and where in the code to stop the auto start feature. The code below is the same that I am using I just didn't add my titles and URL's. I also was wondering if there is a place in the code to change the color of the player.

----------------------------------------------------------------------------------------------------------------------------------

[code][<!-- Multi Music Player at www.rainbow.arch.scriptmania.com/scripts/music/ -->
<!-- begin code multi music player -->
<object id="multiplayer" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" height="0" standby="Loading Microsoft Windows Media Player components..." width="0" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
<param NAME VALUE>
<param NAME="ShowControls" VALUE="0">
<param NAME="ShowStatusBar" VALUE="0">
<param NAME="ShowDisplay" VALUE="0">
<param NAME="DefaultFrame" VALUE="Slide">
<param NAME="Autostart" VALUE="1">
<param NAME="Loop" VALUE="True">
</object>
<form name="form">
<select name="playlist" size="1">

<!-- Add song info here -->
<option value="0">SONG TITLE-ARTIST NAME</option>
<option value="1">SONG TITLE-ARTIST NAME</option>
<option value="2">SONG TITLE-ARTIST NAME</option>
<option value="3">SONG TITLE-ARTIST NAME</option>
<option value="4">SONG TITLE-ARTIST NAME</option>
<option value="5">SONG TITLE-ARTIST NAME</option>

</select><br>
<input TYPE="BUTTON" NAME="multiplay" VALUE="play" OnClick="play(document.forms['form'].playlist);">
<input TYPE="BUTTON" NAME="multipause" VALUE="pause" OnClick="document.multiplayer.pause(); playstate=2;">
<input TYPE="BUTTON" NAME="multistop" VALUE="stop" OnClick="document.multiplayer.stop(); playstate=2;"></p>
</form>

<script language="JavaScript">
<!--
var playstate = 1;
shuffle = 1; // Set to 0 to always play first song in list
// Set to 1 to randomly choose the first song to play
songs=new Array();

// Add song URLs here
songs[0]="SONG URL";
songs[1]="SONG URL";
songs[2]="SONG URL";
songs[3]="SONG URL";
songs[4]="SONG URL";
songs[5]="SONG URL";

if (shuffle == 1) {
var randsg = Math.floor(Math.random()*songs.length);
document.multiplayer.FileName = songs[randsg];
document.multiplayer.scr = songs[randsg];
document.forms['form'].playlist.options[randsg].selected = true;
}
function play(list) {
if (playstate == 2) {
document.multiplayer.Play();
} else {
var snum = list.options[list.selectedIndex].value
document.multiplayer.FileName = songs[snum];
document.multiplayer.scr = songs[snum];
}
playstate = 1;
}
//-->
</script>
<!-- end code multi music player -->
/CODE]
__________________
"Success is the ability to go from one failure to another"
"With no loss of enthusiasm."
Mike46's Avatar
Computer Specs
Senior Member with 238 posts.
 
Join Date: Jul 2005
Location: Extraterrestrial Highway
Experience: Intermediate
08-Aug-2008, 10:13 PM #2
Cool Different Option
Just for those of you that might be interested setting the player to not auto start with Java Script the following code does not work.

(0) - (-1) - (False)

I am sure that the code is out there and someone with knowledge of Java surely knows it. I have chosen a different route to get done what I needed to do. If anyone wants to give a shot at this code and see if they can figure it out maybe it would help others that might want to use it.
__________________
"Success is the ability to go from one failure to another"
"With no loss of enthusiasm."
Chicon's Avatar
Computer Specs
Distinguished Member with 6,690 posts.
 
Join Date: Jul 2004
Location: 50° 34' 07.13" N - 04° 10' 23.
Experience: Second socks retriever
09-Aug-2008, 04:07 AM #3
Quote:
Originally Posted by Mike46 View Post
...
I am sure that the code is out there and someone with knowledge of Java surely knows it.
....
Hi Mike46,

No, Java is a completely different language than Javascript. Also, your problem was related to the configuration of a Microsoft component embedded in a HTML document. It has nothing in common with Java.
Closed Thread Bookmark and Share

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 03:13 AM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.