Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
song length (php/javascript)

 
Post new topic   Reply to topic Printable version
 View previous topic  Gamestation. Post :: Post probblem with c++  View next topic  
Author Message
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Sun Nov 12, 2006 2:19 pm    Post subject: song length (php/javascript) Reply to topic Reply with quote

Does anyone know how to detect how long a song will last or when a song is done playing in javascript or php.

I have this thing that plays a random song, I made it by naming songs 1.mp3, 2.mp3 ect and just generating a random number.

What I need it to do now is after it plays that one song, refresh the window so it plays a new song. That's why I need to know either how to calculate the song length or actually see when it is done playing.


EDIT: Nevermind, I figured out a different way.
Since I had if statements to show which song was playing I just added how long the song lasted in seconds then made the page refresh for that time period.

Code: Show/Hide

if ($random == 1){
echo('<br />Current Song: DJ Baby Anne - 2001');
echo('<meta http-equiv="refresh" content="206;url=music.php">');
}


One down, 63 songs to go.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Mon Nov 13, 2006 12:07 pm    Post subject: Reply to topic Reply with quote

Why not generate a playlist file, serve it as a content attachment and have whatever media player the user has installed play it.
_________________
ss news
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:40
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3614
Location: Las Vegas
Offline

PostPosted: Mon Nov 13, 2006 12:18 pm    Post subject: Reply to topic Reply with quote

I'd look into a bunch of the different AJAX toolkits. Lots of different features there, such as the ability to push new music or to just stream chunks of music, where the chunks just come progressively from one mp3 file and then change to another when that is done.

I think I've seen this in a flash version too, but I doubt that would be as simple to learn.
Back to top
View users profile Send private message Add User to Ignore List Send email
BD@MomWork
Guest


Offline

PostPosted: Mon Nov 13, 2006 4:52 pm    Post subject: Reply to topic Reply with quote

I made a new song link, it refreshes the page since each some is randomly played each time music.php is visited. It basically just streams each song and then once it is done it plays another one.

http://ss-halo.net/haloalias click ' Random Song' .

You can check out the other stuff there, its our alias bot. I made it so I could alias anyone or check out who banned who and why from any computer without having to download continuum. It's just a logicbot, mysql server, and some fun.

Let me know if you find any security holes or make any suggestions.
Back to top
Cyan~Fire
I'll count you!
I'll count you!


Age:36
Gender:Gender:Male
Joined: Jul 14 2003
Posts: 4608
Location: A Dream
Offline

PostPosted: Mon Nov 13, 2006 6:29 pm    Post subject: Reply to topic Reply with quote

I think smong had the best idea.
_________________
This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Mon Nov 13, 2006 7:01 pm    Post subject: Reply to topic Reply with quote

I had issues with that. In IE it uses windows media, but in firefox it uses quick time. I could get the playlist to play in IE but not Firefox. I'm doing this so that every browser (besides opera since it plays the same song over and over) can listen. Can the playlist be set to be shuffled? I like them to just be random.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
Maverick
broken record


Age:39
Gender:Gender:Male
Joined: Feb 26 2005
Posts: 1521
Location: The Netherlands
Offline

PostPosted: Tue Nov 14, 2006 3:09 am    Post subject: Reply to topic Reply with quote

That firefox uses quicktime is caused by your own settings, bd.
_________________
Nickname: Maverick (I changed my name!)
TWCore developer | Subspace statistics
Back to top
View users profile Send private message Add User to Ignore List Visit posters website
BDwinsAlt
Agurus's Posse


Age:33
Gender:Gender:Male
Joined: Jun 16 2003
Posts: 1145
Location: Alabama
Offline

PostPosted: Tue Nov 14, 2006 7:43 am    Post subject: Reply to topic Reply with quote

Ok, they are default settings. Am I the only one who will have those setts? No. I said I was trying to make it work for everyone. icon_eek.gif

It works fine for Firefox and IE users. So I'm not worried about the other people.
Back to top
View users profile Send private message Add User to Ignore List Send email Visit posters website AIM Address Yahoo Messenger MSN Messenger
D1st0rt
Miss Directed Wannabe


Age:36
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Fri Nov 17, 2006 1:41 am    Post subject: Reply to topic Reply with quote

Is song length stored in the ID3 tags?
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 639 page(s) served in previous 5 minutes.

phpBB Created this page in 0.553401 seconds : 34 queries executed (77.2%): GZIP compression disabled