@vkontakte/calls-sdk 2.6.2 → 2.6.3-beta.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.
@@ -1,18 +1,52 @@
1
1
  import LiveStatus from '../enums/LiveStatus';
2
- import { OkUserId, CompositeUserId } from './Participant';
2
+ import { CompositeUserId } from './Participant';
3
3
  import { MediaType } from './ParticipantStreamDescription';
4
+ /**
5
+ * Preview изображения ролика
6
+ */
4
7
  export interface IMoviePreview {
8
+ /**
9
+ * Ссылка на изображение
10
+ */
5
11
  url: string;
12
+ /**
13
+ * Ширина изображения
14
+ */
6
15
  width: number;
16
+ /**
17
+ * Высота изображения
18
+ */
7
19
  height: number;
8
20
  }
21
+ /**
22
+ * MetaData ролика
23
+ */
24
+ export interface IMovieMetaData {
25
+ /**
26
+ * Название ролика
27
+ */
28
+ title?: string;
29
+ /**
30
+ * Список Preview
31
+ */
32
+ thumbnails?: IMoviePreview[];
33
+ }
34
+ /**
35
+ * Параметры для добавления ролика в Совместный Просмотр
36
+ */
9
37
  export interface IAddMovieParams {
10
- movieId: string;
38
+ /**
39
+ * ID Ролика
40
+ */
41
+ movieId: number;
42
+ /**
43
+ * Начальная громкость
44
+ */
11
45
  gain?: number;
12
- metadata?: {
13
- title?: string;
14
- thumbnails?: IMoviePreview[];
15
- };
46
+ /**
47
+ * MetaData ролика
48
+ */
49
+ metadata?: IMovieMetaData;
16
50
  }
