Skip to content

Commit

Permalink
control camera and mic
Browse files Browse the repository at this point in the history
  • Loading branch information
myandrienko committed Jan 23, 2025
1 parent 43d3c4a commit 3791a6e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions sample-apps/react/react-dogfood/components/Inspector/CodecDash.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ import { ValuePoller } from './ValuePoller';

export function CodecDash() {
const call = useCall();
const { useCameraState } = useCallStateHooks();
const {
forceSubscriptions,
subscribedParticipantCount,
remoteParticipantCount,
} = useForceSubscriptions();
const { camera, isEnabled: isCameraEnabled } = useCameraState();

useEffect(() => {
if (call) {
Expand All @@ -27,16 +25,7 @@ export function CodecDash() {
<div className="rd__inspector-dash">
<h3>Codecs in use</h3>
<dl>
<dt>
Publishing
<button
className="rd__dash-action-button"
type="button"
onClick={() => camera.toggle()}
>
{isCameraEnabled ? 'Disable' : 'Enable'} camera
</button>
</dt>
<dt>Publishing</dt>
<dd>
<ValuePoller
id="publisher-codecs"
Expand Down Expand Up @@ -67,6 +56,12 @@ export function CodecDash() {
/>
</dd>
</dl>
<p>
<small>
Press "Sub. to all" to start receiving video from all participants
currently in the call.
</small>
</p>
</div>
);
}
Expand Down

0 comments on commit 3791a6e

Please sign in to comment.