T
torchestra
I am using Quicktime for Java and have placed a movie in a frame. I
would like to replace the movie with another movie when it finish
playing. For this I use the triggerAtStop in the quicktime.std.clocks
class. My problem is that the new movie is placed bellow the first
movie in the frame and do not replace it.
(Some of the code - the programme load files, L1M1.mp4, L1M2,mp4 etc.
where the numbers in the file name are generated from variables.
(...)
class MyQTCallback extends ExtremesCallBack {
public MyQTCallback (Movie m) throws QTException {
super (m.getTimeBase(), StdQTConstants.triggerAtStop);
callMeWhen();
}
public void execute () {
try {
M = M+1;
NewMovie();
} catch (QTException qte) {
qte.printStackTrace();
}
}
public static void main (String [] Args) {
try {
QTSessionCheck.check();
System.out.println(filpath+filnavn);
filnavn = "L"+ Integer.toString(L) + "M" +
Integer.toString(M) + ".mp4";
QTFile file = new QTFile( new File(filpath,
filnavn));
OpenMovieFile omFile =
OpenMovieFile.asRead((QTFile) file);
Movie m = Movie.fromFile(omFile);
Frame f = new BasicQTSherlock (m);
f.pack();
f.setVisible(true);
m.start();
} catch (Exception e) {
e.printStackTrace();
}
}
public void NewMovie () throws QTException {
filnavn = "L"+ Integer.toString(L) + "M" + Integer.toString(M) +
".mp4";
QTFile file = new QTFile( new File(filpath, filnavn));
OpenMovieFile omFile = OpenMovieFile.asRead((QTFile) file);
Movie m = Movie.fromFile(omFile);
QTComponent qc= QTFactory.makeQTComponent(m);
Component c = qc.asComponent();
add (c,BorderLayout.CENTER);
m.start();
}
(...)
would like to replace the movie with another movie when it finish
playing. For this I use the triggerAtStop in the quicktime.std.clocks
class. My problem is that the new movie is placed bellow the first
movie in the frame and do not replace it.
(Some of the code - the programme load files, L1M1.mp4, L1M2,mp4 etc.
where the numbers in the file name are generated from variables.
(...)
class MyQTCallback extends ExtremesCallBack {
public MyQTCallback (Movie m) throws QTException {
super (m.getTimeBase(), StdQTConstants.triggerAtStop);
callMeWhen();
}
public void execute () {
try {
M = M+1;
NewMovie();
} catch (QTException qte) {
qte.printStackTrace();
}
}
public static void main (String [] Args) {
try {
QTSessionCheck.check();
System.out.println(filpath+filnavn);
filnavn = "L"+ Integer.toString(L) + "M" +
Integer.toString(M) + ".mp4";
QTFile file = new QTFile( new File(filpath,
filnavn));
OpenMovieFile omFile =
OpenMovieFile.asRead((QTFile) file);
Movie m = Movie.fromFile(omFile);
Frame f = new BasicQTSherlock (m);
f.pack();
f.setVisible(true);
m.start();
} catch (Exception e) {
e.printStackTrace();
}
}
public void NewMovie () throws QTException {
filnavn = "L"+ Integer.toString(L) + "M" + Integer.toString(M) +
".mp4";
QTFile file = new QTFile( new File(filpath, filnavn));
OpenMovieFile omFile = OpenMovieFile.asRead((QTFile) file);
Movie m = Movie.fromFile(omFile);
QTComponent qc= QTFactory.makeQTComponent(m);
Component c = qc.asComponent();
add (c,BorderLayout.CENTER);
m.start();
}
(...)