Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

39/add mic mute #44

Merged
merged 16 commits into from
Apr 12, 2024
Merged

39/add mic mute #44

merged 16 commits into from
Apr 12, 2024

Conversation

malmen237
Copy link
Contributor

No description provided.

@malmen237 malmen237 self-assigned this Apr 8, 2024
@malmen237 malmen237 requested a review from martinstark April 8, 2024 12:56
@malmen237 malmen237 linked an issue Apr 8, 2024 that may be closed by this pull request
Copy link
Collaborator

@martinstark martinstark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall looks good, but, as discussed, let's use the full input media source instead of just one track

src/components/production-line/use-rtc-connection.ts Outdated Show resolved Hide resolved
src/global-state/global-state-actions.ts Outdated Show resolved Hide resolved
@malmen237 malmen237 requested a review from martinstark April 9, 2024 11:36
Copy link
Collaborator

@martinstark martinstark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I realized we need to clear the connected MediaStream when a peer connection is closed, or it will be kept in memory in the global state even when not in use.

This makes me think that dispatching from the attachInputAudioToPeerConnection is the wrong place, since we would like to keep the dispatch and clean up logic in the same place.

I think the canonical react solution would be to put this in the useEffect in useRtcConnection, since the clean up logic could then be put inside the return value of that useEffect.

More specifically, in use-rtc-connection.ts:

  1. dispatch the connected audio stream inside the if (inputAudioStream !== "no-device") { check on line 172
  2. dispatch an event that sets the connected media stream to null inside the return value on line 188

src/components/production-line/use-rtc-connection.ts Outdated Show resolved Hide resolved
src/components/production-line/use-rtc-connection.ts Outdated Show resolved Hide resolved
src/icons/icon.tsx Outdated Show resolved Hide resolved
src/icons/icon.tsx Outdated Show resolved Hide resolved
@malmen237 malmen237 requested a review from martinstark April 11, 2024 09:56
@malmen237 malmen237 requested a review from martinstark April 11, 2024 11:50
@malmen237 malmen237 merged commit b73fd76 into main Apr 12, 2024
2 checks passed
@malmen237 malmen237 deleted the 39/add-mic-mute branch April 12, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to mute mic
2 participants