@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.
- package/dist/index.es.js +3 -3
- package/dist/index.js +3 -3
- package/dist/types/common.d.ts +5 -0
- package/dist/types/engine.d.ts +1 -0
- package/dist/types/network.d.ts +2 -1
- package/package.json +1 -1
- package/src/engine/index.ts +6 -0
- package/src/types/common.ts +6 -0
- package/src/types/engine.ts +1 -0
- package/src/types/network.ts +2 -1
package/dist/types/common.d.ts
CHANGED
|
@@ -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;
|
package/dist/types/engine.d.ts
CHANGED
package/dist/types/network.d.ts
CHANGED
|
@@ -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
package/src/engine/index.ts
CHANGED
|
@@ -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
|
});
|
package/src/types/common.ts
CHANGED
|
@@ -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 = {
|
package/src/types/engine.ts
CHANGED
package/src/types/network.ts
CHANGED
|
@@ -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 = {
|