So I'd like my gallery to work on the iPhone. So far pictures work great, but video, not so good.
The problem is the code doesn't handle byte-ranges. Since the new G3 looks to be more simple, I'm guessing it won't handle video, so I'd like to modify my gallery to do it, but I'm stuck, because the iphone uses byte-ranges for mp3 and videos.
I know what to do in general. I need change the basic gallery.class around lines 870 based on if $_SERVER['HTTP_RANGE']. If its set the code needs to look at the range requested, and send some additional headers and output the file.
I have the code based on a few sites I've found that can read a file and deliver in via byte-ranges, but now I need to figure out how to add it to my gallery.
Do I add a new class base on gallery? Make edits to gallery.class?
And how would I find out if the gallery has been requested to send a range. I can't read $_SERVER within the gallery class.
Posts: 54
I think I've done it, at least it works.
I changed gallery.class starting around line 862 by adding a test for $_SERVER['HTTP_RANGE']
if there isn't a range, its the current code, if there is then its basicly the same headers with Range headers and a different while loop.
Not sure if this is the right way or not, and with G3 not that it matters.
Posts: 62
This would be really cool if i could get it to work with my iphone. I inserted the above code and then went to my video on my iphone and the video does not appear. Does this still work for you on G2 2.3?
Posts: 54
I'm using Gallery 2.3, but I'll grab a fresh build and re try the code.
You do need a file that is compatible with the iphone. I export my mp4 from Quicktime. I also rename the file m4v.
I'll re-test and put up my steps.
Posts: 54
Steps I did,
Installed G2.3,
Configured ffmpeg plugin.
Activate ffmpeg plugin.
Added m4v to video/mp4 mime type.
Added Video from local server (the file was too big to upload via web page.)
Edited Movie, Added Height and Width (480X272)
Changed /gallery2/modules/core/classes/Gallery.class
lines 862 - 878 with the code above.
Be sure you have a movie that works on the iPhone. I did Quicktime Export "Movie to iPhone" for my site.
Posts: 8
I went through exactly the same steps, but without success. All I get is a non-playable QT image.
Has anyone else succeded with this method.
I tried with both: Gallery 2.3 and 2.3.1
Thanks
Posts: 6
Some changes have to be made to the code from Arnoldjw to make videos work for the IPhone...
This code works fine with Gallery 2.3.1 and the IPhone OS 3.1
The following 3 lines have to be changed...
I don´t know whether this is totally correct and conform to standards, but the apache throws no errors and the videostreaming works fine on the phone and any browser.
I also don´t think that
is necessary or even correct, as my Apache adds this header on its own with the correct value.
$contentLength should be - at least in the else branch - wrong. The value should be $end-$begin+1.
Regards
Posts: 1153
which iPhone client do you use to upload photos? preferably batch uploading - that's the only feature I am interested anyway. Please advise, thank you!
___________________________________________________
http://pixi.me/
Posts: 8339
Comments are now permitted for this topic.
I've created a true module for this topic.
http://www.flashyourweb.com/filemgmt/index.php?id=51
Posts: 8339
Comments are now locked for this topic.