@stream-io/video-react-sdk 1.0.0 → 1.0.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 +17 -0
- package/dist/index.cjs.js +24 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +24 -20
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
- package/src/components/CallControls/ScreenShareButton.tsx +6 -5
- package/src/components/CallControls/ToggleAudioButton.tsx +14 -8
- package/src/components/CallControls/ToggleVideoButton.tsx +12 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"module": "./dist/index.es.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@floating-ui/react": "^0.26.5",
|
|
32
|
-
"@stream-io/video-client": "1.0.
|
|
32
|
+
"@stream-io/video-client": "1.0.2",
|
|
33
33
|
"@stream-io/video-filters-web": "0.1.0",
|
|
34
|
-
"@stream-io/video-react-bindings": "0.4.
|
|
34
|
+
"@stream-io/video-react-bindings": "0.4.28",
|
|
35
35
|
"chart.js": "^4.4.1",
|
|
36
36
|
"clsx": "^2.0.0",
|
|
37
37
|
"react-chartjs-2": "^5.2.0"
|
|
@@ -26,10 +26,11 @@ export const ScreenShareButton = (props: ScreenShareButtonProps) => {
|
|
|
26
26
|
const callSettings = useCallSettings();
|
|
27
27
|
const isScreenSharingAllowed = callSettings?.screensharing.enabled;
|
|
28
28
|
|
|
29
|
-
const { screenShare,
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
const { screenShare, optimisticIsMute } = useScreenShareState();
|
|
30
|
+
const amIScreenSharing = !optimisticIsMute;
|
|
31
|
+
const disableScreenShareButton =
|
|
32
|
+
!amIScreenSharing &&
|
|
33
|
+
(isSomeoneScreenSharing || isScreenSharingAllowed === false);
|
|
33
34
|
return (
|
|
34
35
|
<Restricted requiredGrants={[OwnCapability.SCREENSHARE]}>
|
|
35
36
|
<PermissionNotification
|
|
@@ -40,7 +41,7 @@ export const ScreenShareButton = (props: ScreenShareButtonProps) => {
|
|
|
40
41
|
messageRevoked={t('You can no longer share your screen.')}
|
|
41
42
|
>
|
|
42
43
|
<CompositeButton
|
|
43
|
-
active={isSomeoneScreenSharing}
|
|
44
|
+
active={isSomeoneScreenSharing || amIScreenSharing}
|
|
44
45
|
caption={caption}
|
|
45
46
|
title={caption || t('Share screen')}
|
|
46
47
|
variant="primary"
|
|
@@ -22,11 +22,12 @@ export const ToggleAudioPreviewButton = (
|
|
|
22
22
|
const { caption, Menu, menuPlacement, ...restCompositeButtonProps } = props;
|
|
23
23
|
const { t } = useI18n();
|
|
24
24
|
const { useMicrophoneState } = useCallStateHooks();
|
|
25
|
-
const { microphone,
|
|
25
|
+
const { microphone, optimisticIsMute, hasBrowserPermission } =
|
|
26
|
+
useMicrophoneState();
|
|
26
27
|
|
|
27
28
|
return (
|
|
28
29
|
<CompositeButton
|
|
29
|
-
active={
|
|
30
|
+
active={optimisticIsMute}
|
|
30
31
|
caption={caption}
|
|
31
32
|
className={clsx(!hasBrowserPermission && 'str-video__device-unavailable')}
|
|
32
33
|
variant="secondary"
|
|
@@ -37,14 +38,16 @@ export const ToggleAudioPreviewButton = (
|
|
|
37
38
|
}
|
|
38
39
|
disabled={!hasBrowserPermission}
|
|
39
40
|
data-testid={
|
|
40
|
-
|
|
41
|
+
optimisticIsMute
|
|
42
|
+
? 'preview-audio-unmute-button'
|
|
43
|
+
: 'preview-audio-mute-button'
|
|
41
44
|
}
|
|
42
45
|
onClick={() => microphone.toggle()}
|
|
43
46
|
Menu={Menu}
|
|
44
47
|
menuPlacement={menuPlacement}
|
|
45
48
|
{...restCompositeButtonProps}
|
|
46
49
|
>
|
|
47
|
-
<Icon icon={!
|
|
50
|
+
<Icon icon={!optimisticIsMute ? 'mic' : 'mic-off'} />
|
|
48
51
|
{!hasBrowserPermission && (
|
|
49
52
|
<span
|
|
50
53
|
className="str-video__no-media-permission"
|
|
@@ -76,7 +79,8 @@ export const ToggleAudioPublishingButton = (
|
|
|
76
79
|
useRequestPermission(OwnCapability.SEND_AUDIO);
|
|
77
80
|
|
|
78
81
|
const { useMicrophoneState } = useCallStateHooks();
|
|
79
|
-
const { microphone,
|
|
82
|
+
const { microphone, optimisticIsMute, hasBrowserPermission } =
|
|
83
|
+
useMicrophoneState();
|
|
80
84
|
|
|
81
85
|
return (
|
|
82
86
|
<Restricted requiredGrants={[OwnCapability.SEND_AUDIO]}>
|
|
@@ -88,7 +92,7 @@ export const ToggleAudioPublishingButton = (
|
|
|
88
92
|
messageRevoked={t('You can no longer speak.')}
|
|
89
93
|
>
|
|
90
94
|
<CompositeButton
|
|
91
|
-
active={
|
|
95
|
+
active={optimisticIsMute}
|
|
92
96
|
caption={caption}
|
|
93
97
|
title={
|
|
94
98
|
!hasPermission
|
|
@@ -99,7 +103,9 @@ export const ToggleAudioPublishingButton = (
|
|
|
99
103
|
}
|
|
100
104
|
variant="secondary"
|
|
101
105
|
disabled={!hasBrowserPermission || !hasPermission}
|
|
102
|
-
data-testid={
|
|
106
|
+
data-testid={
|
|
107
|
+
optimisticIsMute ? 'audio-unmute-button' : 'audio-mute-button'
|
|
108
|
+
}
|
|
103
109
|
onClick={async () => {
|
|
104
110
|
if (!hasPermission) {
|
|
105
111
|
await requestPermission();
|
|
@@ -112,7 +118,7 @@ export const ToggleAudioPublishingButton = (
|
|
|
112
118
|
menuOffset={16}
|
|
113
119
|
{...restCompositeButtonProps}
|
|
114
120
|
>
|
|
115
|
-
<Icon icon={
|
|
121
|
+
<Icon icon={optimisticIsMute ? 'mic-off' : 'mic'} />
|
|
116
122
|
{(!hasBrowserPermission || !hasPermission) && (
|
|
117
123
|
<span className="str-video__no-media-permission">!</span>
|
|
118
124
|
)}
|
|
@@ -27,11 +27,11 @@ export const ToggleVideoPreviewButton = (
|
|
|
27
27
|
} = props;
|
|
28
28
|
const { t } = useI18n();
|
|
29
29
|
const { useCameraState } = useCallStateHooks();
|
|
30
|
-
const { camera,
|
|
30
|
+
const { camera, optimisticIsMute, hasBrowserPermission } = useCameraState();
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<CompositeButton
|
|
34
|
-
active={
|
|
34
|
+
active={optimisticIsMute}
|
|
35
35
|
caption={caption}
|
|
36
36
|
className={clsx(!hasBrowserPermission && 'str-video__device-unavailable')}
|
|
37
37
|
title={
|
|
@@ -41,7 +41,9 @@ export const ToggleVideoPreviewButton = (
|
|
|
41
41
|
}
|
|
42
42
|
variant="secondary"
|
|
43
43
|
data-testid={
|
|
44
|
-
|
|
44
|
+
optimisticIsMute
|
|
45
|
+
? 'preview-video-unmute-button'
|
|
46
|
+
: 'preview-video-mute-button'
|
|
45
47
|
}
|
|
46
48
|
onClick={() => camera.toggle()}
|
|
47
49
|
disabled={!hasBrowserPermission}
|
|
@@ -49,7 +51,7 @@ export const ToggleVideoPreviewButton = (
|
|
|
49
51
|
menuPlacement={menuPlacement}
|
|
50
52
|
{...restCompositeButtonProps}
|
|
51
53
|
>
|
|
52
|
-
<Icon icon={!
|
|
54
|
+
<Icon icon={!optimisticIsMute ? 'camera' : 'camera-off'} />
|
|
53
55
|
{!hasBrowserPermission && (
|
|
54
56
|
<span
|
|
55
57
|
className="str-video__no-media-permission"
|
|
@@ -81,7 +83,7 @@ export const ToggleVideoPublishingButton = (
|
|
|
81
83
|
useRequestPermission(OwnCapability.SEND_VIDEO);
|
|
82
84
|
|
|
83
85
|
const { useCameraState, useCallSettings } = useCallStateHooks();
|
|
84
|
-
const { camera,
|
|
86
|
+
const { camera, optimisticIsMute, hasBrowserPermission } = useCameraState();
|
|
85
87
|
const callSettings = useCallSettings();
|
|
86
88
|
const isPublishingVideoAllowed = callSettings?.video.enabled;
|
|
87
89
|
|
|
@@ -97,7 +99,7 @@ export const ToggleVideoPublishingButton = (
|
|
|
97
99
|
messageRevoked={t('You can no longer share your video.')}
|
|
98
100
|
>
|
|
99
101
|
<CompositeButton
|
|
100
|
-
active={
|
|
102
|
+
active={optimisticIsMute}
|
|
101
103
|
caption={caption}
|
|
102
104
|
variant="secondary"
|
|
103
105
|
title={
|
|
@@ -112,7 +114,9 @@ export const ToggleVideoPublishingButton = (
|
|
|
112
114
|
disabled={
|
|
113
115
|
!hasBrowserPermission || !hasPermission || !isPublishingVideoAllowed
|
|
114
116
|
}
|
|
115
|
-
data-testid={
|
|
117
|
+
data-testid={
|
|
118
|
+
optimisticIsMute ? 'video-unmute-button' : 'video-mute-button'
|
|
119
|
+
}
|
|
116
120
|
onClick={async () => {
|
|
117
121
|
if (!hasPermission) {
|
|
118
122
|
await requestPermission();
|
|
@@ -125,7 +129,7 @@ export const ToggleVideoPublishingButton = (
|
|
|
125
129
|
menuOffset={16}
|
|
126
130
|
{...restCompositeButtonProps}
|
|
127
131
|
>
|
|
128
|
-
<Icon icon={
|
|
132
|
+
<Icon icon={optimisticIsMute ? 'camera-off' : 'camera'} />
|
|
129
133
|
{(!hasBrowserPermission ||
|
|
130
134
|
!hasPermission ||
|
|
131
135
|
!isPublishingVideoAllowed) && (
|