+ let callControls;
+ if (this.props.room) {
+ const micClasses = classNames({
+ mx_CallView_callControls_button: true,
+ mx_CallView_callControls_button_micOn: !this.state.micMuted,
+ mx_CallView_callControls_button_micOff: this.state.micMuted,
+ });
- //
;
+ const vidClasses = classNames({
+ mx_CallView_callControls_button: true,
+ mx_CallView_callControls_button_vidOn: !this.state.vidMuted,
+ mx_CallView_callControls_button_vidOff: this.state.vidMuted,
+ });
+
+ // Put the other states of the mic/video icons in the document to make sure they're cached
+ // (otherwise the icon disappears briefly when toggled)
+ const micCacheClasses = classNames({
+ mx_CallView_callControls_button: true,
+ mx_CallView_callControls_button_micOn: this.state.micMuted,
+ mx_CallView_callControls_button_micOff: !this.state.micMuted,
+ mx_CallView_callControls_button_invisible: true,
+ });
+
+ const vidCacheClasses = classNames({
+ mx_CallView_callControls_button: true,
+ mx_CallView_callControls_button_vidOn: this.state.micMuted,
+ mx_CallView_callControls_button_vidOff: !this.state.micMuted,
+ mx_CallView_callControls_button_invisible: true,
+ });
+
+ const callControlsClasses = classNames({
+ mx_CallView_callControls: true,
+ mx_CallView_callControls_hidden: !this.state.controlsVisible,
+ });
+
+ callControls =
+
+
{
+ dis.dispatch({
+ action: 'hangup',
+ room_id: this.state.call.roomId,
+ });
+ }}
+ />
+
+
+
+
;
+ }
// The 'content' for the call, ie. the videos for a video call and profile picture
// for voice calls (fills the bg)
@@ -196,76 +320,20 @@ export default class CallView extends React.Component
{
maxHeight={maxVideoHeight}
/>
+ {callControls}
;
} else {
const avatarSize = this.props.room ? 200 : 75;
- contentView =
+ contentView =
+ {callControls}
;
}
- /*
- if (!this.props.room) {
- const client = MatrixClientPeg.get();
- const callRoom = client.getRoom(this.state.call.roomId);
-
- let caption = _t("Active call");
- if (this.state.isLocalOnHold) {
- // we currently have no UI for holding / unholding a call (apart from slash
- // commands) so we don't disintguish between when we've put the call on hold
- // (ie. we'd show an unhold button) and when the other side has put us on hold
- // (where obviously we would not show such a button).
- caption = _t("Call Paused");
- }
-
- view =
-
-
-
-
-
{callRoom.name}
-
{ caption }
-
- ;
- } else {
- // For video calls, we currently ignore the call hold state altogether
- // (the video will just go black)
-
- // if we're fullscreen, we don't want to set a maxHeight on the video element.
- const maxVideoHeight = getFullScreenElement() ? null : this.props.maxVideoHeight;
- view =
-
-
-
;
- }
- */
-
-
- /*
- let hangup: React.ReactNode;
- if (this.props.showHangup) {
- hangup =
{
- dis.dispatch({
- action: 'hangup',
- room_id: this.state.call.roomId,
- });
- }}
- />;
- }
- */
-
const callTypeText = this.state.call.type === CallType.Video ? _t("Video Call") : _t("Voice Call");
let myClassName;
@@ -290,7 +358,9 @@ export default class CallView extends React.Component
{
myClassName = 'mx_CallView_large';
} else {
header =
-
+
+
+
{callRoom.name}
{callTypeText}