@vkontakte/calls-sdk 2.8.11-dev.d27d8de2.0 → 2.8.11-dev.d5496fb5.0

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.
@@ -256,13 +256,6 @@ export type ParamsObject = {
256
256
  perfStatReportEnabled: boolean;
257
257
  /** @hidden */
258
258
  callStatReportEnabled: boolean;
259
- /**
260
- * Включает логирование событий продуктовой статистики.
261
- *
262
- * _По умолчанию: `false`_
263
- * @hidden
264
- */
265
- clientEventsLoggingEnabled: boolean;
266
259
  /**
267
260
  * Отдавать приоритет кодеку H264 для исходящего видео
268
261
  *
@@ -349,7 +342,14 @@ export type ParamsObject = {
349
342
  * Включает поддержку режима WAIT_FOR_ADMIN в звонках.
350
343
  */
351
344
  waitForAdminInGroupCalls: boolean;
345
+ /**
346
+ * Включает поддержку удержания звонка
347
+ */
352
348
  hold: boolean;
349
+ /**
350
+ * Максимальное количество параллельных звонков
351
+ */
352
+ maxParallelCalls: number;
353
353
  /**
354
354
  * Индекс участника для первого chunk'а который придет при установке соединения с сервером
355
355
  *
@@ -493,107 +493,113 @@ export type ParamsObject = {
493
493
  * _По умолчанию: `false`_
494
494
  */
495
495
  transparentAudio: boolean;
496
+ /**
497
+ * Включить получение обновлений состояния медийной сессии участников
498
+ *
499
+ * _По умолчанию: `false`_
500
+ */
501
+ enableSessionStateUpdates: boolean;
496
502
  /**
497
503
  * Получен локальный стрим с камеры/микрофона
498
504
  */
499
- onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
505
+ onLocalStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
500
506
  /**
501
507
  * Локальный стрим изменился
502
508
  */
503
- onLocalStreamUpdate?: (mediaSettings: MediaSettings, kind: MediaTrackKind) => void;
509
+ onLocalStreamUpdate?: (mediaSettings: MediaSettings, kind: MediaTrackKind, conversationId?: string) => void;
504
510
  /**
505
511
  * Локальный стрим с экрана добавлен/удалён
506
512
  */
507
- onScreenStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
513
+ onScreenStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
508
514
  /**
509
515
  * Локальный стрим вимоджи добавлен/удалён
510
516
  */
511
- onVmojiStream?: (stream: MediaStream | null, mediaSettings: MediaSettings) => void;
517
+ onVmojiStream?: (stream: MediaStream | null, mediaSettings: MediaSettings, conversationId?: string) => void;
512
518
  /**
513
519
  * Произошла ошибка вимоджи
514
520
  */
515
- onVmojiError?: (error: VmojiError) => void;
521
+ onVmojiError?: (error: VmojiError, conversationId?: string) => void;
516
522
  /**
517
523
  * Изменился статус локального соединения
518
524
  */
519
- onLocalStatus?: (status: ParticipantStatus) => void;
525
+ onLocalStatus?: (status: ParticipantStatus, conversationId?: string) => void;
520
526
  /**
521
527
  * Получен стрим собеседника.
522
528
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
523
529
  */
524
- onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
530
+ onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
525
531
  /**
526
532
  * Cтрим собеседника приостановлен/возобновлен.
527
533
  */
528
- onRemoteStreamSuspended?: (userId: ExternalParticipantId, mediaType: MediaType, suspended: boolean) => void;
534
+ onRemoteStreamSuspended?: (userId: ExternalParticipantId, mediaType: MediaType, suspended: boolean, conversationId?: string) => void;
529
535
  /**
530
536
  * Получен стрим с экрана собеседника.
531
537
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
532
538
  */
533
- onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
539
+ onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
534
540
  /**
535
541
  * Получен стрим вимоджи собеседника.
536
542
  * Если сервер закончил стримить вимоджи собеседника, вместо стрима будет передан null
537
543
  */
538
- onRemoteVmojiStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
544
+ onRemoteVmojiStream?: (userId: ExternalParticipantId, stream: MediaStream | null, conversationId?: string) => void;
539
545
  /**
540
546
  * Получен стрим трансляция или мувик от собеседника.
541
547
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
542
548
  */
543
- onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
549
+ onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData, conversationId?: string) => void;
544
550
  /**
545
551
  * Получен собственный стрим трансляция или мувик.
546
552
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
547
553
  */
