Music

Rad

...
Reaction score
228
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...
 

mase

____ ___ ____ __
Reaction score
154
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.
 
P

Persen

Guest
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:^^
 

mase

____ ___ ____ __
Reaction score
154
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.
 

Rad

...
Reaction score
228
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
 

phyrex1an

Staff Member and irregular helper
Reaction score
446
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 :/
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.
 

Rad

...
Reaction score
228
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.

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
 

mase

____ ___ ____ __
Reaction score
154
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.
 

Rad

...
Reaction score
228
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.

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!
 

mase

____ ___ ____ __
Reaction score
154
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.
 

Rad

...
Reaction score
228
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
 
P

Persen

Guest
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.
 

Rad

...
Reaction score
228
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.

Yeah I dont need to upload them they are all in htdocs/files/music
 

mase

____ ___ ____ __
Reaction score
154
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:
 
P

Persen

Guest
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
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
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.
 

mase

____ ___ ____ __
Reaction score
154
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.
 
P

Persen

Guest
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.
ye ofc^^

All you need is something that chooses the song from PHP and sends it to the .swf with loadvars, not hard to do.
Wouldn't you have to preload all the songs then?
 

mase

____ ___ ____ __
Reaction score
154
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 ><
 

DDRtists

ɹoʇɐɹǝpoɯ ɹǝdns
Reaction score
415
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.

Wrong again. :)
Flash, when using LoadSound, does.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top