@kuralle-syrinx/browser-client 2.1.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/index.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kuralle-syrinx/browser-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"types": "./src/index.ts",
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@evan/opus": "1.0.3",
|
|
11
|
-
"@kuralle-syrinx/core": "
|
|
11
|
+
"@kuralle-syrinx/core": "3.0.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"typescript": "^5.7.0",
|
package/src/index.ts
CHANGED
|
@@ -579,6 +579,11 @@ export class SyrinxBrowserClient {
|
|
|
579
579
|
}
|
|
580
580
|
|
|
581
581
|
private reportDownlinkCodecCapability(): void {
|
|
582
|
+
// The socket can drop during async codec negotiation (opus load) — e.g. a forced
|
|
583
|
+
// reconnect. The capability advert is re-sent on the next `ready` after reconnect,
|
|
584
|
+
// so skip it on a closed socket rather than throwing (which would crash the
|
|
585
|
+
// negotiation promise as an unhandled rejection).
|
|
586
|
+
if (!this.transport.connected) return;
|
|
582
587
|
const downlinkEncoding = this.opusCodec ? "opus" : "pcm_s16le";
|
|
583
588
|
this.sendJson({ type: "codec_capability", downlinkEncoding });
|
|
584
589
|
}
|