livekit-client 0.14.1 → 0.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/.github/workflows/{lint.yaml → test.yaml} +7 -4
  2. package/.gitmodules +3 -0
  3. package/README.md +46 -14
  4. package/dist/api/SignalClient.d.ts +7 -32
  5. package/dist/api/SignalClient.js +37 -8
  6. package/dist/api/SignalClient.js.map +1 -1
  7. package/dist/connect.d.ts +1 -1
  8. package/dist/connect.js +73 -59
  9. package/dist/connect.js.map +1 -1
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +4 -3
  12. package/dist/index.js.map +1 -1
  13. package/dist/logger.d.ts +10 -0
  14. package/dist/logger.js +15 -0
  15. package/dist/logger.js.map +1 -1
  16. package/dist/options.d.ts +83 -19
  17. package/dist/options.js +0 -10
  18. package/dist/options.js.map +1 -1
  19. package/dist/proto/livekit_models.d.ts +27 -1
  20. package/dist/proto/livekit_models.js +188 -3
  21. package/dist/proto/livekit_models.js.map +1 -1
  22. package/dist/proto/livekit_rtc.d.ts +114 -7
  23. package/dist/proto/livekit_rtc.js +783 -30
  24. package/dist/proto/livekit_rtc.js.map +1 -1
  25. package/dist/room/RTCEngine.d.ts +4 -2
  26. package/dist/room/RTCEngine.js +31 -35
  27. package/dist/room/RTCEngine.js.map +1 -1
  28. package/dist/room/Room.d.ts +16 -17
  29. package/dist/room/Room.js +125 -77
  30. package/dist/room/Room.js.map +1 -1
  31. package/dist/room/events.d.ts +115 -6
  32. package/dist/room/events.js +114 -5
  33. package/dist/room/events.js.map +1 -1
  34. package/dist/room/participant/LocalParticipant.d.ts +29 -9
  35. package/dist/room/participant/LocalParticipant.js +220 -160
  36. package/dist/room/participant/LocalParticipant.js.map +1 -1
  37. package/dist/room/participant/Participant.js +2 -1
  38. package/dist/room/participant/Participant.js.map +1 -1
  39. package/dist/room/participant/RemoteParticipant.d.ts +1 -1
  40. package/dist/room/participant/RemoteParticipant.js +8 -5
  41. package/dist/room/participant/RemoteParticipant.js.map +1 -1
  42. package/dist/room/participant/publishUtils.d.ts +11 -0
  43. package/dist/room/participant/publishUtils.js +148 -0
  44. package/dist/room/participant/publishUtils.js.map +1 -0
  45. package/dist/room/participant/publishUtils.test.d.ts +1 -0
  46. package/dist/room/participant/publishUtils.test.js +79 -0
  47. package/dist/room/participant/publishUtils.test.js.map +1 -0
  48. package/dist/room/stats.d.ts +21 -6
  49. package/dist/room/stats.js +22 -1
  50. package/dist/room/stats.js.map +1 -1
  51. package/dist/room/track/LocalAudioTrack.d.ts +8 -3
  52. package/dist/room/track/LocalAudioTrack.js +49 -3
  53. package/dist/room/track/LocalAudioTrack.js.map +1 -1
  54. package/dist/room/track/LocalTrack.d.ts +4 -3
  55. package/dist/room/track/LocalTrack.js +6 -48
  56. package/dist/room/track/LocalTrack.js.map +1 -1
  57. package/dist/room/track/LocalVideoTrack.d.ts +13 -4
  58. package/dist/room/track/LocalVideoTrack.js +150 -57
  59. package/dist/room/track/LocalVideoTrack.js.map +1 -1
  60. package/dist/room/track/LocalVideoTrack.test.d.ts +1 -0
  61. package/dist/room/track/LocalVideoTrack.test.js +68 -0
  62. package/dist/room/track/LocalVideoTrack.test.js.map +1 -0
  63. package/dist/room/track/RemoteAudioTrack.d.ts +7 -0
  64. package/dist/room/track/RemoteAudioTrack.js +61 -0
  65. package/dist/room/track/RemoteAudioTrack.js.map +1 -1
  66. package/dist/room/track/RemoteTrackPublication.d.ts +2 -3
  67. package/dist/room/track/RemoteTrackPublication.js +11 -10
  68. package/dist/room/track/RemoteTrackPublication.js.map +1 -1
  69. package/dist/room/track/RemoteVideoTrack.d.ts +10 -6
  70. package/dist/room/track/RemoteVideoTrack.js +97 -44
  71. package/dist/room/track/RemoteVideoTrack.js.map +1 -1
  72. package/dist/room/track/Track.d.ts +10 -2
  73. package/dist/room/track/Track.js +29 -2
  74. package/dist/room/track/Track.js.map +1 -1
  75. package/dist/room/track/create.d.ts +4 -6
  76. package/dist/room/track/create.js +10 -57
  77. package/dist/room/track/create.js.map +1 -1
  78. package/dist/room/track/defaults.d.ts +4 -0
  79. package/dist/room/track/defaults.js +21 -0
  80. package/dist/room/track/defaults.js.map +1 -0
  81. package/dist/room/track/options.d.ts +15 -65
  82. package/dist/room/track/options.js +14 -13
  83. package/dist/room/track/options.js.map +1 -1
  84. package/dist/room/track/utils.d.ts +3 -0
  85. package/dist/room/track/utils.js +68 -0
  86. package/dist/room/track/utils.js.map +1 -0
  87. package/dist/room/track/utils.test.d.ts +1 -0
  88. package/dist/room/track/utils.test.js +85 -0
  89. package/dist/room/track/utils.test.js.map +1 -0
  90. package/dist/room/utils.d.ts +7 -1
  91. package/dist/room/utils.js +29 -6
  92. package/dist/room/utils.js.map +1 -1
  93. package/dist/version.d.ts +1 -1
  94. package/dist/version.js +1 -1
  95. package/example/index.html +194 -178
  96. package/example/sample.ts +454 -325
  97. package/example/styles.css +144 -0
  98. package/example/webpack.config.js +1 -1
  99. package/jest.config.js +6 -0
  100. package/package.json +10 -7
  101. package/tsconfig.eslint.json +8 -1
  102. package/dist/room/defaults.d.ts +0 -5
  103. package/dist/room/defaults.js +0 -32
  104. package/dist/room/defaults.js.map +0 -1
