@cloudflare/realtimekit 1.1.6-staging.2 → 1.1.7-agent.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/dist/browser.js +11 -19
- package/dist/index.cjs.js +11 -19
- package/dist/index.d.ts +896 -5
- package/dist/index.es.js +6146 -8976
- package/dist/index.rn.js +11 -19
- package/dist/react.cjs.js +23 -0
- package/dist/react.d.ts +4695 -0
- package/dist/react.es.js +30986 -0
- package/dist/ts3.4/dist/index.d.ts +882 -5
- package/dist/ts3.4/dist/react.d.ts +4644 -0
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ import * as _dyteinternals_utils from '@dyteinternals/utils';
|
|
|
3
3
|
import { MediaVideoQualityType, ViewType, LivestreamViewerMediaQualityType, MediaProductionPermissionType, WaitingRoomTypes, createNewFlagsmithInstance, PresetTypeV2, MediaScreenShareQualityType, PluginAccessControls, RecorderType as RecorderType$1, BorderRadius, BorderWidth, Theme } from '@dyteinternals/utils';
|
|
4
4
|
import { MessageType as MessageType$1 } from '@protobuf-ts/runtime';
|
|
5
5
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
6
|
+
import * as transform from 'sdp-transform';
|
|
6
7
|
import * as WorkerTimers from 'worker-timers';
|
|
7
8
|
/**
|
|
8
9
|
* protolint:disable ENUM_FIELD_NAMES_PREFIX
|
|
@@ -114,6 +115,101 @@ interface SessionDescription {
|
|
|
114
115
|
* @generated MessageType for protobuf message media.SessionDescription
|
|
115
116
|
*/
|
|
116
117
|
declare const SessionDescription: SessionDescription$Type;
|
|
118
|
+
declare class ProducerPayload$Type extends MessageType$1<ProducerPayload> {
|
|
119
|
+
constructor();
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* @generated from protobuf message media.ProducerPayload
|
|
123
|
+
*/
|
|
124
|
+
interface ProducerPayload {
|
|
125
|
+
/**
|
|
126
|
+
* @generated from protobuf field: string kind = 1;
|
|
127
|
+
*/
|
|
128
|
+
kind: string;
|
|
129
|
+
/**
|
|
130
|
+
* @generated from protobuf field: bool paused = 2;
|
|
131
|
+
*/
|
|
132
|
+
paused: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* @generated from protobuf field: bool screen_share = 3;
|
|
135
|
+
*/
|
|
136
|
+
screenShare: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* @generated from protobuf field: string msid = 4;
|
|
139
|
+
*/
|
|
140
|
+
msid: string;
|
|
141
|
+
/**
|
|
142
|
+
* @generated from protobuf field: optional string app_data = 5;
|
|
143
|
+
*/
|
|
144
|
+
appData?: string;
|
|
145
|
+
/**
|
|
146
|
+
* @generated from protobuf field: optional string mime_type = 6;
|
|
147
|
+
*/
|
|
148
|
+
mimeType?: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @generated MessageType for protobuf message media.ProducerPayload
|
|
152
|
+
*/
|
|
153
|
+
declare const ProducerPayload: ProducerPayload$Type;
|
|
154
|
+
declare class CreateTransportRequest$Type extends MessageType$1<CreateTransportRequest> {
|
|
155
|
+
constructor();
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* @generated from protobuf message media.CreateTransportRequest
|
|
159
|
+
*/
|
|
160
|
+
interface CreateTransportRequest {
|
|
161
|
+
/**
|
|
162
|
+
* @generated from protobuf field: bool consuming = 1;
|
|
163
|
+
*/
|
|
164
|
+
consuming: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* @generated from protobuf field: optional bool force_tcp = 2;
|
|
167
|
+
*/
|
|
168
|
+
forceTcp?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* @generated from protobuf field: media.SessionDescription description = 3;
|
|
171
|
+
*/
|
|
172
|
+
description?: SessionDescription;
|
|
173
|
+
/**
|
|
174
|
+
* @generated from protobuf field: optional bool private_ice = 4;
|
|
175
|
+
*/
|
|
176
|
+
privateIce?: boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Batch create producers. SessionDescription can be blank,
|
|
179
|
+
* only need transport level SessionDescription
|
|
180
|
+
*
|
|
181
|
+
* @generated from protobuf field: repeated media.ProducerPayload producers = 5;
|
|
182
|
+
*/
|
|
183
|
+
producers: ProducerPayload[];
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @generated MessageType for protobuf message media.CreateTransportRequest
|
|
187
|
+
*/
|
|
188
|
+
declare const CreateTransportRequest: CreateTransportRequest$Type;
|
|
189
|
+
declare class AudioActivityRequest$Type extends MessageType$1<AudioActivityRequest> {
|
|
190
|
+
constructor();
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* @generated from protobuf message media.AudioActivityRequest
|
|
194
|
+
*/
|
|
195
|
+
interface AudioActivityRequest {
|
|
196
|
+
/**
|
|
197
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
198
|
+
*/
|
|
199
|
+
producerId: string;
|
|
200
|
+
/**
|
|
201
|
+
* @generated from protobuf field: int32 energy = 2;
|
|
202
|
+
*/
|
|
203
|
+
energy: number;
|
|
204
|
+
/**
|
|
205
|
+
* @generated from protobuf field: bool silent = 3;
|
|
206
|
+
*/
|
|
207
|
+
silent: boolean;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @generated MessageType for protobuf message media.AudioActivityRequest
|
|
211
|
+
*/
|
|
212
|
+
declare const AudioActivityRequest: AudioActivityRequest$Type;
|
|
117
213
|
declare class ProducerTrack$Type extends MessageType$1<ProducerTrack> {
|
|
118
214
|
constructor();
|
|
119
215
|
}
|
|
@@ -270,6 +366,290 @@ interface RtpCapabilitites {
|
|
|
270
366
|
* @generated MessageType for protobuf message media.RtpCapabilitites
|
|
271
367
|
*/
|
|
272
368
|
declare const RtpCapabilitites: RtpCapabilitites$Type;
|
|
369
|
+
declare class PreferredCodec$Type extends MessageType$1<PreferredCodec> {
|
|
370
|
+
constructor();
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* @generated from protobuf message media.PreferredCodec
|
|
374
|
+
*/
|
|
375
|
+
interface PreferredCodec {
|
|
376
|
+
/**
|
|
377
|
+
* @generated from protobuf field: optional string audio = 1;
|
|
378
|
+
*/
|
|
379
|
+
audio?: string;
|
|
380
|
+
/**
|
|
381
|
+
* @generated from protobuf field: optional string video = 2;
|
|
382
|
+
*/
|
|
383
|
+
video?: string;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* @generated MessageType for protobuf message media.PreferredCodec
|
|
387
|
+
*/
|
|
388
|
+
declare const PreferredCodec: PreferredCodec$Type;
|
|
389
|
+
declare class Simulcast$Type extends MessageType$1<Simulcast> {
|
|
390
|
+
constructor();
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* @generated from protobuf message media.Simulcast
|
|
394
|
+
*/
|
|
395
|
+
interface Simulcast {
|
|
396
|
+
/**
|
|
397
|
+
* @generated from protobuf field: optional string preferred_rid = 1;
|
|
398
|
+
*/
|
|
399
|
+
preferredRid?: string;
|
|
400
|
+
/**
|
|
401
|
+
* @generated from protobuf field: optional string priority_ordering = 2;
|
|
402
|
+
*/
|
|
403
|
+
priorityOrdering?: string;
|
|
404
|
+
/**
|
|
405
|
+
* @generated from protobuf field: optional string rid_not_available = 3;
|
|
406
|
+
*/
|
|
407
|
+
ridNotAvailable?: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* @generated MessageType for protobuf message media.Simulcast
|
|
411
|
+
*/
|
|
412
|
+
declare const Simulcast: Simulcast$Type;
|
|
413
|
+
declare class GeoLocation$Type extends MessageType$1<GeoLocation$1> {
|
|
414
|
+
constructor();
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* @generated from protobuf message media.edge.GeoLocation
|
|
418
|
+
*/
|
|
419
|
+
interface GeoLocation$1 {
|
|
420
|
+
/**
|
|
421
|
+
* @generated from protobuf field: float latitude = 1;
|
|
422
|
+
*/
|
|
423
|
+
latitude: number;
|
|
424
|
+
/**
|
|
425
|
+
* @generated from protobuf field: float longitude = 2;
|
|
426
|
+
*/
|
|
427
|
+
longitude: number;
|
|
428
|
+
/**
|
|
429
|
+
* @generated from protobuf field: optional string region = 3;
|
|
430
|
+
*/
|
|
431
|
+
region?: string;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* @generated MessageType for protobuf message media.edge.GeoLocation
|
|
435
|
+
*/
|
|
436
|
+
declare const GeoLocation$1: GeoLocation$Type;
|
|
437
|
+
declare class ConsumePeerRequest$Type extends MessageType$1<ConsumePeerRequest> {
|
|
438
|
+
constructor();
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* @generated from protobuf message media.edge.ConsumePeerRequest
|
|
442
|
+
*/
|
|
443
|
+
interface ConsumePeerRequest {
|
|
444
|
+
/**
|
|
445
|
+
* @generated from protobuf field: string producing_peer_id = 1;
|
|
446
|
+
*/
|
|
447
|
+
producingPeerId: string;
|
|
448
|
+
/**
|
|
449
|
+
* @generated from protobuf field: optional bool paused = 2;
|
|
450
|
+
*/
|
|
451
|
+
paused?: boolean;
|
|
452
|
+
/**
|
|
453
|
+
* @generated from protobuf field: optional string producer_id = 3;
|
|
454
|
+
*/
|
|
455
|
+
producerId?: string;
|
|
456
|
+
/**
|
|
457
|
+
* @generated from protobuf field: optional media.PreferredCodec preferred_codec = 4;
|
|
458
|
+
*/
|
|
459
|
+
preferredCodec?: PreferredCodec;
|
|
460
|
+
/**
|
|
461
|
+
* @generated from protobuf field: optional string producing_transport_id = 5;
|
|
462
|
+
*/
|
|
463
|
+
producingTransportId?: string;
|
|
464
|
+
/**
|
|
465
|
+
* @generated from protobuf field: optional media.Simulcast simulcast = 6;
|
|
466
|
+
*/
|
|
467
|
+
simulcast?: Simulcast;
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* @generated MessageType for protobuf message media.edge.ConsumePeerRequest
|
|
471
|
+
*/
|
|
472
|
+
declare const ConsumePeerRequest: ConsumePeerRequest$Type;
|
|
473
|
+
declare class ConsumePeersRequest$Type extends MessageType$1<ConsumePeersRequest> {
|
|
474
|
+
constructor();
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* @generated from protobuf message media.edge.ConsumePeersRequest
|
|
478
|
+
*/
|
|
479
|
+
interface ConsumePeersRequest {
|
|
480
|
+
/**
|
|
481
|
+
* @generated from protobuf field: repeated media.edge.ConsumePeerRequest requests = 1;
|
|
482
|
+
*/
|
|
483
|
+
requests: ConsumePeerRequest[];
|
|
484
|
+
/**
|
|
485
|
+
* @generated from protobuf field: optional string consuming_transport_id = 2;
|
|
486
|
+
*/
|
|
487
|
+
consumingTransportId?: string;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* @generated MessageType for protobuf message media.edge.ConsumePeersRequest
|
|
491
|
+
*/
|
|
492
|
+
declare const ConsumePeersRequest: ConsumePeersRequest$Type;
|
|
493
|
+
declare class UpdateConsumerSimulcastConfigRequest$Type extends MessageType$1<UpdateConsumerSimulcastConfigRequest> {
|
|
494
|
+
constructor();
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* @generated from protobuf message media.edge.UpdateConsumerSimulcastConfigRequest
|
|
498
|
+
*/
|
|
499
|
+
interface UpdateConsumerSimulcastConfigRequest {
|
|
500
|
+
/**
|
|
501
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
502
|
+
*/
|
|
503
|
+
producerId: string;
|
|
504
|
+
/**
|
|
505
|
+
* @generated from protobuf field: media.Simulcast simulcast = 2;
|
|
506
|
+
*/
|
|
507
|
+
simulcast?: Simulcast;
|
|
508
|
+
/**
|
|
509
|
+
* @generated from protobuf field: string producing_transport_id = 3;
|
|
510
|
+
*/
|
|
511
|
+
producingTransportId: string;
|
|
512
|
+
/**
|
|
513
|
+
* @generated from protobuf field: string mid = 4;
|
|
514
|
+
*/
|
|
515
|
+
mid: string;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* @generated MessageType for protobuf message media.edge.UpdateConsumerSimulcastConfigRequest
|
|
519
|
+
*/
|
|
520
|
+
declare const UpdateConsumerSimulcastConfigRequest: UpdateConsumerSimulcastConfigRequest$Type;
|
|
521
|
+
declare class UpdateConsumersSimulcastConfigRequest$Type extends MessageType$1<UpdateConsumersSimulcastConfigRequest> {
|
|
522
|
+
constructor();
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* @generated from protobuf message media.edge.UpdateConsumersSimulcastConfigRequest
|
|
526
|
+
*/
|
|
527
|
+
interface UpdateConsumersSimulcastConfigRequest {
|
|
528
|
+
/**
|
|
529
|
+
* @generated from protobuf field: repeated media.edge.UpdateConsumerSimulcastConfigRequest requests = 1;
|
|
530
|
+
*/
|
|
531
|
+
requests: UpdateConsumerSimulcastConfigRequest[];
|
|
532
|
+
/**
|
|
533
|
+
* @generated from protobuf field: optional string consuming_transport_id = 2;
|
|
534
|
+
*/
|
|
535
|
+
consumingTransportId?: string;
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* @generated MessageType for protobuf message media.edge.UpdateConsumersSimulcastConfigRequest
|
|
539
|
+
*/
|
|
540
|
+
declare const UpdateConsumersSimulcastConfigRequest: UpdateConsumersSimulcastConfigRequest$Type;
|
|
541
|
+
declare class ProducerCreateRequest$Type extends MessageType$1<ProducerCreateRequest> {
|
|
542
|
+
constructor();
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* @generated from protobuf message media.edge.ProducerCreateRequest
|
|
546
|
+
*/
|
|
547
|
+
interface ProducerCreateRequest {
|
|
548
|
+
/**
|
|
549
|
+
* @generated from protobuf field: string kind = 1;
|
|
550
|
+
*/
|
|
551
|
+
kind: string;
|
|
552
|
+
/**
|
|
553
|
+
* @generated from protobuf field: bool paused = 2;
|
|
554
|
+
*/
|
|
555
|
+
paused: boolean;
|
|
556
|
+
/**
|
|
557
|
+
* @generated from protobuf field: bool screen_share = 3;
|
|
558
|
+
*/
|
|
559
|
+
screenShare: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* @generated from protobuf field: media.SessionDescription description = 4;
|
|
562
|
+
*/
|
|
563
|
+
description?: SessionDescription;
|
|
564
|
+
/**
|
|
565
|
+
* @generated from protobuf field: string msid = 5;
|
|
566
|
+
*/
|
|
567
|
+
msid: string;
|
|
568
|
+
/**
|
|
569
|
+
* @generated from protobuf field: optional string app_data = 6;
|
|
570
|
+
*/
|
|
571
|
+
appData?: string;
|
|
572
|
+
/**
|
|
573
|
+
* @generated from protobuf field: optional string mime_type = 7;
|
|
574
|
+
*/
|
|
575
|
+
mimeType?: string;
|
|
576
|
+
/**
|
|
577
|
+
* @generated from protobuf field: optional string producing_transport_id = 8;
|
|
578
|
+
*/
|
|
579
|
+
producingTransportId?: string;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* @generated MessageType for protobuf message media.edge.ProducerCreateRequest
|
|
583
|
+
*/
|
|
584
|
+
declare const ProducerCreateRequest: ProducerCreateRequest$Type;
|
|
585
|
+
declare class ProducerCloseRequest$Type extends MessageType$1<ProducerCloseRequest> {
|
|
586
|
+
constructor();
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* @generated from protobuf message media.edge.ProducerCloseRequest
|
|
590
|
+
*/
|
|
591
|
+
interface ProducerCloseRequest {
|
|
592
|
+
/**
|
|
593
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
594
|
+
*/
|
|
595
|
+
producerId: string;
|
|
596
|
+
/**
|
|
597
|
+
* @generated from protobuf field: media.SessionDescription description = 2;
|
|
598
|
+
*/
|
|
599
|
+
description?: SessionDescription;
|
|
600
|
+
/**
|
|
601
|
+
* @generated from protobuf field: optional string producing_transport_id = 3;
|
|
602
|
+
*/
|
|
603
|
+
producingTransportId?: string;
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* @generated MessageType for protobuf message media.edge.ProducerCloseRequest
|
|
607
|
+
*/
|
|
608
|
+
declare const ProducerCloseRequest: ProducerCloseRequest$Type;
|
|
609
|
+
declare class ConsumerCloseRequest$Type extends MessageType$1<ConsumerCloseRequest> {
|
|
610
|
+
constructor();
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* @generated from protobuf message media.edge.ConsumerCloseRequest
|
|
614
|
+
*/
|
|
615
|
+
interface ConsumerCloseRequest {
|
|
616
|
+
/**
|
|
617
|
+
* @generated from protobuf field: repeated string consumer_ids = 1;
|
|
618
|
+
*/
|
|
619
|
+
consumerIds: string[];
|
|
620
|
+
/**
|
|
621
|
+
* @generated from protobuf field: media.SessionDescription description = 2;
|
|
622
|
+
*/
|
|
623
|
+
description?: SessionDescription;
|
|
624
|
+
/**
|
|
625
|
+
* @generated from protobuf field: optional string consuming_transport_id = 3;
|
|
626
|
+
*/
|
|
627
|
+
consumingTransportId?: string;
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* @generated MessageType for protobuf message media.edge.ConsumerCloseRequest
|
|
631
|
+
*/
|
|
632
|
+
declare const ConsumerCloseRequest: ConsumerCloseRequest$Type;
|
|
633
|
+
declare class PeerDisplayNameEditRequest$Type extends MessageType$1<PeerDisplayNameEditRequest> {
|
|
634
|
+
constructor();
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* @generated from protobuf message media.edge.PeerDisplayNameEditRequest
|
|
638
|
+
*/
|
|
639
|
+
interface PeerDisplayNameEditRequest {
|
|
640
|
+
/**
|
|
641
|
+
* @generated from protobuf field: string participant_id = 1;
|
|
642
|
+
*/
|
|
643
|
+
participantId: string;
|
|
644
|
+
/**
|
|
645
|
+
* @generated from protobuf field: string display_name = 2;
|
|
646
|
+
*/
|
|
647
|
+
displayName: string;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* @generated MessageType for protobuf message media.edge.PeerDisplayNameEditRequest
|
|
651
|
+
*/
|
|
652
|
+
declare const PeerDisplayNameEditRequest: PeerDisplayNameEditRequest$Type;
|
|
273
653
|
declare class GetRoomStateResponse$Type extends MessageType$1<GetRoomStateResponse> {
|
|
274
654
|
constructor();
|
|
275
655
|
}
|
|
@@ -838,6 +1218,22 @@ interface MovePeersBetweenRoomsRequest {
|
|
|
838
1218
|
* @generated MessageType for protobuf message socket.room.MovePeersBetweenRoomsRequest
|
|
839
1219
|
*/
|
|
840
1220
|
declare const MovePeersBetweenRoomsRequest: MovePeersBetweenRoomsRequest$Type;
|
|
1221
|
+
declare class RemoveParticipantsRequest$Type extends MessageType$1<RemoveParticipantsRequest> {
|
|
1222
|
+
constructor();
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* @generated from protobuf message socket.room.RemoveParticipantsRequest
|
|
1226
|
+
*/
|
|
1227
|
+
interface RemoveParticipantsRequest {
|
|
1228
|
+
/**
|
|
1229
|
+
* @generated from protobuf field: repeated string peer_ids = 1;
|
|
1230
|
+
*/
|
|
1231
|
+
peerIds: string[];
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* @generated MessageType for protobuf message socket.room.RemoveParticipantsRequest
|
|
1235
|
+
*/
|
|
1236
|
+
declare const RemoveParticipantsRequest: RemoveParticipantsRequest$Type;
|
|
841
1237
|
declare class WaitingRoomRequest$Type extends MessageType$1<WaitingRoomRequest> {
|
|
842
1238
|
constructor();
|
|
843
1239
|
}
|
|
@@ -2989,11 +3385,290 @@ declare abstract class HandlerInterface<TransportPromiseEvents> extends Enhanced
|
|
|
2989
3385
|
_addEventListeners(): void;
|
|
2990
3386
|
addCustomEventListeners(): void;
|
|
2991
3387
|
}
|
|
3388
|
+
type HandlerFactory<TransportPromiseEvents> = () => HandlerInterface<TransportPromiseEvents>;
|
|
3389
|
+
type ProducerOptions = {
|
|
3390
|
+
track?: MediaStreamTrack;
|
|
3391
|
+
encodings?: RTCRtpEncodingParameters[];
|
|
3392
|
+
codecOptions?: CodecOption[];
|
|
3393
|
+
stopTracks?: boolean;
|
|
3394
|
+
disableTrackOnPause?: boolean;
|
|
3395
|
+
zeroRtpOnPause?: boolean;
|
|
3396
|
+
appData?: Record<string, unknown>;
|
|
3397
|
+
};
|
|
2992
3398
|
type MediaKind$1 = 'audio' | 'video';
|
|
3399
|
+
type ProducerConstructorOptions = {
|
|
3400
|
+
id: string;
|
|
3401
|
+
localId: string;
|
|
3402
|
+
track?: MediaStreamTrack;
|
|
3403
|
+
stopTracks: boolean;
|
|
3404
|
+
disableTrackOnPause: boolean;
|
|
3405
|
+
zeroRtpOnPause: boolean;
|
|
3406
|
+
handler: HandlerInterface<TransportPromiseEvents>;
|
|
3407
|
+
appData?: Record<string, unknown>;
|
|
3408
|
+
rtpSender?: RTCRtpSender;
|
|
3409
|
+
};
|
|
3410
|
+
declare class Producer extends EnhancedEventEmitter<TransportPromiseEvents> {
|
|
3411
|
+
readonly id: string;
|
|
3412
|
+
readonly localId: string;
|
|
3413
|
+
readonly kind: MediaKind$1;
|
|
3414
|
+
readonly appData: Record<string, unknown>;
|
|
3415
|
+
readonly rtpSender: RTCRtpSender;
|
|
3416
|
+
constructor(context: Context<RTKContextState>, opt: ProducerConstructorOptions);
|
|
3417
|
+
readonly closed: boolean;
|
|
3418
|
+
readonly track: MediaStreamTrack | null;
|
|
3419
|
+
readonly paused: boolean;
|
|
3420
|
+
readonly maxSpatialLayer: number | undefined;
|
|
3421
|
+
close(reason?: string): Promise<void>;
|
|
3422
|
+
getStats(): Promise<RTCStatsReport>;
|
|
3423
|
+
pause(): void;
|
|
3424
|
+
resume(): void;
|
|
3425
|
+
replaceTrack({ track, }: {
|
|
3426
|
+
track: MediaStreamTrack | null;
|
|
3427
|
+
}): Promise<void>;
|
|
3428
|
+
setMaxSpatialLayer(spatialLayer: number): Promise<void>;
|
|
3429
|
+
setRtpEncodingParameters(params: RTCRtpEncodingParameters): Promise<void>;
|
|
3430
|
+
}
|
|
3431
|
+
declare enum SendType {
|
|
3432
|
+
Request = "REQUEST",
|
|
3433
|
+
Response = "RESPONSE",
|
|
3434
|
+
Notify = "NOTIFY"
|
|
3435
|
+
}
|
|
3436
|
+
type RPCMessage = {
|
|
3437
|
+
id: string;
|
|
3438
|
+
method: string;
|
|
3439
|
+
timer: NodeJS.Timeout | number;
|
|
3440
|
+
resolve: (v: unknown) => void;
|
|
3441
|
+
cancel: (e: unknown) => void;
|
|
3442
|
+
};
|
|
2993
3443
|
type DCMessage = {
|
|
2994
3444
|
type: string;
|
|
2995
3445
|
payload: Record<string, unknown>;
|
|
2996
3446
|
};
|
|
3447
|
+
type DCMessageChunked = {
|
|
3448
|
+
id: string;
|
|
3449
|
+
count: number;
|
|
3450
|
+
chunkIndex: number;
|
|
3451
|
+
chunk: string;
|
|
3452
|
+
};
|
|
3453
|
+
type ExtendedDCMessage = {
|
|
3454
|
+
payload: {
|
|
3455
|
+
_bolt: {
|
|
3456
|
+
id: string;
|
|
3457
|
+
type: SendType;
|
|
3458
|
+
version: number;
|
|
3459
|
+
};
|
|
3460
|
+
};
|
|
3461
|
+
} & DCMessage;
|
|
3462
|
+
declare class Datachannel extends EventEmitter$1 {
|
|
3463
|
+
readonly label: string;
|
|
3464
|
+
readonly transportId: string;
|
|
3465
|
+
static createRequest: (data: DCMessage) => ExtendedDCMessage;
|
|
3466
|
+
static createResponse: (id: string, data: DCMessage) => {
|
|
3467
|
+
type: string;
|
|
3468
|
+
payload: {
|
|
3469
|
+
_bolt: {
|
|
3470
|
+
id: string;
|
|
3471
|
+
type: SendType;
|
|
3472
|
+
version: number;
|
|
3473
|
+
};
|
|
3474
|
+
};
|
|
3475
|
+
};
|
|
3476
|
+
static createNotification: (data: DCMessage) => {
|
|
3477
|
+
type: string;
|
|
3478
|
+
payload: {
|
|
3479
|
+
bolt: {
|
|
3480
|
+
id: string;
|
|
3481
|
+
type: SendType;
|
|
3482
|
+
version: number;
|
|
3483
|
+
};
|
|
3484
|
+
};
|
|
3485
|
+
};
|
|
3486
|
+
static createErrorResponse: (id: string, error: Error) => ExtendedDCMessage;
|
|
3487
|
+
channel: RTCDataChannel;
|
|
3488
|
+
queue: Map<string, RPCMessage>;
|
|
3489
|
+
serverProtocolVersion?: number;
|
|
3490
|
+
constructor(context: Context<RTKContextState>, dc: RTCDataChannel, label: string, transportId: string);
|
|
3491
|
+
respond: (id: string, data: DCMessage | Error, error?: boolean) => void;
|
|
3492
|
+
notify: (data: DCMessage) => void;
|
|
3493
|
+
request: (data: DCMessage) => Promise<{
|
|
3494
|
+
type: string;
|
|
3495
|
+
payload: Record<string, unknown>;
|
|
3496
|
+
}>;
|
|
3497
|
+
send: (payload: DCMessage) => void;
|
|
3498
|
+
processMessage: (dcmsg: DCMessageChunked) => ExtendedDCMessage | undefined;
|
|
3499
|
+
processResponseMsg: (msg: ExtendedDCMessage) => boolean;
|
|
3500
|
+
processBoltHandshake: (msg: ExtendedDCMessage) => boolean;
|
|
3501
|
+
}
|
|
3502
|
+
type ConsumerStates = Map<string, {
|
|
3503
|
+
producingTransportId: string;
|
|
3504
|
+
} & ConsumerStateObject>;
|
|
3505
|
+
declare abstract class ConsumerStrategy {
|
|
3506
|
+
abstract create(producers: ProducerState[]): Promise<{
|
|
3507
|
+
consumerStates: ConsumerStates;
|
|
3508
|
+
sessionDescription?: SessionDescription;
|
|
3509
|
+
failedProducers?: (ProducerState & {
|
|
3510
|
+
errorCode?: string;
|
|
3511
|
+
consumerId?: string;
|
|
3512
|
+
})[];
|
|
3513
|
+
}>;
|
|
3514
|
+
abstract close(consumers: Consumer[]): Promise<{
|
|
3515
|
+
failedConsumers?: Consumer['id'][];
|
|
3516
|
+
}>;
|
|
3517
|
+
abstract negotiate(offer: RTCSessionDescriptionInit, reqId?: string, channelLabel?: string): Promise<RTCSessionDescriptionInit>;
|
|
3518
|
+
abstract switchConsumersToLayer(consumer: Consumer[], layer: number): Promise<void>;
|
|
3519
|
+
}
|
|
3520
|
+
declare const mediaEvents: {
|
|
3521
|
+
readonly unknown: 0;
|
|
3522
|
+
readonly createWebRTCTransport: 1;
|
|
3523
|
+
readonly produce: 2;
|
|
3524
|
+
readonly consume: 3;
|
|
3525
|
+
readonly toggleProducer: 4;
|
|
3526
|
+
readonly toggleConsumer: 5;
|
|
3527
|
+
readonly closeProducer: 6;
|
|
3528
|
+
readonly closeConsumer: 7;
|
|
3529
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
3530
|
+
readonly joinRoom: 16;
|
|
3531
|
+
readonly leaveRoom: 17;
|
|
3532
|
+
readonly selectedPeer: 18;
|
|
3533
|
+
readonly globalPinPeer: 19;
|
|
3534
|
+
readonly selfJoinComplete: 20;
|
|
3535
|
+
readonly peerJoinedBroadcast: 25;
|
|
3536
|
+
readonly peerLeaveBroadcast: 26;
|
|
3537
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
3538
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
3539
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
3540
|
+
readonly globalPeerPinBroadcast: 30;
|
|
3541
|
+
readonly recordingStartedBroadcast: 31;
|
|
3542
|
+
readonly recordingStoppedBroadcast: 32;
|
|
3543
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
3544
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
3545
|
+
readonly selectedPeerDiff: 40;
|
|
3546
|
+
readonly renegotiateSessionDescription: 50;
|
|
3547
|
+
readonly errorResponse: 60;
|
|
3548
|
+
readonly kickPeer: 90;
|
|
3549
|
+
readonly kickAll: 91;
|
|
3550
|
+
readonly changeDisplayName: 92;
|
|
3551
|
+
readonly hostControlPeer: 93;
|
|
3552
|
+
readonly hostControlAllPeers: 94;
|
|
3553
|
+
readonly audioActivity: 100;
|
|
3554
|
+
};
|
|
3555
|
+
declare const cfMediaEvents: {
|
|
3556
|
+
readonly unknown: 0;
|
|
3557
|
+
readonly createWebRTCTransport: 1;
|
|
3558
|
+
readonly produce: 2;
|
|
3559
|
+
readonly consume: 3;
|
|
3560
|
+
readonly toggleProducer: 4;
|
|
3561
|
+
readonly toggleConsumer: 5;
|
|
3562
|
+
readonly closeProducer: 6;
|
|
3563
|
+
readonly closeConsumer: 7;
|
|
3564
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
3565
|
+
readonly joinRoom: 16;
|
|
3566
|
+
readonly leaveRoom: 17;
|
|
3567
|
+
readonly selectedPeer: 18;
|
|
3568
|
+
readonly globalPinPeer: 19;
|
|
3569
|
+
readonly selfJoinComplete: 20;
|
|
3570
|
+
readonly peerJoinedBroadcast: 25;
|
|
3571
|
+
readonly peerLeaveBroadcast: 26;
|
|
3572
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
3573
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
3574
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
3575
|
+
readonly globalPeerPinBroadcast: 30;
|
|
3576
|
+
readonly recordingStartedBroadcast: 31;
|
|
3577
|
+
readonly recordingStoppedBroadcast: 32;
|
|
3578
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
3579
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
3580
|
+
readonly selectedPeerDiff: 40;
|
|
3581
|
+
readonly renegotiateSessionDescription: 50;
|
|
3582
|
+
readonly errorResponse: 60;
|
|
3583
|
+
readonly kickPeer: 90;
|
|
3584
|
+
readonly kickAll: 91;
|
|
3585
|
+
readonly changeDisplayName: 92;
|
|
3586
|
+
readonly hostControlPeer: 93;
|
|
3587
|
+
readonly hostControlAllPeers: 94;
|
|
3588
|
+
readonly audioActivity: 100;
|
|
3589
|
+
};
|
|
3590
|
+
declare class SFUSocketOps {
|
|
3591
|
+
events: typeof cfMediaEvents | typeof mediaEvents;
|
|
3592
|
+
sfuType: MediaNodeType;
|
|
3593
|
+
constructor(socket: SocketService, sfuType: MediaNodeType);
|
|
3594
|
+
joinRoom(roomUuid: string, displayName: string, capabilities: PeerRtpCapabilitites, prejoined?: boolean, location?: GeoLocation$1): Promise<Uint8Array>;
|
|
3595
|
+
connectTransport(request: CreateTransportRequest): Promise<{
|
|
3596
|
+
transportId: string;
|
|
3597
|
+
answer: RTCSessionDescriptionInit;
|
|
3598
|
+
producerIds: string[];
|
|
3599
|
+
}>;
|
|
3600
|
+
produce(req: ProducerCreateRequest): Promise<{
|
|
3601
|
+
answer: RTCSessionDescriptionInit;
|
|
3602
|
+
producerId: string;
|
|
3603
|
+
}>;
|
|
3604
|
+
consume(req: ConsumePeersRequest): Promise<{
|
|
3605
|
+
consumerStateMap: {
|
|
3606
|
+
[key: string]: ConsumerState;
|
|
3607
|
+
};
|
|
3608
|
+
sessionDescription: SessionDescription;
|
|
3609
|
+
}>;
|
|
3610
|
+
closeProducer(req: ProducerCloseRequest): Promise<SessionDescription>;
|
|
3611
|
+
closeConsumer(req: ConsumerCloseRequest): Promise<Uint8Array>;
|
|
3612
|
+
updateConsumersSimulcastConfig(req: UpdateConsumersSimulcastConfigRequest): Promise<Uint8Array>;
|
|
3613
|
+
hostControlForPeer(peerId: string, kind: 'audio' | 'video'): Promise<boolean>;
|
|
3614
|
+
hostControlForAll(kind: 'audio' | 'video'): Promise<boolean>;
|
|
3615
|
+
kickAll(): Promise<void>;
|
|
3616
|
+
kickPeer(req: RemoveParticipantsRequest): Promise<void>;
|
|
3617
|
+
changeDisplayName(req: PeerDisplayNameEditRequest): Promise<boolean>;
|
|
3618
|
+
notifySelfJoinComplete(): Promise<PeerJoinCompleteResponse>;
|
|
3619
|
+
audioActivity(req: AudioActivityRequest): Promise<void>;
|
|
3620
|
+
}
|
|
3621
|
+
type CreateProducerInfo = {
|
|
3622
|
+
offer: RTCSessionDescriptionInit;
|
|
3623
|
+
kind: string;
|
|
3624
|
+
paused: boolean;
|
|
3625
|
+
appData: ProducerOptions['appData'];
|
|
3626
|
+
codecOptions: CodecOption[];
|
|
3627
|
+
producingTransportId: string;
|
|
3628
|
+
};
|
|
3629
|
+
type AwaitQueueTask<T> = () => (T | PromiseLike<T>);
|
|
3630
|
+
type AwaitQueueTaskDump = {
|
|
3631
|
+
idx: number;
|
|
3632
|
+
task: AwaitQueueTask<unknown>;
|
|
3633
|
+
name?: string;
|
|
3634
|
+
enqueuedTime: number;
|
|
3635
|
+
executionTime: number;
|
|
3636
|
+
};
|
|
3637
|
+
type PendingTask<T> = {
|
|
3638
|
+
id: number;
|
|
3639
|
+
task: AwaitQueueTask<T>;
|
|
3640
|
+
metadata: Record<string, unknown>;
|
|
3641
|
+
name?: string;
|
|
3642
|
+
enqueuedAt: number;
|
|
3643
|
+
executedAt?: number;
|
|
3644
|
+
completedAt?: number;
|
|
3645
|
+
completed: boolean;
|
|
3646
|
+
resolve: (result: T | PromiseLike<T>) => void;
|
|
3647
|
+
reject: (error: Error) => void;
|
|
3648
|
+
};
|
|
3649
|
+
declare class AwaitQueue {
|
|
3650
|
+
readonly log: boolean;
|
|
3651
|
+
pendingTasks: Map<number, PendingTask<any>>;
|
|
3652
|
+
constructor(logger?: RTKLogger$1, log?: boolean);
|
|
3653
|
+
readonly size: number;
|
|
3654
|
+
push<T>(task: AwaitQueueTask<T>, name?: string, metadata?: Record<string, unknown>): Promise<T>;
|
|
3655
|
+
stop(): void;
|
|
3656
|
+
remove(taskIdx: number): void;
|
|
3657
|
+
get<T>(taskIdx: number): PendingTask<T>;
|
|
3658
|
+
dump(): AwaitQueueTaskDump[];
|
|
3659
|
+
}
|
|
3660
|
+
type TransportOptions = {
|
|
3661
|
+
iceServers?: RTCIceServer[];
|
|
3662
|
+
iceTransportPolicy?: RTCIceTransportPolicy;
|
|
3663
|
+
additionalSettings?: Record<string, unknown>;
|
|
3664
|
+
proprietaryConstraints?: Record<string, unknown>;
|
|
3665
|
+
appData?: Record<string, unknown>;
|
|
3666
|
+
config?: {
|
|
3667
|
+
enableDtx?: boolean;
|
|
3668
|
+
enableStereo: boolean;
|
|
3669
|
+
enableHighBitrate: boolean;
|
|
3670
|
+
};
|
|
3671
|
+
};
|
|
2997
3672
|
type TransportPromiseEvents = {
|
|
2998
3673
|
'close': {
|
|
2999
3674
|
answer: RTCSessionDescriptionInit;
|
|
@@ -3002,6 +3677,124 @@ type TransportPromiseEvents = {
|
|
|
3002
3677
|
description: RTCSessionDescriptionInit;
|
|
3003
3678
|
};
|
|
3004
3679
|
};
|
|
3680
|
+
type ConnectionState = 'new' | 'connecting' | 'connected' | 'failed' | 'disconnected' | 'closed';
|
|
3681
|
+
type InternalTransportOptions = {
|
|
3682
|
+
id?: string;
|
|
3683
|
+
direction: 'send' | 'recv';
|
|
3684
|
+
handlerFactory?: HandlerFactory<TransportPromiseEvents>;
|
|
3685
|
+
config?: {
|
|
3686
|
+
enableDtx?: boolean;
|
|
3687
|
+
enableStereo: boolean;
|
|
3688
|
+
enableHighBitrate: boolean;
|
|
3689
|
+
};
|
|
3690
|
+
} & TransportOptions;
|
|
3691
|
+
declare class Transport extends EnhancedEventEmitter<TransportPromiseEvents> {
|
|
3692
|
+
awaitQueue: AwaitQueue;
|
|
3693
|
+
observer: EnhancedEventEmitter<TransportPromiseEvents>;
|
|
3694
|
+
readonly id: string;
|
|
3695
|
+
serverId: string;
|
|
3696
|
+
readonly direction: 'send' | 'recv';
|
|
3697
|
+
readonly maxSctpMessageSize?: number | undefined;
|
|
3698
|
+
handler: HandlerInterface<TransportPromiseEvents>;
|
|
3699
|
+
connectionState: ConnectionState;
|
|
3700
|
+
readonly producers: Map<string, Producer>;
|
|
3701
|
+
readonly consumers: Map<string, Consumer>;
|
|
3702
|
+
readonly datachannels: Map<string, Datachannel>;
|
|
3703
|
+
connected: boolean;
|
|
3704
|
+
eventsDCReadyPromise: Promise<boolean>;
|
|
3705
|
+
eventsDCReadyPromiseResolver: (value: boolean | PromiseLike<boolean>) => void;
|
|
3706
|
+
eventsDCFailureTimer: NodeJS.Timeout;
|
|
3707
|
+
transportConnectionPromise: Promise<boolean>;
|
|
3708
|
+
readonly consumerTrackEvents: Map<string, (track: MediaStreamTrack, transceiver: RTCRtpTransceiver) => void>;
|
|
3709
|
+
readonly unknownTracksMap: Map<string, RTCTrackEvent>;
|
|
3710
|
+
readonly appData: Record<string, unknown>;
|
|
3711
|
+
readonly closed: boolean;
|
|
3712
|
+
constructor(context: Context<RTKContextState>, sfu: MediaNodeType, { id, direction, handlerFactory, iceServers, iceTransportPolicy, proprietaryConstraints, additionalSettings, appData, config, }: InternalTransportOptions);
|
|
3713
|
+
setServerId(id: string): void;
|
|
3714
|
+
getDatachannel(label: string): Datachannel;
|
|
3715
|
+
readonly isEventsDCReady: Promise<boolean>;
|
|
3716
|
+
close(): void;
|
|
3717
|
+
getStats(): Promise<RTCStatsReport>;
|
|
3718
|
+
connect(transportConnectionRequest: (offer: RTCSessionDescriptionInit) => Promise<{
|
|
3719
|
+
transportId: string;
|
|
3720
|
+
answer: RTCSessionDescriptionInit;
|
|
3721
|
+
}>): Promise<void>;
|
|
3722
|
+
restartIce(): Promise<GenericHandlerResult>;
|
|
3723
|
+
canProduce(producerOptions: ProducerOptions): Promise<boolean>;
|
|
3724
|
+
produce(producerOptions: ProducerOptions, producerCreationRequest: (info: CreateProducerInfo) => Promise<{
|
|
3725
|
+
answer: RTCSessionDescriptionInit;
|
|
3726
|
+
producerId: string;
|
|
3727
|
+
}>): Promise<Producer>;
|
|
3728
|
+
createProducerObject(opts: ProducerConstructorOptions): Promise<Producer>;
|
|
3729
|
+
closeProducer(producer: Producer): Promise<void>;
|
|
3730
|
+
canConsume(): Promise<boolean>;
|
|
3731
|
+
consume(producers: ProducerState[], consumerCreationRequest: ConsumerStrategy['create'], negotiationRequest: ConsumerStrategy['negotiate']): Promise<{
|
|
3732
|
+
consumers: Consumer[];
|
|
3733
|
+
failedProducers: (ProducerState & {
|
|
3734
|
+
errorCode?: string;
|
|
3735
|
+
consumerId?: string;
|
|
3736
|
+
})[];
|
|
3737
|
+
}>;
|
|
3738
|
+
static parseCodecAndFmtpMappings(sdp: RTCSessionDescription, mids: string[]): {
|
|
3739
|
+
[mid: string]: {
|
|
3740
|
+
rtp: transform.MediaAttributes['rtp'];
|
|
3741
|
+
fmtp: transform.MediaAttributes['fmtp'];
|
|
3742
|
+
payloads: string;
|
|
3743
|
+
rtcpFb: transform.MediaAttributes['rtcpFb'];
|
|
3744
|
+
};
|
|
3745
|
+
};
|
|
3746
|
+
static setCodecAndFmtpMappings(sdp: RTCSessionDescriptionInit, mids: string[], payloadMappings: {
|
|
3747
|
+
[mid: string]: {
|
|
3748
|
+
rtp: transform.MediaAttributes['rtp'];
|
|
3749
|
+
fmtp: transform.MediaAttributes['fmtp'];
|
|
3750
|
+
payloads: string;
|
|
3751
|
+
rtcpFb: transform.MediaAttributes['rtcpFb'];
|
|
3752
|
+
};
|
|
3753
|
+
}): {
|
|
3754
|
+
sdp: string;
|
|
3755
|
+
type: RTCSdpType;
|
|
3756
|
+
};
|
|
3757
|
+
static parseHeaderExtensionMappings(sdp: RTCSessionDescriptionInit): {
|
|
3758
|
+
[mid: string]: {
|
|
3759
|
+
value: number;
|
|
3760
|
+
direction?: string;
|
|
3761
|
+
uri: string;
|
|
3762
|
+
config?: string;
|
|
3763
|
+
}[];
|
|
3764
|
+
};
|
|
3765
|
+
static setHeaderExtensionMappings(sdp: RTCSessionDescriptionInit, headerExtensions: {
|
|
3766
|
+
[mid: string]: transform.SharedAttributes['ext'];
|
|
3767
|
+
}): {
|
|
3768
|
+
sdp: string;
|
|
3769
|
+
type: RTCSdpType;
|
|
3770
|
+
};
|
|
3771
|
+
closeConsumers(consumers: Consumer[], closeFn: (consumers: Consumer[], offer: RTCSessionDescriptionInit) => Promise<RTCSessionDescriptionInit>): Promise<void>;
|
|
3772
|
+
setRemoteOffer(offer: RTCSessionDescriptionInit): Promise<RTCSessionDescriptionInit>;
|
|
3773
|
+
_ontrack(event: RTCTrackEvent): void;
|
|
3774
|
+
sendErrorOverDC(label: string, id: string, error: Error): void;
|
|
3775
|
+
sendResponseOverDC(label: string, id: string, payload: DCMessage): void;
|
|
3776
|
+
createConsumerObjectAndWaitForTrack(opts: ConsumerCreationTaskOptions): Promise<Consumer>;
|
|
3777
|
+
setRemoteDescription(sdp: RTCSessionDescriptionInit): Promise<void>;
|
|
3778
|
+
setLocalDescription(sdp: RTCSessionDescriptionInit): Promise<void>;
|
|
3779
|
+
sendDataChannelMessage(channel: string, req: DCMessage): Promise<Record<string, unknown>>;
|
|
3780
|
+
}
|
|
3781
|
+
type ConsumerStateObject = {
|
|
3782
|
+
consumerId: string;
|
|
3783
|
+
trackId: string;
|
|
3784
|
+
streamId: string;
|
|
3785
|
+
screenShare: boolean;
|
|
3786
|
+
paused: boolean;
|
|
3787
|
+
appData: any;
|
|
3788
|
+
kind: 'audio' | 'video';
|
|
3789
|
+
producingPeerId: string;
|
|
3790
|
+
mimeType?: string;
|
|
3791
|
+
};
|
|
3792
|
+
type ConsumerCreationTaskOptions = {
|
|
3793
|
+
producerId: string;
|
|
3794
|
+
producingPeerId: string;
|
|
3795
|
+
producingTransportId: string;
|
|
3796
|
+
appData: Record<string, unknown>;
|
|
3797
|
+
} & ConsumerStateObject;
|
|
3005
3798
|
type ConsumerOptions = {
|
|
3006
3799
|
id?: string;
|
|
3007
3800
|
producerId: string;
|
|
@@ -3648,6 +4441,11 @@ declare class RTKSelf$1 extends RTKSelfMedia$1 {
|
|
|
3648
4441
|
removeDocumentEventListeners(): Promise<void>;
|
|
3649
4442
|
enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
|
|
3650
4443
|
enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
|
|
4444
|
+
produce(payload: {
|
|
4445
|
+
producingTransportId: string;
|
|
4446
|
+
producerId: string;
|
|
4447
|
+
kind: string;
|
|
4448
|
+
}): Promise<void>;
|
|
3651
4449
|
updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
3652
4450
|
enableScreenShare(): Promise<void>;
|
|
3653
4451
|
updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
@@ -4594,11 +5392,11 @@ declare class BrowserDetection {
|
|
|
4594
5392
|
isMobile(): boolean;
|
|
4595
5393
|
getDeviceInfo: () => {
|
|
4596
5394
|
isMobile: boolean;
|
|
4597
|
-
browserName:
|
|
4598
|
-
osName:
|
|
4599
|
-
browserVersion:
|
|
4600
|
-
osVersionName:
|
|
4601
|
-
engineName:
|
|
5395
|
+
browserName: string;
|
|
5396
|
+
osName: string;
|
|
5397
|
+
browserVersion: string;
|
|
5398
|
+
osVersionName: string;
|
|
5399
|
+
engineName: string;
|
|
4602
5400
|
};
|
|
4603
5401
|
_checkCondition(checkTree: any): any;
|
|
4604
5402
|
isVersionGreaterThan(version: any): any;
|
|
@@ -4705,6 +5503,84 @@ declare const enum PRODUCERS_TYPE {
|
|
|
4705
5503
|
SCREENSHARE_VIDEO = "screenshare_video",
|
|
4706
5504
|
SCREENSHARE_AUDIO = "screenshare_audio"
|
|
4707
5505
|
}
|
|
5506
|
+
declare class TransportLayer extends EventEmitter$1 {
|
|
5507
|
+
context: Context<RTKContextState>;
|
|
5508
|
+
readonly telemetry: RTKTelemetry;
|
|
5509
|
+
readonly logger: RTKLogger$1;
|
|
5510
|
+
readonly events: {
|
|
5511
|
+
readonly unknown: 0;
|
|
5512
|
+
readonly createWebRTCTransport: 1;
|
|
5513
|
+
readonly produce: 2;
|
|
5514
|
+
readonly consume: 3;
|
|
5515
|
+
readonly toggleProducer: 4;
|
|
5516
|
+
readonly toggleConsumer: 5;
|
|
5517
|
+
readonly closeProducer: 6;
|
|
5518
|
+
readonly closeConsumer: 7;
|
|
5519
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
5520
|
+
readonly joinRoom: 16;
|
|
5521
|
+
readonly leaveRoom: 17;
|
|
5522
|
+
readonly selectedPeer: 18;
|
|
5523
|
+
readonly globalPinPeer: 19;
|
|
5524
|
+
readonly selfJoinComplete: 20;
|
|
5525
|
+
readonly peerJoinedBroadcast: 25;
|
|
5526
|
+
readonly peerLeaveBroadcast: 26;
|
|
5527
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
5528
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
5529
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
5530
|
+
readonly globalPeerPinBroadcast: 30;
|
|
5531
|
+
readonly recordingStartedBroadcast: 31;
|
|
5532
|
+
readonly recordingStoppedBroadcast: 32;
|
|
5533
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
5534
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
5535
|
+
readonly selectedPeerDiff: 40;
|
|
5536
|
+
readonly renegotiateSessionDescription: 50;
|
|
5537
|
+
readonly errorResponse: 60;
|
|
5538
|
+
readonly kickPeer: 90;
|
|
5539
|
+
readonly kickAll: 91;
|
|
5540
|
+
readonly changeDisplayName: 92;
|
|
5541
|
+
readonly hostControlPeer: 93;
|
|
5542
|
+
readonly hostControlAllPeers: 94;
|
|
5543
|
+
readonly audioActivity: 100;
|
|
5544
|
+
};
|
|
5545
|
+
constructor(context: Context<RTKContextState>, socket: SocketService, nodeType: MediaNodeType);
|
|
5546
|
+
setupTransports(directions: {
|
|
5547
|
+
send?: boolean;
|
|
5548
|
+
recv?: boolean;
|
|
5549
|
+
}): Promise<void>;
|
|
5550
|
+
stopTransports(directions: {
|
|
5551
|
+
send?: boolean;
|
|
5552
|
+
recv?: boolean;
|
|
5553
|
+
}): void;
|
|
5554
|
+
stopAllTransports(): void;
|
|
5555
|
+
}
|
|
5556
|
+
declare class SFUHandler extends TransportLayer {
|
|
5557
|
+
readonly socketHandler: SFUSocketOps;
|
|
5558
|
+
readonly producers: Map<string, Producer>;
|
|
5559
|
+
readonly consumers: Map<string, Consumer>;
|
|
5560
|
+
readonly producerIdToConsumerIdMap: Map<string, string>;
|
|
5561
|
+
readonly logger: RTKLogger$1;
|
|
5562
|
+
constructor(context: Context<RTKContextState>, socket: SocketService, nodeType: MediaNodeType);
|
|
5563
|
+
reset(): void;
|
|
5564
|
+
createProducer(producerOptions: ProducerOptions, onClose: () => void): Promise<Producer>;
|
|
5565
|
+
closeProducer(id: Producer['id'], options?: Partial<{
|
|
5566
|
+
stopTrack: boolean;
|
|
5567
|
+
}>): Promise<void>;
|
|
5568
|
+
closeAllProducers(): Promise<void[]>;
|
|
5569
|
+
produce(payload: {
|
|
5570
|
+
producingTransportId: string;
|
|
5571
|
+
producerId: string;
|
|
5572
|
+
kind: string;
|
|
5573
|
+
}): Promise<{
|
|
5574
|
+
answer: RTCSessionDescriptionInit;
|
|
5575
|
+
producerId: string;
|
|
5576
|
+
}>;
|
|
5577
|
+
createConsumer(producer: ProducerState): Promise<void>;
|
|
5578
|
+
createConsumers(producers: ProducerState[]): Promise<void>;
|
|
5579
|
+
closeConsumer(consumer: Consumer['id']): Promise<void>;
|
|
5580
|
+
closeConsumers(consumers: Consumer['id'][]): Promise<void>;
|
|
5581
|
+
closeAllConsumers(): Promise<void>;
|
|
5582
|
+
switchConsumersToLayer(consumers: Consumer[], layer: number): Promise<void>;
|
|
5583
|
+
}
|
|
4708
5584
|
interface MediaPermissions {
|
|
4709
5585
|
canProduceAudio?: MediaProductionPermissionType;
|
|
4710
5586
|
canProduceVideo?: MediaProductionPermissionType;
|
|
@@ -4724,6 +5600,7 @@ declare class MediaNodeClient {
|
|
|
4724
5600
|
readonly authToken: string;
|
|
4725
5601
|
readonly e2ee: boolean;
|
|
4726
5602
|
readonly peerId: string;
|
|
5603
|
+
readonly sfuHandler: SFUHandler;
|
|
4727
5604
|
readonly telemetry: RTKTelemetry;
|
|
4728
5605
|
readonly logger: RTKLogger$1;
|
|
4729
5606
|
constructor(context: Context<RTKContextState>, nodeType: MediaNodeType, options: MediaNodeClientOptions);
|