diff --git a/app/config.example.js b/app/config.example.js index 7734362..89c9d58 100644 --- a/app/config.example.js +++ b/app/config.example.js @@ -1,4 +1,19 @@ module.exports = { - chromeExtension : 'https://chrome.google.com/webstore/detail/fckajcjdaabdgnbdcmhhebdglogjfodi' + chromeExtension : 'https://chrome.google.com/webstore/detail/fckajcjdaabdgnbdcmhhebdglogjfodi', + loginEnabled : false, + turnServers : [ + { + urls : [ + 'turn:example.com:443?transport=tcp' + ], + username : 'example', + credential : 'example' + } + ], + requestTimeout : 10000, + transportOptions : + { + tcp : true + } }; diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index d41fdc0..93ac56a 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -6,16 +6,19 @@ import { getProtooUrl } from './urlFactory'; import * as cookiesManager from './cookiesManager'; import * as requestActions from './redux/requestActions'; import * as stateActions from './redux/stateActions'; +import { + turnServers, + requestTimeout, + transportOptions +} from '../config'; const logger = new Logger('RoomClient'); const ROOM_OPTIONS = { - requestTimeout : 10000, - transportOptions : - { - tcp : true - } + requestTimeout : requestTimeout, + transportOptions : transportOptions, + turnServers : turnServers }; const VIDEO_CONSTRAINS = diff --git a/app/lib/components/Room.jsx b/app/lib/components/Room.jsx index 64349e3..032e1ef 100644 --- a/app/lib/components/Room.jsx +++ b/app/lib/components/Room.jsx @@ -152,14 +152,17 @@ class Room extends React.Component }} /> -
onLogin()} - /> + {me.loginEnabled ? +
onLogin()} + /> + :null + }
{ case 'SET_ME': { - const { peerName, displayName, displayNameSet, device } = action.payload; + const { + peerName, + displayName, + displayNameSet, + device, + loginEnabled + } = action.payload; - return { ...state, name: peerName, displayName, displayNameSet, device }; + return { + ...state, + name : peerName, + displayName, + displayNameSet, + device, + loginEnabled + }; } case 'SET_MEDIA_CAPABILITIES': diff --git a/app/lib/redux/stateActions.js b/app/lib/redux/stateActions.js index 86adba5..8748bf3 100644 --- a/app/lib/redux/stateActions.js +++ b/app/lib/redux/stateActions.js @@ -22,11 +22,11 @@ export const setRoomActiveSpeaker = (peerName) => }; }; -export const setMe = ({ peerName, displayName, displayNameSet, device }) => +export const setMe = ({ peerName, displayName, displayNameSet, device, loginEnabled }) => { return { type : 'SET_ME', - payload : { peerName, displayName, displayNameSet, device } + payload : { peerName, displayName, displayNameSet, device, loginEnabled } }; };