package/dist/options.d.ts CHANGED
@@ -1,4 +1,59 @@
1
- import { CreateLocalTracksOptions, TrackCaptureDefaults, TrackPublishDefaults } from './room/track/options';
1
+ import { LogLevel, LogLevelDesc } from './logger';
2
+ import { AudioCaptureOptions, CreateLocalTracksOptions, TrackPublishDefaults, VideoCaptureOptions } from './room/track/options';
3
+ /**
4
+ * Options for when creating a new room
5
+ */
6
+ export interface RoomOptions {
7
+ /**
8
+ * AdaptiveStream lets LiveKit automatically manage quality of subscribed
9
+ * video tracks to optimize for bandwidth and CPU.
10
+ * When attached video elements are visible, it'll choose an appropriate
11
+ * resolution based on the size of largest video element it's attached to.
12
+ *
13
+ * When none of the video elements are visible, it'll temporarily pause
14
+ * the data flow until they are visible again.
15
+ */
16
+ adaptiveStream?: boolean;
17
+ /**
18
+ * enable Dynacast, off by default. With Dynacast dynamically pauses
19
+ * video layers that are not being consumed by any subscribers, significantly
20
+ * reducing publishing CPU and bandwidth usage.
21
+ */
22
+ dynacast?: boolean;
23
+ /**
24
+ * default options to use when capturing user's audio
25
+ */
26
+ audioCaptureDefaults?: AudioCaptureOptions;
27
+ /**
28
+ * default options to use when capturing user's video
29
+ */
30
+ videoCaptureDefaults?: VideoCaptureOptions;
31
+ /**
32
+ * default options to use when publishing tracks
33
+ */
34
+ publishDefaults?: TrackPublishDefaults;
35
+ /**
36
+ * should local tracks be stopped when they are unpublished. defaults to true
37
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
38
+ */
39
+ stopLocalTrackOnUnpublish?: boolean;
40
+ /**
41
+ * @internal
42
+ * experimental flag, disable client managed layer pause when publishing capability is limited
43
+ */
44
+ expDisableLayerPause?: boolean;
45
+ }
46
+ /**
47
+ * Options for Room.connect()
48
+ */
49
+ export interface RoomConnectOptions {
50
+ /** autosubscribe to room tracks after joining, defaults to true */
51
+ autoSubscribe?: boolean;
52
+ /**
53
+ * use to override any RTCConfiguration options.
54
+ */
55
+ rtcConfig?: RTCConfiguration;
56
+ }
2
57
  /**
3
58
  * if video or audio tracks are created as part of [[connect]], it'll automatically
4
59
  * publish those tracks to the room.
@@ -7,17 +62,20 @@ export interface ConnectOptions extends CreateLocalTracksOptions {
7
62
  /** autosubscribe to room tracks upon connect, defaults to true */
