A simple script to play a movie:
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()
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