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();
}
(...)
Monique Y. Mudama - 07 Oct 2005 23:07 GMT
> 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.
[snip]
> public void NewMovie () throws QTException {
> filnavn = "L"+ Integer.toString(L) + "M" + Integer.toString(M) +
[quoted text clipped - 7 lines]
> m.start();
> }
I'm not really familiar with this QT stuff, but I didn't see a
remove() anywhere. At a very rough glance, it looks like you keep
adding components, but you never take the old ones away.

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Roedy Green - 08 Oct 2005 09:36 GMT
>Movie m = Movie.fromFile(omFile);
> Frame f = new BasicQTSherlock (m);
> f.pack();
> f.setVisible(true);
It looks as though you create a whole new frame for each movie. If
you want that frame to disappear, you will need a f.dispose()
I have never heard of this API. Look for some close, dispose, remove
methods at the various levels that you call when the movie is done.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.