@stream-io/video-react-sdk 0.4.0 → 0.4.2

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.
@@ -1,13 +1,17 @@
1
1
  import { ComponentType } from 'react';
2
2
  export type VideoPreviewProps = {
3
3
  /**
4
- * Component rendered when user turns off the video.
4
+ * Additional CSS class name to apply to the root element.
5
5
  */
6
- DisabledVideoPreview?: ComponentType;
6
+ className?: string;
7
7
  /**
8
8
  * Enforces mirroring of the video on the X axis. Defaults to true.
9
9
  */
10
10
  mirror?: boolean;
11
+ /**
12
+ * Component rendered when user turns off the video.
13
+ */
14
+ DisabledVideoPreview?: ComponentType;
11
15
  /**
12
16
  * Component rendered when no camera devices are available.
13
17
  */
@@ -17,4 +21,4 @@ export type VideoPreviewProps = {
17
21
  */
18
22
  StartingCameraPreview?: ComponentType;
19
23
  };
20
- export declare const VideoPreview: ({ mirror, DisabledVideoPreview, NoCameraPreview, StartingCameraPreview, }: VideoPreviewProps) => import("react/jsx-runtime").JSX.Element;
24
+ export declare const VideoPreview: ({ className, mirror, DisabledVideoPreview, NoCameraPreview, StartingCameraPreview, }: VideoPreviewProps) => import("react/jsx-runtime").JSX.Element;
@@ -45,6 +45,8 @@ export declare const translations: {
45
45
  "Microphone off": string;
46
46
  "Camera on": string;
47
47
  "Camera off": string;
48
+ "No camera found": string;
49
+ "Video is disabled": string;
48
50
  Pinned: string;
49
51
  Unpin: string;
50
52
  Pin: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -31,8 +31,8 @@
31
31
  "@floating-ui/react": "^0.22.0",
32
32
  "@nivo/core": "^0.80.0",
33
33
  "@nivo/line": "^0.80.0",
34
- "@stream-io/video-client": "^0.4.0",
35
- "@stream-io/video-react-bindings": "^0.3.0",
34
+ "@stream-io/video-client": "^0.4.1",
35
+ "@stream-io/video-react-bindings": "^0.3.1",
36
36
  "clsx": "^2.0.0",
37
37
  "prop-types": "^15.8.1",
38
38
  "rxjs": "~7.8.1"
@@ -1,26 +1,32 @@
1
1
  import { ComponentType } from 'react';
2
2
  import clsx from 'clsx';
3
- import { useCallStateHooks } from '@stream-io/video-react-bindings';
3
+ import { useCallStateHooks, useI18n } from '@stream-io/video-react-bindings';
4
4
  import { BaseVideo } from '../../core/components/Video';
5
5
  import { LoadingIndicator } from '../LoadingIndicator';
6
6
 
7
7
  const DefaultDisabledVideoPreview = () => {
8
- return <div>Video is disabled</div>;
8
+ const { t } = useI18n();
9
+ return <div>{t('Video is disabled')}</div>;
9
10
  };
10
11
 
11
12
  const DefaultNoCameraPreview = () => {
12
- return <div>No camera found</div>;
13
+ const { t } = useI18n();
14
+ return <div>{t('No camera found')}</div>;
13
15
  };
14
16
 
15
17
  export type VideoPreviewProps = {
16
18
  /**
17
- * Component rendered when user turns off the video.
19
+ * Additional CSS class name to apply to the root element.
18
20
  */
19
- DisabledVideoPreview?: ComponentType;
21
+ className?: string;
20
22
  /**
21
23
  * Enforces mirroring of the video on the X axis. Defaults to true.
22
24
  */
23
25
  mirror?: boolean;
26
+ /**
27
+ * Component rendered when user turns off the video.
28
+ */
29
+ DisabledVideoPreview?: ComponentType;
24
30
  /**
25
31
  * Component rendered when no camera devices are available.
26
32
  */
@@ -32,6 +38,7 @@ export type VideoPreviewProps = {
32
38
  };
33
39
 
34
40
  export const VideoPreview = ({
41
+ className,
35
42
  mirror = true,
36
43
  DisabledVideoPreview = DefaultDisabledVideoPreview,
37
44
  NoCameraPreview = DefaultNoCameraPreview,
@@ -63,5 +70,9 @@ export const VideoPreview = ({
63
70
  contents = <DisabledVideoPreview />;
64
71
  }
65
72
 
66
- return <div className="str-video__video-preview-container">{contents}</div>;
73
+ return (
74
+ <div className={clsx('str-video__video-preview-container', className)}>
75
+ {contents}
76
+ </div>
77
+ );
67
78
  };
@@ -49,6 +49,8 @@
49
49
  "Microphone off": "Microphone off",
50
50
  "Camera on": "Camera on",
51
51
  "Camera off": "Camera off",
52
+ "No camera found": "No camera found",
53
+ "Video is disabled": "Video is disabled",
52
54
  "Pinned": "Pinned",
53
55
  "Unpin": "Unpin",
54
56
  "Pin": "Pin",