views:

208

answers:

3

Hi everyone; I've wrote a piece of code in python and pygtk for an embeded mplayer in a gui. I assume I use GtkSocket and the slave mode of mplayer with the -wid option.

But I've got an issue, when the size of my GTK window is smaller than my stream, the stream appears to be cropped. And when the size of my window is bigger than my stream, the stream appear centred inside the widget which embed MPlayer. (a gtk.Frame but I've also try with a gtk.DrawingArea) I would like to know how I can get my stream resize dynamically depending on the window's size. I don't want to use Glade or any GUI builder. Thanks in advance for any help, and please excuse my poor english.

A: 

I can post my code if it can help!

alex
nobody can help?
alex
Have a little patience, it's a complicated question! By the way, your remark about posting the code should be in a comment to the original question, not posted as an answer. Only post an answer if it answers the question.
ptomato
A: 

You'll want to connect to the 'size-allocate' signal of whatever widget you embedded MPlayer in. Once you know the new size of the widget, say 200x300, send the commands

set_property width 300
set_property height 200

to MPlayer in slave mode.

(See http://www.mplayerhq.hu/DOCS/tech/slave.txt for a list of slave mode commands.)

ptomato
Hi thanks for the answer but if the get_property is okay, set_property doesn't exist, according to your link about mplayer slave mode.
alex
Hi,I've found some example of somebody did that but I don't understand how!Here is his code: http://www.dinointeractive.com/?p=36I just don't understand what am I missing!
alex
set_property is about halfway down the page, between set_mouse_pos and speed_incr. Ctrl-F is your friend.
ptomato
What don't you understand about the code? Could you be more specific?
ptomato
For the set_property: look at the table a the end of the doc. There's no set_property for height and width. Only get.I don't understand how this guy did to resize the stream, when I resize the window! I did nothing with mplayer in particular, so I guess he done it with pyGTK but I can't find how he procced =(Thanks for your help =)
alex
I would said "HE" did nothing in particular with mplayer.Also, I've sent an email to him... but it seems that he doesn't or can"t answer to me. His blog was not update since last july so..
alex
You're right about the property, I missed that.
ptomato
A: 

You need to tell mplayer to zoom video according to window size. This can be done either in command line (-zoom) or in the configuration file (zoom = 1).

tsahee