# Video loop crashes

**URL:** <https://discourse.psychopy.org/t/video-loop-crashes/35919>\
**Category:** Builder\
**Tags:** randomization\
**Created:** [July 31, 2023, 2:50am UTC](https://discourse.psychopy.org/t/video-loop-crashes/35919 "2023-07-31T02:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kafkaesque](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kafkaesque](https://discourse.psychopy.org/u/kafkaesque)\
**Post date:** [July 31, 2023, 2:50am UTC](https://discourse.psychopy.org/t/video-loop-crashes/35919/1 "2023-07-31T02:50:54Z")

</div>

If this template helps then use it. If not then just delete and start from scratch.

**OS** (e.g. Win10): both Windows 10 and MacOS (M1)  
**PsychoPy version** (e.g. 1.84.x): 2022.2.2  
**Standard Standalone? (y/n)** If not then what?:  
**What are you trying to achieve?:** I want to play one random video file from a list of 4 videos. Therefore, I want to first read all video files in xlsx file, randomize its order, and then terminate loop right after first trial. However, when I make a loop with condition file, the whole experiment just freezes and I need to shut my computer down and restart the whole thing. However, when I remove the loop, video plays just fine. I don’t know why the loop doesn’t work.

**What did you try to make it work?:** I tried to make a condition loop file, that looks like this:

 ![Screen Shot 2023-07-31 at 11.47.38 AM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/f/9fff6c19ee2f17d84cd6776de0fa03d15a02346a.png)

and psychopy builder component with loop that looks like this:

 ![Screen Shot 2023-07-31 at 11.49.01 AM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/f/1f238795c255079fec3c8d7731b1ca24ac724cf6.png)

**What specifically went wrong when you tried that?:**  
The computer just freezes on the previous component screen and I need to either force quit the app or restart the computer. So it doesn’t return any error messages.
