Audio
MuteMic(bool shouldMute, PeerMetadata metadata)
To mute microphone, call MuteMic
function. It takes the bool and PeerMetadata as param. Keep that in mind, in case you want to make some changes in class PeerMetadata you need to make some changes in HuddleWebglPlugin.jslib accordingly.
Parameters
Params | Type | Description |
---|---|---|
shouldMute | bool | setting mute status of peer |
metadata | PeerMetadata | custom class object to store metadata of peer |
.csharp
public void MuteMic(bool shouldMute,PeerMetadata metadata)
{
Huddle01Core.Instance.MuteMic(shouldMute, metadata);
}
Huddel01Core.PeerMuted(string peerId, bool isMuted)
This event gets invoked when any peer toggle their audio. Subcribe to this event to receive notification.
Parameters
Params | Type | Description |
---|---|---|
peerId | string | peer id |
isMuted | bool | mic status, true if muted |
.csharp
private void OnEnable()
{
Huddle01Core.PeerMuted += OnPeerMute;
}
private void OnDisable()
{
Huddle01Core.PeerMuted -= OnPeerMute;
}
private void OnPeerMute(string peerId,bool isMuted)
{
Debug.Log($"{peerId} : {isMuted}");
}