forked from j62/ctbrec
Dispose the video player on error
This commit is contained in:
parent
0ff04ed9ef
commit
1feea03ec3
|
@ -242,6 +242,7 @@ public class PreviewPopupHandler implements EventHandler<MouseEvent> {
|
|||
if(videoPlayer.getError().getCause() != null) {
|
||||
LOG.error("Error while starting preview stream root cause:", videoPlayer.getError().getCause());
|
||||
}
|
||||
videoPlayer.dispose();
|
||||
Platform.runLater(() -> {
|
||||
showTestImage();
|
||||
});
|
||||
|
@ -277,6 +278,9 @@ public class PreviewPopupHandler implements EventHandler<MouseEvent> {
|
|||
}
|
||||
|
||||
private void hidePopup() {
|
||||
if(future != null && !future.isDone()) {
|
||||
future.cancel(true);
|
||||
}
|
||||
Platform.runLater(() -> {
|
||||
popup.setX(-1000);
|
||||
popup.setY(-1000);
|
||||
|
|
Loading…
Reference in New Issue