Feel free to explore these next relevant links:
Can anyone help me find what's wrong with my code for a video player based off sensor reading - Processing 2.x and 3.x Forum
How to switch between multiple movies?/Play movie after a movie? - Processing 2.x and 3.x Forum
Set distance value with ultrasonic sensor - Processing 2.x and 3.x Forum
Kf