diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index fa283d7..b74a1ae 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -179,6 +179,13 @@ export default class RoomClient this.notify('Changed layout to filmstrip view.'); break; } + + case 'm': // Toggle microphone + { + this.toggleMic(); + this.notify('Muted/unmuted your microphone.'); + break; + } } } }); @@ -391,6 +398,16 @@ export default class RoomClient } } + toggleMic() + { + logger.debug('toggleMic()'); + + if (this._micProducer.locallyPaused) + this.unmuteMic(); + else + this.muteMic(); + } + muteMic() { logger.debug('muteMic()'); diff --git a/app/lib/components/Peer.jsx b/app/lib/components/Peer.jsx index ee0861f..9da8c67 100644 --- a/app/lib/components/Peer.jsx +++ b/app/lib/components/Peer.jsx @@ -40,7 +40,8 @@ class Peer extends Component onUnmuteMic, toggleConsumerFullscreen, toggleConsumerWindow, - style + style, + windowConsumer } = this.props; const micEnabled = ( @@ -128,7 +129,9 @@ class Peer extends Component />
{ e.stopPropagation(); @@ -205,6 +208,7 @@ Peer.propTypes = micConsumer : appPropTypes.Consumer, webcamConsumer : appPropTypes.Consumer, screenConsumer : appPropTypes.Consumer, + windowConsumer : PropTypes.number, onMuteMic : PropTypes.func.isRequired, onUnmuteMic : PropTypes.func.isRequired, streamDimensions : PropTypes.object, @@ -229,7 +233,8 @@ const mapStateToProps = (state, { name }) => peer, micConsumer, webcamConsumer, - screenConsumer + screenConsumer, + windowConsumer : state.room.windowConsumer }; };