Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: detecting a file in use Date: Wed, 06 Nov 2013 18:34:40 +0100 Lines: 36 Message-ID: References: <19q44k7e0oext.1x1a126s3btq$.dlg@40tude.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net YzmcLwLtRdcgFc7H8UIC6AjX+TWdyfvwiT3CADr0upejqZyw2X Cancel-Lock: sha1:TxD81Ax559SpGbLW8MEaY416VJk= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 In-Reply-To: <19q44k7e0oext.1x1a126s3btq$.dlg@40tude.net> Xref: csiph.com comp.lang.php:11741 On 06/11/13 18:12, richard wrote: > What should be used to know when a request has been made for the server to > load an audio file? > As I see it, the server has to know that a request has been made. > > You, the user, using your browser, sees a list of songs that you can play. > You click that link, the browser sends a request to fetch that file. > This is the point in time when I want to know that the request has been > made. three ways to do it Simple: parse the log file Medium: use a wrapper file which notify that someone requested a file and then serve the file, this can destroy fast forward/rewind/pause/resume features. Complicated: Make the JavaScript to call a page and tell which file the user is loading and if they do buffer or not. > Javascript takes care of the playing side. > But still, the server has to have some way of knowing which audio file is > being requested and whether or not buffering is needed. > Now that the audio file has played, the server needs to know that file has > completed downloading. > So what do I use to know this has happened? If you use wrapper and the page terminates, then it's finished with the download. If you use the javascript then make an ajax call and tell that the song has finished to play. -- //Aho