Skip to content

Commit 7c25171

Browse files
committed
feat: allow disabling presenter's video in the dominant speaker layout
1 parent 2703121 commit 7c25171

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

sample-apps/react/egress-composite/src/ConfigurationContext.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ export type ConfigurationValue = {
119119
// grid-specific
120120
'layout.grid.gap'?: string | number; // ❌
121121
'layout.grid.page_size'?: number; // ✅
122+
122123
// dominant_speaker-specific (single-participant)
123124
'layout.single-participant.mode'?: 'shuffle' | 'default'; // ✅
124125
'layout.single-participant.shuffle_delay'?: number; // ✅
125126
'layout.single-participant.padding_inline'?: string; // ✅
126127
'layout.single-participant.padding_block'?: string | number; // ✅
128+
'layout.single-participant.presenter_visible'?: boolean; // ✅
129+
127130
// spotlight-specific
128131
'layout.spotlight.participants_bar_position'?: Exclude<
129132
VerticalPosition | HorizontalPosition,

sample-apps/react/egress-composite/src/components/layouts/DominantSpeaker/DominantSpeakerScreenShare.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
} from '@stream-io/video-react-sdk';
99

1010
import { useEgressReadyWhenAnyParticipantMounts } from '../egressReady';
11+
import { useConfigurationContext } from '../../../ConfigurationContext';
1112

1213
import './DominantSpeakerScreenShare.scss';
1314

@@ -23,6 +24,12 @@ export const DominantSpeakerScreenShare = () => {
2324
SfuModels.TrackType.SCREEN_SHARE,
2425
);
2526

27+
const {
28+
options: {
29+
'layout.single-participant.presenter_visible': presenterVisible = true,
30+
},
31+
} = useConfigurationContext();
32+
2633
return (
2734
<div
2835
className="eca__dominant-speaker-screen-share__container"
@@ -36,18 +43,20 @@ export const DominantSpeakerScreenShare = () => {
3643
muteAudio // audio is handled by <ParticipantsAudio />
3744
ParticipantViewUI={null}
3845
/>
39-
<div className="eca__dominant-speaker-screen-share__current-speaker">
40-
<ParticipantView
41-
participant={screensharingParticipant}
42-
muteAudio // audio is handled by <ParticipantsAudio />
43-
ParticipantViewUI={
44-
<DefaultParticipantViewUI
45-
indicatorsVisible={false}
46-
showMenuButton={false}
47-
/>
48-
}
49-
/>
50-
</div>
46+
{presenterVisible && (
47+
<div className="eca__dominant-speaker-screen-share__current-speaker">
48+
<ParticipantView
49+
participant={screensharingParticipant}
50+
muteAudio // audio is handled by <ParticipantsAudio />
51+
ParticipantViewUI={
52+
<DefaultParticipantViewUI
53+
indicatorsVisible={false}
54+
showMenuButton={false}
55+
/>
56+
}
57+
/>
58+
</div>
59+
)}
5160
</div>
5261
);
5362
};

0 commit comments

Comments
 (0)