@vkontakte/calls-sdk 2.8.11-dev.fdf6f999.0 → 2.8.11

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.
@@ -23,7 +23,6 @@ import { ParticipantsStateList, ParticipantStateMapped } from '../types/Particip
23
23
  import { MediaType } from '../types/ParticipantStreamDescription';
24
24
  import { IRoomId, Room, RoomParticipantUpdate, Rooms, RoomsUpdate } from '../types/Room';
25
25
  import { IAPIBaseUrl, IApiEnv } from '../types/Params';
26
- import type { VideoStreamDebugInfo } from '../types/VideoStreamDebug';
27
26
  import { VmojiError } from '../types/Vmoji';
28
27
  import { DebugMessageType } from './Debug';
29
28
  import { ParticipantStatus } from './External';
@@ -105,13 +104,6 @@ export type ParamsObject = {
105
104
  debugLog: boolean;
106
105
  /** @hidden */
107
106
  debug: boolean;
108
- /**
109
- * Вкчлючает отправку на клиент статы по входящим/исходящим видео-потокам
110
- * @hidden
111
- *
112
- * _По умолчанию: `false`_
113
- */
114
- debugVideoStreams: boolean;
115
107
  /**
116
108
  * Выставляет таймаут в ms для fetch запросов от sdk
117
109
  * По умолчанию 5000 ms
@@ -264,13 +256,6 @@ export type ParamsObject = {
264
256
  perfStatReportEnabled: boolean;
265
257
  /** @hidden */
266
258
  callStatReportEnabled: boolean;
267
- /**
268
- * Включает логирование событий продуктовой статистики.
269
- *
270
- * _По умолчанию: `false`_
271
- * @hidden
272
- */
273
- clientEventsLoggingEnabled: boolean;
274
259
  /**
275
260
  * Отдавать приоритет кодеку H264 для исходящего видео
276
261
  *
@@ -357,7 +342,14 @@ export type ParamsObject = {
357
342
  * Включает поддержку режима WAIT_FOR_ADMIN в звонках.
358
343
  */
359
344
  waitForAdminInGroupCalls: boolean;
345
+ /**
346
+ * Включает поддержку удержания звонка
347
+ */
360
348
  hold: boolean;
349
+ /**
350
+ * Максимальное количество параллельных звонков
351
+ */
352
+ maxParallelCalls: number;
361
353
  /**
362
354
  * Индекс участника для первого chunk'а который придет при установке соединения с сервером
363
355
  *
@@ -495,113 +487,127 @@ export type ParamsObject = {
495
487
  * _По умолчанию: `false`_
496
488
  */
497
489
  webtransportFF: boolean;
490
+ /**
491
+ * Ждать подтверждения от бэкенда для команд startStream/stopStream.
492
+ * При включении: reject без соединения, resolve/reject по ответу бэкенда,
493
+ * а при реконнекте — по стейту записи из Connection-сообщения.
494
+ *
495
+ * _По умолчанию: `false`_
496
+ */
497
+ waitForRecordResponse: boolean;
498
498
  /**
499
499
  * Включить поддержку прозрачного аудио
500
500
  *
501
501
  * _По умолчанию: `false`_
502
502
  */
503
503
  transparentAudio: boolean;
504
+ /**
505
+ * Включить получение обновлений состояния медийной сессии участников
506
+ *
507
+ * _По умолчанию: `false`_
508
+ */
509
+ enableSessionStateUpdates: boolean;
504
510
  /**
505
511
  * Получен локальный стрим с камеры/микрофона
506
512
  */
507
- onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
513
+ onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
508
514
  /**
509
515
  * Локальный стрим изменился
510
516
  */
511
- onLocalStreamUpdate?: (mediaSettings: MediaSettings, kind: MediaTrackKind) => void;
517
+ onLocalStreamUpdate?: (mediaSettings: MediaSettings, kind: MediaTrackKind, conversationId?: string) => void;
512
518
  /**
513
519
  * Локальный стрим с экрана добавлен/удалён
514
520
  */
515
- onScreenStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
521
+ onScreenStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
516
522
  /**
517
523
  * Локальный стрим вимоджи добавлен/удалён
518
524
  */
519
- onVmojiStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
525
+ onVmojiStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
520
526
  /**
521
527
  * Произошла ошибка вимоджи
522
528
  */
523
- onVmojiError?: (error: VmojiError) => void;
529
+ onVmojiError?: (error: VmojiError, conversationId?: string) => void;
524
530
  /**
525
531
  * Изменился статус локального соединения
526
532
  */
527
- onLocalStatus?: (status: ParticipantStatus) => void;
533
+ onLocalStatus?: (status: ParticipantStatus, conversationId?: string) => void;
528
534
  /**
529
535
  * Получен стрим собеседника.
530
536
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
531
537
  */
532
- onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
538
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
533
539
  /**
534
540
  * Cтрим собеседника приостановлен/возобновлен.
535
541
  */
536
- onRemoteStreamSuspended?: (userId: ExternalParticipantId, mediaType: MediaType, suspended: boolean) => void;
542
+ onRemoteStreamSuspended?: (userId: ExternalParticipantId, mediaType: MediaType, suspended: boolean, conversationId?: string) => void;
537
543
  /**
538
544
  * Получен стрим с экрана собеседника.
539
545
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
540
546
  */
541
- onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
547
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
542
548
  /**
543
549
  * Получен стрим вимоджи собеседника.
544
550
  * Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
545
551
  */
546
- onRemoteVmojiStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
552
+ onRemoteVmojiStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
547
553
  /**
548
554
  * Получен стрим трансляция или мувик от собеседника.
549
555
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
550
556
  */
551
- onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
557
+ onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData, conversationId?: string) => void;
552
558
  /**
553
559
  * Получен собственный стрим трансляция или мувик.
554
560
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
555
561
  */
