This repository was archived by the owner on Jun 28, 2024. It is now read-only.
Commit cb4eeed
authored
Mute track (#79)
## Description
This PR introduces changes from:
fishjam-dev/ts-client-sdk#49 and also:
### useCamera, useMicrophone, useScreenshare
Hooks for managing a single track of a given type in the global state
(similarly to the React Native API).
#### onDeviceStop
`onDeviceStop?: "remove" | "mute";
This PR introduces a new `onDeviceStop` config parameter that allows the
user to decide what to do if a track stops. Without it, the track has
been removed from `RTCPeerConnection`. Now, with the option `mute`, that
track can be reused later without renegotiation. It is a companion event
to `onDeviceChange`.
Added `onDeviceStop`, `onDeviceChange`, and the ability to stop a device
to `use-camera-and-microphone-example`.
#### onDeviceChange
`onDeviceChange?: "replace" | "stop";`
Determines whether a track should be replaced when the user requests a
device change. Previously, `broadcastOnDeviceChange`.
#### Other changes
- Names of types like `UseMicrophoneResult` changed to something
simpler, like `MicrophoneAPI`.
## Motivation and Context
Fishjam now offers the ability to reuse tracks.
## Types of changes
- [ ] Bug fix (a non-breaking change that fixes an issue)
- [ ] New feature (a non-breaking change that adds functionality)
- [x] Breaking change (a fix or feature that would cause existing
functionality to not work as expected)
- The `replaceTrack` method can handle a nullable track parameter.
- The `stream` parameter was removed from the `addTrack` method.1 parent e7b883e commit cb4eeed
15 files changed
Lines changed: 344 additions & 244 deletions
File tree
- examples
- minimal-react
- src/components
- use-camera-and-microphone-example
- src
- src
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
12 | | - | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
41 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
42 | 52 | | |
43 | 53 | | |
44 | 54 | | |
| |||
Lines changed: 64 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | | - | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
40 | | - | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
43 | 47 | | |
44 | | - | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
46 | 51 | | |
47 | 52 | | |
| |||
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
70 | | - | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
74 | | - | |
| 80 | + | |
| 81 | + | |
75 | 82 | | |
76 | 83 | | |
77 | 84 | | |
| |||
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
88 | | - | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
| 108 | + | |
| 109 | + | |
101 | 110 | | |
102 | 111 | | |
103 | 112 | | |
| |||
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
224 | | - | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
229 | | - | |
| 238 | + | |
230 | 239 | | |
231 | 240 | | |
232 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
233 | 255 | | |
234 | 256 | | |
235 | 257 | | |
| |||
247 | 269 | | |
248 | 270 | | |
249 | 271 | | |
250 | | - | |
| 272 | + | |
251 | 273 | | |
252 | 274 | | |
253 | 275 | | |
254 | 276 | | |
255 | | - | |
| 277 | + | |
256 | 278 | | |
257 | 279 | | |
258 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
259 | 294 | | |
260 | 295 | | |
261 | 296 | | |
| |||
279 | 314 | | |
280 | 315 | | |
281 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
282 | 320 | | |
283 | 321 | | |
284 | 322 | | |
| |||
290 | 328 | | |
291 | 329 | | |
292 | 330 | | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
293 | 334 | | |
294 | 335 | | |
295 | 336 | | |
| |||
318 | 359 | | |
319 | 360 | | |
320 | 361 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
327 | 371 | | |
328 | 372 | | |
329 | 373 | | |
| |||
0 commit comments