Started work on settings dialog. Possible to switch camera.

This commit is contained in:
Håvar Aambø Fosstveit
2018-06-15 14:58:01 +02:00
parent 668fa0f37f
commit 7e1b391fe1
18 changed files with 651 additions and 70 deletions
+8
View File
@@ -9,6 +9,7 @@ const initialState =
canShareScreen : false,
needExtension : false,
canChangeWebcam : false,
webcamDevices : null,
webcamInProgress : false,
screenShareInProgress : false,
audioOnly : false,
@@ -50,6 +51,13 @@ const me = (state = initialState, action) =>
return { ...state, canChangeWebcam };
}
case 'SET_WEBCAM_DEVICES':
{
const devices = action.payload;
return { ...state, webcamDevices: devices };
}
case 'SET_WEBCAM_IN_PROGRESS':
{
const { flag } = action.payload;
+9 -1
View File
@@ -4,7 +4,8 @@ const initialState =
state : 'new', // new/connecting/connected/disconnected/closed,
activeSpeakerName : null,
peerHeight : 300,
peerWidth : 400
peerWidth : 400,
showSettings : false
};
const room = (state = initialState, action) =>
@@ -42,6 +43,13 @@ const room = (state = initialState, action) =>
return { ...state, peerWidth: peerWidth, peerHeight: peerHeight };
}
case 'TOGGLE_SETTINGS':
{
const showSettings = !state.showSettings;
return { ...state, showSettings };
}
default:
return state;
}
+3 -2
View File
@@ -57,10 +57,11 @@ export const disableWebcam = () =>
};
};
export const changeWebcam = () =>
export const changeWebcam = (deviceId) =>
{
return {
type : 'CHANGE_WEBCAM'
type : 'CHANGE_WEBCAM',
payload : { deviceId }
};
};
+3 -1
View File
@@ -83,7 +83,9 @@ export default ({ dispatch, getState }) => (next) =>
case 'CHANGE_WEBCAM':
{
client.changeWebcam();
const { deviceId } = action.payload;
client.changeWebcam(deviceId);
break;
}
+15
View File
@@ -62,6 +62,14 @@ export const setCanChangeWebcam = (flag) =>
};
};
export const setWebcamDevices = (devices) =>
{
return {
type : 'SET_WEBCAM_DEVICES',
payload : devices
};
};
export const setDisplayName = (displayName) =>
{
return {
@@ -110,6 +118,13 @@ export const setMyRaiseHandState = (flag) =>
};
};
export const toggleSettings = () =>
{
return {
type : 'TOGGLE_SETTINGS'
};
};
export const setMyRaiseHandStateInProgress = (flag) =>
{
return {