Skip to content

Commit

Permalink
pause + leave fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowLp174 committed Sep 15, 2022
1 parent 2f5b7f2 commit 5545584
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Media.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand All @@ -193,7 +194,6 @@ class MediaPlayer extends Media {
}
resume() {
if (!this.paused) return;
this.paused = false;
this.emit("start");
this._write();
}
Expand Down
3 changes: 2 additions & 1 deletion Signaling.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit 5545584

Please sign in to comment.