Module: Movie overlay

floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2011-03-22 03:34

New module to add a play button over the thumb of a movie to signify that the thumb is not a photo.

http://codex.gallery2.org/Gallery3:Modules:movie_overlay

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Wed, 2011-10-05 02:40

Thanks for a cool module! I wanted to point out, however, that the top and left settings don't work because the value of '80px' is hard-coded into movie_overlay_theme.php. I was able to fix this by changing the following lines:

top:80px;
left:80px;

to

top:".$top."px;
left:".$left."px;
 
klinion

Joined: 2009-02-26
Posts: 180
Posted: Wed, 2011-10-05 20:59

Works like a dream thanks

www.talkingwalk.com/gallerywalk

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-10-08 05:39

windracer,
Thanks for that. It must have been a Monday or a Friday :-)
I just downloaded this module again and find that some of the icons are not well done.
Anybody care to help out and develop some better ones with proper transparency and not clugeged together?
Just post them here or send them in a PM and I will add them to the module. You will get credit as well on the codex, is that enough incentive?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Sat, 2011-10-08 16:58

I took a shot at cleaning up the ones without transparent backgrounds (2, 3, 4, 5, and 7). I'm by no means a graphic artist, but I think they look a little better. :-)

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Tue, 2011-10-11 01:55

There's also a typo in the module name in the theme.info file. :)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-10-12 02:06

Fixed the typo and added your images.
Cheers!

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Tue, 2012-03-27 14:59

Just a few notes:

1) The top and left 80px's are still hard coded in movie_overlay_theme.php
2) I was looking in to this and haven't tried to mod it yet, but is there a way to say 'center' the icon?

pseudo center code:
top = ($imageheight/2 - $iconheight/2)
left = ($imagewidth/2 - $iconwidth/2)

Think I have the logic close...

Just a thought.

EDIT: Perhaps not quite that simple since it's in the stylesheet...

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-03-27 15:51

I thought I fixed that up. At any rate I will see about fixing it when I get home later today.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-03-27 22:15

Fixed the top and left being 80 issue and moved the zip file to the codex.
the issue with using $imageheight/2 and $imagewidth/2 is that the thumbs for movies can be and often are of differing sizes.
I suppose it could be done giving each overlay a unique ID and then some calculation to get the thumb height and width.
Seems like a lot of work for little benefit.
If there is more call for it I might work on that.
Some HTML5 overlay might be a better option.
I think that displaying the time of the movie would be cool as well.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Wed, 2012-03-28 00:58

That's true with the video dimensions... I use the videothumbnail module to create a thumbnail, so I know that they are a fixed size...

I think timeoverlay would be cool.

+1 here

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-03-28 04:01

I'm no UI expert and certainly not a designer, but here is movie time if you have ffmpeg installed. Not sure what the results are if ffmpeg is not available.
overwrite the file with the one below removing the _.txt extension.

I think the best way to do this is with some JS and replace the image with a <div> or tow that can be styled a bit better in the view.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Wed, 2012-03-28 04:38
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Tue, 2012-04-03 23:24

suprsidr, Yes I did see those and look cool. I have decided to go for a css method to fix a couple of issues I was having and perhaps go the <canvas> route in the future.
I have updated the module on the codex.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Wed, 2012-05-09 02:13

Hi Dave, when I try to deactivate the module, I get this in my logs:

2012-05-08 21:50:53 -04:00 --- error: Kohana_PHP_Exception [ 1 ]: Call to undefined method module::delete() 
/usr/local/src/gallery3-support/modules/movie_overlay/helpers/movie_overlay_installer.php [ 30 ] 
#0 [internal function]: Kohana_PHP_Exception_Core::shutdown_handler(NULL)
#1 /av/gallery3/system/core/Event.php(208): call_user_func_array(Array, Array) 
#2 /av/gallery3/system/core/Kohana.php(549): Event_Core::run('system.shutdown')
#3 [internal function]: Kohana_Core::shutdown() 
#4 {main}

