1. Is there a way to get the MediaCtrl to tell you the original
dimensions
of a video it's loaded? Both Media Player and QuickTime provide methods for
this, but I don't see a way to access the information from wxMediaCtrl.There is not a separate API for it but you can use GetBestSize as it is
calculated dynamically based on the size of the currently loaded video.
Right... GetBestSize() gets the size of the video plus the size of the
player controls if they are enabled... (yes, I probably need a seperate
method for that but I didn't add any this time due to ABI concerns... of
course since it isn't getting into 2.6.3 it seems kind of silly now...)
> 5. My current implementation loads a gif image into the media player when
> my program starts to be displayed before a video file is selected. The
> image doesn't display using wx.MediaCtrl. Also, when I load a movie using
> the Load() method, the video's first frame isn't displayed until I call
> "Play", unlike my current implementation. Any idea why not? (This is
> obviously a small, cosmetic issue, but I'd like to be able to keep my
> program's appearance consistent.)No idea, and I've wondered this too. The initial implementation on
Windows did show the first frame, but when it was redesigned to better
support the other platforms with the same API then it stopped doing it.
I'm not sure I understand the issue here - I'm pretty sure it is clear from
the docs that nothing is displayed until Play but I could be wrong. As for
the image, that could have been a result from the directshow-->windows media
player control transition as the old directshow method loaded lots of
stuff, the newer method has the player controls but I think may be
capable of less in the loading department.
I see why I missed this. I called GetBestSize() immediately after loading,
and it was returning (0, 0). I see that if I call it much later in the
process, it does return a legitimate size.
Remember that in 2.6.2+ loading is asyncronous on all platforms
now so calling Play() right after Load() simply won't work - you need
to catch the wxEVT_MEDIA_LOADED event and play there, and in addition
even then you may not be able to get the size of the video [in the case
of gstreamer] until the video is a bit into playing
(as a side note I personally wanted to block in Play() in this instance
but was afraid of even more wxMediaCtrl-spam on wx-dev). Same applies
to the duration of the media.
[The reason for the async behaviour is because some backends like
realplayer or windows media player may take a while to load
so simply blocking in Load() probably isn't what a user wants. I
suppose for the metadata such as video size et. al it probably
would have been a good idea for some kind of metadata event etc,
but again I didn't want to wx-dev anymore so I held off on it...]
Okay, it appears to be missing in 2.6.1.0-unicode, and merely broken in
2.6.1.2-unicode. Using 2.6.1.2, there is in fact a bar in place the color
and size expected for the player controls. However, the bar is blank and
unresponsive.
Hmmm? This doesn't make any sense... none of my testing has shown this :\ -
I guess I need to learn a little python and try out this release :).
Anyway, I'm always open to suggestions and feel free to email me privately
as well because I only check the archives and only check the python ones
like once a month....
Ryan