556
- onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
562
+ onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData, conversationId?: string) => void;
557
563
  /**
558
564
  * Получено обновление стрима или лайва от собеседника.
559
565
  */
560
- onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
566
+ onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState, conversationId?: string) => void;
561
567
  /**
562
568
  * Получено обновление собственного стрима или лайва.
563
569
  */
564
- onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
570
+ onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState, conversationId?: string) => void;
565
571
  /**
566
572
  * Начат звонок
567
573
  */
568
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
574
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string) => void;
569
575
  /**
570
576
  * Начальный список участников для постраничного звонка
571
577
  */
572
- onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
578
+ onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk, conversationId?: string) => void;
573
579
  /**
574
580
  * Изменились данные стрима собеседника
575
581
  */
576
- onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers: ExternalParticipantListMarkers | null) => void;
582
+ onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
577
583
  /**
578
584
  * Изменились данные стрима собеседника
579
585
  */
580
- onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
586
+ onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, conversationId?: string) => void;
581
587
  /**
582
588
  * Полученны данные по стримам (лайв/мувик) от собеседника
583
589
  */
584
- onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId) => void;
590
+ onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId, conversationId?: string) => void;
585
591
  /**
586
592
  * Полученны данные по остановленным стримам (лайв/мувик) от собеседника
587
593
  */
588
- onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId) => void;
594
+ onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId, conversationId?: string) => void;
589
595
  /**
590
596
  * Полученны данные по собственным стримам (лайв/мувик)
591
597
  */
592
- onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId) => void;
598
+ onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId, conversationId?: string) => void;
593
599
  /**
594
600
  * Полученны данные по собственным остановленным стримам (лайв/мувик)
595
601
  */
596
- onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId) => void;
602
+ onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId, conversationId?: string) => void;
597
603
  /**
598
604
  * Добавили участника
599
605
  */
600
- onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
606
+ onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
601
607
  /**
602
608
  * Участник присоединился к звонку
603
609
  */
604
- onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
610
+ onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers, conversationId?: string) => void;
605
611
  /**
606
612
  * Получены данные по изменению локальных состояний со стороны админа
607
613
  * Например, принудительно опущена рука
@@ -609,19 +615,19 @@ export type ParamsObject = {
609
615
  * @param participantState Полный объект состояния участника, полученный от SDK/сервера.
610
616
  * @param global `true` – действие глобальное (для всех участников), `false` – действие локальное (только у текущего пользователя).
611
617
  */
612
- onLocalParticipantState?: (participantState: ParticipantStateMapped, global: boolean) => void;
618
+ onLocalParticipantState?: (participantState: ParticipantStateMapped, global: boolean, conversationId?: string) => void;
613
619
  /**
614
620
  * Изменились данные состояний собеседника
615
621
  */
616
- onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null) => void;
622
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
617
623
  /**
618
624
  * Изменились данные состояний нескольких собеседников
619
625
  */
