element-call icon indicating copy to clipboard operation
element-call copied to clipboard

Show the device that's actually in use

Open dbkr opened this issue 2 years ago • 8 comments

Feeds the current track (if any), and therefore device it's using into the device selection dropdown and implement a some somewhat complex logic to observe when the 'default' device has changed to a different actual devbice between when we opened it and now, and display the device we're actually using as selected instead.

The comments should explain more, including the caveat that we can't do the same detective work if the device is one of several devices on the same bit of hardware. This is because is uses the same groupId comparison technique used by Livekit in normalizeDeviceId to do a smiliar thing.

Fixes https://github.com/vector-im/element-call/issues/1646

dbkr avatar Oct 02 '23 16:10 dbkr

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (3e0bc8a) 29.94% compared to head (aff01d0) 29.94%. Report is 10 commits behind head on livekit.

Additional details and impacted files
@@           Coverage Diff            @@
##           livekit    #1670   +/-   ##
========================================
  Coverage    29.94%   29.94%           
========================================
  Files           47       47           
  Lines         1877     1877           
  Branches       328      328           
========================================
  Hits           562      562           
  Misses        1274     1274           
  Partials        41       41           
Flag Coverage Δ
unittests 29.94% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 02 '23 16:10 codecov-commenter

Thinking about this topic does livekit already check if the order of the devices changes on firefox?

A Promise that is fulfilled with an array of MediaDeviceInfo objects. Each object in the array describes one of the available media input and output devices. The order is significant — the default capture devices will be listed first.

I am wondering if the ux would be much less broken with the following approach:

  • we have a checkbox: os default settings
  • if it is checked we only show what device we get as the first device of enumerateDevices and we react to order changes and update the media device accordnigly. (on chrome we always use id="default" and update using the groupId or label trick)
  • if it is unchecked a dropdown selector will appear to choose the device. We then NEVER use "default" as the device id and never react on os cahnges and instead only react to changes in the dropdown.

toger5 avatar Oct 05 '23 15:10 toger5

I am wondering if the other PR does obsolete this? Yes - hopefully :) Although the plan basically was to make sure the dropdown always shows the truth first, then implement the device switching, so even if the device switching doesn't work for whatever reason, it still shows the truth.

I am wondering if this PR in combination with the other one would lead to the following behaviour [...]

It will switch back to device a when you change the default device in the OS a -> b -> a (I tested). The group ID of the default device should change just the same in either case.

I am wondering if the ux would be much less broken with the following approach: [...]

Possibly! Do you think we should pause this and wait for product / design input?

dbkr avatar Oct 05 '23 17:10 dbkr

It will switch back to device a when you change the default device in the OS a -> b -> a (I tested). The group ID of the default device should change just the same in either case.

Then I have a thinko, just to confirm, you tested with both PR's being merged at the same.

toger5 avatar Oct 06 '23 09:10 toger5

Yes - hopefully :) Although the plan basically was to make sure the dropdown always shows the truth first, then implement the device switching, so even if the device switching doesn't work for whatever reason, it still shows the truth.

Considering this,

Possibly! Do you think we should pause this and wait for product / design input?

I think pushing this to the next release and asking design is a good idea.

toger5 avatar Oct 06 '23 09:10 toger5

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 06 '24 08:09 CLAassistant

Making draft as this is stale.

hughns avatar Nov 06 '24 11:11 hughns

@robintown Does this fix sth that is still broken in v0.13.0? I am not sure what we do with default devices as of now?

toger5 avatar Jun 26 '25 10:06 toger5