fix: fullscreenbutton on screenshare

master
Stefan Otto 2018-07-18 15:21:19 +02:00
parent dcca301d82
commit f49f02d016
2 changed files with 9 additions and 5 deletions

View File

@ -52,21 +52,21 @@ 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();
} }

View File

@ -147,7 +147,11 @@ class Peer extends Component
{screenConsumer ? {screenConsumer ?
<div className={classnames('view-container', 'screen')} style={style}> <div className={classnames('view-container', 'screen')} style={style}>
<div className='controls'> <div
className={classnames('controls', {
visible : this.state.controlsVisible
})}
>
<div <div
className={classnames('button', 'screen', { className={classnames('button', 'screen', {
on : screenVisible, on : screenVisible,