livekit-client 1.12.0 → 1.12.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +19 -1
- package/dist/livekit-client.e2ee.worker.js +1 -1
- package/dist/livekit-client.e2ee.worker.js.map +1 -1
- package/dist/livekit-client.e2ee.worker.mjs +442 -334
- package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
- package/dist/livekit-client.esm.mjs +12303 -14499
- package/dist/livekit-client.esm.mjs.map +1 -1
- package/dist/livekit-client.umd.js +1 -1
- package/dist/livekit-client.umd.js.map +1 -1
- package/dist/src/api/SignalClient.d.ts +2 -2
- package/dist/src/api/SignalClient.d.ts.map +1 -1
- package/dist/src/connectionHelper/ConnectionCheck.d.ts +3 -2
- package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/Checker.d.ts +3 -2
- package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -1
- package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
- package/dist/src/e2ee/E2eeManager.d.ts +4 -2
- package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
- package/dist/src/e2ee/KeyProvider.d.ts +4 -2
- package/dist/src/e2ee/KeyProvider.d.ts.map +1 -1
- package/dist/src/e2ee/constants.d.ts +1 -0
- package/dist/src/e2ee/constants.d.ts.map +1 -1
- package/dist/src/e2ee/types.d.ts +1 -0
- package/dist/src/e2ee/types.d.ts.map +1 -1
- package/dist/src/e2ee/worker/FrameCryptor.d.ts +4 -3
- package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +21 -2
- package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/proto/livekit_models_pb.d.ts +1264 -0
- package/dist/src/proto/livekit_models_pb.d.ts.map +1 -0
- package/dist/src/proto/livekit_rtc_pb.d.ts +1373 -0
- package/dist/src/proto/livekit_rtc_pb.d.ts.map +1 -0
- package/dist/src/room/PCTransport.d.ts +2 -1
- package/dist/src/room/PCTransport.d.ts.map +1 -1
- package/dist/src/room/RTCEngine.d.ts +9 -5
- package/dist/src/room/RTCEngine.d.ts.map +1 -1
- package/dist/src/room/RegionUrlProvider.d.ts +4 -1
- package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
- package/dist/src/room/Room.d.ts +15 -11
- package/dist/src/room/Room.d.ts.map +1 -1
- package/dist/src/room/participant/LocalParticipant.d.ts +2 -2
- package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
- package/dist/src/room/participant/Participant.d.ts +5 -3
- package/dist/src/room/participant/Participant.d.ts.map +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/src/room/participant/ParticipantTrackPermission.d.ts.map +1 -1
- package/dist/src/room/participant/RemoteParticipant.d.ts +8 -7
- package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
- package/dist/src/room/timers.d.ts +5 -4
- package/dist/src/room/timers.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrack.d.ts +3 -0
- package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/src/room/track/LocalTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/LocalVideoTrack.d.ts +2 -2
- package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/Track.d.ts +6 -4
- package/dist/src/room/track/Track.d.ts.map +1 -1
- package/dist/src/room/track/TrackPublication.d.ts +7 -5
- package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
- package/dist/src/room/track/create.d.ts.map +1 -1
- package/dist/src/room/track/options.d.ts +7 -0
- package/dist/src/room/track/options.d.ts.map +1 -1
- package/dist/src/room/track/utils.d.ts +5 -1
- package/dist/src/room/track/utils.d.ts.map +1 -1
- package/dist/src/room/utils.d.ts +3 -1
- package/dist/src/room/utils.d.ts.map +1 -1
- package/dist/src/test/mocks.d.ts +4 -3
- package/dist/src/test/mocks.d.ts.map +1 -1
- package/dist/src/utils/browserParser.d.ts +2 -0
- package/dist/src/utils/browserParser.d.ts.map +1 -1
- package/dist/ts4.2/src/api/SignalClient.d.ts +2 -2
- package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +3 -2
- package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +3 -2
- package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +4 -2
- package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +4 -2
- package/dist/ts4.2/src/e2ee/constants.d.ts +1 -0
- package/dist/ts4.2/src/e2ee/types.d.ts +1 -0
- package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +4 -3
- package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +21 -2
- package/dist/ts4.2/src/index.d.ts +1 -1
- package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +1264 -0
- package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +1373 -0
- package/dist/ts4.2/src/room/PCTransport.d.ts +2 -1
- package/dist/ts4.2/src/room/RTCEngine.d.ts +9 -5
- package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +4 -1
- package/dist/ts4.2/src/room/Room.d.ts +15 -11
- package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +2 -2
- package/dist/ts4.2/src/room/participant/Participant.d.ts +5 -3
- package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
- package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +8 -7
- package/dist/ts4.2/src/room/timers.d.ts +5 -4
- package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -0
- package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +2 -2
- package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
- package/dist/ts4.2/src/room/track/Track.d.ts +6 -4
- package/dist/ts4.2/src/room/track/TrackPublication.d.ts +7 -5
- package/dist/ts4.2/src/room/track/options.d.ts +7 -0
- package/dist/ts4.2/src/room/track/utils.d.ts +5 -1
- package/dist/ts4.2/src/room/utils.d.ts +3 -1
- package/dist/ts4.2/src/test/mocks.d.ts +4 -3
- package/dist/ts4.2/src/utils/browserParser.d.ts +2 -0
- package/package.json +10 -10
- package/src/api/SignalClient.ts +104 -101
- package/src/connectionHelper/ConnectionCheck.ts +3 -2
- package/src/connectionHelper/checks/Checker.ts +3 -3
- package/src/connectionHelper/checks/webrtc.ts +66 -2
- package/src/connectionHelper/checks/websocket.ts +4 -0
- package/src/e2ee/E2eeManager.ts +4 -3
- package/src/e2ee/KeyProvider.ts +3 -2
- package/src/e2ee/constants.ts +4 -0
- package/src/e2ee/types.ts +1 -0
- package/src/e2ee/worker/FrameCryptor.test.ts +1 -3
- package/src/e2ee/worker/FrameCryptor.ts +14 -16
- package/src/e2ee/worker/ParticipantKeyHandler.ts +48 -2
- package/src/e2ee/worker/e2ee.worker.ts +12 -6
- package/src/index.ts +1 -1
- package/src/proto/livekit_models_pb.ts +2096 -0
- package/src/proto/livekit_rtc_pb.ts +2332 -0
- package/src/room/PCTransport.ts +1 -1
- package/src/room/RTCEngine.ts +24 -18
- package/src/room/RegionUrlProvider.ts +11 -2
- package/src/room/Room.test.ts +1 -0
- package/src/room/Room.ts +175 -86
- package/src/room/participant/LocalParticipant.ts +43 -59
- package/src/room/participant/Participant.ts +6 -4
- package/src/room/participant/ParticipantTrackPermission.ts +3 -3
- package/src/room/participant/RemoteParticipant.ts +24 -21
- package/src/room/participant/publishUtils.test.ts +1 -0
- package/src/room/track/LocalTrack.ts +24 -9
- package/src/room/track/LocalTrackPublication.ts +1 -1
- package/src/room/track/LocalVideoTrack.test.ts +2 -1
- package/src/room/track/LocalVideoTrack.ts +22 -22
- package/src/room/track/RemoteTrackPublication.ts +12 -7
- package/src/room/track/RemoteVideoTrack.test.ts +5 -4
- package/src/room/track/Track.ts +9 -6
- package/src/room/track/TrackPublication.ts +7 -5
- package/src/room/track/create.ts +18 -17
- package/src/room/track/facingMode.test.ts +1 -0
- package/src/room/track/options.ts +6 -0
- package/src/room/track/utils.test.ts +1 -0
- package/src/room/track/utils.ts +44 -2
- package/src/room/utils.test.ts +16 -0
- package/src/room/utils.ts +20 -4
- package/src/test/mocks.ts +7 -5
- package/src/utils/AsyncQueue.test.ts +1 -0
- package/src/utils/browserParser.test.ts +33 -3
- package/src/utils/browserParser.ts +5 -0
- package/dist/src/proto/google/protobuf/timestamp.d.ts +0 -146
- package/dist/src/proto/google/protobuf/timestamp.d.ts.map +0 -1
- package/dist/src/proto/livekit_models.d.ts +0 -2399
- package/dist/src/proto/livekit_models.d.ts.map +0 -1
- package/dist/src/proto/livekit_rtc.d.ts +0 -14352
- package/dist/src/proto/livekit_rtc.d.ts.map +0 -1
- package/dist/ts4.2/src/proto/google/protobuf/timestamp.d.ts +0 -150
- package/dist/ts4.2/src/proto/livekit_models.d.ts +0 -2659
- package/dist/ts4.2/src/proto/livekit_rtc.d.ts +0 -15764
- package/src/proto/google/protobuf/timestamp.ts +0 -230
- package/src/proto/livekit_models.ts +0 -4006
- package/src/proto/livekit_rtc.ts +0 -4672
@@ -1,230 +0,0 @@
|
|
1
|
-
/* eslint-disable */
|
2
|
-
import Long from "long";
|
3
|
-
import _m0 from "protobufjs/minimal";
|
4
|
-
|
5
|
-
export const protobufPackage = "google.protobuf";
|
6
|
-
|
7
|
-
/**
|
8
|
-
* A Timestamp represents a point in time independent of any time zone or local
|
9
|
-
* calendar, encoded as a count of seconds and fractions of seconds at
|
10
|
-
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
|
11
|
-
* January 1, 1970, in the proleptic Gregorian calendar which extends the
|
12
|
-
* Gregorian calendar backwards to year one.
|
13
|
-
*
|
14
|
-
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
|
15
|
-
* second table is needed for interpretation, using a [24-hour linear
|
16
|
-
* smear](https://developers.google.com/time/smear).
|
17
|
-
*
|
18
|
-
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
|
19
|
-
* restricting to that range, we ensure that we can convert to and from [RFC
|
20
|
-
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
|
21
|
-
*
|
22
|
-
* # Examples
|
23
|
-
*
|
24
|
-
* Example 1: Compute Timestamp from POSIX `time()`.
|
25
|
-
*
|
26
|
-
* Timestamp timestamp;
|
27
|
-
* timestamp.set_seconds(time(NULL));
|
28
|
-
* timestamp.set_nanos(0);
|
29
|
-
*
|
30
|
-
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
|
31
|
-
*
|
32
|
-
* struct timeval tv;
|
33
|
-
* gettimeofday(&tv, NULL);
|
34
|
-
*
|
35
|
-
* Timestamp timestamp;
|
36
|
-
* timestamp.set_seconds(tv.tv_sec);
|
37
|
-
* timestamp.set_nanos(tv.tv_usec * 1000);
|
38
|
-
*
|
39
|
-
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
|
40
|
-
*
|
41
|
-
* FILETIME ft;
|
42
|
-
* GetSystemTimeAsFileTime(&ft);
|
43
|
-
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
|
44
|
-
*
|
45
|
-
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
|
46
|
-
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
|
47
|
-
* Timestamp timestamp;
|
48
|
-
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
|
49
|
-
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
|
50
|
-
*
|
51
|
-
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
|
52
|
-
*
|
53
|
-
* long millis = System.currentTimeMillis();
|
54
|
-
*
|
55
|
-
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
|
56
|
-
* .setNanos((int) ((millis % 1000) * 1000000)).build();
|
57
|
-
*
|
58
|
-
* Example 5: Compute Timestamp from Java `Instant.now()`.
|
59
|
-
*
|
60
|
-
* Instant now = Instant.now();
|
61
|
-
*
|
62
|
-
* Timestamp timestamp =
|
63
|
-
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
|
64
|
-
* .setNanos(now.getNano()).build();
|
65
|
-
*
|
66
|
-
* Example 6: Compute Timestamp from current time in Python.
|
67
|
-
*
|
68
|
-
* timestamp = Timestamp()
|
69
|
-
* timestamp.GetCurrentTime()
|
70
|
-
*
|
71
|
-
* # JSON Mapping
|
72
|
-
*
|
73
|
-
* In JSON format, the Timestamp type is encoded as a string in the
|
74
|
-
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
75
|
-
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
|
76
|
-
* where {year} is always expressed using four digits while {month}, {day},
|
77
|
-
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
78
|
-
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
79
|
-
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
80
|
-
* is required. A proto3 JSON serializer should always use UTC (as indicated by
|
81
|
-
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
82
|
-
* able to accept both UTC and other timezones (as indicated by an offset).
|
83
|
-
*
|
84
|
-
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
85
|
-
* 01:30 UTC on January 15, 2017.
|
86
|
-
*
|
87
|
-
* In JavaScript, one can convert a Date object to this format using the
|
88
|
-
* standard
|
89
|
-
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
90
|
-
* method. In Python, a standard `datetime.datetime` object can be converted
|
91
|
-
* to this format using
|
92
|
-
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
|
93
|
-
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
|
94
|
-
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
|
95
|
-
* http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
96
|
-
* ) to obtain a formatter capable of generating timestamps in this format.
|
97
|
-
*/
|
98
|
-
export interface Timestamp {
|
99
|
-
/**
|
100
|
-
* Represents seconds of UTC time since Unix epoch
|
101
|
-
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
|
102
|
-
* 9999-12-31T23:59:59Z inclusive.
|
103
|
-
*/
|
104
|
-
seconds: number;
|
105
|
-
/**
|
106
|
-
* Non-negative fractions of a second at nanosecond resolution. Negative
|
107
|
-
* second values with fractions must still have non-negative nanos values
|
108
|
-
* that count forward in time. Must be from 0 to 999,999,999
|
109
|
-
* inclusive.
|
110
|
-
*/
|
111
|
-
nanos: number;
|
112
|
-
}
|
113
|
-
|
114
|
-
function createBaseTimestamp(): Timestamp {
|
115
|
-
return { seconds: 0, nanos: 0 };
|
116
|
-
}
|
117
|
-
|
118
|
-
export const Timestamp = {
|
119
|
-
encode(message: Timestamp, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
120
|
-
if (message.seconds !== 0) {
|
121
|
-
writer.uint32(8).int64(message.seconds);
|
122
|
-
}
|
123
|
-
if (message.nanos !== 0) {
|
124
|
-
writer.uint32(16).int32(message.nanos);
|
125
|
-
}
|
126
|
-
return writer;
|
127
|
-
},
|
128
|
-
|
129
|
-
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
130
|
-
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
131
|
-
let end = length === undefined ? reader.len : reader.pos + length;
|
132
|
-
const message = createBaseTimestamp();
|
133
|
-
while (reader.pos < end) {
|
134
|
-
const tag = reader.uint32();
|
135
|
-
switch (tag >>> 3) {
|
136
|
-
case 1:
|
137
|
-
if (tag !== 8) {
|
138
|
-
break;
|
139
|
-
}
|
140
|
-
|
141
|
-
message.seconds = longToNumber(reader.int64() as Long);
|
142
|
-
continue;
|
143
|
-
case 2:
|
144
|
-
if (tag !== 16) {
|
145
|
-
break;
|
146
|
-
}
|
147
|
-
|
148
|
-
message.nanos = reader.int32();
|
149
|
-
continue;
|
150
|
-
}
|
151
|
-
if ((tag & 7) === 4 || tag === 0) {
|
152
|
-
break;
|
153
|
-
}
|
154
|
-
reader.skipType(tag & 7);
|
155
|
-
}
|
156
|
-
return message;
|
157
|
-
},
|
158
|
-
|
159
|
-
fromJSON(object: any): Timestamp {
|
160
|
-
return {
|
161
|
-
seconds: isSet(object.seconds) ? Number(object.seconds) : 0,
|
162
|
-
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
163
|
-
};
|
164
|
-
},
|
165
|
-
|
166
|
-
toJSON(message: Timestamp): unknown {
|
167
|
-
const obj: any = {};
|
168
|
-
message.seconds !== undefined && (obj.seconds = Math.round(message.seconds));
|
169
|
-
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
170
|
-
return obj;
|
171
|
-
},
|
172
|
-
|
173
|
-
create<I extends Exact<DeepPartial<Timestamp>, I>>(base?: I): Timestamp {
|
174
|
-
return Timestamp.fromPartial(base ?? {});
|
175
|
-
},
|
176
|
-
|
177
|
-
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(object: I): Timestamp {
|
178
|
-
const message = createBaseTimestamp();
|
179
|
-
message.seconds = object.seconds ?? 0;
|
180
|
-
message.nanos = object.nanos ?? 0;
|
181
|
-
return message;
|
182
|
-
},
|
183
|
-
};
|
184
|
-
|
185
|
-
declare var self: any | undefined;
|
186
|
-
declare var window: any | undefined;
|
187
|
-
declare var global: any | undefined;
|
188
|
-
var tsProtoGlobalThis: any = (() => {
|
189
|
-
if (typeof globalThis !== "undefined") {
|
190
|
-
return globalThis;
|
191
|
-
}
|
192
|
-
if (typeof self !== "undefined") {
|
193
|
-
return self;
|
194
|
-
}
|
195
|
-
if (typeof window !== "undefined") {
|
196
|
-
return window;
|
197
|
-
}
|
198
|
-
if (typeof global !== "undefined") {
|
199
|
-
return global;
|
200
|
-
}
|
201
|
-
throw "Unable to locate global object";
|
202
|
-
})();
|
203
|
-
|
204
|
-
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
205
|
-
|
206
|
-
export type DeepPartial<T> = T extends Builtin ? T
|
207
|
-
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
208
|
-
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
209
|
-
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
210
|
-
: Partial<T>;
|
211
|
-
|
212
|
-
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
213
|
-
export type Exact<P, I extends P> = P extends Builtin ? P
|
214
|
-
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
215
|
-
|
216
|
-
function longToNumber(long: Long): number {
|
217
|
-
if (long.gt(Number.MAX_SAFE_INTEGER)) {
|
218
|
-
throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
|
219
|
-
}
|
220
|
-
return long.toNumber();
|
221
|
-
}
|
222
|
-
|
223
|
-
if (_m0.util.Long !== Long) {
|
224
|
-
_m0.util.Long = Long as any;
|
225
|
-
_m0.configure();
|
226
|
-
}
|
227
|
-
|
228
|
-
function isSet(value: any): boolean {
|
229
|
-
return value !== null && value !== undefined;
|
230
|
-
}
|