Skip to content

Commit

Permalink
fix: produce if user checks box
Browse files Browse the repository at this point in the history
  • Loading branch information
woody146 committed Jun 22, 2023
1 parent e5d72a0 commit 8b80911
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/rooms/src/components/Producer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,12 @@ export function Producer({
video: useVideo,
audio: useAudio,
});
await transport.produce({ track: stream.getVideoTracks()[0] });
await transport.produce({ track: stream.getAudioTracks()[0] });
if (useVideo) {
await transport.produce({ track: stream.getVideoTracks()[0] });
}
if (useAudio) {
await transport.produce({ track: stream.getAudioTracks()[0] });
}
} catch (err: any) {
setLog(err.toString());
throw err;
Expand Down

0 comments on commit 8b80911

Please sign in to comment.