BYTE_RANGE_ERROR_MESSAGE while streaming video via PHP
I'm trying to (pseudo-/HTTP-)stream a video on the iPad and I'm getting this short message from the Safari browser on my iPad: "Quicktime: BYTE RANGE_ERRORMESSAGE".
This is the situation: I made a HTML5 page with an "video"-Tag in it to load/stream a Quicktime/mp4 video file:
<video width="720" height="576" controls autoplay>
<source src="video.mov" type="video/mp4" />
</video>
This works fine on my iPad. The problem is now: I can't write the videos source path directly in the HTML-tag because it should be hidden. So I write:
<video width="720" height="576" controls autoplay>
<source src="stream_video.php?videoID=4" type="video/mp4" />
</video>
The PHP file looks like this:
<?php
// send headers (not all necessary for iPad, some for other devices/browsers
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Pragma: no-cache"); // IE
header("Cache-Control: no-cache"); // IE
header("Connection: Keep-Alive");
header("Content-Type: video/mpeg");
header("Content-Disposition: attachment; filename=video.mov;");
header("Content-Description: File Transfer");
header("Accept-Ranges: bytes");
header("Content-Length: ".filesize($sourceFile));
// output file
readfile($sourceFile);
exit();
?>
Now this PHP-script works fine for all browsers on computers but not, if the webpage with the embedded video should be shown on an iPad. The iPad Safari shows the broken video icon and the debug console says "Quicktime: BYTE RANGE_ERRORMESSAGE". That's all, no video.
Does anybody know a solution for this problem? I haven't found any description for this error message!? Are the headers I'm sending allright for the iPad?
TIA and best regards, Joe
iPad, iPad OS: 3.22