livekit-client 1.9.6 → 1.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. package/dist/livekit-client.esm.mjs +1318 -885
  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/index.d.ts +1 -0
  8. package/dist/src/index.d.ts.map +1 -1
  9. package/dist/src/proto/livekit_models.d.ts +108 -10
  10. package/dist/src/proto/livekit_models.d.ts.map +1 -1
  11. package/dist/src/proto/livekit_rtc.d.ts +513 -194
  12. package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
  13. package/dist/src/room/Room.d.ts +3 -2
  14. package/dist/src/room/Room.d.ts.map +1 -1
  15. package/dist/src/room/events.d.ts +5 -1
  16. package/dist/src/room/events.d.ts.map +1 -1
  17. package/dist/src/room/participant/LocalParticipant.d.ts.map +1 -1
  18. package/dist/src/room/participant/Participant.d.ts +2 -2
  19. package/dist/src/room/participant/Participant.d.ts.map +1 -1
  20. package/dist/src/room/participant/RemoteParticipant.d.ts.map +1 -1
  21. package/dist/src/room/participant/publishUtils.d.ts +8 -0
  22. package/dist/src/room/participant/publishUtils.d.ts.map +1 -1
  23. package/dist/src/room/track/LocalTrack.d.ts +32 -0
  24. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  25. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  26. package/dist/src/room/track/RemoteTrackPublication.d.ts +4 -1
  27. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  28. package/dist/src/room/track/TrackPublication.d.ts +2 -1
  29. package/dist/src/room/track/TrackPublication.d.ts.map +1 -1
  30. package/dist/src/room/track/options.d.ts +1 -1
  31. package/dist/src/room/track/options.d.ts.map +1 -1
  32. package/dist/src/room/track/processor/types.d.ts +19 -0
  33. package/dist/src/room/track/processor/types.d.ts.map +1 -0
  34. package/dist/src/utils/browserParser.d.ts.map +1 -1
  35. package/dist/ts4.2/src/api/SignalClient.d.ts +2 -1
  36. package/dist/ts4.2/src/index.d.ts +1 -0
  37. package/dist/ts4.2/src/proto/livekit_models.d.ts +126 -12
  38. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +617 -254
  39. package/dist/ts4.2/src/room/Room.d.ts +3 -2
  40. package/dist/ts4.2/src/room/events.d.ts +5 -1
  41. package/dist/ts4.2/src/room/participant/Participant.d.ts +2 -2
  42. package/dist/ts4.2/src/room/participant/publishUtils.d.ts +8 -0
  43. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +32 -0
  44. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +4 -1
  45. package/dist/ts4.2/src/room/track/TrackPublication.d.ts +2 -1
  46. package/dist/ts4.2/src/room/track/options.d.ts +1 -1
  47. package/dist/ts4.2/src/room/track/processor/types.d.ts +19 -0
  48. package/package.json +14 -13
  49. package/src/api/SignalClient.ts +8 -1
  50. package/src/index.ts +1 -0
  51. package/src/proto/google/protobuf/timestamp.ts +3 -3
  52. package/src/proto/livekit_models.ts +254 -161
  53. package/src/proto/livekit_rtc.ts +334 -180
  54. package/src/room/Room.ts +26 -1
  55. package/src/room/events.ts +4 -0
  56. package/src/room/participant/LocalParticipant.ts +23 -3
  57. package/src/room/participant/Participant.ts +2 -1
  58. package/src/room/participant/RemoteParticipant.ts +4 -1
  59. package/src/room/participant/publishUtils.ts +68 -12
  60. package/src/room/track/LocalTrack.ts +120 -16
  61. package/src/room/track/LocalVideoTrack.ts +96 -33
  62. package/src/room/track/RemoteTrackPublication.ts +8 -1
  63. package/src/room/track/Track.ts +3 -3
  64. package/src/room/track/TrackPublication.ts +2 -1
  65. package/src/room/track/options.ts +1 -1
  66. package/src/room/track/processor/types.ts +20 -0
  67. package/src/utils/browserParser.ts +1 -4
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter } from 'events';
2
2
  import type TypedEventEmitter from 'typed-emitter';
3
3
  import log from '../../logger';
4
- import type { TrackInfo } from '../../proto/livekit_models';
4
+ import type { SubscriptionError, TrackInfo } from '../../proto/livekit_models';
5
5
  import type { UpdateSubscription, UpdateTrackSettings } from '../../proto/livekit_rtc';
6
6
  import { TrackEvent } from '../events';
7
7
  import LocalAudioTrack from './LocalAudioTrack';
@@ -146,4 +146,5 @@ export type PublicationEventCallbacks = {
146
146
  status: TrackPublication.SubscriptionStatus,
147
147
  prevStatus: TrackPublication.SubscriptionStatus,
148
148
  ) => void;
149
+ subscriptionFailed: (error: SubscriptionError) => void;
149
150
  };
@@ -284,7 +284,7 @@ export function isCodecEqual(c1: string | undefined, c2: string | undefined): bo
284
284
  /**
285
285
  * scalability modes for svc, only supprot l3t3 now.
286
286
  */
287
- export type ScalabilityMode = 'L3T3';
287
+ export type ScalabilityMode = 'L3T3' | 'L3T3_KEY';
288
288
 
289
289
  export namespace AudioPresets {
290
290
  export const telephone: AudioPreset = {
@@ -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
+ }
@@ -16,10 +16,7 @@ let browserDetails: BrowserDetails | undefined;
16
16
  * @internal
17
17
  */
18
18
  export function getBrowser(userAgent?: string, force = true) {
19
- if (
20
- userAgent === undefined &&
21
- (typeof document !== 'undefined' || typeof navigator === 'undefined')
22
- ) {
19
+ if (typeof userAgent === 'undefined' && typeof navigator === 'undefined') {
23
20
  return;
24
21
  }
25
22
  const ua = (userAgent ?? navigator.userAgent).toLowerCase();