Music

Discussion in 'General Webmaster Support' started by Rad, May 5, 2007.

  1. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    I figured out how to turn my own computer into a site, and want to make a music player for some songs.

    I was wondering if there was a way to list my songs (I dont care about the effort in writing in the code for each song) so that when you click on them, rather than downloading them (which im sure is illegal :rolleyes: ) to play them in an embed? Or even more prefferably if theres a flash object out there capable of this?

    Or would it be illegal to do this as well?

    Im not looking for one of those fancy media players like at Project Playlist, something more point-and-click that I could fit to my theme for the entire site (My site uses Iframes for different pages, so I could have it play the music on the parent page and you click on the child page [Music.htm] which plays the song on the parent page [Index.htm])

    I would also like to do this with videos in another section... hm

    [EDIT] On a side note, is there a way to check (during a redirect) if a site is offline, and if it is to redirect to a different site? In this case it would be a site that either said "Website is currently not available" or something...
     
  2. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    I don't think there is a way to check if a site is offline.

    As for the players, it can be done in PHP/Javascript for sure and if it is possible in flash I could take a try at it.
     
  3. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    Easily done^^

    First, you need a web server on your computer. (I recommend Apache2)
    You better get PHP too, or else you'll have to update everything manually as you know.

    Then you need a simple script, which searches a dierctory and arrays all the files (prolly a filter for just mp3s or whatever). Create some kind of player, either with CSS and listboxes or just the selects... Hide an embed, change src and stuff with JS and there's your player:D

    I'd gladly help you with the code, but I guess DDR will be faster :banghead:^^
     
  4. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    You could also make it a database so you can record the music info too and display it on ur site. You would need MySQL also.
    And you (I) could make an upload page so you don't have to do all of the adding manually.
     
  5. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Well yeah I just dont really know where to go when you say "PHP/Javascript/MySQL"

    I got HTML and CSS down for the most part though

    I was thinking like, my music page on my site has a bunch of songs (But dont download them cuz they arent for downloading! :rolleyes: )

    I was thinking, sort of like how the sound-on-click would work with buttons (I abandoned that idea thanks to duwenbasden -_-), except you click the link which would start it in a media player. I just dont know how it would work

    Help would be appreciated mase

    And I was already using apache ;)

    And if for some reason you see an old version of the site (i dont know if anyone has been to it) add a slash to the end of the URL and it will reload it all... It doesnt like to update automatically :/

    And one other thing, are the buttons to hard to read?? lol
     
  6. phyrex1an

    phyrex1an Staff Member and irregular helper Staff Member

    Ratings:
    +446 / 0 / -0
    Because it's cached, if you want to turn off the cache add this inside your head tag.
    HTML:
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="expires" content="0">
    
    Pretty self explanatory I hope.
    Usually caching is a pretty good thing for static content, makes your page fast.
     
  7. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    that makes sense and seems to work... but its still cache'd, so you have to clear your cache (with an extra slash at the end of URL) to make it load the page with the cache data in the head! lol
     
  8. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Ok, well I can do it in Flash, but PHP would be a lot better, cleaner, and easier.
    What do you want it done in?

    -Edit-

    And as for the cache, you can hold Ctrl and Refresh and it will reload everything.
     
  9. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Well, I dont like flash very much but I dont understand PHP

    Well I dont understand PHP either

    Your choice lol as long as it works ill be happy :)

    Not saying ill be mad if it doesnt...

    anyway

    ctrl + refresh is nice!
     
  10. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    I'll make one in PHP, so that way I can be easy for you to upload/play songs from your site.
    Give me a few days and I should have it done.

    Also, you should get XAMPP or WAMP for your server.
     
  11. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Alright ill look into XAMPP first

    im at a friends LAN party right now so I wont have it working and my site will be down until I get home tomorrow
     
  12. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    Don't get any premade compilation please!
    Install PHP manually:p

    And mase, you said upload script? Why not just use a standard folder on the harddrive? (Can be anywhere on the host machine, even outside the htdocs or w/e) Just search it and list the songs.
     
  13. Rad

    Rad ...

    Ratings:
    +228 / 0 / -0
    Yeah I dont need to upload them they are all in htdocs/files/music
     
  14. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    I could do that, but I would like to use a database so I can store the description of a song, its src, and hits (possibly). Also, I might use flash to actually play the sounds and PHP to list them.

    -Edit-

    But if Rad doesn't have MySQL then I would have to go that route :eek:
     
  15. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    I dunno flash, so I won't state in that question. I just know that a html/js player isn't hard to make, and you can make a pretty good design with some css magic :p
    I've always been forced to make workarounds, so I can do most things in js and css :D
     
  16. DDRtists

    DDRtists ɹoʇɐɹǝpoɯ ɹǝdns Staff Member

    Ratings:
    +413 / 0 / -0
    You guys are aware that no matter how you embed the music ( From MySQL/File/Ect ), it downloads it to their Temp folder. They will always be able to get the files, if they really want it.

    The way embed works is clientside, the server sends the music file to the computer, and the computer puts in a Player ( WMP, most times ) to play it.
     
  17. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Flash won't do that ><

    All you need is something that chooses the song from PHP and sends it to the .swf with loadvars, not hard to do.
     
  18. Persen

    Persen Guest

    Ratings:
    +0 / 0 / -0
    ye ofc^^

    Wouldn't you have to preload all the songs then?
     
  19. mase

    mase ____ ___ ____ __

    Ratings:
    +155 / 0 / -0
    Not really, loadSound() is a good thing about flash, was messing with it yesterday.
    All I have to do is send the src through php and use loadSound on that src and it loads it and plays it. I can even create a loading/progress bar for the sound when its loading ><
     
  20. DDRtists

    DDRtists ɹoʇɐɹǝpoɯ ɹǝdns Staff Member

    Ratings:
    +413 / 0 / -0
    Wrong again. :)
    Flash, when using LoadSound, does.
     

Share This Page