Skip to content

Commit

Permalink
minor player improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Seil0 committed Apr 18, 2018
1 parent 7631169 commit 75ad137
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,9 @@ public class MainWindowController {
private static final Logger LOGGER = LogManager.getLogger(MainWindowController.class.getName());
private int hashA = -647380320;

private String version = "0.6.100";
private String buildNumber = "149";
private String versionName = "toothless dragon RC";
private final String version = "0.6.100";
private final String buildNumber = "151";
private final String versionName = "toothless dragon RC";
private String dialogBtnStyle;
private String color;
private String local;
Expand Down Expand Up @@ -274,8 +274,9 @@ void setMain(Main main) {
omdbAPIController = new OMDbAPIController(this, dbController, this.main);
}

// call all init methods
// call all initialize methods
void init() {
LOGGER.info("Initializing Project-HomeFlix build " + buildNumber);
loadSettings();
checkAutoUpdate();
initTabel();
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/kellerkinder/HomeFlix/player/PlayerController.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class PlayerController {
private ImageView fullscreen_black = new ImageView(new Image("icons/ic_fullscreen_black_24dp_1x.png"));
private ImageView fullscreen_exit_black = new ImageView(new Image("icons/ic_fullscreen_exit_black_24dp_1x.png"));

/**
/** FIXME double set currentTime(
* initialize the new PlayerWindow
* @param entry the film object
* @param player the player object (needed for closing action)
Expand Down Expand Up @@ -144,7 +144,7 @@ public void changed(ObservableValue<? extends Duration> observable, Duration old
currentTime = newValue.toMillis(); // set the current time
int episode = !film.getEpisode().isEmpty() ? Integer.parseInt(film.getEpisode()) : 0;
int season = !film.getSeason().isEmpty() ? Integer.parseInt(film.getSeason()) : 0;

// if we are end time -10 seconds, do autoplay, if activated
if ((duration - currentTime) < 10000 && episode != 0 && autoplay) {
autoplay = false;
Expand All @@ -155,8 +155,10 @@ public void changed(ObservableValue<? extends Duration> observable, Duration old
init(mainWCon, player, nextFilm);
autoplay = true;
}
} else if ((duration - currentTime) < 100) {
} else if ((duration - currentTime) < 120) {
// if we are -20ms stop the media
mediaPlayer.stop();
mainWCon.getDbController().setCurrentTime(film.getStreamUrl(), 0); // reset old video start time
}

if (!mousePressed) {
Expand All @@ -181,7 +183,7 @@ private void initActions() {
// hide controls timer initialization
final Timer timer = new Timer();
TimerTask controlAnimationTask = null; // task to execute save operation
final long delayTime = 1000;
final long delayTime = 2000; // hide the controls after 2 seconds

@Override
public void handle(MouseEvent mouseEvent) {
Expand Down

0 comments on commit 75ad137

Please sign in to comment.