@vkontakte/calls-sdk 2.5.2-beta.1 → 2.5.2-dev.6d2efd4.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 +9 -9
- package/abstract/BaseSignaling.d.ts +7 -7
- package/calls-sdk.cjs.js +8 -8
- package/calls-sdk.esm.js +8 -8
- package/classes/Conversation.d.ts +13 -12
- package/classes/DebugInfo.d.ts +2 -2
- package/classes/SpeakerDetector.d.ts +2 -2
- package/classes/SpecListener.d.ts +3 -3
- package/classes/screenshare/BaseStreamBuilder.d.ts +3 -3
- package/classes/screenshare/ScreenCaptureReceiver.d.ts +2 -2
- package/classes/screenshare/StreamBuilder.d.ts +2 -2
- package/classes/screenshare/WebmBuilder.d.ts +2 -2
- package/classes/transport/DirectTransport.d.ts +2 -2
- package/classes/transport/ServerTransport.d.ts +2 -2
- package/classes/transport/Statistics.d.ts +2 -2
- package/classes/transport/Transport.d.ts +5 -5
- package/default/Api.d.ts +1 -1
- package/default/Signaling.d.ts +7 -7
- package/package.json +1 -1
- package/static/External.d.ts +18 -18
- package/static/Params.d.ts +21 -20
- package/static/Utils.d.ts +12 -4
- package/types/ConversationParams.d.ts +1 -0
- package/types/ConversationResponse.d.ts +4 -0
- package/types/ExternalId.d.ts +17 -1
- package/types/Participant.d.ts +11 -3
- package/types/ParticipantLayout.d.ts +2 -2
- package/types/ParticipantPriority.d.ts +3 -3
- package/types/ParticipantStreamDescription.d.ts +2 -2
- package/types/SignalingMessage.d.ts +25 -17
|
@@ -12,11 +12,11 @@ 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 {
|
|
15
|
+
import { ExternalParticipantId } from '../types/ExternalId';
|
|
16
16
|
import MediaModifiers from '../types/MediaModifiers';
|
|
17
17
|
import { IVideoDimentions } from '../types/MediaSettings';
|
|
18
18
|
import MuteStates from '../types/MuteStates';
|
|
19
|
-
import { CompositeUserId, OkUserId } from '../types/Participant';
|
|
19
|
+
import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
|
|
20
20
|
import { ParticipantLayout } from '../types/ParticipantLayout';
|
|
21
21
|
import ParticipantPriority from '../types/ParticipantPriority';
|
|
22
22
|
import { ParticipantStreamDescription } from '../types/ParticipantStreamDescription';
|
|
@@ -29,8 +29,8 @@ import { TransportTopology } from './transport/Transport';
|
|
|
29
29
|
*/
|
|
30
30
|
export declare type ConversationData = {
|
|
31
31
|
userId: OkUserId;
|
|
32
|
-
compositeUserId:
|
|
33
|
-
externalId:
|
|
32
|
+
compositeUserId: ParticipantId;
|
|
33
|
+
externalId: ExternalParticipantId;
|
|
34
34
|
/**
|
|
35
35
|
* Время принятия звонка
|
|
36
36
|
*/
|
|
@@ -55,7 +55,7 @@ export declare type ConversationData = {
|
|
|
55
55
|
* Токен комнаты для подключения к звонку по ссылке
|
|
56
56
|
*/
|
|
57
57
|
joinLink?: string;
|
|
58
|
-
pinnedParticipantId:
|
|
58
|
+
pinnedParticipantId: ParticipantId | null;
|
|
59
59
|
mediaModifiers: MediaModifiers;
|
|
60
60
|
options: ConversationOption[];
|
|
61
61
|
muteStates: MuteStates;
|
|
@@ -139,7 +139,7 @@ export default class Conversation extends EventEmitter {
|
|
|
139
139
|
*/
|
|
140
140
|
private _prepareConversation;
|
|
141
141
|
private _createParticipant;
|
|
142
|
-
private
|
|
142
|
+
private _getParticipantId;
|
|
143
143
|
private _setConversation;
|
|
144
144
|
private _updateConversation;
|
|
145
145
|
private _createMediaSource;
|
|
@@ -194,8 +194,8 @@ export default class Conversation extends EventEmitter {
|
|
|
194
194
|
private _isCallAdmin;
|
|
195
195
|
private _checkAdminRole;
|
|
196
196
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<void>;
|
|
197
|
-
muteParticipant(participantId:
|
|
198
|
-
pinParticipant(participantId:
|
|
197
|
+
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia?: MediaOption[]): Promise<void>;
|
|
198
|
+
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<void>;
|
|
199
199
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<void>;
|
|
200
200
|
changeOptions(changes: {
|
|
201
201
|
[key in ConversationOption]?: boolean;
|
|
@@ -208,7 +208,7 @@ export default class Conversation extends EventEmitter {
|
|
|
208
208
|
promoteParticipant(participantId: CompositeUserId, demote?: boolean): Promise<void>;
|
|
209
209
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<void>;
|
|
210
210
|
chatHistory(count: number): Promise<void>;
|
|
211
|
-
customData(data: JSONObject, participantId?:
|
|
211
|
+
customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
|
|
212
212
|
createJoinLink(): Promise<string>;
|
|
213
213
|
removeJoinLink(): Promise<never>;
|
|
214
214
|
addMovie(movieId: string): Promise<{
|
|
@@ -219,7 +219,7 @@ export default class Conversation extends EventEmitter {
|
|
|
219
219
|
removeMovie(movieId: string): Promise<void>;
|
|
220
220
|
startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
|
|
221
221
|
stopStream(): Promise<SignalingMessage>;
|
|
222
|
-
recordSetRole(participantId:
|
|
222
|
+
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<void>;
|
|
223
223
|
getStreamInfo(): Promise<{
|
|
224
224
|
movieId: any;
|
|
225
225
|
preview: any;
|
|
@@ -232,6 +232,7 @@ export default class Conversation extends EventEmitter {
|
|
|
232
232
|
private _onScreenSharingStatus;
|
|
233
233
|
private _changeRemoteMediaSettings;
|
|
234
234
|
private _changeRemoteParticipantState;
|
|
235
|
+
private _invokeRolesChangedCallbackIfNeeded;
|
|
235
236
|
private _onSignalingNotification;
|
|
236
237
|
private _onSignalingReconnect;
|
|
237
238
|
private _onSignalingFailed;
|
|
@@ -286,11 +287,11 @@ export default class Conversation extends EventEmitter {
|
|
|
286
287
|
}
|
|
287
288
|
export declare class UpdateDisplayLayoutError extends Error {
|
|
288
289
|
readonly participantErrors: {
|
|
289
|
-
externalId:
|
|
290
|
+
externalId: ExternalParticipantId;
|
|
290
291
|
errorReason: UpdateDisplayLayoutErrorReason;
|
|
291
292
|
}[];
|
|
292
293
|
constructor(m: string, participantErrors: {
|
|
293
|
-
externalId:
|
|
294
|
+
externalId: ExternalParticipantId;
|
|
294
295
|
errorReason: UpdateDisplayLayoutErrorReason;
|
|
295
296
|
}[]);
|
|
296
297
|
}
|
package/classes/DebugInfo.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Participant, ParticipantId } from '../types/Participant';
|
|
2
2
|
import EventEmitter from './EventEmitter';
|
|
3
3
|
import { StatResult } from './transport/Statistics';
|
|
4
4
|
export default class DebugInfo extends EventEmitter {
|
|
5
5
|
private _lastMemoryStat;
|
|
6
|
-
onRemoteDataStats(stats: StatResult, participants: Record<
|
|
6
|
+
onRemoteDataStats(stats: StatResult, participants: Record<ParticipantId, Participant>): void;
|
|
7
7
|
_calcMemory(): void;
|
|
8
8
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from '../types/Participant';
|
|
2
2
|
import EventEmitter from './EventEmitter';
|
|
3
3
|
import { Transport } from './transport/Transport';
|
|
4
4
|
import { VolumeLevel } from './VolumeDetector';
|
|
@@ -14,7 +14,7 @@ export declare class SpeakerDetector extends EventEmitter {
|
|
|
14
14
|
_onVolumesDetected(volumes: {
|
|
15
15
|
[key: string]: VolumeLevel;
|
|
16
16
|
}): void;
|
|
17
|
-
_onServerSpeakerChanged(speakerId:
|
|
17
|
+
_onServerSpeakerChanged(speakerId: ParticipantId): void;
|
|
18
18
|
_onReceivedServerAudioActivity(): void;
|
|
19
19
|
_onStoppedReceivingServerAudioActivity(): void;
|
|
20
20
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import MediaSettings from '../types/MediaSettings';
|
|
2
|
-
import {
|
|
2
|
+
import { Participant, ParticipantId } from '../types/Participant';
|
|
3
3
|
import EventEmitter from './EventEmitter';
|
|
4
4
|
import { Transport } from './transport/Transport';
|
|
5
5
|
import { VolumesDetector } from './VolumesDetector';
|
|
@@ -10,9 +10,9 @@ export default class SpecListener extends EventEmitter {
|
|
|
10
10
|
private readonly _participants;
|
|
11
11
|
private _connectionTimeout;
|
|
12
12
|
private _volumeTimeout;
|
|
13
|
-
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<
|
|
13
|
+
constructor(transport: Transport, volumesDetector: VolumesDetector, participants: Record<ParticipantId, Participant>);
|
|
14
14
|
destroy(): void;
|
|
15
|
-
onChangeRemoteMediaSettings(participantId:
|
|
15
|
+
onChangeRemoteMediaSettings(participantId: ParticipantId, mediaSettings: MediaSettings): void;
|
|
16
16
|
private _onTransportStateChanged;
|
|
17
17
|
private _onVolumesDetected;
|
|
18
18
|
private _onConnectionTimeout;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from '../../types/Participant';
|
|
2
2
|
import { FrameChunk } from './Utils';
|
|
3
3
|
export declare abstract class BaseStreamBuilder {
|
|
4
|
-
protected readonly _participantId:
|
|
4
|
+
protected readonly _participantId: ParticipantId;
|
|
5
5
|
protected readonly _onStream: (stream: MediaStream) => void;
|
|
6
6
|
protected _chunks: FrameChunk[];
|
|
7
|
-
protected constructor(participantId:
|
|
7
|
+
protected constructor(participantId: ParticipantId, onStream: (stream: MediaStream) => void);
|
|
8
8
|
appendChunk(chunk: FrameChunk): void;
|
|
9
9
|
destroy(): void;
|
|
10
10
|
protected abstract _processFrame(frame: FrameData): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from '../../types/Participant';
|
|
2
2
|
import { ParticipantIdRegistry } from '../ParticipantIdRegistry';
|
|
3
3
|
export default class ScreenCaptureReceiver {
|
|
4
4
|
private readonly _datachannel;
|
|
@@ -8,7 +8,7 @@ export default class ScreenCaptureReceiver {
|
|
|
8
8
|
private _onEos;
|
|
9
9
|
constructor(datachannel: RTCDataChannel, participantIdRegistry: ParticipantIdRegistry, onStream: (streamId: string, stream: MediaStream) => void, onEos: (streamId: string) => void);
|
|
10
10
|
private _onDataChannelMessage;
|
|
11
|
-
close(participantId:
|
|
11
|
+
close(participantId: ParticipantId): void;
|
|
12
12
|
destroy(): void;
|
|
13
13
|
static isBrowserSupported(): boolean;
|
|
14
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from '../../types/Participant';
|
|
2
2
|
import { BaseStreamBuilder, FrameData } from './BaseStreamBuilder';
|
|
3
3
|
export default class StreamBuilder extends BaseStreamBuilder {
|
|
4
4
|
private readonly _decoder;
|
|
@@ -9,7 +9,7 @@ export default class StreamBuilder extends BaseStreamBuilder {
|
|
|
9
9
|
private _canvasContext;
|
|
10
10
|
private _stream;
|
|
11
11
|
private _track;
|
|
12
|
-
constructor(participantId:
|
|
12
|
+
constructor(participantId: ParticipantId, onStream: (stream: MediaStream) => void);
|
|
13
13
|
private _createStream;
|
|
14
14
|
private _removeStream;
|
|
15
15
|
private _requestCanvasFrame;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ParticipantId } from '../../types/Participant';
|
|
2
2
|
import { BaseStreamBuilder, FrameData } from './BaseStreamBuilder';
|
|
3
3
|
export default class WebmBuilder extends BaseStreamBuilder {
|
|
4
4
|
private _mediaBuffer;
|
|
@@ -7,7 +7,7 @@ export default class WebmBuilder extends BaseStreamBuilder {
|
|
|
7
7
|
private _earliestTimestamp;
|
|
8
8
|
private _clusterStartTime;
|
|
9
9
|
private _lastFrameTimestamp;
|
|
10
|
-
constructor(participantId:
|
|
10
|
+
constructor(participantId: ParticipantId, onStream: (stream: MediaStream) => void);
|
|
11
11
|
private static _intToU16BE;
|
|
12
12
|
private static _genWebmHeader;
|
|
13
13
|
private static _genSegmentHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../../types/Participant';
|
|
3
3
|
import ServerSettings from '../../types/ServerSettings';
|
|
4
4
|
import EventEmitter from '../EventEmitter';
|
|
5
5
|
import { MediaSource } from '../MediaSource';
|
|
@@ -31,7 +31,7 @@ export default class DirectTransport extends EventEmitter {
|
|
|
31
31
|
private _remoteNetworkStat;
|
|
32
32
|
private _networkLimits;
|
|
33
33
|
private _perfStatReporter;
|
|
34
|
-
constructor(participantId:
|
|
34
|
+
constructor(participantId: ParticipantId, isMaster: boolean, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
35
35
|
getState(): TransportState;
|
|
36
36
|
updateStatisticsInterval(): void;
|
|
37
37
|
open(peerId?: string | null): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../../types/Participant';
|
|
3
3
|
import ServerSettings from '../../types/ServerSettings';
|
|
4
4
|
import SignalingMessage from '../../types/SignalingMessage';
|
|
5
5
|
import EventEmitter from '../EventEmitter';
|
|
@@ -37,7 +37,7 @@ export default class ServerTransport extends EventEmitter {
|
|
|
37
37
|
updateStatisticsInterval(): void;
|
|
38
38
|
open(): void;
|
|
39
39
|
close(error?: Error): void;
|
|
40
|
-
removeParticipant(participantId:
|
|
40
|
+
removeParticipant(participantId: ParticipantId): void;
|
|
41
41
|
preventRestart(): void;
|
|
42
42
|
allowRestart(): void;
|
|
43
43
|
updateSettings(settings: ServerSettings): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExternalParticipantId } from '../../types/ExternalId';
|
|
2
2
|
import { TransportTopology } from './Transport';
|
|
3
3
|
export declare type StatTransport = {
|
|
4
4
|
totalRoundTripTime: number;
|
|
@@ -20,7 +20,7 @@ export declare type StatRtp = {
|
|
|
20
20
|
pliCount: number;
|
|
21
21
|
firCount: number;
|
|
22
22
|
nackCount: number;
|
|
23
|
-
userId?: string |
|
|
23
|
+
userId?: string | ExternalParticipantId;
|
|
24
24
|
bandwidth?: number;
|
|
25
25
|
packetLoss?: number;
|
|
26
26
|
clockRate?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BaseSignaling from '../../abstract/BaseSignaling';
|
|
2
|
-
import {
|
|
2
|
+
import { ParticipantId } from '../../types/Participant';
|
|
3
3
|
import ServerSettings from '../../types/ServerSettings';
|
|
4
4
|
import EventEmitter from '../EventEmitter';
|
|
5
5
|
import { MediaSource } from '../MediaSource';
|
|
@@ -48,12 +48,12 @@ export declare class Transport extends EventEmitter {
|
|
|
48
48
|
constructor(topology: TransportTopology, signaling: BaseSignaling, mediaSource: MediaSource, serverSettings: ServerSettings);
|
|
49
49
|
updateSettings(settings: ServerSettings): void;
|
|
50
50
|
updateStatisticsInterval(): void;
|
|
51
|
-
allocate(participantId:
|
|
52
|
-
open(participantIds:
|
|
53
|
-
close(participantId:
|
|
51
|
+
allocate(participantId: ParticipantId, isMaster?: boolean): void;
|
|
52
|
+
open(participantIds: ParticipantId[], peerId?: string | null): void;
|
|
53
|
+
close(participantId: ParticipantId): void;
|
|
54
54
|
destroy(): void;
|
|
55
55
|
getTopology(): TransportTopology;
|
|
56
|
-
isAllocated(participantId:
|
|
56
|
+
isAllocated(participantId: ParticipantId): boolean;
|
|
57
57
|
allocated(): string[];
|
|
58
58
|
opened(): string[];
|
|
59
59
|
private _setStates;
|
package/default/Api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export default class Api extends BaseApi {
|
|
|
10
10
|
private _externalUidsCache;
|
|
11
11
|
private _callUnsafe;
|
|
12
12
|
private _call;
|
|
13
|
-
userId(
|
|
13
|
+
userId(compositeUserId: CompositeUserId): Promise<ExternalId>;
|
|
14
14
|
prepareUserIds(ids: OkUserId[]): Promise<void>;
|
|
15
15
|
authorize(): Promise<void>;
|
|
16
16
|
log(items: LogItem[]): void;
|
package/default/Signaling.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ import { JSONObject } from '../static/Json';
|
|
|
12
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
14
14
|
import MuteStates from '../types/MuteStates';
|
|
15
|
-
import { CompositeUserId } from '../types/Participant';
|
|
15
|
+
import { CompositeUserId, ParticipantId } from '../types/Participant';
|
|
16
16
|
import SignalingMessage from '../types/SignalingMessage';
|
|
17
17
|
import { WaitingParticipantId } from '../types/WaitingHall';
|
|
18
18
|
export default class Signaling extends BaseSignaling {
|
|
@@ -71,9 +71,9 @@ export default class Signaling extends BaseSignaling {
|
|
|
71
71
|
private static _isDataChannelResponseRequired;
|
|
72
72
|
getNextCommandSequenceNumber(): number;
|
|
73
73
|
hangup(reason: string): Promise<SignalingMessage | void>;
|
|
74
|
-
sendCandidate(participantId:
|
|
74
|
+
sendCandidate(participantId: ParticipantId, candidate: RTCIceCandidate): Promise<SignalingMessage>;
|
|
75
75
|
requestTestMode(command: string): Promise<SignalingMessage>;
|
|
76
|
-
sendSdp(participantId:
|
|
76
|
+
sendSdp(participantId: ParticipantId, sdp: RTCSessionDescription): Promise<SignalingMessage>;
|
|
77
77
|
acceptCall(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
78
78
|
changeMediaSettings(mediaSettings: MediaSettings): Promise<SignalingMessage>;
|
|
79
79
|
changeParticipantState(state: {
|
|
@@ -96,17 +96,17 @@ export default class Signaling extends BaseSignaling {
|
|
|
96
96
|
removeMovie(data: any): Promise<SignalingMessage>;
|
|
97
97
|
startStream(data: any): Promise<SignalingMessage>;
|
|
98
98
|
stopStream(): Promise<SignalingMessage>;
|
|
99
|
-
recordSetRole(participantId:
|
|
99
|
+
recordSetRole(participantId: ParticipantId, role: RecordRole | null): Promise<SignalingMessage>;
|
|
100
100
|
getRecordStatus(): Promise<SignalingMessage>;
|
|
101
101
|
switchTopology(topology: TransportTopology, force?: boolean): Promise<SignalingMessage>;
|
|
102
102
|
requestRealloc(): Promise<SignalingMessage>;
|
|
103
103
|
reportPerfStat(report: PerfStatReport): Promise<SignalingMessage>;
|
|
104
104
|
chatMessage(message: string, participantId?: CompositeUserId | null): Promise<SignalingMessage>;
|
|
105
105
|
chatHistory(count: number): Promise<SignalingMessage>;
|
|
106
|
-
customData(data: JSONObject, participantId:
|
|
106
|
+
customData(data: JSONObject, participantId: ParticipantId | null): Promise<SignalingMessage>;
|
|
107
107
|
grantRoles(participantId: CompositeUserId, roles: UserRole[], revoke: boolean): Promise<SignalingMessage>;
|
|
108
|
-
muteParticipant(participantId:
|
|
109
|
-
pinParticipant(participantId:
|
|
108
|
+
muteParticipant(participantId: ParticipantId | null, muteStates: MuteStates, requestedMedia: MediaOption[]): Promise<SignalingMessage>;
|
|
109
|
+
pinParticipant(participantId: ParticipantId, unpin: boolean): Promise<SignalingMessage>;
|
|
110
110
|
updateMediaModifiers(mediaModifiers: MediaModifiers): Promise<SignalingMessage>;
|
|
111
111
|
changeOptions(changes: {
|
|
112
112
|
[key in ConversationOption]?: boolean;
|
package/package.json
CHANGED
package/static/External.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 } from '../types/ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
|
|
11
11
|
import MediaModifiers from '../types/MediaModifiers';
|
|
12
12
|
import MediaSettings from '../types/MediaSettings';
|
|
13
13
|
import MuteStates from '../types/MuteStates';
|
|
@@ -66,7 +66,7 @@ declare namespace External {
|
|
|
66
66
|
* @param userId
|
|
67
67
|
* @param stream
|
|
68
68
|
*/
|
|
69
|
-
function onRemoteStream(userId:
|
|
69
|
+
function onRemoteStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
|
|
70
70
|
/**
|
|
71
71
|
* Получен стрим лайв от собеседника.
|
|
72
72
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
@@ -75,7 +75,7 @@ declare namespace External {
|
|
|
75
75
|
* @param streamName
|
|
76
76
|
* @param stream
|
|
77
77
|
*/
|
|
78
|
-
function onRemoteLive(userId:
|
|
78
|
+
function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
|
|
79
79
|
/**
|
|
80
80
|
* Получен стрим с экрана собеседника.
|
|
81
81
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
@@ -83,7 +83,7 @@ declare namespace External {
|
|
|
83
83
|
* @param userId
|
|
84
84
|
* @param stream
|
|
85
85
|
*/
|
|
86
|
-
function onRemoteScreenStream(userId:
|
|
86
|
+
function onRemoteScreenStream(userId: ExternalParticipantId, stream: MediaStream | null): void;
|
|
87
87
|
/**
|
|
88
88
|
* Начат звонок
|
|
89
89
|
*
|
|
@@ -92,21 +92,21 @@ declare namespace External {
|
|
|
92
92
|
* @param muteStates Состояние устройств при входе в звонок
|
|
93
93
|
* @param participants Список участников звонка (при `Params.batchParticipantsOnStart = true`)
|
|
94
94
|
*/
|
|
95
|
-
function onConversation(userId:
|
|
95
|
+
function onConversation(userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]): void;
|
|
96
96
|
/**
|
|
97
97
|
* Изменились данные стрима собеседника
|
|
98
98
|
*
|
|
99
99
|
* @param userId
|
|
100
100
|
* @param mediaSettings
|
|
101
101
|
*/
|
|
102
|
-
function onRemoteMediaSettings(userId:
|
|
102
|
+
function onRemoteMediaSettings(userId: ExternalParticipantId, mediaSettings: MediaSettings): void;
|
|
103
103
|
/**
|
|
104
104
|
* Изменились данные состояний собеседника
|
|
105
105
|
*
|
|
106
106
|
* @param userId
|
|
107
107
|
* @param participantState
|
|
108
108
|
*/
|
|
109
|
-
function onRemoteParticipantState(userId:
|
|
109
|
+
function onRemoteParticipantState(userId: ExternalParticipantId, participantState: {
|
|
110
110
|
[key: string]: string;
|
|
111
111
|
} | ParticipantStateMapped): void;
|
|
112
112
|
/**
|
|
@@ -116,7 +116,7 @@ declare namespace External {
|
|
|
116
116
|
* @param status
|
|
117
117
|
* @param data
|
|
118
118
|
*/
|
|
119
|
-
function onRemoteStatus(userIds:
|
|
119
|
+
function onRemoteStatus(userIds: ExternalParticipantId[], status: ParticipantStatus, data?: any): void;
|
|
120
120
|
/**
|
|
121
121
|
* Изменился статус соединения собеседника
|
|
122
122
|
*
|
|
@@ -125,7 +125,7 @@ declare namespace External {
|
|
|
125
125
|
* @param data
|
|
126
126
|
* @deprecated
|
|
127
127
|
*/
|
|
128
|
-
function onParticipantStatus(userId:
|
|
128
|
+
function onParticipantStatus(userId: ExternalParticipantId, status: ParticipantStatus, data?: any): void;
|
|
129
129
|
/**
|
|
130
130
|
* Разрешения на доступы были запрошены в браузере
|
|
131
131
|
*/
|
|
@@ -141,7 +141,7 @@ declare namespace External {
|
|
|
141
141
|
*
|
|
142
142
|
* @param userId
|
|
143
143
|
*/
|
|
144
|
-
function onRemoteRemoved(userId:
|
|
144
|
+
function onRemoteRemoved(userId: ExternalParticipantId): void;
|
|
145
145
|
/**
|
|
146
146
|
* Изменилось состояние звонка
|
|
147
147
|
*
|
|
@@ -168,7 +168,7 @@ declare namespace External {
|
|
|
168
168
|
* @param userId Пользователь, для которого изменились разрешения или `null` для текущего пользователя
|
|
169
169
|
* @param adminId Пользователь, который изменил разрешения
|
|
170
170
|
*/
|
|
171
|
-
function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?:
|
|
171
|
+
function onMuteStates(muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll?: boolean, unmute?: boolean, userId?: ExternalParticipantId | null, adminId?: ExternalParticipantId | null): void;
|
|
172
172
|
/**
|
|
173
173
|
* Изменились роли собеседника в звонке
|
|
174
174
|
*
|
|
@@ -188,7 +188,7 @@ declare namespace External {
|
|
|
188
188
|
* @param userId Внешний ID пользователя
|
|
189
189
|
* @param unpin Открепить или закрепить
|
|
190
190
|
*/
|
|
191
|
-
function onPinnedParticipant(userId:
|
|
191
|
+
function onPinnedParticipant(userId: ExternalParticipantId, unpin: boolean): void;
|
|
192
192
|
/**
|
|
193
193
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
194
194
|
*
|
|
@@ -211,14 +211,14 @@ declare namespace External {
|
|
|
211
211
|
*
|
|
212
212
|
* @param userId
|
|
213
213
|
*/
|
|
214
|
-
function onSpeakerChanged(userId:
|
|
214
|
+
function onSpeakerChanged(userId: ExternalParticipantId): void;
|
|
215
215
|
/**
|
|
216
216
|
* Громкость собеседников
|
|
217
217
|
*
|
|
218
218
|
* @param volumes
|
|
219
219
|
*/
|
|
220
220
|
function onVolumesDetected(volumes: {
|
|
221
|
-
uid:
|
|
221
|
+
uid: ExternalParticipantId;
|
|
222
222
|
volume: number;
|
|
223
223
|
}[]): void;
|
|
224
224
|
/**
|
|
@@ -256,7 +256,7 @@ declare namespace External {
|
|
|
256
256
|
* @param from ID отправителя
|
|
257
257
|
* @param direct Личное сообщение или общее
|
|
258
258
|
*/
|
|
259
|
-
function onChatMessage(message: string, from:
|
|
259
|
+
function onChatMessage(message: string, from: ExternalParticipantId, direct?: boolean): void;
|
|
260
260
|
/**
|
|
261
261
|
* Получены данные от собеседника
|
|
262
262
|
*
|
|
@@ -264,7 +264,7 @@ declare namespace External {
|
|
|
264
264
|
* @param from ID отправителя
|
|
265
265
|
* @param direct Личное сообщение или общее
|
|
266
266
|
*/
|
|
267
|
-
function onCustomData(data: JSONObject, from:
|
|
267
|
+
function onCustomData(data: JSONObject, from: ExternalParticipantId, direct?: boolean): void;
|
|
268
268
|
/**
|
|
269
269
|
* Начата запись звонка
|
|
270
270
|
*
|
|
@@ -275,7 +275,7 @@ declare namespace External {
|
|
|
275
275
|
* @param externalMovieId Внешний ID ролика
|
|
276
276
|
* @param externalOwnerId Внешний ID пользователя/группы от которого ведётся трансляция
|
|
277
277
|
*/
|
|
278
|
-
function onRecordStarted(initiator:
|
|
278
|
+
function onRecordStarted(initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string): void;
|
|
279
279
|
/**
|
|
280
280
|
* Закончена запись звонка
|
|
281
281
|
*/
|
|
@@ -292,7 +292,7 @@ declare namespace External {
|
|
|
292
292
|
* @param status Оценки качества соединения участников от 0 до 1
|
|
293
293
|
*/
|
|
294
294
|
function onNetworkStatusChanged(status: {
|
|
295
|
-
uid:
|
|
295
|
+
uid: ExternalParticipantId;
|
|
296
296
|
rating: number;
|
|
297
297
|
}[]): void;
|
|
298
298
|
/**
|
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 } from '../types/ExternalId';
|
|
10
|
+
import { ExternalId, ExternalParticipant, ExternalParticipantId } from '../types/ExternalId';
|
|
11
11
|
import IceServer from '../types/IceServer';
|
|
12
12
|
import MediaModifiers from '../types/MediaModifiers';
|
|
13
13
|
import MediaSettings from '../types/MediaSettings';
|
|
@@ -222,6 +222,7 @@ export declare type ParamsObject = {
|
|
|
222
222
|
*/
|
|
223
223
|
batchParticipantsOnStart: boolean;
|
|
224
224
|
participantStateMapped: boolean;
|
|
225
|
+
joinFromMultipleDevices: boolean;
|
|
225
226
|
/**
|
|
226
227
|
* Получен локальный стрим с камеры/микрофона
|
|
227
228
|
*/
|
|
@@ -242,40 +243,40 @@ export declare type ParamsObject = {
|
|
|
242
243
|
* Получен стрим собеседника.
|
|
243
244
|
* Если сервер закончил стримить собеседника, вместо стрима будет передан null
|
|
244
245
|
*/
|
|
245
|
-
onRemoteStream?: (userId:
|
|
246
|
+
onRemoteStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
246
247
|
/**
|
|
247
248
|
* Получен стрим с экрана собеседника.
|
|
248
249
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
249
250
|
*/
|
|
250
|
-
onRemoteScreenStream?: (userId:
|
|
251
|
+
onRemoteScreenStream?: (userId: ExternalParticipantId, stream: MediaStream | null) => void;
|
|
251
252
|
/**
|
|
252
253
|
* Получен стрим трансляция или мувик от собеседника.
|
|
253
254
|
* Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
|
|
254
255
|
*/
|
|
255
|
-
onRemoteLive?: (userId:
|
|
256
|
+
onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
|
|
256
257
|
/**
|
|
257
258
|
* Начат звонок
|
|
258
259
|
*/
|
|
259
|
-
onConversation?: (userId:
|
|
260
|
+
onConversation?: (userId: ExternalParticipantId, mediaModifiers: MediaModifiers, muteStates: MuteStates, participants?: ExternalParticipant[]) => void;
|
|
260
261
|
/**
|
|
261
262
|
* Изменились данные стрима собеседника
|
|
262
263
|
*/
|
|
263
|
-
onRemoteMediaSettings?: (userId:
|
|
264
|
+
onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings) => void;
|
|
264
265
|
/**
|
|
265
266
|
* Изменились данные состояний собеседника
|
|
266
267
|
*/
|
|
267
|
-
onRemoteParticipantState?: (userId:
|
|
268
|
+
onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: {
|
|
268
269
|
[key: string]: string;
|
|
269
270
|
}) => void;
|
|
270
271
|
/**
|
|
271
272
|
* Изменился статус соединения собеседников
|
|
272
273
|
*/
|
|
273
|
-
onRemoteStatus?: (userIds:
|
|
274
|
+
onRemoteStatus?: (userIds: ExternalParticipantId[], status: ParticipantStatus, data: any) => void;
|
|
274
275
|
/**
|
|
275
276
|
* Изменился статус соединения собеседника
|
|
276
277
|
* @deprecated
|
|
277
278
|
*/
|
|
278
|
-
onParticipantStatus?: (userId:
|
|
279
|
+
onParticipantStatus?: (userId: ExternalParticipantId, status: ParticipantStatus, data: any) => void;
|
|
279
280
|
/**
|
|
280
281
|
* Разрешения на доступы были запрошены в браузере
|
|
281
282
|
*/
|
|
@@ -287,7 +288,7 @@ export declare type ParamsObject = {
|
|
|
287
288
|
/**
|
|
288
289
|
* Пользователь отключился от звонка
|
|
289
290
|
*/
|
|
290
|
-
onRemoteRemoved?: (userId:
|
|
291
|
+
onRemoteRemoved?: (userId: ExternalParticipantId) => void;
|
|
291
292
|
/**
|
|
292
293
|
* Изменилось состояние звонка
|
|
293
294
|
*/
|
|
@@ -299,11 +300,11 @@ export declare type ParamsObject = {
|
|
|
299
300
|
/**
|
|
300
301
|
* Изменились состояния устройств пользователя или разрешения включать камеру/микрофон
|
|
301
302
|
*/
|
|
302
|
-
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId:
|
|
303
|
+
onMuteStates?: (muteStates: MuteStates, unmuteOptions: MediaOption[], mediaOptions: MediaOption[], muteAll: boolean, unmute: boolean, userId: ExternalParticipantId | null, adminId: ExternalParticipantId | null) => void;
|
|
303
304
|
/**
|
|
304
305
|
* Изменились роли собеседника в звонке
|
|
305
306
|
*/
|
|
306
|
-
onRolesChanged?: (userId:
|
|
307
|
+
onRolesChanged?: (userId: ExternalParticipantId, roles: UserRole[]) => void;
|
|
307
308
|
/**
|
|
308
309
|
* Изменились свои роли в звонке
|
|
309
310
|
*/
|
|
@@ -311,7 +312,7 @@ export declare type ParamsObject = {
|
|
|
311
312
|
/**
|
|
312
313
|
* Закрепляет/открепляет собеседника для всех
|
|
313
314
|
*/
|
|
314
|
-
onPinnedParticipant?: (userId:
|
|
315
|
+
onPinnedParticipant?: (userId: ExternalParticipantId, unpin: boolean) => void;
|
|
315
316
|
/**
|
|
316
317
|
* Закрепляет/открепляет текущего пользователя у других собеседников
|
|
317
318
|
*/
|
|
@@ -324,12 +325,12 @@ export declare type ParamsObject = {
|
|
|
324
325
|
/**
|
|
325
326
|
* Изменился говорящий в звонке
|
|
326
327
|
*/
|
|
327
|
-
onSpeakerChanged?: (userId:
|
|
328
|
+
onSpeakerChanged?: (userId: ExternalParticipantId) => void;
|
|
328
329
|
/**
|
|
329
330
|
* Громкость собеседников
|
|
330
331
|
*/
|
|
331
332
|
onVolumesDetected?: (volumes: {
|
|
332
|
-
uid:
|
|
333
|
+
uid: ExternalParticipantId;
|
|
333
334
|
volume: number;
|
|
334
335
|
}[]) => void;
|
|
335
336
|
/**
|
|
@@ -361,15 +362,15 @@ export declare type ParamsObject = {
|
|
|
361
362
|
/**
|
|
362
363
|
* Получено сообщение чата
|
|
363
364
|
*/
|
|
364
|
-
onChatMessage?: (message: string, from:
|
|
365
|
+
onChatMessage?: (message: string, from: ExternalParticipantId, direct: boolean) => void;
|
|
365
366
|
/**
|
|
366
367
|
* Получены данные от собеседника
|
|
367
368
|
*/
|
|
368
|
-
onCustomData?: (data: JSONObject, from:
|
|
369
|
+
onCustomData?: (data: JSONObject, from: ExternalParticipantId, direct: boolean) => void;
|
|
369
370
|
/**
|
|
370
371
|
* Начата трансляция/запись звонка
|
|
371
372
|
*/
|
|
372
|
-
onRecordStarted?: (initiator:
|
|
373
|
+
onRecordStarted?: (initiator: ExternalParticipantId, movieId: number, startTime: number, type: 'STREAM' | 'RECORD', externalMovieId?: string, externalOwnerId?: string) => void;
|
|
373
374
|
/**
|
|
374
375
|
* Закончена трансляция/запись звонка
|
|
375
376
|
*/
|
|
@@ -386,7 +387,7 @@ export declare type ParamsObject = {
|
|
|
386
387
|
* @param status Оценки качества соединения участников от 0 до 1
|
|
387
388
|
*/
|
|
388
389
|
onNetworkStatusChanged?: (status: {
|
|
389
|
-
uid:
|
|
390
|
+
uid: ExternalParticipantId;
|
|
390
391
|
rating: number;
|
|
391
392
|
}[]) => void;
|
|
392
393
|
/**
|
|
@@ -420,7 +421,7 @@ export default abstract class Params {
|
|
|
420
421
|
static get appVersion(): number;
|
|
421
422
|
static get sdkVersion(): string | number | boolean;
|
|
422
423
|
static get debug(): string | number | boolean;
|
|
423
|
-
static get protocolVersion():
|
|
424
|
+
static get protocolVersion(): 5 | 6;
|
|
424
425
|
static get platform(): string;
|
|
425
426
|
static set platform(value: string);
|
|
426
427
|
static get clientType(): string;
|