diff --git a/Media.js b/Media.js index 3c44535..3eef84f 100644 --- a/Media.js +++ b/Media.js @@ -183,6 +183,7 @@ class MediaPlayer extends Media { finished() { this.track = new MediaStreamTrack({ kind: "audio" }); this.playing = false; + this.paused = false; this.disconnect(false, false); this.emit("finish"); } @@ -193,7 +194,6 @@ class MediaPlayer extends Media { } resume() { if (!this.paused) return; - this.paused = false; this.emit("start"); this._write(); } diff --git a/Signaling.js b/Signaling.js index acb7282..e1bbc1a 100644 --- a/Signaling.js +++ b/Signaling.js @@ -58,7 +58,8 @@ class Signaling { this.ws.send(msg); }); this.ws.on("close", (e) => { - if (e !== 1000) console.log("WebSocket Closed: ", e); + if (e === 1000) return; // don't reconnect when websocket is closed intentionally + console.log("WebSocket Closed: ", e); // TODO: Reconnect setTimeout(() => { this.reconnect(); diff --git a/package.json b/package.json index 3009022..6c868e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revoice.js", - "version": "0.1.72", + "version": "0.1.73", "description": "A voice module for Revolt", "main": "index.js", "scripts": {