Merge branch 'develop' into develop
commit
d606acf1e4
|
|
@ -46,7 +46,8 @@
|
|||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"electron": "electron --no-sandbox .",
|
||||
"dev": "nf start -p 3000"
|
||||
"dev": "nf start -p 3000",
|
||||
"lint": "eslint -c .eslintrc.json --ext .js src"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ export default class RoomClient
|
|||
this._hark = null;
|
||||
|
||||
// Local MediaStream for hark
|
||||
this._harkStream = null
|
||||
this._harkStream = null;
|
||||
|
||||
// Local webcam mediasoup Producer.
|
||||
this._webcamProducer = null;
|
||||
|
|
@ -1162,21 +1162,30 @@ export default class RoomClient
|
|||
...VIDEO_CONSTRAINS[resolution]
|
||||
}
|
||||
});
|
||||
if (stream){
|
||||
|
||||
if (stream)
|
||||
{
|
||||
const track = stream.getVideoTracks()[0];
|
||||
if (track) {
|
||||
|
||||
if (track)
|
||||
{
|
||||
await this._webcamProducer.replaceTrack({ track });
|
||||
|
||||
store.dispatch(
|
||||
producerActions.setProducerTrack(this._webcamProducer.id, track));
|
||||
|
||||
} else {
|
||||
logger.warn('getVideoTracks Error: First Video Track is null')
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn('getVideoTracks Error: First Video Track is null');
|
||||
}
|
||||
|
||||
} else {
|
||||
logger.warn ('getUserMedia Error: Stream is null!')
|
||||
}
|
||||
else
|
||||
{
|
||||
logger.warn('getUserMedia Error: Stream is null!');
|
||||
}
|
||||
|
||||
store.dispatch(settingsActions.setSelectedWebcamDevice(deviceId));
|
||||
|
||||
await this._updateWebcams();
|
||||
|
|
@ -1586,6 +1595,50 @@ export default class RoomClient
|
|||
})
|
||||
}));
|
||||
|
||||
if (this._screenSharingProducer)
|
||||
{
|
||||
this._screenSharingProducer.close();
|
||||
|
||||
store.dispatch(
|
||||
producerActions.removeProducer(this._screenSharingProducer.id));
|
||||
|
||||
this._screenSharingProducer = null;
|
||||
}
|
||||
|
||||
if (this._webcamProducer)
|
||||
{
|
||||
this._webcamProducer.close();
|
||||
|
||||
store.dispatch(
|
||||
producerActions.removeProducer(this._webcamProducer.id));
|
||||
|
||||
this._webcamProducer = null;
|
||||
}
|
||||
|
||||
if (this._micProducer)
|
||||
{
|
||||
this._micProducer.close();
|
||||
|
||||
store.dispatch(
|
||||
producerActions.removeProducer(this._micProducer.id));
|
||||
|
||||
this._micProducer = null;
|
||||
}
|
||||
|
||||
if (this._sendTransport)
|
||||
{
|
||||
this._sendTransport.close();
|
||||
|
||||
this._sendTransport = null;
|
||||
}
|
||||
|
||||
if (this._recvTransport)
|
||||
{
|
||||
this._recvTransport.close();
|
||||
|
||||
this._recvTransport = null;
|
||||
}
|
||||
|
||||
store.dispatch(roomActions.setRoomState('connecting'));
|
||||
});
|
||||
|
||||
|
|
@ -1788,6 +1841,13 @@ export default class RoomClient
|
|||
break;
|
||||
}
|
||||
|
||||
case 'roomBack':
|
||||
{
|
||||
await this._joinRoom({ joinVideo });
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 'lockRoom':
|
||||
{
|
||||
store.dispatch(
|
||||
|
|
@ -2340,7 +2400,7 @@ export default class RoomClient
|
|||
dtlsParameters,
|
||||
iceServers : this._turnServers,
|
||||
// TODO: Fix for issue #72
|
||||
iceTransportPolicy : this._device.flag === 'firefox' ? 'relay' : undefined,
|
||||
iceTransportPolicy : this._device.flag === 'firefox' && this._turnServers ? 'relay' : undefined,
|
||||
proprietaryConstraints : PC_PROPRIETARY_CONSTRAINTS
|
||||
});
|
||||
|
||||
|
|
@ -2402,9 +2462,9 @@ export default class RoomClient
|
|||
iceParameters,
|
||||
iceCandidates,
|
||||
dtlsParameters,
|
||||
iceServers : this._turnServers,
|
||||
iceServers : this._turnServers,
|
||||
// TODO: Fix for issue #72
|
||||
iceTransportPolicy : this._device.flag === 'firefox' ? 'relay' : undefined
|
||||
iceTransportPolicy : this._device.flag === 'firefox' && this._turnServers ? 'relay' : undefined
|
||||
});
|
||||
|
||||
this._recvTransport.on(
|
||||
|
|
@ -2477,7 +2537,11 @@ export default class RoomClient
|
|||
{
|
||||
if (this._mediasoupDevice.canProduce('audio'))
|
||||
if (!this._muted)
|
||||
this.enableMic();
|
||||
{
|
||||
await this.enableMic();
|
||||
if (peers.length > 4)
|
||||
this.muteMic();
|
||||
}
|
||||
|
||||
if (joinVideo && this._mediasoupDevice.canProduce('video'))
|
||||
this.enableWebcam();
|
||||
|
|
|
|||
|
|
@ -35,12 +35,10 @@ export const setConsumerPreferredLayers = (consumerId, spatialLayer, temporalLay
|
|||
});
|
||||
|
||||
export const setConsumerPriority = (consumerId, priority) =>
|
||||
{
|
||||
return {
|
||||
type : 'SET_CONSUMER_PRIORITY',
|
||||
payload : { consumerId, priority }
|
||||
};
|
||||
};
|
||||
({
|
||||
type : 'SET_CONSUMER_PRIORITY',
|
||||
payload : { consumerId, priority }
|
||||
});
|
||||
|
||||
export const setConsumerTrack = (consumerId, track) =>
|
||||
({
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ export const setPicture = (picture) =>
|
|||
});
|
||||
|
||||
export const setMediaCapabilities = ({
|
||||
canSendMic,
|
||||
canSendWebcam,
|
||||
canShareScreen,
|
||||
canShareFiles
|
||||
}) =>
|
||||
canSendMic,
|
||||
canSendWebcam,
|
||||
canShareScreen,
|
||||
canShareFiles
|
||||
}) =>
|
||||
({
|
||||
type : 'SET_MEDIA_CAPABILITIES',
|
||||
payload : { canSendMic, canSendWebcam, canShareScreen, canShareFiles }
|
||||
|
|
@ -92,7 +92,7 @@ export const setDisplayNameInProgress = (flag) =>
|
|||
payload : { flag }
|
||||
});
|
||||
|
||||
export const setIsSpeaking = (flag) =>
|
||||
export const setIsSpeaking = (flag) =>
|
||||
({
|
||||
type : 'SET_IS_SPEAKING',
|
||||
payload : { flag }
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ export const setPeerPicture = (peerId, picture) =>
|
|||
payload : { peerId, picture }
|
||||
});
|
||||
|
||||
|
||||
export const addPeerRole = (peerId, role) =>
|
||||
({
|
||||
type : 'ADD_PEER_ROLE',
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ const ChooseRoom = ({
|
|||
<CookieConsent buttonText={intl.formatMessage({
|
||||
id : 'room.consentUnderstand',
|
||||
defaultMessage : 'I understand'
|
||||
})}>
|
||||
})}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='room.cookieConsent'
|
||||
defaultMessage='This website uses cookies to enhance the user experience'
|
||||
|
|
|
|||
|
|
@ -78,31 +78,33 @@ const styles = (theme) =>
|
|||
alignItems : 'flex-end',
|
||||
padding : theme.spacing(1),
|
||||
zIndex : 21,
|
||||
opacity : 0,
|
||||
opacity : 1,
|
||||
transition : 'opacity 0.3s',
|
||||
touchAction : 'none',
|
||||
pointerEvents : 'none',
|
||||
'&.hover' :
|
||||
'& p' :
|
||||
{
|
||||
opacity : 1
|
||||
},
|
||||
'& p' :
|
||||
{
|
||||
position : 'absolute',
|
||||
float : 'left',
|
||||
top : '50%',
|
||||
left : '50%',
|
||||
transform : 'translate(-50%, -50%)',
|
||||
color : 'rgba(255, 255, 255, 0.5)',
|
||||
fontSize : '7em',
|
||||
margin : 0
|
||||
position : 'absolute',
|
||||
float : 'left',
|
||||
top : '50%',
|
||||
left : '50%',
|
||||
transform : 'translate(-50%, -50%)',
|
||||
color : 'rgba(255, 255, 255, 0.5)',
|
||||
fontSize : '7em',
|
||||
margin : 0,
|
||||
opacity : 0,
|
||||
transition : 'opacity 0.1s ease-in-out',
|
||||
'&.hover' :
|
||||
{
|
||||
opacity : 1
|
||||
}
|
||||
}
|
||||
},
|
||||
ptt :
|
||||
{
|
||||
position : 'absolute',
|
||||
float : 'left',
|
||||
bottom : '10%',
|
||||
top : '10%',
|
||||
left : '50%',
|
||||
transform : 'translate(-50%, 0%)',
|
||||
color : 'rgba(255, 255, 255, 0.7)',
|
||||
|
|
@ -112,10 +114,12 @@ const styles = (theme) =>
|
|||
padding : '15px',
|
||||
borderRadius : '20px',
|
||||
textAlign : 'center',
|
||||
opacity : 0,
|
||||
'&.enabled' :
|
||||
opacity : 0,
|
||||
transition : 'opacity 1s ease',
|
||||
'&.enabled' :
|
||||
{
|
||||
opacity : 1
|
||||
transition : 'opacity 0.1s',
|
||||
opacity : 1
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -292,7 +296,7 @@ const Me = (props) =>
|
|||
>
|
||||
<div className={classnames(classes.viewContainer)} style={style}>
|
||||
<div
|
||||
className={classnames(classes.controls, 'hover')}
|
||||
className={classnames(classes.controls)}
|
||||
onMouseOver={() => setHover(true)}
|
||||
onMouseOut={() => setHover(false)}
|
||||
onTouchStart={() =>
|
||||
|
|
@ -313,7 +317,7 @@ const Me = (props) =>
|
|||
}, 2000);
|
||||
}}
|
||||
>
|
||||
<p className={classnames(hover ? 'hover' : null)}>
|
||||
<p className={classnames(hover && 'hover')}>
|
||||
<FormattedMessage
|
||||
id='room.me'
|
||||
defaultMessage='ME'
|
||||
|
|
@ -323,7 +327,7 @@ const Me = (props) =>
|
|||
<div className={classnames(classes.ptt, (micState ==='muted' && me.isSpeaking) ? 'enabled' : null)} >
|
||||
<FormattedMessage
|
||||
id='me.mutedPTT'
|
||||
defaultMessage='You are muted: hold SPACE-BAR to speak!'
|
||||
defaultMessage='You are muted, hold down SPACE-BAR to talk'
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const styles = (theme) =>
|
|||
},
|
||||
divider :
|
||||
{
|
||||
marginLeft : theme.spacing(3),
|
||||
marginLeft : theme.spacing(3)
|
||||
},
|
||||
show :
|
||||
{
|
||||
|
|
@ -364,7 +364,7 @@ TopBar.propTypes =
|
|||
room : appPropTypes.Room.isRequired,
|
||||
peersLength : PropTypes.number,
|
||||
lobbyPeers : PropTypes.array,
|
||||
permanentTopBar : PropTypes.bool,
|
||||
permanentTopBar : PropTypes.bool,
|
||||
myPicture : PropTypes.string,
|
||||
loggedIn : PropTypes.bool.isRequired,
|
||||
loginEnabled : PropTypes.bool.isRequired,
|
||||
|
|
@ -383,14 +383,14 @@ TopBar.propTypes =
|
|||
|
||||
const mapStateToProps = (state) =>
|
||||
({
|
||||
room : state.room,
|
||||
peersLength : peersLengthSelector(state),
|
||||
lobbyPeers : lobbyPeersKeySelector(state),
|
||||
room : state.room,
|
||||
peersLength : peersLengthSelector(state),
|
||||
lobbyPeers : lobbyPeersKeySelector(state),
|
||||
permanentTopBar : state.settings.permanentTopBar,
|
||||
loggedIn : state.me.loggedIn,
|
||||
loginEnabled : state.me.loginEnabled,
|
||||
myPicture : state.me.picture,
|
||||
unread : state.toolarea.unreadMessages +
|
||||
loggedIn : state.me.loggedIn,
|
||||
loginEnabled : state.me.loginEnabled,
|
||||
myPicture : state.me.picture,
|
||||
unread : state.toolarea.unreadMessages +
|
||||
state.toolarea.unreadFiles
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -339,7 +339,8 @@ const JoinDialog = ({
|
|||
<CookieConsent buttonText={intl.formatMessage({
|
||||
id : 'room.consentUnderstand',
|
||||
defaultMessage : 'I understand'
|
||||
})}>
|
||||
})}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='room.cookieConsent'
|
||||
defaultMessage='This website uses cookies to enhance the user experience'
|
||||
|
|
|
|||
|
|
@ -151,14 +151,14 @@ const ListPeer = (props) =>
|
|||
id : 'tooltip.muteScreenSharing',
|
||||
defaultMessage : 'Mute participant share'
|
||||
})}
|
||||
color={ screenVisible ? 'primary' : 'secondary'}
|
||||
disabled={ peer.peerScreenInProgress }
|
||||
color={screenVisible ? 'primary' : 'secondary'}
|
||||
disabled={peer.peerScreenInProgress}
|
||||
onClick={() =>
|
||||
{
|
||||
screenVisible ?
|
||||
roomClient.modifyPeerConsumer(peer.id, 'screen', true) :
|
||||
roomClient.modifyPeerConsumer(peer.id, 'screen', false);
|
||||
}}
|
||||
{
|
||||
screenVisible ?
|
||||
roomClient.modifyPeerConsumer(peer.id, 'screen', true) :
|
||||
roomClient.modifyPeerConsumer(peer.id, 'screen', false);
|
||||
}}
|
||||
>
|
||||
{ screenVisible ?
|
||||
<ScreenIcon />
|
||||
|
|
@ -172,14 +172,14 @@ const ListPeer = (props) =>
|
|||
id : 'tooltip.muteParticipant',
|
||||
defaultMessage : 'Mute participant'
|
||||
})}
|
||||
color={ micEnabled ? 'primary' : 'secondary'}
|
||||
disabled={ peer.peerAudioInProgress }
|
||||
color={micEnabled ? 'primary' : 'secondary'}
|
||||
disabled={peer.peerAudioInProgress}
|
||||
onClick={() =>
|
||||
{
|
||||
micEnabled ?
|
||||
roomClient.modifyPeerConsumer(peer.id, 'mic', true) :
|
||||
roomClient.modifyPeerConsumer(peer.id, 'mic', false);
|
||||
}}
|
||||
{
|
||||
micEnabled ?
|
||||
roomClient.modifyPeerConsumer(peer.id, 'mic', true) :
|
||||
roomClient.modifyPeerConsumer(peer.id, 'mic', false);
|
||||
}}
|
||||
>
|
||||
{ micEnabled ?
|
||||
<MicIcon />
|
||||
|
|
@ -193,11 +193,11 @@ const ListPeer = (props) =>
|
|||
id : 'tooltip.kickParticipant',
|
||||
defaultMessage : 'Kick out participant'
|
||||
})}
|
||||
disabled={ peer.peerKickInProgress }
|
||||
disabled={peer.peerKickInProgress}
|
||||
onClick={() =>
|
||||
{
|
||||
roomClient.kickPeer(peer.id);
|
||||
}}
|
||||
{
|
||||
roomClient.kickPeer(peer.id);
|
||||
}}
|
||||
>
|
||||
<ExitIcon />
|
||||
</IconButton>
|
||||
|
|
|
|||
|
|
@ -287,28 +287,28 @@ class Filmstrip extends React.PureComponent
|
|||
}
|
||||
|
||||
Filmstrip.propTypes = {
|
||||
roomClient : PropTypes.any.isRequired,
|
||||
activeSpeakerId : PropTypes.string,
|
||||
advancedMode : PropTypes.bool,
|
||||
peers : PropTypes.object.isRequired,
|
||||
consumers : PropTypes.object.isRequired,
|
||||
myId : PropTypes.string.isRequired,
|
||||
selectedPeerId : PropTypes.string,
|
||||
spotlights : PropTypes.array.isRequired,
|
||||
boxes : PropTypes.number,
|
||||
classes : PropTypes.object.isRequired
|
||||
roomClient : PropTypes.any.isRequired,
|
||||
activeSpeakerId : PropTypes.string,
|
||||
advancedMode : PropTypes.bool,
|
||||
peers : PropTypes.object.isRequired,
|
||||
consumers : PropTypes.object.isRequired,
|
||||
myId : PropTypes.string.isRequired,
|
||||
selectedPeerId : PropTypes.string,
|
||||
spotlights : PropTypes.array.isRequired,
|
||||
boxes : PropTypes.number,
|
||||
classes : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) =>
|
||||
{
|
||||
return {
|
||||
activeSpeakerId : state.room.activeSpeakerId,
|
||||
selectedPeerId : state.room.selectedPeerId,
|
||||
peers : state.peers,
|
||||
consumers : state.consumers,
|
||||
myId : state.me.id,
|
||||
spotlights : state.room.spotlights,
|
||||
boxes : videoBoxesSelector(state)
|
||||
activeSpeakerId : state.room.activeSpeakerId,
|
||||
selectedPeerId : state.room.selectedPeerId,
|
||||
peers : state.peers,
|
||||
consumers : state.consumers,
|
||||
myId : state.me.id,
|
||||
spotlights : state.room.spotlights,
|
||||
boxes : videoBoxesSelector(state)
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -159,13 +159,13 @@ class Room extends React.PureComponent
|
|||
<CookieConsent
|
||||
buttonText={
|
||||
<FormattedMessage
|
||||
id = 'room.consentUnderstand'
|
||||
defaultMessage = 'I understand'
|
||||
id='room.consentUnderstand'
|
||||
defaultMessage='I understand'
|
||||
/>
|
||||
}
|
||||
>
|
||||
<FormattedMessage
|
||||
id = 'room.cookieConsent'
|
||||
id='room.cookieConsent'
|
||||
defaultMessage='This website uses cookies to enhance the user experience'
|
||||
/>
|
||||
</CookieConsent>
|
||||
|
|
|
|||
|
|
@ -353,15 +353,15 @@ const Settings = ({
|
|||
|
||||
Settings.propTypes =
|
||||
{
|
||||
roomClient : PropTypes.any.isRequired,
|
||||
me : appPropTypes.Me.isRequired,
|
||||
room : appPropTypes.Room.isRequired,
|
||||
settings : PropTypes.object.isRequired,
|
||||
onToggleAdvancedMode : PropTypes.func.isRequired,
|
||||
roomClient : PropTypes.any.isRequired,
|
||||
me : appPropTypes.Me.isRequired,
|
||||
room : appPropTypes.Room.isRequired,
|
||||
settings : PropTypes.object.isRequired,
|
||||
onToggleAdvancedMode : PropTypes.func.isRequired,
|
||||
onTogglePermanentTopBar : PropTypes.func.isRequired,
|
||||
handleChangeMode : PropTypes.func.isRequired,
|
||||
handleCloseSettings : PropTypes.func.isRequired,
|
||||
classes : PropTypes.object.isRequired
|
||||
handleChangeMode : PropTypes.func.isRequired,
|
||||
handleCloseSettings : PropTypes.func.isRequired,
|
||||
classes : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
const mapStateToProps = (state) =>
|
||||
|
|
@ -374,10 +374,10 @@ const mapStateToProps = (state) =>
|
|||
};
|
||||
|
||||
const mapDispatchToProps = {
|
||||
onToggleAdvancedMode : settingsActions.toggleAdvancedMode,
|
||||
onToggleAdvancedMode : settingsActions.toggleAdvancedMode,
|
||||
onTogglePermanentTopBar : settingsActions.togglePermanentTopBar,
|
||||
handleChangeMode : roomActions.setDisplayMode,
|
||||
handleCloseSettings : roomActions.setSettingsOpen
|
||||
handleChangeMode : roomActions.setDisplayMode,
|
||||
handleCloseSettings : roomActions.setSettingsOpen
|
||||
};
|
||||
|
||||
export default withRoomContext(connect(
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ FullScreenView.propTypes =
|
|||
consumer : appPropTypes.Consumer,
|
||||
toggleConsumerFullscreen : PropTypes.func.isRequired,
|
||||
toolbarsVisible : PropTypes.bool,
|
||||
permanentTopBar : PropTypes.bool,
|
||||
permanentTopBar : PropTypes.bool,
|
||||
classes : PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ const mapStateToProps = (state) =>
|
|||
({
|
||||
consumer : state.consumers[state.room.fullScreenConsumer],
|
||||
toolbarsVisible : state.room.toolbarsVisible,
|
||||
permanentTopBar : state.settings.permanentTopBar
|
||||
permanentTopBar : state.settings.permanentTopBar
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ const initialState =
|
|||
advancedMode : false,
|
||||
resolution : 'medium', // low, medium, high, veryhigh, ultra
|
||||
lastN : 4,
|
||||
permanentTopBar : true
|
||||
permanentTopBar : true
|
||||
};
|
||||
|
||||
const settings = (state = initialState, action) =>
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "登录",
|
||||
"tooltip.logout": "注销",
|
||||
|
|
|
|||
|
|
@ -48,6 +48,12 @@
|
|||
"room.spotlights": "Aktivní Účastníci",
|
||||
"room.passive": "Pasivní Účastníci",
|
||||
"room.videoPaused": "Toto video bylo pozastaveno",
|
||||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Přihlášení",
|
||||
"tooltip.logout": "Odhlášení",
|
||||
|
|
|
|||
|
|
@ -52,8 +52,11 @@
|
|||
"room.muteAll": "Alle stummschalten",
|
||||
"room.stopAllVideo": "Alle Videos stoppen",
|
||||
"room.closeMeeting": "Meeting schließen",
|
||||
"room.speechUnsupported": "Dein Browser unterstützt keine Spracherkennung",
|
||||
|
||||
"tooltip.login": "Anmelden",
|
||||
"me.mutedPTT": "Du bist stummgeschalted, Halte die SPACE-Taste um zu sprechen",
|
||||
|
||||
"tooltip.login": "Anmelden",
|
||||
"tooltip.logout": "Abmelden",
|
||||
"tooltip.admitFromLobby": "Teilnehmer reinlassen",
|
||||
"tooltip.lockRoom": "Raum abschließen",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Log ind",
|
||||
"tooltip.logout": "Log ud",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Σύνδεση",
|
||||
"tooltip.logout": "Αποσύνδεση",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": "Mute all",
|
||||
"room.stopAllVideo": "Stop all video",
|
||||
"room.closeMeeting": "Close meeting",
|
||||
"room.speechUnsupported": "Your browser does not support speech recognition",
|
||||
|
||||
"me.mutedPTT": "You are muted, hold down SPACE-BAR to talk",
|
||||
|
||||
"tooltip.login": "Log in",
|
||||
"tooltip.logout": "Log out",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Entrar",
|
||||
"tooltip.logout": "Salir",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Connexion",
|
||||
"tooltip.logout": "Déconnexion",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Prijava",
|
||||
"tooltip.logout": "Odjava",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Belépés",
|
||||
"tooltip.logout": "Kilépés",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@
|
|||
"room.spotlights": "Partecipanti in Evidenza",
|
||||
"room.passive": "Participanti Passivi",
|
||||
"room.videoPaused": "Il video è in pausa",
|
||||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Log in",
|
||||
"tooltip.logout": "Log out",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": "Demp alle",
|
||||
"room.stopAllVideo": "Stopp all video",
|
||||
"room.closeMeeting": "Avslutt møte",
|
||||
"room.speechUnsupported": "Din nettleser støtter ikke stemmegjenkjenning",
|
||||
|
||||
"me.mutedPTT": "Du er dempet, hold nede SPACE for å snakke",
|
||||
|
||||
"tooltip.login": "Logg in",
|
||||
"tooltip.logout": "Logg ut",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Zaloguj",
|
||||
"tooltip.logout": "Wyloguj",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Entrar",
|
||||
"tooltip.logout": "Sair",
|
||||
|
|
|
|||
|
|
@ -52,6 +52,9 @@
|
|||
"room.muteAll": null,
|
||||
"room.stopAllVideo": null,
|
||||
"room.closeMeeting": null,
|
||||
"room.speechUnsupported": null,
|
||||
|
||||
"me.mutedPTT": null,
|
||||
|
||||
"tooltip.login": "Intră în cont",
|
||||
"tooltip.logout": "Deconectare",
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ module.exports =
|
|||
// listeningRedirectPort disabled
|
||||
// use case: loadbalancer backend
|
||||
httpOnly : false,
|
||||
// WebServer/Express trust proxy config for httpOnly mode
|
||||
// You can find more info:
|
||||
// - https://expressjs.com/en/guide/behind-proxies.html
|
||||
// - https://www.npmjs.com/package/proxy-addr
|
||||
// use case: loadbalancer backend
|
||||
trustProxy : '',
|
||||
// This function will be called on successful login through oidc.
|
||||
// Use this function to map your oidc userinfo to the Peer object.
|
||||
// The roomId is equal to the room name.
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class Lobby extends EventEmitter
|
|||
// Close the peers.
|
||||
for (const peer in this._peers)
|
||||
{
|
||||
if (!peer.closed)
|
||||
peer.close();
|
||||
if (!this._peers[peer].closed)
|
||||
this._peers[peer].close();
|
||||
}
|
||||
|
||||
this._peers = null;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ const EventEmitter = require('events').EventEmitter;
|
|||
const axios = require('axios');
|
||||
const Logger = require('./Logger');
|
||||
const Lobby = require('./Lobby');
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
const jwt = require('jsonwebtoken');
|
||||
const userRoles = require('../userRoles');
|
||||
const config = require('../config/config');
|
||||
|
||||
|
|
@ -46,6 +48,8 @@ class Room extends EventEmitter
|
|||
super();
|
||||
this.setMaxListeners(Infinity);
|
||||
|
||||
this._uuid = uuidv4();
|
||||
|
||||
// Room ID.
|
||||
this._roomId = roomId;
|
||||
|
||||
|
|
@ -107,8 +111,8 @@ class Room extends EventEmitter
|
|||
// Close the peers.
|
||||
for (const peer in this._peers)
|
||||
{
|
||||
if (!peer.closed)
|
||||
peer.close();
|
||||
if (!this._peers[peer].closed)
|
||||
this._peers[peer].close();
|
||||
}
|
||||
|
||||
this._peers = null;
|
||||
|
|
@ -120,22 +124,41 @@ class Room extends EventEmitter
|
|||
this.emit('close');
|
||||
}
|
||||
|
||||
handlePeer(peer)
|
||||
verifyPeer({ id, token })
|
||||
{
|
||||
logger.info('handlePeer() [peer:"%s", roles:"%s"]', peer.id, peer.roles);
|
||||
try
|
||||
{
|
||||
const decoded = jwt.verify(token, this._uuid);
|
||||
|
||||
// Allow reconnections, remove old peer
|
||||
logger.info('verifyPeer() [decoded:"%o"]', decoded);
|
||||
|
||||
return decoded.id === id;
|
||||
}
|
||||
catch (err)
|
||||
{
|
||||
logger.warn('verifyPeer() | invalid token');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
handlePeer({ peer, returning })
|
||||
{
|
||||
logger.info('handlePeer() [peer:"%s", roles:"%s", returning:"%s"]', peer.id, peer.roles, returning);
|
||||
|
||||
// Should not happen
|
||||
if (this._peers[peer.id])
|
||||
{
|
||||
logger.warn(
|
||||
'handleConnection() | there is already a peer with same peerId [peer:"%s"]',
|
||||
peer.id);
|
||||
|
||||
this._peers[peer.id].close();
|
||||
}
|
||||
|
||||
// Returning user
|
||||
if (returning)
|
||||
this._peerJoining(peer, true);
|
||||
// Always let ADMIN in, even if locked
|
||||
if (peer.roles.includes(userRoles.ADMIN))
|
||||
else if (peer.roles.includes(userRoles.ADMIN))
|
||||
this._peerJoining(peer);
|
||||
else if (this._locked)
|
||||
this._parkPeer(peer);
|
||||
|
|
@ -332,7 +355,7 @@ class Room extends EventEmitter
|
|||
}
|
||||
}
|
||||
|
||||
async _peerJoining(peer)
|
||||
async _peerJoining(peer, returning = false)
|
||||
{
|
||||
peer.socket.join(this._roomId);
|
||||
|
||||
|
|
@ -343,45 +366,58 @@ class Room extends EventEmitter
|
|||
|
||||
this._handlePeer(peer);
|
||||
|
||||
let turnServers;
|
||||
|
||||
if ('turnAPIURI' in config)
|
||||
if (returning)
|
||||
{
|
||||
try
|
||||
{
|
||||
const { data } = await axios.get(
|
||||
config.turnAPIURI,
|
||||
{
|
||||
params : {
|
||||
'uri_schema' : 'turn',
|
||||
'transport' : 'tcp',
|
||||
'ip_ver' : 'ipv4',
|
||||
'servercount' : '2',
|
||||
'api_key' : config.turnAPIKey,
|
||||
'ip' : peer.socket.request.connection.remoteAddress
|
||||
}
|
||||
});
|
||||
|
||||
turnServers = [ {
|
||||
urls : data.uris,
|
||||
username : data.username,
|
||||
credential : data.password
|
||||
} ];
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
if ('backupTurnServers' in config)
|
||||
turnServers = config.backupTurnServers;
|
||||
|
||||
logger.error('_peerJoining() | error on REST turn [error:"%o"]', error);
|
||||
}
|
||||
this._notification(peer.socket, 'roomBack');
|
||||
}
|
||||
else if ('backupTurnServers' in config)
|
||||
else
|
||||
{
|
||||
turnServers = config.backupTurnServers;
|
||||
}
|
||||
const token = jwt.sign({ id: peer.id }, this._uuid, { noTimestamp: true });
|
||||
|
||||
this._notification(peer.socket, 'roomReady', { turnServers });
|
||||
peer.socket.handshake.session.token = token;
|
||||
|
||||
peer.socket.handshake.session.save();
|
||||
|
||||
let turnServers;
|
||||
|
||||
if ('turnAPIURI' in config)
|
||||
{
|
||||
try
|
||||
{
|
||||
const { data } = await axios.get(
|
||||
config.turnAPIURI,
|
||||
{
|
||||
params : {
|
||||
'uri_schema' : 'turn',
|
||||
'transport' : 'tcp',
|
||||
'ip_ver' : 'ipv4',
|
||||
'servercount' : '2',
|
||||
'api_key' : config.turnAPIKey,
|
||||
'ip' : peer.socket.request.connection.remoteAddress
|
||||
}
|
||||
});
|
||||
|
||||
turnServers = [ {
|
||||
urls : data.uris,
|
||||
username : data.username,
|
||||
credential : data.password
|
||||
} ];
|
||||
}
|
||||
catch (error)
|
||||
{
|
||||
if ('backupTurnServers' in config)
|
||||
turnServers = config.backupTurnServers;
|
||||
|
||||
logger.error('_peerJoining() | error on REST turn [error:"%o"]', error);
|
||||
}
|
||||
}
|
||||
else if ('backupTurnServers' in config)
|
||||
{
|
||||
turnServers = config.backupTurnServers;
|
||||
}
|
||||
|
||||
this._notification(peer.socket, 'roomReady', { turnServers });
|
||||
}
|
||||
}
|
||||
|
||||
_handlePeer(peer)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
"express-socket.io-session": "^1.3.5",
|
||||
"helmet": "^3.21.2",
|
||||
"ims-lti": "^3.0.2",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"mediasoup": "^3.5.5",
|
||||
"openid-client": "^3.7.3",
|
||||
"passport": "^0.4.0",
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
"pidusage": "^2.0.17",
|
||||
"redis": "^2.8.0",
|
||||
"socket.io": "^2.3.0",
|
||||
"spdy": "^4.0.1"
|
||||
"spdy": "^4.0.1",
|
||||
"uuid": "^7.0.2"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,6 +100,10 @@ const session = expressSession({
|
|||
}
|
||||
});
|
||||
|
||||
if (config.trustProxy) {
|
||||
app.set('trust proxy', config.trustProxy);
|
||||
}
|
||||
|
||||
app.use(session);
|
||||
|
||||
passport.serializeUser((user, done) =>
|
||||
|
|
@ -464,8 +468,28 @@ async function runWebSocketServer()
|
|||
|
||||
queue.push(async () =>
|
||||
{
|
||||
const { token } = socket.handshake.session;
|
||||
|
||||
const room = await getOrCreateRoom({ roomId });
|
||||
const peer = new Peer({ id: peerId, roomId, socket });
|
||||
|
||||
let peer = peers.get(peerId);
|
||||
let returning = false;
|
||||
|
||||
if (peer && !token)
|
||||
{ // Don't allow hijacking sessions
|
||||
socket.disconnect(true);
|
||||
|
||||
return;
|
||||
}
|
||||
else if (token && room.verifyPeer({ id: peerId, token }))
|
||||
{ // Returning user, remove if old peer exists
|
||||
if (peer)
|
||||
peer.close();
|
||||
|
||||
returning = true;
|
||||
}
|
||||
|
||||
peer = new Peer({ id: peerId, roomId, socket });
|
||||
|
||||
peers.set(peerId, peer);
|
||||
|
||||
|
|
@ -495,7 +519,7 @@ async function runWebSocketServer()
|
|||
}
|
||||
}
|
||||
|
||||
room.handlePeer(peer);
|
||||
room.handlePeer({ peer, returning });
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue