Skip to content
Snippets Groups Projects
Commit 34ad48a5 authored by David Baker's avatar David Baker
Browse files

Wire up fullscreen button. Requires react-sdk with sync flag to dispatcher.

parent 078134d4
Branches
Tags
No related merge requests found
......@@ -18,6 +18,7 @@ limitations under the License.
var React = require('react');
var sdk = require('matrix-react-sdk')
var dis = require('matrix-react-sdk/lib/dispatcher')
var CallHandler = require('matrix-react-sdk/lib/CallHandler');
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
......@@ -37,6 +38,10 @@ module.exports = React.createClass({
return this.refs.name_edit.getDOMNode().value;
},
onFullscreenClick: function() {
dis.dispatch({action: 'video_fullscreen'}, true);
},
render: function() {
var EditableText = sdk.getComponent("atoms.EditableText");
var RoomAvatar = sdk.getComponent('atoms.RoomAvatar');
......
......@@ -19,12 +19,17 @@ limitations under the License.
var React = require('react');
var sdk = require('matrix-react-sdk')
var dis = require('matrix-react-sdk/lib/dispatcher')
var VideoViewController = require('matrix-react-sdk/lib/controllers/molecules/voip/VideoView')
module.exports = React.createClass({
displayName: 'VideoView',
mixins: [VideoViewController],
componentWillMount: function() {
dis.register(this.onAction);
},
getRemoteVideoElement: function() {
return this.refs.remote.getDOMNode();
},
......@@ -33,10 +38,20 @@ module.exports = React.createClass({
return this.refs.local.getDOMNode();
},
onAction: function(payload) {
switch (payload.action) {
case 'video_fullscreen':
var element = this.refs.container.getDOMNode();
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
requestMethod.call(element);
break;
}
},
render: function() {
var VideoFeed = sdk.getComponent('atoms.voip.VideoFeed');
return (
<div className="mx_VideoView">
<div className="mx_VideoView" ref="container">
<div className="mx_VideoView_remoteVideoFeed">
<VideoFeed ref="remote"/>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment