@vkontakte/calls-sdk 2.6.2-dev.65f330d.0 → 2.6.2-dev.6c48704.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 +43 -7
- package/abstract/BaseApi.d.ts +6 -2
- package/abstract/BaseSignaling.d.ts +6 -0
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +17 -3
- package/classes/ProducerCommandSerializationService.d.ts +1 -1
- package/default/Api.d.ts +7 -2
- package/default/Api.test.d.ts +1 -0
- package/default/Signaling.d.ts +6 -0
- package/enums/ConversationFeature.d.ts +2 -1
- package/enums/ConversationOption.d.ts +2 -1
- package/enums/HangupType.d.ts +3 -1
- package/enums/MediaOption.d.ts +2 -1
- package/enums/RoomsEventType.d.ts +6 -0
- package/enums/SignalingCommandType.d.ts +8 -1
- package/enums/SignalingNotification.d.ts +4 -1
- package/package.json +1 -1
- package/static/External.d.ts +20 -9
- package/static/Params.d.ts +36 -5
- package/static/Utils.d.ts +2 -1
- package/types/Conversation.d.ts +12 -0
- package/types/ConversationParams.d.ts +1 -0
- package/types/MovieShare.d.ts +15 -5
- package/types/ParticipantListChunk.d.ts +2 -0
- package/types/Room.d.ts +60 -0
- package/types/SignalingMessage.d.ts +37 -0
- package/utils/Conversation.d.ts +2 -0
|
@@ -38,6 +38,7 @@ export declare type ConversationData = {
|
|
|
38
38
|
*/
|
|
39
39
|
acceptTime: number | null;
|
|
40
40
|
features: ConversationFeature[];
|
|
41
|
+
featuresPerRole?: Partial<Record<ConversationFeature, UserRole[]>> | null;
|
|
41
42
|
/**
|
|
42
43
|
* ID звонка
|
|
43
44
|
*/
|
|
@@ -77,6 +78,7 @@ export default class Conversation extends EventEmitter {
|
|
|
77
78
|
private readonly _signaling;
|
|
78
79
|
private _mediaSource;
|
|
79
80
|
private _conversation;
|
|
81
|
+
private _myLastRequestedLayouts;
|
|
80
82
|
private _state;
|
|
81
83
|
private _participantState;
|
|
82
84
|
private _participants;
|
|
@@ -107,7 +109,7 @@ export default class Conversation extends EventEmitter {
|
|
|
107
109
|
static current(): Conversation | null;
|
|
108
110
|
static hangupAfterInit(): void;
|
|
109
111
|
static id(): string | null;
|
|
110
|
-
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>;
|
|
111
113
|
onJoin(joinArgs: {
|
|
112
114
|
conversationId?: string;
|
|
113
115
|
mediaOptions: MediaOption[];
|
|
@@ -152,10 +154,12 @@ export default class Conversation extends EventEmitter {
|
|
|
152
154
|
private _processConnection;
|
|
153
155
|
private _prepareParticipants;
|
|
154
156
|
private _onConversationParticipantListChunk;
|
|
157
|
+
private _createParticipantListChunk;
|
|
155
158
|
private _participantListChunkToExternalChunk;
|
|
156
159
|
private _registerConnectionParticipants;
|
|
157
160
|
private _registerParticipants;
|
|
158
|
-
|
|
161
|
+
/** Установим состояние локальных мьютов */
|
|
162
|
+
private _registerParticipantLocalMuteState;
|
|
159
163
|
private _getStatusByTransportState;
|
|
160
164
|
private _registerParticipantInCache;
|
|
161
165
|
private _getExistedParticipantByIdOrCreate;
|
|
@@ -217,6 +221,7 @@ export default class Conversation extends EventEmitter {
|
|
|
217
221
|
private _checkAdminRole;
|
|
218
222
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
219
223
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
|
|
224
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<void>;
|
|
220
225
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
|
|
221
226
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
222
227
|
changeOptions(changes: {
|
|
@@ -233,12 +238,16 @@ export default class Conversation extends EventEmitter {
|
|
|
233
238
|
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
234
239
|
createJoinLink(): Promise<string>;
|
|
235
240
|
removeJoinLink(): Promise<never>;
|
|
236
|
-
addMovie({ movieId, gain }: IAddMovieParams): Promise<{
|
|
241
|
+
addMovie({ movieId, gain, metadata }: IAddMovieParams): Promise<{
|
|
237
242
|
movieId: string;
|
|
238
243
|
streamType: string;
|
|
239
244
|
}>;
|
|
240
245
|
updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
|
|
241
246
|
removeMovie(movieId: string): Promise<void>;
|
|
247
|
+
updateRooms(rooms: SignalingMessage.Room[], assignRandomly: boolean): Promise<void>;
|
|
248
|
+
activateRooms(roomIds: number[], deactivate: boolean): Promise<void>;
|
|
249
|
+
switchRoom(toRoomId?: number, participantId?: ParticipantId): Promise<void>;
|
|
250
|
+
removeRooms(roomIds: number[]): Promise<void>;
|
|
242
251
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
|
|
243
252
|
stopStream(): Promise<SignalingMessage>;
|
|
244
253
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<void>;
|
|
@@ -309,6 +318,11 @@ export default class Conversation extends EventEmitter {
|
|
|
309
318
|
private _updateDisplayLayoutFromCache;
|
|
310
319
|
private _setParticipantsStatus;
|
|
311
320
|
private _onJoinLinkChanged;
|
|
321
|
+
private _onRoomsUpdated;
|
|
322
|
+
private _onRoomUpdated;
|
|
323
|
+
private _convertRoomToExternal;
|
|
324
|
+
private _onRoomParticipantsUpdated;
|
|
325
|
+
private _isMe;
|
|
312
326
|
}
|
|
313
327
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
314
328
|
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
|
}
|
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
|
|
20
|
-
|
|
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 {};
|
package/default/Signaling.d.ts
CHANGED
|
@@ -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';
|
|
@@ -100,6 +101,10 @@ export default class Signaling extends BaseSignaling {
|
|
|
100
101
|
addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
|
|
101
102
|
updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
|
|
102
103
|
removeMovie(data: any): Promise<SignalingMessage>;
|
|
104
|
+
updateRooms(rooms: SignalingMessage.Room[], assignRandomly: boolean): Promise<SignalingMessage>;
|
|
105
|
+
activateRooms(roomIds: number[], deactivate: boolean): Promise<SignalingMessage>;
|
|
106
|
+
switchRoom(toRoomId?: number, participantId?: ParticipantId): Promise<SignalingMessage>;
|
|
107
|
+
removeRooms(roomIds: number[]): Promise<SignalingMessage>;
|
|
103
108
|
startStream(data: any): Promise<SignalingMessage>;
|
|
104
109
|
stopStream(): Promise<SignalingMessage>;
|
|
105
110
|
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
@@ -112,6 +117,7 @@ export default class Signaling extends BaseSignaling {
|
|
|
112
117
|
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
113
118
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
114
119
|
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
|
|
120
|
+
enableFeatureForRoles(feature: ConversationFeature, roles: UserRole[]): Promise<SignalingMessage>;
|
|
115
121
|
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
|
|
116
122
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
117
123
|
changeOptions(changes: {
|
|
@@ -4,7 +4,8 @@
|
|
|
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"
|
|
8
9
|
}
|
|
9
10
|
export default ConversationOption;
|
|
10
11
|
export declare function compareOptions(oldOptions: ConversationOption[], newOptions: ConversationOption[]): boolean;
|
package/enums/HangupType.d.ts
CHANGED
|
@@ -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;
|
package/enums/MediaOption.d.ts
CHANGED
|
@@ -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,12 @@ 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
|
+
GET_ROOMS = "get_rooms",
|
|
40
|
+
GET_ROOM = "get_room",
|
|
41
|
+
UPDATE_ROOMS = "update-rooms",
|
|
42
|
+
ACTIVATE_ROOMS = "activate-rooms",
|
|
43
|
+
REMOVE_ROOMS = "remove-rooms",
|
|
44
|
+
SWITCH_ROOM = "switch-room"
|
|
38
45
|
}
|
|
39
46
|
export default SignalingCommandType;
|
|
@@ -39,6 +39,9 @@ declare enum SignalingNotification {
|
|
|
39
39
|
MOVIE_UPDATE_NOTIFICATION = "movie-update-notification",
|
|
40
40
|
MOVIE_SHARE_INFO = "movie-share-info",
|
|
41
41
|
MOVIE_SHARE_STARTED = "movie-share-started",
|
|
42
|
-
MOVIE_SHARE_STOPPED = "movie-share-stopped"
|
|
42
|
+
MOVIE_SHARE_STOPPED = "movie-share-stopped",
|
|
43
|
+
ROOM_UPDATED = "room-updated",
|
|
44
|
+
ROOMS_UPDATED = "rooms-updated",
|
|
45
|
+
ROOM_PARTICIPANTS_UPDATED = "room-participants-updated"
|
|
43
46
|
}
|
|
44
47
|
export default SignalingNotification;
|
package/package.json
CHANGED
package/static/External.d.ts
CHANGED
|
@@ -6,13 +6,15 @@ import ChatRoomEventType from '../enums/ChatRoomEventType';
|
|
|
6
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
7
7
|
import FatalError from '../enums/FatalError';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
|
+
import RoomsEventType from '../enums/RoomsEventType';
|
|
9
10
|
import UserRole from '../enums/UserRole';
|
|
10
11
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
|
|
11
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
12
13
|
import MediaSettings from '../types/MediaSettings';
|
|
13
|
-
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
14
|
+
import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
14
15
|
import MuteStates from '../types/MuteStates';
|
|
15
16
|
import { ParticipantStateMapped } from '../types/Participant';
|
|
17
|
+
import { Room, RoomParticipantUpdate, RoomsUpdate } from '../types/Room';
|
|
16
18
|
import { DebugMessageType } from './Debug';
|
|
17
19
|
import { JSONObject } from './Json';
|
|
18
20
|
/**
|
|
@@ -73,19 +75,17 @@ declare namespace External {
|
|
|
73
75
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
74
76
|
*
|
|
75
77
|
* @param userId
|
|
76
|
-
* @param
|
|
77
|
-
* @param stream
|
|
78
|
+
* @param data
|
|
78
79
|
*/
|
|
79
|
-
function onRemoteLive(userId: ExternalParticipantId,
|
|
80
|
+
function onRemoteLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
|
|
80
81
|
/**
|
|
81
82
|
* Получен собственный стрим лайв.
|
|
82
83
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
83
84
|
*
|
|
84
85
|
* @param userId
|
|
85
|
-
* @param
|
|
86
|
-
* @param stream
|
|
86
|
+
* @param data
|
|
87
87
|
*/
|
|
88
|
-
function onLocalLive(userId: ExternalParticipantId,
|
|
88
|
+
function onLocalLive(userId: ExternalParticipantId, data: IOnRemoteMovieData): void;
|
|
89
89
|
/**
|
|
90
90
|
* Получено обновление стрима или лайва от собеседника.
|
|
91
91
|
*
|
|
@@ -116,7 +116,7 @@ declare namespace External {
|
|
|
116
116
|
* @param muteStates Состояние устройств при входе в звонок
|
|
117
117
|
* @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
|
|
118
118
|
*/
|
|
119
|
-
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
|
|
119
|
+
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[], rooms?: Room[]): void;
|
|
120
120
|
/**
|
|
121
121
|
* Постраничные данные про участников при начале звонка
|
|
122
122
|
* @param chunk
|
|
@@ -246,8 +246,10 @@ declare namespace External {
|
|
|
246
246
|
* @param unmute Разрешение включить устройство
|
|
247
247
|
* @param userId Пользователь, для которого изменились разрешения или `null` для текущего пользователя
|
|
248
248
|
* @param adminId Пользователь, который изменил разрешения
|
|
249
|
+
* @param stateUpdated Если `true`, значит глобальное/персональное состояние изменилось и поля `muteStates`/`unmuteOptions` содержат обновления, если `false`, значит, эти поля не имеют значения
|
|
250
|
+
* @param requestedMedia Какие устройства попросили влючить участника
|
|
249
251
|
*/
|
|
250
|
-
function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null): void;
|
|
252
|
+
function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]): void;
|
|
251
253
|
/**
|
|
252
254
|
* Изменились роли собеседника в звонке
|
|
253
255
|
*
|
|
@@ -412,5 +414,14 @@ declare namespace External {
|
|
|
412
414
|
* @param joinLink токен присоединения к звонку
|
|
413
415
|
*/
|
|
414
416
|
function onJoinLinkChanged(joinLink: string): void;
|
|
417
|
+
/**
|
|
418
|
+
*/
|
|
419
|
+
function onRoomsUpdated(updates: Partial<Record<RoomsEventType, RoomsUpdate>>): void;
|
|
420
|
+
/**
|
|
421
|
+
*/
|
|
422
|
+
function onRoomUpdated(eventTypes: RoomsEventType[], roomId: number, room: Room | null): void;
|
|
423
|
+
/**
|
|
424
|
+
*/
|
|
425
|
+
function onRoomParticipantsUpdated(update: RoomParticipantUpdate): void;
|
|
415
426
|
}
|
|
416
427
|
export default External;
|
package/static/Params.d.ts
CHANGED
|
@@ -6,14 +6,16 @@ import ChatRoomEventType from '../enums/ChatRoomEventType';
|
|
|
6
6
|
import ConversationOption from '../enums/ConversationOption';
|
|
7
7
|
import FatalError from '../enums/FatalError';
|
|
8
8
|
import MediaOption from '../enums/MediaOption';
|
|
9
|
+
import RoomsEventType from '../enums/RoomsEventType';
|
|
9
10
|
import UserRole from '../enums/UserRole';
|
|
10
11
|
import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, ExternalParticipantListMarkers } from '../types/ExternalId';
|
|
11
12
|
import IceServer from '../types/IceServer';
|
|
12
13
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
14
|
import MediaSettings from '../types/MediaSettings';
|
|
14
|
-
import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
15
|
+
import { IOnRemoteMovieData, ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
|
|
15
16
|
import MuteStates from '../types/MuteStates';
|
|
16
17
|
import { ParticipantStateMapped } from '../types/Participant';
|
|
18
|
+
import { Room, RoomParticipantUpdate, RoomsUpdate } from '../types/Room';
|
|
17
19
|
import AuthData from './AuthData';
|
|
18
20
|
import { DebugMessageType } from './Debug';
|
|
19
21
|
import { ParticipantStatus } from './External';
|
|
@@ -25,6 +27,7 @@ import { FacingMode } from './WebRTCUtils';
|
|
|
25
27
|
export declare type ParamsObject = {
|
|
26
28
|
platform: string;
|
|
27
29
|
clientType: string;
|
|
30
|
+
externalUserType: string;
|
|
28
31
|
device: string;
|
|
29
32
|
/**
|
|
30
33
|
* API ключ приложения
|
|
@@ -44,6 +47,11 @@ export declare type ParamsObject = {
|
|
|
44
47
|
* Домен, чтобы попасть в тестовую группу. Для тестирования экспериментальных улучшений существуют отдельные сервера, чтобы собирать фидбек и уже потом раскатывать на всех юзеров. Если передать сюда специальный ключ, то конверсейшн будет обрабатываться на таком сервере.
|
|
45
48
|
*/
|
|
46
49
|
domain: string;
|
|
50
|
+
/**
|
|
51
|
+
* Домен, куда будет ходить Ok api за данными
|
|
52
|
+
* @hidden
|
|
53
|
+
*/
|
|
54
|
+
externalDomain: string;
|
|
47
55
|
iceServers: IceServer[];
|
|
48
56
|
wssBase: string;
|
|
49
57
|
wssToken: string;
|
|
@@ -231,6 +239,10 @@ export declare type ParamsObject = {
|
|
|
231
239
|
* Включить постраничный вывод участников. Работает только если включено videoTracksCount (слоты)
|
|
232
240
|
*/
|
|
233
241
|
useParticipantListChunk: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* Включить комнаты
|
|
244
|
+
*/
|
|
245
|
+
useRooms: boolean;
|
|
234
246
|
/**
|
|
235
247
|
* Индекс участника для первого chunk'а который придет при установки соединения с сервером
|
|
236
248
|
*/
|
|
@@ -248,6 +260,11 @@ export declare type ParamsObject = {
|
|
|
248
260
|
* Включать RED-extension (redundancy) для p2p звонков
|
|
249
261
|
*/
|
|
250
262
|
p2pAudioRed: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Добавлять флаг spsPpsIdrInKeyframe для h264 кодека. В результате ключевые фреймы без sps и pps
|
|
265
|
+
* не используются как ключевые. Решает проблему с артефактами на видео в случае потерь пакетов.
|
|
266
|
+
*/
|
|
267
|
+
h264spsPpsIdrInKeyframe: boolean;
|
|
251
268
|
/**
|
|
252
269
|
* Получать список участников звонка третьим аргументом в `onConversation`
|
|
253
270
|
* @hidden
|
|
@@ -301,12 +318,12 @@ export declare type ParamsObject = {
|
|
|
301
318
|
* Получен стрим трансляция или мувик от собеседника.
|
|
302
319
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
303
320
|
*/
|
|
304
|
-
onRemoteLive?: (userId: ExternalParticipantId,
|
|
321
|
+
onRemoteLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
|
|
305
322
|
/**
|
|
306
323
|
* Получен собственный стрим трансляция или мувик.
|
|
307
324
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
308
325
|
*/
|
|
309
|
-
onLocalLive?: (userId: ExternalParticipantId,
|
|
326
|
+
onLocalLive?: (userId: ExternalParticipantId, data: IOnRemoteMovieData) => void;
|
|
310
327
|
/**
|
|
311
328
|
* Получено обновление стрима или лайва от собеседника.
|
|
312
329
|
*/
|
|
@@ -318,7 +335,7 @@ export declare type ParamsObject = {
|
|
|
318
335
|
/**
|
|
319
336
|
* Начат звонок
|
|
320
337
|
*/
|
|
321
|
-
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
|
|
338
|
+
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[], rooms?: Room[]) => void;
|
|
322
339
|
/**
|
|
323
340
|
* Начальный список участников для постраничного звонка
|
|
324
341
|
*/
|
|
@@ -391,7 +408,7 @@ export declare type ParamsObject = {
|
|
|
391
408
|
/**
|
|
392
409
|
* Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
|
|
393
410
|
*/
|
|
394
|
-
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
|
|
411
|
+
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null, stateUpdated?: boolean, requestedMedia?: MediaOption[]) => void;
|
|
395
412
|
/**
|
|
396
413
|
* Изменились роли собеседника в звонке
|
|
397
414
|
*/
|
|
@@ -512,6 +529,15 @@ export declare type ParamsObject = {
|
|
|
512
529
|
* @param joinLink токен присоединения к звонку
|
|
513
530
|
*/
|
|
514
531
|
onJoinLinkChanged?: (joinLink: string) => void;
|
|
532
|
+
/**
|
|
533
|
+
*/
|
|
534
|
+
onRoomsUpdated?: (updates: Partial<Record<RoomsEventType, RoomsUpdate>>) => void;
|
|
535
|
+
/**
|
|
536
|
+
*/
|
|
537
|
+
onRoomUpdated?: (eventTypes: RoomsEventType[], roomId: number, room: Room | null) => void;
|
|
538
|
+
/**
|
|
539
|
+
*/
|
|
540
|
+
onRoomParticipantsUpdated?: (update: RoomParticipantUpdate) => void;
|
|
515
541
|
};
|
|
516
542
|
export default abstract class Params {
|
|
517
543
|
private static _params;
|
|
@@ -528,6 +554,8 @@ export default abstract class Params {
|
|
|
528
554
|
static set platform(value: string);
|
|
529
555
|
static get clientType(): string;
|
|
530
556
|
static set clientType(value: string);
|
|
557
|
+
static get externalUserType(): string;
|
|
558
|
+
static set externalUserType(value: string);
|
|
531
559
|
static get device(): string;
|
|
532
560
|
static get apiKey(): string;
|
|
533
561
|
static get apiEnv(): string;
|
|
@@ -537,6 +565,7 @@ export default abstract class Params {
|
|
|
537
565
|
static get anonymToken(): string;
|
|
538
566
|
static set anonymToken(value: string);
|
|
539
567
|
static get domain(): string;
|
|
568
|
+
static get externalDomain(): string;
|
|
540
569
|
static get iceServers(): IceServer[];
|
|
541
570
|
static set iceServers(value: IceServer[]);
|
|
542
571
|
static get wssBase(): string;
|
|
@@ -601,10 +630,12 @@ export default abstract class Params {
|
|
|
601
630
|
static get breakVideoPayloadTypes(): boolean;
|
|
602
631
|
static get filteredMessages(): boolean;
|
|
603
632
|
static get useParticipantListChunk(): boolean;
|
|
633
|
+
static get useRooms(): boolean;
|
|
604
634
|
static get participantListChunkInitIndex(): number;
|
|
605
635
|
static get participantListChunkInitCount(): number;
|
|
606
636
|
static get serverAudioRed(): boolean;
|
|
607
637
|
static get p2pAudioRed(): boolean;
|
|
638
|
+
static get h264spsPpsIdrInKeyframe(): boolean;
|
|
608
639
|
static get batchParticipantsOnStart(): boolean;
|
|
609
640
|
static get filterObservers(): boolean;
|
|
610
641
|
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 objectReduce<R, T extends Object>(obj: T, callback: (acc: R, value: T[keyof T], key: keyof T) => R, initialValue: R): R;
|
|
65
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
|
+
}
|
package/types/MovieShare.d.ts
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { OkUserId, CompositeUserId } from './Participant';
|
|
2
2
|
import { MediaType } from './ParticipantStreamDescription';
|
|
3
|
+
export interface IMoviePreview {
|
|
4
|
+
url: string;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
}
|
|
3
8
|
export interface IAddMovieParams {
|
|
4
9
|
movieId: string;
|
|
5
10
|
gain?: number;
|
|
11
|
+
metadata?: {
|
|
12
|
+
title?: string;
|
|
13
|
+
thumbnails?: IMoviePreview[];
|
|
14
|
+
};
|
|
6
15
|
}
|
|
7
16
|
export declare type ISharedMovieStateResponse = [number, number, boolean, number, number];
|
|
8
17
|
export interface ISharedMovieState {
|
|
@@ -19,14 +28,15 @@ export interface ISharedMovieInfo {
|
|
|
19
28
|
source: MediaType;
|
|
20
29
|
externalMovieId: string;
|
|
21
30
|
duration: number;
|
|
22
|
-
|
|
23
|
-
thumbnailMedium: string;
|
|
24
|
-
thumbnailBig: string;
|
|
25
|
-
thumbnailHigh: string;
|
|
26
|
-
thumbnailHd: string;
|
|
31
|
+
thumbnails: IMoviePreview[];
|
|
27
32
|
}
|
|
28
33
|
export interface ISharedMovieStoppedInfo {
|
|
29
34
|
movieId: OkUserId;
|
|
30
35
|
initiatorId: CompositeUserId;
|
|
31
36
|
source: MediaType;
|
|
32
37
|
}
|
|
38
|
+
export interface IOnRemoteMovieData {
|
|
39
|
+
streamName: string;
|
|
40
|
+
stream: MediaStream | null;
|
|
41
|
+
mediaType: MediaType;
|
|
42
|
+
}
|
|
@@ -10,4 +10,6 @@ export interface ParticipantListChunkParameters {
|
|
|
10
10
|
backward?: boolean;
|
|
11
11
|
/** If true then resulting chunk will start from Participant with specified marker, if such Participant (still) exists */
|
|
12
12
|
includeMarker?: boolean;
|
|
13
|
+
/** optional, id of the room to get chunk for, main call if unspecified */
|
|
14
|
+
roomId?: number;
|
|
13
15
|
}
|
package/types/Room.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
|
|
2
|
+
import { Participant, ParticipantListMarkers } from './Participant';
|
|
3
|
+
export interface Room {
|
|
4
|
+
id: number;
|
|
5
|
+
/**
|
|
6
|
+
* name of this room
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* count of participants (read/write, optional)
|
|
11
|
+
*/
|
|
12
|
+
participantCount: number;
|
|
13
|
+
/**
|
|
14
|
+
* ids of all participants (read/write, optional)
|
|
15
|
+
*/
|
|
16
|
+
participantIds: ExternalParticipantId[];
|
|
17
|
+
/**
|
|
18
|
+
* ids of participants to be added to this room (read/write, optional)
|
|
19
|
+
*/
|
|
20
|
+
addParticipantIds?: ExternalParticipantId[];
|
|
21
|
+
/**
|
|
22
|
+
* ids of participants to be removed from this room (read/write, optional)
|
|
23
|
+
*/
|
|
24
|
+
removeParticipantIds?: ExternalParticipantId[];
|
|
25
|
+
/**
|
|
26
|
+
* if participant requested then contains first chunk of participants in this rooms
|
|
27
|
+
* (if client fails to support chunks, then contains all participant in this room)
|
|
28
|
+
* (read, optional)
|
|
29
|
+
*/
|
|
30
|
+
participants?: ExternalParticipantListChunk;
|
|
31
|
+
/**
|
|
32
|
+
* if this room is active (read/write, optional)
|
|
33
|
+
*/
|
|
34
|
+
active?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface RoomsUpdate {
|
|
37
|
+
rooms?: Room[];
|
|
38
|
+
roomIds?: number[];
|
|
39
|
+
}
|
|
40
|
+
export interface RoomParticipantUpdate {
|
|
41
|
+
roomId: number;
|
|
42
|
+
/**
|
|
43
|
+
* total number of participants in the room
|
|
44
|
+
*/
|
|
45
|
+
participantCount: number;
|
|
46
|
+
/**
|
|
47
|
+
* ids of added participants, always present (if any) so participants would be able
|
|
48
|
+
* to identify their presence in particular room
|
|
49
|
+
*/
|
|
50
|
+
addedParticipantIds?: ExternalParticipantId[];
|
|
51
|
+
/**
|
|
52
|
+
* optional, data for added participants
|
|
53
|
+
*/
|
|
54
|
+
addedParticipants?: Participant[];
|
|
55
|
+
/**
|
|
56
|
+
* optional, depending on the context may contain either markers
|
|
57
|
+
* for all (sorted) lists available or be empty (if client fails to support chunked participants)
|
|
58
|
+
*/
|
|
59
|
+
removedParticipantMarkers?: ParticipantListMarkers;
|
|
60
|
+
}
|