Allow multiple player processes at once

This commit is contained in:
0xboobface 2018-08-13 18:27:23 +02:00
parent f485d3255d
commit c64359d455
2 changed files with 6 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
public class Settings { public class Settings {
public boolean singlePlayer = true;
public boolean localRecording = true; public boolean localRecording = true;
public int httpPort = 8080; public int httpPort = 8080;
public int httpTimeout = 10; public int httpTimeout = 10;
@ -21,5 +22,6 @@ public class Settings {
public boolean determineResolution = false; public boolean determineResolution = false;
public boolean requireAuthentication = false; public boolean requireAuthentication = false;
public boolean chooseStreamQuality = false; public boolean chooseStreamQuality = false;
public boolean recordFollowed = false;
public byte[] key = null; public byte[] key = null;
} }

View File

@ -17,8 +17,9 @@ public class Player {
private static PlayerThread playerThread; private static PlayerThread playerThread;
public static void play(String url) { public static void play(String url) {
boolean singlePlayer = Config.getInstance().getSettings().singlePlayer;
try { try {
if (playerThread != null && playerThread.isRunning()) { if (singlePlayer && playerThread != null && playerThread.isRunning()) {
playerThread.stopThread(); playerThread.stopThread();
} }
@ -29,8 +30,9 @@ public class Player {
} }
public static void play(Recording rec) { public static void play(Recording rec) {
boolean singlePlayer = Config.getInstance().getSettings().singlePlayer;
try { try {
if (playerThread != null && playerThread.isRunning()) { if (singlePlayer && playerThread != null && playerThread.isRunning()) {
playerThread.stopThread(); playerThread.stopThread();
} }