Commits

Michele Orrù committed 3022dd8

Code cleanup

Comments (0)

Files changed (1)

player-example.py

                 title = filename
             self.SetTitle("%s - wxVLCplayer" % title)
 
-
             # set the wiindow system where to render VLC's video output
             self.player.set_xwindow(self.videopanel.GetHandle())
             self.OnPlay(None)
             # set the volume slider to the current volume
             self.volslider.SetValue(self.player.audio_get_volume() // 2)
 
+        # finally destroy the dialog
         dlg.Destroy()
 
     def OnPlay(self, evt):
         if not self.player:
             self.OnOpen(None)
         else:
+            # Try to launch the media, if this fails display an error message
             if self.player.play() == -1:
                 self.errorDialog("Unable to play.")
-            self.timer.Start()
+            else:
+                self.timer.Start()
 
     def OnPause(self, evt):
         """
         Pause the player.
         """
+        # If the player exists, the switch to pause/play, otherwise display an
+        # error message
         if self.player:
             self.player.pause()
         else:
         length = self.player.get_length()
         self.timeslider.SetRange(-1, length)
 
+        # update the time on the slider
         if self.player:
             time = self.player.get_time()
         else: