Pink Poogle Toy Forum

The official community of Pink Poogle Toy
Main Site
NeoDex
It is currently Sun Dec 01, 2024 5:31 am

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Question About Adding Music to a Page
PostPosted: Sat Jun 12, 2004 8:29 pm 
Honorary Member
Honorary Member
User avatar

Posts: 886
Joined: Mon May 31, 2004 7:03 am
Location: Los Angeles, CA
Hi, just a quick little question, and I'd appreciate any help.

Currently, I'm working on customizing my LiveJournal. I know that there are codes to add music to a page in HTML or CSS or whatever, and I know that you can make one song play infinitely. However, I was wondering if it was possible to play a few songs in a loop, something like this:

Song 1
Song 2
Song 3
Song 4
Song 1 again
etc.

Is there any codes to do this, and if so will you let me know what they are? Thanks! :D


Image


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 12, 2004 9:02 pm 
Administrator
Administrator
User avatar

Posts: 1140
Joined: Mon May 31, 2004 1:36 pm
Try using a media player control with a playlist.

I don't think you can do this with bgsound.


Image
Will you stop with the honour stuff?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 12, 2004 11:10 pm 
Honorary Member
Honorary Member

Posts: 169
Joined: Sat Jun 05, 2004 6:30 pm
Location: Milwaukee, Wisconsin
hmm good one, i knwo theres a way to do it try looking into some javascript, a couple tips:

maybe somehting like document.bgsound="thesound";

whihc might set the sound but dont count on it becaus eim only guessing

what iw ould do is make a function that recurse after a song is done, you might have to se tthe length of a song, ill look more into it for ya


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 13, 2004 2:30 pm 
Administrator
Administrator
User avatar

Posts: 1140
Joined: Mon May 31, 2004 1:36 pm
That's another way to do it. If you setTimeout(handlerfunction, songlength*1000), you'll know when to set the next one.

Assuming document.bgsound is valid, you would use:
Code:
<script>
var songs = Array("sound1.mid","sound2.mid","sound3.mid"); //Filenames
var slength = Array(67,23,43); //Duration in seconds
var song_id = 0; //Start ID

nextSong();

function nextSong() {
 document.bgsound = songs[song_id];
 setTimeout ("nextSong();",slength[song_id]*1000);
 song_id++;
 if (song_id > songs.length) song_id = 0;
}
</script>


Image
Will you stop with the honour stuff?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group