-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FCE-457: Allow user to only initialise audio or video #245
FCE-457: Allow user to only initialise audio or video #245
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some cosmetic changes, the api lgtm
const constraints = { | ||
video: enableVideo ? videoManager.getConstraints() : false, | ||
audio: enableAudio ? audioManager.getConstraints() : false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
const constraints = { | |
video: enableVideo ? videoManager.getConstraints() : false, | |
audio: enableAudio ? audioManager.getConstraints() : false, | |
}; | |
const constraints = { | |
video: enableVideo && videoManager.getConstraints(), | |
audio: enableAudio && audioManager.getConstraints(), | |
}; |
let [stream, deviceErrors] = await getAvailableMedia({ | ||
video: enableVideo ? prepareConstraints(previousDevices.video?.deviceId, constraints.video) : false, | ||
audio: enableAudio ? prepareConstraints(previousDevices.audio?.deviceId, constraints.audio) : false, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
let [stream, deviceErrors] = await getAvailableMedia({ | |
video: enableVideo ? prepareConstraints(previousDevices.video?.deviceId, constraints.video) : false, | |
audio: enableAudio ? prepareConstraints(previousDevices.audio?.deviceId, constraints.audio) : false, | |
}); | |
let [stream, deviceErrors] = await getAvailableMedia({ | |
video: enableVideo && prepareConstraints(previousDevices.video?.deviceId, constraints.video), | |
audio: enableAudio && prepareConstraints(previousDevices.audio?.deviceId, constraints.audio), | |
}); |
async (params?: UseInitializeDevicesParams) => { | ||
const { enableVideo = true, enableAudio = true } = params || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick:
async (params?: UseInitializeDevicesParams) => { | |
const { enableVideo = true, enableAudio = true } = params || {}; | |
async (params: UseInitializeDevicesParams = { enableVideo = true, enableAudio = true }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean it like that?
async ({ enableVideo = true, enableAudio = true }: UseInitializeDevicesParams = {}) =>
The above solution won't work 🤔
Description
Motivation and Context
Types of changes
not work as expected)