added replay and forward 10 sec button
continuous-integration/drone/push Build is passing Details

* player ui rework [part 1]
This commit is contained in:
Jannik 2020-04-21 23:37:02 +02:00
parent 965c081d05
commit 0d57127d64
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
14 changed files with 103 additions and 55 deletions

View File

@ -43,9 +43,9 @@ public class Main extends Application {
private MainWindowController mainWindowController; private MainWindowController mainWindowController;
private static XMLController xmlController; private static XMLController xmlController;
private static Logger LOGGER; private static Logger LOGGER;
public static final String version = "0.8.0"; public static final String version = "0.8.90";
public static final String buildNumber = "173"; public static final String buildNumber = "175";
public static final String versionName = "toothless dragon"; public static final String versionName = "nimbly xlr8";
// TODO rename streamURL to mediaURL // TODO rename streamURL to mediaURL

View File

@ -73,7 +73,9 @@ public class PlayerController {
@FXML private JFXSlider timeSlider; @FXML private JFXSlider timeSlider;
@FXML private JFXButton btnBack; @FXML private JFXButton btnBack;
@FXML private JFXButton playBtn; @FXML private JFXButton btnPlay;
@FXML private JFXButton btnReplay;
@FXML private JFXButton btnForward;
@FXML private JFXButton fullscreenBtn; @FXML private JFXButton fullscreenBtn;
@FXML private JFXButton nextEpBtn; @FXML private JFXButton nextEpBtn;
@ -103,10 +105,10 @@ public class PlayerController {
private boolean showControls = true; private boolean showControls = true;
private boolean autoplay; private boolean autoplay;
private Image playArrow = new Image("icons/baseline_play_arrow_black_48dp.png"); private Image playArrow = new Image("icons/baseline_play_arrow_white_48dp.png");
private Image pause = new Image("icons/baseline_pause_black_48dp.png"); private Image pause = new Image("icons/baseline_pause_white_48dp.png");
private Image fullscreen = new Image("icons/baseline_fullscreen_black_48dp.png"); private Image fullscreen = new Image("icons/baseline_fullscreen_white_48dp.png");
private Image fullscreenExit = new Image("icons/baseline_fullscreen_exit_black_48dp.png"); private Image fullscreenExit = new Image("icons/baseline_fullscreen_exit_white_48dp.png");
/** /**
* create a new PlayerWindow object * create a new PlayerWindow object
@ -274,11 +276,9 @@ public class PlayerController {
nextEpBtn.setText(XMLController.getLocalBundle().getString("nextEpisode") nextEpBtn.setText(XMLController.getLocalBundle().getString("nextEpisode")
+ countdown + XMLController.getLocalBundle().getString("seconds")); + countdown + XMLController.getLocalBundle().getString("seconds"));
bottomVBox.setVisible(true); bottomVBox.setVisible(true);
System.out.println("next episode in " + countdown + " seconds");
} else { } else {
nextEpBtn.setVisible(false); nextEpBtn.setVisible(false);
// TODO start next episode playNextMedia();
System.out.println("playing next episode ...");
} }
} }
} }
@ -290,18 +290,7 @@ public class PlayerController {
} }
@FXML @FXML
void fullscreenBtnAction(ActionEvent event) { void btnPlayAction(ActionEvent event) {
if (player.getStage().isFullScreen()) {
player.getStage().setFullScreen(false);
fullscreenIcon.setImage(fullscreen);
} else {
player.getStage().setFullScreen(true);
fullscreenIcon.setImage(fullscreenExit);
}
}
@FXML
void playBtnAction(ActionEvent event) {
if (embeddedMediaPlayer.status().isPlaying()) { if (embeddedMediaPlayer.status().isPlaying()) {
embeddedMediaPlayer.controls().pause(); embeddedMediaPlayer.controls().pause();
playIcon.setImage(playArrow); playIcon.setImage(playArrow);
@ -311,9 +300,31 @@ public class PlayerController {
} }
} }
@FXML
void btnReplayAction(ActionEvent event) {
embeddedMediaPlayer.controls().skipTime(-10000);
}
@FXML
void btnForwardAction(ActionEvent event) {
embeddedMediaPlayer.controls().skipTime(10000);
}
@FXML
void fullscreenBtnAction(ActionEvent event) {
if (player.getStage().isFullScreen()) {
player.getStage().setFullScreen(false);
fullscreenIcon.setImage(fullscreen);
} else {
player.getStage().setFullScreen(true);
fullscreenIcon.setImage(fullscreenExit);
}
}
@FXML @FXML
void nextEpBtnAction(ActionEvent event) { void nextEpBtnAction(ActionEvent event) {
playNextMedia(); // TODO nextEpBtn.setVisible(false);
playNextMedia();
} }
private void playNextMedia() { private void playNextMedia() {
@ -321,7 +332,7 @@ public class PlayerController {
DBController.getInstance().setCurrentTime(media.getStreamUrl(), 0); // reset old video start time DBController.getInstance().setCurrentTime(media.getStreamUrl(), 0); // reset old video start time
FilmTabelDataType nextMedia = DBController.getInstance().getNextEpisode(media.getTitle(), episode, season); FilmTabelDataType nextMedia = DBController.getInstance().getNextEpisode(media.getTitle(), episode, season);
if (nextMedia != null) { if (nextMedia != null) {
//mediaPlayer2.stop(); embeddedMediaPlayer.media().play(nextMedia.getStreamUrl());
media = nextMedia; media = nextMedia;
autoplay = true; autoplay = true;
} }

View File

@ -22,7 +22,7 @@
</HBox> </HBox>
<HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> <HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children> <children>
<JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" onAction="#btnBackAction" style="-fx-background-color: transparent;"> <JFXButton fx:id="btnBack" contentDisplay="GRAPHIC_ONLY" onAction="#btnBackAction">
<graphic> <graphic>
<ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true"> <ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true">
<image> <image>
@ -49,7 +49,10 @@
<Insets left="5.0" right="5.0" /> <Insets left="5.0" right="5.0" />
</padding> </padding>
</JFXSlider> </JFXSlider>
<Label fx:id="lblEndTime" text="0:00:00" textFill="WHITE" /> <Label fx:id="lblEndTime" text="0:00:00" textFill="WHITE">
<font>
<Font size="17.0" />
</font></Label>
</children> </children>
<VBox.margin> <VBox.margin>
<Insets /> <Insets />
@ -58,27 +61,61 @@
<Insets left="10.0" right="10.0" /> <Insets left="10.0" right="10.0" />
</padding> </padding>
</HBox> </HBox>
<HBox fx:id="controlsHBox" alignment="CENTER" spacing="10.0"> <HBox fx:id="controlsHBox" spacing="10.0">
<children> <children>
<JFXButton fx:id="playBtn" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#playBtnAction" prefHeight="39.0" style="-fx-background-color: white;"> <HBox spacing="10.0">
<graphic> <children>
<ImageView fx:id="playIcon" fitHeight="29.0" pickOnBounds="true" preserveRatio="true"> <JFXButton fx:id="btnPlay" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
<image> <graphic>
<Image url="@../icons/baseline_pause_black_48dp.png" /> <ImageView fx:id="playIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
</image> <image>
</ImageView> <Image url="@../icons/baseline_pause_white_48dp.png" />
</graphic></JFXButton> </image>
<JFXButton fx:id="fullscreenBtn" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#fullscreenBtnAction" prefHeight="39.0" style="-fx-background-color: white;"> </ImageView>
<graphic> </graphic>
<ImageView fx:id="fullscreenIcon" fitHeight="29.0" pickOnBounds="true" preserveRatio="true"> </JFXButton>
<image> <JFXButton fx:id="btnReplay" contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
<Image url="@../icons/baseline_fullscreen_black_48dp.png" /> <graphic>
</image> <ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
</ImageView> <image>
</graphic></JFXButton> <Image url="@../icons/baseline_replay_10_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXButton fx:id="btnForward" contentDisplay="GRAPHIC_ONLY" onAction="#btnForwardAction">
<graphic>
<ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_forward_10_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
</children>
<padding>
<Insets left="5.0" right="5.0" />
</padding>
</HBox>
<HBox alignment="TOP_RIGHT" HBox.hgrow="ALWAYS">
<children>
<JFXButton fx:id="fullscreenBtn" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#fullscreenBtnAction" prefHeight="39.0">
<graphic>
<ImageView fx:id="fullscreenIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_fullscreen_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
</children>
<padding>
<Insets left="5.0" right="5.0" />
</padding>
</HBox>
</children> </children>
<padding> <padding>
<Insets bottom="5.0" top="5.0" /> <Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</padding> </padding>
</HBox> </HBox>
</children> </children>
@ -86,7 +123,7 @@
<Insets bottom="5.0" /> <Insets bottom="5.0" />
</padding> </padding>
</VBox> </VBox>
<JFXButton fx:id="nextEpBtn" onAction="#nextEpBtnAction" style="-fx-background-color: ee3523;" text="next episode in 10 seconds" textFill="WHITE" visible="false" AnchorPane.bottomAnchor="80.0" AnchorPane.rightAnchor="20.0"> <JFXButton fx:id="nextEpBtn" onAction="#nextEpBtnAction" style="-fx-background-color: ee3523;" text="next episode in 10 seconds" textFill="WHITE" visible="false" AnchorPane.bottomAnchor="100.0" AnchorPane.rightAnchor="20.0">
<font> <font>
<Font name="System Bold" size="14.0" /> <Font name="System Bold" size="14.0" />
</font> </font>

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

View File

@ -39,7 +39,7 @@ updateBtnChecking = Es wird nach Updates gesucht...
updateBtnUpdateAvailable = Update verf\u00FCgbar updateBtnUpdateAvailable = Update verf\u00FCgbar
updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen: autoUpdate = beim Start nach Updates suchen:
autoplay = autoplay autoplay = Autoplay
branchLbl = Updatezweig branchLbl = Updatezweig
sourcesLbl = Quellen sourcesLbl = Quellen
@ -52,7 +52,7 @@ columnFavorite = Favorit
# error translations # error translations
vlcNotInstalled = Um einen Film abspielen wird der VLC Media Player ben\u00F6tigt! vlcNotInstalled = Um einen Film abspielen wird der VLC Media Player ben\u00F6tigt!
infoText = \nAutoren: \n \u2022 seil0@mosad.xyz \n \u2022 localhorst@mosad.xyz \n(c) 2016-2019 mosad www.mosad.xyz infoText = \nAutoren: \n \u2022 seil0@mosad.xyz \n \u2022 localhorst@mosad.xyz \n(c) 2016-2020 mosad www.mosad.xyz
# textFlow translations # textFlow translations
title = Titel title = Titel
@ -62,7 +62,7 @@ released = Ver\u00F6ffentlicht am
season = Staffel season = Staffel
episode = Episode episode = Episode
runtime = Laufzeit runtime = Laufzeit
genre = Gener genre = Genre
directors = Regisseur directors = Regisseur
writers = Autoren writers = Autoren
actors = Schauspieler actors = Schauspieler
@ -78,7 +78,7 @@ website = Webseite
# first start # first start
addSourceHeader = Neue Quelle hinzuf\u00FCgen addSourceHeader = Neue Quelle hinzuf\u00FCgen
addSourceBody = HomeFlix konnte keine Quelle finden. \nFüge eine loakels Verzeichniss oder eine Sreaming Datei als neue Quelle hinzu. addSourceBody = HomeFlix konnte keine Quelle finden. \nF\u00FCge eine loakels Verzeichniss oder eine Sreaming Datei als neue Quelle hinzu.
cancelBtnText = Abbrechen cancelBtnText = Abbrechen
# DetailView # DetailView

View File

@ -39,9 +39,9 @@ updateBtnChecking = checking for updates...
updateBtnUpdateAvailable = update available updateBtnUpdateAvailable = update available
updateBtnNoUpdateAvailable = no update available updateBtnNoUpdateAvailable = no update available
autoUpdate = check at startup for updates: autoUpdate = check at startup for updates:
autoplay = autoplay autoplay = Autoplay
branchLbl = Branch branchLbl = Branch
sourcesLbl = Quellen sourcesLbl = Sources
# column translations # column translations
columnStreamUrl = File Name columnStreamUrl = File Name
@ -52,7 +52,7 @@ columnFavorite = Favorite
# error translations # error translations
vlcNotInstalled = VLC Media Player is required to play a movie! vlcNotInstalled = VLC Media Player is required to play a movie!
infoText = \nMaintainers: \n \u2022 seil0@mosad.xyz \n \u2022 localhorst@mosad.xyz \n(c) 2016-2019 mosad www.mosad.xyz infoText = \nMaintainers: \n \u2022 seil0@mosad.xyz \n \u2022 localhorst@mosad.xyz \n(c) 2016-2020 mosad www.mosad.xyz
# textFlow translations # textFlow translations
title = Title title = Title
@ -62,7 +62,7 @@ released = published on
season = Season season = Season
episode = Episode episode = Episode
runtime = Runtime runtime = Runtime
genre = Gener genre = Genre
directors = Directors directors = Directors
writers = Writers writers = Writers
actors = Actors actors = Actors
@ -78,7 +78,7 @@ website = Website
# first startnext episode in # first startnext episode in
addSourceHeader = add a new source addSourceHeader = add a new source
addSourceBody = HomeFlix was not able to load a source. \nAdd a new local directory oa a streaming file as new source. addSourceBody = HomeFlix was not able to load a source. \nAdd a new local directory or a streaming file as new source.
cancelBtnText = cancel cancelBtnText = cancel
# DetailView # DetailView