title: Export Video Processing Video Applet
body: <p>I am facing a recurrent problem when I try to export a Processing applet that deals with video to work in the browser. It's a simple application that stops, plays and pauses a .mp4 video. When I run it using Processing IDE, it works just fine. But executing the index.html generated when I export, the video box gets blank and nothing happen and I get this error in the console:</p>
  
  <pre><code>Exception in thread "Animation Thread" java.lang.NoClassDefFoundError: Could not initialize class quicktime.QTSession
      at processing.video.Movie.init(Unknown Source)
      at processing.video.Movie.&lt;init&gt;(Unknown Source)
      at processing.video.Movie.&lt;init&gt;(Unknown Source)
      at sketch_nov14a.setup(sketch_nov14a.java:31)
      at processing.core.PApplet.handleDraw(Unknown Source)
      at processing.core.PApplet.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Maybe it is a known issue, but I still can't find the solution: <a href="http://processing.org/bugs/bugzilla/44.html" rel="nofollow">BUG 44</a></p>
  
  <p>That is the code:</p>
  
  <pre><code>import processing.video.*;
  
  Movie theMov; 
  boolean isPlaying;
  boolean isLooping;
  
  
  void setup() { 
    size(600,400,P2D);
    theMov = new Movie(this, "http://www.sinopsedofilme.com.br/processing/video2.mp4");
    /* only use 1 of the following options */
    theMov.play();  //plays the movie once
    theMov.loop();  //plays the movie over and over
    isPlaying = true;
    isLooping = true;
  
  }
  
  void draw() { 
    image(theMov, 0,0); 
  } 
  
  void movieEvent(Movie m) { 
    m.read(); 
  } 
  
  void keyPressed() {
    if (key == 'p') {
      // toggle pausing
      if (isPlaying) {
        theMov.pause();
      } else {
        theMov.play();
      }
      isPlaying = !isPlaying;
  
    } else if (key == 'l') {
      // toggle looping
      if (isLooping) {
        theMov.noLoop();
      } else {
        theMov.loop();
      }
      isLooping = !isLooping;
  
    } else if (key == 's') {
      // stop playing
      theMov.stop();
      isPlaying = false;
  
    } else if (key == 'j') {
      // jump to a random time
      theMov.jump(random(theMov.duration()));
    }
  }
  </code></pre>