Video does not work on ipad with gallery

Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Tue, 2013-07-09 09:29

Hej,

I have a problem to look videos at ipad/iphone with gallery. On windows with firefox all is fine but with ipad the video does not start. I get only a error picture.
But if i used the direct link, for example from the upload folder, all is fine on ipad. Only with using gallery they dont show the videos.

Anybody any idea? :)

Regards

Sebastian

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-07-09 15:41

http://www.langleycom.com/gallery3/index.php/Movies-/Preview
Works on mine.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Tue, 2013-07-09 18:24

Hej thanks for the hint. I have checked now many things. First idea was frame rate. In Europe normal 25fps, but apple, you never know what they do. :) So ecoding with 29,97fps, same error.

To show that, i have added a public album, added both vids, look, and it works.

http://www.familiealbert.com
Username: tester
Password: tester

The public folder works on my ipad, but the hidden folder you only see after login, dont work on the ipad.

I just dont understand why. But i need it. :) We want to make an online album from our wedding with fotos and videos. But not for everyone on the world. :)

Regards

Sebastian

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Tue, 2013-07-09 19:13

I found another topic with exactly the same problem but without a solution. :(

http://galleryproject.org/node/107119

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-07-09 19:28

I see now and can reproduce.
Might be a flowplayer thing. Will have to play around a bit.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Tue, 2013-07-09 19:33

Ok i'm not to stupid to configure that. :)

Thank you very much.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2013-07-09 22:33

Works fine with Safari on windows.
Does not work with ipad and the JWplayer module that replaces the flowplayer player.
Could be some ipad thing.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Tue, 2013-07-09 23:47

iDevices need BYTE RANGE support. http://galleryproject.org/node/105336

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-07-10 03:34

suprsidr,
thanks for looking into this but here is the issue; guest viewable items work fine on the ipad and other OS/browser combos:
http://www.langleycom.com/gallery3/index.php/Movies-

Now, login using U: fred P: fredfred
Now you will see another album that had permissions set with the same videos.
This protected albums videos work with other OS/browser combos but not the ipad.
I'm no server/firewall expert but I think that the headers sent with the video might be different than those items not in a protected album. Just a guess though.

Ideas?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Wed, 2013-07-10 06:45

Hej

Is it possible to set an alternative direkt link? Not download. While if i used the direkt link the video works.

BR

Sebastian

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-07-10 15:05

Yes we could detect ipad using JS or php, using userAgent.
But before we go down that road does it work on iphone? It is does or does not then it changes the JS/PHP userAgent detection code.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Wed, 2013-07-10 15:12

Yes, its the same at me with iphone 4 and ipad 2.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2013-07-10 15:48

I don't have my ipad with me now to test so here is something to get you started:
<?= html::anchor($item->file_url(true), t("Click here to download item.")); ?>
will give you a link to the item on the filesystem.

This I can't test but you can try:

<? $isiPad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');
  if ($isipad) { ?>
this will show to ipad users
<? } ?>

These code snipits can be added to the themes movie.html.php file in the view folder.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Thu, 2013-07-11 05:58

Hej,

i'm not sure where to add the code. I'm not really expert in php things. :)

The code from movie.html.php is like follow:

Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?>
<div id="item-overlay" style="display:block">
<div class="toolbar" id="item-toolbar-top">
<a class="backbutton" href="<?= ORM::factory("item", $theme->item()->parent_id)->url() ?>"><?= ORM::factory("item", $theme->item()->parent_id)->title ?></a>
</div>
</div>

<video controls="controls" poster="<?= $item->thumb_url() ?>" src="<?= $item->file_url() ?>"></video>

I think directly in front of all in first line?

I think, there was to much stress yesterday. I have rechecked my idea with direkt link. It also only works on non hidden folders. Forget the idea. :)

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Thu, 2013-07-11 08:16

I think i have a quick solution for me. Have deleted the htaccess file in Video folder, and now it works. Without login you dont see the folder, and nobody will know the direct link to that folder and the exact filename.

But i dont know if he only added the htaccess while i create the album, or every time i make any changes in it. I will see it. Not the best solution but it works. So it seems its something with htaccess. :)

 
shadlaws

Joined: 2012-03-14
Posts: 183
Posted: Thu, 2013-07-11 16:56

Hey guys,

Coincidentally, I *just* tracked down the same problem for Gallery 3.1... good news: this is 100% solved for Gallery 3.1!

@suprsidr - you're right, it's byte-range support. Unfortunately, Apple's browsers *demand* its support, even if responses without "Accept-Ranges" headers or 206 statuses are received (which kinda violates HTTP standards, but oh well).

@floridave - the public links work because they don't use Gallery's file_proxy controller. They're served directly by the server's file system, which supports the "Range" header. Private links are served via Gallery 3.0.x's file_proxy controller, which ignores the "Range" header completely.

@sebsa - the reason it works with htaccess removed is because you've removed Gallery's file_proxy from the loop, making all of the files in there public. Anyone with the link can navigate there without access restrictions.

BTW, the same info applies to videos via Gallery's REST - Gallery 3.0.x doesn't support byte-range requests, but Gallery 3.1 does. And FWIW, Kohana 3 made it pretty painless to implement :-)

Take care,
Shad

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2013-07-11 17:04

shad, thanks for the excellent write up on this! Good to know it's 'fixed' in 3.1. Appreciate it!

 
Sebsa

Joined: 2013-07-09
Posts: 10
Posted: Thu, 2013-07-11 17:27

Great news. Thx a lot. Last question: When is release date? :D

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Fri, 2014-03-28 23:29

shadlaws: Are you sure it's fixed in 3.1? I've been looking at the code changes for master in github, and can see how mediaelement.js has been implemented (good choice!) I went to as far as port the code changes for this particular feature into my vanilla G3 3.0.9 installation. I now have html5 mediaelements.js video being served from my secure albums, and works great on all computer based browsers, but it doesn't want to work on iPhone/iPad.

I believe the problem still exists due to the file_proxy as when I remove the .htaccess file, the problem goes away. But for the life of me (and I spent a few hours now) I can't find the file_proxy or related fixes to get streaming on iOS to work correctly so I can merge those changes into my installation.

Are you sure 3.1 is fixed? Can you point me to the right direction? What file / date or defect was the fix dropped under?

 
leonki

Joined: 2010-12-18
Posts: 32
Posted: Mon, 2014-03-31 00:40

No reply.. or no one is using G3 with iOS. :(

I was trying to figure out the failure, and I narrowed it down, but I'm at a dead end (using tcpdump & wireshark while walking the code).

For some reason, iOS sends 2 GET /gallary3/var/.../myvideo.mp4?m=12345678 type requests, one after another. In both cases, G3 fails in file_proxy.php in the following location:

// Make sure we have access to the item
if (!access::can("view", $item)) {
$e = new Kohana_404_Exception();
$e->test_fail_code = 4;
throw $e;
}

The failure occurs in access.php under user_can. For some reason, it falls right through and returns false. Anyone got G3 with video working on iOS?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2014-04-01 04:27

http://www.langleycom.com/gallery3/index.php/Example-video
Works for me on the ipad. Apple does not allow autoplay. So you have to click the center play triangle and then the play triangle in the lower left. Not sure why.

Permissions is a different issue. When iOS device make a request for a video, they don't download the whole video. They download only small chunk at a time, to minimize bandwidth usage, and also because the user may want to skip to a later portion of the video without downloading the previous parts.
G3s file_proxy controller needs to have byte-range support added.

if your willing to get your hands dirty this might help:
http://forums.phpfreaks.com/topic/229190-php-video-proxy-for-mobile/

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team