Added support for setting audio input device, not working on linux at the moment. Updated webcam selection.

This commit is contained in:
Håvar Aambø Fosstveit
2018-06-15 23:19:26 +02:00
parent 7e1b391fe1
commit fcb15e706d
8 changed files with 278 additions and 47 deletions
+25 -1
View File
@@ -8,9 +8,12 @@ const initialState =
canSendWebcam : false,
canShareScreen : false,
needExtension : false,
canChangeAudioDevice : false,
audioDevices : null,
canChangeWebcam : false,
webcamDevices : null,
webcamInProgress : false,
audioInProgress : false,
screenShareInProgress : false,
audioOnly : false,
audioOnlyInProgress : false,
@@ -44,6 +47,20 @@ const me = (state = initialState, action) =>
return { ...state, canShareScreen, needExtension };
}
case 'SET_CAN_CHANGE_AUDIO_DEVICE':
{
const canChangeAudioDevice = action.payload;
return { ...state, canChangeAudioDevice };
}
case 'SET_AUDIO_DEVICES':
{
const { devices } = action.payload;
return { ...state, audioDevices: devices };
}
case 'SET_CAN_CHANGE_WEBCAM':
{
const canChangeWebcam = action.payload;
@@ -53,11 +70,18 @@ const me = (state = initialState, action) =>
case 'SET_WEBCAM_DEVICES':
{
const devices = action.payload;
const { devices } = action.payload;
return { ...state, webcamDevices: devices };
}
case 'SET_AUDIO_IN_PROGRESS':
{
const { flag } = action.payload;
return { ...state, audioInProgress: flag };
}
case 'SET_WEBCAM_IN_PROGRESS':
{
const { flag } = action.payload;
+8
View File
@@ -65,6 +65,14 @@ export const changeWebcam = (deviceId) =>
};
};
export const changeAudioDevice = (deviceId) =>
{
return {
type : 'CHANGE_AUDIO_DEVICE',
payload : { deviceId }
};
};
export const enableAudioOnly = () =>
{
return {
+9
View File
@@ -90,6 +90,15 @@ export default ({ dispatch, getState }) => (next) =>
break;
}
case 'CHANGE_AUDIO_DEVICE':
{
const { deviceId } = action.payload;
client.changeAudioDevice(deviceId);
break;
}
case 'ENABLE_AUDIO_ONLY':
{
client.enableAudioOnly();
+25 -1
View File
@@ -54,6 +54,22 @@ export const setScreenCapabilities = ({ canShareScreen, needExtension }) =>
};
};
export const setCanChangeAudioDevice = (flag) =>
{
return {
type : 'SET_CAN_CHANGE_AUDIO_DEVICE',
payload : flag
};
};
export const setAudioDevices = (devices) =>
{
return {
type : 'SET_AUDIO_DEVICES',
payload : { devices }
};
};
export const setCanChangeWebcam = (flag) =>
{
return {
@@ -66,7 +82,7 @@ export const setWebcamDevices = (devices) =>
{
return {
type : 'SET_WEBCAM_DEVICES',
payload : devices
payload : { devices }
};
};
@@ -189,6 +205,14 @@ export const setProducerTrack = (producerId, track) =>
};
};
export const setAudioInProgress = (flag) =>
{
return {
type : 'SET_AUDIO_IN_PROGRESS',
payload : { flag }
};
};
export const setWebcamInProgress = (flag) =>
{
return {