@@ -13,7 +13,16 @@ import { getProject, getProjectRoom } from '../data'
13
13
type Props = {
14
14
volume : number
15
15
isMuted : boolean
16
+ /**
17
+ * `isHidden` denotes whether the video feed is enabled.
18
+ * If `isHidden` is true, but `isAudioOnly` is false, the placeholder will be rendered.
19
+ */
16
20
isHidden : boolean
21
+ /**
22
+ * `isAudioOnly` denotes whether the participant node appears in the `content` or is contained in the `audioContainer`.
23
+ * If `isHidden` is true, but `isAudioOnly` is false, the placeholder will be rendered.
24
+ */
25
+ isAudioOnly : boolean
17
26
sink : string
18
27
}
19
28
@@ -73,7 +82,7 @@ export const RoomParticipant = {
73
82
} ) => {
74
83
const ref = useRef < HTMLVideoElement > ( )
75
84
76
- const { volume = 1 , isHidden = false } = props || { }
85
+ const { volume = 1 , isHidden = false , isAudioOnly = false } = props || { }
77
86
const [ labelSize , setLabelSize ] = useState < 0 | 1 | 2 | 3 > ( 0 )
78
87
79
88
/* It's checking if the participant is the local participant. */
@@ -88,7 +97,7 @@ export const RoomParticipant = {
88
97
89
98
// Hide video if explicitly isHidden by host or
90
99
// if the participant is sending no video
91
- const hasVideo = ! props ?. isHidden && source ?. props ?. videoEnabled
100
+ const hasVideo = ! isAudioOnly && ! isHidden && source ?. props ?. videoEnabled
92
101
93
102
useEffect ( ( ) => {
94
103
if ( ! ref . current ) return
@@ -152,8 +161,13 @@ export const RoomParticipant = {
152
161
style = { {
153
162
position : 'relative' ,
154
163
display : 'flex' ,
155
- height : '100%' ,
156
- width : '100%' ,
164
+ ...( isAudioOnly ? {
165
+ height : '0px' ,
166
+ width : '0px' ,
167
+ } : {
168
+ height : '100%' ,
169
+ width : '100%' ,
170
+ } ) ,
157
171
} }
158
172
>
159
173
< div
@@ -170,7 +184,7 @@ export const RoomParticipant = {
170
184
opacity : hasVideo ? '0' : '1' ,
171
185
} }
172
186
>
173
- { source ?. props . displayName && (
187
+ { source ?. props . displayName && ! props ?. isAudioOnly && (
174
188
< div
175
189
style = { {
176
190
borderRadius : '50%' ,
@@ -218,7 +232,7 @@ export const RoomParticipant = {
218
232
} }
219
233
/>
220
234
</ div >
221
- { source ?. props . displayName && (
235
+ { source ?. props . displayName && ! isAudioOnly && (
222
236
< div
223
237
className = "NameBannerContainer"
224
238
style = { {
0 commit comments