homepage Welcome to WebmasterWorld Guest from 54.166.65.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Play mp3 from php mysql query
j milo taylor




msg:3651741
 11:26 am on May 16, 2008 (gmt 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

 

supermanjnk




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

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

henry0




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

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




msg:3651953
 4:37 pm on May 16, 2008 (gmt 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)

cameraman




msg:3652073
 6:57 pm on May 16, 2008 (gmt 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.

supermanjnk




msg:3652091
 7:29 pm on May 16, 2008 (gmt 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.

jezra




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

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

j milo taylor




msg:3653474
 9:13 am on May 19, 2008 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved