Merge branch 'fix-raiseHand' into develop

This commit is contained in:
Stefan Otto
2018-07-26 11:42:46 +02:00
11 changed files with 1240 additions and 1084 deletions
+7 -11
View File
@@ -178,11 +178,11 @@ export default class RoomClient
});
}
changeProfilePicture(picture)
changeProfilePicture(picture)
{
logger.debug('changeProfilePicture() [picture: "%s"]', picture);
this._protoo.send('change-profile-picture', { picture }).catch((error) =>
this._protoo.send('change-profile-picture', { picture }).catch((error) =>
{
logger.error('shareProfilePicure() | failed: %o', error);
});
@@ -913,11 +913,6 @@ export default class RoomClient
{
this._dispatch(
stateActions.setMyRaiseHandState(state));
this._dispatch(requestActions.notify(
{
text : 'raiseHand state changed'
}));
this._dispatch(
stateActions.setMyRaiseHandStateInProgress(false));
})
@@ -1806,10 +1801,11 @@ export default class RoomClient
this._dispatch(stateActions.addPeer(
{
name : peer.name,
displayName : displayName,
device : peer.appData.device,
consumers : []
name : peer.name,
displayName : displayName,
device : peer.appData.device,
raiseHandState : peer.appData.raiseHandState,
consumers : []
}));
if (notify)
@@ -47,6 +47,20 @@ const ListPeer = (props) =>
<div className='peer-info'>
{peer.displayName}
</div>
<div className='indicators'>
{peer.raiseHandState ?
<div className={
classnames(
'icon', 'raise-hand', {
on : peer.raiseHandState,
off : !peer.raiseHandState
}
)
}
/>
:null
}
</div>
<div className='controls'>
{ screenConsumer ?
<div
+14
View File
@@ -91,6 +91,20 @@ class Peer extends Component
}
<div className={classnames('view-container', 'webcam')} style={style}>
<div className='indicators'>
{peer.raiseHandState ?
<div className={
classnames(
'icon', 'raise-hand', {
on : peer.raiseHandState,
off : !peer.raiseHandState
}
)
}
/>
:null
}
</div>
<div
className={classnames('controls', {
visible : this.state.controlsVisible
+20 -9
View File
@@ -14,17 +14,17 @@ class Sidebar extends Component
handleToggleFullscreen = () =>
{
if (fscreen.fullscreenElement)
if (fscreen.fullscreenElement)
{
fscreen.exitFullscreen();
}
else
else
{
fscreen.requestFullscreen(document.documentElement);
}
};
handleFullscreenChange = () =>
handleFullscreenChange = () =>
{
this.setState({
fullscreen : fscreen.fullscreenElement !== null
@@ -47,16 +47,16 @@ class Sidebar extends Component
}
}
render()
render()
{
const {
toolbarsVisible, me, screenProducer, onLogin, onShareScreen,
onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout
onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout, onToggleHand
} = this.props;
let screenState;
let screenTip;
if (me.needExtension)
{
screenState = 'need-extension';
@@ -77,7 +77,7 @@ class Sidebar extends Component
screenState = 'off';
screenTip = 'Start screen sharing';
}
return (
<div
className={classnames('sidebar room-controls', {
@@ -126,7 +126,7 @@ class Sidebar extends Component
}
}}
/>
{me.loginEnabled && (me.loggedIn ? (
<div
className='button logout'
@@ -144,6 +144,15 @@ class Sidebar extends Component
onClick={onLogin}
/>
))}
<div
className={classnames('button', 'raise-hand', {
on : me.raiseHand,
disabled : me.raiseHandInProgress
})}
data-tip='Raise hand'
data-type='dark'
onClick={() => onToggleHand(!me.raiseHand)}
/>
<div
className={classnames('button', 'leave-meeting')}
@@ -162,6 +171,7 @@ Sidebar.propTypes = {
onShareScreen : PropTypes.func.isRequired,
onUnShareScreen : PropTypes.func.isRequired,
onNeedExtension : PropTypes.func.isRequired,
onToggleHand : PropTypes.func.isRequired,
onLeaveMeeting : PropTypes.func.isRequired,
onLogin : PropTypes.func.isRequired,
onLogout : PropTypes.func.isRequired,
@@ -181,6 +191,7 @@ const mapDispatchToProps = {
onShareScreen : requestActions.enableScreenSharing,
onUnShareScreen : requestActions.disableScreenSharing,
onNeedExtension : requestActions.installExtension,
onToggleHand : requestActions.toggleHand,
onLogin : requestActions.userLogin,
onLogout : requestActions.userLogout
};
@@ -188,4 +199,4 @@ const mapDispatchToProps = {
export default connect(
mapStateToProps,
mapDispatchToProps
)(Sidebar);
)(Sidebar);
+12
View File
@@ -191,6 +191,18 @@ export const installExtension = () =>
};
};
export const toggleHand = (enable) =>
{
if (enable)
return {
type : 'RAISE_HAND'
};
else
return {
type : 'LOWER_HAND'
};
};
export const sendChatMessage = (text, name, picture) =>
{
const message = createNewMessage(text, 'response', name, picture);