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

Frontend is unable to access mediaDevices #3466

Open
whiteboxsolutions opened this issue May 8, 2024 · 2 comments
Open

Frontend is unable to access mediaDevices #3466

whiteboxsolutions opened this issue May 8, 2024 · 2 comments
Labels
Bug Something isn't working

Comments

@whiteboxsolutions
Copy link

Description

Frontend javascript is unable to access mediaDevices via window.navigator.mediaDevices. Running the enumerateDevices() method returns a promise which fulfills with an empty list.

This issue is intermittent, and can't seem to be reproduced on my machine in either dev, debug nor release builds. It happens on end user machines randomly

To Reproduce

Intermittently:

  1. Compile demo application as a debug release
  2. Run binary on non-developer machine
  3. Open dev tools
  4. Run window.navigator.mediaDevices.enumerateDevices() in dev console

Expected behaviour

enumerateDevices() method returns a promise which when fulfilled provides a list of video and audio devices and their IDs.

Screenshots

No response

Attempted Fixes

Restarting the application seems to fix things most of the time.

System Details

DEB | Using go webview2loader
Wails CLI v2.5.1

 SUCCESS  Done.

# System

OS           | Windows 10 Pro     
Version      | 2009 (Build: 19045)
ID           | 22H2
Go Version   | go1.20.4
Platform     | windows
Architecture | amd64

# Wails

Version | v2.5.1

# Dependencies

Dependency | Package Name | Status    | Version
WebView2   | N/A          | Installed | 124.0.2478.80
Nodejs     | N/A          | Installed | 20.5.0
npm        | N/A          | Installed | 9.8.0
*upx       | N/A          | Installed | upx 4.0.2
*nsis      | N/A          | Installed | v3.09
* - Optional Dependency

# Diagnosis

Your system is ready for Wails development!

Additional context

No response

@whiteboxsolutions whiteboxsolutions added the Bug Something isn't working label May 8, 2024
@leaanthony
Copy link
Member

Thanks for opening. I suspect it's a webview2 version issue. Is it possible to the version they have installed? You should be able to get it from navigator.userAgent

@whiteboxsolutions
Copy link
Author

Checked that - user's useragent matches my dev machines:

'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'

It's weird that it's intermittent - I'm wondering if it could be a windows defender sandboxing issue or something.

The application is being run as administrator as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants