Skip to content

Commit 704f9a4

Browse files
authored
FCE-783/changing device docs (#85)
## Description Add a paragraph about changing cameras and microphones.
1 parent e07dc29 commit 704f9a4

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

docs/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 8
44

55
# Glossary
66

7-
Terms used in our documentation
7+
A brief walk-through of the terms we use in the documentation.
88

99
### Room
1010

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,34 @@
22
sidebar_position: 4
33
---
44

5-
# Toggling devices
5+
# Managing devices
66

7-
The Fishjam SDK provides functions for dynamically controlling media device streams. This includes turning the cameras and microphones on and off, as well as muting and unmuting microphones.
7+
The Fishjam SDK provides functions for dynamically controlling media device streams. This includes selecting desired cameras and microphones, turning them on and off, as well as muting and unmuting microphones.
8+
9+
### Selecting Camera and Microphone - [`selectCamera()`](/api/web/type-aliases/UseCameraResult#selectcamera) and [`selectMicrophone()`](/api/web/type-aliases/UseMicrophoneResult#selectmicrophone)
10+
11+
To select the desired camera or microphone, use the [`selectCamera()`](/api/web/type-aliases/UseCameraResult#selectcamera) and [`selectMicrophone()`](/api/web/type-aliases/UseMicrophoneResult#listmicrophones) functions.
12+
Lists of the available devices are available via the [`cameraDevices`](/api/web/type-aliases/UseCameraResult#cameradevices) and [`microphoneDevices`](/api/web/type-aliases/UseMicrophoneResult#microphonedevices) properties.
13+
14+
#### Usage Example
15+
16+
```tsx
17+
import { useCamera } from "@fishjam-cloud/react-client";
18+
19+
export function CameraControl() {
20+
const { cameraDevices, selectCamera } = useCamera();
21+
22+
return (
23+
<ul>
24+
{cameraDevices.map(({ deviceId, label }) => (
25+
<li key={deviceId}>
26+
<button onClick={() => selectCamera(deviceId)}>{label}</button>
27+
</li>
28+
))}
29+
</ul>
30+
);
31+
}
32+
```
833

934
### Turning Camera On and Off - [`toggleCamera()`](/api/web/type-aliases/UseCameraResult#togglecamera)
1035

0 commit comments

Comments
 (0)