8
63
  autoSubscribe?: boolean;
9
64
  /**
10
- * automatically manage quality of subscribed video tracks, subscribe to the
11
- * an appropriate resolution based on the size of the video elements that tracks
12
- * are attached to.
13
- *
14
- * also observes the visibility of attached tracks and pauses receiving data
15
- * if they are not visible.
16
- *
65
+ * see [[RoomOptions.adaptiveStream]]
66
+ */
67
+ adaptiveStream?: boolean;
68
+ /**
69
+ * alias for adaptiveStream
70
+ * @deprecated
17
71
  */
18
72
  autoManageVideo?: boolean;
73
+ /**
74
+ * see [[RoomOptions.dynacast]]
75
+ */
76
+ dynacast?: boolean;
19
77
  /** configures LiveKit internal log level */
20
- logLevel?: LogLevel;
78
+ logLevel?: LogLevel | LogLevelDesc;
21
79
  /**
22
80
  * set ICE servers. When deployed correctly, LiveKit automatically uses the built-in TURN servers
23
81
  */
@@ -39,19 +97,25 @@ export interface ConnectOptions extends CreateLocalTracksOptions {
39
97
  */
40
98
  video?: boolean;
41
99
  /**
42
- * default options to use when capturing user media
100
+ * default options to use when capturing user's audio
101
+ */
102
+ audioCaptureDefaults?: AudioCaptureOptions;
103
+ /**
104
+ * default options to use when capturing user's video
43
105
  */
44
- captureDefaults?: TrackCaptureDefaults;
106
+ videoCaptureDefaults?: VideoCaptureOptions;
45
107
  /**
46
108
  * default options to use when publishing tracks
47
109
  */
48
110
  publishDefaults?: TrackPublishDefaults;
49
- }
50
- export declare enum LogLevel {
51
- trace = "trace",
52
- debug = "debug",
53
- info = "info",
54
- warn = "warn",
55
- error = "error",
56
- silent = "silent"
111
+ /**
112
+ * should local tracks be stopped when they are unpublished. defaults to true
113
+ * set this to false if you would prefer to clean up unpublished local tracks manually.
114
+ */
115
+ stopLocalTrackOnUnpublish?: boolean;
116
+ /**
117
+ * @internal
118
+ * experimental flag, disable client managed layer pause when publishing capability is limited
119
+ */
120
+ expDisableLayerPause?: boolean;
57
121
  }
package/dist/options.js CHANGED
@@ -1,13 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogLevel = void 0;
4
- var LogLevel;
5
- (function (LogLevel) {
6
- LogLevel["trace"] = "trace";
7
- LogLevel["debug"] = "debug";
8
- LogLevel["info"] = "info";
9
- LogLevel["warn"] = "warn";
10
- LogLevel["error"] = "error";
11
- LogLevel["silent"] = "silent";
12
- })(LogLevel = exports.LogLevel || (exports.LogLevel = {}));
13
3
  //# sourceMappingURL=options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":";;;AA6DA,IAAY,QAOX;AAPD,WAAY,QAAQ;IAClB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,yBAAa,CAAA;IACb,2BAAe,CAAA;IACf,6BAAiB,CAAA;AACnB,CAAC,EAPW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAOnB"}
1
+ {"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":""}
@@ -18,6 +18,14 @@ export declare enum TrackSource {
18
18
  }
19
19
  export declare function trackSourceFromJSON(object: any): TrackSource;
20
20
  export declare function trackSourceToJSON(object: TrackSource): string;
