new player part 2

* homeflix now saves the progress you made for all films
* added icons for the player
* added a slider to set the play time for the player
* disable contols and cursor if mous is not moved for 5sec, enable it if moved
* autoplay, WIP needs testing
This commit is contained in:
Jannik
2018-04-02 02:18:43 +02:00
parent 2881c1f9d6
commit a918b0b1d8
11 changed files with 259 additions and 30 deletions

View File

@ -229,7 +229,6 @@ public class MainWindowController {
private boolean settingsTrue = false;
private boolean autoUpdate = false;
private boolean useBeta = false;
private boolean betaPlayer = false;
private static final Logger LOGGER = LogManager.getLogger(MainWindowController.class.getName());
private int hashA = -647380320;
@ -240,6 +239,7 @@ public class MainWindowController {
private String color;
private String title;
private String streamUrl;
private String currentEp;
private String ratingSortType;
private String local;
private String omdbAPIKey;
@ -500,6 +500,7 @@ public class MainWindowController {
next = indexTable + 1;
title = columnTitle.getCellData(indexTable); // get name of selected item
streamUrl = columnStreamUrl.getCellData(indexTable); // get file path of selected item
currentEp = columnEpisode.getCellData(indexTable); // get the current episode of a series
for (FilmTabelDataType helpData : filmsList) {
if (helpData.getStreamUrl().equals(streamUrl)) {
@ -548,9 +549,12 @@ public class MainWindowController {
private void playbtnclicked() {
// TODO rework when #19 is coming
if (betaPlayer) {
new Player(streamUrl);
} else {
try {
System.out.println();
new Player(streamUrl, currentEp, dbController);
} catch (Exception e) {
LOGGER.error("using fallback player!", e); // FIXME doesn't work!
if (System.getProperty("os.name").contains("Linux")) {
String line;
String output = "";
@ -572,22 +576,21 @@ public class MainWindowController {
} else {
try {
Runtime.getRuntime().exec(new String[] { "vlc", streamUrl }); // TODO switch to ProcessBuilder
} catch (IOException e) {
showErrorMsg(errorPlay, e);
} catch (IOException e1) {
showErrorMsg(errorPlay, e1);
}
}
} else if (System.getProperty("os.name").contains("Windows") || System.getProperty("os.name").contains("Mac OS X")) {
try {
Desktop.getDesktop().open(new File(streamUrl));
} catch (IOException e) {
showErrorMsg(errorPlay, e);
} catch (IOException e1) {
showErrorMsg(errorPlay, e1);
}
} else {
LOGGER.error(System.getProperty("os.name") + ", OS is not supported, please contact a developer! ");
}
}
}
}
@FXML