Welcome to WebmasterWorld Guest from 54.226.32.234

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Play mp3 from php mysql query

     

j milo taylor

11:26 am on May 16, 2008 (gmt 0)

5+ Year Member



What is the best way to do this?

I have a mysql database, an artist is selected. the artist may have a number of mp3s associated with them. how can these be played in a web browser. can they be loaded into quicktime for example? if there is more than one audio file, how can i auto play the first, then allow users to stop it, and select another?

it would be great if the solution could also be applied to movies, which are associated with artists in the same way

thanks
j milo taylor

supermanjnk

12:45 pm on May 16, 2008 (gmt 0)

10+ Year Member



In order to ensure that the files are playable by everyone, I would look into some sort of flash solution like flow player.

henry0

2:01 pm on May 16, 2008 (gmt 0)

WebmasterWorld Senior Member henry0 is a WebmasterWorld Top Contributor of All Time 10+ Year Member



FlowPlayer seems quite promissing :)
since I am no specialist in that field
I would love to hear from other members that have used it...

j milo taylor

4:37 pm on May 16, 2008 (gmt 0)

5+ Year Member



i really want to try to avoid using any commercial solution, i dont really want their branding all over my project.

i guess the php code is not going to be that complex, and i would like to expand my knowledge (rather than paying for the benefits of someone else's work)

cameraman

6:57 pm on May 16, 2008 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



...ensure...playable by everyone...flash solution

Believe it or not, not everyone embraces that junk. Some people believe that effective, highly functional web sites can actually be designed without forcing their visitors to load that onto their computers. But I digress - I must have been temporarily blinded by some sort of bright yet useless light.

Just embed it. Use a search engine for the html end ('embed music file'). If you're pulling the actual binary data from a db table, the source will be a php script. The script will send a header like audio/mpeg and then the data pulled from the table. If you're just storing the file name in the table, that's a whole lot easier, just echo the file name into the embed element.

supermanjnk

7:29 pm on May 16, 2008 (gmt 0)

10+ Year Member




Believe it or not, not everyone embraces that junk. Some people believe that effective, highly functional web sites can actually be designed without forcing their visitors to load that onto their computers. But I digress - I must have been temporarily blinded by some sort of bright yet useless light.


Yes, approximately 1.2 percent of the internet population (in mature markets) do not use flash.

jezra

8:37 pm on May 16, 2008 (gmt 0)

10+ Year Member



if you can find it, i will recommend the 1pixelout player. It is small, simple and unobtrusive.

j milo taylor

9:13 am on May 19, 2008 (gmt 0)

5+ Year Member



cameraman,

thanks for you advice, it really works a dream. so simple, i've been trying to get this done for onths , your post really made it 'click'.

to address some of the other posts, well, the solution outlined by cameraman is so simple, and so useful, i really don't need to use flash in any way.

thanks again everyone for your comments
milo

 

Featured Threads

Hot Threads This Week

Hot Threads This Month