-
Bug
-
Resolution: Fixed
-
P3
-
fx2.0.2
-
Mac OS X with JavaFX 2.1 preview, Windows 7 with Java 6 u29 and JavaFX 2.0.2.
Updating MediaPlayer properties on a background thread causes exceptions to be thrown when those properties are bound to scene graph nodes. The following example program demonstrates the bug:
public class CurrentTimeUpdatedOffAppThread extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
System.out.println("JavaFX version: "+VersionInfo.getRuntimeVersion());
Media m = new Media("http://traffic.libsyn.com/dickwall/JavaPosse373.mp3");
MediaPlayer mp = new MediaPlayer(m);
Label label = new Label();
label.textProperty().bind(Bindings.convert(mp.currentTimeProperty()));
final Scene scene = new Scene(new Group(label), 200, 200);
primaryStage.setScene(scene);
primaryStage.setTitle("CurrentTime Bug");
primaryStage.show();
mp.play();
}
}
After a few seconds, the media will begin to play and an exception will be thrown.
public class CurrentTimeUpdatedOffAppThread extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) {
System.out.println("JavaFX version: "+VersionInfo.getRuntimeVersion());
Media m = new Media("http://traffic.libsyn.com/dickwall/JavaPosse373.mp3");
MediaPlayer mp = new MediaPlayer(m);
Label label = new Label();
label.textProperty().bind(Bindings.convert(mp.currentTimeProperty()));
final Scene scene = new Scene(new Group(label), 200, 200);
primaryStage.setScene(scene);
primaryStage.setTitle("CurrentTime Bug");
primaryStage.show();
mp.play();
}
}
After a few seconds, the media will begin to play and an exception will be thrown.
- relates to
-
JDK-8117838 MediaPlayer's status property is not updated on the JavaFX application thread
- Closed
-
JDK-8127074 MediaPlayer or Media updating properties on wrong thread.
- Closed