We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Video pauses, but audio keeps playing (Read 382 times)
Video pauses, but audio keeps playing
Dec 1st, 2009, 12:28am
 
Hi all...

I have a simple demo sketch of a video playing. The idea is that when I click on the video it pauses, and when I click on it again the video resumes playing.

My code stops the video allright, but the audio keeps playing. Anyone have any ideas how to fix this?

Here's the code...


import processing.video.*;

Movie video;

int play = 1;

void setup() {
 background(255);
 size(320,240);
 video = new Movie(this, "DRT.mp4");
 video.loop();
}

void draw() {

 // Display frame
 image(video,0,0);

}
void mouseReleased() {
 if (play == 1) {
   play = 0;
   video.pause();
 }
 else {
   play = 1;
   video.play();
 }
}




Page Index Toggle Pages: 1