wxMediaCtrl on Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

wxMediaCtrl on Windows

Gabrielle C
For some reason I am not getting neither the event saying that the video was loaded neither the mediactrl.Length() to work on Windows. I am doing:

import wx
import wx.media as wm
self.mc = wm.MediaCtrl(self.top_panel, style=wx.SIMPLE_BORDER)
self.Bind(wm.EVT_MEDIA_LOADED, self.OnMediaLoaded)
self.mc.Load(path)

self.OnMediaLoaded is never called ( I also tried to append the Bind directly on the mc). If I try to get self.mc.Length() it also doesn't work (I get 0). But the video plays...

I don't know if it is related, but, when the app builds, an image of the video flashes on the mc location, but after it flashes I get only a black square, If I do 

self.mc.Play()

The video plays, no errors on console. 

Thanks

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wxMediaCtrl on Windows

Patrick Maher
I use MediaCtrl a lot on Windows (initially win 7, now 10), for playing both audio and video, and it generally works well, though a few little things don't do what they are supposed to.

I think the black box you're seeing might be because you didn't specify the size of your video when you defined mc. For example, in one of my programs I have:

        self.player = wx.media.MediaCtrl(self,-1,size=(588,448))

I vaguely recall that I didn't get the OnMediaLoaded event either, but I wrote these programs so long ago that I don't really remember.

The Length() command works for me for audio, I haven't tried it for video. Of course, the media file has to be loaded first for it to work.

If you showed us a small runable example we might be able to be more helpful.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.