|
@@ -5,6 +5,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import javax.annotation.PostConstruct;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -25,6 +26,14 @@ public class MusicServiceImpl implements MusicService, Runnable {
|
|
|
//1:重复播放,0:不重复
|
|
|
Boolean repeat = false;
|
|
|
|
|
|
+ Thread thread;
|
|
|
+
|
|
|
+ @PostConstruct
|
|
|
+ public void init(){
|
|
|
+ this.thread = new Thread(this);
|
|
|
+ this.thread.start();
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public Integer start(String path, Integer vol) {
|
|
|
synchronized (this) {
|