I am creating GUI to play video files. The problem is that when I pause video, Play button cannot re-play that video, and I have to select video file again.
Note: S
Question: Pause button will have no effect.
Reference:
Tkinter.Widget.after-method - after(delay_ms, callback=None, *args)
Registers an callback that is called after a given time.
Tkinter.Widget.after_cancel-method - after_cancel(id)
Cancels an callback.
To cancel
the allready queued events
for self.play_video
change the following:
def play_video(self):
...
if self.pause:
self.window.after_cancel(self.after_id)
else:
self.after_id = self.window.after(self.delay, self.play_video)