@vkontakte/calls-sdk 2.6.2-dev.57d3082.0 → 2.6.2-dev.5b6408b.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 { ExternalParticipant, ExternalParticipantId, ExternalParticipantListChunk, 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, IGetParticipantsParameters, OkUserId, ParticipantId } from '../types/Participant';
20
21
  import { ParticipantLayout } from '../types/ParticipantLayout';
@@ -208,6 +209,9 @@ export default class Conversation extends EventEmitter {
208
209
  private _onParticipantSourcesUpdate;
209
210
  private _onParticipantPromoted;
210
211
  private _onChatRoomUpdated;
212
+ private _onSharedMovieUpdate;
213
+ private _onSharedMovieInfoStarted;
214
+ private _onSharedMovieInfoStopped;
211
215
  private _waitForStreamIfNeeded;
212
216
  private _matchStreamDescription;
213
217
  private _getWaitingTime;
@@ -231,11 +235,11 @@ export default class Conversation extends EventEmitter {
231
235
  customData(data: JSONObject, participantId?: ParticipantId | null): Promise<void>;
232
236
  createJoinLink(): Promise<string>;
233
237
  removeJoinLink(): Promise<never>;
234
- addMovie(movieId: string): Promise<{
238
+ addMovie({ movieId, gain }: IAddMovieParams): Promise<{
235
239
  movieId: string;
236
240
  streamType: string;
237
241
  }>;
238
- updateMovie(movieId: string, gain?: number, offset?: string, pause?: boolean): Promise<void>;
242
+ updateMovie(movieId: string, gain?: number, offset?: number, pause?: boolean): Promise<void>;
239
243
  removeMovie(movieId: string): Promise<void>;
240
244
  startStream(isRecord?: boolean, name?: string | null, movieId?: string | null, privacy?: 'PUBLIC' | 'FRIENDS' | 'DIRECT_LINK', groupId?: string | null): Promise<SignalingMessage>;
241
245
  stopStream(): Promise<SignalingMessage>;
@@ -11,6 +11,7 @@ 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';
16
17
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
@@ -92,8 +93,8 @@ export default class Signaling extends BaseSignaling {
92
93
  updateDisplayLayout(layout: {
93
94
  [key: string]: string;
94
95
  }): Promise<SignalingMessage>;
95
- addMovie(data: any): Promise<SignalingMessage>;
96
- updateMovie(data: any): Promise<SignalingMessage>;
96
+ addMovie(data: IAddMovieParams): Promise<SignalingMessage>;
97
+ updateMovie(data: ISharedMovieState): Promise<SignalingMessage>;
97
98
  removeMovie(data: any): Promise<SignalingMessage>;
98
99
  startStream(data: any): Promise<SignalingMessage>;
99
100
  stopStream(): Promise<SignalingMessage>;
@@ -35,6 +35,10 @@ declare enum SignalingNotification {
35
35
  PROMOTE_PARTICIPANT = "promote-participant",
36
36
  CHAT_ROOM_UPDATED = "chat-room-updated",
37
37
  PROMOTION_APPROVED = "promotion-approved",
38
- JOIN_LINK_CHANGED = "join-link-changed"
38
+ JOIN_LINK_CHANGED = "join-link-changed",
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"
39
43
  }
40
44
  export default SignalingNotification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-dev.57d3082.0",
3
+ "version": "2.6.2-dev.5b6408b.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",
@@ -10,6 +10,7 @@ import UserRole from '../enums/UserRole';
10
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 { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from '../types/MovieShare';
13
14
  import MuteStates from '../types/MuteStates';
14
15
  import { ParticipantStateMapped } from '../types/Participant';
15
16
  import { DebugMessageType } from './Debug';
@@ -76,6 +77,29 @@ declare namespace External {
76
77
  * @param stream
77
78
  */
78
79
  function onRemoteLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
80
+ /**
81
+ * Получен собственный стрим лайв.
82
+ * Если сервер закончил стримить собеседника, вместо стрима будет передан null
83
+ *
84
+ * @param userId
85
+ * @param streamName
86
+ * @param stream
87
+ */
88
+ function onLocalLive(userId: ExternalParticipantId, streamName: string, stream: MediaStream | null): void;
89
+ /**
90
+ * Получено обновление стрима или лайва от собеседника.
91
+ *
92
+ * @param userId
93
+ * @param data
94
+ */
95
+ function onRemoteLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
96
+ /**
97
+ * Получено обновление собственного стрима или лайва.
98
+ *
99
+ * @param userId
100
+ * @param data
101
+ */
102
+ function onLocalLiveUpdate(userId: ExternalParticipantId, data: ISharedMovieState): void;
79
103
  /**
80
104
  * Получен стрим с экрана собеседника.
81
105
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
@@ -106,6 +130,41 @@ declare namespace External {
106
130
  * @param markers
107
131
  */
108
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;
109
168
  /**
110
169
  * Добавили участника
111
170
  *
@@ -11,6 +11,7 @@ import { ExternalId, ExternalParticipant, ExternalParticipantId, ExternalPartici
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';
@@ -293,6 +294,19 @@ export declare type ParamsObject = {
293
294
  * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
294
295
  */
295
296
  onRemoteLive?: (userId: ExternalParticipantId, streamId: string, stream: MediaStream | null) => void;
297
+ /**
298
+ * Получен собственный стрим трансляция или мувик.
299
+ * Если сервер закончил стримить экран собеседника, вместо стрима будет передан null
300
+ */
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;
296
310
  /**
297
311
  * Начат звонок
298
312
  */
@@ -305,6 +319,26 @@ export declare type ParamsObject = {
305
319
  * Изменились данные стрима собеседника
306
320
  */
307
321
  onRemoteMediaSettings?: (userId: ExternalParticipantId, mediaSettings: MediaSettings, markers?: ExternalParticipantListMarkers) => void;
322
+ /**
323
+ * Изменились данные стрима собеседника
324
+ */
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;
308
342
  /**
309
343
  * Добавили участника
310
344
  */
@@ -1,6 +1,7 @@
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
6
  import { ParticipantListMarker, ParticipantListType, ParticipantStateMapped } from './Participant';
6
7
  import SignalingMessage from './SignalingMessage';
@@ -94,6 +95,7 @@ export interface ExternalParticipant {
94
95
  */
95
96
  unmuteOptions: MediaOption[];
96
97
  markers?: ExternalParticipantListMarkers;
98
+ movieShareInfos?: ISharedMovieInfo[];
97
99
  }
98
100
  export interface ExternalParticipantListChunk {
99
101
  participants: ExternalParticipant[];
@@ -19,7 +19,7 @@ export declare type MediaSettings = {
19
19
  export declare type VideoStreamInfo = {
20
20
  id: string;
21
21
  source: string;
22
- vkMovieId?: string;
22
+ externalMovieId?: string;
23
23
  };
24
24
  export default MediaSettings;
25
25
  export declare function compareMediaSettings(ms1: MediaSettings, ms2: MediaSettings): boolean;
@@ -0,0 +1,32 @@
1
+ import { OkUserId, CompositeUserId } from './Participant';
2
+ import { MediaType } from './ParticipantStreamDescription';
3
+ export interface IAddMovieParams {
4
+ movieId: string;
5
+ gain?: number;
6
+ }
7
+ export declare type ISharedMovieStateResponse = [number, number, boolean, number, number];
8
+ export interface ISharedMovieState {
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;
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;
32
+ }
@@ -4,6 +4,7 @@ import UserRole from '../enums/UserRole';
4
4
  import { ParticipantStatus } from '../static/External';
5
5
  import MediaSettings from '../types/MediaSettings';
6
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
  /**
@@ -55,6 +56,7 @@ export interface Participant {
55
56
  unmuteOptions: MediaOption[];
56
57
  observedIds: CompositeUserId[];
57
58
  markers?: ExternalParticipantListMarkers;
59
+ movieShareInfos?: ISharedMovieInfo[];
58
60
  }
59
61
  export interface IGetParticipantsParameters {
60
62
  externalIds: ExternalId[];
@@ -9,6 +9,7 @@ import UserRole from '../enums/UserRole';
9
9
  import UserType from '../enums/UserType';
10
10
  import MediaModifiers from './MediaModifiers';
11
11
  import MediaSettings from './MediaSettings';
12
+ import { ISharedMovieInfo, ISharedMovieState, ISharedMovieStoppedInfo } from './MovieShare';
12
13
  import MuteStates from './MuteStates';
13
14
  import { CompositeUserId, OkUserId, ParticipantId, ParticipantListMarker as ParticipantParticipantListMarker, ParticipantListMarkers, ParticipantListType as ParticipantParticipantListType } from './Participant';
14
15
  import VideoSettings from './VideoSettings';
@@ -54,6 +55,7 @@ declare namespace SignalingMessage {
54
55
  unmuteOptions?: MediaOption[];
55
56
  markers?: ParticipantListMarkers;
56
57
  observedIds?: CompositeUserId[];
58
+ movieShareInfos?: ISharedMovieInfo[];
57
59
  }
58
60
  export interface ParticipantListChunk extends Notification {
59
61
  participants: (Participant & Required<Pick<Participant, 'markers'>>)[];
@@ -277,6 +279,14 @@ declare namespace SignalingMessage {
277
279
  export interface JoinLinkChanged extends Notification {
278
280
  joinLink: string;
279
281
  }
282
+ export interface SharedMovieState extends Notification {
283
+ data: ISharedMovieState[];
284
+ }
285
+ export interface SharedMovieInfo extends Notification {
286
+ movieShareInfo: ISharedMovieInfo;
287
+ }
288
+ export interface SharedMovieStoppedInfo extends Notification, ISharedMovieStoppedInfo {
289
+ }
280
290
  export {};
281
291
  }
282
292
  export default SignalingMessage;