620
- onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId) => void;
626
+ onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId, conversationId?: string) => void;
621
627
  /**
622
628
  * Изменился статус соединения собеседников
623
629
  */
624
- onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
630
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any, conversationId?: string) => void;
625
631
  /**
626
632
  * Разрешения на доступы были запрошены в браузере
627
633
  */
@@ -633,56 +639,56 @@ export type ParamsObject = {
633
639
  /**
634
640
  * Пользователь отключился от звонка
635
641
  */
636
- onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
642
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
637
643
  /**
638
644
  * Изменилось состояние звонка
639
645
  */
640
- onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
646
+ onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string) => void;
641
647
  /**
642
648
  * Изменилось состояние камеры или микрофона
643
649
  */
644
- onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
650
+ onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean, conversationId?: string) => void;
645
651
  /**
646
652
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
647
653
  */
648
- onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[], roomId?: number | null) => void;
654
+ onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[], roomId?: number | null, conversationId?: string) => void;
649
655
  /**
650
656
  * Изменились роли собеседника в звонке
651
657
  */
652
- onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[], isInitial?: boolean) => void;
658
+ onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[], isInitial?: boolean, conversationId?: string) => void;
653
659
  /**
654
660
  * Изменились свои роли в звонке
655
661
  */
656
- onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean) => void;
662
+ onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean, conversationId?: string) => void;
657
663
  /**
658
664
  * Закрепляет/открепляет собеседника для всех
659
665
  */
660
- onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers: ExternalParticipantListMarkers | null, roomId?: number | null) => void;
666
+ onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers: ExternalParticipantListMarkers | null, roomId?: number | null, conversationId?: string) => void;
661
667
  /**
662
668
  * Закрепляет/открепляет текущего пользователя у других собеседников
663
669
  */
664
- onLocalPin?: (unpin: boolean) => void;
670
+ onLocalPin?: (unpin: boolean, conversationId?: string) => void;
665
671
  /**
666
672
  * Изменились опции звонка
667
673
  */
668
- onOptionsChanged?: (options: ConversationOption[]) => void;
669
- onRateNeeded?: Function;
674
+ onOptionsChanged?: (options: ConversationOption[], conversationId?: string) => void;
675
+ onRateNeeded?: (conversationId?: string) => void;
670
676
  /**
671
677
  * Изменился говорящий в звонке
672
678
  */
673
- onSpeakerChanged?: (userId: ExternalParticipantId) => void;
679
+ onSpeakerChanged?: (userId: ExternalParticipantId, conversationId?: string) => void;
674
680
  /**
675
681
  * Громкость собеседников
676
682
  */
677
683
  onVolumesDetected?: (volumes: {
678
684
  uid: ExternalParticipantId;
679
685
  volume: number;
680
- }[]) => void;
686
+ }[], conversationId?: string) => void;
681
687
  /**
682
688
  * Громкость своего микрофона
683
689
  */
684
690
  onLocalVolume?: (volume: number, isMicEnabled: boolean) => void;
685
- onJoinStatus?: Function;
691
+ onJoinStatus?: (available: boolean, chatId: string, conversationId?: string) => void;
686
692
  /**
687
693
  * Звонок был завершен
688
694
  */
@@ -690,12 +696,12 @@ export type ParamsObject = {
690
696
  /**
691
697
  * Входящий звонок был принят мной
692
698
  */
693
- onCallAccepted?: () => void;
699
+ onCallAccepted?: (conversationId?: string) => void;
694
700
  /**
695
701
  * Исходящий звонок был принят кем-то
696
702
  * @param userId
697
703
  */
698
- onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
704
+ onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities, conversationId?: string) => void;
699
705
  /**
700
706
  * Список устройств изменился
701
707
  */
@@ -712,25 +718,25 @@ export type ParamsObject = {
712
718
  /**
713
719
  * Получено сообщение чата
714
720
  */
715
- onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean) => void;
721
+ onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean, conversationId?: string) => void;
716
722
  /**
717
723
  * Получены данные от собеседника
718
724
  */
719
- onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean) => void;
725
+ onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean, conversationId?: string) => void;
720
726
  /**
721
727
  * Начата трансляция/запись звонка
722
728
  */
723
- onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string, roomId?: number | null) => void;
729
+ onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string, roomId?: number | null, conversationId?: string) => void;
724
730
  /**
725
731
  * Закончена трансляция/запись звонка
726
732
  */
