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

View File

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