Try refing the container using a functiob as it currently seems to be endinh up with no refs some of the time

kegan/timestamp-hover
David Baker 2015-10-20 18:23:27 +01:00
parent fe0707535c
commit 006f0b00c6
1 changed files with 7 additions and 3 deletions

View File

@ -38,13 +38,17 @@ module.exports = React.createClass({
return this.refs.local.getDOMNode(); return this.refs.local.getDOMNode();
}, },
setContainer: function(c) {
this.container = c;
},
onAction: function(payload) { onAction: function(payload) {
switch (payload.action) { switch (payload.action) {
case 'video_fullscreen': case 'video_fullscreen':
if (!this.refs.container) { if (!this.container) {
return; return;
} }
var element = this.refs.container.getDOMNode(); var element = this.container.getDOMNode();
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen; var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
requestMethod.call(element); requestMethod.call(element);
break; break;
@ -54,7 +58,7 @@ module.exports = React.createClass({
render: function() { render: function() {
var VideoFeed = sdk.getComponent('atoms.voip.VideoFeed'); var VideoFeed = sdk.getComponent('atoms.voip.VideoFeed');
return ( return (
<div className="mx_VideoView" ref="container"> <div className="mx_VideoView" ref={this.setContainer}>
<div className="mx_VideoView_remoteVideoFeed"> <div className="mx_VideoView_remoteVideoFeed">
<VideoFeed ref="remote"/> <VideoFeed ref="remote"/>
</div> </div>