@cloudflare/realtimekit 1.1.6 → 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 -3
package/dist/index.d.ts
CHANGED
|
@@ -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
|
/**
|
|
@@ -115,6 +116,101 @@ interface SessionDescription {
|
|
|
115
116
|
* @generated MessageType for protobuf message media.SessionDescription
|
|
116
117
|
*/
|
|
117
118
|
declare const SessionDescription: SessionDescription$Type;
|
|
119
|
+
declare class ProducerPayload$Type extends MessageType$1<ProducerPayload> {
|
|
120
|
+
constructor();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @generated from protobuf message media.ProducerPayload
|
|
124
|
+
*/
|
|
125
|
+
interface ProducerPayload {
|
|
126
|
+
/**
|
|
127
|
+
* @generated from protobuf field: string kind = 1;
|
|
128
|
+
*/
|
|
129
|
+
kind: string;
|
|
130
|
+
/**
|
|
131
|
+
* @generated from protobuf field: bool paused = 2;
|
|
132
|
+
*/
|
|
133
|
+
paused: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* @generated from protobuf field: bool screen_share = 3;
|
|
136
|
+
*/
|
|
137
|
+
screenShare: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* @generated from protobuf field: string msid = 4;
|
|
140
|
+
*/
|
|
141
|
+
msid: string;
|
|
142
|
+
/**
|
|
143
|
+
* @generated from protobuf field: optional string app_data = 5;
|
|
144
|
+
*/
|
|
145
|
+
appData?: string;
|
|
146
|
+
/**
|
|
147
|
+
* @generated from protobuf field: optional string mime_type = 6;
|
|
148
|
+
*/
|
|
149
|
+
mimeType?: string;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* @generated MessageType for protobuf message media.ProducerPayload
|
|
153
|
+
*/
|
|
154
|
+
declare const ProducerPayload: ProducerPayload$Type;
|
|
155
|
+
declare class CreateTransportRequest$Type extends MessageType$1<CreateTransportRequest> {
|
|
156
|
+
constructor();
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* @generated from protobuf message media.CreateTransportRequest
|
|
160
|
+
*/
|
|
161
|
+
interface CreateTransportRequest {
|
|
162
|
+
/**
|
|
163
|
+
* @generated from protobuf field: bool consuming = 1;
|
|
164
|
+
*/
|
|
165
|
+
consuming: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* @generated from protobuf field: optional bool force_tcp = 2;
|
|
168
|
+
*/
|
|
169
|
+
forceTcp?: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* @generated from protobuf field: media.SessionDescription description = 3;
|
|
172
|
+
*/
|
|
173
|
+
description?: SessionDescription;
|
|
174
|
+
/**
|
|
175
|
+
* @generated from protobuf field: optional bool private_ice = 4;
|
|
176
|
+
*/
|
|
177
|
+
privateIce?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Batch create producers. SessionDescription can be blank,
|
|
180
|
+
* only need transport level SessionDescription
|
|
181
|
+
*
|
|
182
|
+
* @generated from protobuf field: repeated media.ProducerPayload producers = 5;
|
|
183
|
+
*/
|
|
184
|
+
producers: ProducerPayload[];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* @generated MessageType for protobuf message media.CreateTransportRequest
|
|
188
|
+
*/
|
|
189
|
+
declare const CreateTransportRequest: CreateTransportRequest$Type;
|
|
190
|
+
declare class AudioActivityRequest$Type extends MessageType$1<AudioActivityRequest> {
|
|
191
|
+
constructor();
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* @generated from protobuf message media.AudioActivityRequest
|
|
195
|
+
*/
|
|
196
|
+
interface AudioActivityRequest {
|
|
197
|
+
/**
|
|
198
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
199
|
+
*/
|
|
200
|
+
producerId: string;
|
|
201
|
+
/**
|
|
202
|
+
* @generated from protobuf field: int32 energy = 2;
|
|
203
|
+
*/
|
|
204
|
+
energy: number;
|
|
205
|
+
/**
|
|
206
|
+
* @generated from protobuf field: bool silent = 3;
|
|
207
|
+
*/
|
|
208
|
+
silent: boolean;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* @generated MessageType for protobuf message media.AudioActivityRequest
|
|
212
|
+
*/
|
|
213
|
+
declare const AudioActivityRequest: AudioActivityRequest$Type;
|
|
118
214
|
declare class ProducerTrack$Type extends MessageType$1<ProducerTrack> {
|
|
119
215
|
constructor();
|
|
120
216
|
}
|
|
@@ -271,7 +367,291 @@ interface RtpCapabilitites {
|
|
|
271
367
|
* @generated MessageType for protobuf message media.RtpCapabilitites
|
|
272
368
|
*/
|
|
273
369
|
declare const RtpCapabilitites: RtpCapabilitites$Type;
|
|
370
|
+
declare class PreferredCodec$Type extends MessageType$1<PreferredCodec> {
|
|
371
|
+
constructor();
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* @generated from protobuf message media.PreferredCodec
|
|
375
|
+
*/
|
|
376
|
+
interface PreferredCodec {
|
|
377
|
+
/**
|
|
378
|
+
* @generated from protobuf field: optional string audio = 1;
|
|
379
|
+
*/
|
|
380
|
+
audio?: string;
|
|
381
|
+
/**
|
|
382
|
+
* @generated from protobuf field: optional string video = 2;
|
|
383
|
+
*/
|
|
384
|
+
video?: string;
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* @generated MessageType for protobuf message media.PreferredCodec
|
|
388
|
+
*/
|
|
389
|
+
declare const PreferredCodec: PreferredCodec$Type;
|
|
390
|
+
declare class Simulcast$Type extends MessageType$1<Simulcast> {
|
|
391
|
+
constructor();
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @generated from protobuf message media.Simulcast
|
|
395
|
+
*/
|
|
396
|
+
interface Simulcast {
|
|
397
|
+
/**
|
|
398
|
+
* @generated from protobuf field: optional string preferred_rid = 1;
|
|
399
|
+
*/
|
|
400
|
+
preferredRid?: string;
|
|
401
|
+
/**
|
|
402
|
+
* @generated from protobuf field: optional string priority_ordering = 2;
|
|
403
|
+
*/
|
|
404
|
+
priorityOrdering?: string;
|
|
405
|
+
/**
|
|
406
|
+
* @generated from protobuf field: optional string rid_not_available = 3;
|
|
407
|
+
*/
|
|
408
|
+
ridNotAvailable?: string;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @generated MessageType for protobuf message media.Simulcast
|
|
412
|
+
*/
|
|
413
|
+
declare const Simulcast: Simulcast$Type;
|
|
274
414
|
|
|
415
|
+
declare class GeoLocation$Type extends MessageType$1<GeoLocation$1> {
|
|
416
|
+
constructor();
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* @generated from protobuf message media.edge.GeoLocation
|
|
420
|
+
*/
|
|
421
|
+
interface GeoLocation$1 {
|
|
422
|
+
/**
|
|
423
|
+
* @generated from protobuf field: float latitude = 1;
|
|
424
|
+
*/
|
|
425
|
+
latitude: number;
|
|
426
|
+
/**
|
|
427
|
+
* @generated from protobuf field: float longitude = 2;
|
|
428
|
+
*/
|
|
429
|
+
longitude: number;
|
|
430
|
+
/**
|
|
431
|
+
* @generated from protobuf field: optional string region = 3;
|
|
432
|
+
*/
|
|
433
|
+
region?: string;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* @generated MessageType for protobuf message media.edge.GeoLocation
|
|
437
|
+
*/
|
|
438
|
+
declare const GeoLocation$1: GeoLocation$Type;
|
|
439
|
+
declare class ConsumePeerRequest$Type extends MessageType$1<ConsumePeerRequest> {
|
|
440
|
+
constructor();
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @generated from protobuf message media.edge.ConsumePeerRequest
|
|
444
|
+
*/
|
|
445
|
+
interface ConsumePeerRequest {
|
|
446
|
+
/**
|
|
447
|
+
* @generated from protobuf field: string producing_peer_id = 1;
|
|
448
|
+
*/
|
|
449
|
+
producingPeerId: string;
|
|
450
|
+
/**
|
|
451
|
+
* @generated from protobuf field: optional bool paused = 2;
|
|
452
|
+
*/
|
|
453
|
+
paused?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* @generated from protobuf field: optional string producer_id = 3;
|
|
456
|
+
*/
|
|
457
|
+
producerId?: string;
|
|
458
|
+
/**
|
|
459
|
+
* @generated from protobuf field: optional media.PreferredCodec preferred_codec = 4;
|
|
460
|
+
*/
|
|
461
|
+
preferredCodec?: PreferredCodec;
|
|
462
|
+
/**
|
|
463
|
+
* @generated from protobuf field: optional string producing_transport_id = 5;
|
|
464
|
+
*/
|
|
465
|
+
producingTransportId?: string;
|
|
466
|
+
/**
|
|
467
|
+
* @generated from protobuf field: optional media.Simulcast simulcast = 6;
|
|
468
|
+
*/
|
|
469
|
+
simulcast?: Simulcast;
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* @generated MessageType for protobuf message media.edge.ConsumePeerRequest
|
|
473
|
+
*/
|
|
474
|
+
declare const ConsumePeerRequest: ConsumePeerRequest$Type;
|
|
475
|
+
declare class ConsumePeersRequest$Type extends MessageType$1<ConsumePeersRequest> {
|
|
476
|
+
constructor();
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* @generated from protobuf message media.edge.ConsumePeersRequest
|
|
480
|
+
*/
|
|
481
|
+
interface ConsumePeersRequest {
|
|
482
|
+
/**
|
|
483
|
+
* @generated from protobuf field: repeated media.edge.ConsumePeerRequest requests = 1;
|
|
484
|
+
*/
|
|
485
|
+
requests: ConsumePeerRequest[];
|
|
486
|
+
/**
|
|
487
|
+
* @generated from protobuf field: optional string consuming_transport_id = 2;
|
|
488
|
+
*/
|
|
489
|
+
consumingTransportId?: string;
|
|
490
|
+
}
|
|
491
|
+
/**
|
|
492
|
+
* @generated MessageType for protobuf message media.edge.ConsumePeersRequest
|
|
493
|
+
*/
|
|
494
|
+
declare const ConsumePeersRequest: ConsumePeersRequest$Type;
|
|
495
|
+
declare class UpdateConsumerSimulcastConfigRequest$Type extends MessageType$1<UpdateConsumerSimulcastConfigRequest> {
|
|
496
|
+
constructor();
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* @generated from protobuf message media.edge.UpdateConsumerSimulcastConfigRequest
|
|
500
|
+
*/
|
|
501
|
+
interface UpdateConsumerSimulcastConfigRequest {
|
|
502
|
+
/**
|
|
503
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
504
|
+
*/
|
|
505
|
+
producerId: string;
|
|
506
|
+
/**
|
|
507
|
+
* @generated from protobuf field: media.Simulcast simulcast = 2;
|
|
508
|
+
*/
|
|
509
|
+
simulcast?: Simulcast;
|
|
510
|
+
/**
|
|
511
|
+
* @generated from protobuf field: string producing_transport_id = 3;
|
|
512
|
+
*/
|
|
513
|
+
producingTransportId: string;
|
|
514
|
+
/**
|
|
515
|
+
* @generated from protobuf field: string mid = 4;
|
|
516
|
+
*/
|
|
517
|
+
mid: string;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* @generated MessageType for protobuf message media.edge.UpdateConsumerSimulcastConfigRequest
|
|
521
|
+
*/
|
|
522
|
+
declare const UpdateConsumerSimulcastConfigRequest: UpdateConsumerSimulcastConfigRequest$Type;
|
|
523
|
+
declare class UpdateConsumersSimulcastConfigRequest$Type extends MessageType$1<UpdateConsumersSimulcastConfigRequest> {
|
|
524
|
+
constructor();
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* @generated from protobuf message media.edge.UpdateConsumersSimulcastConfigRequest
|
|
528
|
+
*/
|
|
529
|
+
interface UpdateConsumersSimulcastConfigRequest {
|
|
530
|
+
/**
|
|
531
|
+
* @generated from protobuf field: repeated media.edge.UpdateConsumerSimulcastConfigRequest requests = 1;
|
|
532
|
+
*/
|
|
533
|
+
requests: UpdateConsumerSimulcastConfigRequest[];
|
|
534
|
+
/**
|
|
535
|
+
* @generated from protobuf field: optional string consuming_transport_id = 2;
|
|
536
|
+
*/
|
|
537
|
+
consumingTransportId?: string;
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* @generated MessageType for protobuf message media.edge.UpdateConsumersSimulcastConfigRequest
|
|
541
|
+
*/
|
|
542
|
+
declare const UpdateConsumersSimulcastConfigRequest: UpdateConsumersSimulcastConfigRequest$Type;
|
|
543
|
+
declare class ProducerCreateRequest$Type extends MessageType$1<ProducerCreateRequest> {
|
|
544
|
+
constructor();
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* @generated from protobuf message media.edge.ProducerCreateRequest
|
|
548
|
+
*/
|
|
549
|
+
interface ProducerCreateRequest {
|
|
550
|
+
/**
|
|
551
|
+
* @generated from protobuf field: string kind = 1;
|
|
552
|
+
*/
|
|
553
|
+
kind: string;
|
|
554
|
+
/**
|
|
555
|
+
* @generated from protobuf field: bool paused = 2;
|
|
556
|
+
*/
|
|
557
|
+
paused: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* @generated from protobuf field: bool screen_share = 3;
|
|
560
|
+
*/
|
|
561
|
+
screenShare: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* @generated from protobuf field: media.SessionDescription description = 4;
|
|
564
|
+
*/
|
|
565
|
+
description?: SessionDescription;
|
|
566
|
+
/**
|
|
567
|
+
* @generated from protobuf field: string msid = 5;
|
|
568
|
+
*/
|
|
569
|
+
msid: string;
|
|
570
|
+
/**
|
|
571
|
+
* @generated from protobuf field: optional string app_data = 6;
|
|
572
|
+
*/
|
|
573
|
+
appData?: string;
|
|
574
|
+
/**
|
|
575
|
+
* @generated from protobuf field: optional string mime_type = 7;
|
|
576
|
+
*/
|
|
577
|
+
mimeType?: string;
|
|
578
|
+
/**
|
|
579
|
+
* @generated from protobuf field: optional string producing_transport_id = 8;
|
|
580
|
+
*/
|
|
581
|
+
producingTransportId?: string;
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* @generated MessageType for protobuf message media.edge.ProducerCreateRequest
|
|
585
|
+
*/
|
|
586
|
+
declare const ProducerCreateRequest: ProducerCreateRequest$Type;
|
|
587
|
+
declare class ProducerCloseRequest$Type extends MessageType$1<ProducerCloseRequest> {
|
|
588
|
+
constructor();
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* @generated from protobuf message media.edge.ProducerCloseRequest
|
|
592
|
+
*/
|
|
593
|
+
interface ProducerCloseRequest {
|
|
594
|
+
/**
|
|
595
|
+
* @generated from protobuf field: string producer_id = 1;
|
|
596
|
+
*/
|
|
597
|
+
producerId: string;
|
|
598
|
+
/**
|
|
599
|
+
* @generated from protobuf field: media.SessionDescription description = 2;
|
|
600
|
+
*/
|
|
601
|
+
description?: SessionDescription;
|
|
602
|
+
/**
|
|
603
|
+
* @generated from protobuf field: optional string producing_transport_id = 3;
|
|
604
|
+
*/
|
|
605
|
+
producingTransportId?: string;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* @generated MessageType for protobuf message media.edge.ProducerCloseRequest
|
|
609
|
+
*/
|
|
610
|
+
declare const ProducerCloseRequest: ProducerCloseRequest$Type;
|
|
611
|
+
declare class ConsumerCloseRequest$Type extends MessageType$1<ConsumerCloseRequest> {
|
|
612
|
+
constructor();
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* @generated from protobuf message media.edge.ConsumerCloseRequest
|
|
616
|
+
*/
|
|
617
|
+
interface ConsumerCloseRequest {
|
|
618
|
+
/**
|
|
619
|
+
* @generated from protobuf field: repeated string consumer_ids = 1;
|
|
620
|
+
*/
|
|
621
|
+
consumerIds: string[];
|
|
622
|
+
/**
|
|
623
|
+
* @generated from protobuf field: media.SessionDescription description = 2;
|
|
624
|
+
*/
|
|
625
|
+
description?: SessionDescription;
|
|
626
|
+
/**
|
|
627
|
+
* @generated from protobuf field: optional string consuming_transport_id = 3;
|
|
628
|
+
*/
|
|
629
|
+
consumingTransportId?: string;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* @generated MessageType for protobuf message media.edge.ConsumerCloseRequest
|
|
633
|
+
*/
|
|
634
|
+
declare const ConsumerCloseRequest: ConsumerCloseRequest$Type;
|
|
635
|
+
declare class PeerDisplayNameEditRequest$Type extends MessageType$1<PeerDisplayNameEditRequest> {
|
|
636
|
+
constructor();
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* @generated from protobuf message media.edge.PeerDisplayNameEditRequest
|
|
640
|
+
*/
|
|
641
|
+
interface PeerDisplayNameEditRequest {
|
|
642
|
+
/**
|
|
643
|
+
* @generated from protobuf field: string participant_id = 1;
|
|
644
|
+
*/
|
|
645
|
+
participantId: string;
|
|
646
|
+
/**
|
|
647
|
+
* @generated from protobuf field: string display_name = 2;
|
|
648
|
+
*/
|
|
649
|
+
displayName: string;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* @generated MessageType for protobuf message media.edge.PeerDisplayNameEditRequest
|
|
653
|
+
*/
|
|
654
|
+
declare const PeerDisplayNameEditRequest: PeerDisplayNameEditRequest$Type;
|
|
275
655
|
declare class GetRoomStateResponse$Type extends MessageType$1<GetRoomStateResponse> {
|
|
276
656
|
constructor();
|
|
277
657
|
}
|
|
@@ -842,6 +1222,22 @@ interface MovePeersBetweenRoomsRequest {
|
|
|
842
1222
|
* @generated MessageType for protobuf message socket.room.MovePeersBetweenRoomsRequest
|
|
843
1223
|
*/
|
|
844
1224
|
declare const MovePeersBetweenRoomsRequest: MovePeersBetweenRoomsRequest$Type;
|
|
1225
|
+
declare class RemoveParticipantsRequest$Type extends MessageType$1<RemoveParticipantsRequest> {
|
|
1226
|
+
constructor();
|
|
1227
|
+
}
|
|
1228
|
+
/**
|
|
1229
|
+
* @generated from protobuf message socket.room.RemoveParticipantsRequest
|
|
1230
|
+
*/
|
|
1231
|
+
interface RemoveParticipantsRequest {
|
|
1232
|
+
/**
|
|
1233
|
+
* @generated from protobuf field: repeated string peer_ids = 1;
|
|
1234
|
+
*/
|
|
1235
|
+
peerIds: string[];
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* @generated MessageType for protobuf message socket.room.RemoveParticipantsRequest
|
|
1239
|
+
*/
|
|
1240
|
+
declare const RemoveParticipantsRequest: RemoveParticipantsRequest$Type;
|
|
845
1241
|
declare class WaitingRoomRequest$Type extends MessageType$1<WaitingRoomRequest> {
|
|
846
1242
|
constructor();
|
|
847
1243
|
}
|
|
@@ -3017,14 +3413,298 @@ declare abstract class HandlerInterface<TransportPromiseEvents> extends Enhanced
|
|
|
3017
3413
|
_addEventListeners(): void;
|
|
3018
3414
|
addCustomEventListeners(): void;
|
|
3019
3415
|
}
|
|
3416
|
+
type HandlerFactory<TransportPromiseEvents> = () => HandlerInterface<TransportPromiseEvents>;
|
|
3020
3417
|
|
|
3418
|
+
type ProducerOptions = {
|
|
3419
|
+
track?: MediaStreamTrack;
|
|
3420
|
+
encodings?: RTCRtpEncodingParameters[];
|
|
3421
|
+
codecOptions?: CodecOption[];
|
|
3422
|
+
stopTracks?: boolean;
|
|
3423
|
+
disableTrackOnPause?: boolean;
|
|
3424
|
+
zeroRtpOnPause?: boolean;
|
|
3425
|
+
appData?: Record<string, unknown>;
|
|
3426
|
+
};
|
|
3021
3427
|
type MediaKind$1 = 'audio' | 'video';
|
|
3428
|
+
type ProducerConstructorOptions = {
|
|
3429
|
+
id: string;
|
|
3430
|
+
localId: string;
|
|
3431
|
+
track?: MediaStreamTrack;
|
|
3432
|
+
stopTracks: boolean;
|
|
3433
|
+
disableTrackOnPause: boolean;
|
|
3434
|
+
zeroRtpOnPause: boolean;
|
|
3435
|
+
handler: HandlerInterface<TransportPromiseEvents>;
|
|
3436
|
+
appData?: Record<string, unknown>;
|
|
3437
|
+
rtpSender?: RTCRtpSender;
|
|
3438
|
+
};
|
|
3439
|
+
declare class Producer extends EnhancedEventEmitter<TransportPromiseEvents> {
|
|
3440
|
+
readonly id: string;
|
|
3441
|
+
readonly localId: string;
|
|
3442
|
+
readonly kind: MediaKind$1;
|
|
3443
|
+
readonly appData: Record<string, unknown>;
|
|
3444
|
+
readonly rtpSender: RTCRtpSender;
|
|
3445
|
+
constructor(context: Context<RTKContextState>, opt: ProducerConstructorOptions);
|
|
3446
|
+
get closed(): boolean;
|
|
3447
|
+
get track(): MediaStreamTrack | null;
|
|
3448
|
+
get paused(): boolean;
|
|
3449
|
+
get maxSpatialLayer(): number | undefined;
|
|
3450
|
+
close(reason?: string): Promise<void>;
|
|
3451
|
+
getStats(): Promise<RTCStatsReport>;
|
|
3452
|
+
pause(): void;
|
|
3453
|
+
resume(): void;
|
|
3454
|
+
replaceTrack({ track, }: {
|
|
3455
|
+
track: MediaStreamTrack | null;
|
|
3456
|
+
}): Promise<void>;
|
|
3457
|
+
setMaxSpatialLayer(spatialLayer: number): Promise<void>;
|
|
3458
|
+
setRtpEncodingParameters(params: RTCRtpEncodingParameters): Promise<void>;
|
|
3459
|
+
}
|
|
3022
3460
|
|
|
3461
|
+
declare enum SendType {
|
|
3462
|
+
Request = "REQUEST",
|
|
3463
|
+
Response = "RESPONSE",
|
|
3464
|
+
Notify = "NOTIFY"
|
|
3465
|
+
}
|
|
3466
|
+
type RPCMessage = {
|
|
3467
|
+
id: string;
|
|
3468
|
+
method: string;
|
|
3469
|
+
timer: NodeJS.Timeout | number;
|
|
3470
|
+
resolve: (v: unknown) => void;
|
|
3471
|
+
cancel: (e: unknown) => void;
|
|
3472
|
+
};
|
|
3023
3473
|
type DCMessage = {
|
|
3024
3474
|
type: string;
|
|
3025
3475
|
payload: Record<string, unknown>;
|
|
3026
3476
|
};
|
|
3477
|
+
type DCMessageChunked = {
|
|
3478
|
+
id: string;
|
|
3479
|
+
count: number;
|
|
3480
|
+
chunkIndex: number;
|
|
3481
|
+
chunk: string;
|
|
3482
|
+
};
|
|
3483
|
+
type ExtendedDCMessage = {
|
|
3484
|
+
payload: {
|
|
3485
|
+
_bolt: {
|
|
3486
|
+
id: string;
|
|
3487
|
+
type: SendType;
|
|
3488
|
+
version: number;
|
|
3489
|
+
};
|
|
3490
|
+
};
|
|
3491
|
+
} & DCMessage;
|
|
3492
|
+
declare class Datachannel extends EventEmitter$1 {
|
|
3493
|
+
readonly label: string;
|
|
3494
|
+
readonly transportId: string;
|
|
3495
|
+
static createRequest: (data: DCMessage) => ExtendedDCMessage;
|
|
3496
|
+
static createResponse: (id: string, data: DCMessage) => {
|
|
3497
|
+
type: string;
|
|
3498
|
+
payload: {
|
|
3499
|
+
_bolt: {
|
|
3500
|
+
id: string;
|
|
3501
|
+
type: SendType;
|
|
3502
|
+
version: number;
|
|
3503
|
+
};
|
|
3504
|
+
};
|
|
3505
|
+
};
|
|
3506
|
+
static createNotification: (data: DCMessage) => {
|
|
3507
|
+
type: string;
|
|
3508
|
+
payload: {
|
|
3509
|
+
bolt: {
|
|
3510
|
+
id: string;
|
|
3511
|
+
type: SendType;
|
|
3512
|
+
version: number;
|
|
3513
|
+
};
|
|
3514
|
+
};
|
|
3515
|
+
};
|
|
3516
|
+
static createErrorResponse: (id: string, error: Error) => ExtendedDCMessage;
|
|
3517
|
+
channel: RTCDataChannel;
|
|
3518
|
+
queue: Map<string, RPCMessage>;
|
|
3519
|
+
serverProtocolVersion?: number;
|
|
3520
|
+
constructor(context: Context<RTKContextState>, dc: RTCDataChannel, label: string, transportId: string);
|
|
3521
|
+
respond: (id: string, data: DCMessage | Error, error?: boolean) => void;
|
|
3522
|
+
notify: (data: DCMessage) => void;
|
|
3523
|
+
request: (data: DCMessage) => Promise<{
|
|
3524
|
+
type: string;
|
|
3525
|
+
payload: Record<string, unknown>;
|
|
3526
|
+
}>;
|
|
3527
|
+
send: (payload: DCMessage) => void;
|
|
3528
|
+
processMessage: (dcmsg: DCMessageChunked) => ExtendedDCMessage | undefined;
|
|
3529
|
+
processResponseMsg: (msg: ExtendedDCMessage) => boolean;
|
|
3530
|
+
processBoltHandshake: (msg: ExtendedDCMessage) => boolean;
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
type ConsumerStates = Map<string, {
|
|
3534
|
+
producingTransportId: string;
|
|
3535
|
+
} & ConsumerStateObject>;
|
|
3536
|
+
declare abstract class ConsumerStrategy {
|
|
3537
|
+
abstract create(producers: ProducerState[]): Promise<{
|
|
3538
|
+
consumerStates: ConsumerStates;
|
|
3539
|
+
sessionDescription?: SessionDescription;
|
|
3540
|
+
failedProducers?: (ProducerState & {
|
|
3541
|
+
errorCode?: string;
|
|
3542
|
+
consumerId?: string;
|
|
3543
|
+
})[];
|
|
3544
|
+
}>;
|
|
3545
|
+
abstract close(consumers: Consumer[]): Promise<{
|
|
3546
|
+
failedConsumers?: Consumer['id'][];
|
|
3547
|
+
}>;
|
|
3548
|
+
abstract negotiate(offer: RTCSessionDescriptionInit, reqId?: string, channelLabel?: string): Promise<RTCSessionDescriptionInit>;
|
|
3549
|
+
abstract switchConsumersToLayer(consumer: Consumer[], layer: number): Promise<void>;
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3552
|
+
declare const mediaEvents: {
|
|
3553
|
+
readonly unknown: 0;
|
|
3554
|
+
readonly createWebRTCTransport: 1;
|
|
3555
|
+
readonly produce: 2;
|
|
3556
|
+
readonly consume: 3;
|
|
3557
|
+
readonly toggleProducer: 4;
|
|
3558
|
+
readonly toggleConsumer: 5;
|
|
3559
|
+
readonly closeProducer: 6;
|
|
3560
|
+
readonly closeConsumer: 7;
|
|
3561
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
3562
|
+
readonly joinRoom: 16;
|
|
3563
|
+
readonly leaveRoom: 17;
|
|
3564
|
+
readonly selectedPeer: 18;
|
|
3565
|
+
readonly globalPinPeer: 19;
|
|
3566
|
+
readonly selfJoinComplete: 20;
|
|
3567
|
+
readonly peerJoinedBroadcast: 25;
|
|
3568
|
+
readonly peerLeaveBroadcast: 26;
|
|
3569
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
3570
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
3571
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
3572
|
+
readonly globalPeerPinBroadcast: 30;
|
|
3573
|
+
readonly recordingStartedBroadcast: 31;
|
|
3574
|
+
readonly recordingStoppedBroadcast: 32;
|
|
3575
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
3576
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
3577
|
+
readonly selectedPeerDiff: 40;
|
|
3578
|
+
readonly renegotiateSessionDescription: 50;
|
|
3579
|
+
readonly errorResponse: 60;
|
|
3580
|
+
readonly kickPeer: 90;
|
|
3581
|
+
readonly kickAll: 91;
|
|
3582
|
+
readonly changeDisplayName: 92;
|
|
3583
|
+
readonly hostControlPeer: 93;
|
|
3584
|
+
readonly hostControlAllPeers: 94;
|
|
3585
|
+
readonly audioActivity: 100;
|
|
3586
|
+
};
|
|
3587
|
+
declare const cfMediaEvents: {
|
|
3588
|
+
readonly unknown: 0;
|
|
3589
|
+
readonly createWebRTCTransport: 1;
|
|
3590
|
+
readonly produce: 2;
|
|
3591
|
+
readonly consume: 3;
|
|
3592
|
+
readonly toggleProducer: 4;
|
|
3593
|
+
readonly toggleConsumer: 5;
|
|
3594
|
+
readonly closeProducer: 6;
|
|
3595
|
+
readonly closeConsumer: 7;
|
|
3596
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
3597
|
+
readonly joinRoom: 16;
|
|
3598
|
+
readonly leaveRoom: 17;
|
|
3599
|
+
readonly selectedPeer: 18;
|
|
3600
|
+
readonly globalPinPeer: 19;
|
|
3601
|
+
readonly selfJoinComplete: 20;
|
|
3602
|
+
readonly peerJoinedBroadcast: 25;
|
|
3603
|
+
readonly peerLeaveBroadcast: 26;
|
|
3604
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
3605
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
3606
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
3607
|
+
readonly globalPeerPinBroadcast: 30;
|
|
3608
|
+
readonly recordingStartedBroadcast: 31;
|
|
3609
|
+
readonly recordingStoppedBroadcast: 32;
|
|
3610
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
3611
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
3612
|
+
readonly selectedPeerDiff: 40;
|
|
3613
|
+
readonly renegotiateSessionDescription: 50;
|
|
3614
|
+
readonly errorResponse: 60;
|
|
3615
|
+
readonly kickPeer: 90;
|
|
3616
|
+
readonly kickAll: 91;
|
|
3617
|
+
readonly changeDisplayName: 92;
|
|
3618
|
+
readonly hostControlPeer: 93;
|
|
3619
|
+
readonly hostControlAllPeers: 94;
|
|
3620
|
+
readonly audioActivity: 100;
|
|
3621
|
+
};
|
|
3622
|
+
|
|
3623
|
+
declare class SFUSocketOps {
|
|
3624
|
+
events: typeof cfMediaEvents | typeof mediaEvents;
|
|
3625
|
+
sfuType: MediaNodeType;
|
|
3626
|
+
constructor(socket: SocketService, sfuType: MediaNodeType);
|
|
3627
|
+
joinRoom(roomUuid: string, displayName: string, capabilities: PeerRtpCapabilitites, prejoined?: boolean, location?: GeoLocation$1): Promise<Uint8Array>;
|
|
3628
|
+
connectTransport(request: CreateTransportRequest): Promise<{
|
|
3629
|
+
transportId: string;
|
|
3630
|
+
answer: RTCSessionDescriptionInit;
|
|
3631
|
+
producerIds: string[];
|
|
3632
|
+
}>;
|
|
3633
|
+
produce(req: ProducerCreateRequest): Promise<{
|
|
3634
|
+
answer: RTCSessionDescriptionInit;
|
|
3635
|
+
producerId: string;
|
|
3636
|
+
}>;
|
|
3637
|
+
consume(req: ConsumePeersRequest): Promise<{
|
|
3638
|
+
consumerStateMap: {
|
|
3639
|
+
[key: string]: ConsumerState;
|
|
3640
|
+
};
|
|
3641
|
+
sessionDescription: SessionDescription;
|
|
3642
|
+
}>;
|
|
3643
|
+
closeProducer(req: ProducerCloseRequest): Promise<SessionDescription>;
|
|
3644
|
+
closeConsumer(req: ConsumerCloseRequest): Promise<Uint8Array>;
|
|
3645
|
+
updateConsumersSimulcastConfig(req: UpdateConsumersSimulcastConfigRequest): Promise<Uint8Array>;
|
|
3646
|
+
hostControlForPeer(peerId: string, kind: 'audio' | 'video'): Promise<boolean>;
|
|
3647
|
+
hostControlForAll(kind: 'audio' | 'video'): Promise<boolean>;
|
|
3648
|
+
kickAll(): Promise<void>;
|
|
3649
|
+
kickPeer(req: RemoveParticipantsRequest): Promise<void>;
|
|
3650
|
+
changeDisplayName(req: PeerDisplayNameEditRequest): Promise<boolean>;
|
|
3651
|
+
notifySelfJoinComplete(): Promise<PeerJoinCompleteResponse>;
|
|
3652
|
+
audioActivity(req: AudioActivityRequest): Promise<void>;
|
|
3653
|
+
}
|
|
3654
|
+
|
|
3655
|
+
type CreateProducerInfo = {
|
|
3656
|
+
offer: RTCSessionDescriptionInit;
|
|
3657
|
+
kind: string;
|
|
3658
|
+
paused: boolean;
|
|
3659
|
+
appData: ProducerOptions['appData'];
|
|
3660
|
+
codecOptions: CodecOption[];
|
|
3661
|
+
producingTransportId: string;
|
|
3662
|
+
};
|
|
3027
3663
|
|
|
3664
|
+
type AwaitQueueTask<T> = () => (T | PromiseLike<T>);
|
|
3665
|
+
type AwaitQueueTaskDump = {
|
|
3666
|
+
idx: number;
|
|
3667
|
+
task: AwaitQueueTask<unknown>;
|
|
3668
|
+
name?: string;
|
|
3669
|
+
enqueuedTime: number;
|
|
3670
|
+
executionTime: number;
|
|
3671
|
+
};
|
|
3672
|
+
type PendingTask<T> = {
|
|
3673
|
+
id: number;
|
|
3674
|
+
task: AwaitQueueTask<T>;
|
|
3675
|
+
metadata: Record<string, unknown>;
|
|
3676
|
+
name?: string;
|
|
3677
|
+
enqueuedAt: number;
|
|
3678
|
+
executedAt?: number;
|
|
3679
|
+
completedAt?: number;
|
|
3680
|
+
completed: boolean;
|
|
3681
|
+
resolve: (result: T | PromiseLike<T>) => void;
|
|
3682
|
+
reject: (error: Error) => void;
|
|
3683
|
+
};
|
|
3684
|
+
declare class AwaitQueue {
|
|
3685
|
+
readonly log: boolean;
|
|
3686
|
+
pendingTasks: Map<number, PendingTask<any>>;
|
|
3687
|
+
constructor(logger?: RTKLogger$1, log?: boolean);
|
|
3688
|
+
get size(): number;
|
|
3689
|
+
push<T>(task: AwaitQueueTask<T>, name?: string, metadata?: Record<string, unknown>): Promise<T>;
|
|
3690
|
+
stop(): void;
|
|
3691
|
+
remove(taskIdx: number): void;
|
|
3692
|
+
get<T>(taskIdx: number): PendingTask<T>;
|
|
3693
|
+
dump(): AwaitQueueTaskDump[];
|
|
3694
|
+
}
|
|
3695
|
+
|
|
3696
|
+
type TransportOptions = {
|
|
3697
|
+
iceServers?: RTCIceServer[];
|
|
3698
|
+
iceTransportPolicy?: RTCIceTransportPolicy;
|
|
3699
|
+
additionalSettings?: Record<string, unknown>;
|
|
3700
|
+
proprietaryConstraints?: Record<string, unknown>;
|
|
3701
|
+
appData?: Record<string, unknown>;
|
|
3702
|
+
config?: {
|
|
3703
|
+
enableDtx?: boolean;
|
|
3704
|
+
enableStereo: boolean;
|
|
3705
|
+
enableHighBitrate: boolean;
|
|
3706
|
+
};
|
|
3707
|
+
};
|
|
3028
3708
|
type TransportPromiseEvents = {
|
|
3029
3709
|
'close': {
|
|
3030
3710
|
answer: RTCSessionDescriptionInit;
|
|
@@ -3033,7 +3713,125 @@ type TransportPromiseEvents = {
|
|
|
3033
3713
|
description: RTCSessionDescriptionInit;
|
|
3034
3714
|
};
|
|
3035
3715
|
};
|
|
3716
|
+
type ConnectionState = 'new' | 'connecting' | 'connected' | 'failed' | 'disconnected' | 'closed';
|
|
3717
|
+
type InternalTransportOptions = {
|
|
3718
|
+
id?: string;
|
|
3719
|
+
direction: 'send' | 'recv';
|
|
3720
|
+
handlerFactory?: HandlerFactory<TransportPromiseEvents>;
|
|
3721
|
+
config?: {
|
|
3722
|
+
enableDtx?: boolean;
|
|
3723
|
+
enableStereo: boolean;
|
|
3724
|
+
enableHighBitrate: boolean;
|
|
3725
|
+
};
|
|
3726
|
+
} & TransportOptions;
|
|
3727
|
+
declare class Transport extends EnhancedEventEmitter<TransportPromiseEvents> {
|
|
3728
|
+
awaitQueue: AwaitQueue;
|
|
3729
|
+
observer: EnhancedEventEmitter<TransportPromiseEvents>;
|
|
3730
|
+
readonly id: string;
|
|
3731
|
+
serverId: string;
|
|
3732
|
+
readonly direction: 'send' | 'recv';
|
|
3733
|
+
readonly maxSctpMessageSize?: number | undefined;
|
|
3734
|
+
handler: HandlerInterface<TransportPromiseEvents>;
|
|
3735
|
+
connectionState: ConnectionState;
|
|
3736
|
+
readonly producers: Map<string, Producer>;
|
|
3737
|
+
readonly consumers: Map<string, Consumer>;
|
|
3738
|
+
readonly datachannels: Map<string, Datachannel>;
|
|
3739
|
+
connected: boolean;
|
|
3740
|
+
eventsDCReadyPromise: Promise<boolean>;
|
|
3741
|
+
eventsDCReadyPromiseResolver: (value: boolean | PromiseLike<boolean>) => void;
|
|
3742
|
+
eventsDCFailureTimer: NodeJS.Timeout;
|
|
3743
|
+
transportConnectionPromise: Promise<boolean>;
|
|
3744
|
+
readonly consumerTrackEvents: Map<string, (track: MediaStreamTrack, transceiver: RTCRtpTransceiver) => void>;
|
|
3745
|
+
readonly unknownTracksMap: Map<string, RTCTrackEvent>;
|
|
3746
|
+
readonly appData: Record<string, unknown>;
|
|
3747
|
+
get closed(): boolean;
|
|
3748
|
+
constructor(context: Context<RTKContextState>, sfu: MediaNodeType, { id, direction, handlerFactory, iceServers, iceTransportPolicy, proprietaryConstraints, additionalSettings, appData, config, }: InternalTransportOptions);
|
|
3749
|
+
setServerId(id: string): void;
|
|
3750
|
+
getDatachannel(label: string): Datachannel;
|
|
3751
|
+
get isEventsDCReady(): Promise<boolean>;
|
|
3752
|
+
close(): void;
|
|
3753
|
+
getStats(): Promise<RTCStatsReport>;
|
|
3754
|
+
connect(transportConnectionRequest: (offer: RTCSessionDescriptionInit) => Promise<{
|
|
3755
|
+
transportId: string;
|
|
3756
|
+
answer: RTCSessionDescriptionInit;
|
|
3757
|
+
}>): Promise<void>;
|
|
3758
|
+
restartIce(): Promise<GenericHandlerResult>;
|
|
3759
|
+
canProduce(producerOptions: ProducerOptions): Promise<boolean>;
|
|
3760
|
+
produce(producerOptions: ProducerOptions, producerCreationRequest: (info: CreateProducerInfo) => Promise<{
|
|
3761
|
+
answer: RTCSessionDescriptionInit;
|
|
3762
|
+
producerId: string;
|
|
3763
|
+
}>): Promise<Producer>;
|
|
3764
|
+
createProducerObject(opts: ProducerConstructorOptions): Promise<Producer>;
|
|
3765
|
+
closeProducer(producer: Producer): Promise<void>;
|
|
3766
|
+
canConsume(): Promise<boolean>;
|
|
3767
|
+
consume(producers: ProducerState[], consumerCreationRequest: ConsumerStrategy['create'], negotiationRequest: ConsumerStrategy['negotiate']): Promise<{
|
|
3768
|
+
consumers: Consumer[];
|
|
3769
|
+
failedProducers: (ProducerState & {
|
|
3770
|
+
errorCode?: string;
|
|
3771
|
+
consumerId?: string;
|
|
3772
|
+
})[];
|
|
3773
|
+
}>;
|
|
3774
|
+
static parseCodecAndFmtpMappings(sdp: RTCSessionDescription, mids: string[]): {
|
|
3775
|
+
[mid: string]: {
|
|
3776
|
+
rtp: transform.MediaAttributes['rtp'];
|
|
3777
|
+
fmtp: transform.MediaAttributes['fmtp'];
|
|
3778
|
+
payloads: string;
|
|
3779
|
+
rtcpFb: transform.MediaAttributes['rtcpFb'];
|
|
3780
|
+
};
|
|
3781
|
+
};
|
|
3782
|
+
static setCodecAndFmtpMappings(sdp: RTCSessionDescriptionInit, mids: string[], payloadMappings: {
|
|
3783
|
+
[mid: string]: {
|
|
3784
|
+
rtp: transform.MediaAttributes['rtp'];
|
|
3785
|
+
fmtp: transform.MediaAttributes['fmtp'];
|
|
3786
|
+
payloads: string;
|
|
3787
|
+
rtcpFb: transform.MediaAttributes['rtcpFb'];
|
|
3788
|
+
};
|
|
3789
|
+
}): {
|
|
3790
|
+
sdp: string;
|
|
3791
|
+
type: RTCSdpType;
|
|
3792
|
+
};
|
|
3793
|
+
static parseHeaderExtensionMappings(sdp: RTCSessionDescriptionInit): {
|
|
3794
|
+
[mid: string]: {
|
|
3795
|
+
value: number;
|
|
3796
|
+
direction?: string;
|
|
3797
|
+
uri: string;
|
|
3798
|
+
config?: string;
|
|
3799
|
+
}[];
|
|
3800
|
+
};
|
|
3801
|
+
static setHeaderExtensionMappings(sdp: RTCSessionDescriptionInit, headerExtensions: {
|
|
3802
|
+
[mid: string]: transform.SharedAttributes['ext'];
|
|
3803
|
+
}): {
|
|
3804
|
+
sdp: string;
|
|
3805
|
+
type: RTCSdpType;
|
|
3806
|
+
};
|
|
3807
|
+
closeConsumers(consumers: Consumer[], closeFn: (consumers: Consumer[], offer: RTCSessionDescriptionInit) => Promise<RTCSessionDescriptionInit>): Promise<void>;
|
|
3808
|
+
setRemoteOffer(offer: RTCSessionDescriptionInit): Promise<RTCSessionDescriptionInit>;
|
|
3809
|
+
_ontrack(event: RTCTrackEvent): void;
|
|
3810
|
+
sendErrorOverDC(label: string, id: string, error: Error): void;
|
|
3811
|
+
sendResponseOverDC(label: string, id: string, payload: DCMessage): void;
|
|
3812
|
+
createConsumerObjectAndWaitForTrack(opts: ConsumerCreationTaskOptions): Promise<Consumer>;
|
|
3813
|
+
setRemoteDescription(sdp: RTCSessionDescriptionInit): Promise<void>;
|
|
3814
|
+
setLocalDescription(sdp: RTCSessionDescriptionInit): Promise<void>;
|
|
3815
|
+
sendDataChannelMessage(channel: string, req: DCMessage): Promise<Record<string, unknown>>;
|
|
3816
|
+
}
|
|
3036
3817
|
|
|
3818
|
+
type ConsumerStateObject = {
|
|
3819
|
+
consumerId: string;
|
|
3820
|
+
trackId: string;
|
|
3821
|
+
streamId: string;
|
|
3822
|
+
screenShare: boolean;
|
|
3823
|
+
paused: boolean;
|
|
3824
|
+
appData: any;
|
|
3825
|
+
kind: 'audio' | 'video';
|
|
3826
|
+
producingPeerId: string;
|
|
3827
|
+
mimeType?: string;
|
|
3828
|
+
};
|
|
3829
|
+
type ConsumerCreationTaskOptions = {
|
|
3830
|
+
producerId: string;
|
|
3831
|
+
producingPeerId: string;
|
|
3832
|
+
producingTransportId: string;
|
|
3833
|
+
appData: Record<string, unknown>;
|
|
3834
|
+
} & ConsumerStateObject;
|
|
3037
3835
|
type ConsumerOptions = {
|
|
3038
3836
|
id?: string;
|
|
3039
3837
|
producerId: string;
|
|
@@ -3681,6 +4479,11 @@ declare class RTKSelf$1 extends RTKSelfMedia$1 {
|
|
|
3681
4479
|
removeDocumentEventListeners(): Promise<void>;
|
|
3682
4480
|
enableAudio(customTrack?: MediaStreamTrack): Promise<void>;
|
|
3683
4481
|
enableVideo(customTrack?: MediaStreamTrack): Promise<void>;
|
|
4482
|
+
produce(payload: {
|
|
4483
|
+
producingTransportId: string;
|
|
4484
|
+
producerId: string;
|
|
4485
|
+
kind: string;
|
|
4486
|
+
}): Promise<void>;
|
|
3684
4487
|
updateVideoConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
3685
4488
|
enableScreenShare(): Promise<void>;
|
|
3686
4489
|
updateScreenshareConstraints(resolution: VideoQualityConstraints): Promise<void>;
|
|
@@ -4627,11 +5430,11 @@ declare class BrowserDetection {
|
|
|
4627
5430
|
isMobile(): boolean;
|
|
4628
5431
|
getDeviceInfo: () => {
|
|
4629
5432
|
isMobile: boolean;
|
|
4630
|
-
browserName:
|
|
4631
|
-
osName:
|
|
4632
|
-
browserVersion:
|
|
4633
|
-
osVersionName:
|
|
4634
|
-
engineName:
|
|
5433
|
+
browserName: string;
|
|
5434
|
+
osName: string;
|
|
5435
|
+
browserVersion: string;
|
|
5436
|
+
osVersionName: string;
|
|
5437
|
+
engineName: string;
|
|
4635
5438
|
};
|
|
4636
5439
|
_checkCondition(checkTree: any): any;
|
|
4637
5440
|
isVersionGreaterThan(version: any): any;
|
|
@@ -4745,6 +5548,93 @@ declare const enum PRODUCERS_TYPE {
|
|
|
4745
5548
|
SCREENSHARE_AUDIO = "screenshare_audio"
|
|
4746
5549
|
}
|
|
4747
5550
|
|
|
5551
|
+
declare class TransportLayer extends EventEmitter$1 {
|
|
5552
|
+
context: Context<RTKContextState>;
|
|
5553
|
+
get telemetry(): RTKTelemetry;
|
|
5554
|
+
get logger(): RTKLogger$1;
|
|
5555
|
+
protected get socket(): SocketService;
|
|
5556
|
+
protected get socketHandler(): SFUSocketOps;
|
|
5557
|
+
protected get sendTransport(): Transport;
|
|
5558
|
+
protected get recvTransport(): Transport;
|
|
5559
|
+
get events(): {
|
|
5560
|
+
readonly unknown: 0;
|
|
5561
|
+
readonly createWebRTCTransport: 1;
|
|
5562
|
+
readonly produce: 2;
|
|
5563
|
+
readonly consume: 3;
|
|
5564
|
+
readonly toggleProducer: 4;
|
|
5565
|
+
readonly toggleConsumer: 5;
|
|
5566
|
+
readonly closeProducer: 6;
|
|
5567
|
+
readonly closeConsumer: 7;
|
|
5568
|
+
readonly updateConsumersSimulcastConfig: 8;
|
|
5569
|
+
readonly joinRoom: 16;
|
|
5570
|
+
readonly leaveRoom: 17;
|
|
5571
|
+
readonly selectedPeer: 18;
|
|
5572
|
+
readonly globalPinPeer: 19;
|
|
5573
|
+
readonly selfJoinComplete: 20;
|
|
5574
|
+
readonly peerJoinedBroadcast: 25;
|
|
5575
|
+
readonly peerLeaveBroadcast: 26;
|
|
5576
|
+
readonly peerProducerCreateBroadcast: 27;
|
|
5577
|
+
readonly peerProducerToggleBroadcast: 28;
|
|
5578
|
+
readonly peerProducerCloseBroadcast: 29;
|
|
5579
|
+
readonly globalPeerPinBroadcast: 30;
|
|
5580
|
+
readonly recordingStartedBroadcast: 31;
|
|
5581
|
+
readonly recordingStoppedBroadcast: 32;
|
|
5582
|
+
readonly peerDisplayNameEditBroadcast: 33;
|
|
5583
|
+
readonly mediaRoomTerminationBroadcastResponse: 36;
|
|
5584
|
+
readonly selectedPeerDiff: 40;
|
|
5585
|
+
readonly renegotiateSessionDescription: 50;
|
|
5586
|
+
readonly errorResponse: 60;
|
|
5587
|
+
readonly kickPeer: 90;
|
|
5588
|
+
readonly kickAll: 91;
|
|
5589
|
+
readonly changeDisplayName: 92;
|
|
5590
|
+
readonly hostControlPeer: 93;
|
|
5591
|
+
readonly hostControlAllPeers: 94;
|
|
5592
|
+
readonly audioActivity: 100;
|
|
5593
|
+
};
|
|
5594
|
+
protected get nodeType(): MediaNodeType;
|
|
5595
|
+
protected set sendTransportConnectedCallback(cb: (transport: Transport) => void);
|
|
5596
|
+
protected set recvTransportConnectedCallback(cb: (transport: Transport) => void);
|
|
5597
|
+
constructor(context: Context<RTKContextState>, socket: SocketService, nodeType: MediaNodeType);
|
|
5598
|
+
setupTransports(directions: {
|
|
5599
|
+
send?: boolean;
|
|
5600
|
+
recv?: boolean;
|
|
5601
|
+
}): Promise<void>;
|
|
5602
|
+
stopTransports(directions: {
|
|
5603
|
+
send?: boolean;
|
|
5604
|
+
recv?: boolean;
|
|
5605
|
+
}): void;
|
|
5606
|
+
stopAllTransports(): void;
|
|
5607
|
+
}
|
|
5608
|
+
|
|
5609
|
+
declare class SFUHandler extends TransportLayer {
|
|
5610
|
+
get socketHandler(): SFUSocketOps;
|
|
5611
|
+
get producers(): Map<string, Producer>;
|
|
5612
|
+
get consumers(): Map<string, Consumer>;
|
|
5613
|
+
get producerIdToConsumerIdMap(): Map<string, string>;
|
|
5614
|
+
get logger(): RTKLogger$1;
|
|
5615
|
+
constructor(context: Context<RTKContextState>, socket: SocketService, nodeType: MediaNodeType);
|
|
5616
|
+
reset(): void;
|
|
5617
|
+
createProducer(producerOptions: ProducerOptions, onClose: () => void): Promise<Producer>;
|
|
5618
|
+
closeProducer(id: Producer['id'], options?: Partial<{
|
|
5619
|
+
stopTrack: boolean;
|
|
5620
|
+
}>): Promise<void>;
|
|
5621
|
+
closeAllProducers(): Promise<void[]>;
|
|
5622
|
+
produce(payload: {
|
|
5623
|
+
producingTransportId: string;
|
|
5624
|
+
producerId: string;
|
|
5625
|
+
kind: string;
|
|
5626
|
+
}): Promise<{
|
|
5627
|
+
answer: RTCSessionDescriptionInit;
|
|
5628
|
+
producerId: string;
|
|
5629
|
+
}>;
|
|
5630
|
+
createConsumer(producer: ProducerState): Promise<void>;
|
|
5631
|
+
createConsumers(producers: ProducerState[]): Promise<void>;
|
|
5632
|
+
closeConsumer(consumer: Consumer['id']): Promise<void>;
|
|
5633
|
+
closeConsumers(consumers: Consumer['id'][]): Promise<void>;
|
|
5634
|
+
closeAllConsumers(): Promise<void>;
|
|
5635
|
+
switchConsumersToLayer(consumers: Consumer[], layer: number): Promise<void>;
|
|
5636
|
+
}
|
|
5637
|
+
|
|
4748
5638
|
interface MediaPermissions {
|
|
4749
5639
|
canProduceAudio?: MediaProductionPermissionType;
|
|
4750
5640
|
canProduceVideo?: MediaProductionPermissionType;
|
|
@@ -4761,6 +5651,7 @@ declare class MediaNodeClient {
|
|
|
4761
5651
|
readonly authToken: string;
|
|
4762
5652
|
readonly e2ee: boolean;
|
|
4763
5653
|
get peerId(): string;
|
|
5654
|
+
get sfuHandler(): SFUHandler;
|
|
4764
5655
|
get telemetry(): RTKTelemetry;
|
|
4765
5656
|
get logger(): RTKLogger$1;
|
|
4766
5657
|
constructor(context: Context<RTKContextState>, nodeType: MediaNodeType, options: MediaNodeClientOptions);
|