548
- onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
554
+ onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData, conversationId?: string) => void;
549
555
  /**
550
556
  * Получено обновление стрима или лайва от собеседника.
551
557
  */
552
- onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
558
+ onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState, conversationId?: string) => void;
553
559
  /**
554
560
  * Получено обновление собственного стрима или лайва.
555
561
  */
556
- onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
562
+ onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState, conversationId?: string) => void;
557
563
  /**
558
564
  * Начат звонок
559
565
  */
560
- onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms) => void;
566
+ onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants: ExternalParticipant[], rooms?: Rooms, conversationId?: string) => void;
561
567
  /**
562
568
  * Начальный список участников для постраничного звонка
563
569
  */
564
- onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
570
+ onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk, conversationId?: string) => void;
565
571
  /**
566
572
  * Изменились данные стрима собеседника
567
573
  */
568
- onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers: ExternalParticipantListMarkers | null) => void;
574
+ onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
569
575
  /**
570
576
  * Изменились данные стрима собеседника
571
577
  */
572
- onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
578
+ onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, conversationId?: string) => void;
573
579
  /**
574
580
  * Полученны данные по стримам (лайв/мувик) от собеседника
575
581
  */
576
- onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId) => void;
582
+ onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId, conversationId?: string) => void;
577
583
  /**
578
584
  * Полученны данные по остановленным стримам (лайв/мувик) от собеседника
579
585
  */
580
- onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId) => void;
586
+ onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId, conversationId?: string) => void;
581
587
  /**
582
588
  * Полученны данные по собственным стримам (лайв/мувик)
583
589
  */
584
- onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId) => void;
590
+ onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo, roomId?: IRoomId, conversationId?: string) => void;
585
591
  /**
586
592
  * Полученны данные по собственным остановленным стримам (лайв/мувик)
587
593
  */
588
- onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId) => void;
594
+ onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo, roomId?: IRoomId, conversationId?: string) => void;
589
595
  /**
590
596
  * Добавили участника
591
597
  */
592
- onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
598
+ onParticipantAdded?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
593
599
  /**
594
600
  * Участник присоединился к звонку
595
601
  */
596
- onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers) => void;
602
+ onParticipantJoined?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers, conversationId?: string) => void;
597
603
  /**
598
604
  * Получены данные по изменению локальных состояний со стороны админа
599
605
  * Например, принудительно опущена рука
@@ -601,19 +607,19 @@ export type ParamsObject = {
601
607
  * @param participantState Полный объект состояния участника, полученный от SDK/сервера.
602
608
  * @param global `true` – действие глобальное (для всех участников), `false` – действие локальное (только у текущего пользователя).
603
609
  */
604
- onLocalParticipantState?: (participantState: ParticipantStateMapped, global: boolean) => void;
610
+ onLocalParticipantState?: (participantState: ParticipantStateMapped, global: boolean, conversationId?: string) => void;
605
611
  /**
606
612
  * Изменились данные состояний собеседника
607
613
  */
608
- onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null) => void;
614
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
609
615
  /**
610
616
  * Изменились данные состояний нескольких собеседников
611
617
  */
612
- onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId) => void;
618
+ onRemoteParticipantsState?: (stateList: ParticipantsStateList, roomId?: IRoomId, conversationId?: string) => void;
613
619
  /**
614
620
  * Изменился статус соединения собеседников
615
621
  */
616
- onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
622
+ onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any, conversationId?: string) => void;
617
623
  /**
618
624
  * Разрешения на доступы были запрошены в браузере
619
625
  */
@@ -625,56 +631,56 @@ export type ParamsObject = {
625
631
  /**
626
632
  * Пользователь отключился от звонка
627
633
  */
628
- onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null) => void;
634
+ onRemoteRemoved?: (userId: ExternalParticipantId, markers: ExternalParticipantListMarkers | null, conversationId?: string) => void;
629
635
  /**
630
636
  * Изменилось состояние звонка
631
637
  */
632
- onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData) => void;
638
+ onCallState?: (isCallActive: boolean, canAddParticipants: boolean, conversation: ConversationData, conversationId?: string) => void;
633
639
  /**
634
640
  * Изменилось состояние камеры или микрофона
635
641
  */
