Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
imajon
imajon's Profile
1
Posts
2
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Video list array, out of memory
[3 Replies]
28-Dec-2012 01:49 AM
Forum:
Core Library Questions
Hi,
I'm working on a video playlist application which i can control with my mobile over internet.
My code work fine but after playing 7 videos, the application say to me that she don't want to play more video because it is out of memory.
I notice that i have to remove each video i play after it finished but i don't know how.
Somebody know how to avoid to keep video in memory after it played ?
Thanks.
Here is the code :-)
import processing.net.*;
import processing.video.*;
int port = 5204;
Server myServer;
String argumentA;
PFont f;
Movie movie;
String[] numbers = {
"comp5.mov",
"s-dikinson.mov",
"s-GS.mov",
"s-meca.mov",
"s-mariner.mov",
"s-rising.mov",
};
PImage img;
void setup()
{
size(1500, 900);
background(0);
myServer = new Server(this, port);
f = createFont("Arial",16,true);
movie = new Movie(this, numbers[2]);
movie2 = new Movie(this, numbers[0]);
movie.play();
}
void movieEvent(Movie m) {
m.read();
}
int varX=1280;
int varY=720;
void draw()
{
image(movie, width/2-640,height/2-360, varX, varY);
Client thisClient = myServer.available();
if (thisClient !=null) {
String whatClientSaid = thisClient.readString();
if (whatClientSaid.indexOf("login=")!=-1) {
thisClient.write("You will be disconnected now.rn");
println(thisClient.ip() + " has been disconnected");
int argumentA2 = whatClientSaid.indexOf("&");
int argumentA1 = whatClientSaid.indexOf("login");
argumentA = whatClientSaid.substring(argumentA1+6,argumentA2);
println(argumentA);
background(0);
img = loadImage("jon.jpg");
myServer.disconnect(thisClient);
}
}
float md = movie.duration();
float mt = movie.time();
if (mt == md) {
movie.stop();
movie = new Movie(this, numbers[2]);
movie.play();
}
}
«Prev
Next »
Moderate user : imajon
Forum