Merge branch 'fix-raiseHand' into develop

master
Stefan Otto 2018-07-26 11:42:46 +02:00
commit 4f8c896a43
11 changed files with 1240 additions and 1084 deletions

View File

@ -913,11 +913,6 @@ export default class RoomClient
{ {
this._dispatch( this._dispatch(
stateActions.setMyRaiseHandState(state)); stateActions.setMyRaiseHandState(state));
this._dispatch(requestActions.notify(
{
text : 'raiseHand state changed'
}));
this._dispatch( this._dispatch(
stateActions.setMyRaiseHandStateInProgress(false)); stateActions.setMyRaiseHandStateInProgress(false));
}) })
@ -1806,10 +1801,11 @@ export default class RoomClient
this._dispatch(stateActions.addPeer( this._dispatch(stateActions.addPeer(
{ {
name : peer.name, name : peer.name,
displayName : displayName, displayName : displayName,
device : peer.appData.device, device : peer.appData.device,
consumers : [] raiseHandState : peer.appData.raiseHandState,
consumers : []
})); }));
if (notify) if (notify)

View File

@ -47,6 +47,20 @@ const ListPeer = (props) =>
<div className='peer-info'> <div className='peer-info'>
{peer.displayName} {peer.displayName}
</div> </div>
<div className='indicators'>
{peer.raiseHandState ?
<div className={
classnames(
'icon', 'raise-hand', {
on : peer.raiseHandState,
off : !peer.raiseHandState
}
)
}
/>
:null
}
</div>
<div className='controls'> <div className='controls'>
{ screenConsumer ? { screenConsumer ?
<div <div

View File

@ -91,6 +91,20 @@ class Peer extends Component
} }
<div className={classnames('view-container', 'webcam')} style={style}> <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 <div
className={classnames('controls', { className={classnames('controls', {
visible : this.state.controlsVisible visible : this.state.controlsVisible

View File

@ -51,7 +51,7 @@ class Sidebar extends Component
{ {
const { const {
toolbarsVisible, me, screenProducer, onLogin, onShareScreen, toolbarsVisible, me, screenProducer, onLogin, onShareScreen,
onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout onUnShareScreen, onNeedExtension, onLeaveMeeting, onLogout, onToggleHand
} = this.props; } = this.props;
let screenState; let screenState;
@ -144,6 +144,15 @@ class Sidebar extends Component
onClick={onLogin} 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 <div
className={classnames('button', 'leave-meeting')} className={classnames('button', 'leave-meeting')}
@ -162,6 +171,7 @@ Sidebar.propTypes = {
onShareScreen : PropTypes.func.isRequired, onShareScreen : PropTypes.func.isRequired,
onUnShareScreen : PropTypes.func.isRequired, onUnShareScreen : PropTypes.func.isRequired,
onNeedExtension : PropTypes.func.isRequired, onNeedExtension : PropTypes.func.isRequired,
onToggleHand : PropTypes.func.isRequired,
onLeaveMeeting : PropTypes.func.isRequired, onLeaveMeeting : PropTypes.func.isRequired,
onLogin : PropTypes.func.isRequired, onLogin : PropTypes.func.isRequired,
onLogout : PropTypes.func.isRequired, onLogout : PropTypes.func.isRequired,
@ -181,6 +191,7 @@ const mapDispatchToProps = {
onShareScreen : requestActions.enableScreenSharing, onShareScreen : requestActions.enableScreenSharing,
onUnShareScreen : requestActions.disableScreenSharing, onUnShareScreen : requestActions.disableScreenSharing,
onNeedExtension : requestActions.installExtension, onNeedExtension : requestActions.installExtension,
onToggleHand : requestActions.toggleHand,
onLogin : requestActions.userLogin, onLogin : requestActions.userLogin,
onLogout : requestActions.userLogout onLogout : requestActions.userLogout
}; };

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) => export const sendChatMessage = (text, name, picture) =>
{ {
const message = createNewMessage(text, 'response', name, picture); const message = createNewMessage(text, 'response', name, picture);

23
app/package-lock.json generated
View File

@ -4599,12 +4599,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -4619,17 +4621,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -4746,7 +4751,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -4758,6 +4764,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -4772,6 +4779,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -4890,7 +4898,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -4902,6 +4911,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -5023,6 +5033,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",

View File

@ -16,7 +16,55 @@
[data-component='ListPeer'] { [data-component='ListPeer'] {
display: flex; display: flex;
> .indicators {
left: 0;
top: 0;
display: flex;
flex-direction:; row;
justify-content: flex-start;
align-items: center;
padding: 0.4vmin;
transition: opacity 0.3s;
> .icon {
flex: 0 0 auto;
margin: 0.2vmin;
border-radius: 2px;
background-position: center;
background-size: 75%;
background-repeat: no-repeat;
background-color: rgba(#000, 0.5);
transition-property: opacity, background-color;
transition-duration: 0.15s;
+desktop() {
width: 24px;
height: 24px;
opacity: 0.85;
&:hover {
opacity: 1;
}
}
+mobile() {
width: 22px;
height: 22px;
}
&.on {
opacity: 1;
}
&.off {
opacity: 0.2;
}
&.raise-hand {
background-image: url('/resources/images/icon-hand-white.svg');
}
}
}
> .controls { > .controls {
float: right; float: right;
display: flex; display: flex;

View File

@ -32,7 +32,57 @@
order: 1; order: 1;
max-width: 50%; max-width: 50%;
} }
> .indicators {
position: absolute;
left: 0;
top: 0;
display: flex;
flex-direction:; row;
justify-content: flex-start;
align-items: center;
padding: 0.4vmin;
transition: opacity 0.3s;
z-index: 10;
> .icon {
flex: 0 0 auto;
margin: 0.2vmin;
border-radius: 2px;
background-position: center;
background-size: 75%;
background-repeat: no-repeat;
background-color: rgba(#000, 0.5);
transition-property: opacity, background-color;
transition-duration: 0.15s;
+desktop() {
width: 24px;
height: 24px;
opacity: 0.85;
&:hover {
opacity: 1;
}
}
+mobile() {
width: 22px;
height: 22px;
}
&.on {
opacity: 1;
}
&.off {
opacity: 0.2;
}
&.raise-hand {
background-image: url('/resources/images/icon-hand-white.svg');
}
}
}
> .controls { > .controls {
position: absolute; position: absolute;
z-index: 10; z-index: 10;

View File

@ -279,7 +279,7 @@ class Room extends EventEmitter
const { raiseHandState } = request.data; const { raiseHandState } = request.data;
const { mediaPeer } = protooPeer.data; const { mediaPeer } = protooPeer.data;
mediaPeer.appData.raiseHand = request.data.raiseHandState; mediaPeer.appData.raiseHandState = request.data.raiseHandState;
// Spread to others via protoo. // Spread to others via protoo.
this._protooRoom.spread( this._protooRoom.spread(
'raisehand-message', 'raisehand-message',

2104
server/package-lock.json generated

File diff suppressed because it is too large Load Diff