Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-05-2002, 10:06 AM   PM User | #1
adrian.vincent
New to the CF scene

 
Join Date: Jun 2002
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
adrian.vincent is an unknown quantity at this point
Question random music script?

im looking for a script where, when u enter the page a random song from my server will play, the songs are in WMA format.

is there a script for this?

thanks in advance.
adrian.vincent is offline   Reply With Quote
Old 07-05-2002, 08:57 PM   PM User | #2
Cloudski
Regular Coder

 
Join Date: Jul 2002
Location: U.S. (Wish Japan though)
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Cloudski is an unknown quantity at this point
First of all, are you sure WMA files can be used a backgroud sound? If so, make sure you arn users that the format for music may not be supported by them. Not EVERYONE can use WMA.. I do have a script that will load a random song.

This will possible suport WMV, I am not sure.. I never used it...

Code:
<script language="javascript">
// use this script freely
// var numsongs stands for the number of songs given
var numsongs = 5 //replace with any number you want
day = new Date()
seed = day.getTime()
ran = parseInt(((seed - (parseInt(seed/1000,10) * 1000))/10)/100*numsongs
+ 1,10)
 
if (ran == (5))
{
song =("insert file src here")
words =("input song title here")
}
else if (ran == (4))
{
song =("insert file src here")
words =("input song title here")
}
else if (ran == (3))
{
song =("insert file src here")
words =("input song title here")
}
else if (ran == (2))
{
song =("insert file src here")
words =("input song title here")
}
else if (ran == (1))
{
song =("insert file src here")
words =("input song title here")
}

document.write('<EMBED SRC= "' + song + '" CONTROLS=smallconsole HEIGHT=45 WIDTH=290 AUTOSTART=TRUE LOOP=TRUE VOLUME=35%>')
document.write('<br>You are listening to ' + words + ' ')
</SCRIPT>
I hope that helps... Oh and be sure that numsongs is not higher than the total songs available

Cloudski is offline   Reply With Quote
Old 07-08-2002, 03:19 AM   PM User | #3
Cloudski
Regular Coder

 
Join Date: Jul 2002
Location: U.S. (Wish Japan though)
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Cloudski is an unknown quantity at this point
Well, did it work??? Does anyone else have something that will work in this situation??? Sheesh.. I give a reply and it stops the whole subject
Cloudski is offline   Reply With Quote
Old 07-11-2002, 10:10 AM   PM User | #4
adrian.vincent
New to the CF scene

 
Join Date: Jun 2002
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
adrian.vincent is an unknown quantity at this point
Unhappy sorry sorry

i havent been able to check up on my email but i did try out our script offline and it did work i am just in the remodeling of my site part... thnx a lot by the way and sorry bout the late reply
adrian.vincent is offline   Reply With Quote
Old 07-11-2002, 11:07 AM   PM User | #5
Cloudski
Regular Coder

 
Join Date: Jul 2002
Location: U.S. (Wish Japan though)
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Cloudski is an unknown quantity at this point
No problem
Cloudski is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:24 AM.


Advertisement
Log in to turn off these ads.