@stream-io/video-react-sdk 1.7.5 → 1.7.7
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/CHANGELOG.md +16 -0
- package/dist/index.cjs.js +5 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -35
- package/dist/index.es.js.map +1 -1
- package/dist/src/hooks/index.d.ts +0 -1
- package/package.json +3 -3
- package/src/components/CallControls/RecordCallButton.tsx +5 -2
- package/src/components/Notification/RecordingInProgressNotification.tsx +4 -2
- package/src/hooks/index.ts +0 -1
- package/dist/src/hooks/useToggleCallRecording.d.ts +0 -5
- package/src/hooks/useToggleCallRecording.ts +0 -36
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasAudio, hasScreenShareAudio, CallingState, hasVideo, hasScreenShare, OwnCapability, Browsers, VisibilityState, getLogger, disposeOfMediaStream, isPinned, name, NoiseCancellationSettingsModeEnum, SfuModels, paginatedLayoutSortPreset, combineComparators, screenSharing, speakerLayoutSortPreset, CallTypes, defaultSortPreset, setSdkInfo } from '@stream-io/video-client';
|
|
2
2
|
export * from '@stream-io/video-client';
|
|
3
|
-
import { useCall, useCallStateHooks, useI18n, Restricted, useConnectedUser, StreamCallProvider, StreamVideoProvider, useStreamVideoClient } from '@stream-io/video-react-bindings';
|
|
3
|
+
import { useCall, useCallStateHooks, useI18n, Restricted, useToggleCallRecording, useConnectedUser, StreamCallProvider, StreamVideoProvider, useStreamVideoClient } from '@stream-io/video-react-bindings';
|
|
4
4
|
export * from '@stream-io/video-react-bindings';
|
|
5
5
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import { useState, useEffect, Fragment as Fragment$1, createContext, useContext, useCallback, useRef, useMemo, isValidElement, forwardRef, useLayoutEffect, lazy, Suspense } from 'react';
|
|
@@ -245,39 +245,6 @@ const useHorizontalScrollPosition = (scrollElement, threshold = SCROLL_THRESHOLD
|
|
|
245
245
|
return scrollPosition;
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
-
const useToggleCallRecording = () => {
|
|
249
|
-
const call = useCall();
|
|
250
|
-
const { useIsCallRecordingInProgress } = useCallStateHooks();
|
|
251
|
-
const isCallRecordingInProgress = useIsCallRecordingInProgress();
|
|
252
|
-
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
253
|
-
// TODO: add permissions
|
|
254
|
-
useEffect(() => {
|
|
255
|
-
// we wait until call.recording_started/stopped event to flips the
|
|
256
|
-
// `isCallRecordingInProgress` state variable.
|
|
257
|
-
// Once the flip happens, we remove the loading indicator
|
|
258
|
-
setIsAwaitingResponse((isAwaiting) => {
|
|
259
|
-
if (isAwaiting)
|
|
260
|
-
return false;
|
|
261
|
-
return isAwaiting;
|
|
262
|
-
});
|
|
263
|
-
}, [isCallRecordingInProgress]);
|
|
264
|
-
const toggleCallRecording = useCallback(async () => {
|
|
265
|
-
try {
|
|
266
|
-
setIsAwaitingResponse(true);
|
|
267
|
-
if (isCallRecordingInProgress) {
|
|
268
|
-
await call?.stopRecording();
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
await call?.startRecording();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
catch (e) {
|
|
275
|
-
console.error(`Failed start recording`, e);
|
|
276
|
-
}
|
|
277
|
-
}, [call, isCallRecordingInProgress]);
|
|
278
|
-
return { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress };
|
|
279
|
-
};
|
|
280
|
-
|
|
281
248
|
const useRequestPermission = (permission) => {
|
|
282
249
|
const call = useCall();
|
|
283
250
|
const { useHasPermissions } = useCallStateHooks();
|
|
@@ -2562,7 +2529,7 @@ const LivestreamPlayer = (props) => {
|
|
|
2562
2529
|
return (jsx(StreamCall, { call: call, children: jsx(LivestreamLayout, { ...layoutProps }) }));
|
|
2563
2530
|
};
|
|
2564
2531
|
|
|
2565
|
-
const [major, minor, patch] = ("1.7.
|
|
2532
|
+
const [major, minor, patch] = ("1.7.7").split('.');
|
|
2566
2533
|
setSdkInfo({
|
|
2567
2534
|
type: SfuModels.SdkType.REACT,
|
|
2568
2535
|
major,
|