@stream-io/video-react-sdk 1.0.1 → 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 +11 -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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [1.0.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.0.1...@stream-io/video-react-sdk-1.0.2) (2024-05-13)
|
|
6
|
+
|
|
7
|
+
### Dependency Updates
|
|
8
|
+
|
|
9
|
+
* `@stream-io/video-client` updated to version `1.0.2`
|
|
10
|
+
* `@stream-io/video-react-bindings` updated to version `0.4.28`
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* optimistically toggle device status ([#1342](https://github.com/GetStream/stream-video-js/issues/1342)) ([2e4e470](https://github.com/GetStream/stream-video-js/commit/2e4e470347fce7c7499dd21a931e5dec74bf9618))
|
|
15
|
+
|
|
5
16
|
### [1.0.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-react-sdk-1.0.0...@stream-io/video-react-sdk-1.0.1) (2024-05-07)
|
|
6
17
|
|
|
7
18
|
### Dependency Updates
|
package/dist/index.cjs.js
CHANGED
|
@@ -828,11 +828,11 @@ const ScreenShareButton = (props) => {
|
|
|
828
828
|
const { hasPermission, requestPermission, isAwaitingPermission } = useRequestPermission(videoClient.OwnCapability.SCREENSHARE);
|
|
829
829
|
const callSettings = useCallSettings();
|
|
830
830
|
const isScreenSharingAllowed = callSettings?.screensharing.enabled;
|
|
831
|
-
const { screenShare,
|
|
832
|
-
const
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SCREENSHARE], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SCREENSHARE, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now share your screen.'), messageAwaitingApproval: t('Awaiting for an approval to share screen.'), messageRevoked: t('You can no longer share your screen.'), children: jsxRuntime.jsx(CompositeButton, { active: isSomeoneScreenSharing, caption: caption, title: caption || t('Share screen'), variant: "primary", "data-testid": isSomeoneScreenSharing
|
|
831
|
+
const { screenShare, optimisticIsMute } = useScreenShareState();
|
|
832
|
+
const amIScreenSharing = !optimisticIsMute;
|
|
833
|
+
const disableScreenShareButton = !amIScreenSharing &&
|
|
834
|
+
(isSomeoneScreenSharing || isScreenSharingAllowed === false);
|
|
835
|
+
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SCREENSHARE], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SCREENSHARE, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now share your screen.'), messageAwaitingApproval: t('Awaiting for an approval to share screen.'), messageRevoked: t('You can no longer share your screen.'), children: jsxRuntime.jsx(CompositeButton, { active: isSomeoneScreenSharing || amIScreenSharing, caption: caption, title: caption || t('Share screen'), variant: "primary", "data-testid": isSomeoneScreenSharing
|
|
836
836
|
? 'screen-share-stop-button'
|
|
837
837
|
: 'screen-share-start-button', disabled: disableScreenShareButton, onClick: async () => {
|
|
838
838
|
if (!hasPermission) {
|
|
@@ -1006,62 +1006,66 @@ const ToggleAudioPreviewButton = (props) => {
|
|
|
1006
1006
|
const { caption, Menu, menuPlacement, ...restCompositeButtonProps } = props;
|
|
1007
1007
|
const { t } = videoReactBindings.useI18n();
|
|
1008
1008
|
const { useMicrophoneState } = videoReactBindings.useCallStateHooks();
|
|
1009
|
-
const { microphone,
|
|
1010
|
-
return (jsxRuntime.jsxs(CompositeButton, { active:
|
|
1009
|
+
const { microphone, optimisticIsMute, hasBrowserPermission } = useMicrophoneState();
|
|
1010
|
+
return (jsxRuntime.jsxs(CompositeButton, { active: optimisticIsMute, caption: caption, className: clsx(!hasBrowserPermission && 'str-video__device-unavailable'), variant: "secondary", title: !hasBrowserPermission
|
|
1011
1011
|
? t('Check your browser audio permissions')
|
|
1012
|
-
: caption || t('Mic'), disabled: !hasBrowserPermission, "data-testid":
|
|
1012
|
+
: caption || t('Mic'), disabled: !hasBrowserPermission, "data-testid": optimisticIsMute
|
|
1013
|
+
? 'preview-audio-unmute-button'
|
|
1014
|
+
: 'preview-audio-mute-button', onClick: () => microphone.toggle(), Menu: Menu, menuPlacement: menuPlacement, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon: !optimisticIsMute ? 'mic' : 'mic-off' }), !hasBrowserPermission && (jsxRuntime.jsx("span", { className: "str-video__no-media-permission", title: t('Check your browser audio permissions'), children: "!" }))] }));
|
|
1013
1015
|
};
|
|
1014
1016
|
const ToggleAudioPublishingButton = (props) => {
|
|
1015
1017
|
const { t } = videoReactBindings.useI18n();
|
|
1016
1018
|
const { caption, Menu = jsxRuntime.jsx(DeviceSelectorAudioInput, { visualType: "list" }), menuPlacement = 'top', ...restCompositeButtonProps } = props;
|
|
1017
1019
|
const { hasPermission, requestPermission, isAwaitingPermission } = useRequestPermission(videoClient.OwnCapability.SEND_AUDIO);
|
|
1018
1020
|
const { useMicrophoneState } = videoReactBindings.useCallStateHooks();
|
|
1019
|
-
const { microphone,
|
|
1020
|
-
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SEND_AUDIO], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SEND_AUDIO, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now speak.'), messageAwaitingApproval: t('Awaiting for an approval to speak.'), messageRevoked: t('You can no longer speak.'), children: jsxRuntime.jsxs(CompositeButton, { active:
|
|
1021
|
+
const { microphone, optimisticIsMute, hasBrowserPermission } = useMicrophoneState();
|
|
1022
|
+
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SEND_AUDIO], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SEND_AUDIO, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now speak.'), messageAwaitingApproval: t('Awaiting for an approval to speak.'), messageRevoked: t('You can no longer speak.'), children: jsxRuntime.jsxs(CompositeButton, { active: optimisticIsMute, caption: caption, title: !hasPermission
|
|
1021
1023
|
? t('You have no permission to share your audio')
|
|
1022
1024
|
: !hasBrowserPermission
|
|
1023
1025
|
? t('Check your browser mic permissions')
|
|
1024
|
-
: caption || t('Mic'), variant: "secondary", disabled: !hasBrowserPermission || !hasPermission, "data-testid":
|
|
1026
|
+
: caption || t('Mic'), variant: "secondary", disabled: !hasBrowserPermission || !hasPermission, "data-testid": optimisticIsMute ? 'audio-unmute-button' : 'audio-mute-button', onClick: async () => {
|
|
1025
1027
|
if (!hasPermission) {
|
|
1026
1028
|
await requestPermission();
|
|
1027
1029
|
}
|
|
1028
1030
|
else {
|
|
1029
1031
|
await microphone.toggle();
|
|
1030
1032
|
}
|
|
1031
|
-
}, Menu: Menu, menuPlacement: menuPlacement, menuOffset: 16, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon:
|
|
1033
|
+
}, Menu: Menu, menuPlacement: menuPlacement, menuOffset: 16, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon: optimisticIsMute ? 'mic-off' : 'mic' }), (!hasBrowserPermission || !hasPermission) && (jsxRuntime.jsx("span", { className: "str-video__no-media-permission", children: "!" }))] }) }) }));
|
|
1032
1034
|
};
|
|
1033
1035
|
|
|
1034
1036
|
const ToggleVideoPreviewButton = (props) => {
|
|
1035
1037
|
const { caption, Menu = DeviceSelectorVideo, menuPlacement = 'top', ...restCompositeButtonProps } = props;
|
|
1036
1038
|
const { t } = videoReactBindings.useI18n();
|
|
1037
1039
|
const { useCameraState } = videoReactBindings.useCallStateHooks();
|
|
1038
|
-
const { camera,
|
|
1039
|
-
return (jsxRuntime.jsxs(CompositeButton, { active:
|
|
1040
|
+
const { camera, optimisticIsMute, hasBrowserPermission } = useCameraState();
|
|
1041
|
+
return (jsxRuntime.jsxs(CompositeButton, { active: optimisticIsMute, caption: caption, className: clsx(!hasBrowserPermission && 'str-video__device-unavailable'), title: !hasBrowserPermission
|
|
1040
1042
|
? t('Check your browser video permissions')
|
|
1041
|
-
: caption || t('Video'), variant: "secondary", "data-testid":
|
|
1043
|
+
: caption || t('Video'), variant: "secondary", "data-testid": optimisticIsMute
|
|
1044
|
+
? 'preview-video-unmute-button'
|
|
1045
|
+
: 'preview-video-mute-button', onClick: () => camera.toggle(), disabled: !hasBrowserPermission, Menu: Menu, menuPlacement: menuPlacement, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon: !optimisticIsMute ? 'camera' : 'camera-off' }), !hasBrowserPermission && (jsxRuntime.jsx("span", { className: "str-video__no-media-permission", title: t('Check your browser video permissions'), children: "!" }))] }));
|
|
1042
1046
|
};
|
|
1043
1047
|
const ToggleVideoPublishingButton = (props) => {
|
|
1044
1048
|
const { t } = videoReactBindings.useI18n();
|
|
1045
1049
|
const { caption, Menu = jsxRuntime.jsx(DeviceSelectorVideo, { visualType: "list" }), menuPlacement = 'top', ...restCompositeButtonProps } = props;
|
|
1046
1050
|
const { hasPermission, requestPermission, isAwaitingPermission } = useRequestPermission(videoClient.OwnCapability.SEND_VIDEO);
|
|
1047
1051
|
const { useCameraState, useCallSettings } = videoReactBindings.useCallStateHooks();
|
|
1048
|
-
const { camera,
|
|
1052
|
+
const { camera, optimisticIsMute, hasBrowserPermission } = useCameraState();
|
|
1049
1053
|
const callSettings = useCallSettings();
|
|
1050
1054
|
const isPublishingVideoAllowed = callSettings?.video.enabled;
|
|
1051
|
-
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SEND_VIDEO], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SEND_VIDEO, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now share your video.'), messageAwaitingApproval: t('Awaiting for an approval to share your video.'), messageRevoked: t('You can no longer share your video.'), children: jsxRuntime.jsxs(CompositeButton, { active:
|
|
1055
|
+
return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [videoClient.OwnCapability.SEND_VIDEO], children: jsxRuntime.jsx(PermissionNotification, { permission: videoClient.OwnCapability.SEND_VIDEO, isAwaitingApproval: isAwaitingPermission, messageApproved: t('You can now share your video.'), messageAwaitingApproval: t('Awaiting for an approval to share your video.'), messageRevoked: t('You can no longer share your video.'), children: jsxRuntime.jsxs(CompositeButton, { active: optimisticIsMute, caption: caption, variant: "secondary", title: !hasPermission
|
|
1052
1056
|
? t('You have no permission to share your video')
|
|
1053
1057
|
: !hasBrowserPermission
|
|
1054
1058
|
? t('Check your browser video permissions')
|
|
1055
1059
|
: !isPublishingVideoAllowed
|
|
1056
1060
|
? t('Video publishing is disabled by the system')
|
|
1057
|
-
: caption || t('Video'), disabled: !hasBrowserPermission || !hasPermission || !isPublishingVideoAllowed, "data-testid":
|
|
1061
|
+
: caption || t('Video'), disabled: !hasBrowserPermission || !hasPermission || !isPublishingVideoAllowed, "data-testid": optimisticIsMute ? 'video-unmute-button' : 'video-mute-button', onClick: async () => {
|
|
1058
1062
|
if (!hasPermission) {
|
|
1059
1063
|
await requestPermission();
|
|
1060
1064
|
}
|
|
1061
1065
|
else {
|
|
1062
1066
|
await camera.toggle();
|
|
1063
1067
|
}
|
|
1064
|
-
}, Menu: Menu, menuPlacement: menuPlacement, menuOffset: 16, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon:
|
|
1068
|
+
}, Menu: Menu, menuPlacement: menuPlacement, menuOffset: 16, ...restCompositeButtonProps, children: [jsxRuntime.jsx(Icon, { icon: optimisticIsMute ? 'camera-off' : 'camera' }), (!hasBrowserPermission ||
|
|
1065
1069
|
!hasPermission ||
|
|
1066
1070
|
!isPublishingVideoAllowed) && (jsxRuntime.jsx("span", { className: "str-video__no-media-permission", children: "!" }))] }) }) }));
|
|
1067
1071
|
};
|
|
@@ -2510,7 +2514,7 @@ const VerticalScrollButtons = ({ scrollWrapper, }) => {
|
|
|
2510
2514
|
};
|
|
2511
2515
|
const hasScreenShare = (p) => !!p?.publishedTracks.includes(videoClient.SfuModels.TrackType.SCREEN_SHARE);
|
|
2512
2516
|
|
|
2513
|
-
const [major, minor, patch] = ("1.0.
|
|
2517
|
+
const [major, minor, patch] = ("1.0.2" ).split('.');
|
|
2514
2518
|
videoClient.setSdkInfo({
|
|
2515
2519
|
type: videoClient.SfuModels.SdkType.REACT,
|
|
2516
2520
|
major,
|