17
51
  export declare type ISharedMovieStateResponse = [
18
52
  number,
@@ -23,38 +57,133 @@ export declare type ISharedMovieStateResponse = [
23
57
  number,
24
58
  number
25
59
  ];
60
+ /**
61
+ * Состояние проигрываемого ролика
62
+ */
26
63
  export interface ISharedMovieState {
64
+ /**
65
+ * ID Инициатора совместного просмотра
66
+ * @hidden
67
+ */
27
68
  participantId: CompositeUserId;
69
+ /**
70
+ * Громкость
71
+ */
28
72
  gain?: number;
73
+ /**
74
+ * Находится ли в состоянии паузы
75
+ */
29
76
  pause?: boolean;
77
+ /**
78
+ * Время прошедшее с начала ролика (сек)
79
+ */
30
80
  offset?: number;
81
+ /**
82
+ * Находится ли в стостоянии временного мьюта звука
83
+ */
31
84
  mute?: boolean;
85
+ /**
86
+ * Состояние лайва
87
+ * @hidden
88
+ */
32
89
  liveStatus?: LiveStatus;
90
+ /**
91
+ * Время до начала трансляции
92
+ * @hidden
93
+ */
33
94
  startTimeMs: number;
34
95
  }
96
+ /**
97
+ * Параментры для обновления состояния ролика
98
+ */
35
99
  export interface IUpdateMovieData {
36
- movieId: string;
100
+ /**
101
+ * Id ролика
102
+ */
103
+ movieId: number;
104
+ /**
105
+ * Громкость
106
+ */
37
107
  gain?: number;
108
+ /**
109
+ * Поставить на паузу / снять с паузы
110
+ */
38
111
  pause?: boolean;
112
+ /**
113
+ * Перемотать на n секунд
114
+ */
39
115
  offset?: number;
116
+ /**
117
+ * Временно отключить звук / включить звук в предыдущее состояние
118
+ */
40
119
  mute?: boolean;
41
120
  }
121
+ /**
122
+ * Информация по добавленному ролику в Совместный просмотр
123
+ */
42
124
  export interface ISharedMovieInfo {
43
- movieId: OkUserId;
125
+ /**
126
+ * Id ролика
127
+ */
128
+ movieId: number;
129
+ /**
130
+ * Id инициатора совсместного просмотра
131
+ * @hidden
132
+ */
44
133
  initiatorId: CompositeUserId;
134
+ /**
135
+ * Название ролика
136
+ */
45
137
  title: string;
138
+ /**
139
+ * Тип ролика (на данный момент STREAM или MOVIE)
140
+ */
46
141
  source: MediaType;
142
+ /**
143
+ * Внешний Id ролика
144
+ */
47
145
  externalMovieId: string;
146
+ /**
147
+ * Продолжительность ролика в секундах
148
+ */
48
149
  duration: number;
150
+ /**
151
+ * Массив Preview
152
+ */
49
153
  thumbnails: IMoviePreview[];
50
154
  }
155
+ /**
156
+ * Информация по удоленному из Совместного Просмотра ролику
157
+ */
51
158
  export interface ISharedMovieStoppedInfo {
52
- movieId: OkUserId;
159
+ /**
160
+ * Id ролика
161
+ */
162
+ movieId: number;
163
+ /**
164
+ * Id инициатора совсместного просмотра
165
+ * @hidden
166
+ */
53
167
  initiatorId: CompositeUserId;
168
+ /**
169
+ * Тип ролика (на данный момент STREAM или MOVIE)
170
+ */
54
171
  source: MediaType;
55
172
  }
173
+ /**
174
+ * Информация по пришедшему стриму ролика в Совместном просмотре
175
+ */
56
176
  export interface IOnRemoteMovieData {
177
+ /**
178
+ * Id стрима
179
+ */
57
180
  streamName: string;
181
+ /**
182
+ * Стрим
183
+ */
58
184
  stream: MediaStream | null;
185
+ /**
186
+ * Тип ролика (на данный момент STREAM или MOVIE)
187
+ */
59
188
  mediaType: MediaType;
60
189
  }
@@ -1,5 +1,7 @@
1
1
  import MediaOption from '../enums/MediaOption';
2
2
  import MuteState from '../enums/MuteState';
3
+ import { ExternalParticipantId } from './ExternalId';
4
+ import { OkUserId } from './Participant';
3
5
  /**
4
6
  * Состояние устройств пользователя установленное админом звонка
5
7
  */
@@ -7,3 +9,16 @@ declare type MuteStates = {
7
9
  [key in MediaOption]?: MuteState;
8
10
  };
9
11
  export default MuteStates;
12
+ export interface IMuteParticipantParams {
13
+ externalId?: string | ExternalParticipantId | null;
14
+ muteStates: MuteStates;
15
+ requestedMedia?: MediaOption[];
16
+ roomId?: number | null;
17
+ }
18
+ export interface IMuteParticipantInternalParams {
19
+ uid: OkUserId | null;
20
+ muteStates: MuteStates;
21
+ requestedMedia: MediaOption[];
22
+ deviceIdx: number;
23
+ roomId: number | null;
24
+ }
@@ -57,6 +57,7 @@ export interface Participant {
57
57
  observedIds: CompositeUserId[];
58
58
  markers?: ExternalParticipantListMarkers;
59
59
  movieShareInfos?: ISharedMovieInfo[];
60
+ isInRoom?: boolean;
60
61
  }
61
62
  export interface IGetParticipantsParameters {
62
63
  externalIds: ExternalId[];
@@ -11,5 +11,5 @@ export interface ParticipantListChunkParameters {
11
11
  /** If true then resulting chunk will start from Participant with specified marker, if such Participant (still) exists */
12
12
  includeMarker?: boolean;
13
13
  /** optional, id of the room to get chunk for, main call if unspecified */
14
- roomId?: number;
14
+ roomId?: number | null;
15
15
  }
package/types/Room.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
2
- import { Participant, ParticipantListMarkers } from './Participant';
1
+ import { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk } from './ExternalId';
2
+ import MuteStates from './MuteStates';
3
+ import { ParticipantListMarkers } from './Participant';
3
4
  export interface Room {
4
5
  id: number;
5
6
  /**
@@ -32,13 +33,28 @@ export interface Room {
32
33
  * if this room is active (read/write, optional)
33
34
  */
34
35
  active?: boolean;
36
+ /**
37
+ * global (room-wide) mute state, if any
38
+ */
39
+ muteStates?: MuteStates;
40
+ }
41
+ /**
42
+ * Initial rooms state
43
+ */
44
+ export interface Rooms {
45
+ rooms: Room[];
46
+ /**
47
+ * current room id of participant. if undefined then the participant is in the main call
48
+ */
49
+ roomId?: number;
35
50
  }
36
51
  export interface RoomsUpdate {
37
52
  rooms?: Room[];
38
53
  roomIds?: number[];
54
+ deactivated?: boolean;
39
55
  }
40
56
  export interface RoomParticipantUpdate {
41
- roomId: number;
57
+ roomId: number | null;
42
58
  /**
43
59
  * total number of participants in the room
44
60
  */
@@ -51,10 +67,11 @@ export interface RoomParticipantUpdate {
51
67
  /**
52
68
  * optional, data for added participants
53
69
  */
54
- addedParticipants?: Participant[];
70
+ addedParticipants?: ExternalParticipant[];
55
71
  /**
56
72
  * optional, depending on the context may contain either markers
57
73
  * for all (sorted) lists available or be empty (if client fails to support chunked participants)
58
74
  */
59
- removedParticipantMarkers?: ParticipantListMarkers;
75
+ removedParticipantMarkers?: ParticipantListMarkers[];
76
+ removedParticipantIds?: ExternalParticipantId[];
60
77
  }
@@ -10,7 +10,6 @@ import UserRole from '../enums/UserRole';
10
10
  import UserType from '../enums/UserType';
11
11
  import { IFeaturesPerRole } from './ConversationFeature';
12
12
  import { IFeedback } from './Feedback';
13
- import { AsrInfo } from './Asr';
14
13
  import MediaModifiers from './MediaModifiers';
15
14
  import MediaSettings from './MediaSettings';
16
15
  import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
@@ -77,7 +76,7 @@ declare namespace SignalingMessage {
77
76
  features: ConversationFeature[];
78
77
  multichatId: string | null;
79
78
  tamtamMultichatId: string | null;
80
- recordInfo: RecordInfo | null;
79
+ recordInfo?: RecordInfo;
81
80
  featuresPerRole?: IFeaturesPerRole | null;
82
81
  pinnedParticipantId: ParticipantId | null;
83
82
  options: ConversationOption[];
@@ -92,6 +91,10 @@ declare namespace SignalingMessage {
92
91
  removeParticipantIds?: CompositeUserId[];
93
92
  participants?: ParticipantListChunk;
94
93
  active?: boolean;
94
+ countdownSec?: number;
95
+ timeoutMs?: number;
96
+ muteStates?: MuteStates;
97
+ recordInfo?: RecordInfo;
95
98
  }
96
99
  interface Notification extends SignalingMessage {
97
100
  type?: string;
@@ -169,6 +172,7 @@ declare namespace SignalingMessage {
169
172
  stateUpdated?: boolean;
170
173
  unmute?: boolean;
171
174
  muteAll?: boolean;
175
+ roomId?: number;
172
176
  }
173
177
  export interface PinParticipant extends Notification {
174
178
  participantId: ParticipantId;
@@ -303,6 +307,7 @@ declare namespace SignalingMessage {
303
307
  }
304
308
  export interface Feedback extends Notification {
305
309
  feedback: IFeedback[];
310
+ roomId?: number;
306
311
  }
307
312
  export interface SharedMovieState extends Notification {
308
313
  data: ISharedMovieState[];
@@ -316,6 +321,7 @@ declare namespace SignalingMessage {
316
321
  updates: Partial<Record<RoomsEventType, {
317
322
  rooms?: Room;
318
323
  roomIds?: number[];
324
+ deactivated?: boolean;
319
325
  }>>;
320
326
  }
321
327
  export interface RoomUpdated extends Notification {
@@ -323,23 +329,22 @@ declare namespace SignalingMessage {
323
329
  room?: Room;
324
330
  roomId: number;
325
331
  deactivate?: boolean;
332
+ muteStates?: MuteStates;
333
+ recordInfo?: RecordInfo;
326
334
  }
327
335
  export interface RoomParticipantsUpdated extends Notification {
328
- roomId: number;
336
+ roomId?: number;
329
337
  participantCount: number;
330
338
  addedParticipantIds?: CompositeUserId[];
331
339
  addedParticipants?: Participant[];
332
- removedParticipantMarkers?: ParticipantListMarkers;
340
+ removedParticipantMarkers?: ParticipantListMarkers[];
341
+ }
342
+ export interface GetRooms extends Notification {
343
+ rooms: Room[];
333
344
  }
334
345
  export interface FeaturesPerRoleChanged extends Notification {
335
346
  featuresPerRole?: IFeaturesPerRole | null;
336
347
  }
337
- export interface AsrStarted extends Notification {
338
- asrInfo: AsrInfo;
339
- }
340
- export interface AsrStopped extends Notification {
341
- movieId: number;
342
- }
343
348
  export {};
344
349
  }
345
350
  export default SignalingMessage;
@@ -0,0 +1,11 @@
1
+ export interface IStartStreamData {
2
+ movieId: string | null;
3
+ name: string | null;
4
+ privacy: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK';
5
+ groupId: string | null;
6
+ roomId: number | null;
7
+ streamMovie: boolean;
8
+ }
9
+ export interface IStopStreamData {
10
+ roomId: number | null;
11
+ }