Jump to content

listen to a song..


corillo181

Recommended Posts

i know that part i mean the content that has to be sent as the heade in order to make the page read as a mp3 and not a normal text/html

i'm now too good with header content

but i know is something  like

 

header('content-type: mp3');

and then i do the query which is what you posted..

 

 

Link to comment
Share on other sites

that dont work only prompts to download the song.

If you set the headers like that and output the contents of the file, the browser is going to prompt you to do something based on the header. If it's an HTML file, the browser will open the file itself. But if it detects an mp3 file, it's going to prompt you to download it just as if you tried to browse to

www.somesite.com/asong.mp3

 

Link to comment
Share on other sites

You should also remember the script will time out if it can't send the entire mp3 in 30 seconds (or whatever timeout you have set).  Use set_time_limit() to override this.  If you want to get fruity, look into accepting byte ranges in your headers, and how to interpret them and send their response-counterparts, which will allow MP3 players to seek/rewind/fast-forward in your streaming mp3s.  It's not as tricky as it sounds, and is very useful.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.