636
- onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean) => void;
642
+ onDeviceSwitched?: (mediaOption: MediaOption, enabled: boolean, conversationId?: string) => void;
637
643
  /**
638
644
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
639
645
  */
640
- 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;
646
+ 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;
641
647
  /**
642
648
  * Изменились роли собеседника в звонке
643
649
  */
644
- onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[], isInitial?: boolean) => void;
650
+ onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[], isInitial?: boolean, conversationId?: string) => void;
645
651
  /**
646
652
  * Изменились свои роли в звонке
647
653
  */
648
- onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean) => void;
654
+ onLocalRolesChanged?: (roles: UserRole[], isInitial?: boolean, conversationId?: string) => void;
649
655
  /**
650
656
  * Закрепляет/открепляет собеседника для всех
651
657
  */
652
- onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers: ExternalParticipantListMarkers | null, roomId?: number | null) => void;
658
+ onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers: ExternalParticipantListMarkers | null, roomId?: number | null, conversationId?: string) => void;
653
659
  /**
654
660
  * Закрепляет/открепляет текущего пользователя у других собеседников
655
661
  */
656
- onLocalPin?: (unpin: boolean) => void;
662
+ onLocalPin?: (unpin: boolean, conversationId?: string) => void;
657
663
  /**
658
664
  * Изменились опции звонка
659
665
  */
660
- onOptionsChanged?: (options: ConversationOption[]) => void;
661
- onRateNeeded?: Function;
666
+ onOptionsChanged?: (options: ConversationOption[], conversationId?: string) => void;
667
+ onRateNeeded?: (conversationId?: string) => void;
662
668
  /**
663
669
  * Изменился говорящий в звонке
664
670
  */
665
- onSpeakerChanged?: (userId: ExternalParticipantId) => void;
671
+ onSpeakerChanged?: (userId: ExternalParticipantId, conversationId?: string) => void;
666
672
  /**
667
673
  * Громкость собеседников
668
674
  */
669
675
  onVolumesDetected?: (volumes: {
670
676
  uid: ExternalParticipantId;
671
677
  volume: number;
672
- }[]) => void;
678
+ }[], conversationId?: string) => void;
673
679
  /**
674
680
  * Громкость своего микрофона
675
681
  */
676
682
  onLocalVolume?: (volume: number, isMicEnabled: boolean) => void;
677
- onJoinStatus?: Function;
683
+ onJoinStatus?: (available: boolean, chatId: string, conversationId?: string) => void;
678
684
  /**
679
685
  * Звонок был завершен
680
686
  */
@@ -682,12 +688,12 @@ export type ParamsObject = {
682
688
  /**
683
689
  * Входящий звонок был принят мной
684
690
  */
685
- onCallAccepted?: () => void;
691
+ onCallAccepted?: (conversationId?: string) => void;
686
692
  /**
687
693
  * Исходящий звонок был принят кем-то
688
694
  * @param userId
689
695
  */
690
- onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities) => void;
696
+ onAcceptedCall?: (userId: ExternalParticipantId, capabilities: ParticipantCapabilities, conversationId?: string) => void;
691
697
  /**
692
698
  * Список устройств изменился
693
699
  */
@@ -704,25 +710,25 @@ export type ParamsObject = {
704
710
  /**
705
711
  * Получено сообщение чата
706
712
  */
707
- onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean) => void;
713
+ onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean, conversationId?: string) => void;
708
714
  /**
709
715
  * Получены данные от собеседника
710
716
  */
711
- onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean) => void;
717
+ onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean, conversationId?: string) => void;
712
718
  /**
713
719
  * Начата трансляция/запись звонка
714
720
  */
715
- onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string, roomId?: number | null) => void;
721
+ onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string, roomId?: number | null, conversationId?: string) => void;
716
722
  /**
717
723
  * Закончена трансляция/запись звонка
718
724
  */
719
- onRecordStopped?: (roomId: number | null, stopBy: ExternalParticipantId | null) => void;
725
+ onRecordStopped?: (roomId: number | null, stopBy: ExternalParticipantId | null, conversationId?: string) => void;
720
726
  /**
721
727
  * Состояние своей сети
722
728
  *
723
729
  * @param rating Оценка качества соединения от 0 до 1
724
730
  */
