Results 1 to 4 of 4

Thread: Help with Mp3 player pls

  1. #1
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help with Mp3 player pls

    I need some help if posible I got this Flash Mp3 player code down below I already got all the songs on it and all but I would like it to play random songs when the page is refreshed or visted could some body help pls.



    <DIV ALIGN="CENTER"><embed allowScriptAccess="never" allowNetworking="internal" enableJSURL="false" src="http://www.kissthat.com/img/flash/player.swf" menu="false" quality="high" width="257" height="300" name="index" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="playList=http://www.kissthat.com/uploads/playlist/2006-11-16/1XpwIYdRI2.xml&ShowPlaylist=1&ShowEQ=1&firstTrack=1&initVol=100" wmode="transparent" /></embed><BR><CENTER><A HREF="http://www.kissthat.com/flashmp3player"></CENTER></DIV>

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    A working demo of the player would have been nice, but figured it out... http://www.kissthat.com/img/flash/pl...=1&initVol=100
    I assume you are just using the third party player and created the playlist.

    The player isn't something you can just change or manipulate through the embed tags.

    I suppose you could possibly create multiple playlists and use that.

    Use PHP to generate a random playlist.

    Code:
    <?xml version="1.0" encoding="UTF-8"?><songs><song path="http://www.filefreak.com/pfiles/408/Movie%20Quotes%20-%20Scarface%20%20-%20Make%20The%20Money%2C%20Get%20The%20Power%2C%20Ge.mp3" title="Scarface quote" /><song path="http://www.filefreak.com/pfiles/408/Three%20Six%20Mafia%20-%2010%20-%20The%20Most%20Known%20Unknowns%20-%20Half%20On%20A%20Sack.mp3" title="Half on a sack" /><song path="http://www.filefreak.com/pfiles/408/Chris%20Brown%20-%20Say%20Goodbye.mp3" title="Say Goodbye" /><song path="http://www.filefreak.com/pfiles/408/Hinder%20-%20Lips%20Of%20An%20Anglel.mp3" title="Lips of an Anglel" /><song path="http://www.filefreak.com/pfiles/408/Dancin%20on%20a%20pole%20Three%20Six.mp3" title="Dancin on a pole" /><song path="http://www.filefreak.com/pfiles/408/Ludacris%20%26%20Pharrell%20-%20Money%20Maker.mp3" title="Money Maker" /><song path="http://www.filefreak.com/pfiles/408/Eminem%20feat.%20Akon%20-%20Smack%20that.mp3" title="Smack that" /><song path="http://www.filefreak.com/pfiles/408/Akon_ft._Snoop_Dogg_-_I_Wanna_****_You.mp3" title="I wanna **** you" /><song path="http://www.filefreak.com/pfiles/408/Jay%20Hickman%20-%20Boat%20Ride%281%29.mp3" title="Boat Ride" /><song path="http://www.filefreak.com/pfiles/408/LilJon%20ft%20Eastside%20Boyz%2C%20Paster%20Troy%20-%20Throw%20It%20Up.mp3" title="Throw it up" /><song path="http://www.filefreak.com/pfiles/408/Akon%20-%20Lonely%20.mp3" title="Lonely" /><song path="http://www.filefreak.com/pfiles/408/Monica%20-%20Everytime%20the%20Beat%20Drops%20ft.%20Dem%20Franchise%20Boyz.mp3" title="Everytime the beat drops" /><song path="http://www.filefreak.com/pfiles/408/three6mafiakwpp-side2side-dty.mp3" title="Side 2 Side" /><song path="http://www.filefreak.com/pfiles/408/Numb%281%29.mp3" title="Numb" /><song path="http://www.filefreak.com/pfiles/408/2pac%20%2B%20Phil%20Collins%20-%20In%20The%20Air%20Of%20Tonight%20%28Maniac%20Bone%20Rmx.mp3" title="In the air tonight" /><song path="http://www.filefreak.com/pfiles/408/Tank___I_m_The_Reason.mp3" title="Im the Reason" /><song path="http://www.filefreak.com/pfiles/408/Mr.%20Mack%20-%20Self%20Made%20-%20Where%20You%20From%20%28865%29%20Remix%20%28Feat.%20Yo%20Gotti%20And%20D.%20Cooley%29.mp3" title="865 (Remix)" /><song path="http://www.filefreak.com/pfiles/408/Where%20Is%20the%20Love%20%20%28BEP%20Justin%20Mix%29.mp3" title="Where is the love" /><song path="http://www.filefreak.com/pfiles/408/Three%206%20Mafia%20-%2001%20-%20The%20Most%20Known%20Unknowns%20-%20Most%20Known%20Unkown%20Hits.mp3" title="Most known unkown hits" /><song path="http://www.filefreak.com/pfiles/408/Nickle%20Back%20-%20Far%20Away.mp3" title="Far away" /></songs>
    That is your xml playlist as linked to by the flash player.

    All you need to do is dynamically use PHP to output a random playlist.

    Note that you will need PHP installed on your server for this to work. If not, ASP might as well, but I'd recommend PHP.

    1. create a new file, call it "playlist.php" and replace in the embed tag above the playList=... with the new (full) url for this page.

    2. In that page, store the songs in an array. Then randomize them, then output that list as xml like above.

    Here's the PHP code for that--

    PHP Code:
    <?php
    //setup random playlist

    //Do not edit next line:
    echo '<?xml version="1.0" encoding="UTF-8"?><songs>';

    //Insert songs for playlist here:
    $songs = array (
       
    => array('http://www.filefreak.com/pfiles/408/Movie%20Quotes%20-%20Scarface%20%20-%20Make%20The%20Money%2C%20Get%20The%20Power%2C%20Ge.mp3''Scarface quote'),
       
    => array('http://www.filefreak.com/pfiles/408/Three%20Six%20Mafia%20-%2010%20-%20The%20Most%20Known%20Unknowns%20-%20Half%20On%20A%20Sack.mp3''Half on a sack')
    // N => array('URL', 'TITLE'),
    //Repeat for each.
    //Add one to the number for the key (1, 2, N...)
    //Input the URL and TITLE for each
    //Note that there MUST be a comma after each new entry
    //EXCEPT the last one
    );

    //Do not edit below
    shuffle($songs);
    foreach (
    $songs as $song) {
       echo 
    '<song path="'.$song[1].'" title="'.$song[2].'" />';
    }
    echo 
    '</songs>';
    ?>

    That should do it.

    The above code is untested, but I'm confident it should work.

    Ask if you have questions.
    Daniel - Freelance Web Design | <?php?> | <html>| espaņol | Deutsch | italiano | portuguęs | catalā | un peu de franįais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Nov 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default thanx

    Thanx for the quick response I'll try this out but sry I did'nt give an example I could have just game my site www.myspace.com/lilg420 its on the left but you said u done figured it out so its cool, thanx again

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Ah, ok.

    Well, myspace is a problem.

    It should work fine, but you will need another server for the playlist.php file that can handle PHP. Myspace certainly will not.
    Daniel - Freelance Web Design | <?php?> | <html>| espaņol | Deutsch | italiano | portuguęs | catalā | un peu de franįais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •