@stream-io/video-client 0.0.28 → 0.0.30

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 (67) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/index.browser.es.js +2512 -1754
  3. package/dist/index.browser.es.js.map +1 -1
  4. package/dist/index.cjs.js +2532 -1752
  5. package/dist/index.cjs.js.map +1 -1
  6. package/dist/index.es.js +2512 -1754
  7. package/dist/index.es.js.map +1 -1
  8. package/dist/src/Call.d.ts +2 -3
  9. package/dist/src/StreamSfuClient.d.ts +23 -10
  10. package/dist/src/StreamVideoClient.d.ts +1 -4
  11. package/dist/src/client-details.d.ts +2 -1
  12. package/dist/src/coordinator/connection/types.d.ts +2 -2
  13. package/dist/src/coordinator/connection/utils.d.ts +1 -0
  14. package/dist/src/events/internal.d.ts +4 -0
  15. package/dist/src/gen/coordinator/index.d.ts +6 -0
  16. package/dist/src/gen/google/protobuf/struct.d.ts +8 -15
  17. package/dist/src/gen/google/protobuf/timestamp.d.ts +2 -9
  18. package/dist/src/gen/video/sfu/event/events.d.ts +121 -1
  19. package/dist/src/gen/video/sfu/models/models.d.ts +38 -1
  20. package/dist/src/gen/video/sfu/signal_rpc/signal.client.d.ts +3 -14
  21. package/dist/src/gen/video/sfu/signal_rpc/signal.d.ts +4 -12
  22. package/dist/src/logger.d.ts +4 -2
  23. package/dist/src/rtc/Dispatcher.d.ts +1 -2
  24. package/dist/src/rtc/{publisher.d.ts → Publisher.d.ts} +49 -15
  25. package/dist/src/rtc/Subscriber.d.ts +58 -0
  26. package/dist/src/rtc/__tests__/Subscriber.test.d.ts +1 -0
  27. package/dist/src/rtc/flows/join.d.ts +8 -1
  28. package/dist/src/rtc/index.d.ts +2 -2
  29. package/dist/src/rtc/signal.d.ts +1 -0
  30. package/dist/src/stats/state-store-stats-reporter.d.ts +3 -4
  31. package/dist/src/store/CallState.d.ts +10 -0
  32. package/package.json +3 -1
  33. package/src/Call.ts +215 -209
  34. package/src/StreamSfuClient.ts +48 -21
  35. package/src/StreamVideoClient.ts +7 -24
  36. package/src/client-details.ts +33 -1
  37. package/src/coordinator/connection/client.ts +6 -8
  38. package/src/coordinator/connection/types.ts +2 -3
  39. package/src/coordinator/connection/utils.ts +1 -0
  40. package/src/events/call.ts +0 -1
  41. package/src/events/callEventHandlers.ts +2 -0
  42. package/src/events/internal.ts +20 -0
  43. package/src/events/sessions.ts +0 -1
  44. package/src/gen/coordinator/index.ts +6 -0
  45. package/src/gen/google/protobuf/struct.ts +541 -333
  46. package/src/gen/google/protobuf/timestamp.ts +214 -148
  47. package/src/gen/video/sfu/event/events.ts +353 -3
  48. package/src/gen/video/sfu/models/models.ts +37 -0
  49. package/src/gen/video/sfu/signal_rpc/signal.client.ts +160 -94
  50. package/src/gen/video/sfu/signal_rpc/signal.ts +1214 -731
  51. package/src/logger.ts +43 -30
  52. package/src/rtc/Dispatcher.ts +5 -9
  53. package/src/rtc/{publisher.ts → Publisher.ts} +245 -111
  54. package/src/rtc/Subscriber.ts +304 -0
  55. package/src/rtc/__tests__/{publisher.test.ts → Publisher.test.ts} +77 -9
  56. package/src/rtc/__tests__/Subscriber.test.ts +121 -0
  57. package/src/rtc/__tests__/mocks/webrtc.mocks.ts +20 -0
  58. package/src/rtc/flows/join.ts +42 -1
  59. package/src/rtc/index.ts +2 -2
  60. package/src/rtc/signal.ts +6 -5
  61. package/src/rtc/videoLayers.ts +1 -4
  62. package/src/stats/state-store-stats-reporter.ts +3 -5
  63. package/src/store/CallState.ts +20 -0
  64. package/src/types.ts +0 -1
  65. package/dist/src/rtc/subscriber.d.ts +0 -9
  66. package/src/rtc/subscriber.ts +0 -107
  67. /package/dist/src/rtc/__tests__/{publisher.test.d.ts → Publisher.test.d.ts} +0 -0
