-
Notifications
You must be signed in to change notification settings - Fork 440
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
feat(MediaSettings): preferred media devices selection 🎤📹 #11936
Conversation
7a64764
to
5456dae
Compare
Tested on Google chrome and brave, my Bluetooth headset is detected with event listener. |
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.
Logic is almost correctly implemented, nice work!
5456dae
to
fd435b2
Compare
Current state to test (step by step)
|
f7d04df
to
a18fdcc
Compare
- event listener tracks only change of physical devices (USB-connected) - allow to get in the list such inputs as bluetooth, mini-jack, virtual devices Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
a18fdcc
to
2a87eff
Compare
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.
Just awesome 🔥
Tested with @Antreesy with plugging in-out USB devices.
Not tested yet with Bluetooth devices and virtual devices / enabling/disabling devices in the system
// eslint-disable-next-line no-console | ||
console.log(`Media devices: | ||
Audio input: | ||
${audioInputList.map(getDeviceString).join('\n')} | ||
|
||
Video input: | ||
${videoInputList.map(getDeviceString).join('\n')} | ||
`) |
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 not forget to remove the debug log :P
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.
That's needed to list devices in the console (so user can pass some information to admin, e.g)
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.
Then it should not be log
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
…lable Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
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.
scenario ( devices A (bluetooth headset), B (virtual mic), C(external mic)):
- [A+B] select A in presence of B
- [B] unplug A , B was automatically selected
- [B+C] plug C and use it
- [A+B+C] plug A, A was automatically selected
@@ -200,14 +212,14 @@ MediaDevicesManager.prototype = { | |||
// Couldn't find device by id | |||
console.debug('Could not find previous audio device, falling back to default/first device in the list', BrowserStorage.getItem('audioInputId'), this.attributes.devices) | |||
} | |||
this.attributes.audioInputId = this._fallbackAudioInputId | |||
this.attributes.audioInputId = getFirstAvailableMediaDevice(devices, this._preferenceAudioInputList, this._fallbackAudioInputId) ?? 'default' |
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.
this._fallbackAudioInputId
can be omitted given that we have the list now, but let's do it next time.
/backport to stable29 |
☑️ Resolves
Tip
Use
to get list in the console
🖌️ UI Checklist
🖼️ Screenshots / Screencasts
Screencast.from.11.04.2024.15.18.10.webm
🚧 Tasks
🏁 Checklist