Video Player Stutter When Changing Source

I am trying to sequence a series of videos randomly.

I have created an array of video players and essentially I only render one of the videos at a time in the draw loop.

This is super close to doing what I want, but at certain times when the video switches there is visually noticable hiccup of frames. It tends to get worse the longer I run the code.

The script uses the ofxHAPAVPlayer so I can play HAP videos.

The code isn’t very long so I’m sharing a link to the project here:


Thank you for your time