@livedigital/client 3.33.1 → 3.33.2-datacenter-type.1

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.
@@ -62,11 +62,16 @@ export declare type AvailableMediaDevices = {
62
62
  video: MediaDeviceInfo[];
63
63
  audio: MediaDeviceInfo[];
64
64
  };
65
+ export declare enum DatacenterType {
66
+ P2P = "p2p",
67
+ Common = "common"
68
+ }
65
69
  export declare type JoinChannelParams = {
66
70
  channelId: string;
67
71
  token: string;
68
72
  role: Role;
69
73
  appData?: Record<string, unknown>;
74
+ isP2pCall?: boolean;
70
75
  };
71
76
  export declare type ChannelEvent = {
72
77
  eventName: string;
@@ -25,6 +25,7 @@ export interface ConnectParams {
25
25
  channelId: string;
26
26
  role: Role;
27
27
  token: string;
28
+ isP2pCall?: boolean;
28
29
  }
29
30
  export interface NodeActiveStreamsStat {
30
31
  node?: string;
@@ -1,9 +1,10 @@
1
- import { Role } from './common';
1
+ import { DatacenterType, Role } from './common';
2
2
  import { SocketIOEvents } from './socket';
3
3
  import { NETWORK_OBSERVER_EVENTS } from '../constants/events';
4
4
  export declare type GetNodeRequest = {
5
5
  channelId: string;
6
6
  role: Role;
7
+ datacenterType?: DatacenterType;
7
8
  };
8
9
  export declare type GetNodeResponse = {
9
10
  webSocketUrl: string;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@livedigital/client",
3
3
  "author": "vlprojects",
4
4
  "license": "MIT",
5
- "version": "3.33.1",
5
+ "version": "3.33.2-datacenter-type.1",
6
6
  "private": false,
7
7
  "bugs": {
8
8
  "url": "https://github.com/vlprojects/livedigital-sdk/issues"
@@ -19,6 +19,7 @@ import {
19
19
  CreateCameraVideoTrackOptions,
20
20
  CreateMicrophoneAudioTrackOptions,
21
21
  CreateScreenMediaOptions,
22
+ DatacenterType,
22
23
  JoinChannelParams,
23
24
  PeerResponse,
24
25
  Role,
@@ -436,7 +437,12 @@ class Engine {
436
437
  }
437
438
 
438
439
  private async connectToSocketServer(params: ConnectParams): Promise<void> {
440
+ const datacenterType = params.isP2pCall
441
+ ? DatacenterType.P2P
442
+ : DatacenterType.Common;
443
+
439
444
  const { webSocketUrl } = await this.getAvailableNode({
445
+ datacenterType,
440
446
  channelId: params.channelId,
441
447
  role: params.role,
442
448
  });
@@ -82,11 +82,17 @@ export type AvailableMediaDevices = {
82
82
  audio: MediaDeviceInfo[],
83
83
  };
84
84
 
85
+ export enum DatacenterType {
86
+ P2P = 'p2p',
87
+ Common = 'common',
88
+ }
89
+
85
90
  export type JoinChannelParams = {
86
91
  channelId: string,
87
92
  token: string,
88
93
  role: Role,
89
94
  appData?: Record<string, unknown>,
95
+ isP2pCall?: boolean,
90
96
  };
91
97
 
92
98
  export type ChannelEvent = {
@@ -42,6 +42,7 @@ export interface ConnectParams {
42
42
  channelId: string,
43
43
  role: Role,
44
44
  token: string,
45
+ isP2pCall?: boolean,
45
46
  }
46
47
 
47
48
  export interface NodeActiveStreamsStat {
@@ -1,10 +1,11 @@
1
- import { Role } from './common';
1
+ import { DatacenterType, Role } from './common';
2
2
  import { SocketIOEvents } from './socket';
3
3
  import { NETWORK_OBSERVER_EVENTS } from '../constants/events';
4
4
 
5
5
  export type GetNodeRequest = {
6
6
  channelId: string;
7
7
  role: Role;
8
+ datacenterType?: DatacenterType;
8
9
  };
9
10
 
10
11
  export type GetNodeResponse = {