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 static XMLController xmlController;
private static Logger LOGGER;
public static final String version = "0.8.0";
public static final String buildNumber = "173";
public static final String versionName = "toothless dragon";
public static final String version = "0.8.90";
public static final String buildNumber = "175";
public static final String versionName = "nimbly xlr8";
// TODO rename streamURL to mediaURL

View File

@ -73,7 +73,9 @@ public class PlayerController {
@FXML private JFXSlider timeSlider;
@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 nextEpBtn;
@ -103,10 +105,10 @@ public class PlayerController {
private boolean showControls = true;
private boolean autoplay;
private Image playArrow = new Image("icons/baseline_play_arrow_black_48dp.png");
private Image pause = new Image("icons/baseline_pause_black_48dp.png");
private Image fullscreen = new Image("icons/baseline_fullscreen_black_48dp.png");
private Image fullscreenExit = new Image("icons/baseline_fullscreen_exit_black_48dp.png");
private Image playArrow = new Image("icons/baseline_play_arrow_white_48dp.png");
private Image pause = new Image("icons/baseline_pause_white_48dp.png");
private Image fullscreen = new Image("icons/baseline_fullscreen_white_48dp.png");
private Image fullscreenExit = new Image("icons/baseline_fullscreen_exit_white_48dp.png");
/**
* create a new PlayerWindow object
@ -274,11 +276,9 @@ public class PlayerController {
nextEpBtn.setText(XMLController.getLocalBundle().getString("nextEpisode")
+ countdown + XMLController.getLocalBundle().getString("seconds"));
bottomVBox.setVisible(true);
System.out.println("next episode in " + countdown + " seconds");
} else {
nextEpBtn.setVisible(false);
// TODO start next episode
System.out.println("playing next episode ...");
playNextMedia();
}
}
}
@ -289,6 +289,27 @@ public class PlayerController {
player.getStage().close();
}
@FXML
void btnPlayAction(ActionEvent event) {
if (embeddedMediaPlayer.status().isPlaying()) {
embeddedMediaPlayer.controls().pause();
playIcon.setImage(playArrow);
} else {
embeddedMediaPlayer.controls().play();
playIcon.setImage(pause);
}
}
@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()) {
@ -300,20 +321,10 @@ public class PlayerController {
}
}
@FXML
void playBtnAction(ActionEvent event) {
if (embeddedMediaPlayer.status().isPlaying()) {
embeddedMediaPlayer.controls().pause();
playIcon.setImage(playArrow);
} else {
embeddedMediaPlayer.controls().play();
playIcon.setImage(pause);
}
}
@FXML
void nextEpBtnAction(ActionEvent event) {
playNextMedia(); // TODO
nextEpBtn.setVisible(false);
playNextMedia();
}
private void playNextMedia() {
@ -321,7 +332,7 @@ public class PlayerController {
DBController.getInstance().setCurrentTime(media.getStreamUrl(), 0); // reset old video start time
FilmTabelDataType nextMedia = DBController.getInstance().getNextEpisode(media.getTitle(), episode, season);
if (nextMedia != null) {
//mediaPlayer2.stop();
embeddedMediaPlayer.media().play(nextMedia.getStreamUrl());
media = nextMedia;
autoplay = true;
}

View File

@ -22,7 +22,7 @@
</HBox>
<HBox fx:id="hBoxTop" alignment="CENTER_LEFT" spacing="10.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<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>
<ImageView fitHeight="24.0" pickOnBounds="true" preserveRatio="true">
<image>
@ -49,7 +49,10 @@
<Insets left="5.0" right="5.0" />
</padding>
</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>
<VBox.margin>
<Insets />
@ -58,27 +61,61 @@
<Insets left="10.0" right="10.0" />
</padding>
</HBox>
<HBox fx:id="controlsHBox" alignment="CENTER" spacing="10.0">
<HBox fx:id="controlsHBox" spacing="10.0">
<children>
<JFXButton fx:id="playBtn" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#playBtnAction" prefHeight="39.0" style="-fx-background-color: white;">
<graphic>
<ImageView fx:id="playIcon" fitHeight="29.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_pause_black_48dp.png" />
</image>
</ImageView>
</graphic></JFXButton>
<JFXButton fx:id="fullscreenBtn" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#fullscreenBtnAction" prefHeight="39.0" style="-fx-background-color: white;">
<graphic>
<ImageView fx:id="fullscreenIcon" fitHeight="29.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_fullscreen_black_48dp.png" />
</image>
</ImageView>
</graphic></JFXButton>
<HBox spacing="10.0">
<children>
<JFXButton fx:id="btnPlay" buttonType="RAISED" contentDisplay="GRAPHIC_ONLY" onAction="#btnPlayAction">
<graphic>
<ImageView fx:id="playIcon" fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<Image url="@../icons/baseline_pause_white_48dp.png" />
</image>
</ImageView>
</graphic>
</JFXButton>
<JFXButton fx:id="btnReplay" contentDisplay="GRAPHIC_ONLY" onAction="#btnReplayAction">
<graphic>
<ImageView fitHeight="42.0" pickOnBounds="true" preserveRatio="true">
<image>
<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>
<padding>
<Insets bottom="5.0" top="5.0" />
<Insets bottom="5.0" left="10.0" right="10.0" top="5.0" />
</padding>
</HBox>
</children>
@ -86,7 +123,7 @@
<Insets bottom="5.0" />
</padding>
</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 name="System Bold" size="14.0" />
</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
updateBtnNoUpdateAvailable = Kein Update verf\u00FCgbar
autoUpdate = beim Start nach Updates suchen:
autoplay = autoplay
autoplay = Autoplay
branchLbl = Updatezweig
sourcesLbl = Quellen
@ -52,7 +52,7 @@ columnFavorite = Favorit
# error translations
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
title = Titel
@ -62,7 +62,7 @@ released = Ver\u00F6ffentlicht am
season = Staffel
episode = Episode
runtime = Laufzeit
genre = Gener
genre = Genre
directors = Regisseur
writers = Autoren
actors = Schauspieler
@ -78,7 +78,7 @@ website = Webseite
# first start
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
# DetailView

View File

@ -39,9 +39,9 @@ updateBtnChecking = checking for updates...
updateBtnUpdateAvailable = update available
updateBtnNoUpdateAvailable = no update available
autoUpdate = check at startup for updates:
autoplay = autoplay
autoplay = Autoplay
branchLbl = Branch
sourcesLbl = Quellen
sourcesLbl = Sources
# column translations
columnStreamUrl = File Name
@ -52,7 +52,7 @@ columnFavorite = Favorite
# error translations
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
title = Title
@ -62,7 +62,7 @@ released = published on
season = Season
episode = Episode
runtime = Runtime
genre = Gener
genre = Genre
directors = Directors
writers = Writers
actors = Actors
@ -78,7 +78,7 @@ website = Website
# first startnext episode in
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
# DetailView