I'm having problems getting the MediaCtrl to display at a reasonable size with large videos. When I make it play one it instantly resizes itself to the size of the original video no matter what I set as it's maxsize, which often means that part of the window is off the screen and you can only see part of the video. I've tried doing MediaCtrl.SetSize() which seems to work fine, but it just goes back to the massive size if I resize the window or do anything to the sizer. Is there any way of stopping this from happening?

Also, I've been wondering if there's a way to change the backend it's using while the program's running, for example (pseudo code):

# Creating a MediaCtrl using the Windows Media Player 10 backend
player = wx.media.MediaCtrl(self, sxBackend=wx.media.MEDIABACKEND_WMP10)
[...]
define OpenFile:
	Ask user for file to open
	if filetype == .MOV:
		player.SetBackend(wx.media.MEDIABACKEND_QUICKTIME) ?

I know it can guess which one to use if I don't specify one, but that can't play WMV's and it displays the Windows Media logo when it's not playing something for some reason.

Any help would be appreciated :)

Well, I worked out a way of changing the media backend - for example, if the file opened is a Quicktime file and the current backend isn't Quicktime, it destroys the media control and then creates it again but using the Quicktime backend. It works reasonably quickly, and I'm working on a system that'll mean it only needs to change backend if the opened file actually needs a different one.
However, I'm still not sure how to stop the resizing problem mentioned above... :-/

It is possibly the video header that is resizing. You should be able to resize and move the window manually depending on your operating system. Something along the lines of
wx.Frame.__init__(self, parent, -1, title, pos=(10,10), size=(640, 480), etc
should work also (with the emphasis on 'should').

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.