@vkontakte/calls-sdk 2.5.3-dev.fe8ad1c.0 → 2.6.2-dev.14b086c.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 +23 -5
- package/abstract/BaseSignaling.d.ts +6 -3
- package/calls-sdk.cjs.js +9 -9
- package/calls-sdk.esm.js +9 -9
- package/classes/Conversation.d.ts +25 -3
- package/classes/Conversation.test.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 +7 -3
- package/enums/HangupType.d.ts +2 -1
- package/enums/SignalingCommandType.d.ts +2 -0
- package/enums/SignalingNotification.d.ts +4 -1
- package/package.json +1 -1
- package/static/External.d.ts +69 -6
- package/static/Params.d.ts +68 -6
- package/static/Utils.d.ts +6 -1
- package/static/Utils.test.d.ts +1 -0
- package/types/ExternalId.d.ts +18 -1
- package/types/MediaSettings.d.ts +1 -1
- package/types/MovieShare.d.ts +25 -9
- package/types/Participant.d.ts +14 -1
- package/types/ParticipantListChunk.d.ts +13 -0
- package/types/SignalingMessage.d.ts +35 -16
- package/types/WaitingHall.d.ts +13 -0
- package/worker/WebCodecsDecoderWorker.d.ts +1 -1
|
@@ -12,13 +12,14 @@ 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
18
|
import { IAddMovieParams } from '../types/MovieShare';
|
|
19
19
|
import MuteStates from '../types/MuteStates';
|
|
20
|
-
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
20
|
+
import { CompositeUserId, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
|
|
21
21
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
22
|
+
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
22
23
|
import ParticipantPriority from '../types/ParticipantPriority';
|
|
23
24
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
24
25
|
import SignalingMessage, { RecordInfo } from '../types/SignalingMessage';
|
|
@@ -129,6 +130,7 @@ export default class Conversation extends EventEmitter {
|
|
|
129
130
|
private _close;
|
|
130
131
|
destroy(): void;
|
|
131
132
|
private _getConversationParams;
|
|
133
|
+
private _addGeoParamsToEndpoint;
|
|
132
134
|
/**
|
|
133
135
|
* @throws ErrorEvent
|
|
134
136
|
*/
|
|
@@ -147,7 +149,21 @@ export default class Conversation extends EventEmitter {
|
|
|
147
149
|
private _updateConversation;
|
|
148
150
|
private _createMediaSource;
|
|
149
151
|
private _connectSignaling;
|
|
152
|
+
private _processConnection;
|
|
153
|
+
private _prepareParticipants;
|
|
154
|
+
private _onConversationParticipantListChunk;
|
|
155
|
+
private _participantListChunkToExternalChunk;
|
|
156
|
+
private _registerConnectionParticipants;
|
|
150
157
|
private _registerParticipants;
|
|
158
|
+
private _getClientType;
|
|
159
|
+
private _getStatusByTransportState;
|
|
160
|
+
private _registerParticipantInCache;
|
|
161
|
+
private _getExistedParticipantByIdOrCreate;
|
|
162
|
+
private _getExternalIdByParticipantId;
|
|
163
|
+
private _registerParticipantAndSetMarkersIfChunkEnabled;
|
|
164
|
+
private _warnParticipantNotInConversation;
|
|
165
|
+
private _setParticipantMarkers;
|
|
166
|
+
private _denormalizeMarkers;
|
|
151
167
|
/**
|
|
152
168
|
* Обрабатывает данные connection из сигналинга. Должен вызываться после `_registerParticipants`
|
|
153
169
|
*
|
|
@@ -183,6 +199,7 @@ export default class Conversation extends EventEmitter {
|
|
|
183
199
|
[key: string]: string;
|
|
184
200
|
}): Promise<void>;
|
|
185
201
|
requestKeyFrame(participantStreamDescription: ParticipantStreamDescription): Promise<void | SignalingMessage>;
|
|
202
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<void>;
|
|
186
203
|
updateDisplayLayout(layouts: ParticipantLayout[]): Promise<void>;
|
|
187
204
|
private _stopStreaming;
|
|
188
205
|
private _sendUpdateDisplayLayout;
|
|
@@ -193,6 +210,8 @@ export default class Conversation extends EventEmitter {
|
|
|
193
210
|
private _onParticipantPromoted;
|
|
194
211
|
private _onChatRoomUpdated;
|
|
195
212
|
private _onSharedMovieUpdate;
|
|
213
|
+
private _onSharedMovieInfoStarted;
|
|
214
|
+
private _onSharedMovieInfoStopped;
|
|
196
215
|
private _waitForStreamIfNeeded;
|
|
197
216
|
private _matchStreamDescription;
|
|
198
217
|
private _getWaitingTime;
|
|
@@ -220,7 +239,7 @@ export default class Conversation extends EventEmitter {
|
|
|
220
239
|
movieId: string;
|
|
221
240
|
streamType: string;
|
|
222
241
|
}>;
|
|
223
|
-
updateMovie(movieId: string, gain?: number, offset?:
|
|
242
|
+
updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
|
|
224
243
|
removeMovie(movieId: string): Promise<void>;
|
|
225
244
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
|
|
226
245
|
stopStream(): Promise<SignalingMessage>;
|
|
@@ -233,6 +252,8 @@ export default class Conversation extends EventEmitter {
|
|
|
233
252
|
effect: IVideoDimentions;
|
|
234
253
|
}): Promise<void>;
|
|
235
254
|
videoEffect(effect: IEffect | null): Promise<void>;
|
|
255
|
+
getParticipants(parameters: IGetParticipantsParameters): Promise<ExternalParticipant[]>;
|
|
256
|
+
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<ExternalParticipantListChunk>;
|
|
236
257
|
private _onLocalMediaStreamChanged;
|
|
237
258
|
private _onScreenSharingStatus;
|
|
238
259
|
private _changeRemoteMediaSettings;
|
|
@@ -288,6 +309,7 @@ export default class Conversation extends EventEmitter {
|
|
|
288
309
|
private _toggleJoinAvailability;
|
|
289
310
|
private _updateDisplayLayoutFromCache;
|
|
290
311
|
private _setParticipantsStatus;
|
|
312
|
+
private _onJoinLinkChanged;
|
|
291
313
|
}
|
|
292
314
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
293
315
|
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
|
@@ -11,8 +11,10 @@ import UserRole from '../enums/UserRole';
|
|
|
11
11
|
import { JSONObject } from '../static/Json';
|
|
12
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
14
|
+
import { IAddMovieParams, ISharedMovieState } from '../types/MovieShare';
|
|
14
15
|
import MuteStates from '../types/MuteStates';
|
|
15
16
|
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
17
|
+
import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
|
|
16
18
|
import SignalingMessage from '../types/SignalingMessage';
|
|
17
19
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
18
20
|
export default class Signaling extends BaseSignaling {
|
|
@@ -72,7 +74,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
72
74
|
getNextCommandSequenceNumber(): number;
|
|
73
75
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
74
76
|
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
75
|
-
requestTestMode(
|
|
77
|
+
requestTestMode(consumerCommand: string, producerCommand: string): Promise<SignalingMessage>;
|
|
76
78
|
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
|
|
77
79
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
78
80
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
@@ -91,8 +93,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
91
93
|
updateDisplayLayout(layout: {
|
|
92
94
|
[key: string]: string;
|
|
93
95
|
}): Promise<SignalingMessage>;
|
|
94
|
-
addMovie(data:
|
|
95
|
-
updateMovie(data:
|
|
96
|
+
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
97
|
+
updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
|
|
96
98
|
removeMovie(data: any): Promise<SignalingMessage>;
|
|
97
99
|
startStream(data: any): Promise<SignalingMessage>;
|
|
98
100
|
stopStream(): Promise<SignalingMessage>;
|
|
@@ -124,6 +126,8 @@ export default class Signaling extends BaseSignaling {
|
|
|
124
126
|
* что все подписчики готовы принимать сообщения от сигналинга.
|
|
125
127
|
*/
|
|
126
128
|
readyToSend(): void;
|
|
129
|
+
getParticipantListChunk(participantListChunkParameters: ParticipantListChunkParameters): Promise<SignalingMessage>;
|
|
130
|
+
getParticipants(externalIds: SignalingMessage.ExternalId[]): Promise<SignalingMessage>;
|
|
127
131
|
protected _connect(connectionType: SignalingConnectionType): void;
|
|
128
132
|
protected _disconnect(): void;
|
|
129
133
|
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",
|
|
@@ -36,6 +36,9 @@ declare enum SignalingNotification {
|
|
|
36
36
|
CHAT_ROOM_UPDATED = "chat-room-updated",
|
|
37
37
|
PROMOTION_APPROVED = "promotion-approved",
|
|
38
38
|
JOIN_LINK_CHANGED = "join-link-changed",
|
|
39
|
-
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification"
|
|
39
|
+
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
|
|
40
|
+
MOVIE_SHARE_INFO = "movie-share-info",
|
|
41
|
+
MOVIE_SHARE_STARTED = "movie-share-started",
|
|
42
|
+
MOVIE_SHARE_STOPPED = "movie-share-stopped"
|
|
40
43
|
}
|
|
41
44
|
export default SignalingNotification;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ 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';
|
|
13
|
+
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
14
14
|
import MuteStates from '../types/MuteStates';
|
|
15
15
|
import { ParticipantStateMapped } from '../types/Participant';
|
|
16
16
|
import { DebugMessageType } from './Debug';
|
|
@@ -117,20 +117,76 @@ declare namespace External {
|
|
|
117
117
|
* @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
|
|
118
118
|
*/
|
|
119
119
|
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
|
|
120
|
+
/**
|
|
121
|
+
* Постраничные данные про участников при начале звонка
|
|
122
|
+
* @param chunk
|
|
123
|
+
*/
|
|
124
|
+
function onConversationParticipantListChunk(chunk: ExternalParticipantListChunk): void;
|
|
120
125
|
/**
|
|
121
126
|
* Изменились данные стрима собеседника
|
|
122
127
|
*
|
|
123
128
|
* @param userId
|
|
124
129
|
* @param mediaSettings
|
|
130
|
+
* @param markers
|
|
125
131
|
*/
|
|
126
|
-
function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
|
|
132
|
+
function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers): void;
|
|
133
|
+
/**
|
|
134
|
+
* Изменились данные собственного стрима
|
|
135
|
+
*
|
|
136
|
+
* @param userId
|
|
137
|
+
* @param mediaSettings
|
|
138
|
+
*/
|
|
139
|
+
function onLocalMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
|
|
140
|
+
/**
|
|
141
|
+
* Полученны данные по стримам (лайв/мувик) от собеседника
|
|
142
|
+
*
|
|
143
|
+
* @param userId
|
|
144
|
+
* @param sharedMovieInfo
|
|
145
|
+
*/
|
|
146
|
+
function onRemoteSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo): void;
|
|
147
|
+
/**
|
|
148
|
+
* Полученны данные по остановленным стримам (лайв/мувик) от собеседника
|
|
149
|
+
*
|
|
150
|
+
* @param userId
|
|
151
|
+
* @param sharedMovieStoppedInfo
|
|
152
|
+
*/
|
|
153
|
+
function onRemoteSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo): void;
|
|
154
|
+
/**
|
|
155
|
+
* Полученны данные по собственным стримам (лайв/мувик)
|
|
156
|
+
*
|
|
157
|
+
* @param userId
|
|
158
|
+
* @param sharedMovieInfo
|
|
159
|
+
*/
|
|
160
|
+
function onLocalSharedMovieInfo(userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo): void;
|
|
161
|
+
/**
|
|
162
|
+
* Полученны данные по собственным остановленным стримам (лайв/мувик)
|
|
163
|
+
*
|
|
164
|
+
* @param userId
|
|
165
|
+
* @param sharedMovieStoppedInfo
|
|
166
|
+
*/
|
|
167
|
+
function onLocalSharedMovieStoppedInfo(userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo): void;
|
|
168
|
+
/**
|
|
169
|
+
* Добавили участника
|
|
170
|
+
*
|
|
171
|
+
* @param userId
|
|
172
|
+
* @param markers
|
|
173
|
+
*/
|
|
174
|
+
function onParticipantAdded(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
|
|
175
|
+
/**
|
|
176
|
+
* Участник подключился
|
|
177
|
+
*
|
|
178
|
+
* @param userId
|
|
179
|
+
* @param markers
|
|
180
|
+
*/
|
|
181
|
+
function onParticipantJoined(userId: ExternalId, markers?: ExternalParticipantListMarkers): void;
|
|
127
182
|
/**
|
|
128
183
|
* Изменились данные состояний собеседника
|
|
129
184
|
*
|
|
130
185
|
* @param userId
|
|
131
186
|
* @param participantState
|
|
187
|
+
* @param markers
|
|
132
188
|
*/
|
|
133
|
-
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped): void;
|
|
189
|
+
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers): void;
|
|
134
190
|
/**
|
|
135
191
|
* Изменился статус соединения собеседников
|
|
136
192
|
*
|
|
@@ -162,8 +218,9 @@ declare namespace External {
|
|
|
162
218
|
* Пользователь отключился от звонка
|
|
163
219
|
*
|
|
164
220
|
* @param userId
|
|
221
|
+
* @param markers
|
|
165
222
|
*/
|
|
166
|
-
function onRemoteRemoved(userId: ExternalParticipantId): void;
|
|
223
|
+
function onRemoteRemoved(userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers): void;
|
|
167
224
|
/**
|
|
168
225
|
* Изменилось состояние звонка
|
|
169
226
|
*
|
|
@@ -209,8 +266,9 @@ declare namespace External {
|
|
|
209
266
|
*
|
|
210
267
|
* @param userId Внешний ID пользователя
|
|
211
268
|
* @param unpin Открепить или закрепить
|
|
269
|
+
* @param markers
|
|
212
270
|
*/
|
|
213
|
-
function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean): void;
|
|
271
|
+
function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers): void;
|
|
214
272
|
/**
|
|
215
273
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
216
274
|
*
|
|
@@ -349,5 +407,10 @@ declare namespace External {
|
|
|
349
407
|
* @param stream стрим от WebRTC
|
|
350
408
|
*/
|
|
351
409
|
function onRemoteMixedAudioStream(stream: MediaStream): void;
|
|
410
|
+
/**
|
|
411
|
+
* Получена новая ссылка на звонок
|
|
412
|
+
* @param joinLink токен присоединения к звонку
|
|
413
|
+
*/
|
|
414
|
+
function onJoinLinkChanged(joinLink: string): void;
|
|
352
415
|
}
|
|
353
416
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -7,10 +7,11 @@ 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';
|
|
14
|
+
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
14
15
|
import MuteStates from '../types/MuteStates';
|
|
15
16
|
import { ParticipantStateMapped } from '../types/Participant';
|
|
16
17
|
import AuthData from './AuthData';
|
|
@@ -218,6 +219,19 @@ export declare type ParamsObject = {
|
|
|
218
219
|
movieShare: boolean;
|
|
219
220
|
filteredMessages: boolean;
|
|
220
221
|
breakVideoPayloadTypes: boolean;
|
|
222
|
+
/**
|
|
223
|
+
* Включить постраничный вывод участников. Работает только если включено videoTracksCount (слоты)
|
|
224
|
+
*/
|
|
225
|
+
useParticipantListChunk: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Индекс участника для первого chunk'а который придет при установки соединения с сервером
|
|
228
|
+
*/
|
|
229
|
+
participantListChunkInitIndex: number;
|
|
230
|
+
/**
|
|
231
|
+
* Количество участников которые придут в первом chunk'е при установки соединения с сервером
|
|
232
|
+
* если параметр не проставлен то будет использоваться значение по умолчанию установленное на сервере
|
|
233
|
+
*/
|
|
234
|
+
participantListChunkInitCount: number | null;
|
|
221
235
|
/**
|
|
222
236
|
* Включать RED-extension (redundancy) для групповых звонков
|
|
223
237
|
*/
|
|
@@ -285,18 +299,58 @@ export declare type ParamsObject = {
|
|
|
285
299
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
286
300
|
*/
|
|
287
301
|
onLocalLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
|
|
302
|
+
/**
|
|
303
|
+
* Получено обновление стрима или лайва от собеседника.
|
|
304
|
+
*/
|
|
305
|
+
onRemoteLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
|
|
306
|
+
/**
|
|
307
|
+
* Получено обновление собственного стрима или лайва.
|
|
308
|
+
*/
|
|
309
|
+
onLocalLiveUpdate?: (userId: ExternalParticipantId, data: ISharedMovieState) => void;
|
|
288
310
|
/**
|
|
289
311
|
* Начат звонок
|
|
290
312
|
*/
|
|
291
313
|
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
|
|
314
|
+
/**
|
|
315
|
+
* Начальный список участников для постраничного звонка
|
|
316
|
+
*/
|
|
317
|
+
onConversationParticipantListChunk?: (chunk: ExternalParticipantListChunk) => void;
|
|
318
|
+
/**
|
|
319
|
+
* Изменились данные стрима собеседника
|
|
320
|
+
*/
|
|
321
|
+
onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
|
|
292
322
|
/**
|
|
293
323
|
* Изменились данные стрима собеседника
|
|
294
324
|
*/
|
|
295
|
-
|
|
325
|
+
onLocalMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
|
|
326
|
+
/**
|
|
327
|
+
* Полученны данные по стримам (лайв/мувик) от собеседника
|
|
328
|
+
*/
|
|
329
|
+
onRemoteSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo) => void;
|
|
330
|
+
/**
|
|
331
|
+
* Полученны данные по остановленным стримам (лайв/мувик) от собеседника
|
|
332
|
+
*/
|
|
333
|
+
onRemoteSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo) => void;
|
|
334
|
+
/**
|
|
335
|
+
* Полученны данные по собственным стримам (лайв/мувик)
|
|
336
|
+
*/
|
|
337
|
+
onLocalSharedMovieInfo?: (userId: ExternalParticipantId, sharedMovieInfo: ISharedMovieInfo) => void;
|
|
338
|
+
/**
|
|
339
|
+
* Полученны данные по собственным остановленным стримам (лайв/мувик)
|
|
340
|
+
*/
|
|
341
|
+
onLocalSharedMovieStoppedInfo?: (userId: ExternalParticipantId, sharedMovieStoppedInfo: ISharedMovieStoppedInfo) => void;
|
|
342
|
+
/**
|
|
343
|
+
* Добавили участника
|
|
344
|
+
*/
|
|
345
|
+
onParticipantAdded?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
346
|
+
/**
|
|
347
|
+
* Участник присоединился к звонку
|
|
348
|
+
*/
|
|
349
|
+
onParticipantJoined?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
296
350
|
/**
|
|
297
351
|
* Изменились данные состояний собеседника
|
|
298
352
|
*/
|
|
299
|
-
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped) => void;
|
|
353
|
+
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped, markers?: ExternalParticipantListMarkers) => void;
|
|
300
354
|
/**
|
|
301
355
|
* Изменился статус соединения собеседников
|
|
302
356
|
*/
|
|
@@ -317,7 +371,7 @@ export declare type ParamsObject = {
|
|
|
317
371
|
/**
|
|
318
372
|
* Пользователь отключился от звонка
|
|
319
373
|
*/
|
|
320
|
-
onRemoteRemoved?: (userId: ExternalParticipantId) => void;
|
|
374
|
+
onRemoteRemoved?: (userId: ExternalParticipantId, markers?: ExternalParticipantListMarkers) => void;
|
|
321
375
|
/**
|
|
322
376
|
* Изменилось состояние звонка
|
|
323
377
|
*/
|
|
@@ -341,7 +395,7 @@ export declare type ParamsObject = {
|
|
|
341
395
|
/**
|
|
342
396
|
* Закрепляет/открепляет собеседника для всех
|
|
343
397
|
*/
|
|
344
|
-
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
|
|
398
|
+
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean, markers?: ExternalParticipantListMarkers) => void;
|
|
345
399
|
/**
|
|
346
400
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
347
401
|
*/
|
|
@@ -445,6 +499,11 @@ export declare type ParamsObject = {
|
|
|
445
499
|
* @param stream стрим от WebRTC
|
|
446
500
|
*/
|
|
447
501
|
onRemoteMixedAudioStream?: (stream: MediaStream) => void;
|
|
502
|
+
/**
|
|
503
|
+
* Получена новая ссылка на звонок
|
|
504
|
+
* @param joinLink токен присоединения к звонку
|
|
505
|
+
*/
|
|
506
|
+
onJoinLinkChanged?: (joinLink: string) => void;
|
|
448
507
|
};
|
|
449
508
|
export default abstract class Params {
|
|
450
509
|
private static _params;
|
|
@@ -454,7 +513,7 @@ export default abstract class Params {
|
|
|
454
513
|
static get(name: string): any;
|
|
455
514
|
static get appName(): string;
|
|
456
515
|
static get appVersion(): number;
|
|
457
|
-
static get sdkVersion(): string
|
|
516
|
+
static get sdkVersion(): string;
|
|
458
517
|
static get debug(): string | number | boolean;
|
|
459
518
|
static get protocolVersion(): 5 | 6;
|
|
460
519
|
static get platform(): string;
|
|
@@ -532,6 +591,9 @@ export default abstract class Params {
|
|
|
532
591
|
static get videoTracksCount(): number;
|
|
533
592
|
static get breakVideoPayloadTypes(): boolean;
|
|
534
593
|
static get filteredMessages(): boolean;
|
|
594
|
+
static get useParticipantListChunk(): boolean;
|
|
595
|
+
static get participantListChunkInitIndex(): number;
|
|
596
|
+
static get participantListChunkInitCount(): number;
|
|
535
597
|
static get serverAudioRed(): boolean;
|
|
536
598
|
static get p2pAudioRed(): boolean;
|
|
537
599
|
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
|
@@ -1,8 +1,9 @@
|
|
|
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
|
-
import { ParticipantStateMapped } from './Participant';
|
|
6
|
+
import { ParticipantListMarker, ParticipantListType, ParticipantStateMapped } from './Participant';
|
|
6
7
|
import SignalingMessage from './SignalingMessage';
|
|
7
8
|
/**
|
|
8
9
|
* Тип внешнего пользователя
|
|
@@ -57,6 +58,14 @@ export interface ExternalParticipantId extends ExternalId {
|
|
|
57
58
|
*/
|
|
58
59
|
deviceIdx: number;
|
|
59
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Маркер определяющий положение участника в списке
|
|
63
|
+
*/
|
|
64
|
+
export declare type ExternalParticipantListMarker = Required<ParticipantListMarker>;
|
|
65
|
+
/**
|
|
66
|
+
* Словарь сопоставляющий тип списка участников с маркером (положением участника в списке)
|
|
67
|
+
*/
|
|
68
|
+
export declare type ExternalParticipantListMarkers = Record<ParticipantListType, ExternalParticipantListMarker>;
|
|
60
69
|
/**
|
|
61
70
|
* Участник звонка
|
|
62
71
|
*/
|
|
@@ -85,4 +94,12 @@ export interface ExternalParticipant {
|
|
|
85
94
|
* Разрешения на включение устройств
|
|
86
95
|
*/
|
|
87
96
|
unmuteOptions: MediaOption[];
|
|
97
|
+
markers?: ExternalParticipantListMarkers;
|
|
98
|
+
movieShareInfos?: ISharedMovieInfo[];
|
|
99
|
+
}
|
|
100
|
+
export interface ExternalParticipantListChunk {
|
|
101
|
+
participants: ExternalParticipant[];
|
|
102
|
+
countBefore: number;
|
|
103
|
+
countAfter: number;
|
|
104
|
+
markerFound: boolean;
|
|
88
105
|
}
|
package/types/MediaSettings.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare type MediaSettings = {
|
|
|
19
19
|
export declare type VideoStreamInfo = {
|
|
20
20
|
id: string;
|
|
21
21
|
source: string;
|
|
22
|
-
|
|
22
|
+
externalMovieId?: string;
|
|
23
23
|
};
|
|
24
24
|
export default MediaSettings;
|
|
25
25
|
export declare function compareMediaSettings(ms1: MediaSettings, ms2: MediaSettings): boolean;
|
package/types/MovieShare.d.ts
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OkUserId, CompositeUserId } from './Participant';
|
|
2
|
+
import { MediaType } from './ParticipantStreamDescription';
|
|
2
3
|
export interface IAddMovieParams {
|
|
3
4
|
movieId: string;
|
|
4
5
|
gain?: number;
|
|
5
6
|
}
|
|
6
|
-
declare type
|
|
7
|
-
declare type Offset = number | null;
|
|
8
|
-
export declare type ISharedMovieStateResponse = [number, Gain, boolean, Offset, number];
|
|
7
|
+
export declare type ISharedMovieStateResponse = [number, number, boolean, number, number];
|
|
9
8
|
export interface ISharedMovieState {
|
|
10
|
-
participantId:
|
|
11
|
-
gain
|
|
12
|
-
pause
|
|
13
|
-
offset
|
|
9
|
+
participantId: CompositeUserId;
|
|
10
|
+
gain?: number;
|
|
11
|
+
pause?: boolean;
|
|
12
|
+
offset?: number;
|
|
13
|
+
duration?: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ISharedMovieInfo {
|
|
16
|
+
movieId: OkUserId;
|
|
17
|
+
initiatorId: CompositeUserId;
|
|
18
|
+
title: string;
|
|
19
|
+
source: MediaType;
|
|
20
|
+
externalMovieId: string;
|
|
14
21
|
duration: number;
|
|
22
|
+
thumbnailNormal: string;
|
|
23
|
+
thumbnailMedium: string;
|
|
24
|
+
thumbnailBig: string;
|
|
25
|
+
thumbnailHigh: string;
|
|
26
|
+
thumbnailHd: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ISharedMovieStoppedInfo {
|
|
29
|
+
movieId: OkUserId;
|
|
30
|
+
initiatorId: CompositeUserId;
|
|
31
|
+
source: MediaType;
|
|
15
32
|
}
|
|
16
|
-
export {};
|
package/types/Participant.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ 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
|
+
import { ISharedMovieInfo } from './MovieShare';
|
|
7
8
|
import MuteStates from './MuteStates';
|
|
8
9
|
import ParticipantLayout from './ParticipantLayout';
|
|
9
10
|
/**
|
|
@@ -16,6 +17,13 @@ export declare type CompositeUserId = string;
|
|
|
16
17
|
*/
|
|
17
18
|
export declare type ParticipantId = string;
|
|
18
19
|
export declare type OkUserId = number;
|
|
20
|
+
export declare type ParticipantListType = 'GRID' | 'SIDE' | 'ADMIN';
|
|
21
|
+
export interface ParticipantListMarker {
|
|
22
|
+
rank?: number;
|
|
23
|
+
ts?: number;
|
|
24
|
+
id?: CompositeUserId;
|
|
25
|
+
}
|
|
26
|
+
export declare type ParticipantListMarkers = Record<ParticipantListType, ParticipantListMarker>;
|
|
19
27
|
/**
|
|
20
28
|
* Стейт участника звонка
|
|
21
29
|
*/
|
|
@@ -47,4 +55,9 @@ export interface Participant {
|
|
|
47
55
|
muteStates: MuteStates;
|
|
48
56
|
unmuteOptions: MediaOption[];
|
|
49
57
|
observedIds: CompositeUserId[];
|
|
58
|
+
markers?: ExternalParticipantListMarkers;
|
|
59
|
+
movieShareInfos?: ISharedMovieInfo[];
|
|
60
|
+
}
|
|
61
|
+
export interface IGetParticipantsParameters {
|
|
62
|
+
externalIds: ExternalId[];
|
|
50
63
|
}
|
|
@@ -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
|
+
}
|