@videosdk.live/react-sdk 0.4.8 → 0.4.10
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 +85 -14
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +85 -15
- package/dist/index.modern.js.map +1 -1
- package/dist/types/index.d.ts +50 -3
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -251,7 +251,7 @@ export function MeetingConsumer({
|
|
|
251
251
|
reliability: string;
|
|
252
252
|
}) => void;
|
|
253
253
|
onMeetingJoined?: () => void;
|
|
254
|
-
onMeetingLeft?: () => void;
|
|
254
|
+
onMeetingLeft?: ({ reason, code }: { reason: string, code: string }) => void;
|
|
255
255
|
onLiveStreamStarted?: () => void;
|
|
256
256
|
onLiveStreamStopped?: () => void;
|
|
257
257
|
onVideoStateChanged?: () => void;
|
|
@@ -819,7 +819,7 @@ export function useMeeting({
|
|
|
819
819
|
reliability: string;
|
|
820
820
|
}) => void;
|
|
821
821
|
onMeetingJoined?: () => void;
|
|
822
|
-
onMeetingLeft?: () => void;
|
|
822
|
+
onMeetingLeft?: ({ reason , code }: { reason: string, code: string }) => void;
|
|
823
823
|
onLiveStreamStarted?: () => void;
|
|
824
824
|
onLiveStreamStopped?: () => void;
|
|
825
825
|
onVideoStateChanged?: () => void;
|
|
@@ -1187,6 +1187,49 @@ export function usePubSub(
|
|
|
1187
1187
|
}>;
|
|
1188
1188
|
};
|
|
1189
1189
|
|
|
1190
|
+
/**
|
|
1191
|
+
*
|
|
1192
|
+
* @param key - Represents the key for which you want to set the value in the realtime store.
|
|
1193
|
+
* ---
|
|
1194
|
+
* @param onValueChanged - This will get triggered when the value for the given key changes.
|
|
1195
|
+
* ---
|
|
1196
|
+
* @returns This will return `setValue()` and `getValue()` methods.
|
|
1197
|
+
* ---
|
|
1198
|
+
* **useRealtimeStore example**
|
|
1199
|
+
* ```js
|
|
1200
|
+
* var key = 'BLOCKED';
|
|
1201
|
+
*
|
|
1202
|
+
* function onValueChanged({value,updatedBy}) {
|
|
1203
|
+
* console.log('New Message:', message);
|
|
1204
|
+
* }
|
|
1205
|
+
*
|
|
1206
|
+
* const {setValue,getValue} = useRealtimeStore(key, {
|
|
1207
|
+
* onValueChanged,
|
|
1208
|
+
* });
|
|
1209
|
+
* ```
|
|
1210
|
+
*/
|
|
1211
|
+
export function useRealtimeStore(
|
|
1212
|
+
key: string,
|
|
1213
|
+
{
|
|
1214
|
+
onValueChanged,
|
|
1215
|
+
}?: {
|
|
1216
|
+
onValueChanged?: ({
|
|
1217
|
+
value,
|
|
1218
|
+
updatedBy,
|
|
1219
|
+
}: {
|
|
1220
|
+
value: string
|
|
1221
|
+
updatedBy: string,
|
|
1222
|
+
}) => void,
|
|
1223
|
+
}
|
|
1224
|
+
): {
|
|
1225
|
+
setValue: ({
|
|
1226
|
+
value
|
|
1227
|
+
}: {
|
|
1228
|
+
value: string;
|
|
1229
|
+
}) => Promise<any>;
|
|
1230
|
+
getValue: () => Promise<string>;
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1190
1233
|
export function useFile(): {
|
|
1191
1234
|
uploadBase64File: ({
|
|
1192
1235
|
base64Data,
|
|
@@ -1779,6 +1822,8 @@ export function getNetworkStats({
|
|
|
1779
1822
|
* ---
|
|
1780
1823
|
* @param videoStyle - Custom styles for the video element inside the container.
|
|
1781
1824
|
*
|
|
1825
|
+
* @param videoRef - Optional ref to the underlying <video> element.
|
|
1826
|
+
*
|
|
1782
1827
|
* ---
|
|
1783
1828
|
* @returns A React component that renders the participant's video stream with optional adaptive observers.
|
|
1784
1829
|
*
|
|
@@ -1800,7 +1845,8 @@ export function VideoPlayer({
|
|
|
1800
1845
|
containerStyle,
|
|
1801
1846
|
className,
|
|
1802
1847
|
classNameVideo,
|
|
1803
|
-
videoStyle
|
|
1848
|
+
videoStyle,
|
|
1849
|
+
videoRef
|
|
1804
1850
|
}: {
|
|
1805
1851
|
participantId: string;
|
|
1806
1852
|
type?: "video" | "share";
|
|
@@ -1808,6 +1854,7 @@ export function VideoPlayer({
|
|
|
1808
1854
|
className?: string;
|
|
1809
1855
|
classNameVideo?: string;
|
|
1810
1856
|
videoStyle?: React.CSSProperties;
|
|
1857
|
+
videoRef?: React.Ref<HTMLVideoElement>
|
|
1811
1858
|
}): JSX.Element;
|
|
1812
1859
|
|
|
1813
1860
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@videosdk.live/react-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.modern.js",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@videosdk.live/js-sdk": "0.3.
|
|
77
|
+
"@videosdk.live/js-sdk": "0.3.10",
|
|
78
78
|
"events": "^3.3.0"
|
|
79
79
|
}
|
|
80
80
|
}
|