@stream-io/video-react-sdk 1.34.0 → 1.34.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.
Files changed (28) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/{background-filters-Zu84SkRR.cjs.js → background-filters-DdQqSx4T.cjs.js} +7 -3
  3. package/dist/background-filters-DdQqSx4T.cjs.js.map +1 -0
  4. package/dist/{background-filters-RdXfNf6_.es.js → background-filters-g6ozIvlN.es.js} +7 -3
  5. package/dist/background-filters-g6ozIvlN.es.js.map +1 -0
  6. package/dist/{embedded-BackgroundFilters-Zu84SkRR.cjs.js → embedded-BackgroundFilters-DdQqSx4T.cjs.js} +7 -3
  7. package/dist/embedded-BackgroundFilters-DdQqSx4T.cjs.js.map +1 -0
  8. package/dist/{embedded-BackgroundFilters-RdXfNf6_.es.js → embedded-BackgroundFilters-g6ozIvlN.es.js} +7 -3
  9. package/dist/embedded-BackgroundFilters-g6ozIvlN.es.js.map +1 -0
  10. package/dist/embedded.cjs.js +38 -37
  11. package/dist/embedded.cjs.js.map +1 -1
  12. package/dist/embedded.es.js +38 -37
  13. package/dist/embedded.es.js.map +1 -1
  14. package/dist/index.cjs.js +43 -40
  15. package/dist/index.cjs.js.map +1 -1
  16. package/dist/index.es.js +43 -40
  17. package/dist/index.es.js.map +1 -1
  18. package/dist/src/components/BackgroundFilters/types.d.ts +6 -1
  19. package/dist/src/components/CallControls/RecordCallButton.d.ts +6 -5
  20. package/package.json +4 -4
  21. package/src/components/BackgroundFilters/BackgroundFilters.tsx +6 -0
  22. package/src/components/BackgroundFilters/types.ts +7 -0
  23. package/src/components/CallControls/RecordCallButton.tsx +26 -13
  24. package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +3 -4
  25. package/dist/background-filters-RdXfNf6_.es.js.map +0 -1
  26. package/dist/background-filters-Zu84SkRR.cjs.js.map +0 -1
  27. package/dist/embedded-BackgroundFilters-RdXfNf6_.es.js.map +0 -1
  28. package/dist/embedded-BackgroundFilters-Zu84SkRR.cjs.js.map +0 -1
@@ -686,7 +686,7 @@ const AvatarFallback = ({ className, names, style, }) => {
686
686
  return (jsxRuntime.jsx("div", { className: clsx('str-video__avatar--initials-fallback', className), style: style, children: jsxRuntime.jsxs("div", { children: [names[0][0], names[1]?.[0]] }) }));
687
687
  };
688
688
 