727
- onRecordStopped?: (roomId: number | null, stopBy: ExternalParticipantId | null) => void;
733
+ onRecordStopped?: (roomId: number | null, stopBy: ExternalParticipantId | null, conversationId?: string) => void;
728
734
  /**
729
735
  * Состояние своей сети
730
736
  *
731
737
  * @param rating Оценка качества соединения от 0 до 1
732
738
  */
733
- onLocalNetworkStatusChanged?: (rating: number) => void;
739
+ onLocalNetworkStatusChanged?: (rating: number, conversationId?: string) => void;
734
740
  /**
735
741
  * Состояние сети участников
736
742
  *
@@ -739,7 +745,7 @@ export type ParamsObject = {
739
745
  onNetworkStatusChanged?: (status: {
740
746
  uid: ExternalParticipantId;
741
747
  rating: number;
742
- }[]) => void;
748
+ }[], conversationId?: string) => void;
743
749
  /**
744
750
  * Получено отладочное сообщение. Работает только при выключенном режиме отладки
745
751
  */
@@ -767,74 +773,74 @@ export type ParamsObject = {
767
773
  * @param addedParticipantIds Некоторое количество участников, добавленных в зал
768
774
  * @param removedParticipantIds Некоторое количество участников, убранных из зала
769
775
  */
770
- onChatRoomUpdated?: (eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[], addedParticipantIds: ExternalId[], removedParticipantIds: ExternalId[]) => void;
776
+ onChatRoomUpdated?: (eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[], addedParticipantIds: ExternalId[], removedParticipantIds: ExternalId[], conversationId?: string) => void;
771
777
  /**
772
778
  * Получен микшированный аудио стрим.
773
779
  * @hidden
774
780
  * @param stream стрим от WebRTC
775
781
  */
776
- onRemoteMixedAudioStream?: (stream: MediaStream) => void;
782
+ onRemoteMixedAudioStream?: (stream: MediaStream, conversationId?: string) => void;
777
783
  /**
778
784
  * Получена новая ссылка на звонок
779
785
  * @param joinLink токен присоединения к звонку
780
786
  */
781
- onJoinLinkChanged?: (joinLink: string) => void;
787
+ onJoinLinkChanged?: (joinLink: string, conversationId?: string) => void;
782
788
  /**
783
789
  * Получено обновление списка сессионных залов
784
790
  * @param updates список обновлений по залам
785
791
  */
786
- onRoomsUpdated?: (updates: Partial<Record<RoomsEventType, RoomsUpdate>>) => void;
792
+ onRoomsUpdated?: (updates: Partial<Record<RoomsEventType, RoomsUpdate>>, conversationId?: string) => void;
787
793
  /**
788
794
  * Получено обновление сессионных зало
789
795
  * @param eventTypes список событий
790
796
  * @param roomId номер сессионного зала
791
797
  * @param room сессионный зал
792
798
  */
793
- onRoomUpdated?: (eventTypes: RoomsEventType[], roomId: number, room: Room | null, deactivate: boolean | null) => void;
799
+ onRoomUpdated?: (eventTypes: RoomsEventType[], roomId: number, room: Room | null, deactivate: boolean | null, conversationId?: string) => void;
794
800
  /**
795
801
  * Получение обновление списка участников в сессионном зале
796
802
  * @param update обновление списка участников
797
803
  */
798
- onRoomParticipantsUpdated?: (update: RoomParticipantUpdate) => void;
804
+ onRoomParticipantsUpdated?: (update: RoomParticipantUpdate, conversationId?: string) => void;
799
805
  /**
800
806
  * Получение информации о смене зала
801
807
  * @param roomId номер сессионного зала
802
808
  */
803
- onRoomSwitched?: (roomId: number | null) => void;
809
+ onRoomSwitched?: (roomId: number | null, conversationId?: string) => void;
804
810
  /**
805
811
  * Установить id сессионного зала на старте звонка
806
812
  * @param roomId номер сессионного зала
807
813
  */
808
- onRoomStart?: (roomId: number | null) => void;
814
+ onRoomStart?: (roomId: number | null, conversationId?: string) => void;
809
815
  /**
810
816
  * Получены новые реакции в звонке
811
817
  * @param feedback массив с реакциями
812
818
  */
813
- onFeedback?: (feedback: IFeedbackExternal[], roomId: number | null) => void;
819
+ onFeedback?: (feedback: IFeedbackExternal[], roomId: number | null, conversationId?: string) => void;
814
820
  /**
815
821
  * Изменился список ролей, которым доступны ConversationFeatures
816
822
  *
817
823
  * @param featuresPerRole Объект вида ключ: ConversationFeature = значение: UserRole[]
818
824
  * (если ключ фичи отсутствует, или в ролях пустой массив, считаем фичу доступной для всех пользователей)
819
825
  */
820
- onFeaturesPerRoleChanged?: (featuresPerRole: IFeaturesPerRole) => void;
826
+ onFeaturesPerRoleChanged?: (featuresPerRole: IFeaturesPerRole, conversationId?: string) => void;
821
827
  /**
822
828
  * Изменился Vmoji-аватар пользователя
823
829
  * @param externalId Id пользователя, у которого изменился аватар
824
830
  */
825
- onParticipantVmojiUpdate?: (externalId: ExternalParticipantId) => void;
831
+ onParticipantVmojiUpdate?: (externalId: ExternalParticipantId, conversationId?: string) => void;
826
832
  /**
827
833
  * Начата текстовая расшифровка звонка
828
834
  * @param initiatorId Id пользователя, запустившего расшифровку звонка
829
835
  * @param movieId Id расшифровки
830
836
  * @param roomId Id комнаты
831
837
  */
832
- onAsrStarted?: (initiatorId: ExternalParticipantId, movieId: number, roomId: number | null) => void;
838
+ onAsrStarted?: (initiatorId: ExternalParticipantId, movieId: number, roomId: number | null, conversationId?: string) => void;
833
839
  /**
834
840
  * Закончена текстовая расшифровка звонка
835
841
  * @param roomId Id комнаты
836
842
  */
837
- onAsrStopped?: (roomId: number | null) => void;
843
+ onAsrStopped?: (roomId: number | null, conversationId?: string) => void;
838
844
  /**
839
845
  * Получена расшифровка речи
840
846
  * @param id Id пользователя, произнесшего реплику
@@ -842,56 +848,53 @@ export type ParamsObject = {
842
848
  * @param timestamp Время расшифровки
843
849
  * @param duration Длительность реплики в расшифровке
844
850
  */
845
- onAsrTranscription?: (id: ExternalParticipantId, text: string, timestamp: number, duration: number) => void;
851
+ onAsrTranscription?: (id: ExternalParticipantId, text: string, timestamp: number, duration: number, conversationId?: string) => void;
846
852
  /**
847
853
  * Установка начальных параметров текстовой расшифровки звонка. (Используется при входе в звонок/ смене комнаты)
848
854
  * @param data Начальная информация по ASR
849
855
  * @param roomId Id Комнаты
850
856
  */
851
- onAsrSet?: (data: IAsrData | null, roomId: number | null) => void;
857
+ onAsrSet?: (data: IAsrData | null, roomId: number | null, conversationId?: string) => void;
852
858
  /**
853
859
  * Админ начал/остановил совместное использование стороннего web-приложения
854
860
  * @param userId id участника-админа
855
861
  * @param sharedUrl url страницы
856
862
  */
857
- onRemoteSharedUrl?: (userId: ExternalParticipantId, sharedUrl: string | undefined, roomId: IRoomId) => void;
863
+ onRemoteSharedUrl?: (userId: ExternalParticipantId, sharedUrl: string | undefined, roomId: IRoomId, conversationId?: string) => void;
858
864
  /**
859
865
  * Изменился id участника (деанонимизация)
860
866
  * @param prevId
861
867
  * @param newId
862
868
  */
863
- onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId) => void;
869
+ onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId, conversationId?: string) => void;
864
870
  /**
865
871
  * Предложение включить режим автоматического отключения приёма видео
866
872
  * в плохой сети
867
873
  * @param bandwidth текущая полоса пропускания, kbps
868
874
  */
