Merge pull request #265 from vector-im/230-exit-full-screen-voip
Exit full screen programatically when the remote side hangs up
This commit is contained in:
commit
3423a493e7
|
@ -90,6 +90,7 @@ module.exports = {
|
||||||
else {
|
else {
|
||||||
this.getVideoView().getLocalVideoElement().style.display = "none";
|
this.getVideoView().getLocalVideoElement().style.display = "none";
|
||||||
this.getVideoView().getRemoteVideoElement().style.display = "none";
|
this.getVideoView().getRemoteVideoElement().style.display = "none";
|
||||||
|
dis.dispatch({action: 'video_fullscreen', fullscreen: false});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,7 @@ module.exports = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
onFullscreenClick: function() {
|
onFullscreenClick: function() {
|
||||||
dis.dispatch({action: 'video_fullscreen'}, true);
|
dis.dispatch({action: 'video_fullscreen', fullscreen: true}, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
|
|
|
@ -51,8 +51,26 @@ module.exports = React.createClass({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var element = this.container.getDOMNode();
|
var element = this.container.getDOMNode();
|
||||||
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullscreen;
|
if (payload.fullscreen) {
|
||||||
requestMethod.call(element);
|
var requestMethod = (
|
||||||
|
element.requestFullScreen ||
|
||||||
|
element.webkitRequestFullScreen ||
|
||||||
|
element.mozRequestFullScreen ||
|
||||||
|
element.msRequestFullscreen
|
||||||
|
);
|
||||||
|
requestMethod.call(element);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
var exitMethod = (
|
||||||
|
document.exitFullscreen ||
|
||||||
|
document.mozCancelFullScreen ||
|
||||||
|
document.webkitExitFullscreen ||
|
||||||
|
document.msExitFullscreen
|
||||||
|
);
|
||||||
|
if (exitMethod) {
|
||||||
|
exitMethod.call(document);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue