python - Code for playing video in wx.Media after the wmv file is loaded -


i newbie in wxpython , have write code can start playing video after load file. have been going through lot of forums tried implement 10 - 20 codes, wx.media not playing video file @ all. able load file not play it.

i need simple code in manually enter path name of video file , after file loaded should start playing.

i using windows xp, python 2.7 , wxpython python 2.7.

i grateful of if me on one.

following code using load() , play() file. still not working.

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 controls         try:             self.mc = wx.media.mediactrl(self, style=wx.simple_border)         except notimplementederror:             self.destroy()             raise         self.mc.load(r"c:\documents , settings\n1002401b\desktop\test1.wmv")         #self.slider.setrange(0, self.mc.length())         #folder, filename = os.path.split("c:\documents , settings\n1002401b\desktop\test1.wmv")         self.bind(wx.media.evt_media_loaded, self.onplay)     def onplay(self,evt):         self.mc.play()  app = wx.app(0)  frame = wx.frame(none) panel = testpanel(frame) frame.show()  app.mainloop() 

thanking you.

you can find tutorial wx.media module here.

you have call load(path) , play() on mediactrl object.

it idea future posts include small snippet of code, can know have tried.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -