livekit-client 1.7.0 → 1.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/README.md +20 -1
  2. package/dist/livekit-client.esm.mjs +2240 -1067
  3. package/dist/livekit-client.esm.mjs.map +1 -1
  4. package/dist/livekit-client.umd.js +1 -1
  5. package/dist/livekit-client.umd.js.map +1 -1
  6. package/dist/src/index.d.ts +3 -1
  7. package/dist/src/index.d.ts.map +1 -1
  8. package/dist/src/options.d.ts +5 -0
  9. package/dist/src/options.d.ts.map +1 -1
  10. package/dist/src/proto/google/protobuf/timestamp.d.ts.map +1 -1
  11. package/dist/src/proto/livekit_models.d.ts +32 -0
  12. package/dist/src/proto/livekit_models.d.ts.map +1 -1
  13. package/dist/src/proto/livekit_rtc.d.ts +315 -75
  14. package/dist/src/proto/livekit_rtc.d.ts.map +1 -1
  15. package/dist/src/room/RTCEngine.d.ts +9 -1
  16. package/dist/src/room/RTCEngine.d.ts.map +1 -1
  17. package/dist/src/room/ReconnectPolicy.d.ts +1 -0
  18. package/dist/src/room/ReconnectPolicy.d.ts.map +1 -1
  19. package/dist/src/room/RegionUrlProvider.d.ts +14 -0
  20. package/dist/src/room/RegionUrlProvider.d.ts.map +1 -0
  21. package/dist/src/room/Room.d.ts +6 -1
  22. package/dist/src/room/Room.d.ts.map +1 -1
  23. package/dist/src/room/defaults.d.ts.map +1 -1
  24. package/dist/src/room/errors.d.ts +2 -1
  25. package/dist/src/room/errors.d.ts.map +1 -1
  26. package/dist/src/room/events.d.ts +15 -2
  27. package/dist/src/room/events.d.ts.map +1 -1
  28. package/dist/src/room/track/LocalAudioTrack.d.ts +1 -1
  29. package/dist/src/room/track/LocalAudioTrack.d.ts.map +1 -1
  30. package/dist/src/room/track/LocalTrack.d.ts +3 -2
  31. package/dist/src/room/track/LocalTrack.d.ts.map +1 -1
  32. package/dist/src/room/track/LocalVideoTrack.d.ts.map +1 -1
  33. package/dist/src/room/track/RemoteTrackPublication.d.ts +1 -1
  34. package/dist/src/room/track/RemoteTrackPublication.d.ts.map +1 -1
  35. package/dist/src/room/track/RemoteVideoTrack.d.ts +2 -1
  36. package/dist/src/room/track/RemoteVideoTrack.d.ts.map +1 -1
  37. package/dist/src/room/track/Track.d.ts +3 -1
  38. package/dist/src/room/track/Track.d.ts.map +1 -1
  39. package/dist/src/room/track/utils.d.ts.map +1 -1
  40. package/dist/src/room/types.d.ts +4 -0
  41. package/dist/src/room/types.d.ts.map +1 -1
  42. package/dist/src/room/utils.d.ts +4 -0
  43. package/dist/src/room/utils.d.ts.map +1 -1
  44. package/dist/ts4.2/src/index.d.ts +3 -1
  45. package/dist/ts4.2/src/options.d.ts +5 -0
  46. package/dist/ts4.2/src/proto/livekit_models.d.ts +32 -0
  47. package/dist/ts4.2/src/proto/livekit_rtc.d.ts +348 -84
  48. package/dist/ts4.2/src/room/RTCEngine.d.ts +9 -1
  49. package/dist/ts4.2/src/room/ReconnectPolicy.d.ts +1 -0
  50. package/dist/ts4.2/src/room/RegionUrlProvider.d.ts +14 -0
  51. package/dist/ts4.2/src/room/Room.d.ts +6 -1
  52. package/dist/ts4.2/src/room/errors.d.ts +2 -1
  53. package/dist/ts4.2/src/room/events.d.ts +15 -2
  54. package/dist/ts4.2/src/room/track/LocalAudioTrack.d.ts +1 -1
  55. package/dist/ts4.2/src/room/track/LocalTrack.d.ts +3 -2
  56. package/dist/ts4.2/src/room/track/RemoteTrackPublication.d.ts +1 -1
  57. package/dist/ts4.2/src/room/track/RemoteVideoTrack.d.ts +2 -1
  58. package/dist/ts4.2/src/room/track/Track.d.ts +3 -1
  59. package/dist/ts4.2/src/room/types.d.ts +4 -0
  60. package/dist/ts4.2/src/room/utils.d.ts +4 -0
  61. package/package.json +19 -19
  62. package/src/api/SignalClient.ts +4 -4
  63. package/src/index.ts +3 -0
  64. package/src/options.ts +6 -0
  65. package/src/proto/google/protobuf/timestamp.ts +15 -6
  66. package/src/proto/livekit_models.ts +903 -222
  67. package/src/proto/livekit_rtc.ts +1053 -279
  68. package/src/room/RTCEngine.ts +168 -56
  69. package/src/room/ReconnectPolicy.ts +2 -0
  70. package/src/room/RegionUrlProvider.ts +73 -0
  71. package/src/room/Room.ts +212 -133
  72. package/src/room/defaults.ts +1 -0
  73. package/src/room/errors.ts +1 -0
  74. package/src/room/events.ts +15 -0
  75. package/src/room/track/LocalAudioTrack.ts +14 -6
  76. package/src/room/track/LocalTrack.ts +22 -8
  77. package/src/room/track/LocalVideoTrack.ts +12 -6
  78. package/src/room/track/RemoteTrackPublication.ts +10 -4
  79. package/src/room/track/RemoteVideoTrack.test.ts +2 -0
  80. package/src/room/track/RemoteVideoTrack.ts +53 -9
  81. package/src/room/track/Track.ts +46 -31
  82. package/src/room/track/utils.ts +3 -2
  83. package/src/room/types.ts +6 -0
  84. package/src/room/utils.ts +53 -0
@@ -49,6 +49,11 @@ export interface InternalRoomOptions {
49
49
  * policy to use when attempting to reconnect
50
50
  */
51
51
  reconnectPolicy: ReconnectPolicy;
52
+ /**
53
+ * specifies whether the sdk should automatically disconnect the room
54
+ * on 'pagehide' and 'beforeunload' events
55
+ */
56
+ disconnectOnPageLeave: boolean;
52
57
  /**
53
58
  * @internal
54
59
  * experimental flag, introduce a delay before sending signaling messages
@@ -1,5 +1,23 @@
1
1
  import _m0 from "protobufjs/minimal";
2
2
  export declare const protobufPackage = "livekit";
3
+ export declare enum AudioCodec {
4
+ DEFAULT_AC = 0,
5
+ OPUS = 1,
6
+ AAC = 2,
7
+ UNRECOGNIZED = -1
8
+ }
9
+ export declare function audioCodecFromJSON(object: any): AudioCodec;
10
+ export declare function audioCodecToJSON(object: AudioCodec): string;
11
+ export declare enum VideoCodec {
12
+ DEFAULT_VC = 0,
13
+ H264_BASELINE = 1,
14
+ H264_MAIN = 2,
15
+ H264_HIGH = 3,
16
+ VP8 = 4,
17
+ UNRECOGNIZED = -1
18
+ }
19
+ export declare function videoCodecFromJSON(object: any): VideoCodec;
20
+ export declare function videoCodecToJSON(object: VideoCodec): string;
3
21
  export declare enum TrackType {
4
22
  AUDIO = 0,
5
23
  VIDEO = 1,
@@ -95,6 +113,8 @@ export interface ParticipantPermission {
95
113
  hidden: boolean;
96
114
  /** indicates it's a recorder instance */
97
115
  recorder: boolean;
116
+ /** indicates that participant can update own metadata */
117
+ canUpdateMetadata: boolean;
98
118
  }
