@stream-io/video-react-sdk 1.31.8 → 1.32.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.
@@ -0,0 +1,10 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { Placement } from '@floating-ui/react';
3
+ export type MicCaptureErrorNotificationProps = {
4
+ /**
5
+ * Text message displayed by the notification.
6
+ */
7
+ text?: string;
8
+ placement?: Placement;
9
+ };
10
+ export declare const MicCaptureErrorNotification: ({ children, text, placement, }: PropsWithChildren<MicCaptureErrorNotificationProps>) => import("react/jsx-runtime").JSX.Element;
@@ -2,3 +2,4 @@ export * from './Notification';
2
2
  export * from './PermissionNotification';
3
3
  export * from './SpeakingWhileMutedNotification';
4
4
  export * from './RecordingInProgressNotification';
5
+ export * from './MicCaptureErrorNotification';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "1.31.8",
3
+ "version": "1.32.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -31,9 +31,9 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@floating-ui/react": "^0.27.6",
34
- "@stream-io/video-client": "1.41.3",
34
+ "@stream-io/video-client": "1.42.1",
35
35
  "@stream-io/video-filters-web": "0.7.2",
36
- "@stream-io/video-react-bindings": "1.13.3",
36
+ "@stream-io/video-react-bindings": "1.13.5",
37
37
  "chart.js": "^4.4.4",
38
38
  "clsx": "^2.0.0",
39
39
  "react-chartjs-2": "^5.3.0"
@@ -1,6 +1,9 @@
1
1
  import { OwnCapability } from '@stream-io/video-client';
2
2
  import { Restricted } from '@stream-io/video-react-bindings';
3
- import { SpeakingWhileMutedNotification } from '../Notification';
3
+ import {
4
+ SpeakingWhileMutedNotification,
5
+ MicCaptureErrorNotification,
6
+ } from '../Notification';
4
7
  import { RecordCallButton } from './RecordCallButton';
5
8
  import { ReactionsButton } from './ReactionsButton';
6
9
  import { ScreenShareButton } from './ScreenShareButton';
@@ -15,9 +18,11 @@ export type CallControlsProps = {
15
18
  export const CallControls = ({ onLeave }: CallControlsProps) => (
16
19
  <div className="str-video__call-controls">
17
20
  <Restricted requiredGrants={[OwnCapability.SEND_AUDIO]}>
18
- <SpeakingWhileMutedNotification>
19
- <ToggleAudioPublishingButton />
20
- </SpeakingWhileMutedNotification>
21
+ <MicCaptureErrorNotification>
22
+ <SpeakingWhileMutedNotification>
23
+ <ToggleAudioPublishingButton />
24
+ </SpeakingWhileMutedNotification>
25
+ </MicCaptureErrorNotification>
21
26
  </Restricted>
22
27
  <Restricted requiredGrants={[OwnCapability.SEND_VIDEO]}>
23
28
  <ToggleVideoPublishingButton />
@@ -0,0 +1,43 @@
1
+ import { PropsWithChildren, useEffect, useState } from 'react';
2
+ import { Placement } from '@floating-ui/react';
3
+ import { useCall, useI18n } from '@stream-io/video-react-bindings';
4
+ import { Notification } from './Notification';
5
+
6
+ export type MicCaptureErrorNotificationProps = {
7
+ /**
8
+ * Text message displayed by the notification.
9
+ */
10
+ text?: string;
11
+ placement?: Placement;
12
+ };
13
+
14
+ export const MicCaptureErrorNotification = ({
15
+ children,
16
+ text,
17
+ placement,
18
+ }: PropsWithChildren<MicCaptureErrorNotificationProps>) => {
19
+ const call = useCall();
20
+ const { t } = useI18n();
21
+ const [isVisible, setIsVisible] = useState(false);
22
+ useEffect(() => {
23
+ if (!call) return;
24
+ return call.on('mic.capture_report', (event) => {
25
+ setIsVisible(!event.capturesAudio);
26
+ });
27
+ }, [call]);
28
+
29
+ const message =
30
+ text ??
31
+ t('Your microphone is not capturing audio. Please check your setup.');
32
+
33
+ return (
34
+ <Notification
35
+ message={message}
36
+ isVisible={isVisible}
37
+ placement={placement}
38
+ close={() => setIsVisible(false)}
39
+ >
40
+ {children}
41
+ </Notification>
42
+ );
43
+ };
@@ -43,7 +43,7 @@ export const Notification = (props: PropsWithChildren<NotificationProps>) => {
43
43
  }, [isVisible, resetIsVisible, visibilityTimeout]);
44
44
 
45
45
  return (
46
- <div ref={refs.setReference}>
46
+ <div className="str-video__notification-wrapper" ref={refs.setReference}>
47
47
  {isVisible && (
48
48
  <div
49
49
  className={clsx('str-video__notification', className)}
@@ -2,3 +2,4 @@ export * from './Notification';
2
2
  export * from './PermissionNotification';
3
3
  export * from './SpeakingWhileMutedNotification';
4
4
  export * from './RecordingInProgressNotification';
5
+ export * from './MicCaptureErrorNotification';
@@ -247,7 +247,7 @@ const ParticipantOverlay = (props: {
247
247
  showLiveBadge ||
248
248
  showMuteButton ||
249
249
  showSpeakerName;
250
- const { participant } = useParticipantViewContext();
250
+ const { participant, participantViewElement } = useParticipantViewContext();
251
251
  const { useParticipantCount, useSpeakerState } = useCallStateHooks();
252
252
  const participantCount = useParticipantCount();
253
253
  const duration = useUpdateCallDuration();
@@ -294,12 +294,14 @@ const ParticipantOverlay = (props: {
294
294
  onClick={() => speaker.setVolume(isSpeakerMuted ? 1 : 0)}
295
295
  />
296
296
  )}
297
- {enableFullScreen && (
298
- <span
299
- className="str-video__livestream-layout__go-fullscreen"
300
- onClick={toggleFullScreen}
301
- />
302
- )}
297
+ {enableFullScreen &&
298
+ participantViewElement &&
299
+ typeof participantViewElement.requestFullscreen !== 'undefined' && (
300
+ <span
301
+ className="str-video__livestream-layout__go-fullscreen"
302
+ onClick={toggleFullScreen}
303
+ />
304
+ )}
303
305
  </div>
304
306
  )}
305
307
  </div>