Flash video does not work due to UrlGenerator API call behavior

kjholla

Joined: 2009-03-31
Posts: 44
Posted: Thu, 2009-12-31 00:18

Hello,

I am trying to modify the flashvideo module to suit my needs.

However, I see that the same code seems to have differing behavior in two of my Gallery2 INstallations.

Both gallery2 installations use version 2.3

I have the same code running on both:

$urlGenerator =& $gallery->getUrlGenerator();
$src = $urlGenerator->generateUrl(
	array('view' => 'core.DownloadItem', 'itemId' => $entity->getId(),
         'serialNumber' => $entity->getSerialNumber()),
	array('forceFullUrl' => true, 'forceSessionId' => false, 'htmlEntities' => false));

In one installation, the URL generated is as below:

http://mydifferentdomain.com/gallery2/download/21833-1/mymovie.flv?g2_GALLERYSID=8abfa929f29b710b5890fd95ef49daf5

This works for my purpose.

However, in another, it shows:

http://mydomain.com/gallery2/main.php?g2_view=core.DownloadItem&g2_itemId=20630&g2_serialNumber=5

This doesn't work with the flash player I am using.

Can anyone help me understand what setting or configuration is causing this difference in behavior of the UrlGenerator API? How can I control this so that I get a URL I know will work for my setup on both installations?

Regards,
KH

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Thu, 2009-12-31 00:36
Quote:
Can anyone help me understand what setting or configuration is causing this difference in behavior of the UrlGenerator API?

Different urlrewrite rules in the urlrewrite module - the first has the rule for dowload urls enabled, the second doesn't.

 
kjholla

Joined: 2009-03-31
Posts: 44
Posted: Thu, 2009-12-31 00:55

It works!! Fantastic!

This really makes me feel stupid to see that it was such a simple solution. Thanks a lot alecmyers.

Regards,
KH