@stream-io/video-client 0.5.11 → 0.6.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.
- package/CHANGELOG.md +25 -0
- package/dist/index.browser.es.js +377 -566
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +376 -565
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +377 -566
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +12 -13
- package/dist/src/StreamVideoClient.d.ts +4 -5
- package/dist/src/coordinator/connection/client.d.ts +7 -13
- package/dist/src/coordinator/connection/types.d.ts +16 -4
- package/dist/src/devices/SpeakerManager.d.ts +14 -3
- package/dist/src/events/call-permissions.d.ts +2 -2
- package/dist/src/events/call.d.ts +4 -4
- package/dist/src/events/internal.d.ts +2 -2
- package/dist/src/events/participant.d.ts +5 -5
- package/dist/src/rtc/Dispatcher.d.ts +19 -6
- package/dist/src/rtc/IceTrickleBuffer.d.ts +2 -3
- package/dist/src/rtc/signal.d.ts +2 -2
- package/dist/src/types.d.ts +7 -0
- package/package.json +4 -4
- package/src/Call.ts +46 -53
- package/src/StreamSfuClient.ts +1 -3
- package/src/StreamVideoClient.ts +14 -13
- package/src/__tests__/server-side/call.test.ts +1 -7
- package/src/coordinator/connection/client.ts +30 -53
- package/src/coordinator/connection/connection.ts +22 -9
- package/src/coordinator/connection/types.ts +16 -5
- package/src/devices/InputMediaDeviceManagerState.ts +10 -1
- package/src/devices/SpeakerManager.ts +25 -4
- package/src/devices/__tests__/InputMediaDeviceManagerState.test.ts +25 -1
- package/src/devices/__tests__/SpeakerManager.test.ts +32 -2
- package/src/events/__tests__/call-permissions.test.ts +10 -20
- package/src/events/__tests__/mutes.test.ts +26 -55
- package/src/events/__tests__/participant.test.ts +47 -87
- package/src/events/call-permissions.ts +3 -4
- package/src/events/call.ts +6 -13
- package/src/events/callEventHandlers.ts +7 -4
- package/src/events/internal.ts +14 -22
- package/src/events/mutes.ts +1 -4
- package/src/events/participant.ts +14 -19
- package/src/events/speaker.ts +2 -8
- package/src/gen/google/protobuf/struct.ts +12 -19
- package/src/gen/google/protobuf/timestamp.ts +4 -7
- package/src/gen/video/sfu/event/events.ts +83 -164
- package/src/gen/video/sfu/models/models.ts +81 -123
- package/src/gen/video/sfu/signal_rpc/signal.client.ts +1 -1
- package/src/gen/video/sfu/signal_rpc/signal.ts +38 -77
- package/src/helpers/DynascaleManager.ts +7 -5
- package/src/helpers/__tests__/DynascaleManager.test.ts +5 -0
- package/src/rtc/Dispatcher.ts +42 -25
- package/src/rtc/IceTrickleBuffer.ts +4 -8
- package/src/rtc/Publisher.ts +1 -3
- package/src/rtc/Subscriber.ts +2 -6
- package/src/rtc/signal.ts +3 -2
- package/src/types.ts +8 -0
package/dist/index.browser.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'webrtc-adapter';
|
|
2
|
-
import { MessageType, isJsonObject, typeofJsonValue, reflectionMergePartial, UnknownFieldHandler, WireType,
|
|
2
|
+
import { MessageType, isJsonObject, typeofJsonValue, reflectionMergePartial, UnknownFieldHandler, WireType, PbLong } from '@protobuf-ts/runtime';
|
|
3
3
|
import { ServiceType, stackIntercept } from '@protobuf-ts/runtime-rpc';
|
|
4
4
|
import axios, { AxiosHeaders } from 'axios';
|
|
5
5
|
export { AxiosError } from 'axios';
|
|
@@ -195,11 +195,8 @@ class Struct$Type extends MessageType {
|
|
|
195
195
|
return target;
|
|
196
196
|
}
|
|
197
197
|
create(value) {
|
|
198
|
-
const message =
|
|
199
|
-
|
|
200
|
-
enumerable: false,
|
|
201
|
-
value: this,
|
|
202
|
-
});
|
|
198
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
199
|
+
message.fields = {};
|
|
203
200
|
if (value !== undefined)
|
|
204
201
|
reflectionMergePartial(this, message, value);
|
|
205
202
|
return message;
|
|
@@ -242,7 +239,7 @@ class Struct$Type extends MessageType {
|
|
|
242
239
|
}
|
|
243
240
|
internalBinaryWrite(message, writer, options) {
|
|
244
241
|
/* map<string, google.protobuf.Value> fields = 1; */
|
|
245
|
-
for (let k of Object.keys(message.fields)) {
|
|
242
|
+
for (let k of globalThis.Object.keys(message.fields)) {
|
|
246
243
|
writer
|
|
247
244
|
.tag(1, WireType.LengthDelimited)
|
|
248
245
|
.fork()
|
|
@@ -324,7 +321,10 @@ class Value$Type extends MessageType {
|
|
|
324
321
|
case 'nullValue':
|
|
325
322
|
return null;
|
|
326
323
|
case 'numberValue':
|
|
327
|
-
|
|
324
|
+
let numberValue = message.kind.numberValue;
|
|
325
|
+
if (typeof numberValue == 'number' && !Number.isFinite(numberValue))
|
|
326
|
+
throw new globalThis.Error();
|
|
327
|
+
return numberValue;
|
|
328
328
|
case 'stringValue':
|
|
329
329
|
return message.kind.stringValue;
|
|
330
330
|
case 'listValue':
|
|
@@ -384,11 +384,8 @@ class Value$Type extends MessageType {
|
|
|
384
384
|
return target;
|
|
385
385
|
}
|
|
386
386
|
create(value) {
|
|
387
|
-
const message =
|
|
388
|
-
|
|
389
|
-
enumerable: false,
|
|
390
|
-
value: this,
|
|
391
|
-
});
|
|
387
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
388
|
+
message.kind = { oneofKind: undefined };
|
|
392
389
|
if (value !== undefined)
|
|
393
390
|
reflectionMergePartial(this, message, value);
|
|
394
391
|
return message;
|
|
@@ -509,11 +506,8 @@ class ListValue$Type extends MessageType {
|
|
|
509
506
|
return target;
|
|
510
507
|
}
|
|
511
508
|
create(value) {
|
|
512
|
-
const message =
|
|
513
|
-
|
|
514
|
-
enumerable: false,
|
|
515
|
-
value: this,
|
|
516
|
-
});
|
|
509
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
510
|
+
message.values = [];
|
|
517
511
|
if (value !== undefined)
|
|
518
512
|
reflectionMergePartial(this, message, value);
|
|
519
513
|
return message;
|
|
@@ -648,11 +642,9 @@ class Timestamp$Type extends MessageType {
|
|
|
648
642
|
return target;
|
|
649
643
|
}
|
|
650
644
|
create(value) {
|
|
651
|
-
const message =
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
value: this,
|
|
655
|
-
});
|
|
645
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
646
|
+
message.seconds = '0';
|
|
647
|
+
message.nanos = 0;
|
|
656
648
|
if (value !== undefined)
|
|
657
649
|
reflectionMergePartial(this, message, value);
|
|
658
650
|
return message;
|
|
@@ -989,11 +981,9 @@ class CallState$Type extends MessageType {
|
|
|
989
981
|
]);
|
|
990
982
|
}
|
|
991
983
|
create(value) {
|
|
992
|
-
const message =
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
value: this,
|
|
996
|
-
});
|
|
984
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
985
|
+
message.participants = [];
|
|
986
|
+
message.pins = [];
|
|
997
987
|
if (value !== undefined)
|
|
998
988
|
reflectionMergePartial(this, message, value);
|
|
999
989
|
return message;
|
|
@@ -1058,11 +1048,9 @@ class ParticipantCount$Type extends MessageType {
|
|
|
1058
1048
|
]);
|
|
1059
1049
|
}
|
|
1060
1050
|
create(value) {
|
|
1061
|
-
const message =
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
value: this,
|
|
1065
|
-
});
|
|
1051
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1052
|
+
message.total = 0;
|
|
1053
|
+
message.anonymous = 0;
|
|
1066
1054
|
if (value !== undefined)
|
|
1067
1055
|
reflectionMergePartial(this, message, value);
|
|
1068
1056
|
return message;
|
|
@@ -1115,11 +1103,9 @@ class Pin$Type extends MessageType {
|
|
|
1115
1103
|
]);
|
|
1116
1104
|
}
|
|
1117
1105
|
create(value) {
|
|
1118
|
-
const message =
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
value: this,
|
|
1122
|
-
});
|
|
1106
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1107
|
+
message.userId = '';
|
|
1108
|
+
message.sessionId = '';
|
|
1123
1109
|
if (value !== undefined)
|
|
1124
1110
|
reflectionMergePartial(this, message, value);
|
|
1125
1111
|
return message;
|
|
@@ -1218,23 +1204,18 @@ class Participant$Type extends MessageType {
|
|
|
1218
1204
|
]);
|
|
1219
1205
|
}
|
|
1220
1206
|
create(value) {
|
|
1221
|
-
const message =
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
};
|
|
1234
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
1235
|
-
enumerable: false,
|
|
1236
|
-
value: this,
|
|
1237
|
-
});
|
|
1207
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1208
|
+
message.userId = '';
|
|
1209
|
+
message.sessionId = '';
|
|
1210
|
+
message.publishedTracks = [];
|
|
1211
|
+
message.trackLookupPrefix = '';
|
|
1212
|
+
message.connectionQuality = 0;
|
|
1213
|
+
message.isSpeaking = false;
|
|
1214
|
+
message.isDominantSpeaker = false;
|
|
1215
|
+
message.audioLevel = 0;
|
|
1216
|
+
message.name = '';
|
|
1217
|
+
message.image = '';
|
|
1218
|
+
message.roles = [];
|
|
1238
1219
|
if (value !== undefined)
|
|
1239
1220
|
reflectionMergePartial(this, message, value);
|
|
1240
1221
|
return message;
|
|
@@ -1370,11 +1351,9 @@ class StreamQuality$Type extends MessageType {
|
|
|
1370
1351
|
]);
|
|
1371
1352
|
}
|
|
1372
1353
|
create(value) {
|
|
1373
|
-
const message =
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
value: this,
|
|
1377
|
-
});
|
|
1354
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1355
|
+
message.videoQuality = 0;
|
|
1356
|
+
message.userId = '';
|
|
1378
1357
|
if (value !== undefined)
|
|
1379
1358
|
reflectionMergePartial(this, message, value);
|
|
1380
1359
|
return message;
|
|
@@ -1427,11 +1406,9 @@ class VideoDimension$Type extends MessageType {
|
|
|
1427
1406
|
]);
|
|
1428
1407
|
}
|
|
1429
1408
|
create(value) {
|
|
1430
|
-
const message =
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
value: this,
|
|
1434
|
-
});
|
|
1409
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1410
|
+
message.width = 0;
|
|
1411
|
+
message.height = 0;
|
|
1435
1412
|
if (value !== undefined)
|
|
1436
1413
|
reflectionMergePartial(this, message, value);
|
|
1437
1414
|
return message;
|
|
@@ -1501,11 +1478,11 @@ class VideoLayer$Type extends MessageType {
|
|
|
1501
1478
|
]);
|
|
1502
1479
|
}
|
|
1503
1480
|
create(value) {
|
|
1504
|
-
const message =
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1481
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1482
|
+
message.rid = '';
|
|
1483
|
+
message.bitrate = 0;
|
|
1484
|
+
message.fps = 0;
|
|
1485
|
+
message.quality = 0;
|
|
1509
1486
|
if (value !== undefined)
|
|
1510
1487
|
reflectionMergePartial(this, message, value);
|
|
1511
1488
|
return message;
|
|
@@ -1601,18 +1578,13 @@ class Codec$Type extends MessageType {
|
|
|
1601
1578
|
]);
|
|
1602
1579
|
}
|
|
1603
1580
|
create(value) {
|
|
1604
|
-
const message =
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
};
|
|
1612
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
1613
|
-
enumerable: false,
|
|
1614
|
-
value: this,
|
|
1615
|
-
});
|
|
1581
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1582
|
+
message.payloadType = 0;
|
|
1583
|
+
message.name = '';
|
|
1584
|
+
message.fmtpLine = '';
|
|
1585
|
+
message.clockRate = 0;
|
|
1586
|
+
message.encodingParameters = '';
|
|
1587
|
+
message.feedbacks = [];
|
|
1616
1588
|
if (value !== undefined)
|
|
1617
1589
|
reflectionMergePartial(this, message, value);
|
|
1618
1590
|
return message;
|
|
@@ -1702,11 +1674,10 @@ let ICETrickle$Type$1 = class ICETrickle$Type extends MessageType {
|
|
|
1702
1674
|
]);
|
|
1703
1675
|
}
|
|
1704
1676
|
create(value) {
|
|
1705
|
-
const message =
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
});
|
|
1677
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1678
|
+
message.peerType = 0;
|
|
1679
|
+
message.iceCandidate = '';
|
|
1680
|
+
message.sessionId = '';
|
|
1710
1681
|
if (value !== undefined)
|
|
1711
1682
|
reflectionMergePartial(this, message, value);
|
|
1712
1683
|
return message;
|
|
@@ -1785,19 +1756,14 @@ class TrackInfo$Type extends MessageType {
|
|
|
1785
1756
|
]);
|
|
1786
1757
|
}
|
|
1787
1758
|
create(value) {
|
|
1788
|
-
const message =
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
};
|
|
1797
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
1798
|
-
enumerable: false,
|
|
1799
|
-
value: this,
|
|
1800
|
-
});
|
|
1759
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1760
|
+
message.trackId = '';
|
|
1761
|
+
message.trackType = 0;
|
|
1762
|
+
message.layers = [];
|
|
1763
|
+
message.mid = '';
|
|
1764
|
+
message.dtx = false;
|
|
1765
|
+
message.stereo = false;
|
|
1766
|
+
message.red = false;
|
|
1801
1767
|
if (value !== undefined)
|
|
1802
1768
|
reflectionMergePartial(this, message, value);
|
|
1803
1769
|
return message;
|
|
@@ -1895,11 +1861,11 @@ class Call$Type extends MessageType {
|
|
|
1895
1861
|
]);
|
|
1896
1862
|
}
|
|
1897
1863
|
create(value) {
|
|
1898
|
-
const message =
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1864
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1865
|
+
message.type = '';
|
|
1866
|
+
message.id = '';
|
|
1867
|
+
message.createdByUserId = '';
|
|
1868
|
+
message.hostUserId = '';
|
|
1903
1869
|
if (value !== undefined)
|
|
1904
1870
|
reflectionMergePartial(this, message, value);
|
|
1905
1871
|
return message;
|
|
@@ -1992,11 +1958,10 @@ let Error$Type$1 = class Error$Type extends MessageType {
|
|
|
1992
1958
|
]);
|
|
1993
1959
|
}
|
|
1994
1960
|
create(value) {
|
|
1995
|
-
const message =
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
});
|
|
1961
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
1962
|
+
message.code = 0;
|
|
1963
|
+
message.message = '';
|
|
1964
|
+
message.shouldRetry = false;
|
|
2000
1965
|
if (value !== undefined)
|
|
2001
1966
|
reflectionMergePartial(this, message, value);
|
|
2002
1967
|
return message;
|
|
@@ -2057,11 +2022,7 @@ class ClientDetails$Type extends MessageType {
|
|
|
2057
2022
|
]);
|
|
2058
2023
|
}
|
|
2059
2024
|
create(value) {
|
|
2060
|
-
const message =
|
|
2061
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
2062
|
-
enumerable: false,
|
|
2063
|
-
value: this,
|
|
2064
|
-
});
|
|
2025
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2065
2026
|
if (value !== undefined)
|
|
2066
2027
|
reflectionMergePartial(this, message, value);
|
|
2067
2028
|
return message;
|
|
@@ -2133,11 +2094,11 @@ class Sdk$Type extends MessageType {
|
|
|
2133
2094
|
]);
|
|
2134
2095
|
}
|
|
2135
2096
|
create(value) {
|
|
2136
|
-
const message =
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2097
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2098
|
+
message.type = 0;
|
|
2099
|
+
message.major = '';
|
|
2100
|
+
message.minor = '';
|
|
2101
|
+
message.patch = '';
|
|
2141
2102
|
if (value !== undefined)
|
|
2142
2103
|
reflectionMergePartial(this, message, value);
|
|
2143
2104
|
return message;
|
|
@@ -2208,11 +2169,10 @@ class OS$Type extends MessageType {
|
|
|
2208
2169
|
]);
|
|
2209
2170
|
}
|
|
2210
2171
|
create(value) {
|
|
2211
|
-
const message =
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
});
|
|
2172
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2173
|
+
message.name = '';
|
|
2174
|
+
message.version = '';
|
|
2175
|
+
message.architecture = '';
|
|
2216
2176
|
if (value !== undefined)
|
|
2217
2177
|
reflectionMergePartial(this, message, value);
|
|
2218
2178
|
return message;
|
|
@@ -2271,11 +2231,9 @@ class Browser$Type extends MessageType {
|
|
|
2271
2231
|
]);
|
|
2272
2232
|
}
|
|
2273
2233
|
create(value) {
|
|
2274
|
-
const message =
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
value: this,
|
|
2278
|
-
});
|
|
2234
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2235
|
+
message.name = '';
|
|
2236
|
+
message.version = '';
|
|
2279
2237
|
if (value !== undefined)
|
|
2280
2238
|
reflectionMergePartial(this, message, value);
|
|
2281
2239
|
return message;
|
|
@@ -2328,11 +2286,9 @@ class Device$Type extends MessageType {
|
|
|
2328
2286
|
]);
|
|
2329
2287
|
}
|
|
2330
2288
|
create(value) {
|
|
2331
|
-
const message =
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
value: this,
|
|
2335
|
-
});
|
|
2289
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2290
|
+
message.name = '';
|
|
2291
|
+
message.version = '';
|
|
2336
2292
|
if (value !== undefined)
|
|
2337
2293
|
reflectionMergePartial(this, message, value);
|
|
2338
2294
|
return message;
|
|
@@ -2401,15 +2357,10 @@ class CallGrants$Type extends MessageType {
|
|
|
2401
2357
|
]);
|
|
2402
2358
|
}
|
|
2403
2359
|
create(value) {
|
|
2404
|
-
const message =
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
};
|
|
2409
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
2410
|
-
enumerable: false,
|
|
2411
|
-
value: this,
|
|
2412
|
-
});
|
|
2360
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2361
|
+
message.canPublishAudio = false;
|
|
2362
|
+
message.canPublishVideo = false;
|
|
2363
|
+
message.canScreenshare = false;
|
|
2413
2364
|
if (value !== undefined)
|
|
2414
2365
|
reflectionMergePartial(this, message, value);
|
|
2415
2366
|
return message;
|
|
@@ -2491,7 +2442,7 @@ var models = /*#__PURE__*/Object.freeze({
|
|
|
2491
2442
|
});
|
|
2492
2443
|
|
|
2493
2444
|
/* eslint-disable */
|
|
2494
|
-
// @generated by protobuf-ts 2.9.
|
|
2445
|
+
// @generated by protobuf-ts 2.9.3 with parameter long_type_string,client_generic,server_none,eslint_disable
|
|
2495
2446
|
// @generated from protobuf file "video/sfu/signal_rpc/signal.proto" (package "stream.video.sfu.signal", syntax proto3)
|
|
2496
2447
|
// tslint:disable
|
|
2497
2448
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
@@ -2508,11 +2459,9 @@ class ICERestartRequest$Type extends MessageType {
|
|
|
2508
2459
|
]);
|
|
2509
2460
|
}
|
|
2510
2461
|
create(value) {
|
|
2511
|
-
const message =
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
value: this,
|
|
2515
|
-
});
|
|
2462
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2463
|
+
message.sessionId = '';
|
|
2464
|
+
message.peerType = 0;
|
|
2516
2465
|
if (value !== undefined)
|
|
2517
2466
|
reflectionMergePartial(this, message, value);
|
|
2518
2467
|
return message;
|
|
@@ -2564,11 +2513,7 @@ class ICERestartResponse$Type extends MessageType {
|
|
|
2564
2513
|
]);
|
|
2565
2514
|
}
|
|
2566
2515
|
create(value) {
|
|
2567
|
-
const message =
|
|
2568
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
2569
|
-
enumerable: false,
|
|
2570
|
-
value: this,
|
|
2571
|
-
});
|
|
2516
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2572
2517
|
if (value !== undefined)
|
|
2573
2518
|
reflectionMergePartial(this, message, value);
|
|
2574
2519
|
return message;
|
|
@@ -2621,11 +2566,9 @@ class UpdateMuteStatesRequest$Type extends MessageType {
|
|
|
2621
2566
|
]);
|
|
2622
2567
|
}
|
|
2623
2568
|
create(value) {
|
|
2624
|
-
const message =
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
value: this,
|
|
2628
|
-
});
|
|
2569
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2570
|
+
message.sessionId = '';
|
|
2571
|
+
message.muteStates = [];
|
|
2629
2572
|
if (value !== undefined)
|
|
2630
2573
|
reflectionMergePartial(this, message, value);
|
|
2631
2574
|
return message;
|
|
@@ -2677,11 +2620,7 @@ class UpdateMuteStatesResponse$Type extends MessageType {
|
|
|
2677
2620
|
]);
|
|
2678
2621
|
}
|
|
2679
2622
|
create(value) {
|
|
2680
|
-
const message =
|
|
2681
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
2682
|
-
enumerable: false,
|
|
2683
|
-
value: this,
|
|
2684
|
-
});
|
|
2623
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2685
2624
|
if (value !== undefined)
|
|
2686
2625
|
reflectionMergePartial(this, message, value);
|
|
2687
2626
|
return message;
|
|
@@ -2737,11 +2676,9 @@ class TrackMuteState$Type extends MessageType {
|
|
|
2737
2676
|
]);
|
|
2738
2677
|
}
|
|
2739
2678
|
create(value) {
|
|
2740
|
-
const message =
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
value: this,
|
|
2744
|
-
});
|
|
2679
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2680
|
+
message.trackType = 0;
|
|
2681
|
+
message.muted = false;
|
|
2745
2682
|
if (value !== undefined)
|
|
2746
2683
|
reflectionMergePartial(this, message, value);
|
|
2747
2684
|
return message;
|
|
@@ -2793,11 +2730,8 @@ class AudioMuteChanged$Type extends MessageType {
|
|
|
2793
2730
|
]);
|
|
2794
2731
|
}
|
|
2795
2732
|
create(value) {
|
|
2796
|
-
const message =
|
|
2797
|
-
|
|
2798
|
-
enumerable: false,
|
|
2799
|
-
value: this,
|
|
2800
|
-
});
|
|
2733
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2734
|
+
message.muted = false;
|
|
2801
2735
|
if (value !== undefined)
|
|
2802
2736
|
reflectionMergePartial(this, message, value);
|
|
2803
2737
|
return message;
|
|
@@ -2843,11 +2777,8 @@ class VideoMuteChanged$Type extends MessageType {
|
|
|
2843
2777
|
]);
|
|
2844
2778
|
}
|
|
2845
2779
|
create(value) {
|
|
2846
|
-
const message =
|
|
2847
|
-
|
|
2848
|
-
enumerable: false,
|
|
2849
|
-
value: this,
|
|
2850
|
-
});
|
|
2780
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2781
|
+
message.muted = false;
|
|
2851
2782
|
if (value !== undefined)
|
|
2852
2783
|
reflectionMergePartial(this, message, value);
|
|
2853
2784
|
return message;
|
|
@@ -2900,11 +2831,9 @@ class UpdateSubscriptionsRequest$Type extends MessageType {
|
|
|
2900
2831
|
]);
|
|
2901
2832
|
}
|
|
2902
2833
|
create(value) {
|
|
2903
|
-
const message =
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
value: this,
|
|
2907
|
-
});
|
|
2834
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2835
|
+
message.sessionId = '';
|
|
2836
|
+
message.tracks = [];
|
|
2908
2837
|
if (value !== undefined)
|
|
2909
2838
|
reflectionMergePartial(this, message, value);
|
|
2910
2839
|
return message;
|
|
@@ -2956,11 +2885,7 @@ class UpdateSubscriptionsResponse$Type extends MessageType {
|
|
|
2956
2885
|
]);
|
|
2957
2886
|
}
|
|
2958
2887
|
create(value) {
|
|
2959
|
-
const message =
|
|
2960
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
2961
|
-
enumerable: false,
|
|
2962
|
-
value: this,
|
|
2963
|
-
});
|
|
2888
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2964
2889
|
if (value !== undefined)
|
|
2965
2890
|
reflectionMergePartial(this, message, value);
|
|
2966
2891
|
return message;
|
|
@@ -3018,11 +2943,10 @@ class TrackSubscriptionDetails$Type extends MessageType {
|
|
|
3018
2943
|
]);
|
|
3019
2944
|
}
|
|
3020
2945
|
create(value) {
|
|
3021
|
-
const message =
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
});
|
|
2946
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
2947
|
+
message.userId = '';
|
|
2948
|
+
message.sessionId = '';
|
|
2949
|
+
message.trackType = 0;
|
|
3026
2950
|
if (value !== undefined)
|
|
3027
2951
|
reflectionMergePartial(this, message, value);
|
|
3028
2952
|
return message;
|
|
@@ -3093,11 +3017,10 @@ class SendAnswerRequest$Type extends MessageType {
|
|
|
3093
3017
|
]);
|
|
3094
3018
|
}
|
|
3095
3019
|
create(value) {
|
|
3096
|
-
const message =
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
});
|
|
3020
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3021
|
+
message.peerType = 0;
|
|
3022
|
+
message.sdp = '';
|
|
3023
|
+
message.sessionId = '';
|
|
3101
3024
|
if (value !== undefined)
|
|
3102
3025
|
reflectionMergePartial(this, message, value);
|
|
3103
3026
|
return message;
|
|
@@ -3155,11 +3078,7 @@ class SendAnswerResponse$Type extends MessageType {
|
|
|
3155
3078
|
]);
|
|
3156
3079
|
}
|
|
3157
3080
|
create(value) {
|
|
3158
|
-
const message =
|
|
3159
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
3160
|
-
enumerable: false,
|
|
3161
|
-
value: this,
|
|
3162
|
-
});
|
|
3081
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3163
3082
|
if (value !== undefined)
|
|
3164
3083
|
reflectionMergePartial(this, message, value);
|
|
3165
3084
|
return message;
|
|
@@ -3205,11 +3124,7 @@ class ICETrickleResponse$Type extends MessageType {
|
|
|
3205
3124
|
]);
|
|
3206
3125
|
}
|
|
3207
3126
|
create(value) {
|
|
3208
|
-
const message =
|
|
3209
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
3210
|
-
enumerable: false,
|
|
3211
|
-
value: this,
|
|
3212
|
-
});
|
|
3127
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3213
3128
|
if (value !== undefined)
|
|
3214
3129
|
reflectionMergePartial(this, message, value);
|
|
3215
3130
|
return message;
|
|
@@ -3263,11 +3178,10 @@ class SetPublisherRequest$Type extends MessageType {
|
|
|
3263
3178
|
]);
|
|
3264
3179
|
}
|
|
3265
3180
|
create(value) {
|
|
3266
|
-
const message =
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
});
|
|
3181
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3182
|
+
message.sdp = '';
|
|
3183
|
+
message.sessionId = '';
|
|
3184
|
+
message.tracks = [];
|
|
3271
3185
|
if (value !== undefined)
|
|
3272
3186
|
reflectionMergePartial(this, message, value);
|
|
3273
3187
|
return message;
|
|
@@ -3328,11 +3242,10 @@ class SetPublisherResponse$Type extends MessageType {
|
|
|
3328
3242
|
]);
|
|
3329
3243
|
}
|
|
3330
3244
|
create(value) {
|
|
3331
|
-
const message =
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
});
|
|
3245
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3246
|
+
message.sdp = '';
|
|
3247
|
+
message.sessionId = '';
|
|
3248
|
+
message.iceRestart = false;
|
|
3336
3249
|
if (value !== undefined)
|
|
3337
3250
|
reflectionMergePartial(this, message, value);
|
|
3338
3251
|
return message;
|
|
@@ -3580,11 +3493,8 @@ class SfuEvent$Type extends MessageType {
|
|
|
3580
3493
|
]);
|
|
3581
3494
|
}
|
|
3582
3495
|
create(value) {
|
|
3583
|
-
const message =
|
|
3584
|
-
|
|
3585
|
-
enumerable: false,
|
|
3586
|
-
value: this,
|
|
3587
|
-
});
|
|
3496
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3497
|
+
message.eventPayload = { oneofKind: undefined };
|
|
3588
3498
|
if (value !== undefined)
|
|
3589
3499
|
reflectionMergePartial(this, message, value);
|
|
3590
3500
|
return message;
|
|
@@ -3792,11 +3702,8 @@ class PinsChanged$Type extends MessageType {
|
|
|
3792
3702
|
]);
|
|
3793
3703
|
}
|
|
3794
3704
|
create(value) {
|
|
3795
|
-
const message =
|
|
3796
|
-
|
|
3797
|
-
enumerable: false,
|
|
3798
|
-
value: this,
|
|
3799
|
-
});
|
|
3705
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3706
|
+
message.pins = [];
|
|
3800
3707
|
if (value !== undefined)
|
|
3801
3708
|
reflectionMergePartial(this, message, value);
|
|
3802
3709
|
return message;
|
|
@@ -3842,11 +3749,7 @@ class Error$Type extends MessageType {
|
|
|
3842
3749
|
]);
|
|
3843
3750
|
}
|
|
3844
3751
|
create(value) {
|
|
3845
|
-
const message =
|
|
3846
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
3847
|
-
enumerable: false,
|
|
3848
|
-
value: this,
|
|
3849
|
-
});
|
|
3752
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3850
3753
|
if (value !== undefined)
|
|
3851
3754
|
reflectionMergePartial(this, message, value);
|
|
3852
3755
|
return message;
|
|
@@ -3903,11 +3806,9 @@ class ICETrickle$Type extends MessageType {
|
|
|
3903
3806
|
]);
|
|
3904
3807
|
}
|
|
3905
3808
|
create(value) {
|
|
3906
|
-
const message =
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
value: this,
|
|
3910
|
-
});
|
|
3809
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3810
|
+
message.peerType = 0;
|
|
3811
|
+
message.iceCandidate = '';
|
|
3911
3812
|
if (value !== undefined)
|
|
3912
3813
|
reflectionMergePartial(this, message, value);
|
|
3913
3814
|
return message;
|
|
@@ -3964,11 +3865,8 @@ class ICERestart$Type extends MessageType {
|
|
|
3964
3865
|
]);
|
|
3965
3866
|
}
|
|
3966
3867
|
create(value) {
|
|
3967
|
-
const message =
|
|
3968
|
-
|
|
3969
|
-
enumerable: false,
|
|
3970
|
-
value: this,
|
|
3971
|
-
});
|
|
3868
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3869
|
+
message.peerType = 0;
|
|
3972
3870
|
if (value !== undefined)
|
|
3973
3871
|
reflectionMergePartial(this, message, value);
|
|
3974
3872
|
return message;
|
|
@@ -4027,11 +3925,8 @@ class SfuRequest$Type extends MessageType {
|
|
|
4027
3925
|
]);
|
|
4028
3926
|
}
|
|
4029
3927
|
create(value) {
|
|
4030
|
-
const message =
|
|
4031
|
-
|
|
4032
|
-
enumerable: false,
|
|
4033
|
-
value: this,
|
|
4034
|
-
});
|
|
3928
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
3929
|
+
message.requestPayload = { oneofKind: undefined };
|
|
4035
3930
|
if (value !== undefined)
|
|
4036
3931
|
reflectionMergePartial(this, message, value);
|
|
4037
3932
|
return message;
|
|
@@ -4087,11 +3982,7 @@ class HealthCheckRequest$Type extends MessageType {
|
|
|
4087
3982
|
super('stream.video.sfu.event.HealthCheckRequest', []);
|
|
4088
3983
|
}
|
|
4089
3984
|
create(value) {
|
|
4090
|
-
const message =
|
|
4091
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
4092
|
-
enumerable: false,
|
|
4093
|
-
value: this,
|
|
4094
|
-
});
|
|
3985
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4095
3986
|
if (value !== undefined)
|
|
4096
3987
|
reflectionMergePartial(this, message, value);
|
|
4097
3988
|
return message;
|
|
@@ -4123,11 +4014,7 @@ class HealthCheckResponse$Type extends MessageType {
|
|
|
4123
4014
|
]);
|
|
4124
4015
|
}
|
|
4125
4016
|
create(value) {
|
|
4126
|
-
const message =
|
|
4127
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
4128
|
-
enumerable: false,
|
|
4129
|
-
value: this,
|
|
4130
|
-
});
|
|
4017
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4131
4018
|
if (value !== undefined)
|
|
4132
4019
|
reflectionMergePartial(this, message, value);
|
|
4133
4020
|
return message;
|
|
@@ -4185,11 +4072,10 @@ class TrackPublished$Type extends MessageType {
|
|
|
4185
4072
|
]);
|
|
4186
4073
|
}
|
|
4187
4074
|
create(value) {
|
|
4188
|
-
const message =
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
});
|
|
4075
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4076
|
+
message.userId = '';
|
|
4077
|
+
message.sessionId = '';
|
|
4078
|
+
message.type = 0;
|
|
4193
4079
|
if (value !== undefined)
|
|
4194
4080
|
reflectionMergePartial(this, message, value);
|
|
4195
4081
|
return message;
|
|
@@ -4275,11 +4161,11 @@ class TrackUnpublished$Type extends MessageType {
|
|
|
4275
4161
|
]);
|
|
4276
4162
|
}
|
|
4277
4163
|
create(value) {
|
|
4278
|
-
const message =
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4164
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4165
|
+
message.userId = '';
|
|
4166
|
+
message.sessionId = '';
|
|
4167
|
+
message.type = 0;
|
|
4168
|
+
message.cause = 0;
|
|
4283
4169
|
if (value !== undefined)
|
|
4284
4170
|
reflectionMergePartial(this, message, value);
|
|
4285
4171
|
return message;
|
|
@@ -4369,16 +4255,11 @@ class JoinRequest$Type extends MessageType {
|
|
|
4369
4255
|
]);
|
|
4370
4256
|
}
|
|
4371
4257
|
create(value) {
|
|
4372
|
-
const message =
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
};
|
|
4378
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
4379
|
-
enumerable: false,
|
|
4380
|
-
value: this,
|
|
4381
|
-
});
|
|
4258
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4259
|
+
message.token = '';
|
|
4260
|
+
message.sessionId = '';
|
|
4261
|
+
message.subscriberSdp = '';
|
|
4262
|
+
message.fastReconnect = false;
|
|
4382
4263
|
if (value !== undefined)
|
|
4383
4264
|
reflectionMergePartial(this, message, value);
|
|
4384
4265
|
return message;
|
|
@@ -4473,11 +4354,10 @@ class Migration$Type extends MessageType {
|
|
|
4473
4354
|
]);
|
|
4474
4355
|
}
|
|
4475
4356
|
create(value) {
|
|
4476
|
-
const message =
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
});
|
|
4357
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4358
|
+
message.fromSfuId = '';
|
|
4359
|
+
message.announcedTracks = [];
|
|
4360
|
+
message.subscriptions = [];
|
|
4481
4361
|
if (value !== undefined)
|
|
4482
4362
|
reflectionMergePartial(this, message, value);
|
|
4483
4363
|
return message;
|
|
@@ -4536,11 +4416,8 @@ class JoinResponse$Type extends MessageType {
|
|
|
4536
4416
|
]);
|
|
4537
4417
|
}
|
|
4538
4418
|
create(value) {
|
|
4539
|
-
const message =
|
|
4540
|
-
|
|
4541
|
-
enumerable: false,
|
|
4542
|
-
value: this,
|
|
4543
|
-
});
|
|
4419
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4420
|
+
message.reconnected = false;
|
|
4544
4421
|
if (value !== undefined)
|
|
4545
4422
|
reflectionMergePartial(this, message, value);
|
|
4546
4423
|
return message;
|
|
@@ -4593,11 +4470,8 @@ class ParticipantJoined$Type extends MessageType {
|
|
|
4593
4470
|
]);
|
|
4594
4471
|
}
|
|
4595
4472
|
create(value) {
|
|
4596
|
-
const message =
|
|
4597
|
-
|
|
4598
|
-
enumerable: false,
|
|
4599
|
-
value: this,
|
|
4600
|
-
});
|
|
4473
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4474
|
+
message.callCid = '';
|
|
4601
4475
|
if (value !== undefined)
|
|
4602
4476
|
reflectionMergePartial(this, message, value);
|
|
4603
4477
|
return message;
|
|
@@ -4650,11 +4524,8 @@ class ParticipantLeft$Type extends MessageType {
|
|
|
4650
4524
|
]);
|
|
4651
4525
|
}
|
|
4652
4526
|
create(value) {
|
|
4653
|
-
const message =
|
|
4654
|
-
|
|
4655
|
-
enumerable: false,
|
|
4656
|
-
value: this,
|
|
4657
|
-
});
|
|
4527
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4528
|
+
message.callCid = '';
|
|
4658
4529
|
if (value !== undefined)
|
|
4659
4530
|
reflectionMergePartial(this, message, value);
|
|
4660
4531
|
return message;
|
|
@@ -4707,11 +4578,9 @@ class SubscriberOffer$Type extends MessageType {
|
|
|
4707
4578
|
]);
|
|
4708
4579
|
}
|
|
4709
4580
|
create(value) {
|
|
4710
|
-
const message =
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
value: this,
|
|
4714
|
-
});
|
|
4581
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4582
|
+
message.iceRestart = false;
|
|
4583
|
+
message.sdp = '';
|
|
4715
4584
|
if (value !== undefined)
|
|
4716
4585
|
reflectionMergePartial(this, message, value);
|
|
4717
4586
|
return message;
|
|
@@ -4763,11 +4632,8 @@ class PublisherAnswer$Type extends MessageType {
|
|
|
4763
4632
|
]);
|
|
4764
4633
|
}
|
|
4765
4634
|
create(value) {
|
|
4766
|
-
const message =
|
|
4767
|
-
|
|
4768
|
-
enumerable: false,
|
|
4769
|
-
value: this,
|
|
4770
|
-
});
|
|
4635
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4636
|
+
message.sdp = '';
|
|
4771
4637
|
if (value !== undefined)
|
|
4772
4638
|
reflectionMergePartial(this, message, value);
|
|
4773
4639
|
return message;
|
|
@@ -4819,11 +4685,8 @@ class ConnectionQualityChanged$Type extends MessageType {
|
|
|
4819
4685
|
]);
|
|
4820
4686
|
}
|
|
4821
4687
|
create(value) {
|
|
4822
|
-
const message =
|
|
4823
|
-
|
|
4824
|
-
enumerable: false,
|
|
4825
|
-
value: this,
|
|
4826
|
-
});
|
|
4688
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4689
|
+
message.connectionQualityUpdates = [];
|
|
4827
4690
|
if (value !== undefined)
|
|
4828
4691
|
reflectionMergePartial(this, message, value);
|
|
4829
4692
|
return message;
|
|
@@ -4880,11 +4743,10 @@ class ConnectionQualityInfo$Type extends MessageType {
|
|
|
4880
4743
|
]);
|
|
4881
4744
|
}
|
|
4882
4745
|
create(value) {
|
|
4883
|
-
const message =
|
|
4884
|
-
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
});
|
|
4746
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4747
|
+
message.userId = '';
|
|
4748
|
+
message.sessionId = '';
|
|
4749
|
+
message.connectionQuality = 0;
|
|
4888
4750
|
if (value !== undefined)
|
|
4889
4751
|
reflectionMergePartial(this, message, value);
|
|
4890
4752
|
return message;
|
|
@@ -4943,11 +4805,9 @@ class DominantSpeakerChanged$Type extends MessageType {
|
|
|
4943
4805
|
]);
|
|
4944
4806
|
}
|
|
4945
4807
|
create(value) {
|
|
4946
|
-
const message =
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
value: this,
|
|
4950
|
-
});
|
|
4808
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4809
|
+
message.userId = '';
|
|
4810
|
+
message.sessionId = '';
|
|
4951
4811
|
if (value !== undefined)
|
|
4952
4812
|
reflectionMergePartial(this, message, value);
|
|
4953
4813
|
return message;
|
|
@@ -5002,11 +4862,11 @@ class AudioLevel$Type extends MessageType {
|
|
|
5002
4862
|
]);
|
|
5003
4863
|
}
|
|
5004
4864
|
create(value) {
|
|
5005
|
-
const message =
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
4865
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4866
|
+
message.userId = '';
|
|
4867
|
+
message.sessionId = '';
|
|
4868
|
+
message.level = 0;
|
|
4869
|
+
message.isSpeaking = false;
|
|
5010
4870
|
if (value !== undefined)
|
|
5011
4871
|
reflectionMergePartial(this, message, value);
|
|
5012
4872
|
return message;
|
|
@@ -5076,11 +4936,8 @@ class AudioLevelChanged$Type extends MessageType {
|
|
|
5076
4936
|
]);
|
|
5077
4937
|
}
|
|
5078
4938
|
create(value) {
|
|
5079
|
-
const message =
|
|
5080
|
-
|
|
5081
|
-
enumerable: false,
|
|
5082
|
-
value: this,
|
|
5083
|
-
});
|
|
4939
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4940
|
+
message.audioLevels = [];
|
|
5084
4941
|
if (value !== undefined)
|
|
5085
4942
|
reflectionMergePartial(this, message, value);
|
|
5086
4943
|
return message;
|
|
@@ -5131,11 +4988,8 @@ class AudioMediaRequest$Type extends MessageType {
|
|
|
5131
4988
|
]);
|
|
5132
4989
|
}
|
|
5133
4990
|
create(value) {
|
|
5134
|
-
const message =
|
|
5135
|
-
|
|
5136
|
-
enumerable: false,
|
|
5137
|
-
value: this,
|
|
5138
|
-
});
|
|
4991
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
4992
|
+
message.channelCount = 0;
|
|
5139
4993
|
if (value !== undefined)
|
|
5140
4994
|
reflectionMergePartial(this, message, value);
|
|
5141
4995
|
return message;
|
|
@@ -5187,11 +5041,7 @@ class AudioSender$Type extends MessageType {
|
|
|
5187
5041
|
]);
|
|
5188
5042
|
}
|
|
5189
5043
|
create(value) {
|
|
5190
|
-
const message =
|
|
5191
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
5192
|
-
enumerable: false,
|
|
5193
|
-
value: this,
|
|
5194
|
-
});
|
|
5044
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5195
5045
|
if (value !== undefined)
|
|
5196
5046
|
reflectionMergePartial(this, message, value);
|
|
5197
5047
|
return message;
|
|
@@ -5255,11 +5105,10 @@ class VideoMediaRequest$Type extends MessageType {
|
|
|
5255
5105
|
]);
|
|
5256
5106
|
}
|
|
5257
5107
|
create(value) {
|
|
5258
|
-
const message =
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
});
|
|
5108
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5109
|
+
message.idealHeight = 0;
|
|
5110
|
+
message.idealWidth = 0;
|
|
5111
|
+
message.idealFrameRate = 0;
|
|
5263
5112
|
if (value !== undefined)
|
|
5264
5113
|
reflectionMergePartial(this, message, value);
|
|
5265
5114
|
return message;
|
|
@@ -5342,18 +5191,13 @@ class VideoLayerSetting$Type extends MessageType {
|
|
|
5342
5191
|
]);
|
|
5343
5192
|
}
|
|
5344
5193
|
create(value) {
|
|
5345
|
-
const message =
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
};
|
|
5353
|
-
globalThis.Object.defineProperty(message, MESSAGE_TYPE, {
|
|
5354
|
-
enumerable: false,
|
|
5355
|
-
value: this,
|
|
5356
|
-
});
|
|
5194
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5195
|
+
message.name = '';
|
|
5196
|
+
message.active = false;
|
|
5197
|
+
message.maxBitrate = 0;
|
|
5198
|
+
message.scaleResolutionDownBy = 0;
|
|
5199
|
+
message.priority = 0;
|
|
5200
|
+
message.maxFramerate = 0;
|
|
5357
5201
|
if (value !== undefined)
|
|
5358
5202
|
reflectionMergePartial(this, message, value);
|
|
5359
5203
|
return message;
|
|
@@ -5448,11 +5292,8 @@ class VideoSender$Type extends MessageType {
|
|
|
5448
5292
|
]);
|
|
5449
5293
|
}
|
|
5450
5294
|
create(value) {
|
|
5451
|
-
const message =
|
|
5452
|
-
|
|
5453
|
-
enumerable: false,
|
|
5454
|
-
value: this,
|
|
5455
|
-
});
|
|
5295
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5296
|
+
message.layers = [];
|
|
5456
5297
|
if (value !== undefined)
|
|
5457
5298
|
reflectionMergePartial(this, message, value);
|
|
5458
5299
|
return message;
|
|
@@ -5523,11 +5364,9 @@ class ChangePublishQuality$Type extends MessageType {
|
|
|
5523
5364
|
]);
|
|
5524
5365
|
}
|
|
5525
5366
|
create(value) {
|
|
5526
|
-
const message =
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
value: this,
|
|
5530
|
-
});
|
|
5367
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5368
|
+
message.audioSenders = [];
|
|
5369
|
+
message.videoSenders = [];
|
|
5531
5370
|
if (value !== undefined)
|
|
5532
5371
|
reflectionMergePartial(this, message, value);
|
|
5533
5372
|
return message;
|
|
@@ -5580,11 +5419,8 @@ class CallGrantsUpdated$Type extends MessageType {
|
|
|
5580
5419
|
]);
|
|
5581
5420
|
}
|
|
5582
5421
|
create(value) {
|
|
5583
|
-
const message =
|
|
5584
|
-
|
|
5585
|
-
enumerable: false,
|
|
5586
|
-
value: this,
|
|
5587
|
-
});
|
|
5422
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5423
|
+
message.message = '';
|
|
5588
5424
|
if (value !== undefined)
|
|
5589
5425
|
reflectionMergePartial(this, message, value);
|
|
5590
5426
|
return message;
|
|
@@ -5645,11 +5481,8 @@ class GoAway$Type extends MessageType {
|
|
|
5645
5481
|
]);
|
|
5646
5482
|
}
|
|
5647
5483
|
create(value) {
|
|
5648
|
-
const message =
|
|
5649
|
-
|
|
5650
|
-
enumerable: false,
|
|
5651
|
-
value: this,
|
|
5652
|
-
});
|
|
5484
|
+
const message = globalThis.Object.create(this.messagePrototype);
|
|
5485
|
+
message.reason = 0;
|
|
5653
5486
|
if (value !== undefined)
|
|
5654
5487
|
reflectionMergePartial(this, message, value);
|
|
5655
5488
|
return message;
|
|
@@ -5972,21 +5805,24 @@ const isSfuEvent = (eventName) => {
|
|
|
5972
5805
|
};
|
|
5973
5806
|
class Dispatcher {
|
|
5974
5807
|
constructor() {
|
|
5808
|
+
this.logger = getLogger(['Dispatcher']);
|
|
5975
5809
|
this.subscribers = {};
|
|
5976
|
-
this.logger = getLogger(['sfu-client']);
|
|
5977
5810
|
this.dispatch = (message) => {
|
|
5978
5811
|
const eventKind = message.eventPayload.oneofKind;
|
|
5979
|
-
if (eventKind)
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
}
|
|
5812
|
+
if (!eventKind)
|
|
5813
|
+
return;
|
|
5814
|
+
const payload = message.eventPayload[eventKind];
|
|
5815
|
+
this.logger('debug', `Dispatching ${eventKind}`, payload);
|
|
5816
|
+
const listeners = this.subscribers[eventKind];
|
|
5817
|
+
if (!listeners)
|
|
5818
|
+
return;
|
|
5819
|
+
for (const fn of listeners) {
|
|
5820
|
+
try {
|
|
5821
|
+
fn(payload);
|
|
5822
|
+
}
|
|
5823
|
+
catch (e) {
|
|
5824
|
+
this.logger('warn', 'Listener failed with error', e);
|
|
5825
|
+
}
|
|
5990
5826
|
}
|
|
5991
5827
|
};
|
|
5992
5828
|
this.on = (eventName, fn) => {
|
|
@@ -6018,6 +5854,7 @@ class IceTrickleBuffer {
|
|
|
6018
5854
|
constructor() {
|
|
6019
5855
|
this.subscriberCandidates = new ReplaySubject();
|
|
6020
5856
|
this.publisherCandidates = new ReplaySubject();
|
|
5857
|
+
this.logger = getLogger(['sfu-client']);
|
|
6021
5858
|
this.push = (iceTrickle) => {
|
|
6022
5859
|
if (iceTrickle.peerType === PeerType.SUBSCRIBER) {
|
|
6023
5860
|
this.subscriberCandidates.next(iceTrickle);
|
|
@@ -6026,10 +5863,9 @@ class IceTrickleBuffer {
|
|
|
6026
5863
|
this.publisherCandidates.next(iceTrickle);
|
|
6027
5864
|
}
|
|
6028
5865
|
else {
|
|
6029
|
-
this.logger
|
|
5866
|
+
this.logger('warn', `ICETrickle, Unknown peer type`, iceTrickle);
|
|
6030
5867
|
}
|
|
6031
5868
|
};
|
|
6032
|
-
this.logger = getLogger(['sfu-client']);
|
|
6033
5869
|
}
|
|
6034
5870
|
}
|
|
6035
5871
|
|
|
@@ -8119,10 +7955,7 @@ class Publisher {
|
|
|
8119
7955
|
this.isDtxEnabled = isDtxEnabled;
|
|
8120
7956
|
this.isRedEnabled = isRedEnabled;
|
|
8121
7957
|
this.iceRestartDelay = iceRestartDelay;
|
|
8122
|
-
this.unsubscribeOnIceRestart = dispatcher.on('iceRestart', async (
|
|
8123
|
-
if (message.eventPayload.oneofKind !== 'iceRestart')
|
|
8124
|
-
return;
|
|
8125
|
-
const { iceRestart } = message.eventPayload;
|
|
7958
|
+
this.unsubscribeOnIceRestart = dispatcher.on('iceRestart', async (iceRestart) => {
|
|
8126
7959
|
if (iceRestart.peerType !== PeerType.PUBLISHER_UNSPECIFIED)
|
|
8127
7960
|
return;
|
|
8128
7961
|
await this.restartIce();
|
|
@@ -8398,16 +8231,10 @@ class Subscriber {
|
|
|
8398
8231
|
this.state = state;
|
|
8399
8232
|
this.iceRestartDelay = iceRestartDelay;
|
|
8400
8233
|
this.pc = this.createPeerConnection(connectionConfig);
|
|
8401
|
-
this.unregisterOnSubscriberOffer = dispatcher.on('subscriberOffer', async (
|
|
8402
|
-
if (message.eventPayload.oneofKind !== 'subscriberOffer')
|
|
8403
|
-
return;
|
|
8404
|
-
const { subscriberOffer } = message.eventPayload;
|
|
8234
|
+
this.unregisterOnSubscriberOffer = dispatcher.on('subscriberOffer', async (subscriberOffer) => {
|
|
8405
8235
|
await this.negotiate(subscriberOffer);
|
|
8406
8236
|
});
|
|
8407
|
-
this.unregisterOnIceRestart = dispatcher.on('iceRestart', async (
|
|
8408
|
-
if (message.eventPayload.oneofKind !== 'iceRestart')
|
|
8409
|
-
return;
|
|
8410
|
-
const { iceRestart } = message.eventPayload;
|
|
8237
|
+
this.unregisterOnIceRestart = dispatcher.on('iceRestart', async (iceRestart) => {
|
|
8411
8238
|
if (iceRestart.peerType !== PeerType.SUBSCRIBER)
|
|
8412
8239
|
return;
|
|
8413
8240
|
await this.restartIce();
|
|
@@ -8730,10 +8557,7 @@ class StreamSfuClient {
|
|
|
8730
8557
|
// connection is established. In that case, those events (ICE candidates)
|
|
8731
8558
|
// need to be buffered and later added to the appropriate PeerConnection
|
|
8732
8559
|
// once the remoteDescription is known and set.
|
|
8733
|
-
this.unsubscribeIceTrickle = dispatcher.on('iceTrickle', (
|
|
8734
|
-
if (e.eventPayload.oneofKind !== 'iceTrickle')
|
|
8735
|
-
return;
|
|
8736
|
-
const { iceTrickle } = e.eventPayload;
|
|
8560
|
+
this.unsubscribeIceTrickle = dispatcher.on('iceTrickle', (iceTrickle) => {
|
|
8737
8561
|
this.iceTrickleBuffer.push(iceTrickle);
|
|
8738
8562
|
});
|
|
8739
8563
|
this.signalWs = createWebSocketSignalChannel({
|
|
@@ -8812,11 +8636,9 @@ const retryable = async (rpc, logger) => {
|
|
|
8812
8636
|
*/
|
|
8813
8637
|
const watchCallAccepted = (call) => {
|
|
8814
8638
|
return async function onCallAccepted(event) {
|
|
8815
|
-
|
|
8816
|
-
|
|
8817
|
-
event.user.id === call.currentUserId) {
|
|
8639
|
+
// We want to discard the event if it's from the current user
|
|
8640
|
+
if (event.user.id === call.currentUserId)
|
|
8818
8641
|
return;
|
|
8819
|
-
}
|
|
8820
8642
|
const { state } = call;
|
|
8821
8643
|
if (event.call.created_by.id === call.currentUserId &&
|
|
8822
8644
|
state.callingState === CallingState.RINGING) {
|
|
@@ -8830,8 +8652,6 @@ const watchCallAccepted = (call) => {
|
|
|
8830
8652
|
*/
|
|
8831
8653
|
const watchCallRejected = (call) => {
|
|
8832
8654
|
return async function onCallRejected(event) {
|
|
8833
|
-
if (event.type !== 'call.rejected')
|
|
8834
|
-
return;
|
|
8835
8655
|
// We want to discard the event if it's from the current user
|
|
8836
8656
|
if (event.user.id === call.currentUserId)
|
|
8837
8657
|
return;
|
|
@@ -8868,9 +8688,7 @@ const watchCallRejected = (call) => {
|
|
|
8868
8688
|
* Event handler that watches the delivery of `call.ended` Websocket event.
|
|
8869
8689
|
*/
|
|
8870
8690
|
const watchCallEnded = (call) => {
|
|
8871
|
-
return async function
|
|
8872
|
-
if (event.type !== 'call.ended')
|
|
8873
|
-
return;
|
|
8691
|
+
return async function onCallEnded() {
|
|
8874
8692
|
const { callingState } = call.state;
|
|
8875
8693
|
if (callingState === CallingState.RINGING ||
|
|
8876
8694
|
callingState === CallingState.JOINED ||
|
|
@@ -8887,9 +8705,7 @@ const watchCallEnded = (call) => {
|
|
|
8887
8705
|
*/
|
|
8888
8706
|
const watchCallGrantsUpdated = (state) => {
|
|
8889
8707
|
return function onCallGrantsUpdated(event) {
|
|
8890
|
-
|
|
8891
|
-
return;
|
|
8892
|
-
const { currentGrants } = event.eventPayload.callGrantsUpdated;
|
|
8708
|
+
const { currentGrants } = event;
|
|
8893
8709
|
if (currentGrants) {
|
|
8894
8710
|
const { canPublishAudio, canPublishVideo, canScreenshare } = currentGrants;
|
|
8895
8711
|
const update = {
|
|
@@ -8914,9 +8730,7 @@ const logger$1 = getLogger(['events']);
|
|
|
8914
8730
|
*/
|
|
8915
8731
|
const watchChangePublishQuality = (dispatcher, call) => {
|
|
8916
8732
|
return dispatcher.on('changePublishQuality', (e) => {
|
|
8917
|
-
|
|
8918
|
-
return;
|
|
8919
|
-
const { videoSenders } = e.eventPayload.changePublishQuality;
|
|
8733
|
+
const { videoSenders } = e;
|
|
8920
8734
|
videoSenders.forEach((videoSender) => {
|
|
8921
8735
|
const { layers } = videoSender;
|
|
8922
8736
|
call.updatePublishQuality(layers.filter((l) => l.active));
|
|
@@ -8925,10 +8739,7 @@ const watchChangePublishQuality = (dispatcher, call) => {
|
|
|
8925
8739
|
};
|
|
8926
8740
|
const watchConnectionQualityChanged = (dispatcher, state) => {
|
|
8927
8741
|
return dispatcher.on('connectionQualityChanged', (e) => {
|
|
8928
|
-
|
|
8929
|
-
return;
|
|
8930
|
-
const { connectionQualityChanged } = e.eventPayload;
|
|
8931
|
-
const { connectionQualityUpdates } = connectionQualityChanged;
|
|
8742
|
+
const { connectionQualityUpdates } = e;
|
|
8932
8743
|
if (!connectionQualityUpdates)
|
|
8933
8744
|
return;
|
|
8934
8745
|
state.updateParticipants(connectionQualityUpdates.reduce((patches, update) => {
|
|
@@ -8946,9 +8757,7 @@ const watchConnectionQualityChanged = (dispatcher, state) => {
|
|
|
8946
8757
|
*/
|
|
8947
8758
|
const watchParticipantCountChanged = (dispatcher, state) => {
|
|
8948
8759
|
return dispatcher.on('healthCheckResponse', (e) => {
|
|
8949
|
-
|
|
8950
|
-
return;
|
|
8951
|
-
const { participantCount } = e.eventPayload.healthCheckResponse;
|
|
8760
|
+
const { participantCount } = e;
|
|
8952
8761
|
if (participantCount) {
|
|
8953
8762
|
state.setParticipantCount(participantCount.total);
|
|
8954
8763
|
state.setAnonymousParticipantCount(participantCount.anonymous);
|
|
@@ -8957,12 +8766,13 @@ const watchParticipantCountChanged = (dispatcher, state) => {
|
|
|
8957
8766
|
};
|
|
8958
8767
|
const watchLiveEnded = (dispatcher, call) => {
|
|
8959
8768
|
return dispatcher.on('error', (e) => {
|
|
8960
|
-
if (e.
|
|
8961
|
-
!e.eventPayload.error.error ||
|
|
8962
|
-
e.eventPayload.error.error.code !== ErrorCode.LIVE_ENDED)
|
|
8769
|
+
if (e.error && e.error.code !== ErrorCode.LIVE_ENDED)
|
|
8963
8770
|
return;
|
|
8964
|
-
if (!call.permissionsContext.hasPermission(OwnCapability.JOIN_BACKSTAGE))
|
|
8965
|
-
call.leave()
|
|
8771
|
+
if (!call.permissionsContext.hasPermission(OwnCapability.JOIN_BACKSTAGE)) {
|
|
8772
|
+
call.leave().catch((err) => {
|
|
8773
|
+
logger$1('error', 'Failed to leave call after live ended', err);
|
|
8774
|
+
});
|
|
8775
|
+
}
|
|
8966
8776
|
});
|
|
8967
8777
|
};
|
|
8968
8778
|
/**
|
|
@@ -8970,9 +8780,9 @@ const watchLiveEnded = (dispatcher, call) => {
|
|
|
8970
8780
|
*/
|
|
8971
8781
|
const watchSfuErrorReports = (dispatcher) => {
|
|
8972
8782
|
return dispatcher.on('error', (e) => {
|
|
8973
|
-
if (
|
|
8783
|
+
if (!e.error)
|
|
8974
8784
|
return;
|
|
8975
|
-
const error = e
|
|
8785
|
+
const { error } = e;
|
|
8976
8786
|
logger$1('error', 'SFU reported error', {
|
|
8977
8787
|
code: ErrorCode[error.code],
|
|
8978
8788
|
message: error.message,
|
|
@@ -8986,9 +8796,7 @@ const watchSfuErrorReports = (dispatcher) => {
|
|
|
8986
8796
|
*/
|
|
8987
8797
|
const watchPinsUpdated = (state) => {
|
|
8988
8798
|
return function onPinsUpdated(e) {
|
|
8989
|
-
|
|
8990
|
-
return;
|
|
8991
|
-
const { pins } = e.eventPayload.pinsUpdated;
|
|
8799
|
+
const { pins } = e;
|
|
8992
8800
|
state.setServerSidePins(pins);
|
|
8993
8801
|
};
|
|
8994
8802
|
};
|
|
@@ -9000,9 +8808,7 @@ const watchPinsUpdated = (state) => {
|
|
|
9000
8808
|
*/
|
|
9001
8809
|
const handleRemoteSoftMute = (call) => {
|
|
9002
8810
|
return call.on('trackUnpublished', async (event) => {
|
|
9003
|
-
|
|
9004
|
-
return;
|
|
9005
|
-
const { trackUnpublished: { cause, type, sessionId }, } = event.eventPayload;
|
|
8811
|
+
const { cause, type, sessionId } = event;
|
|
9006
8812
|
const { localParticipant } = call.state;
|
|
9007
8813
|
if (cause === TrackUnpublishReason.MODERATION &&
|
|
9008
8814
|
sessionId === localParticipant?.sessionId) {
|
|
@@ -9034,9 +8840,7 @@ const handleRemoteSoftMute = (call) => {
|
|
|
9034
8840
|
*/
|
|
9035
8841
|
const watchParticipantJoined = (state) => {
|
|
9036
8842
|
return function onParticipantJoined(e) {
|
|
9037
|
-
|
|
9038
|
-
return;
|
|
9039
|
-
const { participant } = e.eventPayload.participantJoined;
|
|
8843
|
+
const { participant } = e;
|
|
9040
8844
|
if (!participant)
|
|
9041
8845
|
return;
|
|
9042
8846
|
// `state.updateOrAddParticipant` acts as a safeguard against
|
|
@@ -9060,9 +8864,7 @@ const watchParticipantJoined = (state) => {
|
|
|
9060
8864
|
*/
|
|
9061
8865
|
const watchParticipantLeft = (state) => {
|
|
9062
8866
|
return function onParticipantLeft(e) {
|
|
9063
|
-
|
|
9064
|
-
return;
|
|
9065
|
-
const { participant } = e.eventPayload.participantLeft;
|
|
8867
|
+
const { participant } = e;
|
|
9066
8868
|
if (!participant)
|
|
9067
8869
|
return;
|
|
9068
8870
|
state.setParticipants((participants) => participants.filter((p) => p.sessionId !== participant.sessionId));
|
|
@@ -9074,9 +8876,7 @@ const watchParticipantLeft = (state) => {
|
|
|
9074
8876
|
*/
|
|
9075
8877
|
const watchTrackPublished = (state) => {
|
|
9076
8878
|
return function onTrackPublished(e) {
|
|
9077
|
-
|
|
9078
|
-
return;
|
|
9079
|
-
const { trackPublished: { type, sessionId, participant }, } = e.eventPayload;
|
|
8879
|
+
const { type, sessionId, participant } = e;
|
|
9080
8880
|
// An optimization for large calls.
|
|
9081
8881
|
// After a certain threshold, the SFU would stop emitting `participantJoined`
|
|
9082
8882
|
// events, and instead, it would only provide the participant's information
|
|
@@ -9097,9 +8897,7 @@ const watchTrackPublished = (state) => {
|
|
|
9097
8897
|
*/
|
|
9098
8898
|
const watchTrackUnpublished = (state) => {
|
|
9099
8899
|
return function onTrackUnpublished(e) {
|
|
9100
|
-
|
|
9101
|
-
return;
|
|
9102
|
-
const { trackUnpublished: { type, sessionId, participant }, } = e.eventPayload;
|
|
8900
|
+
const { type, sessionId, participant } = e;
|
|
9103
8901
|
// An optimization for large calls. See `watchTrackPublished`.
|
|
9104
8902
|
if (participant) {
|
|
9105
8903
|
state.updateOrAddParticipant(sessionId, participant);
|
|
@@ -9118,9 +8916,7 @@ const unique = (v, i, arr) => arr.indexOf(v) === i;
|
|
|
9118
8916
|
*/
|
|
9119
8917
|
const watchDominantSpeakerChanged = (dispatcher, state) => {
|
|
9120
8918
|
return dispatcher.on('dominantSpeakerChanged', (e) => {
|
|
9121
|
-
|
|
9122
|
-
return;
|
|
9123
|
-
const { dominantSpeakerChanged: { sessionId }, } = e.eventPayload;
|
|
8919
|
+
const { sessionId } = e;
|
|
9124
8920
|
if (sessionId === state.dominantSpeaker?.sessionId)
|
|
9125
8921
|
return;
|
|
9126
8922
|
state.setParticipants((participants) => participants.map((participant) => {
|
|
@@ -9147,9 +8943,7 @@ const watchDominantSpeakerChanged = (dispatcher, state) => {
|
|
|
9147
8943
|
*/
|
|
9148
8944
|
const watchAudioLevelChanged = (dispatcher, state) => {
|
|
9149
8945
|
return dispatcher.on('audioLevelChanged', (e) => {
|
|
9150
|
-
|
|
9151
|
-
return;
|
|
9152
|
-
const { audioLevels } = e.eventPayload.audioLevelChanged;
|
|
8946
|
+
const { audioLevels } = e;
|
|
9153
8947
|
state.updateParticipants(audioLevels.reduce((patches, current) => {
|
|
9154
8948
|
patches[current.sessionId] = {
|
|
9155
8949
|
audioLevel: current.level,
|
|
@@ -9870,8 +9664,11 @@ class DynascaleManager {
|
|
|
9870
9664
|
audioElement.setSinkId(deviceId);
|
|
9871
9665
|
}
|
|
9872
9666
|
});
|
|
9873
|
-
const volumeSubscription =
|
|
9874
|
-
|
|
9667
|
+
const volumeSubscription = combineLatest([
|
|
9668
|
+
this.call.speaker.state.volume$,
|
|
9669
|
+
participant$.pipe(distinctUntilKeyChanged('audioVolume')),
|
|
9670
|
+
]).subscribe(([volume, p]) => {
|
|
9671
|
+
audioElement.volume = p.audioVolume ?? volume;
|
|
9875
9672
|
});
|
|
9876
9673
|
audioElement.autoplay = true;
|
|
9877
9674
|
return () => {
|
|
@@ -10565,7 +10362,13 @@ class InputMediaDeviceManagerState {
|
|
|
10565
10362
|
return notifyGranted();
|
|
10566
10363
|
}
|
|
10567
10364
|
let permissionState;
|
|
10568
|
-
const notify = () => subscriber.next(
|
|
10365
|
+
const notify = () => subscriber.next(
|
|
10366
|
+
// In Safari, the `change` event doesn't reliably emit and hence,
|
|
10367
|
+
// permissionState stays in 'prompt' state forever.
|
|
10368
|
+
// Instead of checking if a permission is granted, we check if it isn't denied
|
|
10369
|
+
isSafari()
|
|
10370
|
+
? permissionState.state !== 'denied'
|
|
10371
|
+
: permissionState.state === 'granted');
|
|
10569
10372
|
navigator.permissions
|
|
10570
10373
|
.query({ name: this.permissionName })
|
|
10571
10374
|
.then((permissionStatus) => {
|
|
@@ -11229,12 +11032,13 @@ class SpeakerState {
|
|
|
11229
11032
|
}
|
|
11230
11033
|
|
|
11231
11034
|
class SpeakerManager {
|
|
11232
|
-
constructor() {
|
|
11035
|
+
constructor(call) {
|
|
11233
11036
|
this.state = new SpeakerState();
|
|
11234
11037
|
this.subscriptions = [];
|
|
11235
11038
|
this.removeSubscriptions = () => {
|
|
11236
11039
|
this.subscriptions.forEach((s) => s.unsubscribe());
|
|
11237
11040
|
};
|
|
11041
|
+
this.call = call;
|
|
11238
11042
|
if (deviceIds$ && !isReactNative()) {
|
|
11239
11043
|
this.subscriptions.push(combineLatest([deviceIds$, this.state.selectedDevice$]).subscribe(([devices, deviceId]) => {
|
|
11240
11044
|
if (!deviceId) {
|
|
@@ -11258,7 +11062,7 @@ class SpeakerManager {
|
|
|
11258
11062
|
return getAudioOutputDevices();
|
|
11259
11063
|
}
|
|
11260
11064
|
/**
|
|
11261
|
-
* Select device
|
|
11065
|
+
* Select a device.
|
|
11262
11066
|
*
|
|
11263
11067
|
* Note: this method is not supported in React Native
|
|
11264
11068
|
*
|
|
@@ -11272,7 +11076,7 @@ class SpeakerManager {
|
|
|
11272
11076
|
}
|
|
11273
11077
|
/**
|
|
11274
11078
|
* Set the volume of the audio elements
|
|
11275
|
-
* @param volume a number between 0 and 1
|
|
11079
|
+
* @param volume a number between 0 and 1.
|
|
11276
11080
|
*
|
|
11277
11081
|
* Note: this method is not supported in React Native
|
|
11278
11082
|
*/
|
|
@@ -11285,6 +11089,23 @@ class SpeakerManager {
|
|
|
11285
11089
|
}
|
|
11286
11090
|
this.state.setVolume(volume);
|
|
11287
11091
|
}
|
|
11092
|
+
/**
|
|
11093
|
+
* Set the volume of a participant.
|
|
11094
|
+
*
|
|
11095
|
+
* Note: this method is not supported in React Native.
|
|
11096
|
+
*
|
|
11097
|
+
* @param sessionId the participant's session id.
|
|
11098
|
+
* @param volume a number between 0 and 1. Set it to `undefined` to use the default volume.
|
|
11099
|
+
*/
|
|
11100
|
+
setParticipantVolume(sessionId, volume) {
|
|
11101
|
+
if (isReactNative()) {
|
|
11102
|
+
throw new Error('This feature is not supported in React Native');
|
|
11103
|
+
}
|
|
11104
|
+
if (volume && (volume < 0 || volume > 1)) {
|
|
11105
|
+
throw new Error('Volume must be between 0 and 1, or undefined');
|
|
11106
|
+
}
|
|
11107
|
+
this.call.state.updateParticipant(sessionId, { audioVolume: volume });
|
|
11108
|
+
}
|
|
11288
11109
|
}
|
|
11289
11110
|
|
|
11290
11111
|
/**
|
|
@@ -11326,6 +11147,46 @@ class Call {
|
|
|
11326
11147
|
*/
|
|
11327
11148
|
this.leaveCallHooks = new Set();
|
|
11328
11149
|
this.streamClientEventHandlers = new Map();
|
|
11150
|
+
/**
|
|
11151
|
+
* You can subscribe to WebSocket events provided by the API. To remove a subscription, call the `off` method.
|
|
11152
|
+
* Please note that subscribing to WebSocket events is an advanced use-case.
|
|
11153
|
+
* For most use-cases, it should be enough to watch for state changes.
|
|
11154
|
+
*
|
|
11155
|
+
* @param eventName the event name.
|
|
11156
|
+
* @param fn the event handler.
|
|
11157
|
+
*/
|
|
11158
|
+
this.on = (eventName, fn) => {
|
|
11159
|
+
if (isSfuEvent(eventName)) {
|
|
11160
|
+
return this.dispatcher.on(eventName, fn);
|
|
11161
|
+
}
|
|
11162
|
+
const offHandler = this.streamClient.on(eventName, (e) => {
|
|
11163
|
+
const event = e;
|
|
11164
|
+
if (event.call_cid && event.call_cid === this.cid) {
|
|
11165
|
+
fn(event);
|
|
11166
|
+
}
|
|
11167
|
+
});
|
|
11168
|
+
// keep the 'off' reference returned by the stream client
|
|
11169
|
+
this.streamClientEventHandlers.set(fn, offHandler);
|
|
11170
|
+
return () => {
|
|
11171
|
+
this.off(eventName, fn);
|
|
11172
|
+
};
|
|
11173
|
+
};
|
|
11174
|
+
/**
|
|
11175
|
+
* Remove subscription for WebSocket events that were created by the `on` method.
|
|
11176
|
+
*
|
|
11177
|
+
* @param eventName the event name.
|
|
11178
|
+
* @param fn the event handler.
|
|
11179
|
+
*/
|
|
11180
|
+
this.off = (eventName, fn) => {
|
|
11181
|
+
if (isSfuEvent(eventName)) {
|
|
11182
|
+
return this.dispatcher.off(eventName, fn);
|
|
11183
|
+
}
|
|
11184
|
+
// unsubscribe from the stream client event by using the 'off' reference
|
|
11185
|
+
const registeredOffHandler = this.streamClientEventHandlers.get(fn);
|
|
11186
|
+
if (registeredOffHandler) {
|
|
11187
|
+
registeredOffHandler();
|
|
11188
|
+
}
|
|
11189
|
+
};
|
|
11329
11190
|
/**
|
|
11330
11191
|
* Leave the call and stop the media streams that were published by the call.
|
|
11331
11192
|
*/
|
|
@@ -11609,9 +11470,7 @@ class Call {
|
|
|
11609
11470
|
sfuClient.signalReady.then(() => {
|
|
11610
11471
|
// register a handler for the "goAway" event
|
|
11611
11472
|
const unregisterGoAway = this.dispatcher.on('goAway', (event) => {
|
|
11612
|
-
|
|
11613
|
-
return;
|
|
11614
|
-
const { reason } = event.eventPayload.goAway;
|
|
11473
|
+
const { reason } = event;
|
|
11615
11474
|
this.logger('info', `[Migration]: Going away from SFU... Reason: ${GoAwayReason[reason]}`);
|
|
11616
11475
|
reconnect('migrate').catch((err) => {
|
|
11617
11476
|
this.logger('warn', `[Migration]: Failed to migrate to another SFU.`, err);
|
|
@@ -11836,11 +11695,9 @@ class Call {
|
|
|
11836
11695
|
this.waitForJoinResponse = (timeout = 5000) => {
|
|
11837
11696
|
return new Promise((resolve, reject) => {
|
|
11838
11697
|
const unsubscribe = this.on('joinResponse', (event) => {
|
|
11839
|
-
if (event.eventPayload.oneofKind !== 'joinResponse')
|
|
11840
|
-
return;
|
|
11841
11698
|
clearTimeout(timeoutId);
|
|
11842
11699
|
unsubscribe();
|
|
11843
|
-
resolve(event
|
|
11700
|
+
resolve(event);
|
|
11844
11701
|
});
|
|
11845
11702
|
const timeoutId = setTimeout(() => {
|
|
11846
11703
|
unsubscribe();
|
|
@@ -12493,7 +12350,7 @@ class Call {
|
|
|
12493
12350
|
this.leaveCallHooks.add(createSubscription(this.trackSubscriptionsSubject.pipe(debounce((v) => timer(v.type)), map$1((v) => v.data)), (subscriptions) => this.sfuClient?.updateSubscriptions(subscriptions)));
|
|
12494
12351
|
this.camera = new CameraManager(this);
|
|
12495
12352
|
this.microphone = new MicrophoneManager(this);
|
|
12496
|
-
this.speaker = new SpeakerManager();
|
|
12353
|
+
this.speaker = new SpeakerManager(this);
|
|
12497
12354
|
this.screenShare = new ScreenShareManager(this);
|
|
12498
12355
|
}
|
|
12499
12356
|
registerEffects() {
|
|
@@ -12579,31 +12436,6 @@ class Call {
|
|
|
12579
12436
|
this.leaveCallHooks.add(registerRingingCallEventHandlers(this));
|
|
12580
12437
|
}));
|
|
12581
12438
|
}
|
|
12582
|
-
on(eventName, fn) {
|
|
12583
|
-
if (isSfuEvent(eventName)) {
|
|
12584
|
-
return this.dispatcher.on(eventName, fn);
|
|
12585
|
-
}
|
|
12586
|
-
else {
|
|
12587
|
-
const eventHandler = (event) => {
|
|
12588
|
-
if (event.call_cid && event.call_cid === this.cid) {
|
|
12589
|
-
fn(event);
|
|
12590
|
-
}
|
|
12591
|
-
};
|
|
12592
|
-
this.streamClientEventHandlers.set(fn, eventHandler);
|
|
12593
|
-
return this.streamClient.on(eventName, eventHandler);
|
|
12594
|
-
}
|
|
12595
|
-
}
|
|
12596
|
-
off(eventName, fn) {
|
|
12597
|
-
if (isSfuEvent(eventName)) {
|
|
12598
|
-
return this.dispatcher.off(eventName, fn);
|
|
12599
|
-
}
|
|
12600
|
-
else {
|
|
12601
|
-
const registeredEventHandler = this.streamClientEventHandlers.get(fn);
|
|
12602
|
-
if (registeredEventHandler) {
|
|
12603
|
-
return this.streamClient.off(eventName, registeredEventHandler);
|
|
12604
|
-
}
|
|
12605
|
-
}
|
|
12606
|
-
}
|
|
12607
12439
|
/**
|
|
12608
12440
|
* A flag indicating whether the call is "ringing" type of call.
|
|
12609
12441
|
*/
|
|
@@ -12855,18 +12687,19 @@ class StableWSConnection {
|
|
|
12855
12687
|
if (this.wsID !== wsID)
|
|
12856
12688
|
return;
|
|
12857
12689
|
this._log('onmessage() - onmessage callback', { event, wsID });
|
|
12858
|
-
const data = typeof event.data === 'string'
|
|
12690
|
+
const data = typeof event.data === 'string'
|
|
12691
|
+
? JSON.parse(event.data)
|
|
12692
|
+
: null;
|
|
12859
12693
|
// we wait till the first message before we consider the connection open.
|
|
12860
12694
|
// the reason for this is that auth errors and similar errors trigger a ws.onopen and immediately
|
|
12861
12695
|
// after that a ws.onclose.
|
|
12862
|
-
if (!this.isResolved && data && data.type === 'connection.
|
|
12696
|
+
if (!this.isResolved && data && data.type === 'connection.error') {
|
|
12863
12697
|
this.isResolved = true;
|
|
12864
12698
|
if (data.error) {
|
|
12699
|
+
// @ts-expect-error - the types of _errorFromWSEvent are incorrect
|
|
12865
12700
|
this.rejectPromise?.(this._errorFromWSEvent(data, false));
|
|
12866
12701
|
return;
|
|
12867
12702
|
}
|
|
12868
|
-
this.resolvePromise?.(data);
|
|
12869
|
-
this._setHealth(true);
|
|
12870
12703
|
}
|
|
12871
12704
|
// trigger the event..
|
|
12872
12705
|
this.lastEvent = new Date();
|
|
@@ -12875,8 +12708,12 @@ class StableWSConnection {
|
|
|
12875
12708
|
// the initial health-check should come from the client
|
|
12876
12709
|
this.scheduleNextPing();
|
|
12877
12710
|
}
|
|
12878
|
-
if (data && data.
|
|
12879
|
-
|
|
12711
|
+
if (data && data.type === 'connection.ok') {
|
|
12712
|
+
this.resolvePromise?.(data);
|
|
12713
|
+
this._setHealth(true);
|
|
12714
|
+
}
|
|
12715
|
+
if (data && data.type === 'connection.error' && data.error) {
|
|
12716
|
+
const { code } = data.error;
|
|
12880
12717
|
this.isHealthy = false;
|
|
12881
12718
|
this.isConnecting = false;
|
|
12882
12719
|
this.consecutiveFailures += 1;
|
|
@@ -12887,7 +12724,9 @@ class StableWSConnection {
|
|
|
12887
12724
|
this._reconnect({ refreshToken: true });
|
|
12888
12725
|
}
|
|
12889
12726
|
}
|
|
12890
|
-
|
|
12727
|
+
if (data) {
|
|
12728
|
+
this.client.dispatchEvent(data);
|
|
12729
|
+
}
|
|
12891
12730
|
this.scheduleConnectionCheck();
|
|
12892
12731
|
};
|
|
12893
12732
|
this.onclose = (wsID, event) => {
|
|
@@ -13826,6 +13665,7 @@ class StreamClient {
|
|
|
13826
13665
|
* @param {httpsAgent} [options.httpsAgent] - custom httpsAgent, in node it's default to https.agent()
|
|
13827
13666
|
*/
|
|
13828
13667
|
constructor(key, options) {
|
|
13668
|
+
this.listeners = {};
|
|
13829
13669
|
this.nextRequestAbortController = null;
|
|
13830
13670
|
this.devToken = (userID) => {
|
|
13831
13671
|
return DevToken(userID);
|
|
@@ -14015,41 +13855,31 @@ class StreamClient {
|
|
|
14015
13855
|
* on - Listen to events on all channels and users your watching
|
|
14016
13856
|
*
|
|
14017
13857
|
* client.on('message.new', event => {console.log("my new message", event, channel.state.messages)})
|
|
14018
|
-
* or
|
|
14019
|
-
* client.on(event => {console.log(event.type)})
|
|
14020
13858
|
*
|
|
14021
|
-
* @param
|
|
14022
|
-
* @param
|
|
13859
|
+
* @param eventName The event type to listen for (optional)
|
|
13860
|
+
* @param callback The callback to call
|
|
14023
13861
|
*
|
|
14024
|
-
* @return
|
|
13862
|
+
* @return Returns a function which, when called, unsubscribes the event handler.
|
|
14025
13863
|
*/
|
|
14026
|
-
this.on = (
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
? callbackOrNothing
|
|
14030
|
-
: callbackOrEventName;
|
|
14031
|
-
if (!(key in this.listeners)) {
|
|
14032
|
-
this.listeners[key] = [];
|
|
13864
|
+
this.on = (eventName, callback) => {
|
|
13865
|
+
if (!this.listeners[eventName]) {
|
|
13866
|
+
this.listeners[eventName] = [];
|
|
14033
13867
|
}
|
|
14034
|
-
this.
|
|
13868
|
+
this.logger('debug', `Adding listener for ${eventName} event`);
|
|
13869
|
+
this.listeners[eventName]?.push(callback);
|
|
14035
13870
|
return () => {
|
|
14036
|
-
this.off(
|
|
13871
|
+
this.off(eventName, callback);
|
|
14037
13872
|
};
|
|
14038
13873
|
};
|
|
14039
13874
|
/**
|
|
14040
13875
|
* off - Remove the event handler
|
|
14041
|
-
*
|
|
14042
13876
|
*/
|
|
14043
|
-
this.off = (
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
? callbackOrNothing
|
|
14047
|
-
: callbackOrEventName;
|
|
14048
|
-
if (!(key in this.listeners)) {
|
|
14049
|
-
this.listeners[key] = [];
|
|
13877
|
+
this.off = (eventName, callback) => {
|
|
13878
|
+
if (!this.listeners[eventName]) {
|
|
13879
|
+
this.listeners[eventName] = [];
|
|
14050
13880
|
}
|
|
14051
|
-
this.logger('debug', `Removing listener for ${
|
|
14052
|
-
this.listeners[
|
|
13881
|
+
this.logger('debug', `Removing listener for ${eventName} event`);
|
|
13882
|
+
this.listeners[eventName] = this.listeners[eventName]?.filter((value) => value !== callback);
|
|
14053
13883
|
};
|
|
14054
13884
|
this._logApiRequest = (type, url, data, config) => {
|
|
14055
13885
|
this.logger('trace', `client: ${type} - Request - ${url}`, {
|
|
@@ -14171,26 +14001,14 @@ class StreamClient {
|
|
|
14171
14001
|
if (!event.received_at)
|
|
14172
14002
|
event.received_at = new Date();
|
|
14173
14003
|
this.logger('debug', `Dispatching event: ${event.type}`, event);
|
|
14174
|
-
this.
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14180
|
-
|
|
14181
|
-
|
|
14182
|
-
this._callClientListeners = (event) => {
|
|
14183
|
-
const client = this;
|
|
14184
|
-
// gather and call the listeners
|
|
14185
|
-
const listeners = [];
|
|
14186
|
-
if (client.listeners.all) {
|
|
14187
|
-
listeners.push(...client.listeners.all);
|
|
14188
|
-
}
|
|
14189
|
-
if (client.listeners[event.type]) {
|
|
14190
|
-
listeners.push(...client.listeners[event.type]);
|
|
14191
|
-
}
|
|
14192
|
-
// call the event and send it to the listeners
|
|
14193
|
-
for (const listener of listeners) {
|
|
14004
|
+
if (!this.listeners)
|
|
14005
|
+
return;
|
|
14006
|
+
// call generic listeners
|
|
14007
|
+
for (const listener of this.listeners.all || []) {
|
|
14008
|
+
listener(event);
|
|
14009
|
+
}
|
|
14010
|
+
// call type specific listeners
|
|
14011
|
+
for (const listener of this.listeners[event.type] || []) {
|
|
14194
14012
|
listener(event);
|
|
14195
14013
|
}
|
|
14196
14014
|
};
|
|
@@ -14272,7 +14090,7 @@ class StreamClient {
|
|
|
14272
14090
|
});
|
|
14273
14091
|
};
|
|
14274
14092
|
this.getUserAgent = () => {
|
|
14275
|
-
const version = "0.
|
|
14093
|
+
const version = "0.6.1" ;
|
|
14276
14094
|
return (this.userAgent ||
|
|
14277
14095
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
14278
14096
|
};
|
|
@@ -14372,7 +14190,6 @@ class StreamClient {
|
|
|
14372
14190
|
};
|
|
14373
14191
|
// set the key
|
|
14374
14192
|
this.key = key;
|
|
14375
|
-
this.listeners = {};
|
|
14376
14193
|
// set the secret
|
|
14377
14194
|
this.secret = options?.secret;
|
|
14378
14195
|
// set the options... and figure out defaults...
|
|
@@ -14474,11 +14291,11 @@ class StreamVideoClient {
|
|
|
14474
14291
|
/**
|
|
14475
14292
|
* Remove subscription for WebSocket events that were created by the `on` method.
|
|
14476
14293
|
*
|
|
14477
|
-
* @param
|
|
14294
|
+
* @param eventName the event name.
|
|
14478
14295
|
* @param callback the callback which was passed to the `on` method.
|
|
14479
14296
|
*/
|
|
14480
|
-
this.off = (
|
|
14481
|
-
return this.streamClient.off(
|
|
14297
|
+
this.off = (eventName, callback) => {
|
|
14298
|
+
return this.streamClient.off(eventName, callback);
|
|
14482
14299
|
};
|
|
14483
14300
|
/**
|
|
14484
14301
|
* Creates a new call.
|
|
@@ -14567,7 +14384,6 @@ class StreamVideoClient {
|
|
|
14567
14384
|
*
|
|
14568
14385
|
* @param {string} id The device id
|
|
14569
14386
|
* @param {string} [userID] The user id. Only specify this for serverside requests
|
|
14570
|
-
*
|
|
14571
14387
|
*/
|
|
14572
14388
|
this.removeDevice = async (id, userID) => {
|
|
14573
14389
|
return await this.streamClient.delete('/devices', {
|
|
@@ -14691,8 +14507,7 @@ class StreamVideoClient {
|
|
|
14691
14507
|
if (connectUserResponse?.me) {
|
|
14692
14508
|
this.writeableStateStore.setConnectedUser(connectUserResponse.me);
|
|
14693
14509
|
}
|
|
14694
|
-
this.eventHandlersToUnregister.push(this.on('connection.changed', (
|
|
14695
|
-
const event = e;
|
|
14510
|
+
this.eventHandlersToUnregister.push(this.on('connection.changed', (event) => {
|
|
14696
14511
|
if (event.online) {
|
|
14697
14512
|
const callsToReWatch = this.writeableStateStore.calls
|
|
14698
14513
|
.filter((call) => call.watching)
|
|
@@ -14712,8 +14527,6 @@ class StreamVideoClient {
|
|
|
14712
14527
|
}
|
|
14713
14528
|
}));
|
|
14714
14529
|
this.eventHandlersToUnregister.push(this.on('call.created', (event) => {
|
|
14715
|
-
if (event.type !== 'call.created')
|
|
14716
|
-
return;
|
|
14717
14530
|
const { call, members } = event;
|
|
14718
14531
|
if (user.id === call.created_by.id) {
|
|
14719
14532
|
this.logger('warn', 'Received `call.created` sent by the current user');
|
|
@@ -14731,8 +14544,6 @@ class StreamVideoClient {
|
|
|
14731
14544
|
this.writeableStateStore.registerCall(newCall);
|
|
14732
14545
|
}));
|
|
14733
14546
|
this.eventHandlersToUnregister.push(this.on('call.ring', async (event) => {
|
|
14734
|
-
if (event.type !== 'call.ring')
|
|
14735
|
-
return;
|
|
14736
14547
|
const { call, members } = event;
|
|
14737
14548
|
if (user.id === call.created_by.id) {
|
|
14738
14549
|
this.logger('debug', 'Received `call.ring` sent by the current user so ignoring the event');
|