livekit-client 2.1.3 → 2.1.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.esm.mjs +95 -29
  2. package/dist/livekit-client.esm.mjs.map +1 -1
  3. package/dist/livekit-client.umd.js +1 -1
  4. package/dist/livekit-client.umd.js.map +1 -1
  5. package/dist/src/room/PCTransport.d.ts.map +1 -1
  6. package/dist/src/room/Room.d.ts.map +1 -1
  7. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  8. package/dist/src/room/participant/publishUtils.d.ts +1 -0
  9. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  10. package/dist/src/room/track/LocalTrack.d.ts +5 -1
  11. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  12. package/dist/src/room/track/LocalVideoTrack.d.ts +4 -0
  13. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  14. package/dist/src/room/track/RemoteTrack.d.ts.map +1 -1
  15. package/dist/src/room/track/options.d.ts +4 -0
  16. package/dist/src/room/track/options.d.ts.map +1 -1
  17. package/dist/src/room/track/utils.d.ts +1 -0
  18. package/dist/src/room/track/utils.d.ts.map +1 -1
  19. package/dist/src/room/types.d.ts +1 -1
  20. package/dist/src/room/types.d.ts.map +1 -1
  21. package/dist/src/room/utils.d.ts +1 -0
  22. package/dist/src/room/utils.d.ts.map +1 -1
  23. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +1 -0
  24. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +5 -1
  25. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +4 -0
  26. package/dist/ts4.2/src/room/track/options.d.ts +4 -0
  27. package/dist/ts4.2/src/room/track/utils.d.ts +1 -0
  28. package/dist/ts4.2/src/room/types.d.ts +1 -1
  29. package/dist/ts4.2/src/room/utils.d.ts +1 -0
  30. package/package.json +2 -2
  31. package/src/room/PCTransport.ts +10 -7
  32. package/src/room/Room.ts +7 -1
  33. package/src/room/participant/LocalParticipant.ts +7 -16
  34. package/src/room/participant/publishUtils.ts +20 -0
  35. package/src/room/track/LocalTrack.ts +21 -2
  36. package/src/room/track/LocalVideoTrack.ts +27 -0
  37. package/src/room/track/RemoteTrack.ts +4 -1
  38. package/src/room/track/options.ts +5 -0
  39. package/src/room/track/utils.ts +4 -0
  40. package/src/room/types.ts +3 -1
  41. package/src/room/utils.ts +4 -2
@@ -2,6 +2,7 @@ import { TrackEvent } from '../events';
2
2
  import { monitorFrequency } from '../stats';
3
3
  import type { LoggerOptions } from '../types';
4
4
  import { Track } from './Track';
5
+ import { supportsSynchronizationSources } from './utils';
5
6
 
6
7
  export default abstract class RemoteTrack<
7
8
  TrackKind extends Track.Kind = Track.Kind,
@@ -77,7 +78,9 @@ export default abstract class RemoteTrack<
77
78
  if (!this.monitorInterval) {
78
79
  this.monitorInterval = setInterval(() => this.monitorReceiver(), monitorFrequency);
79
80
  }
80
- this.registerTimeSyncUpdate();
81
+ if (supportsSynchronizationSources()) {
82
+ this.registerTimeSyncUpdate();
83
+ }
81
84
  }
82
85
 
83
86
  protected abstract monitorReceiver(): void;
@@ -64,6 +64,11 @@ export interface TrackPublishDefaults {
64
64
  */
65
65
  scalabilityMode?: ScalabilityMode;
66
66
 
67
+ /**
68
+ * degradation preference
69
+ */
70
+ degradationPreference?: RTCDegradationPreference;
71
+
67
72
  /**
68
73
  * Up to two additional simulcast layers to publish in addition to the original
69
74
  * Track.
@@ -239,3 +239,7 @@ export function getLogContextFromTrack(track: Track | TrackPublication): Record<
239
239
  };
240
240
  }
241
241
  }
242
+
243
+ export function supportsSynchronizationSources(): boolean {
244
+ return typeof RTCRtpReceiver !== 'undefined' && 'getSynchronizationSources' in RTCRtpReceiver;
245
+ }
package/src/room/types.ts CHANGED
@@ -49,7 +49,9 @@ export type SimulationScenario =
49
49
  // to disable congestion control entirely (by setting bandwidth to 100Mbps)
50
50
  | 'subscriber-bandwidth'
51
51
  | 'disconnect-signal-on-resume'
52
- | 'disconnect-signal-on-resume-no-messages';
52
+ | 'disconnect-signal-on-resume-no-messages'
53
+ // instructs the server to send a full reconnect reconnect action to the client
54
+ | 'leave-full-reconnect';
53
55
 
54
56
  export type LoggerOptions = {
55
57
  loggerName?: string;
package/src/room/utils.ts CHANGED
@@ -491,8 +491,10 @@ export function isVideoCodec(maybeCodec: string): maybeCodec is VideoCodec {
491
491
  return videoCodecs.includes(maybeCodec as VideoCodec);
492
492
  }
493
493
 
494
- export function unwrapConstraint(constraint: ConstrainDOMString): string {
495
- if (typeof constraint === 'string') {
494
+ export function unwrapConstraint(constraint: ConstrainDOMString): string;
495
+ export function unwrapConstraint(constraint: ConstrainULong): number;
496
+ export function unwrapConstraint(constraint: ConstrainDOMString | ConstrainULong): string | number {
497
+ if (typeof constraint === 'string' || typeof constraint === 'number') {
496
498
  return constraint;
497
499
  }
498
500