You are here: Re: fpassthru and mp3 player « PHP Programming Language « IT news, forums, messages
Re: fpassthru and mp3 player

Posted by Andy Hassall on 10/22/13 11:26

On Mon, 12 Sep 2005 11:05:39 +0200, alex bazan <me@privacy.net> wrote:

>I've got musicplayer http://musicplayer.sourceforge.net/ pointing to a
>php file which dumps with fpassthru and appropiate headers an mp3 file.
>
>If i point the mp3 directly i have no problems, but with the php script
>songs stop playing when after a while (always at the same length)...

How is the player reading the file?

If it is streaming it, i.e. only reading just about as fast as it's playing
give or take a buffer size, it'll exceed PHP's maximum execution time, and PHP
will drop the connection.
>
>I've tried removing headers but then the file does not play at all. With
>other players i've experience the same cut at the same length. If i
>don't use the player (ie, dumping the file directly to the browser), i
>can hear all the song without problems.
>
>It seems as if the player only gets ok the first X bytes that got
>transfered.

This is probably exactly so; the browser downloads the file then plays it,
whereas the other player streams it gradually and so keeps PHP running all the
time.

>I want to have the files out of the apache root path, that's why i use
>the php script to dump the files.

You would probably be better off using an Alias in Apache.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация