.stop and .play method in the same function #14
-
I've come across an issue when using .play() and stop() in one function. When creating buttons for each of the methods videoplayer.stop() and videoplayer.play(), everything works perfectly fine.
I've kept out the rest of the code, which are only some buttons and basic pack statements. When i use my add_to_list function behind a button, the video just keeps playing and does not change. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@depayem4 You don't need to use the stop function when making use of the load function, as it implicitly calls the stop function. It automatically stops and then loads the new video. To correct your error add |
Beta Was this translation helpful? Give feedback.
@depayem4 You don't need to use the stop function when making use of the load function, as it implicitly calls the stop function. It automatically stops and then loads the new video.
To correct your error add
videoplayer.after(1000, videoplayer.play)
instead ofvideoplayer.play()
as this will give time for thread to stop playing the old video and load another one.