Just judging from other modules, perhaps helpers/movie_overlay_installer.php:deactivate() wants to be uninstall() instead? It's not clear to me if htere's anything that should actually go into a deactive() routine.
Fixing that, I can verify that the module seems to cause some layout problems with the gray dragon theme. Specifically, it shifts movie frames over by about 1/3 (screenshot attached). Any thoughts about what might be going wrong?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-05-09 06:49

Got a url to show the behaviour/behavior?

intaller.php was most likely a typo on my part or some beer consumption. I will fix that.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Wed, 2012-05-09 11:38

Sure, sent PM with a URL. Thanks a ton!

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Wed, 2012-05-09 12:02
cchiappa wrote:
Fixing that, I can verify that the module seems to cause some layout problems with the gray dragon theme. Specifically, it shifts movie frames over by about 1/3 (screenshot attached). Any thoughts about what might be going wrong?

Hmmm ... I'm using GreyDragon 3.2.2 in two different galleries and don't see that shift in the thumbnail.

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Wed, 2012-05-09 12:29
windracer wrote:
Hmmm ... I'm using GreyDragon 3.2.2 in two different galleries and don't see that shift in the thumbnail.

Interesting...I haven't customized GD all that much although I do have a couple of CSS tweaks and a fair number of modules. Wonder if there's a bad interaction with something.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-05-10 04:03

cchiappa, Remove:
margin: auto;
from helpers/movie_overlay_theme.php as a temporary measure.
Seems that the GD theme overrides the core theme_view code.
Perhaps Serge can look at his override and make some adjustments for the thumb_bottom function placement.

windracer, can you PM the URL to one so I can see the source?
It could be some other module or thumb size that has some other interaction that is causing this issue.
Are you using version 2?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Thu, 2012-05-10 11:51

It looks like I'm still using v1 of the Movie Overlay module. As for other modules, I am using Square Thumbnails in both galleries, so that could be a factor. I've PM'ed you a link to a page that has a few videos on it.

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2012-05-11 01:04

Thanks, that does fix the problem. The overlay is still not quite right, since it looks like the positioning is relative to the frame rather than the thumb nail, but I can hack that up pretty easily.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-05-11 02:52

Yah its that the theme adds the frame between the the thumb_top and thumb_bottom calls. I think it should call those functions before and after the thumbnail image. I have not instigated closely, perhaps you and Serge can come up with some consensus.

you could use V1 of the module but with different aspect ratios it does not work right.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Rockbär
Rockbär's picture

Joined: 2012-04-22
Posts: 76
Posted: Sat, 2012-05-12 14:01

That module doesn't work on my website. I do also use the watermark-plugin - could this be a problem? If I include a youtube-clip the "old" movieoverlay-button appears instead the new one I've chosen in the admin-settings.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2012-05-13 02:28

I have created a ticket:
https://sourceforge.net/apps/trac/gallery/ticket/1861
then it should be a lot easier for this to be cross theme compatible.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Serge D
Serge D's picture

Joined: 2009-06-11
Posts: 2466
Posted: Sun, 2012-05-13 05:21

Thank you Dave
It would be great approach

Serge
_____________________________________________
Photo Gallery | GreyDragon Theme | Follow on Twitter

 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Tue, 2012-05-22 11:09

I've installed the module, but now I want to uninstall it, and when I unpick it form the modules list the update button wont work.
No error related in the log.

How can I uninstall the module?

Thanks.

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
windracer

Joined: 2007-03-05
Posts: 113
Posted: Tue, 2012-05-22 12:03

After inactivating the module you can just delete its folder under the modules sub-directory in your G3 install.

 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Tue, 2012-05-22 13:51

Problem is that when I unpick (inactivate) the module the update button don't work, so it doesn't save that change, keeping the module activated.

I manage to inactivate the module by changing the status to 0 in the database, but that's not a practical solution for disabling a module.

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Tue, 2012-05-22 13:55

inchains - you need the fix I posted in http://gallery.menalto.com/node/101387#comment-391309 , ie you need to rename deactivate in helpers/movie_overlay_installer.php to uninstall.

 
inchains

