diff --git a/src/skins/vector/views/molecules/RoomHeader.js b/src/skins/vector/views/molecules/RoomHeader.js index b7c0394c8..527bf2f7a 100644 --- a/src/skins/vector/views/molecules/RoomHeader.js +++ b/src/skins/vector/views/molecules/RoomHeader.js @@ -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'); diff --git a/src/skins/vector/views/molecules/voip/VideoView.js b/src/skins/vector/views/molecules/voip/VideoView.js index 80160b78c..a27b74e07 100644 --- a/src/skins/vector/views/molecules/voip/VideoView.js +++ b/src/skins/vector/views/molecules/voip/VideoView.js @@ -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 ( -
+