livekit-client 1.12.1 → 1.12.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. package/README.md +7 -3
  2. package/dist/livekit-client.e2ee.worker.js +1 -1
  3. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  4. package/dist/livekit-client.e2ee.worker.mjs +389 -301
  5. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  6. package/dist/livekit-client.esm.mjs +11279 -13498
  7. package/dist/livekit-client.esm.mjs.map +1 -1
  8. package/dist/livekit-client.umd.js +1 -1
  9. package/dist/livekit-client.umd.js.map +1 -1
  10. package/dist/src/api/SignalClient.d.ts +2 -2
  11. package/dist/src/api/SignalClient.d.ts.map +1 -1
  12. package/dist/src/connectionHelper/ConnectionCheck.d.ts +3 -2
  13. package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
  14. package/dist/src/connectionHelper/checks/Checker.d.ts +3 -2
  15. package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -1
  16. package/dist/src/connectionHelper/checks/webrtc.d.ts.map +1 -1
  17. package/dist/src/connectionHelper/checks/websocket.d.ts.map +1 -1
  18. package/dist/src/e2ee/E2eeManager.d.ts +4 -2
  19. package/dist/src/e2ee/E2eeManager.d.ts.map +1 -1
  20. package/dist/src/e2ee/KeyProvider.d.ts +4 -2
  21. package/dist/src/e2ee/KeyProvider.d.ts.map +1 -1
  22. package/dist/src/e2ee/constants.d.ts +1 -0
  23. package/dist/src/e2ee/constants.d.ts.map +1 -1
  24. package/dist/src/e2ee/types.d.ts +1 -0
  25. package/dist/src/e2ee/types.d.ts.map +1 -1
  26. package/dist/src/e2ee/worker/FrameCryptor.d.ts +4 -2
  27. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  28. package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts +14 -3
  29. package/dist/src/e2ee/worker/ParticipantKeyHandler.d.ts.map +1 -1
  30. package/dist/src/index.d.ts +1 -1
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/proto/livekit_models_pb.d.ts +1264 -0
  33. package/dist/src/proto/livekit_models_pb.d.ts.map +1 -0
  34. package/dist/src/proto/livekit_rtc_pb.d.ts +1373 -0
  35. package/dist/src/proto/livekit_rtc_pb.d.ts.map +1 -0
  36. package/dist/src/room/PCTransport.d.ts +2 -1
  37. package/dist/src/room/PCTransport.d.ts.map +1 -1
  38. package/dist/src/room/RTCEngine.d.ts +9 -5
  39. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  40. package/dist/src/room/RegionUrlProvider.d.ts +4 -1
  41. package/dist/src/room/RegionUrlProvider.d.ts.map +1 -1
  42. package/dist/src/room/Room.d.ts +15 -11
  43. package/dist/src/room/Room.d.ts.map +1 -1
  44. package/dist/src/room/participant/LocalParticipant.d.ts +2 -2
  45. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  46. package/dist/src/room/participant/Participant.d.ts +5 -3
  47. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  48. package/dist/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
  49. package/dist/src/room/participant/ParticipantTrackPermission.d.ts.map +1 -1
  50. package/dist/src/room/participant/RemoteParticipant.d.ts +2 -3
  51. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  52. package/dist/src/room/participant/publishUtils.d.ts +1 -1
  53. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  54. package/dist/src/room/timers.d.ts +5 -4
  55. package/dist/src/room/timers.d.ts.map +1 -1
  56. package/dist/src/room/track/LocalTrack.d.ts +3 -0
  57. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  58. package/dist/src/room/track/LocalTrackPublication.d.ts +1 -1
  59. package/dist/src/room/track/LocalTrackPublication.d.ts.map +1 -1
  60. package/dist/src/room/track/LocalVideoTrack.d.ts +2 -2
  61. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  62. package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
  63. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  64. package/dist/src/room/track/Track.d.ts +6 -4
  65. package/dist/src/room/track/Track.d.ts.map +1 -1
  66. package/dist/src/room/track/TrackPublication.d.ts +7 -5
  67. package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
  68. package/dist/src/room/track/create.d.ts.map +1 -1
  69. package/dist/src/room/track/options.d.ts +8 -0
  70. package/dist/src/room/track/options.d.ts.map +1 -1
  71. package/dist/src/room/track/utils.d.ts +5 -1
  72. package/dist/src/room/track/utils.d.ts.map +1 -1
  73. package/dist/src/room/utils.d.ts +3 -1
  74. package/dist/src/room/utils.d.ts.map +1 -1
  75. package/dist/src/test/mocks.d.ts +4 -3
  76. package/dist/src/test/mocks.d.ts.map +1 -1
  77. package/dist/ts4.2/src/api/SignalClient.d.ts +2 -2
  78. package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +3 -2
  79. package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +3 -2
  80. package/dist/ts4.2/src/e2ee/E2eeManager.d.ts +4 -2
  81. package/dist/ts4.2/src/e2ee/KeyProvider.d.ts +4 -2
  82. package/dist/ts4.2/src/e2ee/constants.d.ts +1 -0
  83. package/dist/ts4.2/src/e2ee/types.d.ts +1 -0
  84. package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +4 -2
  85. package/dist/ts4.2/src/e2ee/worker/ParticipantKeyHandler.d.ts +14 -3
  86. package/dist/ts4.2/src/index.d.ts +1 -1
  87. package/dist/ts4.2/src/proto/livekit_models_pb.d.ts +1264 -0
  88. package/dist/ts4.2/src/proto/livekit_rtc_pb.d.ts +1373 -0
  89. package/dist/ts4.2/src/room/PCTransport.d.ts +2 -1
  90. package/dist/ts4.2/src/room/RTCEngine.d.ts +9 -5
  91. package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +4 -1
  92. package/dist/ts4.2/src/room/Room.d.ts +15 -11
  93. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +2 -2
  94. package/dist/ts4.2/src/room/participant/Participant.d.ts +5 -3
  95. package/dist/ts4.2/src/room/participant/ParticipantTrackPermission.d.ts +1 -1
  96. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +2 -3
  97. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +1 -1
  98. package/dist/ts4.2/src/room/timers.d.ts +5 -4
  99. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -0
  100. package/dist/ts4.2/src/room/track/LocalTrackPublication.d.ts +1 -1
  101. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +2 -2
  102. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
  103. package/dist/ts4.2/src/room/track/Track.d.ts +6 -4
  104. package/dist/ts4.2/src/room/track/TrackPublication.d.ts +7 -5
  105. package/dist/ts4.2/src/room/track/options.d.ts +8 -0
  106. package/dist/ts4.2/src/room/track/utils.d.ts +5 -1
  107. package/dist/ts4.2/src/room/utils.d.ts +3 -1
  108. package/dist/ts4.2/src/test/mocks.d.ts +4 -3
  109. package/package.json +10 -10
  110. package/src/api/SignalClient.ts +104 -101
  111. package/src/connectionHelper/ConnectionCheck.ts +3 -2
  112. package/src/connectionHelper/checks/Checker.ts +3 -3
  113. package/src/connectionHelper/checks/webrtc.ts +66 -2
  114. package/src/connectionHelper/checks/websocket.ts +4 -0
  115. package/src/e2ee/E2eeManager.ts +4 -3
  116. package/src/e2ee/KeyProvider.ts +3 -2
  117. package/src/e2ee/constants.ts +4 -0
  118. package/src/e2ee/types.ts +1 -0
  119. package/src/e2ee/worker/FrameCryptor.test.ts +1 -3
  120. package/src/e2ee/worker/FrameCryptor.ts +5 -5
  121. package/src/e2ee/worker/ParticipantKeyHandler.ts +37 -6
  122. package/src/e2ee/worker/e2ee.worker.ts +1 -1
  123. package/src/index.ts +1 -1
  124. package/src/proto/livekit_models_pb.ts +2096 -0
  125. package/src/proto/livekit_rtc_pb.ts +2332 -0
  126. package/src/room/PCTransport.ts +1 -1
  127. package/src/room/RTCEngine.ts +28 -22
  128. package/src/room/RegionUrlProvider.ts +11 -2
  129. package/src/room/Room.test.ts +1 -0
  130. package/src/room/Room.ts +158 -79
  131. package/src/room/participant/LocalParticipant.ts +43 -59
  132. package/src/room/participant/Participant.ts +6 -4
  133. package/src/room/participant/ParticipantTrackPermission.ts +3 -3
  134. package/src/room/participant/RemoteParticipant.ts +5 -6
  135. package/src/room/participant/publishUtils.test.ts +1 -0
  136. package/src/room/participant/publishUtils.ts +4 -2
  137. package/src/room/track/LocalTrack.ts +24 -9
  138. package/src/room/track/LocalTrackPublication.ts +1 -1
  139. package/src/room/track/LocalVideoTrack.test.ts +2 -1
  140. package/src/room/track/LocalVideoTrack.ts +28 -26
  141. package/src/room/track/RemoteTrackPublication.ts +12 -7
  142. package/src/room/track/RemoteVideoTrack.test.ts +5 -4
  143. package/src/room/track/Track.ts +9 -6
  144. package/src/room/track/TrackPublication.ts +7 -5
  145. package/src/room/track/create.ts +9 -17
  146. package/src/room/track/facingMode.test.ts +1 -0
  147. package/src/room/track/options.ts +23 -16
  148. package/src/room/track/utils.test.ts +1 -0
  149. package/src/room/track/utils.ts +44 -2
  150. package/src/room/utils.test.ts +16 -0
  151. package/src/room/utils.ts +20 -4
  152. package/src/test/mocks.ts +7 -5
  153. package/src/utils/AsyncQueue.test.ts +1 -0
  154. package/src/utils/browserParser.test.ts +33 -3
  155. package/src/utils/browserParser.ts +1 -1
  156. package/dist/src/proto/google/protobuf/timestamp.d.ts +0 -146
  157. package/dist/src/proto/google/protobuf/timestamp.d.ts.map +0 -1
  158. package/dist/src/proto/livekit_models.d.ts +0 -2399
  159. package/dist/src/proto/livekit_models.d.ts.map +0 -1
  160. package/dist/src/proto/livekit_rtc.d.ts +0 -14352
  161. package/dist/src/proto/livekit_rtc.d.ts.map +0 -1
  162. package/dist/ts4.2/src/proto/google/protobuf/timestamp.d.ts +0 -150
  163. package/dist/ts4.2/src/proto/livekit_models.d.ts +0 -2659
  164. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +0 -15764
  165. package/src/proto/google/protobuf/timestamp.ts +0 -230
  166. package/src/proto/livekit_models.ts +0 -4006
  167. 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
- }