Fabian Stamm 4 years ago
parent
commit
2dfa0e9662
  1. 16
      index.js

16
index.js

@ -11,13 +11,15 @@ var activeFile = undefined;
io.on("connection", (socket)=>{
console.log("client connected:", socket.client.id);
socket.on("play", (data)=>{
console.log("Play", data);
activeFile = data.file;
player.loadFile(__dirname + "/files/" + data.file, ()=>{
player.play(()=>{
Update.start();
console.log("playing");
socket.emit("playing", {file: data.file});
player.stop(()=>{
console.log("Play", data);
activeFile = data.file;
player.loadFile(__dirname + "/files/" + data.file, ()=>{
player.play(()=>{
Update.start();
console.log("playing");
socket.emit("playing", {file: data.file});
});
});
});
});

Loading…
Cancel
Save