livekit-client 0.15.0 → 0.15.4
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/.gitmodules +3 -0
- package/README.md +21 -4
- package/dist/api/SignalClient.d.ts +11 -2
- package/dist/api/SignalClient.js +92 -25
- package/dist/api/SignalClient.js.map +1 -1
- package/dist/connect.js +3 -0
- package/dist/connect.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/logger.js +1 -0
- package/dist/logger.js.map +1 -1
- package/dist/options.d.ts +28 -14
- package/dist/proto/livekit_models.d.ts +48 -0
- package/dist/proto/livekit_models.js +367 -5
- package/dist/proto/livekit_models.js.map +1 -1
- package/dist/proto/livekit_rtc.d.ts +100 -1
- package/dist/proto/livekit_rtc.js +745 -3
- package/dist/proto/livekit_rtc.js.map +1 -1
- package/dist/room/PCTransport.js +4 -0
- package/dist/room/PCTransport.js.map +1 -1
- package/dist/room/RTCEngine.d.ts +4 -0
- package/dist/room/RTCEngine.js +73 -34
- package/dist/room/RTCEngine.js.map +1 -1
- package/dist/room/Room.d.ts +15 -0
- package/dist/room/Room.js +172 -59
- package/dist/room/Room.js.map +1 -1
- package/dist/room/events.d.ts +60 -24
- package/dist/room/events.js +58 -22
- package/dist/room/events.js.map +1 -1
- package/dist/room/participant/LocalParticipant.d.ts +26 -2
- package/dist/room/participant/LocalParticipant.js +69 -21
- package/dist/room/participant/LocalParticipant.js.map +1 -1
- package/dist/room/participant/Participant.d.ts +3 -1
- package/dist/room/participant/Participant.js +1 -0
- package/dist/room/participant/Participant.js.map +1 -1
- package/dist/room/participant/ParticipantTrackPermission.d.ts +19 -0
- package/dist/room/participant/ParticipantTrackPermission.js +16 -0
- package/dist/room/participant/ParticipantTrackPermission.js.map +1 -0
- package/dist/room/participant/RemoteParticipant.d.ts +2 -2
- package/dist/room/participant/RemoteParticipant.js +9 -15
- package/dist/room/participant/RemoteParticipant.js.map +1 -1
- package/dist/room/participant/publishUtils.d.ts +1 -1
- package/dist/room/participant/publishUtils.js +4 -4
- package/dist/room/participant/publishUtils.js.map +1 -1
- package/dist/room/participant/publishUtils.test.js +10 -1
- package/dist/room/participant/publishUtils.test.js.map +1 -1
- package/dist/room/stats.d.ts +21 -6
- package/dist/room/stats.js +22 -1
- package/dist/room/stats.js.map +1 -1
- package/dist/room/track/LocalAudioTrack.d.ts +5 -1
- package/dist/room/track/LocalAudioTrack.js +45 -1
- package/dist/room/track/LocalAudioTrack.js.map +1 -1
- package/dist/room/track/LocalTrack.js +1 -1
- package/dist/room/track/LocalTrack.js.map +1 -1
- package/dist/room/track/LocalTrackPublication.d.ts +3 -1
- package/dist/room/track/LocalTrackPublication.js +15 -5
- package/dist/room/track/LocalTrackPublication.js.map +1 -1
- package/dist/room/track/LocalVideoTrack.d.ts +8 -1
- package/dist/room/track/LocalVideoTrack.js +117 -52
- package/dist/room/track/LocalVideoTrack.js.map +1 -1
- package/dist/room/track/RemoteAudioTrack.d.ts +6 -8
- package/dist/room/track/RemoteAudioTrack.js +55 -19
- package/dist/room/track/RemoteAudioTrack.js.map +1 -1
- package/dist/room/track/RemoteTrack.d.ts +14 -0
- package/dist/room/track/RemoteTrack.js +47 -0
- package/dist/room/track/RemoteTrack.js.map +1 -0
- package/dist/room/track/RemoteTrackPublication.d.ts +10 -2
- package/dist/room/track/RemoteTrackPublication.js +49 -16
- package/dist/room/track/RemoteTrackPublication.js.map +1 -1
- package/dist/room/track/RemoteVideoTrack.d.ts +7 -7
- package/dist/room/track/RemoteVideoTrack.js +66 -22
- package/dist/room/track/RemoteVideoTrack.js.map +1 -1
- package/dist/room/track/Track.d.ts +12 -0
- package/dist/room/track/Track.js +33 -0
- package/dist/room/track/Track.js.map +1 -1
- package/dist/room/track/TrackPublication.d.ts +14 -1
- package/dist/room/track/TrackPublication.js +24 -7
- package/dist/room/track/TrackPublication.js.map +1 -1
- package/dist/room/track/create.d.ts +23 -0
- package/dist/room/track/create.js +130 -0
- package/dist/room/track/create.js.map +1 -0
- package/dist/room/track/defaults.d.ts +4 -0
- package/dist/room/track/defaults.js +21 -0
- package/dist/room/track/defaults.js.map +1 -0
- package/dist/room/utils.d.ts +3 -1
- package/dist/room/utils.js +36 -6
- package/dist/room/utils.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -3
- package/src/api/SignalClient.ts +434 -0
- package/src/connect.ts +100 -0
- package/src/index.ts +47 -0
- package/src/logger.ts +22 -0
- package/src/options.ts +152 -0
- package/src/proto/livekit_models.ts +1863 -0
- package/src/proto/livekit_rtc.ts +3401 -0
- package/src/room/DeviceManager.ts +57 -0
- package/src/room/PCTransport.ts +86 -0
- package/src/room/RTCEngine.ts +484 -0
- package/src/room/Room.ts +785 -0
- package/src/room/errors.ts +65 -0
- package/src/room/events.ts +396 -0
- package/src/room/participant/LocalParticipant.ts +685 -0
- package/src/room/participant/Participant.ts +214 -0
- package/src/room/participant/ParticipantTrackPermission.ts +32 -0
- package/src/room/participant/RemoteParticipant.ts +238 -0
- package/src/room/participant/publishUtils.test.ts +105 -0
- package/src/room/participant/publishUtils.ts +180 -0
- package/src/room/stats.ts +130 -0
- package/src/room/track/LocalAudioTrack.ts +112 -0
- package/src/room/track/LocalTrack.ts +124 -0
- package/src/room/track/LocalTrackPublication.ts +63 -0
- package/src/room/track/LocalVideoTrack.test.ts +70 -0
- package/src/room/track/LocalVideoTrack.ts +416 -0
- package/src/room/track/RemoteAudioTrack.ts +58 -0
- package/src/room/track/RemoteTrack.ts +59 -0
- package/src/room/track/RemoteTrackPublication.ts +192 -0
- package/src/room/track/RemoteVideoTrack.ts +213 -0
- package/src/room/track/Track.ts +301 -0
- package/src/room/track/TrackPublication.ts +120 -0
- package/src/room/track/create.ts +120 -0
- package/src/room/track/defaults.ts +23 -0
- package/src/room/track/options.ts +229 -0
- package/src/room/track/types.ts +8 -0
- package/src/room/track/utils.test.ts +93 -0
- package/src/room/track/utils.ts +76 -0
- package/src/room/utils.ts +74 -0
- package/src/version.ts +2 -0
- package/.github/workflows/publish.yaml +0 -55
- package/.github/workflows/test.yaml +0 -36
- package/example/index.html +0 -237
- package/example/sample.ts +0 -575
- package/example/styles.css +0 -144
- package/example/webpack.config.js +0 -33
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.StreamStateUpdate = exports.StreamStateInfo = exports.ConnectionQualityUpdate = exports.ConnectionQualityInfo = exports.RoomUpdate = exports.SpeakersChanged = exports.ICEServer = exports.UpdateVideoLayers = exports.LeaveRequest = exports.UpdateTrackSettings = exports.UpdateSubscription = exports.ParticipantUpdate = exports.SessionDescription = exports.TrackPublishedResponse = exports.JoinResponse = exports.MuteTrackRequest = exports.TrickleRequest = exports.AddTrackRequest = exports.SignalResponse = exports.SignalRequest = exports.streamStateToJSON = exports.streamStateFromJSON = exports.StreamState = exports.signalTargetToJSON = exports.signalTargetFromJSON = exports.SignalTarget = exports.protobufPackage = void 0;
|
6
|
+
exports.SimulateScenario = exports.SyncState = exports.SubscriptionPermissionUpdate = exports.UpdateSubscriptionPermissions = exports.TrackPermission = exports.SubscribedQualityUpdate = exports.SubscribedQuality = exports.StreamStateUpdate = exports.StreamStateInfo = exports.ConnectionQualityUpdate = exports.ConnectionQualityInfo = exports.RoomUpdate = exports.SpeakersChanged = exports.ICEServer = exports.UpdateVideoLayers = exports.LeaveRequest = exports.UpdateTrackSettings = exports.UpdateSubscription = exports.ParticipantUpdate = exports.SessionDescription = exports.TrackPublishedResponse = exports.JoinResponse = exports.MuteTrackRequest = exports.TrickleRequest = exports.AddTrackRequest = exports.SignalResponse = exports.SignalRequest = exports.streamStateToJSON = exports.streamStateFromJSON = exports.StreamState = exports.signalTargetToJSON = exports.signalTargetFromJSON = exports.SignalTarget = exports.protobufPackage = void 0;
|
7
7
|
/* eslint-disable */
|
8
8
|
const long_1 = __importDefault(require("long"));
|
9
9
|
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
@@ -103,6 +103,15 @@ exports.SignalRequest = {
|
|
103
103
|
if (message.updateLayers !== undefined) {
|
104
104
|
exports.UpdateVideoLayers.encode(message.updateLayers, writer.uint32(82).fork()).ldelim();
|
105
105
|
}
|
106
|
+
if (message.subscriptionPermissions !== undefined) {
|
107
|
+
exports.UpdateSubscriptionPermissions.encode(message.subscriptionPermissions, writer.uint32(90).fork()).ldelim();
|
108
|
+
}
|
109
|
+
if (message.syncState !== undefined) {
|
110
|
+
exports.SyncState.encode(message.syncState, writer.uint32(98).fork()).ldelim();
|
111
|
+
}
|
112
|
+
if (message.simulate !== undefined) {
|
113
|
+
exports.SimulateScenario.encode(message.simulate, writer.uint32(106).fork()).ldelim();
|
114
|
+
}
|
106
115
|
return writer;
|
107
116
|
},
|
108
117
|
decode(input, length) {
|
@@ -139,6 +148,16 @@ exports.SignalRequest = {
|
|
139
148
|
case 10:
|
140
149
|
message.updateLayers = exports.UpdateVideoLayers.decode(reader, reader.uint32());
|
141
150
|
break;
|
151
|
+
case 11:
|
152
|
+
message.subscriptionPermissions =
|
153
|
+
exports.UpdateSubscriptionPermissions.decode(reader, reader.uint32());
|
154
|
+
break;
|
155
|
+
case 12:
|
156
|
+
message.syncState = exports.SyncState.decode(reader, reader.uint32());
|
157
|
+
break;
|
158
|
+
case 13:
|
159
|
+
message.simulate = exports.SimulateScenario.decode(reader, reader.uint32());
|
160
|
+
break;
|
142
161
|
default:
|
143
162
|
reader.skipType(tag & 7);
|
144
163
|
break;
|
@@ -202,6 +221,25 @@ exports.SignalRequest = {
|
|
202
221
|
else {
|
203
222
|
message.updateLayers = undefined;
|
204
223
|
}
|
224
|
+
if (object.subscriptionPermissions !== undefined &&
|
225
|
+
object.subscriptionPermissions !== null) {
|
226
|
+
message.subscriptionPermissions = exports.UpdateSubscriptionPermissions.fromJSON(object.subscriptionPermissions);
|
227
|
+
}
|
228
|
+
else {
|
229
|
+
message.subscriptionPermissions = undefined;
|
230
|
+
}
|
231
|
+
if (object.syncState !== undefined && object.syncState !== null) {
|
232
|
+
message.syncState = exports.SyncState.fromJSON(object.syncState);
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
message.syncState = undefined;
|
236
|
+
}
|
237
|
+
if (object.simulate !== undefined && object.simulate !== null) {
|
238
|
+
message.simulate = exports.SimulateScenario.fromJSON(object.simulate);
|
239
|
+
}
|
240
|
+
else {
|
241
|
+
message.simulate = undefined;
|
242
|
+
}
|
205
243
|
return message;
|
206
244
|
},
|
207
245
|
toJSON(message) {
|
@@ -242,6 +280,18 @@ exports.SignalRequest = {
|
|
242
280
|
(obj.updateLayers = message.updateLayers
|
243
281
|
? exports.UpdateVideoLayers.toJSON(message.updateLayers)
|
244
282
|
: undefined);
|
283
|
+
message.subscriptionPermissions !== undefined &&
|
284
|
+
(obj.subscriptionPermissions = message.subscriptionPermissions
|
285
|
+
? exports.UpdateSubscriptionPermissions.toJSON(message.subscriptionPermissions)
|
286
|
+
: undefined);
|
287
|
+
message.syncState !== undefined &&
|
288
|
+
(obj.syncState = message.syncState
|
289
|
+
? exports.SyncState.toJSON(message.syncState)
|
290
|
+
: undefined);
|
291
|
+
message.simulate !== undefined &&
|
292
|
+
(obj.simulate = message.simulate
|
293
|
+
? exports.SimulateScenario.toJSON(message.simulate)
|
294
|
+
: undefined);
|
245
295
|
return obj;
|
246
296
|
},
|
247
297
|
fromPartial(object) {
|
@@ -300,6 +350,26 @@ exports.SignalRequest = {
|
|
300
350
|
else {
|
301
351
|
message.updateLayers = undefined;
|
302
352
|
}
|
353
|
+
if (object.subscriptionPermissions !== undefined &&
|
354
|
+
object.subscriptionPermissions !== null) {
|
355
|
+
message.subscriptionPermissions =
|
356
|
+
exports.UpdateSubscriptionPermissions.fromPartial(object.subscriptionPermissions);
|
357
|
+
}
|
358
|
+
else {
|
359
|
+
message.subscriptionPermissions = undefined;
|
360
|
+
}
|
361
|
+
if (object.syncState !== undefined && object.syncState !== null) {
|
362
|
+
message.syncState = exports.SyncState.fromPartial(object.syncState);
|
363
|
+
}
|
364
|
+
else {
|
365
|
+
message.syncState = undefined;
|
366
|
+
}
|
367
|
+
if (object.simulate !== undefined && object.simulate !== null) {
|
368
|
+
message.simulate = exports.SimulateScenario.fromPartial(object.simulate);
|
369
|
+
}
|
370
|
+
else {
|
371
|
+
message.simulate = undefined;
|
372
|
+
}
|
303
373
|
return message;
|
304
374
|
},
|
305
375
|
};
|
@@ -342,6 +412,12 @@ exports.SignalResponse = {
|
|
342
412
|
if (message.streamStateUpdate !== undefined) {
|
343
413
|
exports.StreamStateUpdate.encode(message.streamStateUpdate, writer.uint32(106).fork()).ldelim();
|
344
414
|
}
|
415
|
+
if (message.subscribedQualityUpdate !== undefined) {
|
416
|
+
exports.SubscribedQualityUpdate.encode(message.subscribedQualityUpdate, writer.uint32(114).fork()).ldelim();
|
417
|
+
}
|
418
|
+
if (message.subscriptionPermissionUpdate !== undefined) {
|
419
|
+
exports.SubscriptionPermissionUpdate.encode(message.subscriptionPermissionUpdate, writer.uint32(122).fork()).ldelim();
|
420
|
+
}
|
345
421
|
return writer;
|
346
422
|
},
|
347
423
|
decode(input, length) {
|
@@ -387,6 +463,13 @@ exports.SignalResponse = {
|
|
387
463
|
case 13:
|
388
464
|
message.streamStateUpdate = exports.StreamStateUpdate.decode(reader, reader.uint32());
|
389
465
|
break;
|
466
|
+
case 14:
|
467
|
+
message.subscribedQualityUpdate = exports.SubscribedQualityUpdate.decode(reader, reader.uint32());
|
468
|
+
break;
|
469
|
+
case 15:
|
470
|
+
message.subscriptionPermissionUpdate =
|
471
|
+
exports.SubscriptionPermissionUpdate.decode(reader, reader.uint32());
|
472
|
+
break;
|
390
473
|
default:
|
391
474
|
reader.skipType(tag & 7);
|
392
475
|
break;
|
@@ -471,6 +554,21 @@ exports.SignalResponse = {
|
|
471
554
|
else {
|
472
555
|
message.streamStateUpdate = undefined;
|
473
556
|
}
|
557
|
+
if (object.subscribedQualityUpdate !== undefined &&
|
558
|
+
object.subscribedQualityUpdate !== null) {
|
559
|
+
message.subscribedQualityUpdate = exports.SubscribedQualityUpdate.fromJSON(object.subscribedQualityUpdate);
|
560
|
+
}
|
561
|
+
else {
|
562
|
+
message.subscribedQualityUpdate = undefined;
|
563
|
+
}
|
564
|
+
if (object.subscriptionPermissionUpdate !== undefined &&
|
565
|
+
object.subscriptionPermissionUpdate !== null) {
|
566
|
+
message.subscriptionPermissionUpdate =
|
567
|
+
exports.SubscriptionPermissionUpdate.fromJSON(object.subscriptionPermissionUpdate);
|
568
|
+
}
|
569
|
+
else {
|
570
|
+
message.subscriptionPermissionUpdate = undefined;
|
571
|
+
}
|
474
572
|
return message;
|
475
573
|
},
|
476
574
|
toJSON(message) {
|
@@ -521,6 +619,14 @@ exports.SignalResponse = {
|
|
521
619
|
(obj.streamStateUpdate = message.streamStateUpdate
|
522
620
|
? exports.StreamStateUpdate.toJSON(message.streamStateUpdate)
|
523
621
|
: undefined);
|
622
|
+
message.subscribedQualityUpdate !== undefined &&
|
623
|
+
(obj.subscribedQualityUpdate = message.subscribedQualityUpdate
|
624
|
+
? exports.SubscribedQualityUpdate.toJSON(message.subscribedQualityUpdate)
|
625
|
+
: undefined);
|
626
|
+
message.subscriptionPermissionUpdate !== undefined &&
|
627
|
+
(obj.subscriptionPermissionUpdate = message.subscriptionPermissionUpdate
|
628
|
+
? exports.SubscriptionPermissionUpdate.toJSON(message.subscriptionPermissionUpdate)
|
629
|
+
: undefined);
|
524
630
|
return obj;
|
525
631
|
},
|
526
632
|
fromPartial(object) {
|
@@ -600,6 +706,21 @@ exports.SignalResponse = {
|
|
600
706
|
else {
|
601
707
|
message.streamStateUpdate = undefined;
|
602
708
|
}
|
709
|
+
if (object.subscribedQualityUpdate !== undefined &&
|
710
|
+
object.subscribedQualityUpdate !== null) {
|
711
|
+
message.subscribedQualityUpdate = exports.SubscribedQualityUpdate.fromPartial(object.subscribedQualityUpdate);
|
712
|
+
}
|
713
|
+
else {
|
714
|
+
message.subscribedQualityUpdate = undefined;
|
715
|
+
}
|
716
|
+
if (object.subscriptionPermissionUpdate !== undefined &&
|
717
|
+
object.subscriptionPermissionUpdate !== null) {
|
718
|
+
message.subscriptionPermissionUpdate =
|
719
|
+
exports.SubscriptionPermissionUpdate.fromPartial(object.subscriptionPermissionUpdate);
|
720
|
+
}
|
721
|
+
else {
|
722
|
+
message.subscriptionPermissionUpdate = undefined;
|
723
|
+
}
|
603
724
|
return message;
|
604
725
|
},
|
605
726
|
};
|
@@ -1278,6 +1399,9 @@ exports.UpdateSubscription = {
|
|
1278
1399
|
if (message.subscribe === true) {
|
1279
1400
|
writer.uint32(16).bool(message.subscribe);
|
1280
1401
|
}
|
1402
|
+
for (const v of message.participantTracks) {
|
1403
|
+
livekit_models_1.ParticipantTracks.encode(v, writer.uint32(26).fork()).ldelim();
|
1404
|
+
}
|
1281
1405
|
return writer;
|
1282
1406
|
},
|
1283
1407
|
decode(input, length) {
|
@@ -1285,6 +1409,7 @@ exports.UpdateSubscription = {
|
|
1285
1409
|
let end = length === undefined ? reader.len : reader.pos + length;
|
1286
1410
|
const message = Object.assign({}, baseUpdateSubscription);
|
1287
1411
|
message.trackSids = [];
|
1412
|
+
message.participantTracks = [];
|
1288
1413
|
while (reader.pos < end) {
|
1289
1414
|
const tag = reader.uint32();
|
1290
1415
|
switch (tag >>> 3) {
|
@@ -1294,6 +1419,9 @@ exports.UpdateSubscription = {
|
|
1294
1419
|
case 2:
|
1295
1420
|
message.subscribe = reader.bool();
|
1296
1421
|
break;
|
1422
|
+
case 3:
|
1423
|
+
message.participantTracks.push(livekit_models_1.ParticipantTracks.decode(reader, reader.uint32()));
|
1424
|
+
break;
|
1297
1425
|
default:
|
1298
1426
|
reader.skipType(tag & 7);
|
1299
1427
|
break;
|
@@ -1304,6 +1432,7 @@ exports.UpdateSubscription = {
|
|
1304
1432
|
fromJSON(object) {
|
1305
1433
|
const message = Object.assign({}, baseUpdateSubscription);
|
1306
1434
|
message.trackSids = [];
|
1435
|
+
message.participantTracks = [];
|
1307
1436
|
if (object.trackSids !== undefined && object.trackSids !== null) {
|
1308
1437
|
for (const e of object.trackSids) {
|
1309
1438
|
message.trackSids.push(String(e));
|
@@ -1315,6 +1444,12 @@ exports.UpdateSubscription = {
|
|
1315
1444
|
else {
|
1316
1445
|
message.subscribe = false;
|
1317
1446
|
}
|
1447
|
+
if (object.participantTracks !== undefined &&
|
1448
|
+
object.participantTracks !== null) {
|
1449
|
+
for (const e of object.participantTracks) {
|
1450
|
+
message.participantTracks.push(livekit_models_1.ParticipantTracks.fromJSON(e));
|
1451
|
+
}
|
1452
|
+
}
|
1318
1453
|
return message;
|
1319
1454
|
},
|
1320
1455
|
toJSON(message) {
|
@@ -1326,6 +1461,12 @@ exports.UpdateSubscription = {
|
|
1326
1461
|
obj.trackSids = [];
|
1327
1462
|
}
|
1328
1463
|
message.subscribe !== undefined && (obj.subscribe = message.subscribe);
|
1464
|
+
if (message.participantTracks) {
|
1465
|
+
obj.participantTracks = message.participantTracks.map((e) => e ? livekit_models_1.ParticipantTracks.toJSON(e) : undefined);
|
1466
|
+
}
|
1467
|
+
else {
|
1468
|
+
obj.participantTracks = [];
|
1469
|
+
}
|
1329
1470
|
return obj;
|
1330
1471
|
},
|
1331
1472
|
fromPartial(object) {
|
@@ -1338,6 +1479,13 @@ exports.UpdateSubscription = {
|
|
1338
1479
|
}
|
1339
1480
|
}
|
1340
1481
|
message.subscribe = (_a = object.subscribe) !== null && _a !== void 0 ? _a : false;
|
1482
|
+
message.participantTracks = [];
|
1483
|
+
if (object.participantTracks !== undefined &&
|
1484
|
+
object.participantTracks !== null) {
|
1485
|
+
for (const e of object.participantTracks) {
|
1486
|
+
message.participantTracks.push(livekit_models_1.ParticipantTracks.fromPartial(e));
|
1487
|
+
}
|
1488
|
+
}
|
1341
1489
|
return message;
|
1342
1490
|
},
|
1343
1491
|
};
|
@@ -1777,7 +1925,11 @@ exports.RoomUpdate = {
|
|
1777
1925
|
return message;
|
1778
1926
|
},
|
1779
1927
|
};
|
1780
|
-
const baseConnectionQualityInfo = {
|
1928
|
+
const baseConnectionQualityInfo = {
|
1929
|
+
participantSid: "",
|
1930
|
+
quality: 0,
|
1931
|
+
score: 0,
|
1932
|
+
};
|
1781
1933
|
exports.ConnectionQualityInfo = {
|
1782
1934
|
encode(message, writer = minimal_1.default.Writer.create()) {
|
1783
1935
|
if (message.participantSid !== "") {
|
@@ -1786,6 +1938,9 @@ exports.ConnectionQualityInfo = {
|
|
1786
1938
|
if (message.quality !== 0) {
|
1787
1939
|
writer.uint32(16).int32(message.quality);
|
1788
1940
|
}
|
1941
|
+
if (message.score !== 0) {
|
1942
|
+
writer.uint32(29).float(message.score);
|
1943
|
+
}
|
1789
1944
|
return writer;
|
1790
1945
|
},
|
1791
1946
|
decode(input, length) {
|
@@ -1801,6 +1956,9 @@ exports.ConnectionQualityInfo = {
|
|
1801
1956
|
case 2:
|
1802
1957
|
message.quality = reader.int32();
|
1803
1958
|
break;
|
1959
|
+
case 3:
|
1960
|
+
message.score = reader.float();
|
1961
|
+
break;
|
1804
1962
|
default:
|
1805
1963
|
reader.skipType(tag & 7);
|
1806
1964
|
break;
|
@@ -1822,6 +1980,12 @@ exports.ConnectionQualityInfo = {
|
|
1822
1980
|
else {
|
1823
1981
|
message.quality = 0;
|
1824
1982
|
}
|
1983
|
+
if (object.score !== undefined && object.score !== null) {
|
1984
|
+
message.score = Number(object.score);
|
1985
|
+
}
|
1986
|
+
else {
|
1987
|
+
message.score = 0;
|
1988
|
+
}
|
1825
1989
|
return message;
|
1826
1990
|
},
|
1827
1991
|
toJSON(message) {
|
@@ -1830,13 +1994,15 @@ exports.ConnectionQualityInfo = {
|
|
1830
1994
|
(obj.participantSid = message.participantSid);
|
1831
1995
|
message.quality !== undefined &&
|
1832
1996
|
(obj.quality = livekit_models_1.connectionQualityToJSON(message.quality));
|
1997
|
+
message.score !== undefined && (obj.score = message.score);
|
1833
1998
|
return obj;
|
1834
1999
|
},
|
1835
2000
|
fromPartial(object) {
|
1836
|
-
var _a, _b;
|
2001
|
+
var _a, _b, _c;
|
1837
2002
|
const message = Object.assign({}, baseConnectionQualityInfo);
|
1838
2003
|
message.participantSid = (_a = object.participantSid) !== null && _a !== void 0 ? _a : "";
|
1839
2004
|
message.quality = (_b = object.quality) !== null && _b !== void 0 ? _b : 0;
|
2005
|
+
message.score = (_c = object.score) !== null && _c !== void 0 ? _c : 0;
|
1840
2006
|
return message;
|
1841
2007
|
},
|
1842
2008
|
};
|
@@ -2035,6 +2201,582 @@ exports.StreamStateUpdate = {
|
|
2035
2201
|
return message;
|
2036
2202
|
},
|
2037
2203
|
};
|
2204
|
+
const baseSubscribedQuality = { quality: 0, enabled: false };
|
2205
|
+
exports.SubscribedQuality = {
|
2206
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2207
|
+
if (message.quality !== 0) {
|
2208
|
+
writer.uint32(8).int32(message.quality);
|
2209
|
+
}
|
2210
|
+
if (message.enabled === true) {
|
2211
|
+
writer.uint32(16).bool(message.enabled);
|
2212
|
+
}
|
2213
|
+
return writer;
|
2214
|
+
},
|
2215
|
+
decode(input, length) {
|
2216
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2217
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2218
|
+
const message = Object.assign({}, baseSubscribedQuality);
|
2219
|
+
while (reader.pos < end) {
|
2220
|
+
const tag = reader.uint32();
|
2221
|
+
switch (tag >>> 3) {
|
2222
|
+
case 1:
|
2223
|
+
message.quality = reader.int32();
|
2224
|
+
break;
|
2225
|
+
case 2:
|
2226
|
+
message.enabled = reader.bool();
|
2227
|
+
break;
|
2228
|
+
default:
|
2229
|
+
reader.skipType(tag & 7);
|
2230
|
+
break;
|
2231
|
+
}
|
2232
|
+
}
|
2233
|
+
return message;
|
2234
|
+
},
|
2235
|
+
fromJSON(object) {
|
2236
|
+
const message = Object.assign({}, baseSubscribedQuality);
|
2237
|
+
if (object.quality !== undefined && object.quality !== null) {
|
2238
|
+
message.quality = livekit_models_1.videoQualityFromJSON(object.quality);
|
2239
|
+
}
|
2240
|
+
else {
|
2241
|
+
message.quality = 0;
|
2242
|
+
}
|
2243
|
+
if (object.enabled !== undefined && object.enabled !== null) {
|
2244
|
+
message.enabled = Boolean(object.enabled);
|
2245
|
+
}
|
2246
|
+
else {
|
2247
|
+
message.enabled = false;
|
2248
|
+
}
|
2249
|
+
return message;
|
2250
|
+
},
|
2251
|
+
toJSON(message) {
|
2252
|
+
const obj = {};
|
2253
|
+
message.quality !== undefined &&
|
2254
|
+
(obj.quality = livekit_models_1.videoQualityToJSON(message.quality));
|
2255
|
+
message.enabled !== undefined && (obj.enabled = message.enabled);
|
2256
|
+
return obj;
|
2257
|
+
},
|
2258
|
+
fromPartial(object) {
|
2259
|
+
var _a, _b;
|
2260
|
+
const message = Object.assign({}, baseSubscribedQuality);
|
2261
|
+
message.quality = (_a = object.quality) !== null && _a !== void 0 ? _a : 0;
|
2262
|
+
message.enabled = (_b = object.enabled) !== null && _b !== void 0 ? _b : false;
|
2263
|
+
return message;
|
2264
|
+
},
|
2265
|
+
};
|
2266
|
+
const baseSubscribedQualityUpdate = { trackSid: "" };
|
2267
|
+
exports.SubscribedQualityUpdate = {
|
2268
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2269
|
+
if (message.trackSid !== "") {
|
2270
|
+
writer.uint32(10).string(message.trackSid);
|
2271
|
+
}
|
2272
|
+
for (const v of message.subscribedQualities) {
|
2273
|
+
exports.SubscribedQuality.encode(v, writer.uint32(18).fork()).ldelim();
|
2274
|
+
}
|
2275
|
+
return writer;
|
2276
|
+
},
|
2277
|
+
decode(input, length) {
|
2278
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2279
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2280
|
+
const message = Object.assign({}, baseSubscribedQualityUpdate);
|
2281
|
+
message.subscribedQualities = [];
|
2282
|
+
while (reader.pos < end) {
|
2283
|
+
const tag = reader.uint32();
|
2284
|
+
switch (tag >>> 3) {
|
2285
|
+
case 1:
|
2286
|
+
message.trackSid = reader.string();
|
2287
|
+
break;
|
2288
|
+
case 2:
|
2289
|
+
message.subscribedQualities.push(exports.SubscribedQuality.decode(reader, reader.uint32()));
|
2290
|
+
break;
|
2291
|
+
default:
|
2292
|
+
reader.skipType(tag & 7);
|
2293
|
+
break;
|
2294
|
+
}
|
2295
|
+
}
|
2296
|
+
return message;
|
2297
|
+
},
|
2298
|
+
fromJSON(object) {
|
2299
|
+
const message = Object.assign({}, baseSubscribedQualityUpdate);
|
2300
|
+
message.subscribedQualities = [];
|
2301
|
+
if (object.trackSid !== undefined && object.trackSid !== null) {
|
2302
|
+
message.trackSid = String(object.trackSid);
|
2303
|
+
}
|
2304
|
+
else {
|
2305
|
+
message.trackSid = "";
|
2306
|
+
}
|
2307
|
+
if (object.subscribedQualities !== undefined &&
|
2308
|
+
object.subscribedQualities !== null) {
|
2309
|
+
for (const e of object.subscribedQualities) {
|
2310
|
+
message.subscribedQualities.push(exports.SubscribedQuality.fromJSON(e));
|
2311
|
+
}
|
2312
|
+
}
|
2313
|
+
return message;
|
2314
|
+
},
|
2315
|
+
toJSON(message) {
|
2316
|
+
const obj = {};
|
2317
|
+
message.trackSid !== undefined && (obj.trackSid = message.trackSid);
|
2318
|
+
if (message.subscribedQualities) {
|
2319
|
+
obj.subscribedQualities = message.subscribedQualities.map((e) => e ? exports.SubscribedQuality.toJSON(e) : undefined);
|
2320
|
+
}
|
2321
|
+
else {
|
2322
|
+
obj.subscribedQualities = [];
|
2323
|
+
}
|
2324
|
+
return obj;
|
2325
|
+
},
|
2326
|
+
fromPartial(object) {
|
2327
|
+
var _a;
|
2328
|
+
const message = Object.assign({}, baseSubscribedQualityUpdate);
|
2329
|
+
message.trackSid = (_a = object.trackSid) !== null && _a !== void 0 ? _a : "";
|
2330
|
+
message.subscribedQualities = [];
|
2331
|
+
if (object.subscribedQualities !== undefined &&
|
2332
|
+
object.subscribedQualities !== null) {
|
2333
|
+
for (const e of object.subscribedQualities) {
|
2334
|
+
message.subscribedQualities.push(exports.SubscribedQuality.fromPartial(e));
|
2335
|
+
}
|
2336
|
+
}
|
2337
|
+
return message;
|
2338
|
+
},
|
2339
|
+
};
|
2340
|
+
const baseTrackPermission = {
|
2341
|
+
participantSid: "",
|
2342
|
+
allTracks: false,
|
2343
|
+
trackSids: "",
|
2344
|
+
};
|
2345
|
+
exports.TrackPermission = {
|
2346
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2347
|
+
if (message.participantSid !== "") {
|
2348
|
+
writer.uint32(10).string(message.participantSid);
|
2349
|
+
}
|
2350
|
+
if (message.allTracks === true) {
|
2351
|
+
writer.uint32(16).bool(message.allTracks);
|
2352
|
+
}
|
2353
|
+
for (const v of message.trackSids) {
|
2354
|
+
writer.uint32(26).string(v);
|
2355
|
+
}
|
2356
|
+
return writer;
|
2357
|
+
},
|
2358
|
+
decode(input, length) {
|
2359
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2360
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2361
|
+
const message = Object.assign({}, baseTrackPermission);
|
2362
|
+
message.trackSids = [];
|
2363
|
+
while (reader.pos < end) {
|
2364
|
+
const tag = reader.uint32();
|
2365
|
+
switch (tag >>> 3) {
|
2366
|
+
case 1:
|
2367
|
+
message.participantSid = reader.string();
|
2368
|
+
break;
|
2369
|
+
case 2:
|
2370
|
+
message.allTracks = reader.bool();
|
2371
|
+
break;
|
2372
|
+
case 3:
|
2373
|
+
message.trackSids.push(reader.string());
|
2374
|
+
break;
|
2375
|
+
default:
|
2376
|
+
reader.skipType(tag & 7);
|
2377
|
+
break;
|
2378
|
+
}
|
2379
|
+
}
|
2380
|
+
return message;
|
2381
|
+
},
|
2382
|
+
fromJSON(object) {
|
2383
|
+
const message = Object.assign({}, baseTrackPermission);
|
2384
|
+
message.trackSids = [];
|
2385
|
+
if (object.participantSid !== undefined && object.participantSid !== null) {
|
2386
|
+
message.participantSid = String(object.participantSid);
|
2387
|
+
}
|
2388
|
+
else {
|
2389
|
+
message.participantSid = "";
|
2390
|
+
}
|
2391
|
+
if (object.allTracks !== undefined && object.allTracks !== null) {
|
2392
|
+
message.allTracks = Boolean(object.allTracks);
|
2393
|
+
}
|
2394
|
+
else {
|
2395
|
+
message.allTracks = false;
|
2396
|
+
}
|
2397
|
+
if (object.trackSids !== undefined && object.trackSids !== null) {
|
2398
|
+
for (const e of object.trackSids) {
|
2399
|
+
message.trackSids.push(String(e));
|
2400
|
+
}
|
2401
|
+
}
|
2402
|
+
return message;
|
2403
|
+
},
|
2404
|
+
toJSON(message) {
|
2405
|
+
const obj = {};
|
2406
|
+
message.participantSid !== undefined &&
|
2407
|
+
(obj.participantSid = message.participantSid);
|
2408
|
+
message.allTracks !== undefined && (obj.allTracks = message.allTracks);
|
2409
|
+
if (message.trackSids) {
|
2410
|
+
obj.trackSids = message.trackSids.map((e) => e);
|
2411
|
+
}
|
2412
|
+
else {
|
2413
|
+
obj.trackSids = [];
|
2414
|
+
}
|
2415
|
+
return obj;
|
2416
|
+
},
|
2417
|
+
fromPartial(object) {
|
2418
|
+
var _a, _b;
|
2419
|
+
const message = Object.assign({}, baseTrackPermission);
|
2420
|
+
message.participantSid = (_a = object.participantSid) !== null && _a !== void 0 ? _a : "";
|
2421
|
+
message.allTracks = (_b = object.allTracks) !== null && _b !== void 0 ? _b : false;
|
2422
|
+
message.trackSids = [];
|
2423
|
+
if (object.trackSids !== undefined && object.trackSids !== null) {
|
2424
|
+
for (const e of object.trackSids) {
|
2425
|
+
message.trackSids.push(e);
|
2426
|
+
}
|
2427
|
+
}
|
2428
|
+
return message;
|
2429
|
+
},
|
2430
|
+
};
|
2431
|
+
const baseUpdateSubscriptionPermissions = { allParticipants: false };
|
2432
|
+
exports.UpdateSubscriptionPermissions = {
|
2433
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2434
|
+
if (message.allParticipants === true) {
|
2435
|
+
writer.uint32(8).bool(message.allParticipants);
|
2436
|
+
}
|
2437
|
+
for (const v of message.trackPermissions) {
|
2438
|
+
exports.TrackPermission.encode(v, writer.uint32(18).fork()).ldelim();
|
2439
|
+
}
|
2440
|
+
return writer;
|
2441
|
+
},
|
2442
|
+
decode(input, length) {
|
2443
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2444
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2445
|
+
const message = Object.assign({}, baseUpdateSubscriptionPermissions);
|
2446
|
+
message.trackPermissions = [];
|
2447
|
+
while (reader.pos < end) {
|
2448
|
+
const tag = reader.uint32();
|
2449
|
+
switch (tag >>> 3) {
|
2450
|
+
case 1:
|
2451
|
+
message.allParticipants = reader.bool();
|
2452
|
+
break;
|
2453
|
+
case 2:
|
2454
|
+
message.trackPermissions.push(exports.TrackPermission.decode(reader, reader.uint32()));
|
2455
|
+
break;
|
2456
|
+
default:
|
2457
|
+
reader.skipType(tag & 7);
|
2458
|
+
break;
|
2459
|
+
}
|
2460
|
+
}
|
2461
|
+
return message;
|
2462
|
+
},
|
2463
|
+
fromJSON(object) {
|
2464
|
+
const message = Object.assign({}, baseUpdateSubscriptionPermissions);
|
2465
|
+
message.trackPermissions = [];
|
2466
|
+
if (object.allParticipants !== undefined &&
|
2467
|
+
object.allParticipants !== null) {
|
2468
|
+
message.allParticipants = Boolean(object.allParticipants);
|
2469
|
+
}
|
2470
|
+
else {
|
2471
|
+
message.allParticipants = false;
|
2472
|
+
}
|
2473
|
+
if (object.trackPermissions !== undefined &&
|
2474
|
+
object.trackPermissions !== null) {
|
2475
|
+
for (const e of object.trackPermissions) {
|
2476
|
+
message.trackPermissions.push(exports.TrackPermission.fromJSON(e));
|
2477
|
+
}
|
2478
|
+
}
|
2479
|
+
return message;
|
2480
|
+
},
|
2481
|
+
toJSON(message) {
|
2482
|
+
const obj = {};
|
2483
|
+
message.allParticipants !== undefined &&
|
2484
|
+
(obj.allParticipants = message.allParticipants);
|
2485
|
+
if (message.trackPermissions) {
|
2486
|
+
obj.trackPermissions = message.trackPermissions.map((e) => e ? exports.TrackPermission.toJSON(e) : undefined);
|
2487
|
+
}
|
2488
|
+
else {
|
2489
|
+
obj.trackPermissions = [];
|
2490
|
+
}
|
2491
|
+
return obj;
|
2492
|
+
},
|
2493
|
+
fromPartial(object) {
|
2494
|
+
var _a;
|
2495
|
+
const message = Object.assign({}, baseUpdateSubscriptionPermissions);
|
2496
|
+
message.allParticipants = (_a = object.allParticipants) !== null && _a !== void 0 ? _a : false;
|
2497
|
+
message.trackPermissions = [];
|
2498
|
+
if (object.trackPermissions !== undefined &&
|
2499
|
+
object.trackPermissions !== null) {
|
2500
|
+
for (const e of object.trackPermissions) {
|
2501
|
+
message.trackPermissions.push(exports.TrackPermission.fromPartial(e));
|
2502
|
+
}
|
2503
|
+
}
|
2504
|
+
return message;
|
2505
|
+
},
|
2506
|
+
};
|
2507
|
+
const baseSubscriptionPermissionUpdate = {
|
2508
|
+
participantSid: "",
|
2509
|
+
trackSid: "",
|
2510
|
+
allowed: false,
|
2511
|
+
};
|
2512
|
+
exports.SubscriptionPermissionUpdate = {
|
2513
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2514
|
+
if (message.participantSid !== "") {
|
2515
|
+
writer.uint32(10).string(message.participantSid);
|
2516
|
+
}
|
2517
|
+
if (message.trackSid !== "") {
|
2518
|
+
writer.uint32(18).string(message.trackSid);
|
2519
|
+
}
|
2520
|
+
if (message.allowed === true) {
|
2521
|
+
writer.uint32(24).bool(message.allowed);
|
2522
|
+
}
|
2523
|
+
return writer;
|
2524
|
+
},
|
2525
|
+
decode(input, length) {
|
2526
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2527
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2528
|
+
const message = Object.assign({}, baseSubscriptionPermissionUpdate);
|
2529
|
+
while (reader.pos < end) {
|
2530
|
+
const tag = reader.uint32();
|
2531
|
+
switch (tag >>> 3) {
|
2532
|
+
case 1:
|
2533
|
+
message.participantSid = reader.string();
|
2534
|
+
break;
|
2535
|
+
case 2:
|
2536
|
+
message.trackSid = reader.string();
|
2537
|
+
break;
|
2538
|
+
case 3:
|
2539
|
+
message.allowed = reader.bool();
|
2540
|
+
break;
|
2541
|
+
default:
|
2542
|
+
reader.skipType(tag & 7);
|
2543
|
+
break;
|
2544
|
+
}
|
2545
|
+
}
|
2546
|
+
return message;
|
2547
|
+
},
|
2548
|
+
fromJSON(object) {
|
2549
|
+
const message = Object.assign({}, baseSubscriptionPermissionUpdate);
|
2550
|
+
if (object.participantSid !== undefined && object.participantSid !== null) {
|
2551
|
+
message.participantSid = String(object.participantSid);
|
2552
|
+
}
|
2553
|
+
else {
|
2554
|
+
message.participantSid = "";
|
2555
|
+
}
|
2556
|
+
if (object.trackSid !== undefined && object.trackSid !== null) {
|
2557
|
+
message.trackSid = String(object.trackSid);
|
2558
|
+
}
|
2559
|
+
else {
|
2560
|
+
message.trackSid = "";
|
2561
|
+
}
|
2562
|
+
if (object.allowed !== undefined && object.allowed !== null) {
|
2563
|
+
message.allowed = Boolean(object.allowed);
|
2564
|
+
}
|
2565
|
+
else {
|
2566
|
+
message.allowed = false;
|
2567
|
+
}
|
2568
|
+
return message;
|
2569
|
+
},
|
2570
|
+
toJSON(message) {
|
2571
|
+
const obj = {};
|
2572
|
+
message.participantSid !== undefined &&
|
2573
|
+
(obj.participantSid = message.participantSid);
|
2574
|
+
message.trackSid !== undefined && (obj.trackSid = message.trackSid);
|
2575
|
+
message.allowed !== undefined && (obj.allowed = message.allowed);
|
2576
|
+
return obj;
|
2577
|
+
},
|
2578
|
+
fromPartial(object) {
|
2579
|
+
var _a, _b, _c;
|
2580
|
+
const message = Object.assign({}, baseSubscriptionPermissionUpdate);
|
2581
|
+
message.participantSid = (_a = object.participantSid) !== null && _a !== void 0 ? _a : "";
|
2582
|
+
message.trackSid = (_b = object.trackSid) !== null && _b !== void 0 ? _b : "";
|
2583
|
+
message.allowed = (_c = object.allowed) !== null && _c !== void 0 ? _c : false;
|
2584
|
+
return message;
|
2585
|
+
},
|
2586
|
+
};
|
2587
|
+
const baseSyncState = {};
|
2588
|
+
exports.SyncState = {
|
2589
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2590
|
+
if (message.answer !== undefined) {
|
2591
|
+
exports.SessionDescription.encode(message.answer, writer.uint32(10).fork()).ldelim();
|
2592
|
+
}
|
2593
|
+
if (message.subscription !== undefined) {
|
2594
|
+
exports.UpdateSubscription.encode(message.subscription, writer.uint32(18).fork()).ldelim();
|
2595
|
+
}
|
2596
|
+
for (const v of message.publishTracks) {
|
2597
|
+
exports.TrackPublishedResponse.encode(v, writer.uint32(26).fork()).ldelim();
|
2598
|
+
}
|
2599
|
+
return writer;
|
2600
|
+
},
|
2601
|
+
decode(input, length) {
|
2602
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2603
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2604
|
+
const message = Object.assign({}, baseSyncState);
|
2605
|
+
message.publishTracks = [];
|
2606
|
+
while (reader.pos < end) {
|
2607
|
+
const tag = reader.uint32();
|
2608
|
+
switch (tag >>> 3) {
|
2609
|
+
case 1:
|
2610
|
+
message.answer = exports.SessionDescription.decode(reader, reader.uint32());
|
2611
|
+
break;
|
2612
|
+
case 2:
|
2613
|
+
message.subscription = exports.UpdateSubscription.decode(reader, reader.uint32());
|
2614
|
+
break;
|
2615
|
+
case 3:
|
2616
|
+
message.publishTracks.push(exports.TrackPublishedResponse.decode(reader, reader.uint32()));
|
2617
|
+
break;
|
2618
|
+
default:
|
2619
|
+
reader.skipType(tag & 7);
|
2620
|
+
break;
|
2621
|
+
}
|
2622
|
+
}
|
2623
|
+
return message;
|
2624
|
+
},
|
2625
|
+
fromJSON(object) {
|
2626
|
+
const message = Object.assign({}, baseSyncState);
|
2627
|
+
message.publishTracks = [];
|
2628
|
+
if (object.answer !== undefined && object.answer !== null) {
|
2629
|
+
message.answer = exports.SessionDescription.fromJSON(object.answer);
|
2630
|
+
}
|
2631
|
+
else {
|
2632
|
+
message.answer = undefined;
|
2633
|
+
}
|
2634
|
+
if (object.subscription !== undefined && object.subscription !== null) {
|
2635
|
+
message.subscription = exports.UpdateSubscription.fromJSON(object.subscription);
|
2636
|
+
}
|
2637
|
+
else {
|
2638
|
+
message.subscription = undefined;
|
2639
|
+
}
|
2640
|
+
if (object.publishTracks !== undefined && object.publishTracks !== null) {
|
2641
|
+
for (const e of object.publishTracks) {
|
2642
|
+
message.publishTracks.push(exports.TrackPublishedResponse.fromJSON(e));
|
2643
|
+
}
|
2644
|
+
}
|
2645
|
+
return message;
|
2646
|
+
},
|
2647
|
+
toJSON(message) {
|
2648
|
+
const obj = {};
|
2649
|
+
message.answer !== undefined &&
|
2650
|
+
(obj.answer = message.answer
|
2651
|
+
? exports.SessionDescription.toJSON(message.answer)
|
2652
|
+
: undefined);
|
2653
|
+
message.subscription !== undefined &&
|
2654
|
+
(obj.subscription = message.subscription
|
2655
|
+
? exports.UpdateSubscription.toJSON(message.subscription)
|
2656
|
+
: undefined);
|
2657
|
+
if (message.publishTracks) {
|
2658
|
+
obj.publishTracks = message.publishTracks.map((e) => e ? exports.TrackPublishedResponse.toJSON(e) : undefined);
|
2659
|
+
}
|
2660
|
+
else {
|
2661
|
+
obj.publishTracks = [];
|
2662
|
+
}
|
2663
|
+
return obj;
|
2664
|
+
},
|
2665
|
+
fromPartial(object) {
|
2666
|
+
const message = Object.assign({}, baseSyncState);
|
2667
|
+
if (object.answer !== undefined && object.answer !== null) {
|
2668
|
+
message.answer = exports.SessionDescription.fromPartial(object.answer);
|
2669
|
+
}
|
2670
|
+
else {
|
2671
|
+
message.answer = undefined;
|
2672
|
+
}
|
2673
|
+
if (object.subscription !== undefined && object.subscription !== null) {
|
2674
|
+
message.subscription = exports.UpdateSubscription.fromPartial(object.subscription);
|
2675
|
+
}
|
2676
|
+
else {
|
2677
|
+
message.subscription = undefined;
|
2678
|
+
}
|
2679
|
+
message.publishTracks = [];
|
2680
|
+
if (object.publishTracks !== undefined && object.publishTracks !== null) {
|
2681
|
+
for (const e of object.publishTracks) {
|
2682
|
+
message.publishTracks.push(exports.TrackPublishedResponse.fromPartial(e));
|
2683
|
+
}
|
2684
|
+
}
|
2685
|
+
return message;
|
2686
|
+
},
|
2687
|
+
};
|
2688
|
+
const baseSimulateScenario = {};
|
2689
|
+
exports.SimulateScenario = {
|
2690
|
+
encode(message, writer = minimal_1.default.Writer.create()) {
|
2691
|
+
if (message.speakerUpdate !== undefined) {
|
2692
|
+
writer.uint32(8).int32(message.speakerUpdate);
|
2693
|
+
}
|
2694
|
+
if (message.nodeFailure !== undefined) {
|
2695
|
+
writer.uint32(16).bool(message.nodeFailure);
|
2696
|
+
}
|
2697
|
+
if (message.migration !== undefined) {
|
2698
|
+
writer.uint32(24).bool(message.migration);
|
2699
|
+
}
|
2700
|
+
if (message.serverLeave !== undefined) {
|
2701
|
+
writer.uint32(32).bool(message.serverLeave);
|
2702
|
+
}
|
2703
|
+
return writer;
|
2704
|
+
},
|
2705
|
+
decode(input, length) {
|
2706
|
+
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input);
|
2707
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
2708
|
+
const message = Object.assign({}, baseSimulateScenario);
|
2709
|
+
while (reader.pos < end) {
|
2710
|
+
const tag = reader.uint32();
|
2711
|
+
switch (tag >>> 3) {
|
2712
|
+
case 1:
|
2713
|
+
message.speakerUpdate = reader.int32();
|
2714
|
+
break;
|
2715
|
+
case 2:
|
2716
|
+
message.nodeFailure = reader.bool();
|
2717
|
+
break;
|
2718
|
+
case 3:
|
2719
|
+
message.migration = reader.bool();
|
2720
|
+
break;
|
2721
|
+
case 4:
|
2722
|
+
message.serverLeave = reader.bool();
|
2723
|
+
break;
|
2724
|
+
default:
|
2725
|
+
reader.skipType(tag & 7);
|
2726
|
+
break;
|
2727
|
+
}
|
2728
|
+
}
|
2729
|
+
return message;
|
2730
|
+
},
|
2731
|
+
fromJSON(object) {
|
2732
|
+
const message = Object.assign({}, baseSimulateScenario);
|
2733
|
+
if (object.speakerUpdate !== undefined && object.speakerUpdate !== null) {
|
2734
|
+
message.speakerUpdate = Number(object.speakerUpdate);
|
2735
|
+
}
|
2736
|
+
else {
|
2737
|
+
message.speakerUpdate = undefined;
|
2738
|
+
}
|
2739
|
+
if (object.nodeFailure !== undefined && object.nodeFailure !== null) {
|
2740
|
+
message.nodeFailure = Boolean(object.nodeFailure);
|
2741
|
+
}
|
2742
|
+
else {
|
2743
|
+
message.nodeFailure = undefined;
|
2744
|
+
}
|
2745
|
+
if (object.migration !== undefined && object.migration !== null) {
|
2746
|
+
message.migration = Boolean(object.migration);
|
2747
|
+
}
|
2748
|
+
else {
|
2749
|
+
message.migration = undefined;
|
2750
|
+
}
|
2751
|
+
if (object.serverLeave !== undefined && object.serverLeave !== null) {
|
2752
|
+
message.serverLeave = Boolean(object.serverLeave);
|
2753
|
+
}
|
2754
|
+
else {
|
2755
|
+
message.serverLeave = undefined;
|
2756
|
+
}
|
2757
|
+
return message;
|
2758
|
+
},
|
2759
|
+
toJSON(message) {
|
2760
|
+
const obj = {};
|
2761
|
+
message.speakerUpdate !== undefined &&
|
2762
|
+
(obj.speakerUpdate = message.speakerUpdate);
|
2763
|
+
message.nodeFailure !== undefined &&
|
2764
|
+
(obj.nodeFailure = message.nodeFailure);
|
2765
|
+
message.migration !== undefined && (obj.migration = message.migration);
|
2766
|
+
message.serverLeave !== undefined &&
|
2767
|
+
(obj.serverLeave = message.serverLeave);
|
2768
|
+
return obj;
|
2769
|
+
},
|
2770
|
+
fromPartial(object) {
|
2771
|
+
var _a, _b, _c, _d;
|
2772
|
+
const message = Object.assign({}, baseSimulateScenario);
|
2773
|
+
message.speakerUpdate = (_a = object.speakerUpdate) !== null && _a !== void 0 ? _a : undefined;
|
2774
|
+
message.nodeFailure = (_b = object.nodeFailure) !== null && _b !== void 0 ? _b : undefined;
|
2775
|
+
message.migration = (_c = object.migration) !== null && _c !== void 0 ? _c : undefined;
|
2776
|
+
message.serverLeave = (_d = object.serverLeave) !== null && _d !== void 0 ? _d : undefined;
|
2777
|
+
return message;
|
2778
|
+
},
|
2779
|
+
};
|
2038
2780
|
if (minimal_1.default.util.Long !== long_1.default) {
|
2039
2781
|
minimal_1.default.util.Long = long_1.default;
|
2040
2782
|
minimal_1.default.configure();
|