Playing a video on Processing
in
Core Library Questions
•
2 years ago
Hi All!
I have a slight query with regards to playing a movie with processing.
I'm building a basic game for kids and one of the requirements is that a couple of videos be played when certain actions take place.
I'm using the following code to play the video:
import processing.video.*;
Movie myMovie;
void setup() {
size(640, 480, P2D);
background(0);
// Load and play the video in a loop
myMovie = new Movie(this, "myMovie.mov");
myMovie.loop();
}
void movieEvent(Movie myMovie) {
myMovie.read();
}
void draw() {
tint(255, 20);
image(myMovie, mouseX-myMovie.width/2, mouseY-myMovie.height/2);
}
However, my game seems to be crashing whenever I try to play the video. I've upgraded my memory on the preferences tab, however it does not really work when I upgrade it to 4GB(i'm using a system with 4gb of ram). So i updated its max memory to 1gb.
Any ideas why the game is crashing? Is there a particular file type or size I should be sticking to?
Cheers
- mike
2