diff --git a/gui/fx/src/main/java/com/github/gtache/autosubtitle/gui/fx/FXMediaController.java b/gui/fx/src/main/java/com/github/gtache/autosubtitle/gui/fx/FXMediaController.java index 5a252e1..d981826 100644 --- a/gui/fx/src/main/java/com/github/gtache/autosubtitle/gui/fx/FXMediaController.java +++ b/gui/fx/src/main/java/com/github/gtache/autosubtitle/gui/fx/FXMediaController.java @@ -113,9 +113,19 @@ public class FXMediaController implements MediaController { }); bindPlayButton(); + + stackPane.widthProperty().addListener((observable, oldValue, newValue) -> resizeMediaView()); + stackPane.heightProperty().addListener((observable, oldValue, newValue) -> resizeMediaView()); binder.createBindings(); } + private void resizeMediaView() { + final var width = stackPane.getWidth(); + final var height = stackPane.getHeight(); + videoView.setFitWidth(width); + videoView.setFitHeight(height); + } + private void loadFileVideo(final Path fileVideoPath) { final var media = new Media(fileVideoPath.toUri().toString()); final var player = new MediaPlayer(media); diff --git a/gui/fx/src/main/resources/com/github/gtache/autosubtitle/gui/fx/mediaView.fxml b/gui/fx/src/main/resources/com/github/gtache/autosubtitle/gui/fx/mediaView.fxml index e21c712..34136f3 100644 --- a/gui/fx/src/main/resources/com/github/gtache/autosubtitle/gui/fx/mediaView.fxml +++ b/gui/fx/src/main/resources/com/github/gtache/autosubtitle/gui/fx/mediaView.fxml @@ -53,7 +53,7 @@
- +