simli-client
Advanced tools
+19
-9
@@ -149,3 +149,3 @@ "use strict"; | ||
| } | ||
| console.log("SIMLI: simli-client@1.2.15 initialized"); | ||
| console.log("SIMLI: simli-client@1.2.20 initialized"); | ||
| } | ||
@@ -265,6 +265,6 @@ else { | ||
| case "failed": | ||
| this.emit("failed", "Connection failed"); | ||
| case "closed": | ||
| if (this.videoReceived) { | ||
| this.emit("disconnected"); | ||
| this.emit("failed", "Connection failed or closed"); | ||
| } | ||
@@ -539,3 +539,5 @@ this.cleanup(); | ||
| console.error("SIMLI: connection failure:", reason); | ||
| this.emit("failed", reason); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", reason); | ||
| } | ||
| this.cleanup(); | ||
@@ -551,7 +553,9 @@ } | ||
| this.cleanup() | ||
| .then(() => this.start()) | ||
| .then(() => this.start(this.inputIceServers, this.retryAttempt)) | ||
| .catch((error) => { | ||
| if (this.enableConsoleLogs) | ||
| console.error("SIMLI: Reconnection failed:", error); | ||
| this.emit("failed", "Reconnection failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Reconnection failed"); | ||
| } | ||
| }); | ||
@@ -620,3 +624,5 @@ } | ||
| console.error("SIMLI: Failed to initialize audio stream:", error); | ||
| this.emit("failed", "Audio initialization failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Audio initialization failed"); | ||
| } | ||
| } | ||
@@ -645,3 +651,5 @@ } | ||
| console.error("SIMLI: Failed to initialize AudioWorklet:", error); | ||
| this.emit("failed", "AudioWorklet initialization failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "AudioWorklet initialization failed"); | ||
| } | ||
| }); | ||
@@ -846,7 +854,9 @@ } | ||
| this.cleanup() | ||
| .then(() => this.start()) | ||
| .then(() => this.start(this.inputIceServers, this.retryAttempt)) | ||
| .catch((error) => { | ||
| if (this.enableConsoleLogs) | ||
| console.error("SIMLI: Reconnection failed:", error); | ||
| this.emit("failed", "Reconnection failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Reconnection failed"); | ||
| } | ||
| }); | ||
@@ -853,0 +863,0 @@ } |
+19
-9
@@ -187,3 +187,3 @@ // src/index.ts | ||
| } | ||
| console.log("SIMLI: simli-client@1.2.15 initialized"); | ||
| console.log("SIMLI: simli-client@1.2.20 initialized"); | ||
| } else { | ||
@@ -338,6 +338,6 @@ console.warn( | ||
| case "failed": | ||
| this.emit("failed", "Connection failed"); | ||
| case "closed": | ||
| if (this.videoReceived) { | ||
| this.emit("disconnected"); | ||
| this.emit("failed", "Connection failed or closed"); | ||
| } | ||
@@ -659,3 +659,5 @@ this.cleanup(); | ||
| console.error("SIMLI: connection failure:", reason); | ||
| this.emit("failed", reason); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", reason); | ||
| } | ||
| this.cleanup(); | ||
@@ -673,7 +675,9 @@ } | ||
| this.cleanup() | ||
| .then(() => this.start()) | ||
| .then(() => this.start(this.inputIceServers, this.retryAttempt)) | ||
| .catch((error) => { | ||
| if (this.enableConsoleLogs) | ||
| console.error("SIMLI: Reconnection failed:", error); | ||
| this.emit("failed", "Reconnection failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Reconnection failed"); | ||
| } | ||
| }); | ||
@@ -751,3 +755,5 @@ } | ||
| console.error("SIMLI: Failed to initialize audio stream:", error); | ||
| this.emit("failed", "Audio initialization failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Audio initialization failed"); | ||
| } | ||
| } | ||
@@ -789,3 +795,5 @@ } | ||
| console.error("SIMLI: Failed to initialize AudioWorklet:", error); | ||
| this.emit("failed", "AudioWorklet initialization failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "AudioWorklet initialization failed"); | ||
| } | ||
| }); | ||
@@ -1021,7 +1029,9 @@ } | ||
| this.cleanup() | ||
| .then(() => this.start()) | ||
| .then(() => this.start(this.inputIceServers, this.retryAttempt)) | ||
| .catch((error) => { | ||
| if (this.enableConsoleLogs) | ||
| console.error("SIMLI: Reconnection failed:", error); | ||
| this.emit("failed", "Reconnection failed"); | ||
| if (this.retryAttempt >= this.MAX_RETRY_ATTEMPTS) { | ||
| this.emit("failed", "Reconnection failed"); | ||
| } | ||
| }); | ||
@@ -1028,0 +1038,0 @@ } |
+1
-1
| { | ||
| "name": "simli-client", | ||
| "version": "1.2.19", | ||
| "version": "1.2.20", | ||
| "description": "Simli WebRTC Client", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
81313
1.26%1939
1.04%