689
- const BackgroundFiltersProviderImpl = react.lazy(() => Promise.resolve().then(function () { return require('./embedded-BackgroundFilters-Zu84SkRR.cjs.js'); }).then((m) => ({
689
+ const BackgroundFiltersProviderImpl = react.lazy(() => Promise.resolve().then(function () { return require('./embedded-BackgroundFilters-DdQqSx4T.cjs.js'); }).then((m) => ({
690
690
  default: m.BackgroundFiltersProvider,
691
691
  })));
692
692
  /**
@@ -864,23 +864,53 @@ const WithTooltip = ({ title, tooltipClassName, tooltipPlacement, tooltipDisable
864
864
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { referenceElement: tooltipAnchor, visible: tooltipActuallyVisible, tooltipClassName: tooltipClassName, tooltipPlacement: tooltipPlacement, children: title || '' }), jsxRuntime.jsx("div", { ref: setTooltipAnchor, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...props })] }));
865
865
  };
866
866
 
867
- const RecordEndConfirmation = () => {
867
+ /**
868
+ * Wraps an event handler, silencing and logging exceptions (excluding the NotAllowedError
869
+ * DOMException, which is a normal situation handled by the SDK)
870
+ *
871
+ * @param props component props, including the onError callback
872
+ * @param handler event handler to wrap
873
+ */
874
+ const createCallControlHandler = (props, handler) => {
875
+ return async () => {
876
+ try {
877
+ await handler();
878
+ }
879
+ catch (error) {
880
+ if (props.onError) {
881
+ props.onError(error);
882
+ return;
883
+ }
884
+ if (!isNotAllowedError(error)) {
885
+ console.error('Call control handler failed', error);
886
+ }
887
+ }
888
+ };
889
+ };
890
+ function isNotAllowedError(error) {
891
+ return error instanceof DOMException && error.name === 'NotAllowedError';
892
+ }
893
+
894
+ const RecordEndConfirmation = (props) => {
868
895
  const { t } = videoReactBindings.useI18n();
869
896
  const { toggleCallRecording, isAwaitingResponse } = videoReactBindings.useToggleCallRecording();
870
897
  const { close } = useMenuContext();
871
- return (jsxRuntime.jsxs("div", { className: "str-video__end-recording__confirmation", children: [jsxRuntime.jsxs("div", { className: "str-video__end-recording__header", children: [jsxRuntime.jsx(Icon, { icon: "recording-on" }), jsxRuntime.jsx("h2", { className: "str-video__end-recording__heading", children: t('End recording') })] }), jsxRuntime.jsx("p", { className: "str-video__end-recording__description", children: t('Are you sure you want end the recording?') }), jsxRuntime.jsxs("div", { className: "str-video__end-recording__actions", children: [jsxRuntime.jsx(CompositeButton, { variant: "secondary", onClick: close, children: t('Cancel') }), jsxRuntime.jsx(CompositeButton, { variant: "primary", onClick: toggleCallRecording, children: isAwaitingResponse ? jsxRuntime.jsx(LoadingIndicator, {}) : t('End recording') })] })] }));
898
+ const handleClick = createCallControlHandler(props, toggleCallRecording);
899
+ return (jsxRuntime.jsxs("div", { className: "str-video__end-recording__confirmation", children: [jsxRuntime.jsxs("div", { className: "str-video__end-recording__header", children: [jsxRuntime.jsx(Icon, { icon: "recording-on" }), jsxRuntime.jsx("h2", { className: "str-video__end-recording__heading", children: t('End recording') })] }), jsxRuntime.jsx("p", { className: "str-video__end-recording__description", children: t('Are you sure you want end the recording?') }), jsxRuntime.jsxs("div", { className: "str-video__end-recording__actions", children: [jsxRuntime.jsx(CompositeButton, { variant: "secondary", onClick: close, children: t('Cancel') }), jsxRuntime.jsx(CompositeButton, { variant: "primary", onClick: isAwaitingResponse ? undefined : handleClick, children: isAwaitingResponse ? jsxRuntime.jsx(LoadingIndicator, {}) : t('End recording') })] })] }));
872
900
  };
873
901
  const ToggleEndRecordingMenuButton = react.forwardRef(function ToggleEndRecordingMenuButton(props, ref) {
874
902
  return (jsxRuntime.jsx(CompositeButton, { ref: ref, active: true, variant: "secondary", "data-testid": "recording-stop-button", children: jsxRuntime.jsx(Icon, { icon: "recording-off" }) }));
875
903
  });
876
- const RecordCallConfirmationButton = ({ caption, }) => {
904
+ const RecordCallConfirmationButton = (props) => {
905
+ const { caption } = props;
877
906
  const { t } = videoReactBindings.useI18n();
878
907
  const { toggleCallRecording, isAwaitingResponse, isCallRecordingInProgress } = videoReactBindings.useToggleCallRecording();
908
+ const handleClick = createCallControlHandler(props, toggleCallRecording);
879
909
  if (isCallRecordingInProgress) {
880
910
  return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [
881
911
  videoClient.OwnCapability.START_RECORD_CALL,
882
912
  videoClient.OwnCapability.STOP_RECORD_CALL,
883
- ], children: jsxRuntime.jsx(MenuToggle, { ToggleButton: ToggleEndRecordingMenuButton, visualType: MenuVisualType.PORTAL, children: jsxRuntime.jsx(RecordEndConfirmation, {}) }) }));
913
+ ], children: jsxRuntime.jsx(MenuToggle, { ToggleButton: ToggleEndRecordingMenuButton, visualType: MenuVisualType.PORTAL, children: jsxRuntime.jsx(RecordEndConfirmation, { onError: props.onError }) }) }));
884
914
  }
885
915
  const title = isAwaitingResponse
886
916
  ? t('Waiting for recording to start...')
@@ -888,7 +918,7 @@ const RecordCallConfirmationButton = ({ caption, }) => {
888
918
  return (jsxRuntime.jsx(videoReactBindings.Restricted, { requiredGrants: [
889
919
  videoClient.OwnCapability.START_RECORD_CALL,
890
920
  videoClient.OwnCapability.STOP_RECORD_CALL,
891
- ], children: jsxRuntime.jsx(WithTooltip, { title: title, children: jsxRuntime.jsx(CompositeButton, { active: isCallRecordingInProgress, caption: caption, variant: "secondary", "data-testid": "recording-start-button", onClick: isAwaitingResponse ? undefined : toggleCallRecording, children: isAwaitingResponse ? (jsxRuntime.jsx(LoadingIndicator, {})) : (jsxRuntime.jsx(Icon, { icon: "recording-off" })) }) }) }));
921
+ ], children: jsxRuntime.jsx(WithTooltip, { title: title, children: jsxRuntime.jsx(CompositeButton, { active: isCallRecordingInProgress, caption: caption, variant: "secondary", "data-testid": "recording-start-button", onClick: isAwaitingResponse ? undefined : handleClick, children: isAwaitingResponse ? (jsxRuntime.jsx(LoadingIndicator, {})) : (jsxRuntime.jsx(Icon, { icon: "recording-off" })) }) }) }));
892
922
  };
893
923
 