869
- onVideoSuspendSuggest?: (bandwidth: number) => void;
875
+ onVideoSuspendSuggest?: (bandwidth: number, conversationId?: string) => void;
870
876
  /**
871
877
  * Одобрено повышение пользователя в зале ожидания/зале в режиме Audience
872
878
  *
873
879
  * @param adminParticipantId админ, одобривший повышение
874
880
  */
875
- onPromotionApproved?: (adminParticipantId: ExternalParticipantId) => void;
881
+ onPromotionApproved?: (adminParticipantId: ExternalParticipantId, conversationId?: string) => void;
876
882
  /**
877
883
  * Участник повышен/разжалован в зале ожидания/зале в режиме Audience
878
884
  *
879
885
  * @param demoted участник разжалован
880
886
  */
881
- onPromoted?: (demoted: boolean) => void;
887
+ onPromoted?: (demoted: boolean, conversationId?: string) => void;
882
888
  /**
883
- * Собеседник подключился к сигналлингу
889
+ * Активным установлен определенный звонок
890
+ *
891
+ * @param conversationId ID звонка
884
892
  */
885
- onPeerRegistered?: () => void;
893
+ onCallActive?: (conversationId: string) => void;
886
894
  /**
887
- * Дебаг информация по видеопотоку, отформатированная SDK для отображения в клиенте.
888
- *
889
- * Работает только если включен `debugVideoStreams`.
890
- *
891
- * @param externalParticipantId Id участника, к которому относится видеопоток
892
- * @param info Структурированные данные о дебаге видеопотока
895
+ * Собеседник подключился к сигналлингу
893
896
  */
