I am trying to play a movie, in which I found it is quite finicky.
I had code that only worked with =! FINISHED and would only play the video with .draw. The more I looked into it, it appears .draw is not what I want to play a movie through the duration.
I have since changed the code to match builder output (which is quite unflexible). It looks as so: (an arrow points to my lines with issues)
# MOVIE
if screen_movie.status == NOT_STARTED and nextComponentTime >= trial['isi'] - frameTolerance: # has to be nextComponent because time moved from flipTimeTrial - using nextComponentTime as a sub - trial list is the duration since the last flip
screen_movie.frameNStart = frameN # exact frame index
screen_movie.tStart = current_time # start on trial time and not account for scr refresh
screen_movie.tStartRefresh = flipTimeExp # on exp time
experiment_window.timeOnFlip(screen_movie, 'tStartRefresh') # time at next scr refresh
screen_movie.setAutoDraw(True) <<---------------------------------------------
movieDuration = screen_movie.duration
if screen_movie.status == STARTED and nextComponentTime <= screen_movie.tStartRefresh + movieDuration - frameTolerance:
screen_movie.tStop = current_time # not accounting for scr refresh
screen_movie.frameNStop = frameN # exact frame index
experiment_window.timeOnFlip(screen_movie, 'tStopRefresh') # time at next scr refresh
screen_movie.setAutoDraw(False) <<---------------------------------------------
experiment_window.flip()
Aside from .setAutoDraw, I have tried .draw, .autoDraw, and .play/.stop. All did not work.
Any suggestions?