mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-17 10:37:46 +00:00
feat(rnsdk): add audio and video muted state changed
This commit is contained in:
committed by
Calinteodor
parent
a71143891e
commit
6d02f50d09
@@ -1,6 +1,30 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { AUDIO_MUTED_CHANGED } from '../../../base/conference/actionTypes';
|
||||
import { translate } from '../../../base/i18n/functions';
|
||||
import AbstractAudioMuteButton, { IProps, mapStateToProps } from '../AbstractAudioMuteButton';
|
||||
|
||||
export default translate(connect(mapStateToProps)(AbstractAudioMuteButton<IProps>));
|
||||
/**
|
||||
* Component that renders native toolbar button for toggling audio mute.
|
||||
*
|
||||
* @augments AbstractAudioMuteButton
|
||||
*/
|
||||
class AudioMuteButton extends AbstractAudioMuteButton<IProps> {
|
||||
/**
|
||||
* Changes audio muted state and dispatches the state to redux.
|
||||
*
|
||||
* @param {boolean} audioMuted - Whether audio should be muted or not.
|
||||
* @protected
|
||||
* @returns {void}
|
||||
*/
|
||||
_setAudioMuted(audioMuted: boolean) {
|
||||
this.props.dispatch?.({
|
||||
type: AUDIO_MUTED_CHANGED,
|
||||
muted: audioMuted
|
||||
});
|
||||
|
||||
super._setAudioMuted(audioMuted);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate(connect(mapStateToProps)(AudioMuteButton));
|
||||
|
||||
@@ -1,7 +1,31 @@
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { VIDEO_MUTED_CHANGED } from '../../../base/conference/actionTypes';
|
||||
import { translate } from '../../../base/i18n/functions';
|
||||
import AbstractVideoMuteButton, { IProps, mapStateToProps } from '../AbstractVideoMuteButton';
|
||||
|
||||
/**
|
||||
* Component that renders native toolbar button for toggling video mute.
|
||||
*
|
||||
* @augments AbstractVideoMuteButton
|
||||
*/
|
||||
class VideoMuteButton extends AbstractVideoMuteButton<IProps> {
|
||||
/**
|
||||
* Changes video muted state and dispatches the state to redux.
|
||||
*
|
||||
* @override
|
||||
* @param {boolean} videoMuted - Whether video should be muted or not.
|
||||
* @protected
|
||||
* @returns {void}
|
||||
*/
|
||||
_setVideoMuted(videoMuted: boolean) {
|
||||
this.props.dispatch?.({
|
||||
type: VIDEO_MUTED_CHANGED,
|
||||
muted: videoMuted
|
||||
});
|
||||
|
||||
export default translate(connect(mapStateToProps)(AbstractVideoMuteButton<IProps>));
|
||||
super._setVideoMuted(videoMuted);
|
||||
}
|
||||
}
|
||||
|
||||
export default translate(connect(mapStateToProps)(VideoMuteButton));
|
||||
|
||||
Reference in New Issue
Block a user