Methods Summary |
---|
public void | close()Close the player.
synchronized (this) {
player.close();
while (!closed) {
try {
wait(100);
} catch (InterruptedException ie) {
}
}
}
player.removeControllerListener(this);
|
public boolean | configure()
return configure(Integer.MAX_VALUE);
|
public boolean | configure(int timeOutMillis)Configure the player. This method will block until
either the player has been configured or the configure has failed.
long startTime = System.currentTimeMillis();
synchronized (this) {
if (player instanceof Processor)
((Processor)player).configure();
else
return false;
while (!configured && !failed) {
try {
wait(timeOutMillis);
} catch (InterruptedException ie) {
}
if (System.currentTimeMillis() - startTime > timeOutMillis)
break;
}
}
return configured;
|
public synchronized void | controllerUpdate(javax.media.ControllerEvent ce)
if (ce instanceof RealizeCompleteEvent) {
realized = true;
} else if (ce instanceof ConfigureCompleteEvent) {
configured = true;
} else if (ce instanceof PrefetchCompleteEvent) {
prefetched = true;
} else if (ce instanceof EndOfMediaEvent) {
eom = true;
} else if (ce instanceof ControllerErrorEvent) {
failed = true;
} else if (ce instanceof ControllerClosedEvent) {
closed = true;
} else {
return;
}
notifyAll();
|
public boolean | playToEndOfMedia(int timeOutMillis)Start the player and play till the end of the media. This
method will block until either the player has finished playing
the media or the playback has failed at some point.
long startTime = System.currentTimeMillis();
eom = false;
synchronized (this) {
player.start();
while (!eom && !failed) {
try {
wait(timeOutMillis);
} catch (InterruptedException ie) {
}
if (System.currentTimeMillis() - startTime > timeOutMillis)
break;
}
}
return eom && !failed;
|
public boolean | prefetch(int timeOutMillis)Prefetch the player. This method will block until
either the player has been configured or the configure has failed.
long startTime = System.currentTimeMillis();
synchronized (this) {
player.prefetch();
while (!prefetched && !failed) {
try {
wait(timeOutMillis);
} catch (InterruptedException ie) {
}
if (System.currentTimeMillis() - startTime > timeOutMillis)
break;
}
}
return prefetched && !failed;
|
public boolean | realize()
return realize(Integer.MAX_VALUE);
|
public boolean | realize(int timeOutMillis)Realize the player. This method will block until
either the player has been realized or the realize has failed.
long startTime = System.currentTimeMillis();
synchronized (this) {
player.realize();
while (!realized && !failed) {
try {
wait(timeOutMillis);
} catch (InterruptedException ie) {
}
if (System.currentTimeMillis() - startTime > timeOutMillis)
break;
}
}
return realized;
|