Page 1 of 1

Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 02 Jul 2008 17:06
by yannack
Hello,
I can' seem to be able to resize dynamically the vlc mozilla plugin using the 0.9 nightly builds.
There is no bug in trac (but maybe i didn't search properly), and all the standard ways explained in the forums are useless (vlc.width, vlc.style.width, etc)
I have no problems with vlc 0.8.6, but the nightly builds (0.9) won't resize... Anybody know a workaround or a fix ? Help!

Re: Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 25 Aug 2008 18:49
by yannack
Is there nobody out there with a similar issue?

Re: Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 26 Aug 2008 13:47
by coldfire
are u having problems with plugin size which is embedded in ur browser...whats the problem with that....how are u actually resizing it....doesnt it needs to be done from editing the width/height in html source

Re: Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 26 Aug 2008 14:40
by yannack
I am trying to resize the vlc plugin using javascript, after the plugin is initialized. I only want to create the plugin once as too many creations tend to crash firefox. But I want to allow the user to resize the plugin. I tried to have javascript functions do this (using vlc.width, vlc.style.width, etc), but all I ever was able to get was a cropped video, not shrinked.
This method works great with 0.8.6x but not with the 0.9 version :(
Any suggestion is welcome!
Thanks

Re: Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 10 Oct 2008 18:13
by yannack
Hello again,
Here is a patch for the afore mentioned ticket, which has been developed at our company. This is diffed against the 0.93 stable release. I would have liked to submit it via trac, but apparently this is not possible.

Code: Select all

--- tmp/vlc-0.9.3/projects/mozilla/vlcshell.cpp 2008-09-18 23:03:36.000000000 +0200 +++ vlcshell.cpp 2008-10-10 17:09:51.000000000 +0200 @@ -7,6 +7,9 @@ * Authors: Samuel Hocevar <sam@zoy.org> * Jean-Paul Saman <jpsaman@videolan.org> * + * + * Patch for dynamic (Javascript) resize of embedded VLC plugin: Frederic Anger <f.anger@qiplay.com> and Yannick Bréhon <y.brehon@qiplay.com> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -948,6 +951,9 @@ unsigned int i_nchildren; unsigned int i_control_height, i_control_width; + int i_new_height = 0; + int i_new_width = 0; + if( p_plugin->b_toolbar ) { p_plugin->getToolbarSize( &i_control_width, &i_control_height ); @@ -969,15 +975,25 @@ } #endif /* X11_RESIZE_DEBUG */ - if( ! p_plugin->setSize(window.width, (window.height - i_control_height)) ) + if( event && event->type == ConfigureNotify ) { - /* size already set */ - return; + i_new_height = event->xconfigure.height - i_control_height; + i_new_width = event->xconfigure.width - i_control_width; + } + else + { + i_new_height = window.height - i_control_height; + i_new_width = window.width - i_control_width; } - i_ret = XResizeWindow( p_display, drawable, - window.width, (window.height - i_control_height) ); + if( ! p_plugin->setSize(i_new_width, i_new_height) ) + { + /* size already set */ + return; + } + i_ret = XResizeWindow( p_display, drawable, i_new_width, i_new_height ); + #ifdef X11_RESIZE_DEBUG fprintf( stderr, "vlcshell::Resize() XResizeWindow(owner) returned %d\n", i_ret ); @@ -1008,7 +1024,7 @@ #endif /* X11_RESIZE_DEBUG */ i_ret = XResizeWindow( p_display, base_window, - window.width, ( window.height - i_control_height ) ); + i_new_width , i_new_height ); #ifdef X11_RESIZE_DEBUG fprintf( stderr,

Re: Resizing Mozilla plugin doesn't work in Nightly Builds

Posted: 10 Oct 2008 18:19
by ivoire
Send it to the dev mailing list : vlc-devel at videolan dot org

Patches are allways welcome :)