Pseudo-streaming mp4 fils to iPad

I need to serve mp4 files to iPads through a PHP script for authentication reasons. I am using the rangeDownload function found here. The script is embedded like this:

<video width="640" height="480" controls="true">
	<source src="download.php?id=123" type="video/mp4" />
</video>

It works, kinda… the issues I’m having are:

  1. Consistency: sometimes I get a black box with a play button, and sometimes the video starts to load automatically.
  2. Buffer issues: If the video catches up to the buffer, it stops the download, or just continues on without playing or downloading the video. It looks like when this happens, it repeatedly requests the next byte range, but doesn’t wait for it, it just asks for the next range over and over.
  3. ‘Server configuration’ errors: Sometimes I just get a dialog box saying the server isn’t configured properly.

(PHP on IIS 6, BTW, but I get issues 1&2 on my Apache/Mac install too)

Does anyone have experience with this or have other ideas how to address these issues? I am posting this to an Apple/iPad forum too, but thought someone here might know something. Thanks.

Okay, one thing I’m noticing is if I capture the byte range being requested when trying to load the video element, my local apache server shows 1 request of: bytes=0-1. When I run the same test script on my IIS server, I get 4 requests for the same loading of the video element:

bytes=0-1
bytes=0-5500828
bytes=1448-8191
bytes=8192-5500828

The first 0-1 is the checking if the file supports byte-request, but I don’t know why it’s requesting the whole file, then a part, then another part, when I haven’t clicked on the play button yet…

Can anyone offer how to serve video files to an iPad by any means. They just have to be password protected.