Help for Module-Develpoment: Choose Videothumb
mr.xy
Joined: 2011-09-20
Posts: 67 |
Posted: Tue, 2011-11-29 22:20 | |||
I missed a module, where one can choose the video-thumb manually. In G2 there was such a thing. So far it works (see attachment), but when recalling the form after submit, it shows an urlencoded string instead of the form: %3Cdiv%20style%3D%22width%3A%20600px%3B%20height%3A%20300px%3B%22%20class%3D%22g-videothumb-dialog%22%3E%0A%0A%3Cform%20action%3D%22/gallery3/index.php/videothumb/dialog/5234%22%20method%3D%22post%22%20id%3D%22videothumb_form%22%3E%0A%20%20%20%20Sekunde%3Cinput%20type%3D%22text%22%20name%3D%22second%22%20size%3D%223%22/%3E%0A%20%20%20%20%3Cinput%20type%3D%22submit%22%20value%3D%22OK%22%20id%3D%22videothumb_submit%22%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20value%3D%22/srv/www/htdocs/gallery3/var/albums/Testgalerie/Videovorbereitung/Maepo_V1.flv%22%20name%3D%22file_path%22%3E%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20value%3D%22/srv/www/htdocs/gallery3/var/thumbs/Testgalerie/Videovorbereitung/Maepo_V1.jpg%22%20name%3D%22thumb_path%22%3E%20%20%0A%20%20%20%20%3Cinput%20type%3D%22hidden%22%20value%3D%221%22%20name%3D%22sent%22%3E%20%20%20%20%20%20%20%0A%3C/form%3E%0A%0A%3Cimg%20src%3D%22/gallery3/var/thumbs/Testgalerie/Videovorbereitung/Maepo_V1.jpg%3Fm%3D1322604814%22%20alt%3D%22%22%20width%3D%22200%22%3E%0A%20%0A%3C/div%3E%0A Not php urldecode nor javascript unescape could change this. Hope someone can help me out here
|
||||
Posts: 8339
I'm having no such problem.
Are you using firebug or similar to view the response?
Besides a bit of dialog polishing and a refresh after the response this looks great.
Good job.
Maybe add an additional option to upload a custom thumb for those without ffmpeg.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
Nice, and works, but I'm getting the same response as mr.xy.
I agree it needs polishing and german->english conversion, but well done and a very nice start.
Thanks!
Posts: 8339
I thought maybe the html purifier module would cause your issue, but I cannot reproduce the issue.
But I'm still on 3.0.1
here is my cleaned up videothumb_dialog.html.php
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
nice work suprsidr, however, gibberish still occurring after thumb selection.
3.0.2
Posts: 8339
I'll upgrade to 3.0.2
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
Confirmed, can reproduce on 3.0.2
BTW, the G3 I updated was vanilla 3.0.0 and the module performed as well as on 3.0.1
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
try this:
/controllers/videothumb.php line~24
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
Well done! Works a charm now.
Posts: 814
Only thing I see that would 'clean' it up a bit is:
- to remove it from the top menu selection (only show on context menu)
- don't show option if not a video
Other than those two nitpicking ideas, awesome.
Posts: 8339
helpers/videothumb_event.php
I left movie_menu as is except translation and removed it completely from site_menu
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
What more can I say... perfect module!
I was doing this by hand, and it was a pain in the @&&.
Many thanks to you folks.
Posts: 8339
oops, edit site_menu to:
Not sure where movie_menu appears
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
updated the above site_menu function to actually work this time ;)
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
Yep, cool, I caught that one earlier Forgot to mention it.
Posts: 67
Ahhmm this is stunning. What happend in this thread while I was away coding?
Now one can choose which version to prefer ;-)
I added the possibility to define thumb-dimensions. They are set on the basis of defined width in theme and assumes 4:3 aspect ratio. Also I included a field for minute.
Have a look. May be we can combine our work.
Posts: 27300
Keep up the great work!
What I would like to see is two things:
1. On the modal window I think it would be nice to see the total time of the video.
2. I think the modal window needs 3 buttons. Commit, Preview, Cancel. The preview would function as the commit does now and the Commit would save the thumb and close the dialog.
Just enhancements and usability that popped into my head at first glance.
I will help with some docs unless somebody else would like to contribute
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 67
@floridave:
I had the same two points on my whishlist. Total-time is now added. (see attachement)
Point 2:
Since it immediately changes the thumb "Preview" is mistakeble. I thought of a "Ready" button, but every Submitbutton in the proper style leads to a Cancelbutton beside it. If someone can help me out with this javascript-thing ... to have a single "Ready"-Submitbutton.
Next question would be where to place the "Ready"? The right place would be between the "Send" an "Cancel". But that could be difficult since they come automatically together.
Posts: 8339
If you looked at my dialog update, I have the only necessary buttons: "Ok" and "Done" along w/ some css to fix form element layout.
The "Done" button forces a refresh of the page to update the new thumb.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
@mr.xy
Dealing with video duration in total seconds would probably be more fitting as some video formats set duration in total seconds not min:sec.
Not one of my videos showed a duration of more than 0:0 with your query. Here is my solution:
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
So, have all the corrections/modifications/etc (suprsidr's changes - excluding last one above) rolled in to the last zip posted?
This is becoming a very nice module indeed.
Posts: 67
Thanks suprsidr for your duration-function. Had to change it a bit, cause it didnt work in my environment. Could you please test whether it still works with your videos. Can't test ist, cause mine all deliver hour:minute:second.
I added the "Done" button and it does makes better usability, I think.
On Thing remains: Translation in Dialog. Does this work. I didn't succeed
Posts: 67
Little Bug fixed.
Sitemenu entry made search-site chrash, cause there is no $item.
Posts: 8339
here is my working copy.
I have not adopted 4:3 thumbs as I believe that is a step backwards. Videos are predominately captured in widescreen formats these days and I'm not going to force 4:3 on my users.
As stated above I'm only dealing w/ seconds for the time.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
I fixed that yesterday http://gallery.menalto.com/node/104422#comment-384650
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 27300
Great collaboration guys. Keep up the great work.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 814
should put a check for if user is admin before displaying option in menus...
Posts: 27300
Actually it should not be just for admins but if the user can edit the item:
access::can("edit", $item)
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8339
Thanks Dave, updated my above archive.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
I added a "working.gif" so you don't wonder what's going on while the thumb is being produced.
And now the thumb is being produced the same dimensions as the original thumb so if your theme is making odd size thumbs, this will keep the aspect - which should solve mr.xy's concerns.
And now vastly faster thumb creation.
Again updated my above archive.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
suprsidr: You forgot the can edit item check in the site menu.
Nice changes!
Posts: 8339
fixed!
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 814
sweet
Posts: 67
@suprsidr: Still can't say "Good bye" to my minutes and seconds, because players show it that way, when I look through the video for a good thumb.
Thats why I post another separate version that combines yours (suprsidr's) and my work.
We still have 4:3 videos beside 16:9. Thats why I added an option to choose ratio or freely custom the thumb measures.
The module is tested with admin, registered user and guest.
It shows total video-length (min:sec) and offers the possibility to enter time in min:sec.
Thanks suprsidr's small but very effective ffmpeg-call-modification thumb-generation is much more quick and a working.gif is shown in the short time to spend waiting because of that quick thumb-generation
Posts: 8339
The reason I had the working.gif set once as display:none was to preload the gif for instant display when it was needed.
This can also be achieved in css as say a background-image for a non-display element or something.
If your videos are 4:3 the thumbs will be also, no need to specify.
yes, moving the "seek" to before the input is much faster
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 67
working.gif and display:none = Cool! Nice little trick - thanks.
We are using module "Rectangle Thumbnails" with defined 4:3 ratio to standardize the look of the photo- and video- gallery-overviews. Videothumbs at 16:9 are therefore croped and thumbs unfortunately don't tell the original ratio.
I've build in detection of whether the "rectangle thumbs" module is active. If so: thumbs are croped to desired ratio and a info is displayed:
"Module "RectangleThumbs" active - Thumbs may be croped to defined aspect ratio."
This seemed to be usefull to me. We may be not the only G3 using uniformation of thumbs.
Beside this I've integrated a detection of the aspect-ratio of the video, to take this information from the uploaded stuff.
Posts: 8339
Again, my version keeps the dimensions of the existing thumb. If the RectangleThumbs modules is active doesn't gallery respect this when the original thumb is created?
If so, then your thumb dimensions are already set and will be kept w/ my version. No need to create extra work.
I'm working on testing the returned duration format to display min:sec or just sec depending on what's returned.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 67
Existing thumb unfortunatley don't tell the right dimensions for sure, because via rectangle_thumbs they may be cropped. If you upload an 16:9 video and have defined a 4:3 rectangle_thumb, it will be cropped. This is our situation.
A Colleague here told me, that the usability of the module is better than the preceding in G2, cause he don't have to calculate min:sec (showed by player) to sec any more ;-)
Would like to put our work together and start a codex page to finish this project. What do you think (suprsidr)?
Already working on the next module: http://gallery.menalto.com/node/104516
Posts: 814
Found an issue with this module and an interference with the 'latestupdates' module.
in the site_menu function of helpers/videothumb_event.php, sometimes (particularly with the latestupdates module) $theme->$item() is not defined, causing an error and the page to fail out (not display)
I fixed by adding in the following (in bold/italic) check, this may not be the most appropriate fix (IANAPC = I am not a php coder)
Posts: 8339
Comments are now permitted for this topic.
Posts: 37
Hi,
When I switch on the latest Videothumb module, I get an empty login page - only the gallery icon and top bar is shown, without a login link or anything else.
Not sure whether I should post this under modules or here...
Log file not mentioning any issue for this.
Error is 100% reproducable for me - tried 2 servers with two versions of Ubuntu LTS (8,10) and stock apache/php/mysql versions.
Switch on: login page not shown / switch off: all fine
Would this be fixed by jnash's change? Will this fix find its way into a new version of the module so that other new users do not need to find this thread and then fix it themselves?
Thanks
Posts: 37
Solution of jnash seems to fix my issue.
However, I have another issue - Videothumb does not work for me. I type in the seconds and the little picture does not change but still shows me the same thumb as before...
Log file is empty.
Any ideas?
Posts: 8339
Do you have a valid ffmpeg binary on your server?
if so what version?
in a shell type:
ffmpeg -version
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 37
I have the standard Ubuntu lucid version of it - video transcode module works fine without error
(please see my other post though - thumbnails of avi clips are not found by kohana proxy, others work fine...)
Posts: 8339
avi is not supported by G3
Looks like you have an old version of ffmpeg please update to one from this decade
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 37
That any better?
Posts: 8339
The ffmpeg command to produce a thumbnail changed in ffmpeg version ~0.6 or 0.7 I cannot remember. So yes it should work now.
-s
________________________________
All New jQuery Minislideshow for G2/G3
Posts: 37
Now seems to work. For anybody experiencing the same issue:
I used this great tutorial:
https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid
Worked like a charm. Please note that I tried the some under Ubuntu version 8 instead of 10 - and it did not work. Under Lucid though everything works fine.