diff --git a/src/main/java/org/mosad/homeflix/application/Main.java b/src/main/java/org/mosad/homeflix/application/Main.java index f902977..ab33544 100644 --- a/src/main/java/org/mosad/homeflix/application/Main.java +++ b/src/main/java/org/mosad/homeflix/application/Main.java @@ -44,8 +44,8 @@ public class Main extends Application { private MainWindowController mainWindowController; private static XMLController xmlController; private static Logger LOGGER; - public static final String version = "0.8.90"; - public static final String buildNumber = "175"; + public static final String version = "0.8.91"; + public static final String buildNumber = "177"; public static final String versionName = "nimbly xlr8"; // TODO rename streamURL to mediaURL diff --git a/src/main/java/org/mosad/homeflix/application/SettingsView.java b/src/main/java/org/mosad/homeflix/application/SettingsView.java index 0f29967..6b15d0a 100644 --- a/src/main/java/org/mosad/homeflix/application/SettingsView.java +++ b/src/main/java/org/mosad/homeflix/application/SettingsView.java @@ -87,6 +87,7 @@ public class SettingsView { @FXML private JFXToggleButton autoUpdateToggleBtn; @FXML private JFXToggleButton autoplayToggleBtn; + @FXML private JFXToggleButton fullscreenToggleBtn; @FXML private TableView sourcesTable; @FXML private TableColumn sourceColumn; @@ -109,6 +110,7 @@ public class SettingsView { autoUpdateToggleBtn.setSelected(XMLController.isAutoUpdate()); autoplayToggleBtn.setSelected(XMLController.isAutoplay()); + fullscreenToggleBtn.setSelected(XMLController.isFullscreen()); languageChoisBox.setItems(languages); branchChoisBox.setItems(branches); @@ -197,6 +199,12 @@ public class SettingsView { XMLController.setAutoplay(!XMLController.isAutoplay()); xmlController.saveSettings(); } + + @FXML + private void fullscreenToggleBtnAction(ActionEvent event) { + XMLController.setFullscreen(!XMLController.isFullscreen()); + xmlController.saveSettings(); + } @FXML private void colorPickerAction(ActionEvent event) { @@ -272,6 +280,8 @@ public class SettingsView { autoUpdateToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor())); autoplayToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor())); autoplayToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor())); + fullscreenToggleBtn.setToggleColor(Color.valueOf(XMLController.getColor())); + fullscreenToggleBtn.setToggleLineColor(Color.valueOf(XMLController.getColor())); } public void updateGUILocal() { @@ -288,6 +298,7 @@ public class SettingsView { autoUpdateToggleBtn.setText(XMLController.getLocalBundle().getString("autoUpdate")); autoplayToggleBtn.setText(XMLController.getLocalBundle().getString("autoplay")); + fullscreenToggleBtn.setText(XMLController.getLocalBundle().getString("fullscreen")); } public void setVisible(boolean visible) { diff --git a/src/main/java/org/mosad/homeflix/controller/XMLController.java b/src/main/java/org/mosad/homeflix/controller/XMLController.java index 88dfc7f..fbe1f5a 100644 --- a/src/main/java/org/mosad/homeflix/controller/XMLController.java +++ b/src/main/java/org/mosad/homeflix/controller/XMLController.java @@ -61,6 +61,7 @@ public class XMLController { private static boolean autoUpdate = false; private static boolean useBeta = false; private static boolean autoplay = false; + private static boolean fullscreen = true; private static double fontSize = 17; private static ResourceBundle localBundle = ResourceBundle.getBundle("locals.HomeFlix-Local", Locale.US); @@ -276,6 +277,14 @@ public class XMLController { public static void setAutoplay(boolean autoplay) { XMLController.autoplay = autoplay; } + + public static boolean isFullscreen() { + return fullscreen; + } + + public static void setFullscreen(boolean fullscreen) { + XMLController.fullscreen = fullscreen; + } public static double getFontSize() { return fontSize; diff --git a/src/main/java/org/mosad/homeflix/player/PlayerController.java b/src/main/java/org/mosad/homeflix/player/PlayerController.java index 902a3c4..8794849 100644 --- a/src/main/java/org/mosad/homeflix/player/PlayerController.java +++ b/src/main/java/org/mosad/homeflix/player/PlayerController.java @@ -194,7 +194,7 @@ public class PlayerController { // hide controls timer initialization final Timer timer = new Timer(); TimerTask controlAnimationTask = null; // task to execute save operation - final long delayTime = 4000; // hide the controls after 2 seconds + final long delayTime = 3000; // hide the controls after 2 seconds @Override public void handle(MouseEvent mouseEvent) { @@ -223,6 +223,11 @@ public class PlayerController { timer.schedule(controlAnimationTask, delayTime); } }); + + if (XMLController.isFullscreen()) { + player.getStage().setFullScreen(!player.getStage().isFullScreen()); + fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen); + } } /** @@ -283,6 +288,15 @@ public class PlayerController { @Override public void handle(MouseEvent event) { embeddedMediaPlayer.controls().skipTime(skipTime); + + // TODO update time-stamps if video is paused +// currentTime = currentTime + skipTime; +// endTime = endTime - skipTime; +// +// Platform.runLater(() -> { +// updateControls(); +// }); + mousePressed = false; } }); @@ -437,7 +451,6 @@ public class PlayerController { setAudioTrack(list.getSelectionModel().getSelectedIndex()); audioPopup.hide(); }); - // TODO style the JFXListView Text heading = new Text("Audio"); heading.setFill(Color.WHITE); @@ -462,13 +475,13 @@ public class PlayerController { } @FXML - void btnFullscreenAction(ActionEvent event) { + private void btnFullscreenAction(ActionEvent event) { player.getStage().setFullScreen(!player.getStage().isFullScreen()); fullscreenIcon.setImage(player.getStage().isFullScreen() ? fullscreenExit : fullscreen); } @FXML - void btnNextEpisodeAction(ActionEvent event) { + private void btnNextEpisodeAction(ActionEvent event) { btnNextEpisode.setVisible(false); playNextMedia(); } @@ -508,8 +521,6 @@ public class PlayerController { } private class FXBufferFormatCallback implements BufferFormatCallback { - int sourceWidth; - int sourceHeight; @Override public BufferFormat getBufferFormat(int sourceWidth, int sourceHeight) { diff --git a/src/main/resources/fxml/PlayerWindow.fxml b/src/main/resources/fxml/PlayerWindow.fxml index 2dc2758..0a6996e 100644 --- a/src/main/resources/fxml/PlayerWindow.fxml +++ b/src/main/resources/fxml/PlayerWindow.fxml @@ -11,31 +11,20 @@ - + - + - + - + - + - + - + @@ -50,9 +39,7 @@ - + @@ -78,37 +65,29 @@ - + - + - + - + - + - + - + - + @@ -118,30 +97,22 @@ - + - + - + - + - + - + - + @@ -161,11 +132,7 @@ - + diff --git a/src/main/resources/fxml/SettingsView.fxml b/src/main/resources/fxml/SettingsView.fxml index 079a922..47863ac 100644 --- a/src/main/resources/fxml/SettingsView.fxml +++ b/src/main/resources/fxml/SettingsView.fxml @@ -113,6 +113,11 @@ + + + + + diff --git a/src/main/resources/locals/HomeFlix-Local_de_DE.properties b/src/main/resources/locals/HomeFlix-Local_de_DE.properties index 47ff5d2..fe6ba6d 100644 --- a/src/main/resources/locals/HomeFlix-Local_de_DE.properties +++ b/src/main/resources/locals/HomeFlix-Local_de_DE.properties @@ -40,6 +40,7 @@ updateBtnUpdateAvailable = Update verf\u00FCgbar updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar autoUpdate = beim Start nach Updates suchen: autoplay = Autoplay +fullscreen = starte im Vollbildmodus branchLbl = Updatezweig sourcesLbl = Quellen diff --git a/src/main/resources/locals/HomeFlix-Local_en_US.properties b/src/main/resources/locals/HomeFlix-Local_en_US.properties index e8dd45c..450803b 100644 --- a/src/main/resources/locals/HomeFlix-Local_en_US.properties +++ b/src/main/resources/locals/HomeFlix-Local_en_US.properties @@ -40,6 +40,7 @@ updateBtnUpdateAvailable = update available updateBtnNoUpdateAvailable = no update available autoUpdate = check at startup for updates: autoplay = Autoplay +fullscreen = start in fullscreen branchLbl = Branch sourcesLbl = Sources