Resizing Mozilla plugin doesn't work in Nightly Builds

*nix specific usage questions
yannack
Blank Cone
Blank Cone
Posts: 10
Joined: 02 Apr 2008 17:09

Resizing Mozilla plugin doesn't work in Nightly Builds

Postby yannack » 02 Jul 2008 17:06

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!

yannack
Blank Cone
Blank Cone
Posts: 10
Joined: 02 Apr 2008 17:09

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

Postby yannack » 25 Aug 2008 18:49

Is there nobody out there with a similar issue?

coldfire
Blank Cone
Blank Cone
Posts: 47
Joined: 07 Jul 2008 11:02

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

Postby coldfire » 26 Aug 2008 13:47

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
Good one What is H264?

yannack
Blank Cone
Blank Cone
Posts: 10
Joined: 02 Apr 2008 17:09

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

Postby yannack » 26 Aug 2008 14:40

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

yannack
Blank Cone
Blank Cone
Posts: 10
Joined: 02 Apr 2008 17:09

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

Postby yannack » 10 Oct 2008 18:13

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,

ivoire
Cone that earned his stripes
Cone that earned his stripes
Posts: 413
Joined: 20 Aug 2008 11:29
VLC version: trunk
Operating System: linux (debian sid)
Contact:

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

Postby ivoire » 10 Oct 2008 18:19

Send it to the dev mailing list : vlc-devel at videolan dot org

Patches are allways welcome :)


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 38 guests