Results 1 to 7 of 7

Thread: random music

  1. #1
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool random music

    i have my website so i can play music, one song. im trying to get it so it will play a different song everytime the page is loaded, or a set list of songs. however i would like the order to change everytime i refresh the page... i have not been able to accomplish this at all. if anyone can help, it would be greatly appreciated.

    p.s. im using a javascript snippet that i found for this music, but i posted this here because there was other music stuff in the html post section. if you would like to move it, please do, i just didnt know where to post.

    Code:
    <script language="JavaScript"><!--
    var soundFile = "http://webzoom.freewebs.com/ethix7664/jeremys****/music/Trogdor.mp3";if (soundFile.indexOf(",") > 0) {var sounds = soundFile.split(",");soundFile = sounds[Math.floor(Math.random()*sounds.length)];}if(navigator.plugins.length>0){
    if (navigator.mimeTypes["audio/mp3"] && navigator.mimeTypes["audio/mp3"].enabledPlugin) document.write('<embed src="'+soundFile+'" autostart="true" loop="1" controls="SmallConsole" width=145 height=15></embed>');}
    else {
    document.write('<embed src="'+soundFile+'" autostart="true" loop="1" width=70 height=25></embed>');}
    
    //-->
    </script>
    <noscript><embed src="http://webzoom.freewebs.com/ethix7664/jeremys****/music/Trogdor.mp3" autostart="true" loop="1"></embed></noscript>
    <noembed><bgsound src="http://webzoom.freewebs.com/ethix7664/jeremys****/music/Trogdor.mp3" loop=1></noembed>
    Thats what i have... that works fine. i would just like to add a few more songs to it, so i can play them randomly on refresh.
    Last edited by M3GGs; 09-12-2004 at 05:35 PM.

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I might be wrong, but I think replacing the .mid files should work for wave format:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Javascripts resource by Hypergurl!! http://www.hypergurl.com -->
    <!-- hide script. Begin
    nummidi = 3
    day = new Date()
    z = day.getTime()
    y = (z - (parseInt(z/1000,10) * 1000))/10
    x = parseInt(y/100*nummidi,10) + 1
    if (x == (1))
    midi=("mid1.mid")
    if (x == (2))
    midi=("mid2.mid")
    if (x == (3))
    midi=("mid3.mid")
    document.write('<EMBED SRC= ' + midi + ' autostart=true loop=true ')
    document.write('volume=100 align="center" width=50 height=15 controls=smallconsole>')
    // End -->
    </SCRIPT>
    Care of hypergurl javascripts

    Hope this helps
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    Sep 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thx cr3ative, i found a solution already, similar to yours, somewhat. haha, feel free to check it out, i modified the coding of most of it though, pretty sweet. at least i thought so. got it so it plays 3 random songs per day. a different band each day. i enjoyed coding that one... fun stuff.

  4. #4
    Join Date
    Nov 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Dj-jo

    how does it work???? email me at ojn_bike246@hotmail.com

  5. #5
    Join Date
    Mar 2005
    Location
    Shenandoah Valley, Virginia
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Embedded Music freezes new Compaq XP's

    Hi, I have a website Back 2 The 50s with Elvis http://www.elvis-tcb.com/

    Recently I have had to remove the Dynamic Drive script for embed and no embed that I have used with no problems for 2 years.

    I received emails from viewers that had new Compaq XP's that the embedded music locked up their computer and they had to shut down. Temporarily I have replaced with <BGSOUND src=SONG loop=infinite> but it is so slow starting the song.

    Is there a script that would allow <embed> music but detect if the computer was Compaq XP and switch them to <bgsound>
    Thanks for any help,
    John

  6. #6
    Join Date
    Jun 2007
    Location
    Be Ca
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Willing to help

    Hi,

    Did you get the random list solved? I'll help if you still haven't. Let me know.

    Peace,

    of music...

  7. #7
    Join Date
    Oct 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default music

    Can someone tell me how to play ONE song in the background continuously throughout each web page?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •