Skip to content

Commit aba103b

Browse files
committed
Add VideoFeed atom and VideoView organism.
1 parent c69606d commit aba103b

5 files changed

Lines changed: 108 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
Copyright 2015 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
'use strict';
18+
19+
var React = require('react');
20+
21+
var VideoFeedController = require("../../../../src/controllers/atoms/VideoFeed");
22+
23+
module.exports = React.createClass({
24+
displayName: 'VideoFeed',
25+
mixins: [VideoFeedController],
26+
27+
render: function() {
28+
return (
29+
<video>
30+
</video>
31+
);
32+
},
33+
});
34+
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
Copyright 2015 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
'use strict';
18+
19+
var React = require('react');
20+
21+
var MatrixClientPeg = require("../../../../src/MatrixClientPeg");
22+
var ComponentBroker = require('../../../../src/ComponentBroker');
23+
24+
var VideoFeed = ComponentBroker.get('atoms/VideoFeed');
25+
26+
module.exports = React.createClass({
27+
displayName: 'VideoView',
28+
29+
getRemoteVideoElement: function() {
30+
return this.refs.remote.getDOMNode();
31+
},
32+
33+
getLocalVideoElement: function() {
34+
return this.refs.local.getDOMNode();
35+
},
36+
37+
render: function() {
38+
return (
39+
<div>
40+
<div>
41+
<VideoFeed ref="remote"/>
42+
</div>
43+
<div>
44+
<VideoFeed ref="local"/>
45+
</div>
46+
</div>
47+
);
48+
},
49+
});

‎skins/base/views/pages/MatrixChat.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var ComponentBroker = require('../../../../src/ComponentBroker');
2222
var LeftPanel = ComponentBroker.get('organisms/LeftPanel');
2323
var RoomView = ComponentBroker.get('organisms/RoomView');
2424
var RightPanel = ComponentBroker.get('organisms/RightPanel');
25+
var VideoView = ComponentBroker.get('organisms/VideoView');
2526
var Login = ComponentBroker.get('templates/Login');
2627

2728
var MatrixChatController = require("../../../../src/controllers/pages/MatrixChat");
@@ -40,6 +41,7 @@ module.exports = React.createClass({
4041
<div className="mx_MatrixChat">
4142
<LeftPanel selectedRoom={this.state.currentRoom} />
4243
<RoomView roomId={this.state.currentRoom} key={this.state.currentRoom} />
44+
<VideoView />
4345
<RightPanel roomId={this.state.currentRoom} />
4446
</div>
4547
);

‎src/ComponentBroker.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ if (0) {
6161
require('../skins/base/views/atoms/LogoutButton');
6262
require('../skins/base/views/atoms/EnableNotificationsButton');
6363
require('../skins/base/views/atoms/MessageTimestamp');
64+
require('../skins/base/views/atoms/VideoFeed');
6465
require('../skins/base/views/molecules/MatrixToolbar');
6566
require('../skins/base/views/molecules/RoomTile');
6667
require('../skins/base/views/molecules/MessageTile');
@@ -88,5 +89,6 @@ require('../skins/base/views/organisms/RightPanel');
8889
require('../skins/base/views/molecules/RoomCreate');
8990
require('../skins/base/views/molecules/RoomDropTarget');
9091
require('../skins/base/views/molecules/DirectoryMenu');
92+
require('../skins/base/views/organisms/VideoView');
9193

9294
}

‎src/controllers/atoms/VideoFeed.js‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
Copyright 2015 OpenMarket Ltd
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
'use strict';
18+
19+
module.exports = {
20+
};
21+

0 commit comments

Comments
 (0)