725
- onLocalNetworkStatusChanged?: (rating: number) => void;
731
+ onLocalNetworkStatusChanged?: (rating: number, conversationId?: string) => void;
726
732
  /**
727
733
  * Состояние сети участников
728
734
  *
@@ -731,7 +737,7 @@ export type ParamsObject = {
731
737
  onNetworkStatusChanged?: (status: {
732
738
  uid: ExternalParticipantId;
733
739
  rating: number;
734
- }[]) => void;
740
+ }[], conversationId?: string) => void;
735
741
  /**
736
742
  * Получено отладочное сообщение. Работает только при выключенном режиме отладки
737
743
  */
@@ -759,74 +765,74 @@ export type ParamsObject = {
759
765
  * @param addedParticipantIds Некоторое количество участников, добавленных в зал
760
766
  * @param removedParticipantIds Некоторое количество участников, убранных из зала
761
767
  */
762
- onChatRoomUpdated?: (eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[], addedParticipantIds: ExternalId[], removedParticipantIds: ExternalId[]) => void;
768
+ onChatRoomUpdated?: (eventType: ChatRoomEventType, totalCount: number, firstParticipants: ExternalId[], addedParticipantIds: ExternalId[], removedParticipantIds: ExternalId[], conversationId?: string) => void;
763
769
  /**
764
770
  * Получен микшированный аудио стрим.
765
771
  * @hidden
766
772
  * @param stream стрим от WebRTC
767
773
  */
768
- onRemoteMixedAudioStream?: (stream: MediaStream) => void;
774
+ onRemoteMixedAudioStream?: (stream: MediaStream, conversationId?: string) => void;
769
775
  /**
770
776
  * Получена новая ссылка на звонок
771
777
  * @param joinLink токен присоединения к звонку
772
778
  */
773
- onJoinLinkChanged?: (joinLink: string) => void;
779
+ onJoinLinkChanged?: (joinLink: string, conversationId?: string) => void;
774
780
  /**
775
781
  * Получено обновление списка сессионных залов
776
782
  * @param updates список обновлений по залам
777
783
  */
778
- onRoomsUpdated?: (updates: Partial<Record<RoomsEventType, RoomsUpdate>>) => void;
784
+ onRoomsUpdated?: (updates: Partial<Record<RoomsEventType, RoomsUpdate>>, conversationId?: string) => void;
779
785
  /**
780
786
  * Получено обновление сессионных зало
781
787
  * @param eventTypes список событий
782
788
  * @param roomId номер сессионного зала
783
789
  * @param room сессионный зал
784
790
  */
785
- onRoomUpdated?: (eventTypes: RoomsEventType[], roomId: number, room: Room | null, deactivate: boolean | null) => void;
791
+ onRoomUpdated?: (eventTypes: RoomsEventType[], roomId: number, room: Room | null, deactivate: boolean | null, conversationId?: string) => void;
786
792
  /**
787
793
  * Получение обновление списка участников в сессионном зале
788
794
  * @param update обновление списка участников
789
795
  */
790
- onRoomParticipantsUpdated?: (update: RoomParticipantUpdate) => void;
796
+ onRoomParticipantsUpdated?: (update: RoomParticipantUpdate, conversationId?: string) => void;
791
797
  /**
792
798
  * Получение информации о смене зала
793
799
  * @param roomId номер сессионного зала
794
800
  */
795
- onRoomSwitched?: (roomId: number | null) => void;
801
+ onRoomSwitched?: (roomId: number | null, conversationId?: string) => void;
796
802
  /**
797
803
  * Установить id сессионного зала на старте звонка
798
804
  * @param roomId номер сессионного зала
799
805
  */
800
- onRoomStart?: (roomId: number | null) => void;
806
+ onRoomStart?: (roomId: number | null, conversationId?: string) => void;
801
807
  /**
802
808
  * Получены новые реакции в звонке
803
809
  * @param feedback массив с реакциями
804
810
  */
805
- onFeedback?: (feedback: IFeedbackExternal[], roomId: number | null) => void;
811
+ onFeedback?: (feedback: IFeedbackExternal[], roomId: number | null, conversationId?: string) => void;
806
812
  /**
807
813
  * Изменился список ролей, которым доступны ConversationFeatures
808
814
  *
809
815
  * @param featuresPerRole Объект вида ключ: ConversationFeature = значение: UserRole[]
810
816
  * (если ключ фичи отсутствует, или в ролях пустой массив, считаем фичу доступной для всех пользователей)
811
817
  */
812
- onFeaturesPerRoleChanged?: (featuresPerRole: IFeaturesPerRole) => void;
818
+ onFeaturesPerRoleChanged?: (featuresPerRole: IFeaturesPerRole, conversationId?: string) => void;
813
819
  /**
814
820
  * Изменился Vmoji-аватар пользователя
815
821
  * @param externalId Id пользователя, у которого изменился аватар
816
822
  */
817
- onParticipantVmojiUpdate?: (externalId: ExternalParticipantId) => void;
823
+ onParticipantVmojiUpdate?: (externalId: ExternalParticipantId, conversationId?: string) => void;
818
824
  /**
819
825
  * Начата текстовая расшифровка звонка
820
826
  * @param initiatorId Id пользователя, запустившего расшифровку звонка
821
827
  * @param movieId Id расшифровки
822
828
  * @param roomId Id комнаты
823
829
  */
824
- onAsrStarted?: (initiatorId: ExternalParticipantId, movieId: number, roomId: number | null) => void;
830
+ onAsrStarted?: (initiatorId: ExternalParticipantId, movieId: number, roomId: number | null, conversationId?: string) => void;
825
831
  /**
826
832
  * Закончена текстовая расшифровка звонка
827
833
  * @param roomId Id комнаты
828
834
  */
829
- onAsrStopped?: (roomId: number | null) => void;
835
+ onAsrStopped?: (roomId: number | null, conversationId?: string) => void;
830
836
  /**
831
837
  * Получена расшифровка речи
832
838
  * @param id Id пользователя, произнесшего реплику
@@ -834,47 +840,53 @@ export type ParamsObject = {
834
840
  * @param timestamp Время расшифровки
835
841
  * @param duration Длительность реплики в расшифровке
836
842
  */
837
- onAsrTranscription?: (id: ExternalParticipantId, text: string, timestamp: number, duration: number) => void;
843
+ onAsrTranscription?: (id: ExternalParticipantId, text: string, timestamp: number, duration: number, conversationId?: string) => void;
838
844
  /**
839
845
  * Установка начальных параметров текстовой расшифровки звонка. (Используется при входе в звонок/ смене комнаты)
840
846
  * @param data Начальная информация по ASR
841
847
  * @param roomId Id Комнаты
842
848
  */
843
- onAsrSet?: (data: IAsrData | null, roomId: number | null) => void;
849
+ onAsrSet?: (data: IAsrData | null, roomId: number | null, conversationId?: string) => void;
844
850
  /**
845
851
  * Админ начал/остановил совместное использование стороннего web-приложения
846
852
  * @param userId id участника-админа
847
853
  * @param sharedUrl url страницы
848
854
  */
849
- onRemoteSharedUrl?: (userId: ExternalParticipantId, sharedUrl: string | undefined, roomId: IRoomId) => void;
855
+ onRemoteSharedUrl?: (userId: ExternalParticipantId, sharedUrl: string | undefined, roomId: IRoomId, conversationId?: string) => void;
850
856
  /**
851
857
  * Изменился id участника (деанонимизация)
852
858
  * @param prevId
853
859
  * @param newId
854
860
  */
855
- onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId) => void;
861
+ onParticipantIdChanged?: (prevId: ExternalParticipantId, newId: ExternalParticipantId, conversationId?: string) => void;
856
862
  /**
857
863
  * Предложение включить режим автоматического отключения приёма видео
858
864
  * в плохой сети
859
865
  * @param bandwidth текущая полоса пропускания, kbps
860
866
  */
