P5.js video upload into switch statement

Hi! Welcome to the forum!

First of all could you properly format the code using </> button (it’s not that you wrap the code with < > but you need to wrap with back ticks that appear when you hit that button)

Also could you provide the code with switch statement? If I understand correctly, the code you provided works, and with switch statement (that you didn’t post) the video doesn’t show up, right?

Note that how you’re showing the video is using DOM and not drawing on the canvas. You need to video.hide() in setup and image(video,0,0) in draw if you want to show the video on canvas (with DOM it may work smoother but if you want to modify pixels or overlay shapes, drawing on canvas is easier).