livekit-client 2.3.2 → 2.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/dist/livekit-client.e2ee.worker.js +1 -1
  2. package/dist/livekit-client.e2ee.worker.js.map +1 -1
  3. package/dist/livekit-client.e2ee.worker.mjs +8 -6
  4. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  5. package/dist/livekit-client.esm.mjs +254 -40
  6. package/dist/livekit-client.esm.mjs.map +1 -1
  7. package/dist/livekit-client.umd.js +1 -1
  8. package/dist/livekit-client.umd.js.map +1 -1
  9. package/dist/src/api/SignalClient.d.ts +5 -2
  10. package/dist/src/api/SignalClient.d.ts.map +1 -1
  11. package/dist/src/e2ee/errors.d.ts +2 -1
  12. package/dist/src/e2ee/errors.d.ts.map +1 -1
  13. package/dist/src/e2ee/index.d.ts +1 -0
  14. package/dist/src/e2ee/index.d.ts.map +1 -1
  15. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  16. package/dist/src/logger.d.ts.map +1 -1
  17. package/dist/src/room/RTCEngine.d.ts +2 -1
  18. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  19. package/dist/src/room/Room.d.ts +1 -0
  20. package/dist/src/room/Room.d.ts.map +1 -1
  21. package/dist/src/room/errors.d.ts +5 -0
  22. package/dist/src/room/errors.d.ts.map +1 -1
  23. package/dist/src/room/events.d.ts +15 -2
  24. package/dist/src/room/events.d.ts.map +1 -1
  25. package/dist/src/room/participant/LocalParticipant.d.ts +14 -6
  26. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  27. package/dist/src/room/participant/Participant.d.ts +8 -0
  28. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  29. package/dist/src/room/timers.d.ts +4 -4
  30. package/dist/src/room/timers.d.ts.map +1 -1
  31. package/dist/src/room/track/utils.d.ts +1 -0
  32. package/dist/src/room/track/utils.d.ts.map +1 -1
  33. package/dist/ts4.2/src/api/SignalClient.d.ts +5 -2
  34. package/dist/ts4.2/src/e2ee/errors.d.ts +2 -1
  35. package/dist/ts4.2/src/e2ee/index.d.ts +1 -0
  36. package/dist/ts4.2/src/room/RTCEngine.d.ts +2 -1
  37. package/dist/ts4.2/src/room/Room.d.ts +1 -0
  38. package/dist/ts4.2/src/room/errors.d.ts +5 -0
  39. package/dist/ts4.2/src/room/events.d.ts +15 -2
  40. package/dist/ts4.2/src/room/participant/LocalParticipant.d.ts +14 -6
  41. package/dist/ts4.2/src/room/participant/Participant.d.ts +8 -0
  42. package/dist/ts4.2/src/room/timers.d.ts +4 -4
  43. package/dist/ts4.2/src/room/track/utils.d.ts +1 -0
  44. package/package.json +2 -2
  45. package/src/api/SignalClient.ts +24 -2
  46. package/src/e2ee/errors.ts +8 -1
  47. package/src/e2ee/index.ts +1 -0
  48. package/src/e2ee/worker/FrameCryptor.ts +15 -3
  49. package/src/logger.ts +4 -3
  50. package/src/room/DeviceManager.ts +1 -1
  51. package/src/room/RTCEngine.ts +3 -0
  52. package/src/room/Room.ts +4 -0
  53. package/src/room/errors.ts +11 -0
  54. package/src/room/events.ts +15 -0
  55. package/src/room/participant/LocalParticipant.ts +92 -10
  56. package/src/room/participant/Participant.ts +23 -0
  57. package/src/room/track/utils.test.ts +35 -1
  58. package/src/room/track/utils.ts +22 -0
@@ -243,3 +243,25 @@ export function getLogContextFromTrack(track: Track | TrackPublication): Record<
243
243
  export function supportsSynchronizationSources(): boolean {
244
244
  return typeof RTCRtpReceiver !== 'undefined' && 'getSynchronizationSources' in RTCRtpReceiver;
245
245
  }
246
+
247
+ export function diffAttributes(
248
+ oldValues: Record<string, string> | undefined,
249
+ newValues: Record<string, string> | undefined,
250
+ ) {
251
+ if (oldValues === undefined) {
252
+ oldValues = {};
253
+ }
254
+ if (newValues === undefined) {
255
+ newValues = {};
256
+ }
257
+ const allKeys = [...Object.keys(newValues), ...Object.keys(oldValues)];
258
+ const diff: Record<string, string> = {};
259
+
260
+ for (const key of allKeys) {
261
+ if (oldValues[key] !== newValues[key]) {
262
+ diff[key] = newValues[key] ?? '';
263
+ }
264
+ }
265
+
266
+ return diff;
267
+ }