@vkontakte/calls-sdk 2.5.3-dev.fe8ad1c.0 → 2.6.2-dev.2b57aff.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.
- package/CallsSDK.d.ts +19 -5
- package/abstract/BaseSignaling.d.ts +5 -3
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +9 -9
- package/classes/Conversation.d.ts +23 -5
- package/classes/Conversation.test.d.ts +1 -0
- package/classes/screenshare/ScreenCaptureSender.d.ts +1 -0
- package/classes/transport/DirectTransport.d.ts +1 -1
- package/classes/transport/Transport.d.ts +2 -2
- package/default/Signaling.d.ts +4 -1
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingCommandType.d.ts +2 -0
- package/enums/SignalingNotification.d.ts +1 -2
- package/package.json +1 -1
- package/static/External.d.ts +33 -29
- package/static/Params.d.ts +39 -11
- package/static/Utils.d.ts +6 -1
- package/static/Utils.test.d.ts +1 -0
- package/types/ExternalId.d.ts +16 -1
- package/types/Participant.d.ts +12 -1
- package/types/ParticipantListChunk.d.ts +13 -0
- package/types/SignalingMessage.d.ts +27 -18
- package/types/WaitingHall.d.ts +13 -0
- package/worker/WebCodecsDecoderWorker.d.ts +1 -1
- package/types/MovieShare.d.ts +0 -16
|
@@ -12,13 +12,13 @@ import UpdateDisplayLayoutErrorReason from '../enums/UpdateDisplayLayoutErrorRea
|
|
|
12
12
|
import UserRole from '../enums/UserRole';
|
|
13
13
|
import UserType from '../enums/UserType';
|
|
14
14
|
import { JSONObject } from '../static/Json';
|
|
15
|
-
import { ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
|
|
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 } from '../types/MovieShare';
|
|
19
18
|
import MuteStates from '../types/MuteStates';
|
|
20
|
-
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
19
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
|
|
21
20
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
21
|
+
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
22
22
|
import ParticipantPriority from '../types/ParticipantPriority';
|
|
23
23
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
24
24
|
import SignalingMessage, { RecordInfo } from '../types/SignalingMessage';
|
|
@@ -129,6 +129,7 @@ export default class Conversation extends EventEmitter {
|
|
|
129
129
|
private _close;
|
|
130
130
|
destroy(): void;
|
|
131
131
|
private _getConversationParams;
|
|
132
|
+
private _addGeoParamsToEndpoint;
|
|
132
133
|
/**
|
|
133
134
|
* @throws ErrorEvent
|
|
134
135
|
*/
|
|
@@ -147,7 +148,21 @@ export default class Conversation extends EventEmitter {
|
|
|
147
148
|
private _updateConversation;
|
|
148
149
|
private _createMediaSource;
|
|
149
150
|
private _connectSignaling;
|
|
151
|
+
private _processConnection;
|
|
152
|
+
private _prepareParticipants;
|
|
153
|
+
private _onConversationParticipantListChunk;
|
|
154
|
+
private _participantListChunkToExternalChunk;
|
|
155
|
+
private _registerConnectionParticipants;
|
|
150
156
|
private _registerParticipants;
|
|
157
|
+
private _getClientType;
|
|
158
|
+
private _getStatusByTransportState;
|
|
159
|
+
private _registerParticipantInCache;
|
|
160
|
+
private _getExistedParticipantByIdOrCreate;
|
|
161
|
+
private _getExternalIdByParticipantId;
|
|
162
|
+
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
163
|
+
private _warnParticipantNotInConversation;
|
|
164
|
+
private _setParticipantMarkers;
|
|
165
|
+
private _denormalizeMarkers;
|
|
151
166
|
/**
|
|
152
167
|
* Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
|
|
153
168
|
*
|
|
@@ -183,6 +198,7 @@ export default class Conversation extends EventEmitter {
|
|
|
183
198
|
[key: string]: string;
|
|
184
199
|
}): Promise<void>;
|
|
185
200
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
201
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
186
202
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
187
203
|
private _stopStreaming;
|
|
188
204
|
private _sendUpdateDisplayLayout;
|
|
@@ -192,7 +208,6 @@ export default class Conversation extends EventEmitter {
|
|
|
192
208
|
private _onParticipantSourcesUpdate;
|
|
193
209
|
private _onParticipantPromoted;
|
|
194
210
|
private _onChatRoomUpdated;
|
|
195
|
-
private _onSharedMovieUpdate;
|
|
196
211
|
private _waitForStreamIfNeeded;
|
|
197
212
|
private _matchStreamDescription;
|
|
198
213
|
private _getWaitingTime;
|
|
@@ -216,7 +231,7 @@ export default class Conversation extends EventEmitter {
|
|
|
216
231
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
217
232
|
createJoinLink(): Promise<string>;
|
|
218
233
|
removeJoinLink(): Promise<never>;
|
|
219
|
-
addMovie(
|
|
234
|
+
addMovie(movieId: string): Promise<{
|
|
220
235
|
movieId: string;
|
|
221
236
|
streamType: string;
|
|
222
237
|
}>;
|
|
@@ -233,6 +248,8 @@ export default class Conversation extends EventEmitter {
|
|
|
233
248
|
effect: IVideoDimentions;
|
|
234
249
|
}): Promise<void>;
|
|
235
250
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
251
|
+
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
252
|
+
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
236
253
|
private _onLocalMediaStreamChanged;
|
|
237
254
|
private _onScreenSharingStatus;
|
|
238
255
|
private _changeRemoteMediaSettings;
|
|
@@ -288,6 +305,7 @@ export default class Conversation extends EventEmitter {
|
|
|
288
305
|
private _toggleJoinAvailability;
|
|
289
306
|
private _updateDisplayLayoutFromCache;
|
|
290
307
|
private _setParticipantsStatus;
|
|
308
|
+
private _onJoinLinkChanged;
|
|
291
309
|
}
|
|
292
310
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
293
311
|
readonly participantErrors: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'jasmine-ajax';
|
|
@@ -44,7 +44,7 @@ export default class DirectTransport extends EventEmitter {
|
|
|
44
44
|
private _handleTransmittedData;
|
|
45
45
|
private _addIceCandidate;
|
|
46
46
|
private _setRemoteCandidates;
|
|
47
|
-
_setRemoteDescription(peerId: string, sdp:
|
|
47
|
+
_setRemoteDescription(peerId: string, sdp: RTCSessionDescriptionInit): Promise<void>;
|
|
48
48
|
private _onAddTrack;
|
|
49
49
|
private _handleIceCandidate;
|
|
50
50
|
private _onSignalingStateChange;
|
|
@@ -48,19 +48,19 @@ export declare class Transport extends EventEmitter {
|
|
|
48
48
|
updateSettings(settings: ServerSettings): void;
|
|
49
49
|
updateStatisticsInterval(): void;
|
|
50
50
|
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
|
51
|
-
open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean): void;
|
|
51
|
+
open(participantIds: ParticipantId[], peerId?: string | null, observer?: boolean, force?: boolean): void;
|
|
52
52
|
close(participantId: ParticipantId): void;
|
|
53
53
|
destroy(): void;
|
|
54
54
|
getTopology(): TransportTopology;
|
|
55
55
|
isAllocated(participantId: ParticipantId): boolean;
|
|
56
56
|
allocated(): string[];
|
|
57
57
|
opened(): string[];
|
|
58
|
+
getState(): TransportState;
|
|
58
59
|
private _setStates;
|
|
59
60
|
private _setState;
|
|
60
61
|
private _setLocalState;
|
|
61
62
|
private _onSignalingNotification;
|
|
62
63
|
private _onTopologyChanged;
|
|
63
|
-
private _onRecordStarted;
|
|
64
64
|
private _createDirectTransport;
|
|
65
65
|
private _createServerTransport;
|
|
66
66
|
private _releaseDirectTransport;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ import MediaModifiers from '../types/MediaModifiers';
|
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
14
14
|
import MuteStates from '../types/MuteStates';
|
|
15
15
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
16
|
+
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
16
17
|
import SignalingMessage from '../types/SignalingMessage';
|
|
17
18
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
18
19
|
export default class Signaling extends BaseSignaling {
|
|
@@ -72,7 +73,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
72
73
|
getNextCommandSequenceNumber(): number;
|
|
73
74
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
74
75
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
75
|
-
requestTestMode(
|
|
76
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<SignalingMessage>;
|
|
76
77
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
|
|
77
78
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
78
79
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -124,6 +125,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
124
125
|
* что все подписчики готовы принимать сообщения от сигналинга.
|
|
125
126
|
*/
|
|
126
127
|
readyToSend(): void;
|
|
128
|
+
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
129
|
+
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
127
130
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
128
131
|
protected _disconnect(): void;
|
|
129
132
|
private _onOpen;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare enum HangupType {
|
|
|
22
22
|
SERVICE_DISABLED = "SERVICE_DISABLED",
|
|
23
23
|
EXTERNAL_API_ERROR = "EXTERNAL_API_ERROR",
|
|
24
24
|
SOCKET_CLOSED = "SOCKET_CLOSED",
|
|
25
|
-
ENDED = "ENDED"
|
|
25
|
+
ENDED = "ENDED",
|
|
26
|
+
KILLED_WITHOUT_DELETE = "KILLED_WITHOUT_DELETE"
|
|
26
27
|
}
|
|
27
28
|
export default HangupType;
|
|
@@ -28,6 +28,8 @@ declare enum SignalingCommandType {
|
|
|
28
28
|
UPDATE_MEDIA_MODIFIERS = "update-media-modifiers",
|
|
29
29
|
CHANGE_OPTIONS = "change-options",
|
|
30
30
|
GET_WAITING_HALL = "get-waiting-hall",
|
|
31
|
+
GET_PARTICIPANT_LIST_CHUNK = "get-participant-list-chunk",
|
|
32
|
+
GET_PARTICIPANTS = "get-participants",
|
|
31
33
|
PROMOTE_PARTICIPANT = "promote-participant",
|
|
32
34
|
REQUEST_TEST_MODE = "request-test-mode",
|
|
33
35
|
ADD_MOVIE = "add-movie",
|
|
@@ -35,7 +35,6 @@ 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"
|
|
39
|
-
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification"
|
|
38
|
+
JOIN_LINK_CHANGED = "join-link-changed"
|
|
40
39
|
}
|
|
41
40
|
export default SignalingNotification;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -7,10 +7,9 @@ import ConversationOption from '../enums/ConversationOption';
|
|
|
7
7
|
import FatalError from '../enums/FatalError';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
9
|
import UserRole from '../enums/UserRole';
|
|
10
|
-
import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
|
|
11
11
|
import MediaModifiers from '../types/MediaModifiers';
|
|
12
12
|
import MediaSettings from '../types/MediaSettings';
|
|
13
|
-
import { ISharedMovieState } from '../types/MovieShare';
|
|
14
13
|
import MuteStates from '../types/MuteStates';
|
|
15
14
|
import { ParticipantStateMapped } from '../types/Participant';
|
|
16
15
|
import { DebugMessageType } from './Debug';
|
|
@@ -77,29 +76,6 @@ declare namespace External {
|
|
|
77
76
|
* @param stream
|
|
78
77
|
*/
|
|
79
78
|
function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
|
|
80
|
-
/**
|
|
81
|
-
* Получен собственный стрим лайв.
|
|
82
|
-
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
83
|
-
*
|
|
84
|
-
* @param userId
|
|
85
|
-
* @param streamName
|
|
86
|
-
* @param stream
|
|
87
|
-
*/
|
|
88
|
-
function onLocalLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
|
|
89
|
-
/**
|
|
90
|
-
* Получено обновление стрима или лайва от собеседника.
|
|
91
|
-
*
|
|
92
|
-
* @param userId
|
|
93
|
-
* @param data
|
|
94
|
-
*/
|
|
95
|
-
function onRemoteLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
|
|
96
|
-
/**
|
|
97
|
-
* Получено обновление собственного стрима или лайва.
|
|
98
|
-
*
|
|
99
|
-
* @param userId
|
|
100
|
-
* @param data
|
|
101
|
-
*/
|
|
102
|
-
function onLocalLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
|
|
103
79
|
/**
|
|
104
80
|
* Получен стрим с экрана собеседника.
|
|
105
81
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
@@ -117,20 +93,41 @@ declare namespace External {
|
|
|
117
93
|
* @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
|
|
118
94
|
*/
|
|
119
95
|
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* Постраничные данные про участников при начале звонка
|
|
98
|
+
* @param chunk
|
|
99
|
+
*/
|
|
100
|
+
function onConversationParticipantListChunk(chunk: ExternalParticipantListChunk): void;
|
|
120
101
|
/**
|
|
121
102
|
* Изменились данные стрима собеседника
|
|
122
103
|
*
|
|
123
104
|
* @param userId
|
|
124
105
|
* @param mediaSettings
|
|
106
|
+
* @param markers
|
|
107
|
+
*/
|
|
108
|
+
function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers): void;
|
|
109
|
+
/**
|
|
110
|
+
* Добавили участника
|
|
111
|
+
*
|
|
112
|
+
* @param userId
|
|
113
|
+
* @param markers
|
|
125
114
|
*/
|
|
126
|
-
function
|
|
115
|
+
function onParticipantAdded(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
|
|
116
|
+
/**
|
|
117
|
+
* Участник подключился
|
|
118
|
+
*
|
|
119
|
+
* @param userId
|
|
120
|
+
* @param markers
|
|
121
|
+
*/
|
|
122
|
+
function onParticipantJoined(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
|
|
127
123
|
/**
|
|
128
124
|
* Изменились данные состояний собеседника
|
|
129
125
|
*
|
|
130
126
|
* @param userId
|
|
131
127
|
* @param participantState
|
|
128
|
+
* @param markers
|
|
132
129
|
*/
|
|
133
|
-
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped): void;
|
|
130
|
+
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers): void;
|
|
134
131
|
/**
|
|
135
132
|
* Изменился статус соединения собеседников
|
|
136
133
|
*
|
|
@@ -162,8 +159,9 @@ declare namespace External {
|
|
|
162
159
|
* Пользователь отключился от звонка
|
|
163
160
|
*
|
|
164
161
|
* @param userId
|
|
162
|
+
* @param markers
|
|
165
163
|
*/
|
|
166
|
-
function onRemoteRemoved(userId: ExternalParticipantId): void;
|
|
164
|
+
function onRemoteRemoved(userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers): void;
|
|
167
165
|
/**
|
|
168
166
|
* Изменилось состояние звонка
|
|
169
167
|
*
|
|
@@ -209,8 +207,9 @@ declare namespace External {
|
|
|
209
207
|
*
|
|
210
208
|
* @param userId Внешний ID пользователя
|
|
211
209
|
* @param unpin Открепить или закрепить
|
|
210
|
+
* @param markers
|
|
212
211
|
*/
|
|
213
|
-
function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean): void;
|
|
212
|
+
function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers): void;
|
|
214
213
|
/**
|
|
215
214
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
216
215
|
*
|
|
@@ -349,5 +348,10 @@ declare namespace External {
|
|
|
349
348
|
* @param stream стрим от WebRTC
|
|
350
349
|
*/
|
|
351
350
|
function onRemoteMixedAudioStream(stream: MediaStream): void;
|
|
351
|
+
/**
|
|
352
|
+
* Получена новая ссылка на звонок
|
|
353
|
+
* @param joinLink токен присоединения к звонку
|
|
354
|
+
*/
|
|
355
|
+
function onJoinLinkChanged(joinLink: string): void;
|
|
352
356
|
}
|
|
353
357
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import ConversationOption from '../enums/ConversationOption';
|
|
|
7
7
|
import FatalError from '../enums/FatalError';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
9
|
import UserRole from '../enums/UserRole';
|
|
10
|
-
import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
|
|
11
11
|
import IceServer from '../types/IceServer';
|
|
12
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
@@ -218,6 +218,19 @@ export declare type ParamsObject = {
|
|
|
218
218
|
movieShare: boolean;
|
|
219
219
|
filteredMessages: boolean;
|
|
220
220
|
breakVideoPayloadTypes: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Включить постраничный вывод участников. Работает только если включено videoTracksCount (слоты)
|
|
223
|
+
*/
|
|
224
|
+
useParticipantListChunk: boolean;
|
|
225
|
+
/**
|
|
226
|
+
* Индекс участника для первого chunk'а который придет при установки соединения с сервером
|
|
227
|
+
*/
|
|
228
|
+
participantListChunkInitIndex: number;
|
|
229
|
+
/**
|
|
230
|
+
* Количество участников которые придут в первом chunk'е при установки соединения с сервером
|
|
231
|
+
* если параметр не проставлен то будет использоваться значение по умолчанию установленное на сервере
|
|
232
|
+
*/
|
|
233
|
+
participantListChunkInitCount: number | null;
|
|
221
234
|
/**
|
|
222
235
|
* Включать RED-extension (redundancy) для групповых звонков
|
|
223
236
|
*/
|
|
@@ -280,23 +293,30 @@ export declare type ParamsObject = {
|
|
|
280
293
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
281
294
|
*/
|
|
282
295
|
onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
|
|
283
|
-
/**
|
|
284
|
-
* Получен собственный стрим трансляция или мувик.
|
|
285
|
-
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
286
|
-
*/
|
|
287
|
-
onLocalLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
|
|
288
296
|
/**
|
|
289
297
|
* Начат звонок
|
|
290
298
|
*/
|
|
291
299
|
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
|
|
300
|
+
/**
|
|
301
|
+
* Начальный список участников для постраничного звонка
|
|
302
|
+
*/
|
|
303
|
+
onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
|
|
292
304
|
/**
|
|
293
305
|
* Изменились данные стрима собеседника
|
|
294
306
|
*/
|
|
295
|
-
onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
|
|
307
|
+
onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
|
|
308
|
+
/**
|
|
309
|
+
* Добавили участника
|
|
310
|
+
*/
|
|
311
|
+
onParticipantAdded?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
312
|
+
/**
|
|
313
|
+
* Участник присоединился к звонку
|
|
314
|
+
*/
|
|
315
|
+
onParticipantJoined?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
296
316
|
/**
|
|
297
317
|
* Изменились данные состояний собеседника
|
|
298
318
|
*/
|
|
299
|
-
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped) => void;
|
|
319
|
+
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers) => void;
|
|
300
320
|
/**
|
|
301
321
|
* Изменился статус соединения собеседников
|
|
302
322
|
*/
|
|
@@ -317,7 +337,7 @@ export declare type ParamsObject = {
|
|
|
317
337
|
/**
|
|
318
338
|
* Пользователь отключился от звонка
|
|
319
339
|
*/
|
|
320
|
-
onRemoteRemoved?: (userId: ExternalParticipantId) => void;
|
|
340
|
+
onRemoteRemoved?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
321
341
|
/**
|
|
322
342
|
* Изменилось состояние звонка
|
|
323
343
|
*/
|
|
@@ -341,7 +361,7 @@ export declare type ParamsObject = {
|
|
|
341
361
|
/**
|
|
342
362
|
* Закрепляет/открепляет собеседника для всех
|
|
343
363
|
*/
|
|
344
|
-
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
|
|
364
|
+
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers) => void;
|
|
345
365
|
/**
|
|
346
366
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
347
367
|
*/
|
|
@@ -445,6 +465,11 @@ export declare type ParamsObject = {
|
|
|
445
465
|
* @param stream стрим от WebRTC
|
|
446
466
|
*/
|
|
447
467
|
onRemoteMixedAudioStream?: (stream: MediaStream) => void;
|
|
468
|
+
/**
|
|
469
|
+
* Получена новая ссылка на звонок
|
|
470
|
+
* @param joinLink токен присоединения к звонку
|
|
471
|
+
*/
|
|
472
|
+
onJoinLinkChanged?: (joinLink: string) => void;
|
|
448
473
|
};
|
|
449
474
|
export default abstract class Params {
|
|
450
475
|
private static _params;
|
|
@@ -454,7 +479,7 @@ export default abstract class Params {
|
|
|
454
479
|
static get(name: string): any;
|
|
455
480
|
static get appName(): string;
|
|
456
481
|
static get appVersion(): number;
|
|
457
|
-
static get sdkVersion(): string
|
|
482
|
+
static get sdkVersion(): string;
|
|
458
483
|
static get debug(): string | number | boolean;
|
|
459
484
|
static get protocolVersion(): 5 | 6;
|
|
460
485
|
static get platform(): string;
|
|
@@ -532,6 +557,9 @@ export default abstract class Params {
|
|
|
532
557
|
static get videoTracksCount(): number;
|
|
533
558
|
static get breakVideoPayloadTypes(): boolean;
|
|
534
559
|
static get filteredMessages(): boolean;
|
|
560
|
+
static get useParticipantListChunk(): boolean;
|
|
561
|
+
static get participantListChunkInitIndex(): number;
|
|
562
|
+
static get participantListChunkInitCount(): number;
|
|
535
563
|
static get serverAudioRed(): boolean;
|
|
536
564
|
static get p2pAudioRed(): boolean;
|
|
537
565
|
static get batchParticipantsOnStart(): boolean;
|
package/static/Utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import UserType from '../enums/UserType';
|
|
2
|
-
import { ExternalParticipant } from '../types/ExternalId';
|
|
2
|
+
import { ExternalParticipant, ExternalParticipantListMarker } from '../types/ExternalId';
|
|
3
3
|
import { CompositeUserId, OkUserId, Participant, ParticipantId, ParticipantStateMapped } from '../types/Participant';
|
|
4
4
|
import SignalingMessage from '../types/SignalingMessage';
|
|
5
5
|
import VideoSettings from '../types/VideoSettings';
|
|
@@ -55,5 +55,10 @@ declare namespace Utils {
|
|
|
55
55
|
}): boolean;
|
|
56
56
|
function isArraysEquals<T>(arr1: T[], arr2: T[]): boolean;
|
|
57
57
|
function isEmptyObject(obj: object): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* @see https://wiki.odkl.ru/pages/viewpage.action?spaceKey=VIDEO&title=Signaling+API#SignalingAPI-Постраничныйвыводпартисипантов
|
|
60
|
+
* https://stash.odkl.ru/projects/ODKL/repos/odnoklassniki-webrtc/browse/src/main/java/one/webrtc/domain/conversation/ParticipantIndex.java#67-78
|
|
61
|
+
*/
|
|
62
|
+
function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
|
|
58
63
|
}
|
|
59
64
|
export default Utils;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/ExternalId.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import MediaOption from '../enums/MediaOption';
|
|
|
2
2
|
import { ParticipantStatus } from '../static/External';
|
|
3
3
|
import MediaSettings from './MediaSettings';
|
|
4
4
|
import MuteStates from './MuteStates';
|
|
5
|
-
import { ParticipantStateMapped } from './Participant';
|
|
5
|
+
import { ParticipantListMarker, ParticipantListType, ParticipantStateMapped } from './Participant';
|
|
6
6
|
import SignalingMessage from './SignalingMessage';
|
|
7
7
|
/**
|
|
8
8
|
* Тип внешнего пользователя
|
|
@@ -57,6 +57,14 @@ export interface ExternalParticipantId extends ExternalId {
|
|
|
57
57
|
*/
|
|
58
58
|
deviceIdx: number;
|
|
59
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Маркер определяющий положение участника в списке
|
|
62
|
+
*/
|
|
63
|
+
export declare type ExternalParticipantListMarker = Required<ParticipantListMarker>;
|
|
64
|
+
/**
|
|
65
|
+
* Словарь сопоставляющий тип списка участников с маркером (положением участника в списке)
|
|
66
|
+
*/
|
|
67
|
+
export declare type ExternalParticipantListMarkers = Record<ParticipantListType, ExternalParticipantListMarker>;
|
|
60
68
|
/**
|
|
61
69
|
* Участник звонка
|
|
62
70
|
*/
|
|
@@ -85,4 +93,11 @@ export interface ExternalParticipant {
|
|
|
85
93
|
* Разрешения на включение устройств
|
|
86
94
|
*/
|
|
87
95
|
unmuteOptions: MediaOption[];
|
|
96
|
+
markers?: ExternalParticipantListMarkers;
|
|
97
|
+
}
|
|
98
|
+
export interface ExternalParticipantListChunk {
|
|
99
|
+
participants: ExternalParticipant[];
|
|
100
|
+
countBefore: number;
|
|
101
|
+
countAfter: number;
|
|
102
|
+
markerFound: boolean;
|
|
88
103
|
}
|
package/types/Participant.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import ParticipantState from '../enums/ParticipantState';
|
|
|
3
3
|
import UserRole from '../enums/UserRole';
|
|
4
4
|
import { ParticipantStatus } from '../static/External';
|
|
5
5
|
import MediaSettings from '../types/MediaSettings';
|
|
6
|
-
import { ExternalParticipantId } from './ExternalId';
|
|
6
|
+
import { ExternalId, ExternalParticipantId, ExternalParticipantListMarkers } from './ExternalId';
|
|
7
7
|
import MuteStates from './MuteStates';
|
|
8
8
|
import ParticipantLayout from './ParticipantLayout';
|
|
9
9
|
/**
|
|
@@ -16,6 +16,13 @@ export declare type CompositeUserId = string;
|
|
|
16
16
|
*/
|
|
17
17
|
export declare type ParticipantId = string;
|
|
18
18
|
export declare type OkUserId = number;
|
|
19
|
+
export declare type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN';
|
|
20
|
+
export interface ParticipantListMarker {
|
|
21
|
+
rank?: number;
|
|
22
|
+
ts?: number;
|
|
23
|
+
id?: CompositeUserId;
|
|
24
|
+
}
|
|
25
|
+
export declare type ParticipantListMarkers = Record<ParticipantListType, ParticipantListMarker>;
|
|
19
26
|
/**
|
|
20
27
|
* Стейт участника звонка
|
|
21
28
|
*/
|
|
@@ -47,4 +54,8 @@ export interface Participant {
|
|
|
47
54
|
muteStates: MuteStates;
|
|
48
55
|
unmuteOptions: MediaOption[];
|
|
49
56
|
observedIds: CompositeUserId[];
|
|
57
|
+
markers?: ExternalParticipantListMarkers;
|
|
58
|
+
}
|
|
59
|
+
export interface IGetParticipantsParameters {
|
|
60
|
+
externalIds: ExternalId[];
|
|
50
61
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ParticipantListMarker, ParticipantListType } from './Participant';
|
|
2
|
+
export interface ParticipantListChunkParameters {
|
|
3
|
+
listType: ParticipantListType;
|
|
4
|
+
count: number;
|
|
5
|
+
/** Anchor in sorted list to start from. Mutually exclusive with "fromIdx" */
|
|
6
|
+
fromMarker?: ParticipantListMarker;
|
|
7
|
+
/** Position in sorted list to start from (0-based). Mutually exclusive with "fromMarker" */
|
|
8
|
+
fromIdx?: number;
|
|
9
|
+
/** If true then list is to be iterated in reverse order */
|
|
10
|
+
backward?: boolean;
|
|
11
|
+
/** If true then resulting chunk will start from Participant with specified marker, if such Participant (still) exists */
|
|
12
|
+
includeMarker?: boolean;
|
|
13
|
+
}
|
|
@@ -9,11 +9,10 @@ import UserRole from '../enums/UserRole';
|
|
|
9
9
|
import UserType from '../enums/UserType';
|
|
10
10
|
import MediaModifiers from './MediaModifiers';
|
|
11
11
|
import MediaSettings from './MediaSettings';
|
|
12
|
-
import { ISharedMovieState } from './MovieShare';
|
|
13
12
|
import MuteStates from './MuteStates';
|
|
14
|
-
import { CompositeUserId, OkUserId, ParticipantId } from './Participant';
|
|
13
|
+
import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
|
|
15
14
|
import VideoSettings from './VideoSettings';
|
|
16
|
-
import {
|
|
15
|
+
import { ChatRoom } from './WaitingHall';
|
|
17
16
|
declare type SignalingMessage = Record<string, any>;
|
|
18
17
|
export declare type RecordInfo = {
|
|
19
18
|
initiator: ParticipantId;
|
|
@@ -32,12 +31,8 @@ declare namespace SignalingMessage {
|
|
|
32
31
|
id: number;
|
|
33
32
|
type?: string;
|
|
34
33
|
}
|
|
35
|
-
export type ParticipantListType =
|
|
36
|
-
export
|
|
37
|
-
rank: number;
|
|
38
|
-
ts: number;
|
|
39
|
-
id?: CompositeUserId;
|
|
40
|
-
}
|
|
34
|
+
export type ParticipantListType = ParticipantParticipantListType;
|
|
35
|
+
export type ParticipantListMarker = ParticipantParticipantListMarker;
|
|
41
36
|
export interface Participant {
|
|
42
37
|
id: OkUserId;
|
|
43
38
|
idType?: UserType;
|
|
@@ -57,9 +52,15 @@ declare namespace SignalingMessage {
|
|
|
57
52
|
restricted?: boolean;
|
|
58
53
|
muteStates?: MuteStates;
|
|
59
54
|
unmuteOptions?: MediaOption[];
|
|
60
|
-
markers?:
|
|
55
|
+
markers?: ParticipantListMarkers;
|
|
61
56
|
observedIds?: CompositeUserId[];
|
|
62
57
|
}
|
|
58
|
+
export interface ParticipantListChunk extends Notification {
|
|
59
|
+
participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
|
|
60
|
+
countBefore: number;
|
|
61
|
+
countAfter: number;
|
|
62
|
+
markerFound: boolean;
|
|
63
|
+
}
|
|
63
64
|
interface Conversation {
|
|
64
65
|
id: string;
|
|
65
66
|
state: string;
|
|
@@ -85,7 +86,10 @@ declare namespace SignalingMessage {
|
|
|
85
86
|
participantType: UserType;
|
|
86
87
|
deviceIdx?: number;
|
|
87
88
|
peerId: PeerId;
|
|
88
|
-
data:
|
|
89
|
+
data: {
|
|
90
|
+
candidate?: RTCIceCandidateInit;
|
|
91
|
+
sdp?: RTCSessionDescriptionInit;
|
|
92
|
+
};
|
|
89
93
|
}
|
|
90
94
|
export interface RegisteredPeer extends Notification {
|
|
91
95
|
participantId: OkUserId;
|
|
@@ -108,6 +112,7 @@ declare namespace SignalingMessage {
|
|
|
108
112
|
deviceIdx?: number;
|
|
109
113
|
peerId: PeerId;
|
|
110
114
|
reason: HangupType;
|
|
115
|
+
markers?: ParticipantListMarkers;
|
|
111
116
|
}
|
|
112
117
|
export interface ClosedConversation extends Notification {
|
|
113
118
|
reason: HangupType;
|
|
@@ -118,6 +123,7 @@ declare namespace SignalingMessage {
|
|
|
118
123
|
deviceIdx?: number;
|
|
119
124
|
peerId: PeerId;
|
|
120
125
|
mediaSettings: Partial<MediaSettings>;
|
|
126
|
+
markers?: ParticipantListMarkers;
|
|
121
127
|
}
|
|
122
128
|
export interface ParticipantStateChanged extends Notification {
|
|
123
129
|
participantId: OkUserId;
|
|
@@ -129,6 +135,7 @@ declare namespace SignalingMessage {
|
|
|
129
135
|
state: Record<string, string>;
|
|
130
136
|
stateUpdateTs: Record<string, number>;
|
|
131
137
|
};
|
|
138
|
+
markers?: ParticipantListMarkers;
|
|
132
139
|
}
|
|
133
140
|
export interface RolesChanged extends Notification {
|
|
134
141
|
adminId: ParticipantId;
|
|
@@ -236,11 +243,11 @@ declare namespace SignalingMessage {
|
|
|
236
243
|
}
|
|
237
244
|
export interface ChatRoomUpdated extends Notification {
|
|
238
245
|
eventType: ChatRoomEventType;
|
|
239
|
-
totalCount:
|
|
240
|
-
firstParticipants
|
|
241
|
-
addedParticipantIds
|
|
242
|
-
removedParticipantIds
|
|
243
|
-
feedback
|
|
246
|
+
totalCount: ChatRoom['totalCount'];
|
|
247
|
+
firstParticipants?: ChatRoom['firstParticipants'];
|
|
248
|
+
addedParticipantIds?: ParticipantId[];
|
|
249
|
+
removedParticipantIds?: ParticipantId[];
|
|
250
|
+
feedback?: ChatRoom['feedback'];
|
|
244
251
|
}
|
|
245
252
|
export interface VideoQualityUpdate extends Notification {
|
|
246
253
|
quality: {
|
|
@@ -263,9 +270,11 @@ declare namespace SignalingMessage {
|
|
|
263
270
|
isConcurrent: boolean;
|
|
264
271
|
peerId: PeerId;
|
|
265
272
|
mediaModifiers: MediaModifiers;
|
|
273
|
+
participants?: ParticipantListChunk;
|
|
274
|
+
chatRoom?: ChatRoom;
|
|
266
275
|
}
|
|
267
|
-
export interface
|
|
268
|
-
|
|
276
|
+
export interface JoinLinkChanged extends Notification {
|
|
277
|
+
joinLink: string;
|
|
269
278
|
}
|
|
270
279
|
export {};
|
|
271
280
|
}
|