mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
show ongoing audio call in LeftPanel
This commit is contained in:
parent
dae250b3a3
commit
a23d8e313d
1 changed files with 30 additions and 4 deletions
|
@ -41,6 +41,16 @@ module.exports = React.createClass({
|
||||||
// a callback which is called when the content in the callview changes
|
// a callback which is called when the content in the callview changes
|
||||||
// in a way that is likely to cause a resize.
|
// in a way that is likely to cause a resize.
|
||||||
onResize: React.PropTypes.func,
|
onResize: React.PropTypes.func,
|
||||||
|
|
||||||
|
// render ongoing audio call details - useful when in LeftPanel
|
||||||
|
showVoice: React.PropTypes.bool,
|
||||||
|
},
|
||||||
|
|
||||||
|
getInitialState: function() {
|
||||||
|
return {
|
||||||
|
// the call this view is displaying (if any)
|
||||||
|
call: null,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
componentDidMount: function() {
|
componentDidMount: function() {
|
||||||
|
@ -71,9 +81,15 @@ module.exports = React.createClass({
|
||||||
this.props.ConferenceHandler.getConferenceCallForRoom(roomId) :
|
this.props.ConferenceHandler.getConferenceCallForRoom(roomId) :
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this.call) {
|
||||||
|
this.setState({ call: call });
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
call = CallHandler.getAnyActiveCall();
|
call = CallHandler.getAnyActiveCall();
|
||||||
|
this.setState({ call: call });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (call) {
|
if (call) {
|
||||||
|
@ -108,11 +124,21 @@ module.exports = React.createClass({
|
||||||
|
|
||||||
render: function(){
|
render: function(){
|
||||||
var VideoView = sdk.getComponent('voip.VideoView');
|
var VideoView = sdk.getComponent('voip.VideoView');
|
||||||
|
|
||||||
|
var voice;
|
||||||
|
if (this.state.call && this.state.call.type === "voice" && this.props.showVoice) {
|
||||||
|
var callRoom = MatrixClientPeg.get().getRoom(this.state.call.roomId);
|
||||||
|
voice = <div className="mx_CallView_voice" onClick={ this.props.onClick }>Active call ({ callRoom.name })</div>;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<VideoView ref="video" onClick={ this.props.onClick }
|
<div>
|
||||||
onResize={ this.props.onResize }
|
<VideoView ref="video" onClick={ this.props.onClick }
|
||||||
maxHeight={ this.props.maxVideoHeight }
|
onResize={ this.props.onResize }
|
||||||
/>
|
maxHeight={ this.props.maxVideoHeight }
|
||||||
|
/>
|
||||||
|
{ voice }
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue