Various lint and fixes

auto_join_3.3
Håvar Aambø Fosstveit 2020-04-22 10:26:58 +02:00
parent 66b513cf19
commit 0ed9d4db9b
7 changed files with 30 additions and 24 deletions

View File

@ -51,10 +51,10 @@ export const setAudioDevices = (devices) =>
}); });
export const setAudioOutputDevices = (devices) => export const setAudioOutputDevices = (devices) =>
({ ({
type : 'SET_AUDIO_OUTPUT_DEVICES', type : 'SET_AUDIO_OUTPUT_DEVICES',
payload : { devices } payload : { devices }
}); });
export const setWebcamDevices = (devices) => export const setWebcamDevices = (devices) =>
({ ({
@ -75,10 +75,10 @@ export const setAudioInProgress = (flag) =>
}); });
export const setAudioOutputInProgress = (flag) => export const setAudioOutputInProgress = (flag) =>
({ ({
type : 'SET_AUDIO_OUTPUT_IN_PROGRESS', type : 'SET_AUDIO_OUTPUT_IN_PROGRESS',
payload : { flag } payload : { flag }
}); });
export const setWebcamInProgress = (flag) => export const setWebcamInProgress = (flag) =>
({ ({

View File

@ -5,10 +5,10 @@ export const setSelectedAudioDevice = (deviceId) =>
}); });
export const setSelectedAudioOutputDevice = (deviceId) => export const setSelectedAudioOutputDevice = (deviceId) =>
({ ({
type : 'CHANGE_AUDIO_OUTPUT_DEVICE', type : 'CHANGE_AUDIO_OUTPUT_DEVICE',
payload : { deviceId } payload : { deviceId }
}); });
export const setSelectedWebcamDevice = (deviceId) => export const setSelectedWebcamDevice = (deviceId) =>
({ ({

View File

@ -32,7 +32,8 @@ const AudioPeers = (props) =>
AudioPeers.propTypes = AudioPeers.propTypes =
{ {
micConsumers : PropTypes.array micConsumers : PropTypes.array,
audioOutputDevice : PropTypes.string
}; };
const mapStateToProps = (state) => const mapStateToProps = (state) =>

View File

@ -63,8 +63,9 @@ export default class PeerAudio extends React.PureComponent
} }
} }
_setOutputDevice(audioOutputDevice){ _setOutputDevice(audioOutputDevice)
if(this._audioOutputDevice === audioOutputDevice) {
if (this._audioOutputDevice === audioOutputDevice)
return; return;
this._audioOutputDevice = audioOutputDevice; this._audioOutputDevice = audioOutputDevice;
@ -72,13 +73,12 @@ export default class PeerAudio extends React.PureComponent
const { audio } = this.refs; const { audio } = this.refs;
if (audioOutputDevice && typeof audio.setSinkId === 'function') if (audioOutputDevice && typeof audio.setSinkId === 'function')
{
audio.setSinkId(audioOutputDevice); audio.setSinkId(audioOutputDevice);
} }
}
} }
PeerAudio.propTypes = PeerAudio.propTypes =
{ {
audioTrack : PropTypes.any audioTrack : PropTypes.any,
audioOutputDevice : PropTypes.string
}; };

View File

@ -254,7 +254,12 @@ const Settings = ({
{ audioOutputDevices.map((audioOutput, index) => { audioOutputDevices.map((audioOutput, index) =>
{ {
return ( return (
<MenuItem key={index} value={audioOutput.deviceId}>{audioOutput.label}</MenuItem> <MenuItem
key={index}
value={audioOutput.deviceId}
>
{audioOutput.label}
</MenuItem>
); );
})} })}
</Select> </Select>