@stream-io/video-react-sdk 1.40.0 → 1.40.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 (135) hide show
  1. package/CHANGELOG.md +24 -3
  2. package/dist/background-filters-D2U5UBbH.es.js.map +1 -1
  3. package/dist/background-filters-folwWrgs.cjs.js.map +1 -1
  4. package/dist/embedded-BackgroundFilters-D2U5UBbH.es.js.map +1 -1
  5. package/dist/embedded-BackgroundFilters-folwWrgs.cjs.js.map +1 -1
  6. package/dist/embedded.cjs.js +24 -23
  7. package/dist/embedded.cjs.js.map +1 -1
  8. package/dist/embedded.es.js +24 -23
  9. package/dist/embedded.es.js.map +1 -1
  10. package/dist/index.cjs.js +23 -22
  11. package/dist/index.cjs.js.map +1 -1
  12. package/dist/index.es.js +23 -22
  13. package/dist/index.es.js.map +1 -1
  14. package/dist/src/components/Avatar/Avatar.d.ts +2 -2
  15. package/dist/src/components/BackgroundFilters/BackgroundFilters.d.ts +1 -1
  16. package/dist/src/components/BackgroundFilters/BackgroundFiltersProvider.d.ts +1 -1
  17. package/dist/src/components/Button/TextButton.d.ts +1 -1
  18. package/dist/src/components/CallControls/AcceptCallButton.d.ts +1 -1
  19. package/dist/src/components/CallControls/CallControls.d.ts +1 -1
  20. package/dist/src/components/CallControls/CallStatsButton.d.ts +1 -1
  21. package/dist/src/components/CallControls/CancelCallButton.d.ts +2 -2
  22. package/dist/src/components/CallControls/ReactionsButton.d.ts +2 -2
  23. package/dist/src/components/CallControls/RecordCallButton.d.ts +2 -2
  24. package/dist/src/components/CallControls/ScreenShareButton.d.ts +1 -1
  25. package/dist/src/components/CallControls/ToggleAudioButton.d.ts +2 -2
  26. package/dist/src/components/CallControls/ToggleAudioOutputButton.d.ts +1 -1
  27. package/dist/src/components/CallControls/ToggleVideoButton.d.ts +2 -2
  28. package/dist/src/components/CallParticipantsList/BlockedUserListing.d.ts +1 -1
  29. package/dist/src/components/CallParticipantsList/CallParticipantListHeader.d.ts +1 -1
  30. package/dist/src/components/CallParticipantsList/CallParticipantListing.d.ts +1 -1
  31. package/dist/src/components/CallParticipantsList/CallParticipantListingItem.d.ts +1 -1
  32. package/dist/src/components/CallParticipantsList/CallParticipantsList.d.ts +1 -1
  33. package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.d.ts +1 -1
  34. package/dist/src/components/CallPreview/CallPreview.d.ts +1 -1
  35. package/dist/src/components/CallRecordingList/CallRecordingList.d.ts +1 -1
  36. package/dist/src/components/CallRecordingList/CallRecordingListHeader.d.ts +1 -1
  37. package/dist/src/components/CallRecordingList/CallRecordingListItem.d.ts +1 -1
  38. package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.d.ts +1 -1
  39. package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.d.ts +1 -1
  40. package/dist/src/components/CallStats/CallStats.d.ts +2 -2
  41. package/dist/src/components/CallStats/CallStatsLatencyChart.d.ts +1 -1
  42. package/dist/src/components/DeviceSettings/AudioVolumeIndicator.d.ts +1 -1
  43. package/dist/src/components/DeviceSettings/DeviceAudioPreviewItem.d.ts +1 -1
  44. package/dist/src/components/DeviceSettings/DeviceSelector.d.ts +1 -1
  45. package/dist/src/components/DeviceSettings/DeviceSelectorAudio.d.ts +2 -2
  46. package/dist/src/components/DeviceSettings/DeviceSelectorVideo.d.ts +1 -1
  47. package/dist/src/components/DeviceSettings/DeviceSettings.d.ts +1 -1
  48. package/dist/src/components/DeviceSettings/DeviceVideoPreviewItem.d.ts +1 -1
  49. package/dist/src/components/DeviceSettings/SpeakerTest.d.ts +1 -1
  50. package/dist/src/components/DropdownSelect/DropdownSelect.d.ts +2 -2
  51. package/dist/src/components/Icon/Icon.d.ts +1 -1
  52. package/dist/src/components/LoadingIndicator/LoadingIndicator.d.ts +1 -1
  53. package/dist/src/components/Menu/GenericMenu.d.ts +2 -2
  54. package/dist/src/components/Menu/MenuToggle.d.ts +1 -1
  55. package/dist/src/components/NoiseCancellation/NoiseCancellationProvider.d.ts +1 -1
  56. package/dist/src/components/Notification/MicCaptureErrorNotification.d.ts +1 -1
  57. package/dist/src/components/Notification/Notification.d.ts +1 -1
  58. package/dist/src/components/Notification/PermissionNotification.d.ts +1 -1
  59. package/dist/src/components/Notification/RecordingInProgressNotification.d.ts +1 -1
  60. package/dist/src/components/Notification/SpeakingWhileMutedNotification.d.ts +1 -1
  61. package/dist/src/components/Permissions/PermissionRequests.d.ts +1 -1
  62. package/dist/src/components/Reaction/Reaction.d.ts +1 -1
  63. package/dist/src/components/RingingCall/RingingCall.d.ts +1 -1
  64. package/dist/src/components/RingingCall/RingingCallControls.d.ts +1 -1
  65. package/dist/src/components/Search/SearchInput.d.ts +1 -1
  66. package/dist/src/components/Search/SearchResults.d.ts +1 -1
  67. package/dist/src/components/StreamTheme/StreamTheme.d.ts +1 -1
  68. package/dist/src/components/Tooltip/Tooltip.d.ts +1 -1
  69. package/dist/src/components/Tooltip/WithTooltip.d.ts +1 -1
  70. package/dist/src/components/VideoPreview/VideoPreview.d.ts +1 -1
  71. package/dist/src/core/components/Audio/Audio.d.ts +1 -1
  72. package/dist/src/core/components/Audio/ParticipantsAudio.d.ts +1 -1
  73. package/dist/src/core/components/CallLayout/LivestreamLayout.d.ts +2 -2
  74. package/dist/src/core/components/CallLayout/PaginatedGridLayout.d.ts +1 -1
  75. package/dist/src/core/components/CallLayout/PipLayout/Grid.d.ts +1 -1
  76. package/dist/src/core/components/CallLayout/PipLayout/Host.d.ts +1 -1
  77. package/dist/src/core/components/CallLayout/PipLayout/Pip.d.ts +1 -1
  78. package/dist/src/core/components/CallLayout/PipLayout/index.d.ts +3 -3
  79. package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +1 -1
  80. package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +5 -5
  81. package/dist/src/core/components/ParticipantView/ParticipantActionsContextMenu.d.ts +1 -1
  82. package/dist/src/core/components/StreamVideo/StreamVideo.d.ts +1 -1
  83. package/dist/src/core/components/Video/Video.d.ts +1 -1
  84. package/dist/src/embedded/EmbeddedClientProvider.d.ts +1 -1
  85. package/dist/src/embedded/call/CallControls.d.ts +1 -1
  86. package/dist/src/embedded/call/CallHeader.d.ts +1 -1
  87. package/dist/src/embedded/call/CallLayout.d.ts +1 -1
  88. package/dist/src/embedded/call/CallStateRouter.d.ts +1 -1
  89. package/dist/src/embedded/call/EmbeddedCall.d.ts +1 -1
  90. package/dist/src/embedded/context/ConfigurationContext.d.ts +1 -1
  91. package/dist/src/embedded/livestream/EmbeddedLivestream.d.ts +1 -1
  92. package/dist/src/embedded/livestream/LivestreamUI.d.ts +1 -1
  93. package/dist/src/embedded/livestream/host/HostLayout.d.ts +1 -1
  94. package/dist/src/embedded/livestream/host/HostStateRouter.d.ts +1 -1
  95. package/dist/src/embedded/livestream/viewer/ViewerLayout.d.ts +1 -1
  96. package/dist/src/embedded/livestream/viewer/ViewerLobby.d.ts +1 -1
  97. package/dist/src/embedded/livestream/viewer/ViewerStateRouter.d.ts +1 -1
  98. package/dist/src/embedded/shared/BlurToggleButton/BlurToggleButton.d.ts +2 -2
  99. package/dist/src/embedded/shared/CallFeedback/CallEndedScreen.d.ts +1 -1
  100. package/dist/src/embedded/shared/CallFeedback/CallFeedback.d.ts +1 -1
  101. package/dist/src/embedded/shared/CallFeedback/RatingScreen.d.ts +1 -1
  102. package/dist/src/embedded/shared/CallFeedback/StarRating.d.ts +1 -1
  103. package/dist/src/embedded/shared/CallFeedback/ThankYouScreen.d.ts +1 -1
  104. package/dist/src/embedded/shared/ConnectionNotification/ConnectionNotification.d.ts +1 -1
  105. package/dist/src/embedded/shared/EmbeddedParticipantViewUI/EmbeddedParticipantViewUI.d.ts +1 -1
  106. package/dist/src/embedded/shared/JoinError/JoinError.d.ts +1 -1
  107. package/dist/src/embedded/shared/Lobby/DeviceControls.d.ts +1 -1
  108. package/dist/src/embedded/shared/Lobby/DisabledDeviceButton.d.ts +1 -1
  109. package/dist/src/embedded/shared/Lobby/Lobby.d.ts +1 -1
  110. package/dist/src/embedded/shared/Lobby/ToggleCameraButton.d.ts +1 -1
  111. package/dist/src/embedded/shared/Lobby/ToggleMicButton.d.ts +1 -1
  112. package/dist/src/embedded/shared/Lobby/VideoPreviewFallbacks.d.ts +2 -2
  113. package/dist/src/embedded/shared/ViewersCount/ViewersCount.d.ts +1 -1
  114. package/dist/src/wrappers/LivestreamPlayer/LivestreamPlayer.d.ts +1 -1
  115. package/package.json +13 -13
  116. package/src/components/BackgroundFilters/BackgroundFilters.tsx +2 -4
  117. package/src/components/Button/CompositeButton.tsx +2 -2
  118. package/src/components/Button/IconButton.tsx +1 -1
  119. package/src/components/CallControls/CallStatsButton.tsx +1 -1
  120. package/src/components/CallControls/CancelCallButton.tsx +1 -1
  121. package/src/components/CallControls/ReactionsButton.tsx +1 -1
  122. package/src/components/CallControls/RecordCallButton.tsx +1 -1
  123. package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +2 -2
  124. package/src/components/CallParticipantsList/CallParticipantsList.tsx +1 -1
  125. package/src/components/DeviceSettings/DeviceSettings.tsx +1 -1
  126. package/src/components/Permissions/PermissionRequests.tsx +1 -1
  127. package/src/core/components/Audio/Audio.tsx +1 -1
  128. package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +1 -1
  129. package/src/core/components/ParticipantView/ParticipantView.tsx +124 -120
  130. package/src/core/components/Video/BaseVideo.tsx +1 -1
  131. package/src/core/components/Video/DefaultPictureInPicturePlaceholder.tsx +1 -1
  132. package/src/core/components/Video/DefaultVideoPlaceholder.tsx +1 -1
  133. package/src/embedded/shared/Lobby/ToggleCameraButton.tsx +1 -1
  134. package/src/embedded/shared/Lobby/ToggleMicButton.tsx +1 -1
  135. package/src/embedded/types.ts +1 -3
