@stream-io/video-react-sdk 0.4.11 → 0.4.13

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.
@@ -13,16 +13,21 @@ export type ParticipantViewProps = {
13
13
  */
14
14
  ParticipantViewUI?: ComponentType | ReactElement | null;
15
15
  /**
16
- * The kind of video stream to play for the given participant. The default value is `video`. You can use `none` if you're building an audio-only call.
16
+ * The kind of video stream to play for the given participant.
17
+ * The default value is `videoTrack`.
18
+ * You can use `none` if you're building an audio-only call.
17
19
  */
18
20
  trackType?: VideoTrackType | 'none';
19
21
  /**
20
- * This prop is only useful for advanced use-cases (for example building your own paginated layout). When set to `true` it will mute the give participant's audio stream on the client side. The local participant is always muted.
22
+ * This prop is only useful for advanced use-cases (for example, building your own layout).
23
+ * When set to `true` it will mute the give participant's audio stream on the client side.
24
+ * The local participant is always muted.
21
25
  */
22
26
  muteAudio?: boolean;
23
27
  /**
24
28
  * An object with set functions meant for exposing the video
25
- * and video placeholder elements to the integrators. It's useful when you want to attach custom event handlers to these elements.
29
+ * and video placeholder elements to the integrators.
30
+ * It's useful when you want to attach custom event handlers to these elements.
26
31
  * - `refs.setVideoElement`
27
32
  * - `refs.setVideoPlaceholderElement`
28
33
  */
@@ -44,16 +49,21 @@ export declare const ParticipantView: import("react").ForwardRefExoticComponent<
44
49
  */
45
50
  ParticipantViewUI?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ComponentType | null | undefined;
46
51
  /**
47
- * The kind of video stream to play for the given participant. The default value is `video`. You can use `none` if you're building an audio-only call.
52
+ * The kind of video stream to play for the given participant.
53
+ * The default value is `videoTrack`.
54
+ * You can use `none` if you're building an audio-only call.
48
55
  */
49
56
  trackType?: "none" | VideoTrackType | undefined;
50
57
  /**
51
- * This prop is only useful for advanced use-cases (for example building your own paginated layout). When set to `true` it will mute the give participant's audio stream on the client side. The local participant is always muted.
58
+ * This prop is only useful for advanced use-cases (for example, building your own layout).
59
+ * When set to `true` it will mute the give participant's audio stream on the client side.
60
+ * The local participant is always muted.
52
61
  */
53
62
  muteAudio?: boolean | undefined;
54
63
  /**
55
64
  * An object with set functions meant for exposing the video
56
- * and video placeholder elements to the integrators. It's useful when you want to attach custom event handlers to these elements.
65
+ * and video placeholder elements to the integrators.
66
+ * It's useful when you want to attach custom event handlers to these elements.
57
67
  * - `refs.setVideoElement`
58
68
  * - `refs.setVideoPlaceholderElement`
59
69
  */
@@ -12,8 +12,11 @@ export type VideoProps = ComponentPropsWithoutRef<'video'> & {
12
12
  participant: StreamVideoParticipant;
13
13
  /**
14
14
  * Override the default UI that's visible when a participant turned off their video.
15
+ * Set it to `null` if you wish to disable the video placeholder.
16
+ *
17
+ * @default DefaultVideoPlaceholder
15
18
  */
16
- VideoPlaceholder?: ComponentType<VideoPlaceholderProps>;
19
+ VideoPlaceholder?: ComponentType<VideoPlaceholderProps> | null;
17
20
  /**
18
21
  * An object with setRef functions
19
22
  * meant for exposing some of the internal elements of this component.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "0.4.11",
3
+ "version": "0.4.13",
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.26.1",
32
32
  "@nivo/core": "^0.80.0",
33
33
  "@nivo/line": "^0.80.0",
34
- "@stream-io/video-client": "^0.4.8",
35
- "@stream-io/video-react-bindings": "^0.3.8",
34
+ "@stream-io/video-client": "^0.4.10",
35
+ "@stream-io/video-react-bindings": "^0.3.10",
36
36
  "clsx": "^2.0.0",
37
37
  "prop-types": "^15.8.1"
38
38
  },
@@ -33,18 +33,23 @@ export type ParticipantViewProps = {
33
33
  ParticipantViewUI?: ComponentType | ReactElement | null;
34
34
 
35
35
  /**
36
- * The kind of video stream to play for the given participant. The default value is `video`. You can use `none` if you're building an audio-only call.
36
+ * The kind of video stream to play for the given participant.
37
+ * The default value is `videoTrack`.
38
+ * You can use `none` if you're building an audio-only call.
37
39
  */
38
40
  trackType?: VideoTrackType | 'none';
39
41
 
40
42
  /**
41
- * This prop is only useful for advanced use-cases (for example building your own paginated layout). When set to `true` it will mute the give participant's audio stream on the client side. The local participant is always muted.
43
+ * This prop is only useful for advanced use-cases (for example, building your own layout).
44
+ * When set to `true` it will mute the give participant's audio stream on the client side.
45
+ * The local participant is always muted.
42
46
  */
43
47
  muteAudio?: boolean;
44
48
 
45
49
  /**
46
50
  * An object with set functions meant for exposing the video
47
- * and video placeholder elements to the integrators. It's useful when you want to attach custom event handlers to these elements.
51
+ * and video placeholder elements to the integrators.
52
+ * It's useful when you want to attach custom event handlers to these elements.
48
53
  * - `refs.setVideoElement`
49
54
  * - `refs.setVideoPlaceholderElement`
50
55
  */
@@ -1,4 +1,5 @@
1
1
  import { ComponentPropsWithRef, forwardRef, useState } from 'react';
2
+ import { useI18n } from '@stream-io/video-react-bindings';
2
3
  import type { StreamVideoParticipant } from '@stream-io/video-client';
3
4
 
4
5
  export type VideoPlaceholderProps = {
@@ -9,6 +10,7 @@ export const DefaultVideoPlaceholder = forwardRef<
9
10
  HTMLDivElement,
10
11
  VideoPlaceholderProps
11
12
  >(({ participant, style }, ref) => {
13
+ const { t } = useI18n();
12
14
  const [error, setError] = useState(false);
13
15
  const name = participant.name || participant.userId;
14
16
  return (
@@ -19,7 +21,7 @@ export const DefaultVideoPlaceholder = forwardRef<
19
21
  <div>{name[0]}</div>
20
22
  </div>
21
23
  ) : (
22
- <div>Video is disabled</div>
24
+ <div>{t('Video is disabled')}</div>
23
25
  ))}
24
26
  {participant.image && !error && (
25
27
  <img
@@ -29,8 +29,11 @@ export type VideoProps = ComponentPropsWithoutRef<'video'> & {
29
29
  participant: StreamVideoParticipant;
30
30
  /**
31
31
  * Override the default UI that's visible when a participant turned off their video.
32
+ * Set it to `null` if you wish to disable the video placeholder.
33
+ *
34
+ * @default DefaultVideoPlaceholder
32
35
  */
33
- VideoPlaceholder?: ComponentType<VideoPlaceholderProps>;
36
+ VideoPlaceholder?: ComponentType<VideoPlaceholderProps> | null;
34
37
  /**
35
38
  * An object with setRef functions
36
39
  * meant for exposing some of the internal elements of this component.
@@ -144,7 +147,7 @@ export const Video = ({
144
147
  {!hasNoVideoOrInvisible && (
145
148
  <video
146
149
  {...rest}
147
- className={clsx(className, 'str-video__video', {
150
+ className={clsx('str-video__video', className, {
148
151
  'str-video__video--not-playing': isVideoPaused,
149
152
  'str-video__video--tall': !isWideMode,
150
153
  'str-video__video--mirror': mirrorVideo,
@@ -159,7 +162,7 @@ export const Video = ({
159
162
  />
160
163
  )}
161
164
  {/* TODO: add condition to "hold" the placeholder until track unmutes as well */}
162
- {(hasNoVideoOrInvisible || isVideoPaused) && (
165
+ {(hasNoVideoOrInvisible || isVideoPaused) && VideoPlaceholder && (
163
166
  <VideoPlaceholder
164
167
  style={{ position: 'absolute' }}
165
168
  participant={participant}