livekit-client 1.9.7 → 1.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/dist/livekit-client.esm.mjs +2972 -2583
  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/api/SignalClient.d.ts +2 -1
  6. package/dist/src/api/SignalClient.d.ts.map +1 -1
  7. package/dist/src/connectionHelper/ConnectionCheck.d.ts +2 -3
  8. package/dist/src/connectionHelper/ConnectionCheck.d.ts.map +1 -1
  9. package/dist/src/connectionHelper/checks/Checker.d.ts +2 -3
  10. package/dist/src/connectionHelper/checks/Checker.d.ts.map +1 -1
  11. package/dist/src/index.d.ts +1 -0
  12. package/dist/src/index.d.ts.map +1 -1
  13. package/dist/src/proto/livekit_models.d.ts +108 -10
  14. package/dist/src/proto/livekit_models.d.ts.map +1 -1
  15. package/dist/src/proto/livekit_rtc.d.ts +513 -194
  16. package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
  17. package/dist/src/room/PCTransport.d.ts +1 -1
  18. package/dist/src/room/PCTransport.d.ts.map +1 -1
  19. package/dist/src/room/RTCEngine.d.ts +2 -4
  20. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  21. package/dist/src/room/Room.d.ts +6 -6
  22. package/dist/src/room/Room.d.ts.map +1 -1
  23. package/dist/src/room/events.d.ts +5 -1
  24. package/dist/src/room/events.d.ts.map +1 -1
  25. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  26. package/dist/src/room/participant/Participant.d.ts +4 -6
  27. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  28. package/dist/src/room/participant/RemoteParticipant.d.ts +2 -1
  29. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  30. package/dist/src/room/participant/publishUtils.d.ts +8 -0
  31. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  32. package/dist/src/room/track/LocalTrack.d.ts +33 -0
  33. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  34. package/dist/src/room/track/LocalVideoTrack.d.ts +1 -1
  35. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  36. package/dist/src/room/track/RemoteTrackPublication.d.ts +4 -1
  37. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  38. package/dist/src/room/track/RemoteVideoTrack.d.ts +1 -0
  39. package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
  40. package/dist/src/room/track/Track.d.ts +2 -4
  41. package/dist/src/room/track/Track.d.ts.map +1 -1
  42. package/dist/src/room/track/TrackPublication.d.ts +4 -5
  43. package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
  44. package/dist/src/room/track/options.d.ts +14 -5
  45. package/dist/src/room/track/options.d.ts.map +1 -1
  46. package/dist/src/room/track/processor/types.d.ts +19 -0
  47. package/dist/src/room/track/processor/types.d.ts.map +1 -0
  48. package/dist/src/room/track/types.d.ts +2 -1
  49. package/dist/src/room/track/types.d.ts.map +1 -1
  50. package/dist/src/room/utils.d.ts.map +1 -1
  51. package/dist/ts4.2/src/api/SignalClient.d.ts +2 -1
  52. package/dist/ts4.2/src/connectionHelper/ConnectionCheck.d.ts +2 -3
  53. package/dist/ts4.2/src/connectionHelper/checks/Checker.d.ts +2 -3
  54. package/dist/ts4.2/src/index.d.ts +1 -0
  55. package/dist/ts4.2/src/proto/livekit_models.d.ts +126 -12
  56. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +617 -254
  57. package/dist/ts4.2/src/room/PCTransport.d.ts +1 -1
  58. package/dist/ts4.2/src/room/RTCEngine.d.ts +2 -4
  59. package/dist/ts4.2/src/room/Room.d.ts +6 -6
  60. package/dist/ts4.2/src/room/events.d.ts +5 -1
  61. package/dist/ts4.2/src/room/participant/Participant.d.ts +4 -6
  62. package/dist/ts4.2/src/room/participant/RemoteParticipant.d.ts +2 -1
  63. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +8 -0
  64. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +33 -0
  65. package/dist/ts4.2/src/room/track/LocalVideoTrack.d.ts +1 -1
  66. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +4 -1
  67. package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +1 -0
  68. package/dist/ts4.2/src/room/track/Track.d.ts +2 -4
  69. package/dist/ts4.2/src/room/track/TrackPublication.d.ts +4 -5
  70. package/dist/ts4.2/src/room/track/options.d.ts +14 -5
  71. package/dist/ts4.2/src/room/track/processor/types.d.ts +19 -0
  72. package/dist/ts4.2/src/room/track/types.d.ts +2 -1
  73. package/package.json +14 -15
  74. package/src/api/SignalClient.ts +8 -1
  75. package/src/connectionHelper/ConnectionCheck.ts +2 -3
  76. package/src/connectionHelper/checks/Checker.ts +2 -3
  77. package/src/index.ts +1 -0
  78. package/src/logger.ts +4 -4
  79. package/src/proto/google/protobuf/timestamp.ts +3 -3
  80. package/src/proto/livekit_models.ts +254 -161
  81. package/src/proto/livekit_rtc.ts +334 -180
  82. package/src/room/PCTransport.ts +1 -1
  83. package/src/room/RTCEngine.ts +4 -4
  84. package/src/room/Room.ts +67 -12
  85. package/src/room/events.ts +4 -0
  86. package/src/room/participant/LocalParticipant.ts +33 -5
  87. package/src/room/participant/Participant.ts +4 -5
  88. package/src/room/participant/RemoteParticipant.ts +8 -4
  89. package/src/room/participant/publishUtils.ts +47 -20
  90. package/src/room/track/LocalTrack.ts +180 -57
  91. package/src/room/track/LocalVideoTrack.ts +98 -33
  92. package/src/room/track/RemoteTrackPublication.ts +8 -1
  93. package/src/room/track/RemoteVideoTrack.ts +23 -6
  94. package/src/room/track/Track.ts +5 -7
  95. package/src/room/track/TrackPublication.ts +4 -5
  96. package/src/room/track/options.ts +14 -5
  97. package/src/room/track/processor/types.ts +20 -0
  98. package/src/room/track/types.ts +2 -1
  99. package/src/room/utils.ts +6 -3
