@videosdk.live/react-sdk 0.1.81 → 0.1.83
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.js +84 -2
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +83 -3
- package/dist/index.modern.js.map +1 -1
- package/dist/types/deviceInfo.d.ts +28 -0
- package/dist/types/index.d.ts +64 -0
- package/dist/types/permission.d.ts +5 -0
- package/package.json +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class DeviceInfo extends MediaDeviceInfo {
|
|
2
|
+
}
|
|
3
|
+
export class CameraDeviceInfo extends DeviceInfo {
|
|
4
|
+
}
|
|
5
|
+
export class MicrophoneDeviceInfo extends DeviceInfo {
|
|
6
|
+
}
|
|
7
|
+
export class PlaybackDeviceInfo extends DeviceInfo {
|
|
8
|
+
}
|
|
9
|
+
declare class MediaDeviceInfo {
|
|
10
|
+
constructor(deviceId: any, groupId: any, kind: any, label: any);
|
|
11
|
+
/**
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
deviceId: string;
|
|
15
|
+
/**
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
groupId: string;
|
|
19
|
+
/**
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
kind: string;
|
|
23
|
+
/**
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
label: string;
|
|
27
|
+
}
|
|
28
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
7
7
|
|
|
8
8
|
import { Connection } from './connection';
|
|
9
|
+
import { CameraDeviceInfo, DeviceInfo, MicrophoneDeviceInfo, PlaybackDeviceInfo } from './deviceInfo';
|
|
10
|
+
import { Permission } from './permission';
|
|
9
11
|
import { Meeting } from './meeting';
|
|
10
12
|
import { Participant } from './participant';
|
|
11
13
|
import { Stream } from './stream';
|
|
@@ -316,6 +318,38 @@ export function MeetingConsumer({
|
|
|
316
318
|
}) => void;
|
|
317
319
|
}): any;
|
|
318
320
|
|
|
321
|
+
/**
|
|
322
|
+
*
|
|
323
|
+
* ---
|
|
324
|
+
* @param onDeviceChanged - It's a callback which gets triggered whenever a media device such as a camera, microphone, or speaker is connected to or removed from the system.
|
|
325
|
+
*
|
|
326
|
+
* **Code Example :**
|
|
327
|
+
* ```js
|
|
328
|
+
* function onDeviceChanged(devices) {
|
|
329
|
+
* console.log("onDeviceChanged", devices);
|
|
330
|
+
* }
|
|
331
|
+
* const {} = useMediaDevice({
|
|
332
|
+
* onDeviceChanged
|
|
333
|
+
* });
|
|
334
|
+
* ```
|
|
335
|
+
* ---
|
|
336
|
+
* @returns This will returns methods and events associated with media devices and permissions. You can refer this [API Reference](https://docs.videosdk.live/react/api/sdk-reference/use-mediaDevice/introduction)
|
|
337
|
+
*/
|
|
338
|
+
export function useMediaDevice(
|
|
339
|
+
{
|
|
340
|
+
onDeviceChanged,
|
|
341
|
+
}?: {
|
|
342
|
+
onDeviceChanged?: (devices: Promise<Array<DeviceInfo>>) => void;
|
|
343
|
+
},
|
|
344
|
+
): {
|
|
345
|
+
getDevices: () => Promise<Array<DeviceInfo>>;
|
|
346
|
+
getCameras: () => Promise<Array<CameraDeviceInfo>>;
|
|
347
|
+
getMicrophones: () => Promise<Array<MicrophoneDeviceInfo>>;
|
|
348
|
+
getPlaybackDevices: () => Promise<Array<PlaybackDeviceInfo>>;
|
|
349
|
+
checkPermissions: (permissions?: Permission) => Promise<Map<string, boolean>>;
|
|
350
|
+
requestPermission: (permissions?: Permission) => Promise<Map<string, boolean>>;
|
|
351
|
+
};
|
|
352
|
+
|
|
319
353
|
/**
|
|
320
354
|
*
|
|
321
355
|
* @param participantId - Id of the participant.
|
|
@@ -1085,6 +1119,31 @@ export function createScreenShareVideoTrack({
|
|
|
1085
1119
|
withAudio?: 'enable' | 'disable';
|
|
1086
1120
|
}): Promise<MediaStream>;
|
|
1087
1121
|
|
|
1122
|
+
/**
|
|
1123
|
+
* @param timeoutDuration - This will accept the timeoutDuration.
|
|
1124
|
+
*
|
|
1125
|
+
* **Code Example**
|
|
1126
|
+
* ```js
|
|
1127
|
+
* import { getNetworkStats } from "@videosdk.live/react-sdk";
|
|
1128
|
+
*
|
|
1129
|
+
* try{
|
|
1130
|
+
* const options = { timeoutDuration: 45000 };
|
|
1131
|
+
* const networkStats = await VideoSDK.getNetworkStats(options);
|
|
1132
|
+
* console.log("networkStats", networkStats);
|
|
1133
|
+
* }catch(Ex)
|
|
1134
|
+
* {
|
|
1135
|
+
* console.log("exception",Ex);
|
|
1136
|
+
* }
|
|
1137
|
+
* ```
|
|
1138
|
+
*/
|
|
1139
|
+
export function getNetworkStats({
|
|
1140
|
+
timeoutDuration
|
|
1141
|
+
}?: {
|
|
1142
|
+
timeoutDuration?:
|
|
1143
|
+
| number
|
|
1144
|
+
| undefined;
|
|
1145
|
+
}): Promise<{downloadSpeed: number,uploadSpeed: number}>;
|
|
1146
|
+
|
|
1088
1147
|
export const Constants: {
|
|
1089
1148
|
errors: {
|
|
1090
1149
|
INVALID_API_KEY: number;
|
|
@@ -1137,4 +1196,9 @@ export const Constants: {
|
|
|
1137
1196
|
CONFERENCE: string;
|
|
1138
1197
|
VIEWER: string;
|
|
1139
1198
|
};
|
|
1199
|
+
permission: {
|
|
1200
|
+
AUDIO: Permission;
|
|
1201
|
+
VIDEO: Permission;
|
|
1202
|
+
AUDIO_AND_VIDEO: Permission;
|
|
1203
|
+
};
|
|
1140
1204
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@videosdk.live/react-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.83",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@videosdk.live/js-sdk": "0.0.
|
|
76
|
+
"@videosdk.live/js-sdk": "0.0.80",
|
|
77
77
|
"events": "^3.3.0"
|
|
78
78
|
}
|
|
79
79
|
}
|