Joined: 2012-04-19
Posts: 18
Posted: Tue, 2012-05-22 14:14

Thank you!

________________________________
API:
- Gallery 3.0.3
Server:
- Apache 2.2.22
- PHP 5.2.17
- MySQL 5.1.61-community-log
- OS linux x86_64

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Fri, 2012-07-13 17:16

Hi,
Is there a version 3? The one I uploaded shows version 2. Thanks

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-07-13 23:30

Try again, I uploaded a new version.
I did some minor fixes to work better with the GD theme and some position of the movie duration if you have ffmpeg installed.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Stan T

Joined: 2011-04-27
Posts: 52
Posted: Sat, 2012-07-14 10:29

Thank you.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-08-10 16:14

Updated the codex with a new version. Fixed some css with GreyDragon theme. Only load the css if the page is a album.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2013-05-20 21:43
mzibo, in a private message wrote:
hi,
the Movie Overlay discussion thread seems to be locked, so I'll try contacting you this way.
Can you give me any hints on making the movie overlay work for the image block in the sidebar?
thanks,
jamaa

edit the image block view file to look like:

<?php defined("SYSPATH") or die("No direct script access.") ?>
<? foreach ($items as $item): ?>
<div class="g-image-block">
<? if ($item->type == "movie") { ?>
<?= $theme->thumb_top($item) ?>
<? } ?>
  <a href="<?= url::site("image_block/random/" . $item->id); ?>">
   <?= $item->thumb_img(array("class" => "g-thumbnail")) ?>
  </a>
<? if ($item->type == "movie") { ?>
<?= $theme->thumb_bottom($item) ?>
<? } ?> 
</div>
<? endforeach ?>

Not tested much

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
mzibo

Joined: 2008-03-30
Posts: 12
Posted: Tue, 2013-05-21 18:59

thanks, works like a charm!

in order for the overlay to be positioned properly, I had to also change the following in movie_overlay_theme.php:

static function head($theme, $child) {
	if ($theme->page_type == "collection") {
	$trans = module::get_var("movie_overlay", "trans");
	return "\t<style type=\"text/css\"> 
	.g-movie-thumb {
	  position:relative;
	  margin: auto;
	}
	.g-movie-thumb .g-movie-time {
	  position:absolute;
	  -moz-border-radius: 5px;
	  border-radius: 5px;
	  background-color: #000000;
	  background-color:rgb(0,0,0);
	  background-color:rgba(0,0,0,0.6);
	  filter: alpha(opacity=60);
	  color: #fff;
	  height: 1.5em;
	  font-weight:bold;
	  text-align:right;
	  margin-right: 4px;
	  margin-bottom: 3px;
	  padding: 3px 3px 0px 5px;
	  right:0px;
	}
	.g-movie-thumb .g-description {
	  margin-top: -6px!important;
	  margin-left: -5px!important;
	}
	.g-movie-thumb .g-context-menu {
	  margin-top: -6px!important;
	  margin-left: -5px!important;
	}
	</style>";
 	}
  }
 
cchiappa
cchiappa's picture

Joined: 2008-08-11
Posts: 101
Posted: Fri, 2013-11-08 17:02

The module always invokes ffmpeg on movies even if the time isn't going to be displayed. This can slow things down noticably. Trivial fix:

{~,} 
--- helpers/movie_overlay_theme.php~	2012-08-10 10:02:52.000000000 -0400
+++ helpers/movie_overlay_theme.php	2013-11-08 12:00:21.183362516 -0500
@@ -85,7 +85,8 @@
 	  $view->images_url = 	url::file("modules/movie_overlay/images");
 	  $view->icon = 		module::get_var("movie_overlay", "icon");
 	  $view->trans = 		module::get_var("movie_overlay", "trans");
-	  $view->movie_time = 	number_format(movie_overlay_theme_Core::get_movie_time($child), 2);
+         if (module::get_var("movie_overlay", "time"))
+          	  $view->movie_time = 	number_format(movie_overlay_theme_Core::get_movie_time($child), 2);
 	  return $view;
 	}
   }