@@ -72,131 +72,135 @@ export type ParticipantViewProps = {
72
72
  } & Pick<VideoProps, 'VideoPlaceholder' | 'PictureInPicturePlaceholder'>;
73
73
 
74
74
  export const ParticipantView = memo(
75
- forwardRef<HTMLDivElement, ParticipantViewProps>(function ParticipantView(
76
- {
77
- participant,
78
- trackType = 'videoTrack',
79
- mirror,
80
- muteAudio,
81
- refs: { setVideoElement, setVideoPlaceholderElement } = {},
82
- className,
83
- VideoPlaceholder,
84
- PictureInPicturePlaceholder,
85
- ParticipantViewUI = DefaultParticipantViewUI as ComponentType,
86
- },
87
- ref,
88
- ) {
89
- const { isLocalParticipant, isSpeaking, isDominantSpeaker, sessionId } =
90
- participant;
91
-
92
- const hasAudioTrack = hasAudio(participant);
93
- const hasVideoTrack = hasVideo(participant);
94
- const hasScreenShareAudioTrack = hasScreenShareAudio(participant);
95
-
96
- const [trackedElement, setTrackedElement] = useState<HTMLDivElement | null>(
97
- null,
98
- );
99
-
100
- const [contextVideoElement, setContextVideoElement] =
101
- useState<HTMLVideoElement | null>(null);
102
-
103
- const [contextVideoPlaceholderElement, setContextVideoPlaceholderElement] =
104
- useState<HTMLDivElement | null>(null);
105
-
106
- useTrackElementVisibility({
107
- sessionId,
108
- trackedElement,
109
- trackType,
110
- });
111
-
112
- const { useIncomingVideoSettings } = useCallStateHooks();
113
- const { isParticipantVideoEnabled } = useIncomingVideoSettings();
114
-
115
- const participantViewContextValue = useMemo(
116
- () => ({
75
+ forwardRef<HTMLDivElement, ParticipantViewProps>(
76
+ function ParticipantViewRender(
77
+ {
117
78
  participant,
118
- participantViewElement: trackedElement,
119
- videoElement: contextVideoElement,
120
- videoPlaceholderElement: contextVideoPlaceholderElement,
121
- trackType,
122
- }),
123
- [
124
- contextVideoElement,
79
+ trackType = 'videoTrack',
80
+ mirror,
81
+ muteAudio,
82
+ refs: { setVideoElement, setVideoPlaceholderElement } = {},
83
+ className,
84
+ VideoPlaceholder,
85
+ PictureInPicturePlaceholder,
86
+ ParticipantViewUI = DefaultParticipantViewUI as ComponentType,
87
+ },
88
+ ref,
89
+ ) {
90
+ const { isLocalParticipant, isSpeaking, isDominantSpeaker, sessionId } =
91
+ participant;
92
+
93
+ const hasAudioTrack = hasAudio(participant);
94
+ const hasVideoTrack = hasVideo(participant);
95
+ const hasScreenShareAudioTrack = hasScreenShareAudio(participant);
96
+
97
+ const [trackedElement, setTrackedElement] =
98
+ useState<HTMLDivElement | null>(null);
99
+
100
+ const [contextVideoElement, setContextVideoElement] =
101
+ useState<HTMLVideoElement | null>(null);
102
+
103
+ const [
125
104
  contextVideoPlaceholderElement,
126
- participant,
105
+ setContextVideoPlaceholderElement,
106
+ ] = useState<HTMLDivElement | null>(null);
107
+
108
+ useTrackElementVisibility({
109
+ sessionId,
127
110
  trackedElement,
128
111
  trackType,
129
- ],
130
- );
131
-
132
- const videoRefs: VideoProps['refs'] = useMemo(
133
- () => ({
134
- setVideoElement: (element) => {
135
- setVideoElement?.(element);
136
- setContextVideoElement(element);
137
- },
138
- setVideoPlaceholderElement: (element) => {
139
- setVideoPlaceholderElement?.(element);
140
- setContextVideoPlaceholderElement(element);
141
- },
142
- }),
143
- [setVideoElement, setVideoPlaceholderElement],
144
- );
145
-
146
- return (
147
- <div
148
- data-testid="participant-view"
149
- ref={(element) => {
150
- applyElementToRef(ref, element);
151
- setTrackedElement(element);
152
- }}
153
- className={clsx(
154
- 'str-video__participant-view',
155
- isDominantSpeaker && 'str-video__participant-view--dominant-speaker',
156
- isSpeaking && 'str-video__participant-view--speaking',
157
- !hasVideoTrack && 'str-video__participant-view--no-video',
158
- !hasAudioTrack && 'str-video__participant-view--no-audio',
159
- className,
160
- )}
161
- >
162
- <ParticipantViewContext.Provider value={participantViewContextValue}>
163
- {/* mute the local participant, as we don't want to hear ourselves */}
164
- {!isLocalParticipant && !muteAudio && (
165
- <>
166
- {hasAudioTrack && (
167
- <Audio participant={participant} trackType="audioTrack" />
168
- )}
169
- {hasScreenShareAudioTrack && (
170
- <Audio
171
- participant={participant}
172
- trackType="screenShareAudioTrack"
173
- />
174
- )}
175
- </>
176
- )}
177
- <Video
178
- VideoPlaceholder={VideoPlaceholder}
179
- PictureInPicturePlaceholder={PictureInPicturePlaceholder}
180
- participant={participant}
181
- trackType={trackType}
182
- refs={videoRefs}
183
- enabled={
184
- isLocalParticipant ||
185
- trackType !== 'videoTrack' ||
186
- isParticipantVideoEnabled(participant.sessionId)
187
- }
188
- mirror={mirror}
189
- autoPlay
190
- />
191
- {isComponentType(ParticipantViewUI) ? (
192
- <ParticipantViewUI />
193
- ) : (
194
- ParticipantViewUI
112
+ });
113
+
114
+ const { useIncomingVideoSettings } = useCallStateHooks();
115
+ const { isParticipantVideoEnabled } = useIncomingVideoSettings();
116
+
117
+ const participantViewContextValue = useMemo(
118
+ () => ({
119
+ participant,
120
+ participantViewElement: trackedElement,
121
+ videoElement: contextVideoElement,
122
+ videoPlaceholderElement: contextVideoPlaceholderElement,
123
+ trackType,
124
+ }),
125
+ [
126
+ contextVideoElement,
127
+ contextVideoPlaceholderElement,
128
+ participant,
129
+ trackedElement,
130
+ trackType,
131
+ ],
132
+ );
133
+
134
+ const videoRefs: VideoProps['refs'] = useMemo(
135
+ () => ({
136
+ setVideoElement: (element) => {
137
+ setVideoElement?.(element);
138
+ setContextVideoElement(element);
139
+ },
140
+ setVideoPlaceholderElement: (element) => {
141
+ setVideoPlaceholderElement?.(element);
142
+ setContextVideoPlaceholderElement(element);
143
+ },
144
+ }),
145
+ [setVideoElement, setVideoPlaceholderElement],
146
+ );
147
+
148
+ return (
149
+ <div
150
+ data-testid="participant-view"
151
+ ref={(element) => {
152
+ applyElementToRef(ref, element);
153
+ setTrackedElement(element);
154
+ }}
155
+ className={clsx(
156
+ 'str-video__participant-view',
157
+ isDominantSpeaker &&
158
+ 'str-video__participant-view--dominant-speaker',
159
+ isSpeaking && 'str-video__participant-view--speaking',
160
+ !hasVideoTrack && 'str-video__participant-view--no-video',
161
+ !hasAudioTrack && 'str-video__participant-view--no-audio',
162
+ className,
195
163
  )}
196
- </ParticipantViewContext.Provider>
197
- </div>
198
- );
199
- }),
164
+ >
165
+ <ParticipantViewContext.Provider value={participantViewContextValue}>
166
+ {/* mute the local participant, as we don't want to hear ourselves */}
167
+ {!isLocalParticipant && !muteAudio && (
168
+ <>
169
+ {hasAudioTrack && (
170
+ <Audio participant={participant} trackType="audioTrack" />
171
+ )}
172
+ {hasScreenShareAudioTrack && (
173
+ <Audio
174
+ participant={participant}
175
+ trackType="screenShareAudioTrack"
176
+ />
177
+ )}
178
+ </>
179
+ )}
180
+ <Video
181
+ VideoPlaceholder={VideoPlaceholder}
182
+ PictureInPicturePlaceholder={PictureInPicturePlaceholder}
183
+ participant={participant}
184
+ trackType={trackType}
185
+ refs={videoRefs}
186
+ enabled={
187
+ isLocalParticipant ||
188
+ trackType !== 'videoTrack' ||
189
+ isParticipantVideoEnabled(participant.sessionId)
190
+ }
191
+ mirror={mirror}
192
+ autoPlay
193
+ />
194
+ {isComponentType(ParticipantViewUI) ? (
195
+ <ParticipantViewUI />
196
+ ) : (
197
+ ParticipantViewUI
198
+ )}
199
+ </ParticipantViewContext.Provider>
200
+ </div>
201
+ );
202
+ },
203
+ ),
200
204
  );
201
205
 
202
206
  ParticipantView.displayName = 'ParticipantView';
@@ -12,7 +12,7 @@ export type BaseVideoProps = ComponentPropsWithRef<'video'> & {
12
12
  * (`srcObject`) to reactively handle stream changes
13
13
  */
14
14
  export const BaseVideo = forwardRef<HTMLVideoElement, BaseVideoProps>(
15
- function BaseVideo({ stream, ...rest }, ref) {
15
+ function BaseVideoRender({ stream, ...rest }, ref) {
16
16
  const [videoElement, setVideoElement] = useState<HTMLVideoElement | null>(
17
17
  null,
18
18
  );
@@ -10,7 +10,7 @@ export type PictureInPicturePlaceholderProps = BaseVideoPlaceholderProps;
10
10
  export const DefaultPictureInPicturePlaceholder = forwardRef<
11
11
  HTMLDivElement,
12
12
  PictureInPicturePlaceholderProps
13
- >(function DefaultPictureInPicturePlaceholder(props, ref) {
13
+ >(function DefaultPictureInPicturePlaceholderRender(props, ref) {
14
14
  const { t } = useI18n();
15
15
  return (
16
16
  <BaseVideoPlaceholder ref={ref} {...props}>
@@ -10,7 +10,7 @@ export type VideoPlaceholderProps = BaseVideoPlaceholderProps;
10
10
  export const DefaultVideoPlaceholder = forwardRef<
11
11
  HTMLDivElement,
12
12
  VideoPlaceholderProps
13
- >(function DefaultVideoPlaceholder(props, ref) {
13
+ >(function DefaultVideoPlaceholderRender(props, ref) {
14
14
  const { t } = useI18n();
15
15
  return (
16
16
  <BaseVideoPlaceholder ref={ref} {...props}>
@@ -10,7 +10,7 @@ import {
10
10
  import { CameraMenuWithBlur } from '../BlurToggleButton/BlurToggleButton';
11
11
 
12
12
  const ToggleMenuButton = forwardRef<HTMLButtonElement, ToggleMenuButtonProps>(
13
- function ToggleMenuButton(props, ref) {
13
+ function ToggleMenuButtonRender(props, ref) {
14
14
  const { useCameraState } = useCallStateHooks();
15
15
  const { selectedDevice: selectedCamera, devices: cameras } =
16
16
  useCameraState();
@@ -11,7 +11,7 @@ import {
11
11
  } from '../../../components';
12
12
 
13
13
  const ToggleMenuButton = forwardRef<HTMLButtonElement, ToggleMenuButtonProps>(
14
- function ToggleMenuButton(props, ref) {
14
+ function ToggleMenuButtonRender(props, ref) {
15
15
  const { useMicrophoneState } = useCallStateHooks();
16
16
  const { selectedDevice: selectedMic, devices: microphones } =
17
17
  useMicrophoneState();
@@ -48,9 +48,7 @@ export interface EmbeddedAnonymousUser {
48
48
  * Discriminated union for embedded user configuration.
49
49
  */
50
50
  export type EmbeddedUser =
51
- | EmbeddedAuthenticatedUser
52
- | EmbeddedGuestUser
53
- | EmbeddedAnonymousUser;
51
+ EmbeddedAuthenticatedUser | EmbeddedGuestUser | EmbeddedAnonymousUser;
54
52
 
55
53
  /**
56
54
  * Base props shared by EmbeddedCall and EmbeddedLivestream.