External Editor
Yamb
Web iPhoto Access
 123 members
Connected :
(nobody)
2073897 visitors
22 visitors online
|
- Forum
- Web iPhoto Access
Topic # 256 |
iPod Touch / iPhone Video Streaming |
25/05/2009 @ 13:48
by Damien

visitor
|
Hi, I found your software quite impressive and very useful to access photos from my iPod Touch in high quality instead of the reduced quality we have on the device when using the built-in software.
And when using the software I could not watch videos I had in my iPhoto library and that were already in a format suitable for iPod. So I did some reseearch and foundthat you had to stream the video a particular way for it to be avilable on the iPod/iPhone.
So I've worked a little and update the function getVideo of the util.php so that it works as well for iPod. There it is:
Code : php
function sendVideo($path, $cacheTime) {
$path = getMacAliasOriginal($path, $error);
if ( ! isset($path)) {
die($error);
}
if ( ! file_exists($path)) {
die("Sorry, Can't find file '$path' (or is it a higher directory permission issue?)");
}
if ( ! is_readable($path)) {
die("Sorry, file '$path' is not readable (permission issue)");
}
session_write_close();
$mimetype = videoMimetype($path);
header("Content-Type: $mimetype");
if ( ! httpConditional(filemtime($path), $cacheTime, 0, false, false, false)) {
$filesize = filesize($path);
header("Content-Length: $filesize");
if ( isset($_SERVER['HTTP_RANGE']) ) {
$partialContent = true;
list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
$range = explode('-', $range);
$offset = $range[0];
$end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $filesize;
header("Accept-Ranges: $offset-$filesize");
header('HTTP/1.1 206 Partial Content');
header("Content-Range: bytes $offset-$end/$filesize");
} else {
$partialContent = false;
$offset = 0;
header('Accept-Ranges: bytes');
}
$file = fopen($path, 'rb');
fseek($file, $offset, 0);
while(!feof($file))
{
print fread($file, 4096);
}
fclose($file);
}
exit;
} |
|
|
Answer n° 1
--------
01/06/2009 @ 18:00
by Globs

Administrator
|
Well,
thanks for this.
I'll integrate it in the next version. |
|
|
 topic active  topic closed  Sticky  New message -  Correct message  Close topic  Make sticky
|