video playlist error
in
Core Library Questions
•
1 year ago
Hi,
I found a code for displaying video and it works perfectly fine:
- import processing.video.*;
- // Step 1. Declare Movie object
- Movie movie;
- void setup() {
- size(610,480);
- // Step 2. Initialize Movie object
- // Movie file should be in data folder
- movie = new Movie(this,"1.mov");
- // Step 3. Start movie playing
- movie.loop();
- }
- // Step 4. Read new frames from movie
- void movieEvent(Movie movie) {
- movie.read();
- }
- void draw() {
- // Step 5. Display movie.
- movie.read();
- image(movie,0,0);
- }
- import processing.video.*;
- int maxmyMovies = 4; // Total # of movies
- int myMoviesIndex = 0; // Initial movie to be displayed is the first
- Movie[] myMovies = new Movie[maxmyMovies]; //array of movies
- void setup() {
- size(610, 480);
- // Loading the movies into the array
- // Don't forget to put the .mov files in the data folder!
- for (int i = 1; i < myMovies.length; i ++ ) {
- myMovies[i] = new Movie(this, "1 " + i + ".mov");
- myMovies[i].loop();
- }
- }
- void draw() {
- image(myMovies[1], 0, 0);
- image(myMovies[2], 0, 0);
- image(myMovies[3], 0, 0);
- image(myMovies[4], 0, 0);
- }
1