@vkontakte/calls-sdk 2.5.3-dev.4b0b585.0 → 2.5.3-dev.4c1cd61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ import { JSONObject } from '../static/Json';
15
15
  import { ExternalParticipantId, ExternalUserId } from '../types/ExternalId';
16
16
  import MediaModifiers from '../types/MediaModifiers';
17
17
  import { IVideoDimentions } from '../types/MediaSettings';
18
+ import { IAddMovieParams } from '../types/MovieShare';
18
19
  import MuteStates from '../types/MuteStates';
19
20
  import { CompositeUserId, OkUserId, ParticipantId } from '../types/Participant';
20
21
  import { ParticipantLayout } from '../types/ParticipantLayout';
@@ -214,7 +215,7 @@ export default class Conversation extends EventEmitter {
214
215
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
215
216
  createJoinLink(): Promise<string>;
216
217
  removeJoinLink(): Promise<never>;
217
- addMovie(movieId: string): Promise<{
218
+ addMovie({ movieId, gain }: IAddMovieParams): Promise<{
218
219
  movieId: string;
219
220
  streamType: string;
220
221
  }>;
@@ -278,7 +279,6 @@ export default class Conversation extends EventEmitter {
278
279
  private _onRemoteTrackRemoved;
279
280
  private _removeAudioTrack;
280
281
  private _removeVideoTrack;
281
- private _onRemoteActivityNoSignal;
282
282
  private _onTopologyChanged;
283
283
  private _onRemoteAllStall;
284
284
  private _onRemoteSignalledStall;
@@ -1,6 +1,6 @@
1
1
  import { ParticipantId } from '../types/Participant';
2
2
  import EventEmitter from './EventEmitter';
3
- import { Transport } from './transport/Transport';
3
+ import { Transport, TransportTopology } from './transport/Transport';
4
4
  import { VolumeLevel } from './VolumeDetector';
5
5
  import { VolumesDetector } from './VolumesDetector';
6
6
  export declare const enum SpeakerDetectorEvent {
@@ -8,13 +8,12 @@ export declare const enum SpeakerDetectorEvent {
8
8
  }
9
9
  export declare class SpeakerDetector extends EventEmitter {
10
10
  private _speakerId;
11
- private _serverAudioActivityAvailable;
12
- constructor(volumesDetector: VolumesDetector, transport: Transport);
11
+ private _serverSideSpeakerDetection;
12
+ constructor(volumesDetector: VolumesDetector, transport: Transport, topology: TransportTopology);
13
13
  destroy(): void;
14
14
  _onVolumesDetected(volumes: {
15
15
  [key: string]: VolumeLevel;
16
16
  }): void;
17
17
  _onServerSpeakerChanged(speakerId: ParticipantId): void;
18
- _onReceivedServerAudioActivity(): void;
19
- _onStoppedReceivingServerAudioActivity(): void;
18
+ private _onTopologyChanged;
20
19
  }
@@ -13,5 +13,5 @@ export declare class VolumesDetector extends EventEmitter {
13
13
  private _onRemoteTrackRemoved;
14
14
  private _collectVolumes;
15
15
  private _onSignalledActiveParticipants;
16
- private _onActiveParticipantsNoSignal;
16
+ private _onTopologyChanged;
17
17
  }
@@ -12,7 +12,6 @@ export declare const enum TransportEvent {
12
12
  STATE_CHANGED = "STATE_CHANGED",
13
13
  LOCAL_STATE_CHANGED = "LOCAL_STATE_CHANGED",
14
14
  SIGNALLED_ACTIVE_PARTICIPANTS = "SIGNALLED_ACTIVE_PARTICIPANTS",
15
- ACTIVE_PARTICIPANTS_NO_SIGNAL = "ACTIVE_PARTICIPANTS_NO_SIGNAL",
16
15
  SIGNALLED_SPEAKER_CHANGED = "SIGNALLED_SPEAKER_CHANGED",
17
16
  SIGNALLED_STALLED_PARTICIPANTS = "SIGNALLED_STALLED_PARTICIPANTS",
18
17
  TOPOLOGY_CHANGED = "TOPOLOGY_CHANGED",
@@ -69,7 +68,6 @@ export declare class Transport extends EventEmitter {
69
68
  private _setLocalNoiseSuppression;
70
69
  private _onDirectTransportChanged;
71
70
  private _onServerTransportChanged;
72
- private _onTransportActiveParticipantsNoSignal;
73
71
  private _onTransportActiveParticipants;
74
72
  private _onTransportStalledParticipants;
75
73
  private _onTransportSpeakerChanged;
@@ -1,4 +1,4 @@
1
- declare const enum CallDirection {
1
+ declare enum CallDirection {
2
2
  INCOMING = "INCOMING",
3
3
  OUTGOING = "OUTGOING",
4
4
  JOINING = "JOINING"
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Разрешение на включение устройства
3
3
  */
4
- declare const enum MuteState {
4
+ declare enum MuteState {
5
5
  UNMUTE = "UNMUTE",
6
6
  MUTE = "MUTE",
7
7
  MUTE_PERMANENT = "MUTE_PERMANENT"
@@ -1,4 +1,4 @@
1
- declare const enum ParticipantState {
1
+ declare enum ParticipantState {
2
2
  CALLED = "CALLED",
3
3
  ACCEPTED = "ACCEPTED",
4
4
  REJECTED = "REJECTED",
@@ -1,4 +1,4 @@
1
- declare const enum SignalingNotification {
1
+ declare enum SignalingNotification {
2
2
  TRANSMITTED_DATA = "transmitted-data",
3
3
  ACCEPTED_CALL = "accepted-call",
4
4
  HUNGUP = "hungup",
@@ -1,4 +1,4 @@
1
- declare const enum UserType {
1
+ declare enum UserType {
2
2
  USER = "USER",
3
3
  GROUP = "GROUP"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.5.3-dev.4b0b585.0",
3
+ "version": "2.5.3-dev.4c1cd61.0",
4
4
  "author": "vk.com",
5
5
  "description": "Library for video calls based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -76,6 +76,15 @@ declare namespace External {
76
76
  * @param stream
77
77
  */
78
78
  function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
79
+ /**
80
+ * Получен собственный стрим лайв.
81
+ * Если сервер закончил стримить собеседника, вместо стрима будет передан null
82
+ *
83
+ * @param userId
84
+ * @param streamName
85
+ * @param stream
86
+ */
87
+ function onLocalLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
79
88
  /**
80
89
  * Получен стрим с экрана собеседника.
81
90
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
@@ -106,9 +115,7 @@ declare namespace External {
106
115
  * @param userId
107
116
  * @param participantState
108
117
  */
109
- function onRemoteParticipantState(userId: ExternalParticipantId, participantState: {
110
- [key: string]: string;
111
- } | ParticipantStateMapped): void;
118
+ function onRemoteParticipantState(userId: ExternalParticipantId, participantState: ParticipantStateMapped): void;
112
119
  /**
113
120
  * Изменился статус соединения собеседников
114
121
  *
@@ -12,6 +12,7 @@ import IceServer from '../types/IceServer';
12
12
  import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
14
14
  import MuteStates from '../types/MuteStates';
15
+ import { ParticipantStateMapped } from '../types/Participant';
15
16
  import AuthData from './AuthData';
16
17
  import { DebugMessageType } from './Debug';
17
18
  import { ParticipantStatus } from './External';
@@ -230,7 +231,6 @@ export declare type ParamsObject = {
230
231
  * @hidden
231
232
  */
232
233
  batchParticipantsOnStart: boolean;
233
- participantStateMapped: boolean;
234
234
  joinFromMultipleDevices: boolean;
235
235
  /**
236
236
  * Фильтровать наблюдателей во всех колбэках
@@ -273,6 +273,11 @@ export declare type ParamsObject = {
273
273
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
274
274
  */
275
275
  onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
276
+ /**
277
+ * Получен собственный стрим трансляция или мувик.
278
+ * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
279
+ */
280
+ onLocalLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
276
281
  /**
277
282
  * Начат звонок
278
283
  */
@@ -284,9 +289,7 @@ export declare type ParamsObject = {
284
289
  /**
285
290
  * Изменились данные состояний собеседника
286
291
  */
287
- onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: {
288
- [key: string]: string;
289
- }) => void;
292
+ onRemoteParticipantState?: (userId: ExternalParticipantId, participantState: ParticipantStateMapped) => void;
290
293
  /**
291
294
  * Изменился статус соединения собеседников
292
295
  */
@@ -519,7 +522,6 @@ export default abstract class Params {
519
522
  static get serverAudioRed(): boolean;
520
523
  static get p2pAudioRed(): boolean;
521
524
  static get batchParticipantsOnStart(): boolean;
522
- static get participantStateMapped(): boolean;
523
525
  static get filterObservers(): boolean;
524
526
  static get muteMode(): boolean;
525
527
  }
package/static/Utils.d.ts CHANGED
@@ -40,13 +40,6 @@ declare namespace Utils {
40
40
  * @param participant список участников звонка
41
41
  */
42
42
  function mapParticipantState(participant: Pick<SignalingMessage.Participant, 'participantState'>): ParticipantStateMapped;
43
- /**
44
- * Legacy маппер клиентского состояния участника звонка (когда `state` вида `{ [key: string]: string }`)
45
- * @param participantState состояние участника
46
- */
47
- function mapLegacyParticipantState(participantState: ParticipantStateMapped): {
48
- [key: string]: string;
49
- };
50
43
  /**
51
44
  * мапает данные `participants` перед передачей клиенту
52
45
  */
@@ -0,0 +1,4 @@
1
+ export interface IAddMovieParams {
2
+ movieId: string;
3
+ gain?: number;
4
+ }