Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Web Design & Development Web Design & Development
Search Search
Search for:
Tech Support Guy > > >

Solved: Java Music Player Code


(!)

Mike46's Avatar
Mike46 Mike46 is offline Mike46 has a Profile Picture
Computer Specs
Member with 231 posts.
THREAD STARTER
 
Join Date: Jul 2005
Location: Extraterrestrial Highway
Experience: Intermediate
30-Jul-2008, 06: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]
Mike46's Avatar
Mike46 Mike46 is offline Mike46 has a Profile Picture
Computer Specs
Member with 231 posts.
THREAD STARTER
 
Join Date: Jul 2005
Location: Extraterrestrial Highway
Experience: Intermediate
08-Aug-2008, 09: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.
Chicon's Avatar
Chicon Chicon is offline   Chicon has a birthday soon!
Computer Specs
Member with 6,650 posts.
 
Join Date: Jul 2004
Location: 50 34' 07.13" N - 04 10' 23.
Experience: Second socks retriever
09-Aug-2008, 03: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.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
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.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑

Content Relevant URLs by vBSEO 3.3.2