21
+ export declare enum VideoQuality {
22
+ LOW = 0,
23
+ MEDIUM = 1,
24
+ HIGH = 2,
25
+ UNRECOGNIZED = -1
26
+ }
27
+ export declare function videoQualityFromJSON(object: any): VideoQuality;
28
+ export declare function videoQualityToJSON(object: VideoQuality): string;
21
29
  export declare enum ConnectionQuality {
22
30
  POOR = 0,
23
31
  GOOD = 1,
@@ -36,6 +44,7 @@ export interface Room {
36
44
  enabledCodecs: Codec[];
37
45
  metadata: string;
38
46
  numParticipants: number;
47
+ activeRecording: boolean;
39
48
  }
40
49
  export interface Codec {
41
50
  mime: string;
@@ -49,8 +58,8 @@ export interface ParticipantInfo {
49
58
  metadata: string;
50
59
  /** timestamp when participant joined room, in seconds */
51
60
  joinedAt: number;
52
- /** hidden participant (used for recording) */
53
61
  hidden: boolean;
62
+ recorder: boolean;
54
63
  }
55
64
  export declare enum ParticipantInfo_State {
56
65
  /** JOINING - websocket' connected, but not offered yet */
@@ -83,6 +92,16 @@ export interface TrackInfo {
83
92
  disableDtx: boolean;
84
93
  /** source of media */
85
94
  source: TrackSource;
95
+ layers: VideoLayer[];
96
+ }
97
+ /** provide information about available spatial layers */
98
+ export interface VideoLayer {
99
+ /** for tracks with a single layer, this should be HIGH */
100
+ quality: VideoQuality;
101
+ width: number;
102
+ height: number;
103
+ /** target bitrate, server will measure actual */
104
+ bitrate: number;
86
105
  }
87
106
  /** new DataPacket API */
88
107
  export interface DataPacket {
@@ -143,6 +162,13 @@ export declare const TrackInfo: {
143
162
  toJSON(message: TrackInfo): unknown;
144
163
  fromPartial(object: DeepPartial<TrackInfo>): TrackInfo;
145
164
  };
165
+ export declare const VideoLayer: {
166
+ encode(message: VideoLayer, writer?: _m0.Writer): _m0.Writer;
167
+ decode(input: _m0.Reader | Uint8Array, length?: number | undefined): VideoLayer;
168
+ fromJSON(object: any): VideoLayer;
169
+ toJSON(message: VideoLayer): unknown;
170
+ fromPartial(object: DeepPartial<VideoLayer>): VideoLayer;
171
+ };
146
172
  export declare const DataPacket: {
147
173
  encode(message: DataPacket, writer?: _m0.Writer): _m0.Writer;
148
174
  decode(input: _m0.Reader | Uint8Array, length?: number | undefined): DataPacket;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
6
+ exports.UserPacket = exports.SpeakerInfo = exports.ActiveSpeakerUpdate = exports.DataPacket = exports.VideoLayer = exports.TrackInfo = exports.ParticipantInfo = exports.Codec = exports.Room = exports.dataPacket_KindToJSON = exports.dataPacket_KindFromJSON = exports.DataPacket_Kind = exports.participantInfo_StateToJSON = exports.participantInfo_StateFromJSON = exports.ParticipantInfo_State = exports.connectionQualityToJSON = exports.connectionQualityFromJSON = exports.ConnectionQuality = exports.videoQualityToJSON = exports.videoQualityFromJSON = exports.VideoQuality = exports.trackSourceToJSON = exports.trackSourceFromJSON = exports.TrackSource = exports.trackTypeToJSON = exports.trackTypeFromJSON = exports.TrackType = exports.protobufPackage = void 0;
7
7
  /* eslint-disable */
8
8
  const long_1 = __importDefault(require("long"));
9
9
  const minimal_1 = __importDefault(require("protobufjs/minimal"));
@@ -96,6 +96,44 @@ function trackSourceToJSON(object) {
96
96
  }
97
97
  }
98
98
  exports.trackSourceToJSON = trackSourceToJSON;
99
+ var VideoQuality;
100
+ (function (VideoQuality) {
101
+ VideoQuality[VideoQuality["LOW"] = 0] = "LOW";
102
+ VideoQuality[VideoQuality["MEDIUM"] = 1] = "MEDIUM";
103
+ VideoQuality[VideoQuality["HIGH"] = 2] = "HIGH";
104
+ VideoQuality[VideoQuality["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
105
+ })(VideoQuality = exports.VideoQuality || (exports.VideoQuality = {}));
106
+ function videoQualityFromJSON(object) {
107
+ switch (object) {
108
+ case 0:
109
+ case "LOW":
110
+ return VideoQuality.LOW;
111
+ case 1:
112
+ case "MEDIUM":
113
+ return VideoQuality.MEDIUM;
114
+ case 2:
115
+ case "HIGH":
116
+ return VideoQuality.HIGH;
117
+ case -1:
118
+ case "UNRECOGNIZED":
119
+ default:
120
+ return VideoQuality.UNRECOGNIZED;
121
+ }
122
+ }
123
+ exports.videoQualityFromJSON = videoQualityFromJSON;
124
+ function videoQualityToJSON(object) {
125
+ switch (object) {
126
+ case VideoQuality.LOW:
127
+ return "LOW";
128
+ case VideoQuality.MEDIUM:
129
+ return "MEDIUM";
130
+ case VideoQuality.HIGH:
131
+ return "HIGH";
132
+ default:
133
+ return "UNKNOWN";
134
+ }
135
+ }
136
+ exports.videoQualityToJSON = videoQualityToJSON;
99
137
  var ConnectionQuality;
100
138
  (function (ConnectionQuality) {
101
139
  ConnectionQuality[ConnectionQuality["POOR"] = 0] = "POOR";
@@ -223,6 +261,7 @@ const baseRoom = {
223
261
  turnPassword: "",
224
262
  metadata: "",
225
263
  numParticipants: 0,
264
+ activeRecording: false,
226
265
  };
227
266
  exports.Room = {
228
267
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -253,6 +292,9 @@ exports.Room = {
253
292
  if (message.numParticipants !== 0) {
254
293
  writer.uint32(72).uint32(message.numParticipants);
255
294
  }
295
+ if (message.activeRecording === true) {
296
+ writer.uint32(80).bool(message.activeRecording);
297
+ }
256
298
  return writer;
257
299
  },
258
300
  decode(input, length) {
@@ -290,6 +332,9 @@ exports.Room = {
290
332
  case 9:
291
333
  message.numParticipants = reader.uint32();
292
334
  break;
335
+ case 10:
336
+ message.activeRecording = reader.bool();
337
+ break;
293
338
  default:
294
339
  reader.skipType(tag & 7);
295
340
  break;
@@ -355,6 +400,13 @@ exports.Room = {
355
400
  else {
356
401
  message.numParticipants = 0;
357
402
  }
403
+ if (object.activeRecording !== undefined &&
404
+ object.activeRecording !== null) {
405
+ message.activeRecording = Boolean(object.activeRecording);
406
+ }
407
+ else {
408
+ message.activeRecording = false;
409
+ }
358
410
  return message;
359
411
  },
360
412
  toJSON(message) {
@@ -378,10 +430,12 @@ exports.Room = {
378
430
  message.metadata !== undefined && (obj.metadata = message.metadata);
379
431
  message.numParticipants !== undefined &&
380
432
  (obj.numParticipants = message.numParticipants);
433
+ message.activeRecording !== undefined &&
434
+ (obj.activeRecording = message.activeRecording);
381
435
  return obj;
382
436
  },
383
437
  fromPartial(object) {
384
- var _a, _b, _c, _d, _e, _f, _g, _h;
438
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
385
439
  const message = Object.assign({}, baseRoom);
386
440
  message.sid = (_a = object.sid) !== null && _a !== void 0 ? _a : "";
387
441
  message.name = (_b = object.name) !== null && _b !== void 0 ? _b : "";
@@ -397,6 +451,7 @@ exports.Room = {
397
451
  }
398
452
  message.metadata = (_g = object.metadata) !== null && _g !== void 0 ? _g : "";
399
453
  message.numParticipants = (_h = object.numParticipants) !== null && _h !== void 0 ? _h : 0;
454
+ message.activeRecording = (_j = object.activeRecording) !== null && _j !== void 0 ? _j : false;
400
455
  return message;
401
456
  },
402
457
  };
@@ -468,6 +523,7 @@ const baseParticipantInfo = {
468
523
  metadata: "",
469
524
  joinedAt: 0,
470
525
  hidden: false,
526
+ recorder: false,
471
527
  };
472
528
  exports.ParticipantInfo = {
473
529
  encode(message, writer = minimal_1.default.Writer.create()) {
@@ -492,6 +548,9 @@ exports.ParticipantInfo = {
492
548
  if (message.hidden === true) {
493
549
  writer.uint32(56).bool(message.hidden);
494
550
  }
551
+ if (message.recorder === true) {
552
+ writer.uint32(64).bool(message.recorder);
553
+ }
495
554
  return writer;
496
555
  },
497
556
  decode(input, length) {
@@ -523,6 +582,9 @@ exports.ParticipantInfo = {
523
582
  case 7:
524
583
  message.hidden = reader.bool();
525
584
  break;
585
+ case 8:
586
+ message.recorder = reader.bool();
587
+ break;
526
588
  default:
527
589
  reader.skipType(tag & 7);
528
590
  break;
@@ -574,6 +636,12 @@ exports.ParticipantInfo = {
574
636
  else {
575
637
  message.hidden = false;
576
638
  }
639
+ if (object.recorder !== undefined && object.recorder !== null) {
640
+ message.recorder = Boolean(object.recorder);
641
+ }
642
+ else {
643
+ message.recorder = false;
644
+ }
577
645
  return message;
578
646
  },
579
647
  toJSON(message) {
@@ -591,10 +659,11 @@ exports.ParticipantInfo = {
591
659
  message.metadata !== undefined && (obj.metadata = message.metadata);
592
660
  message.joinedAt !== undefined && (obj.joinedAt = message.joinedAt);
593
661
  message.hidden !== undefined && (obj.hidden = message.hidden);
662
+ message.recorder !== undefined && (obj.recorder = message.recorder);
594
663
  return obj;
595
664
  },
596
665
  fromPartial(object) {
597
- var _a, _b, _c, _d, _e, _f;
666
+ var _a, _b, _c, _d, _e, _f, _g;
598
667
  const message = Object.assign({}, baseParticipantInfo);
599
668
  message.sid = (_a = object.sid) !== null && _a !== void 0 ? _a : "";
600
669
  message.identity = (_b = object.identity) !== null && _b !== void 0 ? _b : "";
@@ -608,6 +677,7 @@ exports.ParticipantInfo = {
608
677
  message.metadata = (_d = object.metadata) !== null && _d !== void 0 ? _d : "";
609
678
  message.joinedAt = (_e = object.joinedAt) !== null && _e !== void 0 ? _e : 0;
610
679
  message.hidden = (_f = object.hidden) !== null && _f !== void 0 ? _f : false;
680
+ message.recorder = (_g = object.recorder) !== null && _g !== void 0 ? _g : false;
611
681
  return message;
612
682
  },
613
683
  };
@@ -651,12 +721,16 @@ exports.TrackInfo = {
651
721
  if (message.source !== 0) {
652
722
  writer.uint32(72).int32(message.source);
653
723
  }
724
+ for (const v of message.layers) {
725
+ exports.VideoLayer.encode(v, writer.uint32(82).fork()).ldelim();
726
+ }
654
727
  return writer;
655
728
  },
656
729
  decode(input, length) {
657
730
  const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
658
731
  let end = length === undefined ? reader.len : reader.pos + length;
659
732
  const message = Object.assign({}, baseTrackInfo);
733
+ message.layers = [];
660
734
  while (reader.pos < end) {
661
735
  const tag = reader.uint32();
662
736
  switch (tag >>> 3) {
@@ -687,6 +761,9 @@ exports.TrackInfo = {
687
761
  case 9:
688
762
  message.source = reader.int32();
689
763
  break;
764
+ case 10:
765
+ message.layers.push(exports.VideoLayer.decode(reader, reader.uint32()));
766
+ break;
690
767
  default:
691
768
  reader.skipType(tag & 7);
692
769
  break;
@@ -696,6 +773,7 @@ exports.TrackInfo = {
696
773
  },
697
774
  fromJSON(object) {
698
775
  const message = Object.assign({}, baseTrackInfo);
776
+ message.layers = [];
699
777
  if (object.sid !== undefined && object.sid !== null) {
700
778
  message.sid = String(object.sid);
701
779
  }
@@ -750,6 +828,11 @@ exports.TrackInfo = {
750
828
  else {
751
829
  message.source = 0;
752
830
  }
831
+ if (object.layers !== undefined && object.layers !== null) {
832
+ for (const e of object.layers) {
833
+ message.layers.push(exports.VideoLayer.fromJSON(e));
834
+ }
835
+ }
753
836
  return message;
754
837
  },
755
838
  toJSON(message) {
@@ -764,6 +847,12 @@ exports.TrackInfo = {
764
847
  message.disableDtx !== undefined && (obj.disableDtx = message.disableDtx);
765
848
  message.source !== undefined &&
766
849
  (obj.source = trackSourceToJSON(message.source));
850
+ if (message.layers) {
851
+ obj.layers = message.layers.map((e) => e ? exports.VideoLayer.toJSON(e) : undefined);
852
+ }
853
+ else {
854
+ obj.layers = [];
855
+ }
767
856
  return obj;
768
857
  },
769
858
  fromPartial(object) {
@@ -778,6 +867,102 @@ exports.TrackInfo = {
778
867
  message.simulcast = (_g = object.simulcast) !== null && _g !== void 0 ? _g : false;
779
868
  message.disableDtx = (_h = object.disableDtx) !== null && _h !== void 0 ? _h : false;
780
869
  message.source = (_j = object.source) !== null && _j !== void 0 ? _j : 0;
870
+ message.layers = [];
871
+ if (object.layers !== undefined && object.layers !== null) {
872
+ for (const e of object.layers) {
873
+ message.layers.push(exports.VideoLayer.fromPartial(e));
874
+ }
875
+ }
876
+ return message;
877
+ },
878
+ };
879
+ const baseVideoLayer = { quality: 0, width: 0, height: 0, bitrate: 0 };
880
+ exports.VideoLayer = {
881
+ encode(message, writer = minimal_1.default.Writer.create()) {
882
+ if (message.quality !== 0) {
883
+ writer.uint32(8).int32(message.quality);
884
+ }
885
+ if (message.width !== 0) {
886
+ writer.uint32(16).uint32(message.width);
887
+ }
888
+ if (message.height !== 0) {
889
+ writer.uint32(24).uint32(message.height);
890
+ }
891
+ if (message.bitrate !== 0) {
892
+ writer.uint32(32).uint32(message.bitrate);
893
+ }
894
+ return writer;
895
+ },
896
+ decode(input, length) {
897
+ const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
898
+ let end = length === undefined ? reader.len : reader.pos + length;
899
+ const message = Object.assign({}, baseVideoLayer);
900
+ while (reader.pos < end) {
901
+ const tag = reader.uint32();
902
+ switch (tag >>> 3) {
903
+ case 1:
904
+ message.quality = reader.int32();
905
+ break;
906
+ case 2:
907
+ message.width = reader.uint32();
908
+ break;
909
+ case 3:
910
+ message.height = reader.uint32();
911
+ break;
912
+ case 4:
913
+ message.bitrate = reader.uint32();
914
+ break;
915
+ default:
916
+ reader.skipType(tag & 7);
917
+ break;
918
+ }
919
+ }
920
+ return message;
921
+ },
922
+ fromJSON(object) {
923
+ const message = Object.assign({}, baseVideoLayer);
924
+ if (object.quality !== undefined && object.quality !== null) {
925
+ message.quality = videoQualityFromJSON(object.quality);
926
+ }
927
+ else {
928
+ message.quality = 0;
929
+ }
930
+ if (object.width !== undefined && object.width !== null) {
931
+ message.width = Number(object.width);
932
+ }
933
+ else {
934
+ message.width = 0;
935
+ }
936
+ if (object.height !== undefined && object.height !== null) {
937
+ message.height = Number(object.height);
938
+ }
939
+ else {
940
+ message.height = 0;
941
+ }
942
+ if (object.bitrate !== undefined && object.bitrate !== null) {
943
+ message.bitrate = Number(object.bitrate);
944
+ }
945
+ else {
946
+ message.bitrate = 0;
947
+ }
948
+ return message;
949
+ },
950
+ toJSON(message) {
951
+ const obj = {};
952
+ message.quality !== undefined &&
953
+ (obj.quality = videoQualityToJSON(message.quality));
954
+ message.width !== undefined && (obj.width = message.width);
955
+ message.height !== undefined && (obj.height = message.height);
956
+ message.bitrate !== undefined && (obj.bitrate = message.bitrate);
957
+ return obj;
958
+ },
959
+ fromPartial(object) {
960
+ var _a, _b, _c, _d;
961
+ const message = Object.assign({}, baseVideoLayer);
962
+ message.quality = (_a = object.quality) !== null && _a !== void 0 ? _a : 0;
963
+ message.width = (_b = object.width) !== null && _b !== void 0 ? _b : 0;
964
+ message.height = (_c = object.height) !== null && _c !== void 0 ? _c : 0;
965
+ message.bitrate = (_d = object.bitrate) !== null && _d !== void 0 ? _d : 0;
781
966
  return message;
782
967
  },
783
968
  };