livekit-client 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) 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 +10 -8
  4. package/dist/livekit-client.e2ee.worker.mjs.map +1 -1
  5. package/dist/livekit-client.esm.mjs +77 -52
  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 +1 -1
  10. package/dist/src/api/SignalClient.d.ts.map +1 -1
  11. package/dist/src/e2ee/worker/FrameCryptor.d.ts +1 -0
  12. package/dist/src/e2ee/worker/FrameCryptor.d.ts.map +1 -1
  13. package/dist/src/logger.d.ts +2 -2
  14. package/dist/src/logger.d.ts.map +1 -1
  15. package/dist/src/room/RTCEngine.d.ts +3 -2
  16. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  17. package/dist/src/room/Room.d.ts.map +1 -1
  18. package/dist/src/room/participant/Participant.d.ts +1 -2
  19. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  20. package/dist/src/room/participant/RemoteParticipant.d.ts +4 -0
  21. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  22. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  23. package/dist/src/room/track/utils.d.ts.map +1 -1
  24. package/dist/src/room/utils.d.ts.map +1 -1
  25. package/dist/ts4.2/src/api/SignalClient.d.ts +1 -1
  26. package/dist/ts4.2/src/e2ee/worker/FrameCryptor.d.ts +1 -0
  27. package/dist/ts4.2/src/logger.d.ts +2 -2
  28. package/dist/ts4.2/src/room/RTCEngine.d.ts +3 -2
  29. package/dist/ts4.2/src/room/participant/Participant.d.ts +1 -2
  30. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +4 -0
  31. package/package.json +1 -1
  32. package/src/api/SignalClient.ts +9 -5
  33. package/src/e2ee/worker/FrameCryptor.ts +12 -6
  34. package/src/logger.ts +21 -18
  35. package/src/room/RTCEngine.ts +12 -8
  36. package/src/room/Room.ts +15 -2
  37. package/src/room/participant/Participant.ts +0 -2
  38. package/src/room/participant/RemoteParticipant.ts +8 -0
  39. package/src/room/track/LocalVideoTrack.ts +5 -1
  40. package/src/room/track/utils.ts +18 -11
  41. package/src/room/utils.ts +3 -0
@@ -33,6 +33,14 @@ export default class RemoteParticipant extends Participant {
33
33
  return new RemoteParticipant(signalClient, pi.sid, pi.identity, pi.name, pi.metadata);
34
34
  }
35
35
 
36
+ protected get logContext() {
37
+ return {
38
+ ...super.logContext,
39
+ rpID: this.sid,
40
+ remoteParticipant: this.identity,
41
+ };
42
+ }
43
+
36
44
  /** @internal */
37
45
  constructor(
38
46
  signalClient: SignalClient,
@@ -424,7 +424,11 @@ async function setPublishingLayersForSender(
424
424
  }
425
425
 
426
426
  if (encodings.length !== senderEncodings.length) {
427
- log.warn('cannot set publishing layers, encodings mismatch');
427
+ log.warn('cannot set publishing layers, encodings mismatch', {
428
+ ...logContext,
429
+ encodings,
430
+ senderEncodings,
431
+ });
428
432
  return;
429
433
  }
430
434
 
@@ -214,20 +214,27 @@ export function getTrackPublicationInfo<T extends TrackPublication>(
214
214
  export function getLogContextFromTrack(track: Track | TrackPublication): Record<string, unknown> {
215
215
  if (track instanceof Track) {
216
216
  return {
217
- trackSid: track.sid,
218
- trackSource: track.source,
219
- trackMuted: track.isMuted,
220
- trackEnabled: track.mediaStreamTrack.enabled,
221
- trackKind: track.kind,
217
+ trackID: track.sid,
218
+ source: track.source,
219
+ muted: track.isMuted,
220
+ enabled: track.mediaStreamTrack.enabled,
221
+ kind: track.kind,
222
+ streamID: track.mediaStreamID,
223
+ streamTrackID: track.mediaStreamTrack.id,
222
224
  };
223
225
  } else {
224
226
  return {
225
- trackSid: track.trackSid,
226
- trackName: track.trackName,
227
- track: track.track ? getLogContextFromTrack(track.track) : undefined,
228
- trackEnabled: track.isEnabled,
229
- trackEncrypted: track.isEncrypted,
230
- trackMimeType: track.mimeType,
227
+ trackID: track.trackSid,
228
+ enabled: track.isEnabled,
229
+ muted: track.isMuted,
230
+ trackInfo: {
231
+ mimeType: track.mimeType,
232
+ name: track.trackName,
233
+ encrypted: track.isEncrypted,
234
+ kind: track.kind,
235
+ source: track.source,
236
+ ...(track.track ? getLogContextFromTrack(track.track) : {}),
237
+ },
231
238
  };
232
239
  }
233
240
  }
package/src/room/utils.ts CHANGED
@@ -133,6 +133,9 @@ export function supportsSetCodecPreferences(transceiver: RTCRtpTransceiver): boo
133
133
  }
134
134
 
135
135
  export function isBrowserSupported() {
136
+ if (typeof RTCPeerConnection === 'undefined') {
137
+ return false;
138
+ }
136
139
  return supportsTransceiver() || supportsAddTrack();
137
140
  }
138
141