import processing.video.*; Movie mv; int flag = 0; void setup() { size(480, 270); // read mp4 file mv = new Movie(this, "walking.mp4"); mv.play(); // start play mv.pause(); } void draw() { if (mv.available() == false) { return; } mv.read(); // read frame PImage Mimg = mv.get(); background(0); image(Mimg, 0, 0); // display } void keyPressed() { if (key == ' ') { //space if (flag == 0) { flag = 1; mv.play(); } else { flag = 0; mv.pause(); } } }