Update linting and fix PropTypes for FullView

master
Torjus 2018-07-16 16:54:00 +02:00
parent 44058625b9
commit 67e2fc1c6f
2 changed files with 15 additions and 8 deletions

View File

@ -52,18 +52,22 @@ export default class FullView extends React.Component
this._setTracks(videoTrack);
if (fscreen.fullscreenEnabled) {
if (fscreen.fullscreenEnabled)
{
fscreen.addEventListener('fullscreenchange', this.handleExitFullscreen, false);
fscreen.requestFullscreen(this.video.current);
}
}
componentWillUnmount() {
componentWillUnmount()
{
fscreen.removeEventListener('fullscreenchange', this.handleExitFullscreen);
}
handleExitFullscreen = () => {
if (!fscreen.fullscreenElement) {
handleExitFullscreen = () =>
{
if (!fscreen.fullscreenElement)
{
this.props.toggleFullscreen();
}
};
@ -87,6 +91,7 @@ export default class FullView extends React.Component
if (videoTrack)
{
const stream = new MediaStream;
stream.addTrack(videoTrack);
video.srcObject = stream;
}
@ -99,7 +104,8 @@ export default class FullView extends React.Component
FullView.propTypes =
{
videoTrack : PropTypes.any,
videoVisible : PropTypes.bool,
videoProfile : PropTypes.string
videoTrack : PropTypes.any,
videoVisible : PropTypes.bool,
videoProfile : PropTypes.string,
toggleFullscreen : PropTypes.func.isRequired
};

View File

@ -69,7 +69,8 @@ class Peers extends React.Component
componentDidUpdate(prevProps)
{
if (prevProps.toolAreaOpen !== this.props.toolAreaOpen) {
if (prevProps.toolAreaOpen !== this.props.toolAreaOpen)
{
this.updateDimensions();
}
}