Skip to content

Commit

Permalink
fix play next logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFaser committed Apr 7, 2024
1 parent eb2e74c commit 9d63c5b
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ public MediaBridge(ControllerApp controllerApp, WebEngine mediaWebEngine, Queue<
public void playNext(boolean skip) {
Platform.runLater(() -> {
if (controllerApp.isEnableMedia()) {
String media = skip ? null : controllerApp.getMediaName();

if (media == null) {
controllerApp.updateMediaQueueListView();
media = mediaQueue.poll();
if (!skip && controllerApp.getMediaName() != null) {
controllerApp.pausePlayer();
return;
}

System.out.println(media);
controllerApp.updateMediaQueueListView();
String media = mediaQueue.poll();

if (media != null) {
mediaWebEngine.load(media);
Expand All @@ -156,6 +156,8 @@ public void playNext(boolean skip) {
}

mediaWebEngine.load(null);
controllerApp.playPlayer();
return;
}

if (skip) {
Expand Down

0 comments on commit 9d63c5b

Please sign in to comment.