Thunderbird Extensions
Apple - mac
Donation
Make a donation to help WiPhA development

Search




Preferences

Connect again
---

Your user name :

Your secret code


 Count of members 123 members


Connected :

(nobody)
Visits

 2073897 visitors

 22 visitors online

Private
forum.gifForum - Web iPhoto Access - Topic #256

Forum - Forum
Web iPhoto Access - Web iPhoto Access


active  Topic # 256  iPod Touch / iPhone Video Streaming

25/05/2009 @ 13:48
by Damien

Anonymous

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;
}
  Post an answer  Top
Answer n° 1
--------
01/06/2009 @ 18:00
by Globs

Globs

Administrator

Well,
thanks for this.
I'll integrate it in the next version.
Write to Globs   Website Globs Post an answer  Top
Answer n° 2
--------
22/10/2013 @ 23:06
by chriscozi

Anonymous

visitor
Is this broken again? My ipad doesn't show videos.
TIA
  Post an answer  Top
active topic active   closed topic closed   Sticky Sticky   New New message   -   Correct Correct message   Close Close topic   Make sticky Make sticky
[]
Forum Topic  Forum 



^ Top ^