Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : How to destroy Movie threads?

$
0
0
Dispose works the same way that the duration and stop functions work; it's an argumentless void, so you do not get a return value, nor do you have to pass an argument. If your movie is called myMovie, you can implement dispose by writing myMovie.dispose();

The best place to add this is after the video ends (you don't want to delete the videoplayer while it's still playing, off course). For example:

if (myMovie.time() >= myMovie.duration()) { //when the timestamp of the player is greater or equal to the duration of the video
      myMovie.dispose(); //delete the player and free the memory for garbage collection
}

Viewing all articles
Browse latest Browse all 1768

Trending Articles