Merge pull request #6 from matrix-org/voip

VoIP addition
This commit is contained in:
David Baker 2015-07-16 12:31:36 +01:00
commit a6f857e9d8
12 changed files with 527 additions and 3 deletions

View file

@ -0,0 +1,34 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
var React = require('react');
var VideoFeedController = require("../../../../../src/controllers/atoms/voip/VideoFeed");
module.exports = React.createClass({
displayName: 'VideoFeed',
mixins: [VideoFeedController],
render: function() {
return (
<video>
</video>
);
},
});

View file

@ -30,6 +30,32 @@ module.exports = React.createClass({
var topic = this.props.room.currentState.getStateEvents('m.room.topic', '');
topic = topic ? <div className="mx_RoomHeader_topic">{ topic.getContent().topic }</div> : null;
var callButtons;
if (this.state) {
switch (this.state.call_state) {
case "ringing":
callButtons = (
<div>
<div className="mx_RoomHeader_button" onClick={this.onAnswerClick}>
YUP
</div>
<div className="mx_RoomHeader_button" onClick={this.onHangupClick}>
NOPE
</div>
</div>
);
break;
case "ringback":
case "connected":
callButtons = (
<div className="mx_RoomHeader_button" onClick={this.onHangupClick}>
BYEBYE
</div>
);
break;
}
}
return (
<div className="mx_RoomHeader">
<div className="mx_RoomHeader_wrapper">
@ -49,10 +75,11 @@ module.exports = React.createClass({
<div className="mx_RoomHeader_button">
<img src="img/search.png" width="32" height="32"/>
</div>
<div className="mx_RoomHeader_button">
{callButtons}
<div className="mx_RoomHeader_button" onClick={this.onVideoClick}>
<img src="img/video.png" width="32" height="32"/>
</div>
<div className="mx_RoomHeader_button">
<div className="mx_RoomHeader_button" onClick={this.onVoiceClick}>
<img src="img/voip.png" width="32" height="32"/>
</div>
</div>

View file

@ -0,0 +1,41 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
var React = require('react');
var MatrixClientPeg = require("../../../../../src/MatrixClientPeg");
var ComponentBroker = require('../../../../../src/ComponentBroker');
var CallViewController = require(
"../../../../../src/controllers/molecules/voip/CallView"
);
var VideoView = ComponentBroker.get('molecules/voip/VideoView');
module.exports = React.createClass({
displayName: 'CallView',
mixins: [CallViewController],
getVideoView: function() {
return this.refs.video;
},
render: function(){
return (
<VideoView ref="video"/>
);
}
});

View file

@ -0,0 +1,50 @@
/*
Copyright 2015 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
'use strict';
var React = require('react');
var MatrixClientPeg = require("../../../../../src/MatrixClientPeg");
var ComponentBroker = require('../../../../../src/ComponentBroker');
var VideoViewController = require("../../../../../src/controllers/molecules/voip/VideoView");
var VideoFeed = ComponentBroker.get('atoms/voip/VideoFeed');
module.exports = React.createClass({
displayName: 'VideoView',
mixins: [VideoViewController],
getRemoteVideoElement: function() {
return this.refs.remote.getDOMNode();
},
getLocalVideoElement: function() {
return this.refs.local.getDOMNode();
},
render: function() {
return (
<div>
<div>
<VideoFeed ref="remote"/>
</div>
<div>
<VideoFeed ref="local"/>
</div>
</div>
);
}
});

View file

@ -26,6 +26,7 @@ var classNames = require("classnames");
var MessageTile = ComponentBroker.get('molecules/MessageTile');
var RoomHeader = ComponentBroker.get('molecules/RoomHeader');
var MessageComposer = ComponentBroker.get('molecules/MessageComposer');
var CallView = ComponentBroker.get("molecules/voip/CallView");
var RoomViewController = require("../../../../src/controllers/organisms/RoomView");
@ -73,7 +74,9 @@ module.exports = React.createClass({
return (
<div className="mx_RoomView">
<RoomHeader room={this.state.room} />
<div className="mx_RoomView_auxPanel"></div>
<div className="mx_RoomView_auxPanel">
<CallView room={this.state.room}/>
</div>
<div ref="messageWrapper" className="mx_RoomView_messagePanel" onScroll={this.onMessageListScroll}>
<div className="mx_RoomView_messageListWrapper">
<div className="mx_RoomView_MessageList" aria-live="polite">