99
119
  export interface ParticipantInfo {
100
120
  sid: string;
@@ -263,6 +283,8 @@ export declare enum ClientInfo_SDK {
263
283
  FLUTTER = 4,
264
284
  GO = 5,
265
285
  UNITY = 6,
286
+ REACT_NATIVE = 7,
287
+ RUST = 8,
266
288
  UNRECOGNIZED = -1
267
289
  }
268
290
  export declare function clientInfo_SDKFromJSON(object: any): ClientInfo_SDK;
@@ -464,6 +486,7 @@ export declare const ParticipantPermission: {
464
486
  canPublishSources?: TrackSource[] | undefined;
465
487
  hidden?: boolean | undefined;
466
488
  recorder?: boolean | undefined;
489
+ canUpdateMetadata?: boolean | undefined;
467
490
  } & {
468
491
  canSubscribe?: boolean | undefined;
469
492
  canPublish?: boolean | undefined;
@@ -473,6 +496,7 @@ export declare const ParticipantPermission: {
473
496
  }) | undefined;
474
497
  hidden?: boolean | undefined;
475
498
  recorder?: boolean | undefined;
499
+ canUpdateMetadata?: boolean | undefined;
476
500
  } & {
477
501
  [K_1 in Exclude<keyof I, keyof ParticipantPermission>]: never;
478
502
  }>(base?: I | undefined): ParticipantPermission;
@@ -483,6 +507,7 @@ export declare const ParticipantPermission: {
483
507
  canPublishSources?: TrackSource[] | undefined;
484
508
  hidden?: boolean | undefined;
485
509
  recorder?: boolean | undefined;
510
+ canUpdateMetadata?: boolean | undefined;
486
511
  } & {
487
512
  canSubscribe?: boolean | undefined;
488
513
  canPublish?: boolean | undefined;
@@ -492,6 +517,7 @@ export declare const ParticipantPermission: {
492
517
  }) | undefined;
493
518
  hidden?: boolean | undefined;
494
519
  recorder?: boolean | undefined;
520
+ canUpdateMetadata?: boolean | undefined;
495
521
  } & {
496
522
  [K_3 in Exclude<keyof I_1, keyof ParticipantPermission>]: never;
497
523
  }>(object: I_1): ParticipantPermission;
@@ -551,6 +577,7 @@ export declare const ParticipantInfo: {
551
577
  canPublishSources?: TrackSource[] | undefined;
552
578
  hidden?: boolean | undefined;
553
579
  recorder?: boolean | undefined;
580
+ canUpdateMetadata?: boolean | undefined;
554
581
  } | undefined;
555
582
  region?: string | undefined;
556
583
  isPublisher?: boolean | undefined;
@@ -791,6 +818,7 @@ export declare const ParticipantInfo: {
791
818
  canPublishSources?: TrackSource[] | undefined;
792
819
  hidden?: boolean | undefined;
793
820
  recorder?: boolean | undefined;
821
+ canUpdateMetadata?: boolean | undefined;
794
822
  } & {
795
823
  canSubscribe?: boolean | undefined;
796
824
  canPublish?: boolean | undefined;
@@ -800,6 +828,7 @@ export declare const ParticipantInfo: {
800
828
  }) | undefined;
801
829
  hidden?: boolean | undefined;
802
830
  recorder?: boolean | undefined;
831
+ canUpdateMetadata?: boolean | undefined;
803
832
  } & {
804
833
  [K_9 in Exclude<keyof I["permission"], keyof ParticipantPermission>]: never;
805
834
  }) | undefined;
@@ -858,6 +887,7 @@ export declare const ParticipantInfo: {
858
887
  canPublishSources?: TrackSource[] | undefined;
859
888
  hidden?: boolean | undefined;
860
889
  recorder?: boolean | undefined;
890
+ canUpdateMetadata?: boolean | undefined;
861
891
  } | undefined;
862
892
  region?: string | undefined;
863
893
  isPublisher?: boolean | undefined;
@@ -1098,6 +1128,7 @@ export declare const ParticipantInfo: {
1098
1128
  canPublishSources?: TrackSource[] | undefined;
1099
1129
  hidden?: boolean | undefined;
1100
1130
  recorder?: boolean | undefined;
1131
+ canUpdateMetadata?: boolean | undefined;
1101
1132
  } & {
1102
1133
  canSubscribe?: boolean | undefined;
1103
1134
  canPublish?: boolean | undefined;
@@ -1107,6 +1138,7 @@ export declare const ParticipantInfo: {
1107
1138
  }) | undefined;
1108
1139
  hidden?: boolean | undefined;
1109
1140
  recorder?: boolean | undefined;
1141
+ canUpdateMetadata?: boolean | undefined;
1110
1142
  } & {
1111
1143
  [K_20 in Exclude<keyof I_1["permission"], keyof ParticipantPermission>]: never;
1112
1144
  }) | undefined;