code cleanup
This commit is contained in:
parent
4b5c9482c8
commit
96e3d9e3ac
|
@ -31,11 +31,9 @@ import javafx.stage.Stage;
|
|||
import javafx.stage.WindowEvent;
|
||||
import kellerkinder.HomeFlix.application.Main;
|
||||
import kellerkinder.HomeFlix.application.MainWindowController;
|
||||
import kellerkinder.HomeFlix.datatypes.FilmTabelDataType;
|
||||
|
||||
public class Player {
|
||||
|
||||
private MainWindowController mainWindowController;
|
||||
private PlayerController playerController;
|
||||
private Stage stage;
|
||||
private AnchorPane pane;
|
||||
|
@ -46,7 +44,6 @@ public class Player {
|
|||
* @param mainWindowController the MainWindowController
|
||||
*/
|
||||
public Player(MainWindowController mainWindowController) {
|
||||
this.mainWindowController = mainWindowController;
|
||||
try {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(ClassLoader.getSystemResource("fxml/PlayerWindow.fxml"));
|
||||
pane = (AnchorPane) fxmlLoader.load();
|
||||
|
@ -74,10 +71,6 @@ public class Player {
|
|||
}
|
||||
}
|
||||
|
||||
public void playNewFilm(FilmTabelDataType film) {
|
||||
playerController.init(mainWindowController, this, film);
|
||||
}
|
||||
|
||||
public Stage getStage() {
|
||||
return stage;
|
||||
}
|
||||
|
|
|
@ -138,7 +138,6 @@ public class PlayerController {
|
|||
});
|
||||
|
||||
// every time the play time changes execute this
|
||||
// TODO rework autoplay
|
||||
mediaPlayer.currentTimeProperty().addListener(new ChangeListener<Duration>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends Duration> observable, Duration oldValue, Duration newValue) {
|
||||
|
@ -152,7 +151,7 @@ public class PlayerController {
|
|||
FilmTabelDataType nextFilm = mainWCon.getDbController().getNextEpisode(film.getTitle(), (episode + 1));
|
||||
if (nextFilm != null) {
|
||||
mediaPlayer.stop();
|
||||
player.playNewFilm(nextFilm);
|
||||
init(mainWCon, player, nextFilm);
|
||||
autoplay = true;
|
||||
}
|
||||
} else if ((duration - currentTime) < 100) {
|
||||
|
@ -178,7 +177,7 @@ public class PlayerController {
|
|||
private void initActions() {
|
||||
|
||||
player.getScene().addEventFilter(MouseEvent.MOUSE_MOVED, new EventHandler<MouseEvent>() {
|
||||
// hide controls timer init
|
||||
// hide controls timer initialization
|
||||
final Timer timer = new Timer();
|
||||
TimerTask controlAnimationTask = null; // task to execute save operation
|
||||
final long delayTime = 1000;
|
||||
|
|
Loading…
Reference in New Issue