I want to start playing a .wmv file as soon as it is loaded in wxPython. I wrote a small code for it. The code does not give any error, but it does not show any video as well. It just shows a gray screen. Following is the code I wrote for my program.
import wx
import wx.media
class TestPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1, style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN)
# Create some controls
try:
self.mc = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER)
except NotImplementedError:
self.Destroy()
raise
self.mc.Load("C:\Users\Rohit\Videos\Debut\paint.wmv")
#self.slider.SetRange(0, self.mc.Length())
#folder, filename = os.path.split("C:\Documents and Settings\N1002401B\Desktop\test1.wmv")
self.Bind(wx.media.EVT_MEDIA_LOADED, self.OnPlay)
def OnPlay(sef,evt):
self.mc.Play()
app = wx.App(0)
frame = wx.Frame(None)
panel = TestPanel(frame)
frame.Show()
app.MainLoop()
Can anyone please help me on this one. I would be really grateful for your help.