@vkontakte/calls-sdk 2.6.2-beta.2 → 2.6.2-dev.0134ffe.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.
@@ -203,8 +203,6 @@ export default class Conversation extends EventEmitter {
203
203
  private _stopStreaming;
204
204
  private _sendUpdateDisplayLayout;
205
205
  private _cleanupCooldownQueue;
206
- private static _isStopStreaming;
207
- private static _layoutToString;
208
206
  private _onParticipantSourcesUpdate;
209
207
  private _onParticipantPromoted;
210
208
  private _onChatRoomUpdated;
@@ -2,7 +2,9 @@ import { ParticipantStreamDescription } from '../types/ParticipantStreamDescript
2
2
  import SignalingMessage from '../types/SignalingMessage';
3
3
  export declare class ParticipantIdRegistry {
4
4
  private streamDescriptionByCompactId;
5
+ private compactIdByStreamDescription;
5
6
  getStreamDescription(compactedId: number): ParticipantStreamDescription | undefined;
7
+ getCompactId(streamDescription: string): number | undefined;
6
8
  handleMessage(data: ArrayBuffer): SignalingMessage | null;
7
9
  private _createParticipantSourcesUpdateNotification;
8
10
  }
@@ -0,0 +1,17 @@
1
+ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
2
+ import SignalingMessage from '../types/SignalingMessage';
3
+ import { ParticipantIdRegistry } from './ParticipantIdRegistry';
4
+ import { PerfStatReport } from './transport/PerfStatReporter';
5
+ export declare class ProducerCommandSerializationService {
6
+ private participantIdRegistry;
7
+ setParticipantIdRegistry(participantIdRegistry: ParticipantIdRegistry): void;
8
+ serializeUpdateDisplayLayout(sequenceNumber: number, layouts: {
9
+ [key: string]: ParticipantLayout | StopStream | RequestKeyFrame;
10
+ }): ArrayBuffer;
11
+ private writeLayout;
12
+ private writeStreamDesc;
13
+ serializePerfStatReport(sequenceNumber: number, report: PerfStatReport): ArrayBuffer;
14
+ deserializeCommandResponse(data: BufferSource): SignalingMessage | undefined;
15
+ private deserializeUpdateDisplayLayoutResponse;
16
+ private deserializeReportPerfStatResponse;
17
+ }
@@ -3,6 +3,7 @@ export default class ScreenCaptureSender {
3
3
  private readonly _datachannel;
4
4
  private _destroyed;
5
5
  private _needKeyframe;
6
+ private readonly DATA_SIZE;
6
7
  constructor(track: MediaStreamTrack, datachannel: RTCDataChannel);
7
8
  private _requestFrame;
8
9
  private _wrapHeader;
@@ -1,3 +1,4 @@
1
+ export declare const HEADER_SIZE = 11;
1
2
  export interface FrameChunkHeader {
2
3
  timestamp: number;
3
4
  start: boolean;
@@ -13,6 +13,7 @@ import MediaModifiers from '../types/MediaModifiers';
13
13
  import MediaSettings from '../types/MediaSettings';
14
14
  import MuteStates from '../types/MuteStates';
15
15
  import { CompositeUserId, ParticipantId } from '../types/Participant';
16
+ import ParticipantLayout, { RequestKeyFrame, StopStream } from '../types/ParticipantLayout';
16
17
  import { ParticipantListChunkParameters } from '../types/ParticipantListChunk';
17
18
  import SignalingMessage from '../types/SignalingMessage';
18
19
  import { WaitingParticipantId } from '../types/WaitingHall';
@@ -40,6 +41,7 @@ export default class Signaling extends BaseSignaling {
40
41
  private producerNotificationDataChannel;
41
42
  private producerCommandDataChannel;
42
43
  private producerCommandDataChannelEnabled;
44
+ private producerCommandSerializationService;
43
45
  private static readonly RECONNECT_DELAY;
44
46
  private static readonly RECONNECT_MAX_DELAY;
45
47
  private static readonly RECONNECT_MAX_COUNT;
@@ -91,8 +93,8 @@ export default class Signaling extends BaseSignaling {
91
93
  changePriorities(priorities: {
92
94
  [key: string]: number;
93
95
  }): Promise<SignalingMessage | void>;
94
- updateDisplayLayout(layout: {
95
- [key: string]: string;
96
+ updateDisplayLayout(layouts: {
97
+ [streamDesc: string]: ParticipantLayout | StopStream | RequestKeyFrame;
96
98
  }): Promise<SignalingMessage>;
97
99
  addMovie(data: any): Promise<SignalingMessage>;
98
100
  updateMovie(data: any): Promise<SignalingMessage>;
@@ -142,6 +144,9 @@ export default class Signaling extends BaseSignaling {
142
144
  protected _reconnect(): void;
143
145
  private _handleCommandResponse;
144
146
  private _handleCommandsQueue;
147
+ private _serializeBinary;
148
+ private _serializeJson;
149
+ private _convertDisplayLayout;
145
150
  protected _waitConnectionMessage(): void;
146
151
  protected _stopWaitConnectionMessage(): void;
147
152
  private _startDoctor;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/calls-sdk",
3
- "version": "2.6.2-beta.2",
3
+ "version": "2.6.2-dev.0134ffe.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",
@@ -199,6 +199,12 @@ export declare type ParamsObject = {
199
199
  producerCommandDataChannel: boolean;
200
200
  consumerScreenDataChannel: boolean;
201
201
  producerScreenDataChannel: boolean;
202
+ /**
203
+ * Размер пакета для отправки трансляции экрана в датаканал в байтах.
204
+ * Максимальный размер пакета 65536 bytes в хроме, но по стандарту лучше максимум 16 Кб.
205
+ * @hidden
206
+ */
207
+ consumerScreenDataChannelPacketSize: number;
202
208
  screenShareWebmBuilder: boolean;
203
209
  noiseSuppression: boolean;
204
210
  /**
@@ -544,6 +550,7 @@ export default abstract class Params {
544
550
  static get producerCommandDataChannel(): boolean;
545
551
  static get consumerScreenDataChannel(): boolean;
546
552
  static get producerScreenDataChannel(): boolean;
553
+ static get consumerScreenDataChannelPacketSize(): number;
547
554
  static get screenShareWebmBuilder(): boolean;
548
555
  static get noiseSuppression(): boolean;
549
556
  static set noiseSuppression(value: boolean);
package/static/Utils.d.ts CHANGED
@@ -60,5 +60,7 @@ declare namespace Utils {
60
60
  * https://stash.odkl.ru/projects/ODKL/repos/odnoklassniki-webrtc/browse/src/main/java/one/webrtc/domain/conversation/ParticipantIndex.java#67-78
61
61
  */
62
62
  function participantMarkerCompare(marker1: ExternalParticipantListMarker | undefined, marker2: ExternalParticipantListMarker | undefined): number;
63
+ /** убирает все ключи со значением `V` на 1 уровне */
64
+ function objectFilterOutValues<T extends Record<string, V>, V = unknown>(obj: T, value?: V | V[]): Partial<T>;
63
65
  }
64
66
  export default Utils;
@@ -0,0 +1,5 @@
1
+ import { Layout, RequestKeyFrame, StopStream } from './ParticipantLayout';
2
+ export declare const REQUEST_KEY_FRAME_CODE = "kf";
3
+ export declare function isStopStreaming(layout: Layout | StopStream | RequestKeyFrame): layout is StopStream;
4
+ export declare function isRequestKeyFrame(layout: Layout | StopStream | RequestKeyFrame): layout is RequestKeyFrame;
5
+ export declare function layoutToString(layout: Layout | StopStream | RequestKeyFrame): string;
@@ -31,10 +31,16 @@ export declare type StopStream = {
31
31
  */
32
32
  stopStream: true;
33
33
  };
34
+ /**
35
+ * Request key frame from source. Should not be called often, negatively impacts video quality.
36
+ */
37
+ export declare type RequestKeyFrame = {
38
+ keyFrameRequested: true;
39
+ };
34
40
  /**
35
41
  * Лейаут собеседника в звонке
36
42
  */
37
- export declare type ParticipantLayout = (Layout | StopStream) & {
43
+ export declare type ParticipantLayout = (Layout | StopStream | RequestKeyFrame) & {
38
44
  /**
39
45
  * Внешний ID пользователя
40
46
  */
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Fork from messagepack internals.
3
+ * Package messagepack doesn't export createWriteBuffer and createReadBuffer methods.
4
+ */
5
+ export declare function createWriteBuffer(): {
6
+ put(v: BufferSource): void;
7
+ putI8(v: number): void;
8
+ putI16(v: number): void;
9
+ putI32(v: number): void;
10
+ putI64(v: number): void;
11
+ putUi8(v: number): void;
12
+ putUi16(v: number): void;
13
+ putUi32(v: number): void;
14
+ putUi64(v: number): void;
15
+ putF(v: number): void;
16
+ ui8array(): Uint8Array;
17
+ };
18
+ export declare function createReadBuffer(buf: BufferSource): {
19
+ peek(): number;
20
+ get(len: number): ArrayBuffer;
21
+ getI8(): number;
22
+ getI16(): number;
23
+ getI32(): number;
24
+ getI64(): number;
25
+ getUi8(): number;
26
+ getUi16(): number;
27
+ getUi32(): number;
28
+ getUi64(): number;
29
+ getF32(): number;
30
+ getF64(): number;
31
+ };