@honeybbq/teamspeak 1.0.0-beta.15 → 1.0.0-beta.17
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/README.md +51 -9
- package/dist/query/lines.d.ts.map +1 -1
- package/dist/query/lines.js +2 -4
- package/dist/query/lines.js.map +1 -1
- package/dist/query/trim.d.ts +10 -0
- package/dist/query/trim.d.ts.map +1 -0
- package/dist/query/trim.js +23 -0
- package/dist/query/trim.js.map +1 -0
- package/dist/query/web.d.ts.map +1 -1
- package/dist/query/web.js +3 -2
- package/dist/query/web.js.map +1 -1
- package/dist/stream/emitter.d.ts +6 -4
- package/dist/stream/emitter.d.ts.map +1 -1
- package/dist/stream/emitter.js +10 -9
- package/dist/stream/emitter.js.map +1 -1
- package/dist/stream/errors.d.ts +0 -8
- package/dist/stream/errors.d.ts.map +1 -1
- package/dist/stream/errors.js +0 -8
- package/dist/stream/errors.js.map +1 -1
- package/dist/stream/index.d.ts +4 -5
- package/dist/stream/index.d.ts.map +1 -1
- package/dist/stream/index.js +3 -4
- package/dist/stream/index.js.map +1 -1
- package/dist/stream/peer.d.ts +7 -1
- package/dist/stream/peer.d.ts.map +1 -1
- package/dist/stream/peer.js +16 -1
- package/dist/stream/peer.js.map +1 -1
- package/dist/stream/published.d.ts +3 -1
- package/dist/stream/published.d.ts.map +1 -1
- package/dist/stream/published.js +15 -5
- package/dist/stream/published.js.map +1 -1
- package/dist/stream/streams.d.ts +2 -4
- package/dist/stream/streams.d.ts.map +1 -1
- package/dist/stream/streams.js +18 -8
- package/dist/stream/streams.js.map +1 -1
- package/dist/stream/types.d.ts +53 -50
- package/dist/stream/types.d.ts.map +1 -1
- package/dist/stream/wire.d.ts +2 -0
- package/dist/stream/wire.d.ts.map +1 -1
- package/dist/stream/wire.js +4 -0
- package/dist/stream/wire.js.map +1 -1
- package/package.json +1 -1
- package/src/query/lines.ts +3 -4
- package/src/query/trim.ts +21 -0
- package/src/query/web.ts +3 -2
- package/src/stream/emitter.ts +10 -9
- package/src/stream/errors.ts +0 -8
- package/src/stream/index.ts +8 -4
- package/src/stream/peer.ts +27 -1
- package/src/stream/published.ts +23 -4
- package/src/stream/streams.ts +18 -8
- package/src/stream/types.ts +61 -50
- package/src/stream/wire.ts +5 -0
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ Upgrading from 0.x? The package was renamed; see the [migration guide](https://g
|
|
|
32
32
|
- **Identity management** — Generate, import/export, and upgrade security level of identities
|
|
33
33
|
- **Full command set** — 111 typed functions covering every command the voice protocol answers
|
|
34
34
|
- **Reconnection** — Opt-in retry with backoff, tuned for TeamSpeak's antiflood ban
|
|
35
|
-
- **Streams** — TeamSpeak 6 screen share signalling: find, publish and watch streams, with SDP and ICE as strings for any WebRTC stack
|
|
35
|
+
- **Streams** — TeamSpeak 6 screen share signalling: find, publish and watch streams, with SDP and ICE as strings for any WebRTC stack
|
|
36
36
|
- **Server capabilities** — Reports the server version and the uid hash it uses (SHA-1 on TS3, SHA-256 on TS6), and the server's name, icon, banner and welcome message
|
|
37
37
|
- **Custom transports** — Supply your own socket, for proxies, tunnels or tests
|
|
38
38
|
- **ESM with types** — Ships ES modules with full TypeScript declarations
|
|
@@ -549,7 +549,7 @@ The uid hash matters because TS3 hashes a client's public key with SHA-1 and TS6
|
|
|
549
549
|
with SHA-256 — a client that assumes either one computes an identifier the other
|
|
550
550
|
server never sends.
|
|
551
551
|
|
|
552
|
-
### Streams
|
|
552
|
+
### Streams
|
|
553
553
|
|
|
554
554
|
TeamSpeak 6 clients can share a screen, a window or a camera. `@honeybbq/teamspeak/stream`
|
|
555
555
|
does the signalling of that: it finds the streams of the clients in view, publishes one,
|
|
@@ -558,9 +558,9 @@ WebRTC, which is yours: `Streams` hands you the SDP and the ICE candidates as st
|
|
|
558
558
|
takes them back, so any WebRTC stack plugs in, in a browser, in Electron or in Node. The
|
|
559
559
|
package has no WebRTC dependency.
|
|
560
560
|
|
|
561
|
-
TeamSpeak does not document this protocol. It was
|
|
562
|
-
and
|
|
563
|
-
|
|
561
|
+
TeamSpeak does not document this protocol. It was verified against the TeamSpeak 6 server
|
|
562
|
+
6.0.0-beta13.1 and the TeamSpeak 6 client 6.0.0-beta5 (macOS), and a TeamSpeak update may
|
|
563
|
+
break it. A TeamSpeak 3 server does not answer the stream
|
|
564
564
|
commands at all, so `publish` and `watch` throw a `StreamsUnsupportedError` before sending
|
|
565
565
|
anything.
|
|
566
566
|
|
|
@@ -603,6 +603,10 @@ stream.on("request", async (request) => {
|
|
|
603
603
|
|
|
604
604
|
const pc = new RTCPeerConnection({ iceServers });
|
|
605
605
|
for (const track of capture.getTracks()) pc.addTrack(track, capture);
|
|
606
|
+
// Always offer audio, even with no track to send (see the interop notes below).
|
|
607
|
+
if (!pc.getTransceivers().some((t) => t.receiver.track.kind === "audio")) {
|
|
608
|
+
pc.addTransceiver("audio", { direction: "sendonly" });
|
|
609
|
+
}
|
|
606
610
|
await pc.setLocalDescription(await pc.createOffer());
|
|
607
611
|
|
|
608
612
|
const viewer = await request.accept(pc.localDescription!.sdp);
|
|
@@ -617,6 +621,45 @@ stream.on("request", async (request) => {
|
|
|
617
621
|
await stream.stop();
|
|
618
622
|
```
|
|
619
623
|
|
|
624
|
+
A request that nobody has answered can end: the viewer withdraws it or goes out of view, or
|
|
625
|
+
the stream ends. `request.on("closed", ({ cause }) => …)` fires then, with `"withdrawn"` or
|
|
626
|
+
`"ended"`, so a UI can drop the request without polling `request.state`; `accept` and `deny`
|
|
627
|
+
then throw. It is not emitted for a request that was accepted or denied.
|
|
628
|
+
|
|
629
|
+
#### Interop with the TeamSpeak 6 client
|
|
630
|
+
|
|
631
|
+
What follows was observed with the TeamSpeak 6 client 6.0.0-beta5 (macOS) against a
|
|
632
|
+
TeamSpeak 6 server 6.0.0-beta13.1.
|
|
633
|
+
|
|
634
|
+
- **Offer audio, always.** When you publish, the client answers an offer only if it has an
|
|
635
|
+
`m=audio` section. For a video-only offer it never answers: it shows a fallback picture and
|
|
636
|
+
keeps the "Join" button, which then does nothing, because the server already counts the
|
|
637
|
+
viewer as joined. Add a send-only audio transceiver even when there is no audio track; an
|
|
638
|
+
audio section before the video section was accepted. `accept` and `ViewerPeer.sendOffer`
|
|
639
|
+
send an offer without audio unchanged, and emit a `"warning"` event on `Streams` with the
|
|
640
|
+
code `"offer-without-audio"`.
|
|
641
|
+
- **Trim the codecs.** The client's own offers carry one video and one audio section, about
|
|
642
|
+
3.9 KB. A browser's offer with every codec is about 6 KB with audio and video, and about
|
|
643
|
+
4.8 KB for video alone, against a limit of about 9.2 KB for a command line. Narrowing the
|
|
644
|
+
codecs keeps room for the candidates and the message:
|
|
645
|
+
|
|
646
|
+
```ts
|
|
647
|
+
const video = pc.addTransceiver(track, { direction: "sendonly" });
|
|
648
|
+
const codecs = RTCRtpSender.getCapabilities("video")!.codecs;
|
|
649
|
+
video.setCodecPreferences(codecs.filter((c) => /^video\/(VP8|H264)$/.test(c.mimeType)));
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
- **Accept every request.** A viewer in the client shows "waiting" until the publisher
|
|
653
|
+
answers. When it withdraws and asks again, that is a new request, with a new `JoinRequest`.
|
|
654
|
+
- **A channel switch ends the viewing, not the stream.** The client leaves a stream it
|
|
655
|
+
watches when it changes channel, so the publisher sees that viewer leave. The server does not end a stream when its publisher or a viewer changes channel.
|
|
656
|
+
- Denying, stopping, leaving, disconnecting and several viewers at once, some of them the
|
|
657
|
+
client and some the SDK, behaved as they do between SDK clients.
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
streams.on("warning", (w) => console.warn(`${w.code}: ${w.message}`));
|
|
661
|
+
```
|
|
662
|
+
|
|
620
663
|
Things to know:
|
|
621
664
|
|
|
622
665
|
- A client may run several streams, so every stream is known by its id. `list()` is what
|
|
@@ -826,9 +869,8 @@ From 1.0 the package follows semver, as described under
|
|
|
826
869
|
event map may gain members in a minor release; give a `switch` over them a
|
|
827
870
|
default case.
|
|
828
871
|
|
|
829
|
-
An API that may still change in a minor release is marked `@experimental`
|
|
830
|
-
|
|
831
|
-
show. Today that is the whole `@honeybbq/teamspeak/stream` entry point, and the whole
|
|
872
|
+
An API that may still change in a minor release is marked `@experimental` in its TSDoc,
|
|
873
|
+
which editors and the API reference show. Today that is the whole
|
|
832
874
|
`@honeybbq/teamspeak/query` entry point, the server view (`client.view` and the
|
|
833
875
|
view events), the `previous` field of the client-left and channel-deleted
|
|
834
876
|
events, and `getServerVariables`.
|
|
@@ -1043,7 +1085,7 @@ with the same semantics, apart from what the languages make differ:
|
|
|
1043
1085
|
| `@honeybbq/teamspeak` | What every TeamSpeak connection shares: the command language, ids, errors, the typed commands, the event types and the status and reconnection types |
|
|
1044
1086
|
| `@honeybbq/teamspeak/client` | The voice client, identities, file transfers, diagnostics and its retry policy |
|
|
1045
1087
|
| `@honeybbq/teamspeak/versions` | Client versions a server accepts, for the client's `version` option; data only, one export each |
|
|
1046
|
-
| `@honeybbq/teamspeak/stream` | TeamSpeak 6 streams, the screen share: finding, publishing and watching them; signalling only, no WebRTC code
|
|
1088
|
+
| `@honeybbq/teamspeak/stream` | TeamSpeak 6 streams, the screen share: finding, publishing and watching them; signalling only, no WebRTC code |
|
|
1047
1089
|
| `@honeybbq/teamspeak/query` | The ServerQuery client, running the same typed commands over raw TCP, SSH or WebQuery; `@experimental` |
|
|
1048
1090
|
|
|
1049
1091
|
Each entry exports only its own symbols. The client entry does not re-export
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/query/lines.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/query/lines.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,qBAAa,UAAU;;IAGrB,gFAAgF;IAChF,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAWhC;CACF"}
|
package/dist/query/lines.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { trimCarriageReturns } from "./trim.js";
|
|
1
2
|
/**
|
|
2
3
|
* Splits a byte stream into the lines ServerQuery speaks.
|
|
3
4
|
*
|
|
@@ -16,10 +17,7 @@ export class LineReader {
|
|
|
16
17
|
const end = this.#pending.indexOf(0x0a);
|
|
17
18
|
if (end < 0)
|
|
18
19
|
break;
|
|
19
|
-
const line = this.#pending
|
|
20
|
-
.subarray(0, end)
|
|
21
|
-
.toString("utf8")
|
|
22
|
-
.replace(/^\r+|\r+$/g, "");
|
|
20
|
+
const line = trimCarriageReturns(this.#pending.subarray(0, end).toString("utf8"));
|
|
23
21
|
this.#pending = this.#pending.subarray(end + 1);
|
|
24
22
|
lines.push(line);
|
|
25
23
|
}
|
package/dist/query/lines.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/query/lines.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACrB,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,gFAAgF;IAChF,IAAI,CAAC,KAAiB;QACpB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,SAAS,CAAC;YACR,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,GAAG,GAAG,CAAC;gBAAE,MAAM;YACnB,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ
|
|
1
|
+
{"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/query/lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACrB,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE3B,gFAAgF;IAChF,IAAI,CAAC,KAAiB;QACpB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,SAAS,CAAC;YACR,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACxC,IAAI,GAAG,GAAG,CAAC;gBAAE,MAAM;YACnB,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;YAClF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;YAChD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trimming by index. A regular expression such as `/\/+$/` retries from every
|
|
3
|
+
* start of a long run that does not end the string, which takes quadratic time
|
|
4
|
+
* on input a server or a caller controls; these walk the string once.
|
|
5
|
+
*/
|
|
6
|
+
/** `text` without the `/` characters at its end. */
|
|
7
|
+
export declare function trimTrailingSlashes(text: string): string;
|
|
8
|
+
/** `text` without the `\r` characters at either end. */
|
|
9
|
+
export declare function trimCarriageReturns(text: string): string;
|
|
10
|
+
//# sourceMappingURL=trim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.d.ts","sourceRoot":"","sources":["../../src/query/trim.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oDAAoD;AACpD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED,wDAAwD;AACxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trimming by index. A regular expression such as `/\/+$/` retries from every
|
|
3
|
+
* start of a long run that does not end the string, which takes quadratic time
|
|
4
|
+
* on input a server or a caller controls; these walk the string once.
|
|
5
|
+
*/
|
|
6
|
+
/** `text` without the `/` characters at its end. */
|
|
7
|
+
export function trimTrailingSlashes(text) {
|
|
8
|
+
let end = text.length;
|
|
9
|
+
while (end > 0 && text.charCodeAt(end - 1) === 0x2f)
|
|
10
|
+
end--;
|
|
11
|
+
return end === text.length ? text : text.slice(0, end);
|
|
12
|
+
}
|
|
13
|
+
/** `text` without the `\r` characters at either end. */
|
|
14
|
+
export function trimCarriageReturns(text) {
|
|
15
|
+
let start = 0;
|
|
16
|
+
let end = text.length;
|
|
17
|
+
while (start < end && text.charCodeAt(start) === 0x0d)
|
|
18
|
+
start++;
|
|
19
|
+
while (end > start && text.charCodeAt(end - 1) === 0x0d)
|
|
20
|
+
end--;
|
|
21
|
+
return start === 0 && end === text.length ? text : text.slice(start, end);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=trim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trim.js","sourceRoot":"","sources":["../../src/query/trim.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,oDAAoD;AACpD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,GAAG,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;QAAE,GAAG,EAAE,CAAC;IAC3D,OAAO,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACzD,CAAC;AAED,wDAAwD;AACxD,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC;IACtB,OAAO,KAAK,GAAG,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,IAAI;QAAE,KAAK,EAAE,CAAC;IAC/D,OAAO,GAAG,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI;QAAE,GAAG,EAAE,CAAC;IAC/D,OAAO,KAAK,KAAK,CAAC,IAAI,GAAG,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5E,CAAC"}
|
package/dist/query/web.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/query/web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../../src/query/web.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1E;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;IACnD,4DAA4D;IAC5D,gBAAyB,IAAI,EAAE,MAAM,CAAuB;IAU5D,uBAAuB;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAG7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node:https";
|
|
3
3
|
import { TeamspeakError } from "@honeybbq/teamspeak";
|
|
4
4
|
import { buildCommandOrdered, parseCommand, splitCommandRows } from "../core/internal.js";
|
|
5
|
+
import { trimTrailingSlashes } from "./trim.js";
|
|
5
6
|
/**
|
|
6
7
|
* A WebQuery request that failed with an HTTP status and no TeamSpeak error in
|
|
7
8
|
* its answer: a wrong or missing api key, a server that is not a WebQuery. A
|
|
@@ -54,7 +55,7 @@ export class WebQueryTransport {
|
|
|
54
55
|
#bytesSent = 0;
|
|
55
56
|
#bytesReceived = 0;
|
|
56
57
|
constructor(options) {
|
|
57
|
-
this.#base = options.url
|
|
58
|
+
this.#base = trimTrailingSlashes(options.url);
|
|
58
59
|
if (options.guest === true) {
|
|
59
60
|
if (options.apiKey !== undefined) {
|
|
60
61
|
throw new TypeError("apiKey and guest were given together; a guest sends no api key");
|
|
@@ -129,7 +130,7 @@ export class WebQueryTransport {
|
|
|
129
130
|
return {
|
|
130
131
|
connectedAt: this.#openedAt,
|
|
131
132
|
transport: "web",
|
|
132
|
-
address: url.toString()
|
|
133
|
+
address: trimTrailingSlashes(url.toString()),
|
|
133
134
|
bytesSent: this.#bytesSent,
|
|
134
135
|
bytesReceived: this.#bytesReceived,
|
|
135
136
|
};
|
package/dist/query/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/query/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/query/web.ts"],"names":[],"mappings":"AAAA,OAAO,EA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AC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YAClC,MAAM,EAAE,GAAG,CAAC,UAAU,IAAI,CAAC;YAC3B,UAAU,EAAE,GAAG,CAAC,aAAa,IAAI,EAAE;SACpC,CAAC,CACH,CACF,CAAC;IACJ,CAAC,CACF,CAAC;IACF,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACxB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC;AAC/B,CAAC,CAAC,CAA4B,CAAC"}
|
package/dist/stream/emitter.d.ts
CHANGED
|
@@ -4,10 +4,12 @@ export declare const MAX_KEPT = 256;
|
|
|
4
4
|
/**
|
|
5
5
|
* A small event emitter whose events can wait for their first listener.
|
|
6
6
|
*
|
|
7
|
-
* The events named in `keep` are held while nobody
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* The events named in `keep` are held while nobody listens to them, before
|
|
8
|
+
* the first listener and again after the last has unsubscribed, up to 256 per
|
|
9
|
+
* event, and delivered, in order, to the next listener. Past that the oldest is
|
|
10
|
+
* dropped, and `onDrop` hears of it. That is what bridges the time between
|
|
11
|
+
* being handed an object and attaching to it, in which the server does not
|
|
12
|
+
* wait.
|
|
11
13
|
*/
|
|
12
14
|
export declare class Emitter<M extends object> {
|
|
13
15
|
#private;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/stream/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gEAAgE;AAChE,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/stream/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,gEAAgE;AAChE,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B;;;;;;;;;GASG;AACH,qBAAa,OAAO,CAAC,CAAC,SAAS,MAAM;;IAOnC,YAAY,IAAI,GAAE,aAAa,CAAC,MAAM,CAAC,CAAM,EAAE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,EAG/E;IAED,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,WAAW,CAiB9E;IAED,IAAI,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAerD;CACF"}
|
package/dist/stream/emitter.js
CHANGED
|
@@ -3,15 +3,16 @@ export const MAX_KEPT = 256;
|
|
|
3
3
|
/**
|
|
4
4
|
* A small event emitter whose events can wait for their first listener.
|
|
5
5
|
*
|
|
6
|
-
* The events named in `keep` are held while nobody
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* The events named in `keep` are held while nobody listens to them, before
|
|
7
|
+
* the first listener and again after the last has unsubscribed, up to 256 per
|
|
8
|
+
* event, and delivered, in order, to the next listener. Past that the oldest is
|
|
9
|
+
* dropped, and `onDrop` hears of it. That is what bridges the time between
|
|
10
|
+
* being handed an object and attaching to it, in which the server does not
|
|
11
|
+
* wait.
|
|
10
12
|
*/
|
|
11
13
|
export class Emitter {
|
|
12
14
|
#listeners = new Map();
|
|
13
15
|
#kept = new Map();
|
|
14
|
-
#attached = new Set();
|
|
15
16
|
#keep;
|
|
16
17
|
#onDrop;
|
|
17
18
|
constructor(keep = [], onDrop) {
|
|
@@ -20,13 +21,13 @@ export class Emitter {
|
|
|
20
21
|
}
|
|
21
22
|
on(event, listener) {
|
|
22
23
|
const stored = listener;
|
|
23
|
-
|
|
24
|
+
const before = this.#listeners.get(event) ?? [];
|
|
25
|
+
this.#listeners.set(event, [...before, stored]);
|
|
24
26
|
const unsubscribe = () => {
|
|
25
27
|
const list = this.#listeners.get(event) ?? [];
|
|
26
28
|
this.#listeners.set(event, list.filter((l) => l !== stored));
|
|
27
29
|
};
|
|
28
|
-
if (
|
|
29
|
-
this.#attached.add(event);
|
|
30
|
+
if (before.length === 0) {
|
|
30
31
|
const kept = this.#kept.get(event) ?? [];
|
|
31
32
|
this.#kept.delete(event);
|
|
32
33
|
for (const payload of kept)
|
|
@@ -37,7 +38,7 @@ export class Emitter {
|
|
|
37
38
|
emit(event, payload) {
|
|
38
39
|
const list = this.#listeners.get(event);
|
|
39
40
|
if (list === undefined || list.length === 0) {
|
|
40
|
-
if (this.#keep.has(event)
|
|
41
|
+
if (this.#keep.has(event)) {
|
|
41
42
|
const kept = this.#kept.get(event) ?? [];
|
|
42
43
|
kept.push(payload);
|
|
43
44
|
if (kept.length > MAX_KEPT) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../src/stream/emitter.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE5B
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../src/stream/emitter.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAC;AAE5B;;;;;;;;;GASG;AACH,MAAM,OAAO,OAAO;IAClB,UAAU,GAAG,IAAI,GAAG,EAA4C,CAAC;IACjE,KAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;IAC7B,KAAK,CAAuB;IAE5B,OAAO,CAAyC;IAEzD,YAAY,IAAI,GAA2B,EAAE,EAAE,MAAiC;QAC9E,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC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,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;gBACzC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACnB,IAAI,IAAI,CAAC,MAAM,GAAG,QAAQ,EAAE,CAAC;oBAC3B,IAAI,CAAC,KAAK,EAAE,CAAC;oBACb,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;gBACxB,CAAC;gBACD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC9B,CAAC;YACD,OAAO;QACT,CAAC;QACD,KAAK,MAAM,QAAQ,IAAI,IAAI;YAAE,IAAI,CAAC,QAAmC,EAAE,OAAO,CAAC,CAAC;IAClF,CAAC;CACF;AAED,qJAAqJ;AACrJ,SAAS,IAAI,CAAI,QAA8B,EAAE,OAAU;IACzD,IAAI,CAAC;QACH,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,cAAc,CAAC,GAAG,EAAE;YAClB,MAAM,KAAK,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/stream/errors.d.ts
CHANGED
|
@@ -5,8 +5,6 @@ import type { ServerFamily } from "@honeybbq/teamspeak";
|
|
|
5
5
|
* TeamSpeak 3 server answers none of the stream commands, not even with an
|
|
6
6
|
* error, so `publish` and `watch` refuse before sending rather than wait out
|
|
7
7
|
* a timeout.
|
|
8
|
-
*
|
|
9
|
-
* @beta
|
|
10
8
|
*/
|
|
11
9
|
export declare class StreamsUnsupportedError extends TeamspeakError {
|
|
12
10
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -23,8 +21,6 @@ export declare class StreamsUnsupportedError extends TeamspeakError {
|
|
|
23
21
|
* The server remembers no decision, so a client can ask again, and every ask
|
|
24
22
|
* is relayed to the publisher. A publisher that means to refuse for good can
|
|
25
23
|
* set `rememberDenied`, or leave the request unanswered.
|
|
26
|
-
*
|
|
27
|
-
* @beta
|
|
28
24
|
*/
|
|
29
25
|
export declare class StreamJoinDeniedError extends TeamspeakError {
|
|
30
26
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -40,8 +36,6 @@ export declare class StreamJoinDeniedError extends TeamspeakError {
|
|
|
40
36
|
* line of about 9.2 KB, escaped, without an answer, so the call fails before
|
|
41
37
|
* sending instead of timing out; `MAX_COMMAND_LINE_BYTES` has the exact
|
|
42
38
|
* figure. An SDP offer of a few kilobytes is far under it.
|
|
43
|
-
*
|
|
44
|
-
* @beta
|
|
45
39
|
*/
|
|
46
40
|
export declare class StreamPayloadTooLargeError extends TeamspeakError {
|
|
47
41
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -60,8 +54,6 @@ export declare class StreamPayloadTooLargeError extends TeamspeakError {
|
|
|
60
54
|
* of, and when the stream ends before its owner answers; a signalling call
|
|
61
55
|
* does when the stream ended under it. The server's
|
|
62
56
|
* own refusal, when there was one, is the `cause`.
|
|
63
|
-
*
|
|
64
|
-
* @beta
|
|
65
57
|
*/
|
|
66
58
|
export declare class StreamEndedError extends TeamspeakError {
|
|
67
59
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/stream/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/stream/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAA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,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAGnD;CACF"}
|
package/dist/stream/errors.js
CHANGED
|
@@ -4,8 +4,6 @@ import { TeamspeakError } from "@honeybbq/teamspeak";
|
|
|
4
4
|
* TeamSpeak 3 server answers none of the stream commands, not even with an
|
|
5
5
|
* error, so `publish` and `watch` refuse before sending rather than wait out
|
|
6
6
|
* a timeout.
|
|
7
|
-
*
|
|
8
|
-
* @beta
|
|
9
7
|
*/
|
|
10
8
|
export class StreamsUnsupportedError extends TeamspeakError {
|
|
11
9
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -36,8 +34,6 @@ export class StreamsUnsupportedError extends TeamspeakError {
|
|
|
36
34
|
* The server remembers no decision, so a client can ask again, and every ask
|
|
37
35
|
* is relayed to the publisher. A publisher that means to refuse for good can
|
|
38
36
|
* set `rememberDenied`, or leave the request unanswered.
|
|
39
|
-
*
|
|
40
|
-
* @beta
|
|
41
37
|
*/
|
|
42
38
|
export class StreamJoinDeniedError extends TeamspeakError {
|
|
43
39
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -67,8 +63,6 @@ export class StreamJoinDeniedError extends TeamspeakError {
|
|
|
67
63
|
* line of about 9.2 KB, escaped, without an answer, so the call fails before
|
|
68
64
|
* sending instead of timing out; `MAX_COMMAND_LINE_BYTES` has the exact
|
|
69
65
|
* figure. An SDP offer of a few kilobytes is far under it.
|
|
70
|
-
*
|
|
71
|
-
* @beta
|
|
72
66
|
*/
|
|
73
67
|
export class StreamPayloadTooLargeError extends TeamspeakError {
|
|
74
68
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -102,8 +96,6 @@ export class StreamPayloadTooLargeError extends TeamspeakError {
|
|
|
102
96
|
* of, and when the stream ends before its owner answers; a signalling call
|
|
103
97
|
* does when the stream ended under it. The server's
|
|
104
98
|
* own refusal, when there was one, is the `cause`.
|
|
105
|
-
*
|
|
106
|
-
* @beta
|
|
107
99
|
*/
|
|
108
100
|
export class StreamEndedError extends TeamspeakError {
|
|
109
101
|
/** {@inheritDoc @honeybbq/teamspeak!TeamspeakError.kind} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/stream/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/stream/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAGrD;;;;;GAKG;AACH,MAAM,OAAO,uBAAwB,SAAQ,cAAc;IACzD,4DAA4D;IAC5D,MAAM,CAAmB,IAAI,GAAW,yBAAyB,CAAC;IAClE;QACE,2EAA2E;QAC3E,uEAAuE;QACvE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE;YAC5C,KAAK,EAAE,yBAAyB;YAChC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAED,6DAA6D;IACpD,MAAM,CAAe;IAC9B,0FAA0F;IACjF,OAAO,CAAS;IAEzB,YAAY,MAAoB,EAAE,OAAe;QAC/C,KAAK,CACH,8CAA8C,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,GAC/F,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,GACpC,EAAE,CACH,CAAC;QACF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,qBAAsB,SAAQ,cAAc;IACvD,4DAA4D;IAC5D,MAAM,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,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,gBAAiB,SAAQ,cAAc;IAClD,4DAA4D;IAC5D,MAAM,CAAmB,IAAI,GAAW,kBAAkB,CAAC;IAC3D;QACE,2EAA2E;QAC3E,uEAAuE;QACvE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE;YAC5C,KAAK,EAAE,kBAAkB;YACzB,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;YAClB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAED,6BAA6B;IACpB,QAAQ,CAAS;IAE1B,YAAY,QAAgB,EAAE,OAAsB;QAClD,KAAK,CAAC,UAAU,QAAQ,6BAA6B,EAAE,OAAO,CAAC,CAAC;QAChE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF"}
|
package/dist/stream/index.d.ts
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* TeamSpeak 6 streams, the screen share: finding the streams of the clients in
|
|
3
3
|
* view, publishing one, and watching one.
|
|
4
4
|
*
|
|
5
|
-
* TeamSpeak does not document the protocol
|
|
6
|
-
* TeamSpeak 6 6.0.0-beta13.1 and
|
|
7
|
-
*
|
|
5
|
+
* TeamSpeak does not document the protocol. It was verified against the
|
|
6
|
+
* TeamSpeak 6 server 6.0.0-beta13.1 and the TeamSpeak 6 client 6.0.0-beta5, and
|
|
7
|
+
* a TeamSpeak update may break it.
|
|
8
8
|
*
|
|
9
9
|
* Only the signalling is in this package. The video itself travels over WebRTC
|
|
10
10
|
* between the publisher and each viewer, which the application brings: SDP and
|
|
@@ -19,9 +19,8 @@
|
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* @module @honeybbq/teamspeak/stream
|
|
22
|
-
* @beta
|
|
23
22
|
*/
|
|
24
23
|
export { Streams } from "./streams.js";
|
|
25
24
|
export { StreamEndedError, StreamJoinDeniedError, StreamPayloadTooLargeError, StreamsUnsupportedError, } from "./errors.js";
|
|
26
|
-
export type { IceCandidate, JoinRequest, JoinRequestState, Peer, PeerClosed, PeerCloseCause, PeerEvents, PublishedStream, PublishedStreamEvents, PublishOptions, RawSignal, StreamAccessibility, StreamEnded, StreamEndCause, StreamInfo, StreamsClient, StreamsEventMap, StreamsOptions, StreamSource, StreamStoppedEvent, StreamView, StreamViewerEvent, ViewerIdentity, ViewerPeer, WatchOptions, } from "./types.js";
|
|
25
|
+
export type { IceCandidate, JoinRequest, JoinRequestCloseCause, JoinRequestClosed, JoinRequestEvents, JoinRequestState, Peer, PeerClosed, PeerCloseCause, PeerEvents, PublishedStream, PublishedStreamEvents, PublishOptions, RawSignal, StreamAccessibility, StreamEnded, StreamEndCause, StreamInfo, StreamsClient, StreamsEventMap, StreamsOptions, StreamSource, StreamStoppedEvent, StreamView, StreamWarning, StreamWarningCode, StreamViewerEvent, ViewerIdentity, ViewerPeer, WatchOptions, } from "./types.js";
|
|
27
26
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AACrB,YAAY,EACV,YAAY,EACZ,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,IAAI,EACJ,UAAU,EACV,cAAc,EACd,UAAU,EACV,eAAe,EACf,qBAAqB,EACrB,cAAc,EACd,SAAS,EACT,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,UAAU,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAY,GACb,MAAM,YAAY,CAAC"}
|
package/dist/stream/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* TeamSpeak 6 streams, the screen share: finding the streams of the clients in
|
|
3
3
|
* view, publishing one, and watching one.
|
|
4
4
|
*
|
|
5
|
-
* TeamSpeak does not document the protocol
|
|
6
|
-
* TeamSpeak 6 6.0.0-beta13.1 and
|
|
7
|
-
*
|
|
5
|
+
* TeamSpeak does not document the protocol. It was verified against the
|
|
6
|
+
* TeamSpeak 6 server 6.0.0-beta13.1 and the TeamSpeak 6 client 6.0.0-beta5, and
|
|
7
|
+
* a TeamSpeak update may break it.
|
|
8
8
|
*
|
|
9
9
|
* Only the signalling is in this package. The video itself travels over WebRTC
|
|
10
10
|
* between the publisher and each viewer, which the application brings: SDP and
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
21
21
|
* @module @honeybbq/teamspeak/stream
|
|
22
|
-
* @beta
|
|
23
22
|
*/
|
|
24
23
|
export { Streams } from "./streams.js";
|
|
25
24
|
export { StreamEndedError, StreamJoinDeniedError, StreamPayloadTooLargeError, StreamsUnsupportedError, } from "./errors.js";
|
package/dist/stream/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,GACxB,MAAM,aAAa,CAAC"}
|
package/dist/stream/peer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ClientID, Unsubscribe } from "@honeybbq/teamspeak";
|
|
2
|
-
import type { IceCandidate, Peer, PeerClosed, PeerEvents, StreamView, ViewerPeer } from "./types.js";
|
|
2
|
+
import type { IceCandidate, Peer, PeerClosed, PeerEvents, StreamView, StreamWarning, ViewerPeer } from "./types.js";
|
|
3
3
|
/** What a peer needs of the `Streams` that made it. */
|
|
4
4
|
export interface PeerLink {
|
|
5
5
|
/** Send a signalling JSON to the other end. */
|
|
@@ -10,7 +10,11 @@ export interface PeerLink {
|
|
|
10
10
|
closed(peer: PeerImpl): void;
|
|
11
11
|
/** Something happened that nobody awaits, such as an event dropped for want of a listener. */
|
|
12
12
|
report(error: Error): void;
|
|
13
|
+
/** Something noticed that is let through; absent where nothing is checked. */
|
|
14
|
+
warn?(warning: StreamWarning): void;
|
|
13
15
|
}
|
|
16
|
+
/** The warning for an offer with no audio section. */
|
|
17
|
+
export declare function noAudioWarning(streamId: string, clientId: ClientID): StreamWarning;
|
|
14
18
|
/** One end of a stream's signalling with one other client. */
|
|
15
19
|
export declare class PeerImpl implements Peer {
|
|
16
20
|
#private;
|
|
@@ -22,6 +26,8 @@ export declare class PeerImpl implements Peer {
|
|
|
22
26
|
sendCandidate(candidate: IceCandidate): Promise<void>;
|
|
23
27
|
sendSignal(cmd: string, args: unknown): Promise<void>;
|
|
24
28
|
close(): Promise<void>;
|
|
29
|
+
/** Warn that an offer for this peer has no audio section. */
|
|
30
|
+
protected warnWithoutAudio(): void;
|
|
25
31
|
/** Send a message of the subclasses'. */
|
|
26
32
|
protected send(json: string): Promise<void>;
|
|
27
33
|
/** A signalling JSON from the other end. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer.d.ts","sourceRoot":"","sources":["../../src/stream/peer.ts"],"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
|
1
1
|
import { TeamspeakError } from "@honeybbq/teamspeak";
|
|
2
2
|
import { Emitter, MAX_KEPT } from "./emitter.js";
|
|
3
|
-
import { answerJson, candidateJson, encodeSignal, offerJson, parseSignal } from "./wire.js";
|
|
3
|
+
import { answerJson, candidateJson, encodeSignal, hasAudioSection, offerJson, parseSignal, } from "./wire.js";
|
|
4
|
+
/** The warning for an offer with no audio section. */
|
|
5
|
+
export function noAudioWarning(streamId, clientId) {
|
|
6
|
+
return {
|
|
7
|
+
code: "offer-without-audio",
|
|
8
|
+
streamId,
|
|
9
|
+
clientId,
|
|
10
|
+
message: `the offer for client ${clientId} has no m=audio section: the TeamSpeak 6 client does not answer an offer without audio, and its Join button then does nothing`,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
4
13
|
/** One end of a stream's signalling with one other client. */
|
|
5
14
|
export class PeerImpl {
|
|
6
15
|
streamId;
|
|
@@ -39,6 +48,10 @@ export class PeerImpl {
|
|
|
39
48
|
this.end({ cause: "closed" });
|
|
40
49
|
await this.#link.leave?.();
|
|
41
50
|
}
|
|
51
|
+
/** Warn that an offer for this peer has no audio section. */
|
|
52
|
+
warnWithoutAudio() {
|
|
53
|
+
this.#link.warn?.(noAudioWarning(this.streamId, this.clientId));
|
|
54
|
+
}
|
|
42
55
|
/** Send a message of the subclasses'. */
|
|
43
56
|
send(json) {
|
|
44
57
|
return this.#send(() => json);
|
|
@@ -80,6 +93,8 @@ export class PeerImpl {
|
|
|
80
93
|
/** The publisher's end for one accepted viewer. */
|
|
81
94
|
export class ViewerPeerImpl extends PeerImpl {
|
|
82
95
|
sendOffer(sdp) {
|
|
96
|
+
if (!hasAudioSection(sdp))
|
|
97
|
+
this.warnWithoutAudio();
|
|
83
98
|
return this.send(offerJson(sdp));
|
|
84
99
|
}
|
|
85
100
|
}
|
package/dist/stream/peer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peer.js","sourceRoot":"","sources":["../../src/stream/peer.ts"],"names":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AC,CAAC;IACnC,CAAC;CACF;AAED,oDAAoD;AACpD,MAAM,OAAO,cAAe,SAAQ,QAAQ;IACjC,KAAK,CAAS;IAEvB,YAAY,QAAgB,EAAE,QAAkB,EAAE,KAAa,EAAE,IAAc;QAC7E,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,MAAM,CAAC,GAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,CAAC;IAED,KAAK;QACH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ClientID, CommandRequest, Unsubscribe } from "@honeybbq/teamspeak";
|
|
2
2
|
import { ViewerPeerImpl } from "./peer.js";
|
|
3
|
-
import type { PublishedStream, PublishedStreamEvents, StreamEnded, StreamInfo, ViewerIdentity, ViewerPeer } from "./types.js";
|
|
3
|
+
import type { PublishedStream, PublishedStreamEvents, StreamEnded, StreamInfo, StreamWarning, ViewerIdentity, ViewerPeer } from "./types.js";
|
|
4
4
|
/** What a published stream needs of the `Streams` that made it. */
|
|
5
5
|
export interface PublishHost {
|
|
6
6
|
/**
|
|
@@ -14,6 +14,8 @@ export interface PublishHost {
|
|
|
14
14
|
isDenied(identity: ViewerIdentity): boolean;
|
|
15
15
|
/** Note that a viewer was denied. */
|
|
16
16
|
remember(identity: ViewerIdentity): void;
|
|
17
|
+
/** Pass on something noticed that is let through. */
|
|
18
|
+
warn(warning: StreamWarning): void;
|
|
17
19
|
/** Send a stream command; a stream the server does not know is a StreamEndedError. */
|
|
18
20
|
send(request: CommandRequest, streamId: string): Promise<void>;
|
|
19
21
|
/** Send `stopstream` for a stream of this client's; a stream already gone is not an error. */
|