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

Add DeviceMute widget action io.element.device_mute. #2482

Merged
merged 5 commits into from
Jul 30, 2024

Conversation

toger5
Copy link
Contributor

@toger5 toger5 commented Jul 17, 2024

This allows to send mute requests ("toWidget") and get the current mute state as a response.
And it will update the client about each change of mute states.

src/room/MuteStates.ts Outdated Show resolved Hide resolved
This allows to send mute requests ("toWidget") and get the current mute state as a response.
And it will update the client about each change of mute states.
src/widget.ts Outdated Show resolved Hide resolved
src/widget.ts Outdated Show resolved Hide resolved
);
};
}
}, [audio, video]);
Copy link
Member

Choose a reason for hiding this comment

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

I might need an explanation on what this is doing: whenever the audio or video mute state changes, we add a new listener for the device mute widget action? The listener presumably also fires (once?) to set the mute states and reply?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To my understanding the audio and video elements are not changing instead they mutate. So whenever they are set we connect the listener and when they are unset we remove it.

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure it's that simple. Why not just use a callback and then the problem goes away? Also it will make the code less nested.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated this. So it is no creating the useCallback and recomputes the on/off when the callback changes.

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

In general, comments would be helpful: I say this as someone who's knowledge of this codebase is now a little rusty :)

Copy link
Member

@dbkr dbkr 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 as far as I can see, comments make it much clearer, thanks!

Copy link
Contributor

@fkwp fkwp left a comment

Choose a reason for hiding this comment

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

lgtm

@toger5 toger5 merged commit f53ea75 into livekit Jul 30, 2024
3 checks passed
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.

None yet

5 participants