Re: PHP and serving streaming media

From: Date: Thu, 16 Aug 2001 04:40:10 +0000
Subject: Re: PHP and serving streaming media
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-62959@lists.php.net to get a copy of this message
Good news: I found a solution. Microsoft was choking on the session headers. I designed a toolkit to interface with MySQL transparently that relies on sessions to keep things accurate from page to page as information is changed in a database. I added a variable called (oddly enough) $no_session, that if set prevents session_start or session_register from being accessed. I also needed to add headers for Content-Length, and Accept-Range: bytes As an example, the code I use for g2 is: $a = "http://music.chiaraquartet.net/".$this->parent->root->table->fieldsbyname[r ootname]->value."/g2/".$this->cliproot().".rm"; header("Accept-Range: bytes"); header("Content-Length: ".strlen($a)); header("Content-Type: audio/x-pn-realaudio"); print $a; $a is set to the location of the realmedia file. Yay! Greg "Richard Lynch" <ceo@l-i-e.com> wrote in message news:00a401c12603$0bd8cec0$6401a8c0@Lynchux100... > > I'm working on a website for my quartet, The Chiara String Quartet. > > You wouldn't happen to be Chicago-based, would you?... :-) > > > 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: > > For the link within the actual HTML, instead of using links like: > > http://chiaraquartet.net/streaming.php?fileid=42 > > Try using links like this: > > http://chiaraquartet.net/streaming.php/bartok4_1.ram?fileid=42 > > While that extra bartok4_1.ram looks real goofy to us humans, IE thinks > that's the name and type of file it is downloading, regardless of the > Content-type: header it *OUGHT* to be looking at because Microsoft sucks. > > > 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? > > You'd have to show us the source code that generates this output... The > headers is internal PHP stuff, but you can over-ride by sending your own. > > The 36 and 0 are almost certainly *YOUR* PHP script being not quite right... > >

« previous php.general (#62959) next »