Nov-13-2024, 03:19 PM
A simple script to play a movie:
The problem is that no action is possible (e.g. a mouse click) until the video is over.
How to perform any action during the video playback.
Best regards.
Wookie
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import pygame import moviepy.editor pygame.init() screen = pygame.display.set_mode(( 1000 , 500 )) clock = pygame.time.Clock() pygame.time.set_timer(pygame.USEREVENT, 5 ) running = True while running: for event in pygame.event.get(): if event. type = = pygame.QUIT: running = False if event. type = = pygame.MOUSEBUTTONDOWN: if event.button = = 1 : print ( 'You left clicked' ) # video film = "Lacuna.avi" video = moviepy.editor.VideoFileClip(film) video.preview() |
How to perform any action during the video playback.
Best regards.
Wookie