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

Add ondevicechange event support to demo #1689

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

markafoltz
Copy link
Contributor

@markafoltz markafoltz commented Dec 11, 2024

Demo does not use devicechange event to keep device selectors in sync with hotplug. This fixes the demo to do that.

It also fixes some other issues:

  • The demo now works if only a camera or mic is available (but not both)
  • The demo waits for enumeration to complete before calling gUM. Previously, this would result in a failed request.

console.log will be removed before merging.

@markafoltz
Copy link
Contributor Author

This should be ready for review. Who can take a look? @handellm @henbos @fippo

@fippo
Copy link
Collaborator

fippo commented Dec 17, 2024

Nice! eslint --fix should be able to deal with the lint failures

@fippo
Copy link
Collaborator

fippo commented Dec 17, 2024

(maybe reduce the console.log amount but... I like console.log)

@handellm
Copy link
Contributor

I tried the patched demo, with repository checked out and python3 -m http.server serving the files and navigating to localhost. Things started out not working, probably there was something strange about permissions. After accepting cam & mike permissions things jumped to life and worked well.

+1 on fixing lint failures otherwise lgtm.

Copy link
Contributor

@guidou guidou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % the automated comments (var -> let/const and spaces)

@markafoltz
Copy link
Contributor Author

eslint --fix should be able to deal with the lint failures

This seems broken for me:

$ eslint --fix main.js

Oops! Something went wrong! :(

ESLint: 6.4.0.

ESLint couldn't find the config "google" to extend from. Please check that the name of the config is correct.

The config "google" was referenced from the config file in "/home/mfoltz/github/markafoltz/webrtc-samples/.eslintrc.js".

I will fix manually instead.

@markafoltz
Copy link
Contributor Author

Things started out not working, probably there was something strange about permissions.

Yeah. If you call enumerateDevices() without permissions it returns dummy values with empty deviceIds, but the demo would populate the dropdowns anyway.

I updated it to avoid populating the dropdowns with dummy values, so permission is requested right away and then the dropdowns can get the true values.

@markafoltz
Copy link
Contributor Author

Okay, this should be ready for another look and a merge if there are no more comments.

@fippo
Copy link
Collaborator

fippo commented Dec 18, 2024

(something weird with webdriver these days, needs investigation)

@fippo fippo merged commit 86ba3f1 into webrtc:gh-pages Dec 18, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants