Guest User

Untitled

a guest
Jul 16th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. // Import video library.
  2. import processing.video.*;
  3.  
  4. // Declare a movie variable.
  5. Movie melies;
  6.  
  7. void setup() {
  8. size(512, 256);
  9.  
  10. // Create a new movie by supplying this
  11. // sketch, a child of a PApplet, and a String
  12. // for the file name.
  13. melies = new Movie(this, "melies.ogv");
  14.  
  15. // Begin playing the movie on a loop.
  16. melies.loop();
  17. }
  18.  
  19. void draw() {
  20.  
  21. // Read new frame data if available.
  22. if (melies.available()) {
  23. melies.read();
  24. }
  25.  
  26. // Display movie with image function.
  27. // an image from the top-left corner that
  28. // is the width and height of the screen.
  29. image(melies, 0.0, 0.0, width, height);
  30. }
Add Comment
Please, Sign In to add comment