PHP and serving streaming media

From: Date: Wed, 15 Aug 2001 05:49:20 +0000
Subject: PHP and serving streaming media
Groups: php.general 
Request: Send a blank email to php-general+get-62772@lists.php.net to get a copy of this message
Hi, I'm working on a website for my quartet, The Chiara String Quartet. One of our primary goals is to present audio clips, and we have many of them. Because of our diverse audience, we need to stream many file formats of identical clips. I'm trying to do this through php-mysql, recording information common to each clip in a database, and then streaming the files through a central PHP file using the header function to output "Content-type: audio/x-ms-wax" or "Content-type: audio/x-pn-realaudio" This works fine in netscape, but IE 5 does not work. Investigating further, I found a basic difference between the way Apache streams straight .wax and .ram files vs. the php filtered one. Find below: Here's the headers from a straight .ram file: HTTP/1.1 200 OK Date: Wed, 15 Aug 2001 05:39:59 GMT Server: Apache/1.3.17 (Unix) mod_bwlimited/0.8 PHP/4.0.4pl1 mod_log_bytes/0.2 mod_frontpage/3.0.4.3 mod_ssl/2.8.0 OpenSSL/0.9.5a Last-Modified: Wed, 31 Jan 2001 18:41:50 GMT ETag: "29b3d8-28-3a785c6e" Accept-Ranges: bytes Content-Length: 40 Connection: close Content-Type: audio/x-pn-realaudio http://chiaraquartet.net/real/b133_2s.rm The contents of the file are the hypertext link. Now, here's the php version of the headers: HTTP/1.1 200 OK Date: Wed, 15 Aug 2001 05:41:11 GMT Server: Apache/1.3.17 (Unix) mod_bwlimited/0.8 PHP/4.0.4pl1 mod_log_bytes/0.2 mod_frontpage/3.0.4.3 mod_ssl/2.8.0 OpenSSL/0.9.5a X-Powered-By: PHP/4.0.4pl1 Set-Cookie: PHPSESSID=a90d719b158c9275ba42b86571df2149; path=/ Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Connection: close Transfer-Encoding: chunked Content-Type: audio/x-pn-realaudio 36 http://music.chiaraquartet.net/bartok4/g2/bartok4_1.rm 0 As you can see, the contents are encased by the length of the file and an ending 0, like a normal html file. You can also see the extra headers PHP adds in. How do I get rid of the 36 and the 0? Thanks. As my first career is the cellist of the quartet, I don't have the time to check, so I would appreciate a direct response to the email address greg at chiaraquartet dot net, replacing at with @ and dot with . Greg Beaver -- The Chiara String Quartet http://www.chiaraquartet.net The most advanced PHP/MySQL-based quartet scheduling system in the world, at http://calendar.chiaraquartet.net

« previous php.general (#62772) next »