@@ -23,13 +23,16 @@ import {
23
23
  Codec,
24
24
  ConnectionQuality,
25
25
  Error as Error$,
26
+ GoAwayReason,
26
27
  ICETrickle as ICETrickle$,
27
28
  Participant,
28
29
  ParticipantCount,
29
30
  PeerType,
31
+ TrackInfo,
30
32
  TrackType,
31
33
  TrackUnpublishReason,
32
34
  } from '../models/models';
35
+ import { TrackSubscriptionDetails } from '../signal_rpc/signal';
33
36
 
34
37
  /**
35
38
  * SFUEvent is a message that is sent from the SFU to the client.
@@ -44,6 +47,9 @@ export interface SfuEvent {
44
47
  | {
45
48
  oneofKind: 'subscriberOffer';
46
49
  /**
50
+ * SubscriberOffer sends the SDP offer for establishing the
51
+ * subscriber PeerConnection.
52
+ *
47
53
  * @generated from protobuf field: stream.video.sfu.event.SubscriberOffer subscriber_offer = 1;
48
54
  */
49
55
  subscriberOffer: SubscriberOffer;
@@ -51,6 +57,9 @@ export interface SfuEvent {
51
57
  | {
52
58
  oneofKind: 'publisherAnswer';
53
59
  /**
60
+ * PublisherAnswer sends the SDP answer to the offer sent by
61
+ * the client for establishing the Publisher PeerConnection.
62
+ *
54
63
  * @generated from protobuf field: stream.video.sfu.event.PublisherAnswer publisher_answer = 2;
55
64
  */
56
65
  publisherAnswer: PublisherAnswer;
@@ -58,6 +67,10 @@ export interface SfuEvent {
58
67
  | {
59
68
  oneofKind: 'connectionQualityChanged';
60
69
  /**
70
+ * ConnectionQualityChanged is sent to inform the connection
71
+ * quality of the participants in the call. It does not have
72
+ * to contain the full list of call participants in it.
73
+ *
61
74
  * @generated from protobuf field: stream.video.sfu.event.ConnectionQualityChanged connection_quality_changed = 3;
62
75
  */
63
76
  connectionQualityChanged: ConnectionQualityChanged;
@@ -65,6 +78,9 @@ export interface SfuEvent {
65
78
  | {
66
79
  oneofKind: 'audioLevelChanged';
67
80
  /**
81
+ * AudioLevelChanged is sent for change in audio levels of
82
+ * the participants.
83
+ *
68
84
  * @generated from protobuf field: stream.video.sfu.event.AudioLevelChanged audio_level_changed = 4;
69
85
  */
70
86
  audioLevelChanged: AudioLevelChanged;
@@ -72,6 +88,10 @@ export interface SfuEvent {
72
88
  | {
73
89
  oneofKind: 'iceTrickle';
74
90
  /**
91
+ * ICETrickle contains the ICE candidate required to establish
92
+ * the ICE transport: part of establishing the PeerConnection
93
+ * and also for ICE restarts.
94
+ *
75
95
  * @generated from protobuf field: stream.video.sfu.models.ICETrickle ice_trickle = 5;
76
96
  */
77
97
  iceTrickle: ICETrickle$;
@@ -79,6 +99,10 @@ export interface SfuEvent {
79
99
  | {
80
100
  oneofKind: 'changePublishQuality';
81
101
  /**
102
+ * ChangePublishQuality advises the publisher to switch on/off
103
+ * various qualities of their video stream based on the subscription.
104
+ * This is done to save the bandwidth and the CPU of the publisher.
105
+ *
82
106
  * @generated from protobuf field: stream.video.sfu.event.ChangePublishQuality change_publish_quality = 6;
83
107
  */
84
108
  changePublishQuality: ChangePublishQuality;
@@ -86,6 +110,9 @@ export interface SfuEvent {
86
110
  | {
87
111
  oneofKind: 'participantJoined';
88
112
  /**
113
+ * ParticipantJoined notifies the client that a new participant
114
+ * has joined the call. This is not sent for anonymous users.
115
+ *
89
116
  * @generated from protobuf field: stream.video.sfu.event.ParticipantJoined participant_joined = 10;
90
117
  */
91
118
  participantJoined: ParticipantJoined;
@@ -93,6 +120,9 @@ export interface SfuEvent {
93
120
  | {
94
121
  oneofKind: 'participantLeft';
95
122
  /**
123
+ * ParticipantLeft notifies the client that a call participant
124
+ * has left the call. This is not sent for anonymous users.
125
+ *
96
126
  * @generated from protobuf field: stream.video.sfu.event.ParticipantLeft participant_left = 11;
97
127
  */
98
128
  participantLeft: ParticipantLeft;
@@ -100,6 +130,10 @@ export interface SfuEvent {
100
130
  | {
101
131
  oneofKind: 'dominantSpeakerChanged';
102
132
  /**
133
+ * DominantSpeakerChanged notifies the client about the current
134
+ * dominant speaker. This is required for certain use cases like
135
+ * the spotlight view.
136
+ *
103
137
  * @generated from protobuf field: stream.video.sfu.event.DominantSpeakerChanged dominant_speaker_changed = 12;
104
138
  */
105
139
  dominantSpeakerChanged: DominantSpeakerChanged;
@@ -107,6 +141,9 @@ export interface SfuEvent {
107
141
  | {
108
142
  oneofKind: 'joinResponse';
109
143
  /**
144
+ * JoinResponse acknowledges a participant successfully joining
145
+ * the call. This is sent in response to the JoinRequest.
146
+ *
110
147
  * @generated from protobuf field: stream.video.sfu.event.JoinResponse join_response = 13;
111
148
  */
112
149
  joinResponse: JoinResponse;
@@ -114,6 +151,9 @@ export interface SfuEvent {
114
151
  | {
115
152
  oneofKind: 'healthCheckResponse';
116
153
  /**
154
+ * HealthCheckResponse is sent in response to the HealthCheckRequest.
155
+ * It contains the participant count in the call.
156
+ *
117
157
  * @generated from protobuf field: stream.video.sfu.event.HealthCheckResponse health_check_response = 14;
118
158
  */
119
159
  healthCheckResponse: HealthCheckResponse;
@@ -121,6 +161,9 @@ export interface SfuEvent {
121
161
  | {
122
162
  oneofKind: 'trackPublished';
123
163
  /**
164
+ * TrackPublished is sent when a new track (like audio, video, screenshare)
165
+ * is published by a participant in the call. It is also sent on mute/unmute.
166
+ *
124
167
  * @generated from protobuf field: stream.video.sfu.event.TrackPublished track_published = 16;
125
168
  */
126
169
  trackPublished: TrackPublished;
@@ -128,6 +171,10 @@ export interface SfuEvent {
128
171
  | {
129
172
  oneofKind: 'trackUnpublished';
130
173
  /**
174
+ * TrackUnpublished is sent when a track (like audio, video, screenshare)
175
+ * is no longer published. It is sent on muting a track or when the participant
176
+ * is leaving the call.
177
+ *
131
178
  * @generated from protobuf field: stream.video.sfu.event.TrackUnpublished track_unpublished = 17;
132
179
  */
133
180
  trackUnpublished: TrackUnpublished;
@@ -135,6 +182,10 @@ export interface SfuEvent {
135
182
  | {
136
183
  oneofKind: 'error';
137
184
  /**
185
+ * Error is used to communicate any error related to the participant. The
186
+ * error code and the message explain what went wrong. Whether the participant
187
+ * can retry is also indicated.
188
+ *
138
189
  * @generated from protobuf field: stream.video.sfu.event.Error error = 18;
139
190
  */
140
191
  error: Error;
@@ -142,10 +193,22 @@ export interface SfuEvent {
142
193
  | {
143
194
  oneofKind: 'callGrantsUpdated';
144
195
  /**
196
+ * CallGrantsUpdated tells what tracks a participant is allowed to publish.
197
+ *
145
198
  * @generated from protobuf field: stream.video.sfu.event.CallGrantsUpdated call_grants_updated = 19;
146
199
  */
147
200
  callGrantsUpdated: CallGrantsUpdated;
148
201
  }
202
+ | {
203
+ oneofKind: 'goAway';
204
+ /**
205
+ * GoAway tells the client to migrate away from the SFU it is connected to.
206
+ * The reason field indicates why this message was sent.
207
+ *
208
+ * @generated from protobuf field: stream.video.sfu.event.GoAway go_away = 20;
209
+ */
210
+ goAway: GoAway;
211
+ }
149
212
  | {
150
213
  oneofKind: undefined;
151
214
  };
@@ -292,8 +355,31 @@ export interface JoinRequest {
292
355
  /**
293
356
  * @generated from protobuf field: stream.video.sfu.models.ClientDetails client_details = 4;
294
357
  */
295
- clientDetails?: ClientDetails; // TODO: we should know if this is going to be
296
- // - publishing and subscribing, or just subscribing for future routing
358
+ clientDetails?: ClientDetails;
359
+ /**
360
+ * TODO: we should know if this is going to be
361
+ * - publishing and subscribing, or just subscribing for future routing
362
+ *
363
+ * @generated from protobuf field: stream.video.sfu.event.Migration migration = 5;
364
+ */
365
+ migration?: Migration;
366
+ }
367
+ /**
368
+ * @generated from protobuf message stream.video.sfu.event.Migration
369
+ */
370
+ export interface Migration {
371
+ /**
372
+ * @generated from protobuf field: string from_sfu_id = 1;
373
+ */
374
+ fromSfuId: string;
375
+ /**
376
+ * @generated from protobuf field: repeated stream.video.sfu.models.TrackInfo announced_tracks = 2;
377
+ */
378
+ announcedTracks: TrackInfo[];
379
+ /**
380
+ * @generated from protobuf field: repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions = 3;
381
+ */
382
+ subscriptions: TrackSubscriptionDetails[];
297
383
  }
298
384
  /**
299
385
  * @generated from protobuf message stream.video.sfu.event.JoinResponse
@@ -305,6 +391,10 @@ export interface JoinResponse {
305
391
  * @generated from protobuf field: stream.video.sfu.models.CallState call_state = 1;
306
392
  */
307
393
  callState?: CallState;
394
+ /**
395
+ * @generated from protobuf field: bool ice_restart = 2;
396
+ */
397
+ iceRestart: boolean;
308
398
  }
309
399
  /**
310
400
  * ParticipantJoined is fired when a user joins a call
@@ -589,6 +679,18 @@ export interface CallGrantsUpdated {
589
679
  */
590
680
  message: string;
591
681
  }
682
+ /**
683
+ * Go away is sent by the SFU to the client to signal to migrate away from the SFU.
684
+ * The evict reason may specify why the user is being evicted.
685
+ *
686
+ * @generated from protobuf message stream.video.sfu.event.GoAway
687
+ */
688
+ export interface GoAway {
689
+ /**
690
+ * @generated from protobuf field: stream.video.sfu.models.GoAwayReason reason = 1;
691
+ */
692
+ reason: GoAwayReason;
693
+ }
592
694
  // @generated message type with reflection information, may provide speed optimized methods
593
695
  class SfuEvent$Type extends MessageType<SfuEvent> {
594
696
  constructor() {
@@ -698,6 +800,13 @@ class SfuEvent$Type extends MessageType<SfuEvent> {
698
800
  oneof: 'eventPayload',
699
801
  T: () => CallGrantsUpdated,
700
802
  },
803
+ {
804
+ no: 20,
805
+ name: 'go_away',
806
+ kind: 'message',
807
+ oneof: 'eventPayload',
808
+ T: () => GoAway,
809
+ },
701
810
  ]);
702
811
  }
703
812
  create(value?: PartialMessage<SfuEvent>): SfuEvent {
@@ -887,6 +996,17 @@ class SfuEvent$Type extends MessageType<SfuEvent> {
887
996
  ),
888
997
  };
889
998
  break;
999
+ case /* stream.video.sfu.event.GoAway go_away */ 20:
1000
+ message.eventPayload = {
1001
+ oneofKind: 'goAway',
1002
+ goAway: GoAway.internalBinaryRead(
1003
+ reader,
1004
+ reader.uint32(),
1005
+ options,
1006
+ (message.eventPayload as any).goAway,
1007
+ ),
1008
+ };
1009
+ break;
890
1010
  default:
891
1011
  let u = options.readUnknownField;
892
1012
  if (u === 'throw')
@@ -1016,6 +1136,13 @@ class SfuEvent$Type extends MessageType<SfuEvent> {
1016
1136
  writer.tag(19, WireType.LengthDelimited).fork(),
1017
1137
  options,
1018
1138
  ).join();
1139
+ /* stream.video.sfu.event.GoAway go_away = 20; */
1140
+ if (message.eventPayload.oneofKind === 'goAway')
1141
+ GoAway.internalBinaryWrite(
1142
+ message.eventPayload.goAway,
1143
+ writer.tag(20, WireType.LengthDelimited).fork(),
1144
+ options,
1145
+ ).join();
1019
1146
  let u = options.writeUnknownFields;
1020
1147
  if (u !== false)
1021
1148
  (u == true ? UnknownFieldHandler.onWrite : u)(
@@ -1697,6 +1824,7 @@ class JoinRequest$Type extends MessageType<JoinRequest> {
1697
1824
  kind: 'message',
1698
1825
  T: () => ClientDetails,
1699
1826
  },
1827
+ { no: 5, name: 'migration', kind: 'message', T: () => Migration },
1700
1828
  ]);
1701
1829
  }
1702
1830
  create(value?: PartialMessage<JoinRequest>): JoinRequest {
@@ -1737,6 +1865,14 @@ class JoinRequest$Type extends MessageType<JoinRequest> {
1737
1865
  message.clientDetails,
1738
1866
  );
1739
1867
  break;
1868
+ case /* stream.video.sfu.event.Migration migration */ 5:
1869
+ message.migration = Migration.internalBinaryRead(
1870
+ reader,
1871
+ reader.uint32(),
1872
+ options,
1873
+ message.migration,
1874
+ );
1875
+ break;
1740
1876
  default:
1741
1877
  let u = options.readUnknownField;
1742
1878
  if (u === 'throw')
@@ -1777,6 +1913,13 @@ class JoinRequest$Type extends MessageType<JoinRequest> {
1777
1913
  writer.tag(4, WireType.LengthDelimited).fork(),
1778
1914
  options,
1779
1915
  ).join();
1916
+ /* stream.video.sfu.event.Migration migration = 5; */
1917
+ if (message.migration)
1918
+ Migration.internalBinaryWrite(
1919
+ message.migration,
1920
+ writer.tag(5, WireType.LengthDelimited).fork(),
1921
+ options,
1922
+ ).join();
1780
1923
  let u = options.writeUnknownFields;
1781
1924
  if (u !== false)
1782
1925
  (u == true ? UnknownFieldHandler.onWrite : u)(
@@ -1792,14 +1935,134 @@ class JoinRequest$Type extends MessageType<JoinRequest> {
1792
1935
  */
1793
1936
  export const JoinRequest = new JoinRequest$Type();
1794
1937
  // @generated message type with reflection information, may provide speed optimized methods
1938
+ class Migration$Type extends MessageType<Migration> {
1939
+ constructor() {
1940
+ super('stream.video.sfu.event.Migration', [
1941
+ {
1942
+ no: 1,
1943
+ name: 'from_sfu_id',
1944
+ kind: 'scalar',
1945
+ T: 9 /*ScalarType.STRING*/,
1946
+ },
1947
+ {
1948
+ no: 2,
1949
+ name: 'announced_tracks',
1950
+ kind: 'message',
1951
+ repeat: 1 /*RepeatType.PACKED*/,
1952
+ T: () => TrackInfo,
1953
+ },
1954
+ {
1955
+ no: 3,
1956
+ name: 'subscriptions',
1957
+ kind: 'message',
1958
+ repeat: 1 /*RepeatType.PACKED*/,
1959
+ T: () => TrackSubscriptionDetails,
1960
+ },
1961
+ ]);
1962
+ }
1963
+ create(value?: PartialMessage<Migration>): Migration {
1964
+ const message = { fromSfuId: '', announcedTracks: [], subscriptions: [] };
1965
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
1966
+ enumerable: false,
1967
+ value: this,
1968
+ });
1969
+ if (value !== undefined)
1970
+ reflectionMergePartial<Migration>(this, message, value);
1971
+ return message;
1972
+ }
1973
+ internalBinaryRead(
1974
+ reader: IBinaryReader,
1975
+ length: number,
1976
+ options: BinaryReadOptions,
1977
+ target?: Migration,
1978
+ ): Migration {
1979
+ let message = target ?? this.create(),
1980
+ end = reader.pos + length;
1981
+ while (reader.pos < end) {
1982
+ let [fieldNo, wireType] = reader.tag();
1983
+ switch (fieldNo) {
1984
+ case /* string from_sfu_id */ 1:
1985
+ message.fromSfuId = reader.string();
1986
+ break;
1987
+ case /* repeated stream.video.sfu.models.TrackInfo announced_tracks */ 2:
1988
+ message.announcedTracks.push(
1989
+ TrackInfo.internalBinaryRead(reader, reader.uint32(), options),
1990
+ );
1991
+ break;
1992
+ case /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions */ 3:
1993
+ message.subscriptions.push(
1994
+ TrackSubscriptionDetails.internalBinaryRead(
1995
+ reader,
1996
+ reader.uint32(),
1997
+ options,
1998
+ ),
1999
+ );
2000
+ break;
2001
+ default:
2002
+ let u = options.readUnknownField;
2003
+ if (u === 'throw')
2004
+ throw new globalThis.Error(
2005
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
2006
+ );
2007
+ let d = reader.skip(wireType);
2008
+ if (u !== false)
2009
+ (u === true ? UnknownFieldHandler.onRead : u)(
2010
+ this.typeName,
2011
+ message,
2012
+ fieldNo,
2013
+ wireType,
2014
+ d,
2015
+ );
2016
+ }
2017
+ }
2018
+ return message;
2019
+ }
2020
+ internalBinaryWrite(
2021
+ message: Migration,
2022
+ writer: IBinaryWriter,
2023
+ options: BinaryWriteOptions,
2024
+ ): IBinaryWriter {
2025
+ /* string from_sfu_id = 1; */
2026
+ if (message.fromSfuId !== '')
2027
+ writer.tag(1, WireType.LengthDelimited).string(message.fromSfuId);
2028
+ /* repeated stream.video.sfu.models.TrackInfo announced_tracks = 2; */
2029
+ for (let i = 0; i < message.announcedTracks.length; i++)
2030
+ TrackInfo.internalBinaryWrite(
2031
+ message.announcedTracks[i],
2032
+ writer.tag(2, WireType.LengthDelimited).fork(),
2033
+ options,
2034
+ ).join();
2035
+ /* repeated stream.video.sfu.signal.TrackSubscriptionDetails subscriptions = 3; */
2036
+ for (let i = 0; i < message.subscriptions.length; i++)
2037
+ TrackSubscriptionDetails.internalBinaryWrite(
2038
+ message.subscriptions[i],
2039
+ writer.tag(3, WireType.LengthDelimited).fork(),
2040
+ options,
2041
+ ).join();
2042
+ let u = options.writeUnknownFields;
2043
+ if (u !== false)
2044
+ (u == true ? UnknownFieldHandler.onWrite : u)(
2045
+ this.typeName,
2046
+ message,
2047
+ writer,
2048
+ );
2049
+ return writer;
2050
+ }
2051
+ }
2052
+ /**
2053
+ * @generated MessageType for protobuf message stream.video.sfu.event.Migration
2054
+ */
2055
+ export const Migration = new Migration$Type();
2056
+ // @generated message type with reflection information, may provide speed optimized methods
1795
2057
  class JoinResponse$Type extends MessageType<JoinResponse> {
1796
2058
  constructor() {
1797
2059
  super('stream.video.sfu.event.JoinResponse', [
1798
2060
  { no: 1, name: 'call_state', kind: 'message', T: () => CallState },
2061
+ { no: 2, name: 'ice_restart', kind: 'scalar', T: 8 /*ScalarType.BOOL*/ },
1799
2062
  ]);
1800
2063
  }
1801
2064
  create(value?: PartialMessage<JoinResponse>): JoinResponse {
1802
- const message = {};
2065
+ const message = { iceRestart: false };
1803
2066
  globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
1804
2067
  enumerable: false,
1805
2068
  value: this,
@@ -1827,6 +2090,9 @@ class JoinResponse$Type extends MessageType<JoinResponse> {
1827
2090
  message.callState,
1828
2091
  );
1829
2092
  break;
2093
+ case /* bool ice_restart */ 2:
2094
+ message.iceRestart = reader.bool();
2095
+ break;
1830
2096
  default:
1831
2097
  let u = options.readUnknownField;
1832
2098
  if (u === 'throw')
@@ -1858,6 +2124,9 @@ class JoinResponse$Type extends MessageType<JoinResponse> {
1858
2124
  writer.tag(1, WireType.LengthDelimited).fork(),
1859
2125
  options,
1860
2126
  ).join();
2127
+ /* bool ice_restart = 2; */
2128
+ if (message.iceRestart !== false)
2129
+ writer.tag(2, WireType.Varint).bool(message.iceRestart);
1861
2130
  let u = options.writeUnknownFields;
1862
2131
  if (u !== false)
1863
2132
  (u == true ? UnknownFieldHandler.onWrite : u)(
@@ -3368,3 +3637,84 @@ class CallGrantsUpdated$Type extends MessageType<CallGrantsUpdated> {
3368
3637
  * @generated MessageType for protobuf message stream.video.sfu.event.CallGrantsUpdated
3369
3638
  */
3370
3639
  export const CallGrantsUpdated = new CallGrantsUpdated$Type();
3640
+ // @generated message type with reflection information, may provide speed optimized methods
3641
+ class GoAway$Type extends MessageType<GoAway> {
3642
+ constructor() {
3643
+ super('stream.video.sfu.event.GoAway', [
3644
+ {
3645
+ no: 1,
3646
+ name: 'reason',
3647
+ kind: 'enum',
3648
+ T: () => [
3649
+ 'stream.video.sfu.models.GoAwayReason',
3650
+ GoAwayReason,
3651
+ 'GO_AWAY_REASON_',
3652
+ ],
3653
+ },
3654
+ ]);
3655
+ }
3656
+ create(value?: PartialMessage<GoAway>): GoAway {
3657
+ const message = { reason: 0 };
3658
+ globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
3659
+ enumerable: false,
3660
+ value: this,
3661
+ });
3662
+ if (value !== undefined)
3663
+ reflectionMergePartial<GoAway>(this, message, value);
3664
+ return message;
3665
+ }
3666
+ internalBinaryRead(
3667
+ reader: IBinaryReader,
3668
+ length: number,
3669
+ options: BinaryReadOptions,
3670
+ target?: GoAway,
3671
+ ): GoAway {
3672
+ let message = target ?? this.create(),
3673
+ end = reader.pos + length;
3674
+ while (reader.pos < end) {
3675
+ let [fieldNo, wireType] = reader.tag();
3676
+ switch (fieldNo) {
3677
+ case /* stream.video.sfu.models.GoAwayReason reason */ 1:
3678
+ message.reason = reader.int32();
3679
+ break;
3680
+ default:
3681
+ let u = options.readUnknownField;
3682
+ if (u === 'throw')
3683
+ throw new globalThis.Error(
3684
+ `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`,
3685
+ );
3686
+ let d = reader.skip(wireType);
3687
+ if (u !== false)
3688
+ (u === true ? UnknownFieldHandler.onRead : u)(
3689
+ this.typeName,
3690
+ message,
3691
+ fieldNo,
3692
+ wireType,
3693
+ d,
3694
+ );
3695
+ }
3696
+ }
3697
+ return message;
3698
+ }
3699
+ internalBinaryWrite(
3700
+ message: GoAway,
3701
+ writer: IBinaryWriter,
3702
+ options: BinaryWriteOptions,
3703
+ ): IBinaryWriter {
3704
+ /* stream.video.sfu.models.GoAwayReason reason = 1; */
3705
+ if (message.reason !== 0)
3706
+ writer.tag(1, WireType.Varint).int32(message.reason);
3707
+ let u = options.writeUnknownFields;
3708
+ if (u !== false)
3709
+ (u == true ? UnknownFieldHandler.onWrite : u)(
3710
+ this.typeName,
3711
+ message,
3712
+ writer,
3713
+ );
3714
+ return writer;
3715
+ }
3716
+ }
3717
+ /**
3718
+ * @generated MessageType for protobuf message stream.video.sfu.event.GoAway
3719
+ */
3720
+ export const GoAway = new GoAway$Type();
@@ -539,6 +539,22 @@ export enum ErrorCode {
539
539
  * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_NOT_FOUND = 200;
540
540
  */
541
541
  PARTICIPANT_NOT_FOUND = 200,
542
+ /**
543
+ * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_MIGRATING_OUT = 201;
544
+ */
545
+ PARTICIPANT_MIGRATING_OUT = 201,
546
+ /**
547
+ * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_MIGRATION_FAILED = 202;
548
+ */
549
+ PARTICIPANT_MIGRATION_FAILED = 202,
550
+ /**
551
+ * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_MIGRATING = 203;
552
+ */
553
+ PARTICIPANT_MIGRATING = 203,
554
+ /**
555
+ * @generated from protobuf enum value: ERROR_CODE_PARTICIPANT_RECONNECT_FAILED = 204;
556
+ */
557
+ PARTICIPANT_RECONNECT_FAILED = 204,
542
558
  /**
543
559
  * @generated from protobuf enum value: ERROR_CODE_CALL_NOT_FOUND = 300;
544
560
  */
@@ -563,6 +579,10 @@ export enum ErrorCode {
563
579
  * @generated from protobuf enum value: ERROR_CODE_INTERNAL_SERVER_ERROR = 500;
564
580
  */
565
581
  INTERNAL_SERVER_ERROR = 500,
582
+ /**
583
+ * @generated from protobuf enum value: ERROR_CODE_SFU_SHUTTING_DOWN = 600;
584
+ */
585
+ SFU_SHUTTING_DOWN = 600,
566
586
  }
567
587
  /**
568
588
  * @generated from protobuf enum stream.video.sfu.models.SdkType
@@ -632,6 +652,23 @@ export enum TrackUnpublishReason {
632
652
  */
633
653
  MODERATION = 3,
634
654
  }
655
+ /**
656
+ * @generated from protobuf enum stream.video.sfu.models.GoAwayReason
657
+ */
658
+ export enum GoAwayReason {
659
+ /**
660
+ * @generated from protobuf enum value: GO_AWAY_REASON_UNSPECIFIED = 0;
661
+ */
662
+ UNSPECIFIED = 0,
663
+ /**
664
+ * @generated from protobuf enum value: GO_AWAY_REASON_SHUTTING_DOWN = 1;
665
+ */
666
+ SHUTTING_DOWN = 1,
667
+ /**
668
+ * @generated from protobuf enum value: GO_AWAY_REASON_REBALANCE = 2;
669
+ */
670
+ REBALANCE = 2,
671
+ }
635
672
  // @generated message type with reflection information, may provide speed optimized methods
636
673
  class CallState$Type extends MessageType<CallState> {
637
674
  constructor() {