@vkontakte/calls-sdk 2.6.2-dev.3549b06.0 → 2.6.2-dev.3e4fbdf.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.
@@ -15,6 +15,7 @@ import { JSONObject } from '../static/Json';
15
15
  import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
18
19
  import MuteStates from '../types/MuteStates';
19
20
  import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
20
21
  import { ParticipantLayout } from '../types/ParticipantLayout';
@@ -37,6 +38,7 @@ export declare type ConversationData = {
37
38
  */
38
39
  acceptTime: number | null;
39
40
  features: ConversationFeature[];
41
+ featuresPerRole?: Partial<Record<ConversationFeature, UserRole[]>> | null;
40
42
  /**
41
43
  * ID звонка
42
44
  */
@@ -76,6 +78,7 @@ export default class Conversation extends EventEmitter {
76
78
  private readonly _signaling;
77
79
  private _mediaSource;
78
80
  private _conversation;
81
+ private _myLastRequestedLayouts;
79
82
  private _state;
80
83
  private _participantState;
81
84
  private _participants;
@@ -106,7 +109,7 @@ export default class Conversation extends EventEmitter {
106
109
  static current(): Conversation | null;
107
110
  static hangupAfterInit(): void;
108
111
  static id(): string | null;
109
- onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationData>;
112
+ onStart(opponentIds: OkUserId[], opponentType: CallType, mediaOptions: MediaOption[], payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, onlyAdminCanShareMovie?: boolean): Promise<ConversationData>;
110
113
  onJoin(joinArgs: {
111
114
  conversationId?: string;
112
115
  mediaOptions: MediaOption[];
@@ -151,10 +154,12 @@ export default class Conversation extends EventEmitter {
151
154
  private _processConnection;
152
155
  private _prepareParticipants;
153
156
  private _onConversationParticipantListChunk;
157
+ private _createParticipantListChunk;
154
158
  private _participantListChunkToExternalChunk;
155
159
  private _registerConnectionParticipants;
156
160
  private _registerParticipants;
157
- private _getClientType;
161
+ /** Установим состояние локальных мьютов */
162
+ private _registerParticipantLocalMuteState;
158
163
  private _getStatusByTransportState;
159
164
  private _registerParticipantInCache;
160
165
  private _getExistedParticipantByIdOrCreate;
@@ -200,12 +205,17 @@ export default class Conversation extends EventEmitter {
200
205
  requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
201
206
  requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
202
207
  updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
208
+ /** @async */
209
+ feedback(key: string): Promise<SignalingMessage>;
203
210
  private _stopStreaming;
204
211
  private _sendUpdateDisplayLayout;
205
212
  private _cleanupCooldownQueue;
206
213
  private _onParticipantSourcesUpdate;
207
214
  private _onParticipantPromoted;
208
215
  private _onChatRoomUpdated;
216
+ private _onSharedMovieUpdate;
217
+ private _onSharedMovieInfoStarted;
218
+ private _onSharedMovieInfoStopped;
209
219
  private _waitForStreamIfNeeded;
210
220
  private _matchStreamDescription;
211
221
  private _getWaitingTime;
@@ -213,6 +223,7 @@ export default class Conversation extends EventEmitter {
213
223
  private _checkAdminRole;
214
224
  grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
215
225
  muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
226
+ enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
216
227
  pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
217
228
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
218
229
  changeOptions(changes: {
@@ -229,11 +240,11 @@ export default class Conversation extends EventEmitter {
229
240
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
230
241
  createJoinLink(): Promise<string>;
231
242
  removeJoinLink(): Promise<never>;
232
- addMovie(movieId: string): Promise<{
243
+ addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
233
244
  movieId: string;
234
245
  streamType: string;
235
246
  }>;
236
- updateMovie(movieId: string, gain?: number, offset?: string, pause?: boolean): Promise<void>;
247
+ updateMovie(params: IUpdateMovieData): Promise<void>;
237
248
  removeMovie(movieId: string): Promise<void>;
238
249
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
239
250
  stopStream(): Promise<SignalingMessage>;
@@ -305,6 +316,9 @@ export default class Conversation extends EventEmitter {
305
316
  private _updateDisplayLayoutFromCache;
306
317
  private _setParticipantsStatus;
307
318
  private _onJoinLinkChanged;
319
+ /** получили из сингналинга сообщение о реакции пользователей */
320
+ private _onFeedback;
321
+ private _isMe;
308
322
  }
309
323
  export declare class UpdateDisplayLayoutError extends Error {
310
324
  readonly participantErrors: {
@@ -11,7 +11,7 @@ export declare class ProducerCommandSerializationService {
11
11
  private writeLayout;
12
12
  private writeStreamDesc;
13
13
  serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
14
- deserializeCommandResponse(data: BufferSource): SignalingMessage | undefined;
14
+ deserializeCommandResponse(data: BufferSource | Blob): Promise<SignalingMessage | undefined>;
15
15
  private deserializeUpdateDisplayLayoutResponse;
16
16
  private deserializeReportPerfStatResponse;
17
17
  }
@@ -4,7 +4,6 @@ export default class ScreenCaptureSender {
4
4
  private _destroyed;
5
5
  private _needKeyframe;
6
6
  private readonly DATA_SIZE;
7
- private readonly _timer;
8
7
  constructor(track: MediaStreamTrack, datachannel: RTCDataChannel);
9
8
  private _requestFrame;
10
9
  private _wrapHeader;
package/default/Api.d.ts CHANGED
@@ -16,8 +16,13 @@ export default class Api extends BaseApi {
16
16
  log(items: LogItem[]): void;
17
17
  init(): void;
18
18
  joinConversation(conversationId: string, isVideo?: boolean, chatId?: string): Promise<ConversationResponse>;
19
- createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
20
- startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean): Promise<ConversationResponse>;
19
+ createConversation(conversationId: string, payload?: string, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
20
+ onlyAdminCanShareMovie?: boolean;
21
+ }): Promise<ConversationResponse>;
22
+ startConversation(conversationId: string, ids?: OkUserId[], type?: CallType, isVideo?: boolean, payload?: string, joiningAllowed?: boolean, requireAuthToJoin?: boolean, { onlyAdminCanShareMovie }?: {
23
+ onlyAdminCanShareMovie?: boolean;
24
+ }): Promise<ConversationResponse>;
25
+ private _preareStartConversationData;
21
26
  private _startConversation;
22
27
  createJoinLink(conversationId: string): Promise<{
23
28
  join_link: string;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ import BaseSignaling, { AddParticipantParams } from '../abstract/BaseSignaling';
2
2
  import { ParticipantIdRegistry } from '../classes/ParticipantIdRegistry';
3
3
  import { PerfStatReport } from '../classes/transport/PerfStatReporter';
4
4
  import { TransportTopology } from '../classes/transport/Transport';
5
+ import ConversationFeature from '../enums/ConversationFeature';
5
6
  import ConversationOption from '../enums/ConversationOption';
6
7
  import MediaOption from '../enums/MediaOption';
7
8
  import RecordRole from '../enums/RecordRole';
@@ -11,6 +12,7 @@ import UserRole from '../enums/UserRole';
11
12
  import { JSONObject } from '../static/Json';
12
13
  import MediaModifiers from '../types/MediaModifiers';
13
14
  import MediaSettings from '../types/MediaSettings';
15
+ import { IAddMovieParams, IUpdateMovieData } from '../types/MovieShare';
14
16
  import MuteStates from '../types/MuteStates';
15
17
  import { CompositeUserId, ParticipantId } from '../types/Participant';
16
18
  import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
@@ -96,8 +98,8 @@ export default class Signaling extends BaseSignaling {
96
98
  updateDisplayLayout(layouts: {
97
99
  [streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
98
100
  }): Promise<SignalingMessage>;
99
- addMovie(data: any): Promise<SignalingMessage>;
100
- updateMovie(data: any): Promise<SignalingMessage>;
101
+ addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
102
+ updateMovie(data: IUpdateMovieData): Promise<SignalingMessage>;
101
103
  removeMovie(data: any): Promise<SignalingMessage>;
102
104
  startStream(data: any): Promise<SignalingMessage>;
103
105
  stopStream(): Promise<SignalingMessage>;
@@ -111,6 +113,7 @@ export default class Signaling extends BaseSignaling {
111
113
  customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
112
114
  grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
113
115
  muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
116
+ enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
114
117
  pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
115
118
  updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
116
119
  changeOptions(changes: {
@@ -118,6 +121,7 @@ export default class Signaling extends BaseSignaling {
118
121
  }): Promise<SignalingMessage>;
119
122
  getWaitingHall(fromId?: WaitingParticipantId | null, count?: number, backward?: boolean): Promise<SignalingMessage>;
120
123
  promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<SignalingMessage>;
124
+ feedback(key: string): Promise<SignalingMessage>;
121
125
  /**
122
126
  * Close a connection with a signaling server
123
127
  */
@@ -1,5 +1,6 @@
1
1
  declare const enum ConversationFeature {
2
2
  ADD_PARTICIPANT = "ADD_PARTICIPANT",
3
- RECORD = "RECORD"
3
+ RECORD = "RECORD",
4
+ MOVIE_SHARE = "MOVIE_SHARE"
4
5
  }
5
6
  export default ConversationFeature;
@@ -4,7 +4,9 @@
4
4
  declare enum ConversationOption {
5
5
  REQUIRE_AUTH_TO_JOIN = "REQUIRE_AUTH_TO_JOIN",
6
6
  AUDIENCE_MODE = "AUDIENCE_MODE",
7
- WAITING_HALL = "WAITING_HALL"
7
+ WAITING_HALL = "WAITING_HALL",
8
+ ASR = "ASR",
9
+ FEEDBACK = "FEEDBACK"
8
10
  }
9
11
  export default ConversationOption;
10
12
  export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
@@ -16,6 +16,7 @@ declare enum HangupType {
16
16
  CALLER_IS_BLOCKED = "CALLER_IS_BLOCKED",
17
17
  NOT_FRIENDS = "NOT_FRIENDS",
18
18
  CALLEE_IS_OFFLINE = "CALLEE_IS_OFFLINE",
19
+ CALLER_IS_REJECTED = "CALLER_IS_REJECTED",
19
20
  UNKNOWN_ERROR = "UNKNOWN_ERROR",
20
21
  UNSUPPORTED = "UNSUPPORTED",
21
22
  OLD_VERSION = "OLD_VERSION",
@@ -23,6 +24,7 @@ declare enum HangupType {
23
24
  EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
24
25
  SOCKET_CLOSED = "SOCKET_CLOSED",
25
26
  ENDED = "ENDED",
26
- KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE"
27
+ KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE",
28
+ ANOTHER_DEVICE = "ANOTHER_DEVICE"
27
29
  }
28
30
  export default HangupType;
@@ -4,6 +4,7 @@
4
4
  declare enum MediaOption {
5
5
  AUDIO = "AUDIO",
6
6
  VIDEO = "VIDEO",
7
- SCREEN_SHARING = "SCREEN_SHARING"
7
+ SCREEN_SHARING = "SCREEN_SHARING",
8
+ MOVIE_SHARING = "MOVIE_SHARING"
8
9
  }
9
10
  export default MediaOption;
@@ -24,6 +24,7 @@ declare enum SignalingCommandType {
24
24
  CUSTOM_DATA = "custom-data",
25
25
  GRANT_ROLES = "grant-roles",
26
26
  MUTE_PARTICIPANT = "mute-participant",
27
+ ENABLE_FEATURE_FOR_ROLES = "enable-feature-for-roles",
27
28
  PIN_PARTICIPANT = "pin-participant",
28
29
  UPDATE_MEDIA_MODIFIERS = "update-media-modifiers",
29
30
  CHANGE_OPTIONS = "change-options",
@@ -34,6 +35,7 @@ declare enum SignalingCommandType {
34
35
  REQUEST_TEST_MODE = "request-test-mode",
35
36
  ADD_MOVIE = "add-movie",
36
37
  UPDATE_MOVIE = "update-movie",
37
- REMOVE_MOVIE = "remove-movie"
38
+ REMOVE_MOVIE = "remove-movie",
39
+ FEEDBACK = "feedback"
38
40
  }
39
41
  export default SignalingCommandType;
@@ -35,6 +35,11 @@ declare enum SignalingNotification {
35
35
  PROMOTE_PARTICIPANT = "promote-participant",
36
36
  CHAT_ROOM_UPDATED = "chat-room-updated",
37
37
  PROMOTION_APPROVED = "promotion-approved",
38
- JOIN_LINK_CHANGED = "join-link-changed"
38
+ JOIN_LINK_CHANGED = "join-link-changed",
39
+ FEEDBACK = "feedback",
40
+ MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
41
+ MOVIE_SHARE_INFO = "movie-share-info",
42
+ MOVIE_SHARE_STARTED = "movie-share-started",
43
+ MOVIE_SHARE_STOPPED = "movie-share-stopped"
39
44
  }
40
45
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-dev.3549b06.0",
3
+ "version": "2.6.2-dev.3e4fbdf.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -8,8 +8,10 @@ import FatalError from '../enums/FatalError';
8
8
  import MediaOption from '../enums/MediaOption';
9
9
  import UserRole from '../enums/UserRole';
10
10
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
+ import { IFeedbackExternal } from '../types/Feedback';
11
12
  import MediaModifiers from '../types/MediaModifiers';
12
13
  import MediaSettings from '../types/MediaSettings';
14
+ import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
13
15
  import MuteStates from '../types/MuteStates';
14
16
  import { ParticipantStateMapped } from '../types/Participant';
15
17
  import { DebugMessageType } from './Debug';
@@ -72,10 +74,31 @@ declare namespace External {
72
74
  * Если сервер закончил стримить собеседника, вместо стрима будет передан null
73
75
  *
74
76
  * @param userId
75
- * @param streamName
76
- * @param stream
77
+ * @param data
77
78
  */
78
- function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
79
+ function onRemoteLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
80
+ /**
81
+ * Получен собственный стрим лайв.
82
+ * Если сервер закончил стримить собеседника, вместо стрима будет передан null
83
+ *
84
+ * @param userId
85
+ * @param data
86
+ */
87
+ function onLocalLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
88
+ /**
89
+ * Получено обновление стрима или лайва от собеседника.
90
+ *
91
+ * @param userId
92
+ * @param data
93
+ */
94
+ function onRemoteLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
95
+ /**
96
+ * Получено обновление собственного стрима или лайва.
97
+ *
98
+ * @param userId
99
+ * @param data
100
+ */
101
+ function onLocalLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
79
102
  /**
80
103
  * Получен стрим с экрана собеседника.
81
104
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
@@ -106,6 +129,41 @@ declare namespace External {
106
129
  * @param markers
107
130
  */
108
131
  function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers): void;
132
+ /**
133
+ * Изменились данные собственного стрима
134
+ *
135
+ * @param userId
136
+ * @param mediaSettings
137
+ */
138
+ function onLocalMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
139
+ /**
140
+ * Полученны данные по стримам (лайв/мувик) от собеседника
141
+ *
142
+ * @param userId
143
+ * @param sharedMovieInfo
144
+ */
145
+ function onRemoteSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo): void;
146
+ /**
147
+ * Полученны данные по остановленным стримам (лайв/мувик) от собеседника
148
+ *
149
+ * @param userId
150
+ * @param sharedMovieStoppedInfo
151
+ */
152
+ function onRemoteSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo): void;
153
+ /**
154
+ * Полученны данные по собственным стримам (лайв/мувик)
155
+ *
156
+ * @param userId
157
+ * @param sharedMovieInfo
158
+ */
159
+ function onLocalSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo): void;
160
+ /**
161
+ * Полученны данные по собственным остановленным стримам (лайв/мувик)
162
+ *
163
+ * @param userId
164
+ * @param sharedMovieStoppedInfo
165
+ */
166
+ function onLocalSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo): void;
109
167
  /**
110
168
  * Добавили участника
111
169
  *
@@ -187,8 +245,10 @@ declare namespace External {
187
245
  * @param unmute Разрешение включить устройство
188
246
  * @param userId Пользователь, для которого изменились разрешения или `null` для текущего пользователя
189
247
  * @param adminId Пользователь, который изменил разрешения
248
+ * @param stateUpdated Если `true`, значит глобальное/персональное состояние изменилось и поля `muteStates`/`unmuteOptions` содержат обновления, если `false`, значит, эти поля не имеют значения
249
+ * @param requestedMedia Какие устройства попросили влючить участника
190
250
  */
191
- function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null): void;
251
+ function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]): void;
192
252
  /**
193
253
  * Изменились роли собеседника в звонке
194
254
  *
@@ -353,5 +413,9 @@ declare namespace External {
353
413
  * @param joinLink токен присоединения к звонку
354
414
  */
355
415
  function onJoinLinkChanged(joinLink: string): void;
416
+ /**
417
+ * Получена новая реакция
418
+ */
419
+ function onFeedback(feedback: IFeedbackExternal[]): void;
356
420
  }
357
421
  export default External;
@@ -8,9 +8,11 @@ import FatalError from '../enums/FatalError';
8
8
  import MediaOption from '../enums/MediaOption';
9
9
  import UserRole from '../enums/UserRole';
10
10
  import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
11
+ import { IFeedbackExternal } from '../types/Feedback';
11
12
  import IceServer from '../types/IceServer';
12
13
  import MediaModifiers from '../types/MediaModifiers';
13
14
  import MediaSettings from '../types/MediaSettings';
15
+ import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
14
16
  import MuteStates from '../types/MuteStates';
15
17
  import { ParticipantStateMapped } from '../types/Participant';
16
18
  import AuthData from './AuthData';
@@ -24,6 +26,7 @@ import { FacingMode } from './WebRTCUtils';
24
26
  export declare type ParamsObject = {
25
27
  platform: string;
26
28
  clientType: string;
29
+ externalUserType: string;
27
30
  device: string;
28
31
  /**
29
32
  * API ключ приложения
@@ -43,6 +46,11 @@ export declare type ParamsObject = {
43
46
  * Домен, чтобы попасть в тестовую группу. Для тестирования экспериментальных улучшений существуют отдельные сервера, чтобы собирать фидбек и уже потом раскатывать на всех юзеров. Если передать сюда специальный ключ, то конверсейшн будет обрабатываться на таком сервере.
44
47
  */
45
48
  domain: string;
49
+ /**
50
+ * Домен, куда будет ходить Ok api за данными
51
+ * @hidden
52
+ */
53
+ externalDomain: string;
46
54
  iceServers: IceServer[];
47
55
  wssBase: string;
48
56
  wssToken: string;
@@ -247,6 +255,11 @@ export declare type ParamsObject = {
247
255
  * Включать RED-extension (redundancy) для p2p звонков
248
256
  */
249
257
  p2pAudioRed: boolean;
258
+ /**
259
+ * Добавлять флаг spsPpsIdrInKeyframe для h264 кодека. В результате ключевые фреймы без sps и pps
260
+ * не используются как ключевые. Решает проблему с артефактами на видео в случае потерь пакетов.
261
+ */
262
+ h264spsPpsIdrInKeyframe: boolean;
250
263
  /**
251
264
  * Получать список участников звонка третьим аргументом в `onConversation`
252
265
  * @hidden
@@ -300,7 +313,20 @@ export declare type ParamsObject = {
300
313
  * Получен стрим трансляция или мувик от собеседника.
301
314
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
302
315
  */
303
- onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
316
+ onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
317
+ /**
318
+ * Получен собственный стрим трансляция или мувик.
319
+ * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
320
+ */
321
+ onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
322
+ /**
323
+ * Получено обновление стрима или лайва от собеседника.
324
+ */
325
+ onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
326
+ /**
327
+ * Получено обновление собственного стрима или лайва.
328
+ */
329
+ onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
304
330
  /**
305
331
  * Начат звонок
306
332
  */
@@ -313,6 +339,26 @@ export declare type ParamsObject = {
313
339
  * Изменились данные стрима собеседника
314
340
  */
315
341
  onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
342
+ /**
343
+ * Изменились данные стрима собеседника
344
+ */
345
+ onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
346
+ /**
347
+ * Полученны данные по стримам (лайв/мувик) от собеседника
348
+ */
349
+ onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo) => void;
350
+ /**
351
+ * Полученны данные по остановленным стримам (лайв/мувик) от собеседника
352
+ */
353
+ onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo) => void;
354
+ /**
355
+ * Полученны данные по собственным стримам (лайв/мувик)
356
+ */
357
+ onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo) => void;
358
+ /**
359
+ * Полученны данные по собственным остановленным стримам (лайв/мувик)
360
+ */
361
+ onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo) => void;
316
362
  /**
317
363
  * Добавили участника
318
364
  */
@@ -357,7 +403,7 @@ export declare type ParamsObject = {
357
403
  /**
358
404
  * Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
359
405
  */
360
- onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
406
+ onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]) => void;
361
407
  /**
362
408
  * Изменились роли собеседника в звонке
363
409
  */
@@ -478,6 +524,11 @@ export declare type ParamsObject = {
478
524
  * @param joinLink токен присоединения к звонку
479
525
  */
480
526
  onJoinLinkChanged?: (joinLink: string) => void;
527
+ /**
528
+ * Получены новые реакции в звонке
529
+ * @param feedback массив с реакциями
530
+ */
531
+ onFeedback?: (feedback: IFeedbackExternal[]) => void;
481
532
  };
482
533
  export default abstract class Params {
483
534
  private static _params;
@@ -494,6 +545,8 @@ export default abstract class Params {
494
545
  static set platform(value: string);
495
546
  static get clientType(): string;
496
547
  static set clientType(value: string);
548
+ static get externalUserType(): string;
549
+ static set externalUserType(value: string);
497
550
  static get device(): string;
498
551
  static get apiKey(): string;
499
552
  static get apiEnv(): string;
@@ -503,6 +556,7 @@ export default abstract class Params {
503
556
  static get anonymToken(): string;
504
557
  static set anonymToken(value: string);
505
558
  static get domain(): string;
559
+ static get externalDomain(): string;
506
560
  static get iceServers(): IceServer[];
507
561
  static set iceServers(value: IceServer[]);
508
562
  static get wssBase(): string;
@@ -571,6 +625,7 @@ export default abstract class Params {
571
625
  static get participantListChunkInitCount(): number;
572
626
  static get serverAudioRed(): boolean;
573
627
  static get p2pAudioRed(): boolean;
628
+ static get h264spsPpsIdrInKeyframe(): boolean;
574
629
  static get batchParticipantsOnStart(): boolean;
575
630
  static get filterObservers(): boolean;
576
631
  static get muteMode(): boolean;
package/static/Utils.d.ts CHANGED
@@ -6,7 +6,7 @@ import VideoSettings from '../types/VideoSettings';
6
6
  export declare const PARAMETERS_SEPARATOR = ":";
7
7
  export declare const DEVICE_IDX_PARAMETER = "d";
8
8
  declare namespace Utils {
9
- function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
9
+ function patchSDP(sdp: string, preferH264: boolean, brokenH264: boolean, preferVP9: boolean, h264spsPpsIdrInKeyframe: boolean, isAudioNack?: boolean, preferRed?: boolean): string;
10
10
  function getPeerIdString(peerId: SignalingMessage.PeerId): string;
11
11
  function comparePeerId(peerId1: SignalingMessage.PeerId, peerId2: SignalingMessage.PeerId): boolean;
12
12
  function getPeerConnectionHostInfo(pc: RTCPeerConnection): Promise<any>;
@@ -62,6 +62,7 @@ declare namespace Utils {
62
62
  function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
63
63
  /** убирает все ключи со значением `V` на 1 уровне */
64
64
  function objectFilterOutValues<T extends Record<string, V>, V = unknown>(obj: T, value?: V | V[]): Partial<T>;
65
- function createBlobWorker(workerFunctionData: string, workerArgs?: unknown[]): string;
65
+ function objectReduce<R, T extends Object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
66
+ const setImmediate: (fn: VoidFunction) => VoidFunction;
66
67
  }
67
68
  export default Utils;
@@ -0,0 +1,12 @@
1
+ import MediaOption from '../enums/MediaOption';
2
+ import MediaSettings from './MediaSettings';
3
+ import { Participant } from './Participant';
4
+ export interface IProcessMuteStateParams {
5
+ mediaOptions?: MediaOption[];
6
+ muteAll?: boolean;
7
+ unmute?: boolean;
8
+ serverSettings?: MediaSettings | null;
9
+ admin?: Participant | null;
10
+ stateUpdated?: boolean;
11
+ requestedMedia?: MediaOption[];
12
+ }
@@ -10,5 +10,6 @@ declare type ConversationParams = {
10
10
  isp_as_org?: string;
11
11
  loc_cc?: string;
12
12
  loc_reg?: string;
13
+ external_user_type: string;
13
14
  };
14
15
  export default ConversationParams;
@@ -1,6 +1,7 @@
1
1
  import MediaOption from '../enums/MediaOption';
2
2
  import { ParticipantStatus } from '../static/External';
3
3
  import MediaSettings from './MediaSettings';
4
+ import { ISharedMovieInfo } from './MovieShare';
4
5
  import MuteStates from './MuteStates';
5
6
  import { ParticipantListMarker, ParticipantListType, ParticipantStateMapped } from './Participant';
6
7
  import SignalingMessage from './SignalingMessage';
@@ -94,6 +95,7 @@ export interface ExternalParticipant {
94
95
  */
95
96
  unmuteOptions: MediaOption[];
96
97
  markers?: ExternalParticipantListMarkers;
98
+ movieShareInfos?: ISharedMovieInfo[];
97
99
  }
98
100
  export interface ExternalParticipantListChunk {
99
101
  participants: ExternalParticipant[];
@@ -0,0 +1,22 @@
1
+ import { CompositeUserId } from './Participant';
2
+ import { ExternalParticipantId } from './ExternalId';
3
+ interface IFeedbackItem {
4
+ participantId: CompositeUserId;
5
+ /** event timestamps for this participant, chronologically */
6
+ times: number[];
7
+ }
8
+ export interface IFeedbackItemExternal extends Omit<IFeedbackItem, 'participantId'> {
9
+ participantId: ExternalParticipantId;
10
+ }
11
+ export interface IFeedback {
12
+ /** feedback ID; key values should be negotiated by clients themselves, like in ParticipantState, and have just the same restrictions; on backend the values of these keys are not bound in any way to those in ParticipantState */
13
+ key: string;
14
+ /** total amount of reactions of this type from the start of this call */
15
+ totalCount: number;
16
+ /** list of items containing initiator & all related data, if any */
17
+ items: IFeedbackItem[];
18
+ }
19
+ export interface IFeedbackExternal extends Omit<IFeedback, 'items'> {
20
+ items: IFeedbackItemExternal[];
21
+ }
22
+ export {};
@@ -19,7 +19,7 @@ export declare type MediaSettings = {
19
19
  export declare type VideoStreamInfo = {
20
20
  id: string;
21
21
  source: string;
22
- vkMovieId?: string;
22
+ externalMovieId?: string;
23
23
  };
24
24
  export default MediaSettings;
25
25
  export declare function compareMediaSettings(ms1: MediaSettings, ms2: MediaSettings): boolean;