@@ -0,0 +1,20 @@
1
+ import type { Track } from '../Track';
2
+
3
+ /**
4
+ * @experimental
5
+ */
6
+ export type ProcessorOptions<T extends Track.Kind> = {
7
+ kind: T;
8
+ track: MediaStreamTrack;
9
+ element?: HTMLMediaElement;
10
+ };
11
+
12
+ /**
13
+ * @experimental
14
+ */
15
+ export interface TrackProcessor<T extends Track.Kind> {
16
+ name: string;
17
+ init: (opts: ProcessorOptions<T>) => void;
18
+ destroy: () => Promise<void>;
19
+ processedTrack?: MediaStreamTrack;
20
+ }
@@ -8,7 +8,8 @@ export type VideoTrack = RemoteVideoTrack | LocalVideoTrack;
8
8
 
9
9
  export type AdaptiveStreamSettings = {
10
10
  /**
11
- * Set a custom pixel density, defaults to 1
11
+ * Set a custom pixel density. Defaults to 2 for high density screens (3+) or
12
+ * 1 otherwise.
12
13
  * When streaming videos on a ultra high definition screen this setting
13
14
  * let's you account for the devicePixelRatio of those screens.
14
15
  * Set it to `screen` to use the actual pixel density of the screen
package/src/room/utils.ts CHANGED
@@ -261,7 +261,7 @@ export function getEmptyVideoStreamTrack() {
261
261
  if (!emptyVideoStreamTrack) {
262
262
  emptyVideoStreamTrack = createDummyVideoStreamTrack();
263
263
  }
264
- return emptyVideoStreamTrack;
264
+ return emptyVideoStreamTrack.clone();
265
265
  }
266
266
 
267
267
  export function createDummyVideoStreamTrack(
@@ -301,8 +301,11 @@ export function getEmptyAudioStreamTrack() {
301
301
  // implementation adapted from https://blog.mozilla.org/webrtc/warm-up-with-replacetrack/
302
302
  const ctx = new AudioContext();
303
303
  const oscillator = ctx.createOscillator();
304
+ const gain = ctx.createGain();
305
+ gain.gain.setValueAtTime(0, 0);
304
306
  const dst = ctx.createMediaStreamDestination();
305
- oscillator.connect(dst);
307
+ oscillator.connect(gain);
308
+ gain.connect(dst);
306
309
  oscillator.start();
307
310
  [emptyAudioStreamTrack] = dst.stream.getAudioTracks();
308
311
  if (!emptyAudioStreamTrack) {
@@ -310,7 +313,7 @@ export function getEmptyAudioStreamTrack() {
310
313
  }
311
314
  emptyAudioStreamTrack.enabled = false;
312
315
  }
313
- return emptyAudioStreamTrack;
316
+ return emptyAudioStreamTrack.clone();
314
317
  }
315
318
 
316
319
  export class Future<T> {