Added ability to mute/unmute mic and enable it later than PixelStreaming creation time #192
Conversation
@@ -426,18 +422,16 @@ export class PeerConnectionController { | |||
}); | |||
} else { | |||
// set the audio options based on mic usage | |||
const audioOptions = useMic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain this change: the useMic ?
check is extraneous, as this code is inside an if (!useMic) ... else { }
scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Looking good @kass-kass. We're currently winding down active development of the master branch in preparation for the 5.2 launch, meaning we're only merging critical bug fixes. We'll open back up to features once 5.2 has launched. With that being said, I've got a small feature request to go with this PR. Could I get you to add a mic toggle in the top left corner (where fullscreen and panel buttons sit)? I think having it only be visible if the page is loaded with the |
PRs go stale after 30 days of inactivity. Please comment or re-open the PR if you are still working on this PR. |
Is the extra functionality re. the microphone button coming? I have been looking at this PR and noticed the functionality was missing. |
@mcottontensor I think we can assume not. You can add it if you think the effort is low enough, otherwise I am happy to merge without the added UI button. |
@lukehb @mcottontensor Haven't been able to find the time to add this yet, due to other workloads. Will likely take a look beginning of October to finish this up, does that sound OK? |
@mcottontensor I think we can merge without the mic button - the lack of that button is not blocking and tbh I prefer the feature without it. |
Relevant components:
Problem statement:
Currently, if a microphone track is enabled at
PixelStreaming
instance creation time, there is no easily accessible way to mute the microphone stream.Additionally, if the
PixelStreaming
instance is created without a mic track, there is no easy way to add one later.Solution
This PR adds public funcitons to set the mic muted state.
The function to unmute the mic can be called with a
forceEnable
parameter, which allows to add a mic track at a later time (if one wasn't initially added), and trigger a full reconnect.Documentation
252b958
Test Plan and Compatibility
Doesn't modify existing APIs, just adds new functions.
Note: some intenral functionality that was very verbose and hard-to-read is now encapsulated in a new
RTCUtils
class.