861
- onVideoSuspendSuggest?: (bandwidth: number) => void;
867
+ onVideoSuspendSuggest?: (bandwidth: number, conversationId?: string) => void;
862
868
  /**
863
869
  * Одобрено повышение пользователя в зале ожидания/зале в режиме Audience
864
870
  *
865
871
  * @param adminParticipantId админ, одобривший повышение
866
872
  */
867
- onPromotionApproved?: (adminParticipantId: ExternalParticipantId) => void;
873
+ onPromotionApproved?: (adminParticipantId: ExternalParticipantId, conversationId?: string) => void;
868
874
  /**
869
875
  * Участник повышен/разжалован в зале ожидания/зале в режиме Audience
870
876
  *
871
877
  * @param demoted участник разжалован
872
878
  */
873
- onPromoted?: (demoted: boolean) => void;
879
+ onPromoted?: (demoted: boolean, conversationId?: string) => void;
880
+ /**
881
+ * Активным установлен определенный звонок
882
+ *
883
+ * @param conversationId ID звонка
884
+ */
885
+ onCallActive?: (conversationId: string) => void;
874
886
  /**
875
887
  * Собеседник подключился к сигналлингу
876
888
  */
877
- onPeerRegistered?: () => void;
889
+ onPeerRegistered?: (conversationId?: string) => void;
878
890
  };