894
924
  const defaultEmojiReactionMap = {
@@ -963,33 +993,6 @@ const DefaultReactionsMenu = ({ reactions, layout = 'horizontal', }) => {
963
993
  }, children: reaction.emoji_code && defaultEmojiReactionMap[reaction.emoji_code] }, reaction.emoji_code))) }));
964
994
  };
965
995
 
966
- /**
967
- * Wraps an event handler, silencing and logging exceptions (excluding the NotAllowedError
968
- * DOMException, which is a normal situation handled by the SDK)
969
- *
970
- * @param props component props, including the onError callback
971
- * @param handler event handler to wrap
972
- */
973
- const createCallControlHandler = (props, handler) => {
974
- return async () => {
975
- try {
976
- await handler();
977
- }
978
- catch (error) {
979
- if (props.onError) {
980
- props.onError(error);
981
- return;
982
- }
983
- if (!isNotAllowedError(error)) {
984
- console.error('Call control handler failed', error);
985
- }
986
- }
987
- };
988
- };
989
- function isNotAllowedError(error) {
990
- return error instanceof DOMException && error.name === 'NotAllowedError';
991
- }
992
-
993
996
  const ScreenShareButton = (props) => {
994
997
  const { t } = videoReactBindings.useI18n();
995
998
  const { caption, optimisticUpdates } = props;
@@ -1153,7 +1156,7 @@ const SpeakerTest = (props) => {
1153
1156
  const audioElementRef = react.useRef(null);
1154
1157
  const [isPlaying, setIsPlaying] = react.useState(false);
1155
1158
  const { t } = videoReactBindings.useI18n();
1156
- const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.34.0"}/assets/piano.mp3`, } = props;
1159
+ const { audioUrl = `https://unpkg.com/${"@stream-io/video-react-sdk"}@${"1.34.2"}/assets/piano.mp3`, } = props;
1157
1160
  // Update audio output device when selection changes
1158
1161
  react.useEffect(() => {
1159
1162
  const audio = audioElementRef.current;
@@ -1796,9 +1799,7 @@ const ParticipantDetails = ({ indicatorsVisible = true, }) => {
1796
1799
  const isTrackPaused = trackType !== 'none' ? videoClient.hasPausedTrack(participant, trackType) : false;
1797
1800
  const isAudioTrackUnmuted = useIsTrackUnmuted(participant);
1798
1801
  const isAudioConnecting = hasAudioTrack && !isAudioTrackUnmuted;
1799
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "str-video__participant-details", children: jsxRuntime.jsxs("div", { className: "str-video__participant-details__name", children: [name || userId, indicatorsVisible && isAudioConnecting && (jsxRuntime.jsx(LoadingIndicator, { className: "str-video__participant-details__name--audio-connecting", tooltip: t('Audio is connecting...') })), indicatorsVisible && !hasAudioTrack && (jsxRuntime.jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideoTrack && (jsxRuntime.jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && isTrackPaused && (jsxRuntime.jsx("span", { title: t('Video paused due to insufficient bandwidth'), className: "str-video__participant-details__name--track-paused" })), indicatorsVisible && canUnpin && (
1800
- // TODO: remove this monstrosity once we have a proper design
1801
- jsxRuntime.jsx("span", { title: t('Unpin'), onClick: () => call?.unpin(sessionId), className: "str-video__participant-details__name--pinned" })), indicatorsVisible && jsxRuntime.jsx(SpeechIndicator, {})] }) }), indicatorsVisible && (jsxRuntime.jsx(Notification, { isVisible: isLocalParticipant &&
1802
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "str-video__participant-details", children: jsxRuntime.jsxs("div", { className: "str-video__participant-details__name", children: [name || userId, indicatorsVisible && isAudioConnecting && (jsxRuntime.jsx(LoadingIndicator, { className: "str-video__participant-details__name--audio-connecting", tooltip: t('Audio is connecting...') })), indicatorsVisible && !hasAudioTrack && (jsxRuntime.jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideoTrack && (jsxRuntime.jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && isTrackPaused && (jsxRuntime.jsx("span", { title: t('Video paused due to insufficient bandwidth'), className: "str-video__participant-details__name--track-paused" })), indicatorsVisible && pin && (jsxRuntime.jsx("span", { title: canUnpin ? t('Unpin') : t('Pinned'), onClick: canUnpin ? () => call?.unpin(sessionId) : undefined, className: "str-video__participant-details__name--pinned" })), indicatorsVisible && jsxRuntime.jsx(SpeechIndicator, {})] }) }), indicatorsVisible && (jsxRuntime.jsx(Notification, { isVisible: isLocalParticipant &&
1802
1803
  connectionQuality === videoClient.SfuModels.ConnectionQuality.POOR, message: t('Poor connection quality'), children: connectionQualityAsString && (jsxRuntime.jsx("span", { className: clsx('str-video__participant-details__connection-quality', `str-video__participant-details__connection-quality--${connectionQualityAsString}`), title: connectionQualityAsString })) }))] }));
1803
1804
  };
1804
1805
  const SpeechIndicator = () => {