Welcome to WebmasterWorld Guest from 54.226.110.143

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Play mp3 from php mysql query

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

New User

5+ Year Member

joined:Mar 19, 2008
posts: 37
votes: 0


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

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

Full Member

10+ Year Member

joined:July 5, 2004
posts:303
votes: 0


In order to ensure that the files are playable by everyone, I would look into some sort of flash solution like flow player.
2:01 pm on May 16, 2008 (gmt 0)

Senior Member from US 

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

joined:Apr 19, 2003
posts: 4397
votes: 2


FlowPlayer seems quite promissing :)
since I am no specialist in that field
I would love to hear from other members that have used it...
4:37 pm on May 16, 2008 (gmt 0)

New User

5+ Year Member

joined:Mar 19, 2008
posts: 37
votes: 0


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)

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

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:Jan 16, 2007
posts:914
votes: 0


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

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

Full Member

10+ Year Member

joined:July 5, 2004
posts:303
votes: 0



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.
8:37 pm on May 16, 2008 (gmt 0)

Full Member

10+ Year Member

joined:Feb 4, 2004
posts: 215
votes: 0


if you can find it, i will recommend the 1pixelout player. It is small, simple and unobtrusive.
9:13 am on May 19, 2008 (gmt 0)

New User

5+ Year Member

joined:Mar 19, 2008
posts: 37
votes: 0


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

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members