raji20 Posted January 31, 2007 Share Posted January 31, 2007 How to play a music throughout the website using PHP code .ie I want to play music in all pages of my website but I dont want the song to start from the beginning every time when a link is clicked.The song list will be coming from the database, where admin can able to upload the music file.Can anyone help me.Please Quote Link to comment Share on other sites More sharing options...
redarrow Posted January 31, 2007 Share Posted January 31, 2007 This can only be done with a poup with javascript and the popup will have to be left open and not closed. Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 31, 2007 Share Posted January 31, 2007 Plus, it won't work in Firefox or for those with popup blockers, and the rest of your visitors will likely be annoyed. If someone wants to hear music, they'll have it playing. Let them choose when they want to listen to the music, forcing music to play is considered very rude. Quote Link to comment Share on other sites More sharing options...
chronister Posted January 31, 2007 Share Posted January 31, 2007 I agree with Jesirose..There is nothing more annoying than forgetting the sound is not muted on the pc and go to a page that has some crappy music playing or sounds in the ads and end up blasting it out at 2 am. I feel that sounds in a webpages have their place and that place is very limited. It's a web annoyance in my book.. but thats just me. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted January 31, 2007 Share Posted January 31, 2007 Google xspf mp3 player it's an os flash based mp3 player. Very easy to add to a website (let me know if you need help) and uses the os xspf playlist format. If that's not to your liking there is one called flam and probably a bunch on sourceforge.net. You won't find a php based mp3 player since php is server-side. You instead want a client side player that pulls its mp3's of your server.Now with xspf you will need to generate the playlist from whats stored in your sql db. I'll assume you have track, artist, file link ( I hope your not storing the mp3 in your mysql db). To do this programitcally you will need loop through each row returned and append to xspf file in the proper format.I am not sure what some of the other ones look like. I think some have direct mysql integration, but i'll leverage the os one. Ping me if you need help. I'm working on something very similiar. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted January 31, 2007 Share Posted January 31, 2007 while i agree with everyone here... i'm still intrigued by raji20's proposal. that would be pretty cool to be able to pull off in php. there's gotta be a way, somehow. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted January 31, 2007 Share Posted January 31, 2007 argh, think of the load even a moderately busy site would put on the server IF a php mp3 player were possible, which I don't think it is, but then again i don't know all that much about php. Quote Link to comment Share on other sites More sharing options...
redarrow Posted January 31, 2007 Share Posted January 31, 2007 I thort maybe but only maybe you could be crafty and randomly play varous tunes buy enbededing the player in a template for the header, So each page the user goes to they here diffrent tunes But you will not be able to keep one tune playing constantly with php, Sorry tried meny times and javascript was the best result or this way. Quote Link to comment Share on other sites More sharing options...
neylitalo Posted January 31, 2007 Share Posted January 31, 2007 [quote author=s0c0 link=topic=124830.msg517844#msg517844 date=1170227989]IF a php mp3 player were possible, which I don't think it is, but then again i don't know all that much about php.[/quote]PHP is a server-side scripting language. This means that anything done in PHP happens independent of the browser, and before anything is sent to the client. Once you've sent information to the client, PHP is completely out of the picture - PHP runs, generates output, and passes that information to the browser.Short version: It's not possible. Quote Link to comment Share on other sites More sharing options...
raji20 Posted January 31, 2007 Author Share Posted January 31, 2007 Hi guys, thanks for your help, I got the solution for the issue.here is the link http://www.thesitewizard.com/webdesign/backgroundmusic.shtmlAlso we can use frameset to enable the play continously Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.