Add in voip mute video/audio skin. Needs a bit more CSS tweaks.

This commit is contained in:
Kegan Dougal 2015-10-20 09:55:34 +01:00
parent bdbfc2b6e0
commit d302f3eebb
3 changed files with 38 additions and 2 deletions

View file

@ -19,6 +19,7 @@ limitations under the License.
var React = require('react');
var sdk = require('matrix-react-sdk')
var CallHandler = require('matrix-react-sdk/lib/CallHandler');
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
var RoomHeaderController = require('matrix-react-sdk/lib/controllers/molecules/RoomHeader')
@ -54,9 +55,36 @@ module.exports = React.createClass({
var callButtons;
if (this.state && this.state.call_state != 'ended') {
var muteVideoButton;
var activeCall = (
CallHandler.getCallForRoom(this.props.room.roomId)
);
if (activeCall && activeCall.type === "video") {
muteVideoButton = (
<div className="mx_RoomHeader_textButton mx_RoomHeader_voipButton"
onClick={this.onMuteVideoClick}>
{
(activeCall.isLocalVideoMuted() ?
"Unmute" : "Mute") + " video"
}
</div>
);
}
callButtons = (
<div className="mx_RoomHeader_textButton" onClick={this.onHangupClick}>
End call
<div>
<div className="mx_RoomHeader_textButton mx_RoomHeader_voipButton"
onClick={this.onHangupClick}>
End call
</div>
{muteVideoButton}
<div className="mx_RoomHeader_textButton mx_RoomHeader_voipButton"
onClick={this.onMuteAudioClick}>
{
(activeCall && activeCall.isMicrophoneMuted() ?
"Unmute" : "Mute") + " audio"
}
</div>
</div>
);
}