894
- onVideoStreamDebug?: (externalParticipantId: ExternalParticipantId, info: VideoStreamDebugInfo) => void;
897
+ onPeerRegistered?: (conversationId?: string) => void;
895
898
  };
896
899
  export default abstract class Params {
897
900
  private static _params;
@@ -943,7 +946,6 @@ export default abstract class Params {
943
946
  static get waitMessageDelay(): number;
944
947
  static get waitAnotherTabDelay(): number;
945
948
  static get debugLog(): boolean;
946
- static get debugVideoStreams(): false | ((externalParticipantId: ExternalParticipantId, info: VideoStreamDebugInfo) => void) | undefined;
947
949
  static get forceRelayPolicy(): boolean;
948
950
  static set forceRelayPolicy(value: boolean);
949
951
  static get videoMinWidth(): number;
@@ -982,7 +984,6 @@ export default abstract class Params {
982
984
  static get networkStatisticsInterval(): number;
983
985
  static get perfStatReportEnabled(): boolean;
984
986
  static get callStatReportEnabled(): boolean;
985
- static get clientEventsLoggingEnabled(): boolean;
986
987
  static get enableLogPerfStatReport(): boolean;
987
988
  static get asrDataChannel(): boolean;
988
989
  static get consumerScreenDataChannelPacketSize(): number;
@@ -1002,6 +1003,7 @@ export default abstract class Params {
1002
1003
  static get addParticipant(): boolean;
1003
1004
  static get waitForAdminInGroupCalls(): boolean;
1004
1005
  static get hold(): boolean;
1006
+ static get maxParallelCalls(): number;
1005
1007
  static get participantListChunkInitIndex(): number;
1006
1008
  static get participantListChunkInitCount(): number | null;
1007
1009
  static get filterObservers(): boolean;
@@ -1024,7 +1026,9 @@ export default abstract class Params {
1024
1026
  static get simulcast(): boolean;
1025
1027
  static get webtransport(): boolean;
1026
1028
  static get webtransportFF(): boolean;
1029
+ static get waitForRecordResponse(): boolean;
1027
1030
  static get transparentAudio(): boolean;
1031
+ static get enableSessionStateUpdates(): boolean;
1028
1032
  static toJSON(): {
1029
1033
  apiKey: string;
1030
1034
  apiEnv: string;
@@ -1059,6 +1063,8 @@ export default abstract class Params {
1059
1063
  simulcast: boolean;
1060
1064
  webtransport: boolean;
1061
1065
  webtransportFF: boolean;
1066
+ waitForRecordResponse: boolean;
1062
1067
  transparentAudio: boolean;
1068
+ enableSessionStateUpdates: boolean;
1063
1069
  };
1064
1070
  }
@@ -0,0 +1,16 @@
1
+ import { ParticipantConnectionStatus, ParticipantSessionState } from '../types/Participant';
2
+ import { ParticipantStatus } from './External';
3
+ import TransportState from '../enums/TransportState';
4
+ type StatusTransition = {
5
+ status: ParticipantStatus;
6
+ shouldNotify: boolean;
7
+ };
8
+ declare namespace ParticipantConnectionStatusUtils {
9
+ function create(status?: Partial<ParticipantConnectionStatus> | null): ParticipantConnectionStatus;
10
+ function fromTransportState(state?: TransportState): ParticipantStatus | null;
11
+ function computeEffective(status: ParticipantConnectionStatus): ParticipantStatus;
12
+ function setSessionState(status: ParticipantConnectionStatus, sessionState?: ParticipantSessionState, sessionStateConnectedBySpeaker?: boolean): StatusTransition;
13
+ function setTransport(status: ParticipantConnectionStatus, transport: ParticipantStatus): StatusTransition;
14
+ function setSessionStateApplicable(status: ParticipantConnectionStatus, applicable: boolean): StatusTransition;
15
+ }
16
+ export default ParticipantConnectionStatusUtils;
@@ -0,0 +1,24 @@
1
+ export type TCapabilities = {
2
+ estimatedPerformanceIndex: number;
3
+ audioMix: boolean;
4
+ consumerUpdate: boolean;
5
+ producerNotificationDataChannelVersion: number;
6
+ producerCommandDataChannelVersion: number;
7
+ consumerScreenDataChannelVersion: number;
8
+ producerScreenDataChannelVersion: number;
9
+ asrDataChannelVersion: number;
10
+ animojiDataChannelVersion: number;
11
+ animojiBackendRender: boolean;
12
+ onDemandTracks: boolean;
13
+ unifiedPlan: boolean;
14
+ singleSession: boolean;
15
+ videoTracksCount: number;
16
+ red: boolean;
17
+ audioShare: boolean;
18
+ fastScreenShare: boolean;
19
+ videoSuspend: boolean;
20
+ simulcast: boolean;
21
+ consumerFastScreenShare: boolean;
22
+ consumerFastScreenShareQualityOnDemand: boolean;
23
+ transparentAudio: boolean;
24
+ };
@@ -18,7 +18,7 @@ export type ExternalUserId = string;
18
18
  export declare namespace ExternalIdUtils {
19
19
  function fromIds(ids: ExternalUserId[] | ExternalId[]): ExternalId[];
20
20
  function fromId(id: ExternalUserId, type?: ExternalIdType, deviceIdx?: number): ExternalParticipantId;
21
- function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean): ExternalParticipantId | undefined;
21
+ function fromSignalingParticipant(participant: SignalingMessage.Participant, useDecorative?: boolean, fallbackToNonDecorative?: boolean): ExternalParticipantId | undefined;
22
22
  function fromSignaling(signalingId: SignalingMessage.ExternalId, deviceIdx?: number): ExternalParticipantId;
23
23
  function toSignaling(externalId: ExternalId): string;
24
24
  function toString(externalId: ExternalId): ExternalIdString;
@@ -44,6 +44,16 @@ export interface ParticipantStateMapped {
44
44
  ts: number;
45
45
  };
46
46
  }
47
+ export interface ParticipantSessionState {
48
+ connected: boolean;
49
+ }
50
+ export interface ParticipantConnectionStatus {
51
+ transport: ParticipantStatus;
52
+ sessionState?: ParticipantSessionState;
53
+ sessionStateApplicable: boolean;
54
+ sessionStateConnectedBySpeaker: boolean;
55
+ lastEffective: ParticipantStatus;
56
+ }
47
57
  /**
48
58
  * Состояния участников звонка
49
59
  */
@@ -63,7 +73,6 @@ export interface Participant {
63
73
  externalId: ExternalParticipantId;
64
74
  mediaSettings: MediaSettings;
65
75
  state: ParticipantState;
66
- status: ParticipantStatus;
67
76
  remoteStream?: MediaStream | null;
68
77
  remoteAudioTrack?: MediaStreamTrack | null;
69
78
  secondStream?: MediaStream | null;
@@ -72,6 +81,8 @@ export interface Participant {
72
81
  clientType: string;
73
82
  roles: UserRole[];
74
83
  participantState: ParticipantStateMapped;
84
+ isOnHold?: boolean;
85
+ connectionStatus: ParticipantConnectionStatus;
75
86
  networkRating: number;
76
87
  lastRequestedLayouts: {
77
88
  [key: StreamDescriptionString]: ParticipantLayout;
@@ -1,8 +1,11 @@
1
+ import IceServer from './IceServer';
1
2
  type PushData = {
2
3
  caller_id: string;
3
4
  caller_client_type?: string;
4
5
  conversation_id: string;
5
6
  endpoint: string;
7
+ wt_endpoint?: string;
8
+ turn_server?: IceServer;
6
9
  is_video: boolean;
7
10
  token: string;
8
11
  sdp_offer?: string;