Add VideoFeed atom and VideoView organism.

pull/1/head
Kegan Dougal 2015-07-15 13:09:15 +01:00
parent c69606df44
commit aba103b8e0
5 changed files with 108 additions and 0 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/VideoFeed");
module.exports = React.createClass({
displayName: 'VideoFeed',
mixins: [VideoFeedController],
render: function() {
return (
<video>
</video>
);
},
});

View File

@ -0,0 +1,49 @@
/*
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 VideoFeed = ComponentBroker.get('atoms/VideoFeed');
module.exports = React.createClass({
displayName: 'VideoView',
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

@ -22,6 +22,7 @@ var ComponentBroker = require('../../../../src/ComponentBroker');
var LeftPanel = ComponentBroker.get('organisms/LeftPanel');
var RoomView = ComponentBroker.get('organisms/RoomView');
var RightPanel = ComponentBroker.get('organisms/RightPanel');
var VideoView = ComponentBroker.get('organisms/VideoView');
var Login = ComponentBroker.get('templates/Login');
var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
@ -40,6 +41,7 @@ module.exports = React.createClass({
<div className="mx_MatrixChat">
<LeftPanel selectedRoom={this.state.currentRoom} />
<RoomView roomId={this.state.currentRoom} key={this.state.currentRoom} />
<VideoView />
<RightPanel roomId={this.state.currentRoom} />
</div>
);

View File

@ -61,6 +61,7 @@ if (0) {
require('../skins/base/views/atoms/LogoutButton');
require('../skins/base/views/atoms/EnableNotificationsButton');
require('../skins/base/views/atoms/MessageTimestamp');
require('../skins/base/views/atoms/VideoFeed');
require('../skins/base/views/molecules/MatrixToolbar');
require('../skins/base/views/molecules/RoomTile');
require('../skins/base/views/molecules/MessageTile');
@ -88,5 +89,6 @@ require('../skins/base/views/organisms/RightPanel');
require('../skins/base/views/molecules/RoomCreate');
require('../skins/base/views/molecules/RoomDropTarget');
require('../skins/base/views/molecules/DirectoryMenu');
require('../skins/base/views/organisms/VideoView');
}

View File

@ -0,0 +1,21 @@
/*
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';
module.exports = {
};