Skip to content
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

fix(WEBRTC-746): recursive call to getDevices when the browser does not support audiooutput like Safari and Firefox. #223

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

DeividVeloso
Copy link
Contributor

@DeividVeloso DeividVeloso commented Dec 7, 2021

the recursive call to getDevices when the browser does not support audio output like Safari and Firefox.

The issue was happening when the browser does not support audio output and
it returns a device list with an empty array when the code received an empty device list it was trying to call getUserMedia and getDevices to fulfilled with data,
but as the browser does not support audio output it was executing the getDevices method in an infinite loop.

To solve it I removed the recursion of getDevice method and now I'm checking first if the user gave permission to list devices, if yes I return a list of devices with all the data fulfilled else I trigger an error and I return an empty array without any device.

📝 To Do

  • All linters pass
  • All tests pass
  • Change documentation based on my changes

✋ Manual testing

  1. Provide manual testing instructions

🦊 Browser testing

Desktop

  • Edge (latest)
  • Chrome
  • Firefox
  • Safari

📸 Screenshots

Description Screenshot
Desktop
usage.gif

…udiooutput like Safari and Firefox.

The issue was happening when the browser does not support audiooutput and
it returns device list with empty array when the code received empty device list it was trying to call getUserMedia and getDevices to fullfiled with data,
but as the browser does not support it was executing the getDevices method in infinite loop.

To solve it we will only execute getDevices in recursion if the device list has data with label and deviceid empty.
This means that the browser supports audiooutput but the user does not allowed the permission to access devices yet.
@DeividVeloso DeividVeloso requested a review from arghav December 7, 2021 20:36
@arghav arghav requested a review from muriware December 8, 2021 16:18
@DeividVeloso DeividVeloso changed the title fix(WEBRTC-746): recursive call to getDevices when the browser does not support audiooutput like Safari and Firefox. WIP-->fix(WEBRTC-746): recursive call to getDevices when the browser does not support audiooutput like Safari and Firefox. Dec 8, 2021
@DeividVeloso DeividVeloso force-pushed the WEBRTC-746-recursive-getDevices branch from 4d125fe to 9128fb6 Compare December 8, 2021 17:11
@DeividVeloso DeividVeloso changed the title WIP-->fix(WEBRTC-746): recursive call to getDevices when the browser does not support audiooutput like Safari and Firefox. fix(WEBRTC-746): recursive call to getDevices when the browser does not support audiooutput like Safari and Firefox. Dec 8, 2021
@DeividVeloso DeividVeloso removed the WIP label Dec 8, 2021
@DeividVeloso DeividVeloso force-pushed the WEBRTC-746-recursive-getDevices branch from 9128fb6 to 71c2c01 Compare December 8, 2021 17:24
@DeividVeloso DeividVeloso force-pushed the WEBRTC-746-recursive-getDevices branch from 71c2c01 to 451b906 Compare December 8, 2021 17:24
@DeividVeloso DeividVeloso merged commit bbc2231 into main Dec 8, 2021
@DeividVeloso DeividVeloso deleted the WEBRTC-746-recursive-getDevices branch December 8, 2021 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants