Video player by Python tkinter, When I pause video, I cannot re-play

后端 未结 4 1011
时光说笑
时光说笑 2021-01-19 05:06

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

4条回答
  •  生来不讨喜
    2021-01-19 05:44

    I would create another method for the play button callback. Something like this:

    def play_start(self):
        self.pause = False
        self.play_video()
    

    However, I would make sure you disable the play button if it's already playing. Otherwise, you could have multiple "instances" of play_video going if the play button is pressed multiple times.


    An alternative is to combine your play and pause button, so it toggles the value of self.pause. Then you could have just one button with one callback function.

提交回复
热议问题