@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.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -2
- package/dist/index.cjs.js +9 -5
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +9 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/VideoPreview/VideoPreview.d.ts +7 -3
- package/dist/src/translations/index.d.ts +2 -0
- package/package.json +3 -3
- package/src/components/VideoPreview/VideoPreview.tsx +17 -6
- package/src/translations/en.json +2 -0
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
export type VideoPreviewProps = {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Additional CSS class name to apply to the root element.
|
|
5
5
|
*/
|
|
6
|
-
|
|
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-sdk",
|
|
3
|
-
"version": "0.4.
|
|
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.
|
|
35
|
-
"@stream-io/video-react-bindings": "^0.3.
|
|
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
|
-
|
|
8
|
+
const { t } = useI18n();
|
|
9
|
+
return <div>{t('Video is disabled')}</div>;
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
const DefaultNoCameraPreview = () => {
|
|
12
|
-
|
|
13
|
+
const { t } = useI18n();
|
|
14
|
+
return <div>{t('No camera found')}</div>;
|
|
13
15
|
};
|
|
14
16
|
|
|
15
17
|
export type VideoPreviewProps = {
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Additional CSS class name to apply to the root element.
|
|
18
20
|
*/
|
|
19
|
-
|
|
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
|
|
73
|
+
return (
|
|
74
|
+
<div className={clsx('str-video__video-preview-container', className)}>
|
|
75
|
+
{contents}
|
|
76
|
+
</div>
|
|
77
|
+
);
|
|
67
78
|
};
|
package/src/translations/en.json
CHANGED