879
891
  export default abstract class Params {
880
892
  private static _params;
@@ -964,7 +976,6 @@ export default abstract class Params {
964
976
  static get networkStatisticsInterval(): number;
965
977
  static get perfStatReportEnabled(): boolean;
966
978
  static get callStatReportEnabled(): boolean;
967
- static get clientEventsLoggingEnabled(): boolean;
968
979
  static get enableLogPerfStatReport(): boolean;
969
980
  static get asrDataChannel(): boolean;
970
981
  static get consumerScreenDataChannelPacketSize(): number;
@@ -984,6 +995,7 @@ export default abstract class Params {
984
995
  static get addParticipant(): boolean;
985
996
  static get waitForAdminInGroupCalls(): boolean;
986
997
  static get hold(): boolean;
998
+ static get maxParallelCalls(): number;
987
999
  static get participantListChunkInitIndex(): number;
988
1000
  static get participantListChunkInitCount(): number | null;
989
1001
  static get filterObservers(): boolean;
@@ -1007,6 +1019,7 @@ export default abstract class Params {
1007
1019
  static get webtransport(): boolean;
1008
1020
  static get webtransportFF(): boolean;
1009
1021
  static get transparentAudio(): boolean;
1022
+ static get enableSessionStateUpdates(): boolean;
1010
1023
  static toJSON(): {
1011
1024
  apiKey: string;
1012
1025
  apiEnv: string;
@@ -1042,5 +1055,6 @@ export default abstract class Params {
1042
1055
  webtransport: boolean;
1043
1056
  webtransportFF: boolean;
1044
1057
  transparentAudio: boolean;
1058
+ enableSessionStateUpdates: boolean;
1045
1059
  };
1046
1060
  }
@@ -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;
@@ -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;
@@ -19,7 +19,7 @@ import MediaModifiers from './MediaModifiers';
19
19
  import MediaSettings from './MediaSettings';
20
20
  import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
21
21
  import MuteStates from './MuteStates';
22
- import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
22
+ import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType, ParticipantSessionState } from './Participant';
23
23
  import { MediaType, ParticipantStreamDescription } from './ParticipantStreamDescription';
24
24
  import { IRoomId } from './Room';
25
25
  import VideoSettings from './VideoSettings';
@@ -89,6 +89,7 @@ declare namespace SignalingMessage {
89
89
  state: Record<string, string>;
90
90
  stateUpdateTs: Record<string, number>;
91
91
  };
92
+ sessionState?: ParticipantSessionState;
92
93
  roles?: UserRole[];
93
94
  peerId?: PeerId;
94
95
  restricted?: boolean;
@@ -97,6 +98,7 @@ declare namespace SignalingMessage {
97
98
  markers?: ParticipantListMarkers;
98
99
  observedIds?: CompositeUserId[];
99
100
  movieShareInfos?: ISharedMovieInfo[];
101
+ onHold?: boolean;
100
102
  }
101
103
  export interface ParticipantListChunk extends Notification {
102
104
  participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
@@ -323,6 +325,13 @@ declare namespace SignalingMessage {
323
325
  export interface SpeakerChanged extends Notification {
324
326
  speaker: ParticipantId;
325
327
  }
328
+ export interface SessionState extends Notification {
329
+ connected: boolean;
330
+ participantId: OkUserId;
331
+ participantType: UserType;
332
+ deviceIdx?: number;
333
+ markers?: ParticipantListMarkers;
334
+ }
326
335
  export interface OptionsChanged extends Notification {
327
336
  options: ConversationOption[];
328
337
  }
@@ -456,6 +465,10 @@ declare namespace SignalingMessage {
456
465
  export interface VideoSuspendSuggest extends Notification {
457
466
  bandwidth: number;
458
467
  }
468
+ export interface Hold extends Notification {
469
+ participantId: ParticipantId;
470
+ hold: boolean;
471
+ }
459
472
  export {};
460
473
  }
461
474
  export default SignalingMessage;